//shared global vars
_jhtml = new Array();


//Global vars
_aLoaded = true;
_sp = new Array();
_spop = new Array();
_spL = null;
_wlc = String(window.location);
_futuredate = new Date(Date.parse("Jan 1, 2999"));

_aGn = new String(navigator.userAgent);
_aGn = _aGn.toLowerCase();
_deskL = screen.width;
_deskT = screen.height;

_hsT = location.host;
_hsP = location.pathname;
_hspro = location.protocol;
_BASE = _hspro+"//"+_hsT+"/";
ali = null;



//document.getElementById('top_menu').innerHTML = '<li><a title="Chess Games" href="./chess/">CHESS GAMES</a></li><li><a title="Checkers Games" href="./checkers/">CHECKERS GAMES</a></li><li><a title="Parcheesi Games" href="./parcheesi/">PARCHEESI GAMES</a></li><li><a title="Car Games" href="./car-games/">CAR RACING GAMES</a></li><li><a title="Billiards Games" href="./billiard/">BILLIARDS GAMES</a></li>';

document.getElementById('copyright').innerHTML = '<div style="padding:8px">Copyright &copy; 2006-2010</div>';


function play(GAME, W, H)
{
//W=W+200;
	var now = new Date();
	var mm = now.valueOf();	
	
	if(GAME=="chess")
	{
	//W = W + 100;
	}
	//else if(GAME=="8ball")
	//{
	H = H + 40;
	//}
	//
	
	
	var ITFOLDER = 'http://www.alilg.com/p/gameplay.php?W='+W+'&&H='+H+'&&game='+GAME+'&&aid=8&mx='+mm+'';
	var _newin = window.open(ITFOLDER,GAME, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=no,resizable=no,top=100px,left=100px,scrollable=no,location=no,addressbar=no");
}


function alilg(ITEM,H,W,ID,aid,URL)
{


//	  if(ITEM=='chesssuper')
//	  {
//		  var newpopwin = window.open("http://alilgplay.com","alilgplaychess");
//		  if(!newpopwin)
//		  {
//			  alert("The Chess Game window popup box blocked by your popup clock blocker, please turn it off and try again!")
//		  }
//		  return;
//	  }
	  
	  
	  var RS = 200;
	  if(H<600)
	  {
	//	H = 600;
	  }
	  
	  W = W + 5;
	  H = H + 5;
			  var L = (_deskL-W)/2;
			  var T = (_deskT-H)/4;
			  T = T - 30;
			  
	  if(ITEM=='chesssuper' || ITEM=='chess2')
	  {
	  
	  
	  
	  
	  
	  //ITFOLDER = "/gameplay.php?aid="+aid;
	  
		  var now = new Date();
	  ITFOLDER = "/p/play.php?w="+W+"&h="+H+"&url=http://www.alilg.com/"+"gameplay.php_q_aid="+aid+"_a_mx="+now.valueOf();
				  
	  
	  if(ITEM=='chesssuper')
	  {
	  W = W + 400;
	  RS = 400;
	  //ITFOLDER = "/p/gameplay.php?aid="+aid+"&&mx="+now.valueOf();
	  }
	  
	  ITEM='chesssuper';
	  //H = H + 130;
	  
	  var L = (_deskL-W)/2;
	  var T = (_deskT-H)/4;
	  T = T - 30;	
	  
	  
	  //		ITFOLDER = "/gameplay.php?aid="+aid+"&&mx="+now.valueOf();
	  
	  var _newin = window.open(ITFOLDER,ITEM, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=no,resizable=no,top="+T+"px,left="+L+"px,scrollable=no,location=no,addressbar=no");
			  }
	  else if(ITEM!=='alimagic')
	  {
	  //ITFOLDER = "/p/play.php?w="+W+"&h="+H+"&url=http://www.alilg.com/"+ITEM+"/_q_ID=_a_aid="+aid;
	  
	  
	  //W = W + 200;
	  
	  
	  if( W < 1400)
	  {
	  //W = W + 200;
	 // RS = 400;
	  }
	  
	  //H = H + 130;
	  
	  var L = (_deskL-W)/2;
	  var T = (_deskT-H)/4;
	  T = T - 30;
	  
				  ITFOLDER = "/"+ITEM+"/?ID=&&aid="+aid;
	  var _newin = window.open(ITFOLDER,ITEM, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=no,resizable=no,top="+T+"px,left="+L+"px,scrollable=no,location=no,addressbar=no");


	  //var _newin = window.open(ITFOLDER,ITEM, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=no,resizable=no,top="+T+"px,left="+L+"px,scrollable=no,location=no,addressbar=no");
	  }
			  else
			  {
	  
				  ITFOLDER = "/"+ITEM+"/?ID=&&aid="+aid;
	  var _newin = window.open(ITFOLDER,ITEM, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=no,resizable=no,top="+T+"px,left="+L+"px,scrollable=no,location=no,addressbar=no");
			  }
	  
	  
	  
	  
			  
			  if(!_newin)
			  {
				  alert("The Chess Game window popup box blocked by your popup clock blocker, please turn it off and try again!")
			  }
			  else
			  {
				  //_newin.window.focus()
			  }
}
	
