/* in zgamepost.php,zgameint.php,ztournapost.php */
function addFavoritesGamestop(checkgameid,addremove,loginreqd)
{
if(loginreqd == 0)
	{
	
populate_httpdiv(WWW_SERVER_URL+'/favgames.php?gid='+checkgameid+'&mode='+addremove,'addremovefavgamelinktop',2);
	}

	else
	{
	document.getElementById("addremovefavgamelinktop").innerHTML = '<div class="gp_tabdiv2"><a href="'+SECURE_SERVER_URL+'/zlogin.php?explicit=1&redirect='+red_url+'">Click here to Sign in</a></div>' 
	
	}
}
/* in zgamepost.php,zgameint.php,ztournapost.php */ 

function showfavgamesection() //for zgameint,zgamepost,ztournapost pages
{
populate_httpdiv(WWW_SERVER_URL+'/favouritebygid.php?gid='+gid,'addremovefavgamelinktop',2);
}

/**********/			/////////
var scrw='100%';
var scrh='100%';
function playinfullscreen(theurl,noscore)
{
	if((noscore=='NO'))
	{
		 MM_openBrWindow(WWW_SERVER_URL+'/loginpopup.php?explicit=1&redirect='+escape(theurl),'gameplay','width=' + scrw + ',height=' + scrh + ',top=0, left=0,scrollbars=yes,resizable=yes');
	}
	else
	{
		 var mywin = window.open (theurl, "mywindow","location=0,status=0,scrollbars=1, width=" + scrw + ",height=" + scrh + "");
		 mywin.moveTo(0,0);
	}
} 

function goLogin() // used in zgameplay.php, zgamepopcap.php,zhighscore.php, atournaplay.php
{
fullURL = window.location.href;
urlArray = fullURL.split(".com/");
window.location = WWW_SERVER_URL+'/loginpopup.php?explicit=1&redirecturl='+escape('/'+urlArray[1]);
}

function showLogoDiv1(hidediv,showdiv) //used in zgameplay, zgamepopcap, ztournaplay
{
	timeout = setTimeout("exitad_game('"+hidediv+"','"+showdiv+"')", 20*1000);
}

/*****************************/
var scrw=screen.width; //////////////
var scrh=screen.height;// 
function popupthis1(theurl) // used in zgameplay, zgamepopcap, ztournaplay
{
	var bname = navigator.appName;
	if (bname == 'Netscape')
	{ 
		scrh1 = scrh - Math.ceil((scrh * 15)/100);
		scrw1 = scrw - Math.floor((scrh * 4)/100);
	}
	else
	{
		var scrh1 = scrh - Math.ceil((scrh * 20)/100);
		var scrw1 = scrw - Math.floor((scrh * 7)/100);
	} 
	var mywin = window.open (theurl + "&width=" + scrw1 + "&height=" + scrh1, "mywindow","location=0,status=0,scrollbars=1, width=" + scrw + ",height=" + scrh + "");
	mywin.moveTo(0,0);
	window.parent.close();
}

/********************* page move function for index page starts**********/
	function page_index_move(url)
			{
				
				populate_httpdiv(url,'gamesection',2);
			} 	
/********************* page move function for index page end**********/			