// JavaScript Document
var serverPath = "http://kf.hq88.com";

var siteDomino = "www.hq88.com";//location.hostname
var imagePath = serverPath + "/web/images/public/serviceMiss_right.gif";		
var linkPath = serverPath + "/web/pages/guest/siterequest.html?method=sendRequest&siteDomino="+ siteDomino;

function openmuAd() 
{
	 var width=600;
 	 var height=490-38;		
	 var left = ( screen.width - width ) / 2;
	 var top = ( screen.height - height ) / 2-20;
	 var func = "";
	 func += 'width='+width+',height='+height;
	 func += ', top='+top;
	 func += ',left='+left;
	 func += ', outerWidth=0';
	 func += ', outerHeight=0';
	 func += ', directories=0';
	 func += ', toolbar=no';
	 func += ', menubar=no';
	 func += ', scrollbars=no';
	 func += ', resizable=no';
	 func += ', location=no';
	 func += ', status=no';
	 window.open(linkPath,"dialog",func);
}

function initEcAd() 
{
	document.getElementById("AdLayer").style.posTop = -200;
	document.getElementById("AdLayer").style.visibility = 'visible'
	MoveRightLayer('AdLayer');
}


function MoveRightLayer(layerName)
{
	var x = (document.documentElement.offsetWidth ? document.documentElement.offsetWidth : document.body.offsetWidth )-145;
	var y = (( document.documentElement.offsetHeight ? document.documentElement.offsetHeight : document.body.offsetHeight )-document.getElementById(layerName).clientHeight)/2;	// å³ä¾§å¹¿åè·ç¦»é¡µé¦é«åº¦
	var diff_y = (( document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + y - document.getElementById(layerName).style.posTop)*.90;
	var diff_x = (( document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) + x - document.getElementById(layerName).style.posLeft)*.40;
	var y = ( document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + y - diff_y;
	var x = ( document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) + x - diff_x;
	document.getElementById(layerName).style.top = y;
	document.getElementById(layerName).style.left = x;
	setTimeout("MoveRightLayer('"+layerName+"');", 30);
}

function adclose(){
	document.getElementById("AdLayer").style.display="none";
}
function admouseOver(obj){
	obj.style.color="red";
}
function admouseOut(obj){
	obj.style.color="#333333";
}
document.write("<div id=AdLayer style='position: absolute;visibility:hidden;z-index:1;cursor:hand; height:120px; width:120px;'><img src='"+ imagePath +"' border='0' onclick='openmuAd()'><br><div style='height:20px; line-height:20px; text-align:center; width:120px; background:#f6f6f6; color:#333333' onclick='adclose()' onmouseover='admouseOver(this)' onmouseout='admouseOut(this)'>关闭</div></div>")
initEcAd()