var timer1, timer2;
var seal;
var seal_old="";
function on_mouse_over_seal(x, y)
{
	if(document.getElementById("seal_div")!=null)
	{
	    if(seal_old==seal) return;
	    else 	closediv();
	}
    
	seal_old=seal;
	
	html='<table border=0 cellspacing=0 cellpadding=0><tr><td align=right>';
	html+='<input type=image src="/images/close.jpg"';
	html+=' onclick="document.body.removeChild(document.getElementById(\'seal_div\'));">';
	html+='</td></tr>';
	html+='<tr><td>';

	if(seal=="CIPA")
	{
		html+="<a href=\"javascript:oWin('700','500','https://www.ciparx.ca/seal/seals.php?id=139' );\">";
		html+="<img src='https://www.ciparx.ca/seal/webseal.php?id=139' border=0></a>";

		html+='</td></tr></table>';
		creatediv(html,100,80,x,y); 
	}
	else if(seal=="PharmacyChecker")
	{
		html+="<a href='#' onclick=\"javascript: window.open('http://www.pharmacychecker.com/ProfileRx.asp?PCID=7A8A21C3-65CA-4799-B360-9DC70A452ED0','pc','scrollbars=1,toolbar=1,menubar=1,address=1,status=1,resizable=1,width=440, height=' + screen.height * .70 + \'');\">";
		html+="<img src='http://www.pharmacychecker.com/seals/7A8A21C3-65CA-4799-B360-9DC70A452ED0.jpg' width='246' border=0></a>";
	
		html+='</td></tr></table>';
		creatediv(html,250,160,x,y); 
	}
	else if(seal=="GeoTrust")
	{
		html+="<SCRIPT language='JavaScript' src='https://smarticon.geotrust.com/si.js' type='text/javascript'></SCRIPT>";
		html+="</td></tr></table>";
		creatediv(html,120,100,x,y); 
	}
}

function creatediv(html, width, height, left, top) 
{ 
   var newdiv = document.createElement('div');
   
   newdiv.setAttribute('id', 'seal_div');
   newdiv.className="viewbox";
   
   newdiv.onmouseover=po;
   newdiv.onmouseout=pu;

   newdiv.style.position = "absolute";
   newdiv.style.width = width;
   newdiv.style.height = height;
   newdiv.style.left = left;
   newdiv.style.top = top;
   
   newdiv.style.background = "#FFFFFF";
   newdiv.style.border = "1px solid #000";
   
   document.body.appendChild(newdiv);

   newdiv.innerHTML = html;
} 

function closediv()
{
	div=document.getElementById('seal_div');
	if(div!=undefined && div!=null)
	{
		document.body.removeChild(div);
	}
}

function po()
{
	clearTimeout(timer2);
}

function pu()
{
	timer2=setTimeout(function(){closediv();clearTimeout(timer2);},2000);
}

function oWin(w,h,url) 
{
	specs="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistor=no,width=" + w + ",height=" + h;
	var imgWin = window.open(url,"windowname",specs);
}