// JavaScript Document
/*function doPlay(pid){
	getEl("confirmpopup").style.display="block";
	  
}
function doPopupContinue(){
	location.href="post_login.htm";
}
function doPopupCancel(){
	getEl("confirmpopup").style.display="none";
}
*/
var popupMargin;
function calculatePopupMargins(){
	var b = getSrollValue();
	var a = getPopupOffset(600,250);
	popupMargin = 	(100+parseInt(b.y)) + "px 0px 0px " + (a.fromLeft) +"px;";
	//popupMargin = 	(a.fromTop+parseInt(b.y)) + "px 0px 0px " + (a.fromLeft) +"px;";
	//alert(popupMargin);
}

function getSrollValue(){
	var isIE  = document.all?true:false;
	var isNS4 = document.layers?true:false;
	var isNS6 = !isNS4&&!isIE&&document.getElementById?true:false;	
	if(isIE){
		//var  y=document.body.scrollTop;
		var  y=document.documentElement.scrollTop;		
		var  x=document.body.scrollLeft; 
	}
	if(isNS4||isNS6){
		var y=window.pageYOffset;
		var x=window.pageXOffset;	
	}
	//alert("sTop:" + y +"sLeft: " + x);
	return {x:x , y:y}
}

function getPopupOffset(poph,popw){
	var winW = 0;
	var winH = 0;
	/*
	in Netscape Navigator: subtract 16 from the width and height 
	in Microsoft Internet Explorer: subtract 20 from the width and height 
	*/
	if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  winW = window.innerWidth;
		  winH = window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = document.body.offsetWidth;
		 // winH = document.documentElement.clientHeight;
		  winH = document.body.offsetHeight;
		 }
	}
	w=parseInt(poph);
	h=parseInt(popw);
	if (window.screen){
		var x = ((parseInt(winW) - w - 10) / 2);
		var y = ((parseInt(winH) - h - 30) / 2);
  	}
	return {fromLeft:x , fromTop:y}
}

/* Capture Enter Event for Popup */

N=(navigator.appName == "Netscape")?1:0;
document.onkeypress=captureEvent;
function captureEvent(e) {
  if(N){
  	w = e.which;
    if (w == 13) {
		response = doPopupSubmit();
	}
	else return;
	}	
  if(!N){
  	if (window.event){ w = window.event.keyCode; 
		if (w == 13)response = doPopupSubmit();
		else return;
	}
 }
return response;
}

function doPopupSubmit(){
	if(getEl("confirmpopup").style.display=='block'){
		doPopupContinue();
	}
	if(getEl("login").style.display=='block'){
		return true;
	}	
	return false;
}