﻿function livechat(param)
{
	try
	{Main("LiveChat");}
	catch(err)
	{;}
	var url = "http://livechat.g4p.com/clientlogin.html"+param; 
	var targetName = 'chat_'+(new Date()).getTime();			
	document.getElementById("aClientLogin").target = targetName
	document.getElementById("aClientLogin").href = url;
	//alert(url);
	window.open(''+url+'',''+targetName+'','height=485,width=366,location=no,menubar=no,resizable=yes,scrollbars=no,status=yes,titlebar=no,toolbar=no,directories=no');
}
function OpenSpecial()
{
	var bgDiv=document.createElement("div");
	bgDiv.id="fullbg";
	bgDiv.className="fullwinbg";
	bgDiv.style.width=document.body.scrollWidth+"px";
	var scrollHeight=document.body.scrollHeight+20;
	bgDiv.style.height=scrollHeight+"px";
	bgDiv.innerHTML="<iframe frameborder=\"0\" scrolling=\"no\" src=\"about:blank\" style=\"background-color:#FFFFFF;width:"+document.body.scrollWidth+"px;height:"+scrollHeight+"px;\"></iframe>";
	document.body.appendChild(bgDiv);
	
	var deliverywin=document.createElement("div");
	deliverywin.id="deliverywin";
	deliverywin.className="deliverywindoweu";
	deliverywin.innerHTML="<iframe id=\"deliveryiframe\" frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"../AwardRollRecords/index.html" + "\" style=\" width:1100px; height:1150px;\"></iframe>";
/*	var mouse=mouseCoords(document.getElementById("Table13"));
	var x=mouse.x+217;
	var y=mouse.y+130;
	deliverywin.style.left=x+"px";
	deliverywin.style.top=y+"px";*/
	document.body.appendChild(deliverywin);
	centerwh(deliverywin);
}
function centerwh(obj)
{
    var h1 = document.body.clientHeight;
    var h2 = document.documentElement.clientHeight;
    var isXhtml = (h2<=h1&&h2!=0)?true:false;
    var body = isXhtml?document.documentElement:document.body;
   
    var wh={left:0,top:0};
    var vwh={w:0,h:0};
    vwh.w=navigator.userAgent.indexOf('MSIE') >= 0?parseInt(body.clientWidth):parseInt(window.innerWidth);
    vwh.h=navigator.userAgent.indexOf('MSIE') >= 0?parseInt(body.clientHeight):parseInt(window.innerHeight);
    wh.left=(vwh.w/2)-parseInt(obj.offsetWidth)/2;
    //wh.top=body.scrollTop+(vwh.h/2)-parseInt($(obj).css("height"))/2 + 290;
	//wh.top=112;
	obj.style.top = wh.top + "px";
	obj.style.left = wh.left + "px";
    //$(obj).css("top",wh.top);
    //$(obj).css("left",wh.left);
}
function windowclose()
{
	if(document.getElementById("fullbg"))
	{
		document.body.removeChild(document.getElementById("fullbg"));
	}
	if(document.getElementById("deliverywin"))
	{
		document.body.removeChild(document.getElementById("deliverywin"));
	}
}