
    function SetImageSize(img)
    {
    	var obj;
    	obj = document.getElementById(img);
    	
        if (obj.width > obj.height)
        {
            obj.width = 40;
        }
        else
        {
            obj.height = 40;
        }
        return false;
    }
    
    function popRPdata(hidID,e)
    {
    
    var popDiv = document.getElementById("fly_rp_pop");
    
    var hidInput = document.getElementById(hidID);
    var data = Array()
    
    data = hidInput.value.split("%#%");
    
    var imageURL, sku, features, condition, price;
    
    sku = data[0];
    price = data[1];
    condition = data[2];
    imageURL = data[3];
    features = data[4];
    
    var image = document.getElementById('fly_rp_pop_image');
    var ConditionDiv = document.getElementById('fly_rp_pop_condition');
    var skuDiv = document.getElementById('fly_rp_pop_sku');
    var priceDiv = document.getElementById('fly_rp_pop_price');
    var featuresDiv = document.getElementById('fly_rp_pop_features');
    
    image.src = imageURL;
    ConditionDiv.innerHTML = condition;
    skuDiv.innerHTML = sku;
    priceDiv.innerHTML = price;
    featuresDiv.innerHTML = features;
        
    popDiv.style.display = "block";
    //alert(e.pageY);
    
    var ie=document.all;
    var ns6=document.getElementById && !document.all;
    var curY;
    var winheight;
    var winwidth;
    var leftedge;
    var rightedge;
    var bottomedge;
    var topedge;
    var offsetfromcursorX=10;
    var offsetfromcursorY=20;

    var offsetdivfrompointerX=54;
    var offsetdivfrompointerY=0;

    curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop-20;
    
    winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight;
	winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20;

	leftedge=ie&&!window.opera? event.clientX-offsetfromcursorX : e.clientX-offsetfromcursorX;
	rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX;
	
	bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY;
	topedge=ie&&!window.opera? event.clientY+offsetfromcursorY : e.clientY+offsetfromcursorY;
	
		var tiptop=0
		
		var testpos=false;
		
		var tippos=(curY+offsetfromcursorY-(popDiv.offsetHeight/3))
		
		if ((tippos>=curY-topedge-1) && (tippos+popDiv.offsetHeight-10<=curY+bottomedge))
		{testpos=true;}
		else
		{
			tippos=(curY+offsetfromcursorY-(popDiv.offsetHeight/2))
			if ((tippos>=curY-topedge-1) && (tippos+popDiv.offsetHeight-10<=curY+bottomedge))
			{testpos=true;}
			else
			{
				tippos=(curY+offsetfromcursorY-(popDiv.offsetHeight*2/4))
				if ((tippos>=curY-topedge-1) && (tippos+popDiv.offsetHeight-10<=curY+bottomedge))
				{testpos=true;}
			}
		
		}
		
		if (testpos)
		{
			popDiv.style.top=tippos+"px"
			tiptop=tippos
		}
		else
		{
			if (topedge<popDiv.offsetHeight-25)
			{
				popDiv.style.top=curY-topedge+"px"
				tiptop=curY-topedge
			}
			else
			{
				if (bottomedge<popDiv.offsetHeight-10)
				{
					popDiv.style.top=curY+bottomedge-popDiv.offsetHeight+"px"
					tiptop=curY+bottomedge-popDiv.offsetHeight
					nondefaultYpos=true
				}
				else
				{
					tippos=(curY+offsetfromcursorY-(popDiv.offsetHeight/3))
					popDiv.style.top=tippos+"px"
					tiptop=tippos
					nondefaultYpos=true
				}
			}
		}
		
    }
 
 function ietruebody()
{
	
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
   
function hidePopUp()
{
    var popDiv = document.getElementById("fly_rp_pop");
    popDiv.style.display = "none";
}