
/*
	COMMON JS FILE FOR ALL WEB SITES

*/

	/*
		GENERAL POPUP WITH DEFAULT FEATURES
	*/	
	function generalpop(url) {		
		
		
		// if there is a pipe found in the url string - use the string after the comma as the window features
		var a = url.split("|");
		if(a.length > 1)
			{
			wn = window.open(a[0], a[1], a[2]);
			}
		else
			{
			wn = window.open(url, "genpop", "height=600,width=600,top=5,left=5,resizable,scrollbars");
			}
		try{wn.focus()}catch(e){};
	}

/*
	LOAD A FLASH MOVIE USING THE SWF OBJECT
*/
function flashMovie(loadMovie,movieWidth,movieHeight,bgColour)
	{
	var strTransparent = "";
	var strBackground = "";
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + movieWidth + '" height="' + movieHeight + '">');
	document.write('<param name="movie" value="' + loadMovie + '">');
	document.write('<param name="quality" value="high">');
	if(bgColour){
		if(bgColour == 'transparent'){
			document.write('<param name="wmode" value="transparent">');
			strTransparent = 'wmode="transparent" ';
		}else{
			document.write('<param name="bgcolor" value="' + bgColour + '">');
			strBackground = 'bgcolor="' + bgColour + '" ';
		}
	}
	document.write('<embed src="' + loadMovie + '" ' + strBackground + strTransparent + '"quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + movieWidth + '" height="' + movieHeight + '"></embed>');
	document.write('</object>');
	}
	


function SetDateOffset(dateOffset){
	document.mainForm.date.value = dateOffset;
	document.mainForm.pageID.value = 0;
}
function SetPageIndex(pageIndex){
	document.mainForm.pageID.value = pageIndex;
}
/*
	SUBMIT THE FORM

*/	
function go(theAction,bShowWait,sendToPage)
	{
	if(document.mainForm)
		{
		if(sendToPage)
			document.mainForm.action = sendToPage;

		if(bShowWait){
		    document.images["imgSubmit"].style.display = "none";
			document.images["imgWait"].style.display = "";
			}
	
	  document.mainForm.form_action.value = theAction;
	  document.mainForm.submit();
		}
	}
	

function goTop(theAction,bShowWait,sendToPage)
	{
		
	if(document.topForm)
		{				
		if(sendToPage)
			document.topForm.action = sendToPage;

		if(bShowWait){
			if(document.images["imgSubmit"])
				document.images["imgSubmit"].style.display = "none";
			if(document.images["imgWait"])
				document.images["imgWait"].style.display = "";
			}
	
		document.topForm.form_action.value = theAction;
		document.topForm.submit();
		}
	}
	
	
	
function play(iRoom,loc,dl) {
	var bGameOpen = false;
	//debugger
	loc = "http://managers.st-minver.com/affiliates/tracker?affTrackCode=19973";	
//	if(dl) loc += "?DL=" + dl + "&cachebuster=" + (Math.random()+'');
//	else   loc += "?cache=" + (Math.random()+'');
	
	

	// check if game window already open
	try
		{
		var oTest = playWin.document;
		if (oTest != null)	bGameOpen = true;
		}
	catch(ee)
		{
		bGameOpen = false;
		}

	if (!bGameOpen)
		{
			h=(screen.height*.9)-54
			w=(screen.width*.9)

			if (navigator.appName.indexOf("Microsoft") != -1) 
			{
			document.location = loc;
//				playWin = window.open(loc, "playWin", "height="+h+",width="+w+",top=1,left=1,resizable");
			}
			else 
			{
			document.location = loc;
//				playWin = window.open(loc, "playWin", "height="+screen.height-2+",width="+screen.width-2+",screenY=1,screenX=1,resizable");
		}
		//playWin.focus();
	}
  else
	{
		//playWin.focus();
	}
}


function goCashierForm() {
	if(!(document.CashierForm.cid.value>0))
		{
		alert("Please log in, or register an account with us first.")
		return;		
		}
	if (navigator.appName.indexOf("Microsoft") != -1) {
	  wb = window.open("", "AquaPayCashier", "height=576,width=700,top=100,left=100");
	} else {
	  wb = window.open("", "AquaPayCashier", "height=576,width=700,screenY=100,screenX=100");
	}
	document.CashierForm.submit();
}

	
/*
	MACROMEDIA FUNCTIONS
*/	

<!--//		MACROMEDIA																																																								   -->
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

<!--//																																																										   -->
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

<!--//																																																										   -->
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

<!--//																																																										   -->
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


<!--//																																																										   -->
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function OpenBingoTutorial(sr)
{
    var filename = "http://info.thejoyofbingo.com/temp/888/bingo_howto.php?prod=888&sr=" + sr;
    var w = 640;
    var h =480;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    window.open(filename,null, "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resize=no,left="+l+",top="+t);
}
function OpeneCogra()
  {
   var w = 520;
   var h = 520;
   var l = (window.screen.width-w)/2;
   var t = (window.screen.height-h)/2;
   window.open("http://www.888.com/new888/lang/en/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
  }
  
   function BI(gameID,gameName,provider,width,height) {		
	
		if(document.CashierForm.sid.value == ""){
			alert("Please log in to the site first");
			window.location = "/skin/members.php";
			return;
		}
						
		var gameURL;
		switch(provider){
		case "electro":
			gameURL="http://instants.gib.ccsaint.net/cgi-bin/pmib.fcg?act=stonestart&uid=USERID&guid=SESSIONID&dest=/spg/flash/GAMENAME&nid=NETWORK&gid=GAMEID&vid=1&cur=CURRENCY";
			break;
		case "kaave":
			gameURL="https://www.abgu.com/games/mac/en/mgames.jsp?from=stone&uid=USERID&guid=SESSIONID&gameid=GAMENAME&nid=NETWORK&gid=GAMEID&vid=2&cur=CURRENCY";
			break;
		case "supa":
			gameURL="https://play.secureinstantgaming.com/maroon/servlet/MaroonAPI?uid=USERID&gameid=GAMENAME&guid=SESSIONID&brand=sto&nid=NETWORK&gid=GAMEID&vid=3&cur=CURRENCY";
			break;
		}
		
		gameURL = gameURL.replace("USERID",document.CashierForm.cid.value);
		gameURL = gameURL.replace("SESSIONID",document.CashierForm.sid.value);
		gameURL = gameURL.replace("GAMENAME",gameName);
		gameURL = gameURL.replace("CURRENCY",document.CashierForm.playerCurrency.value);
		gameURL = gameURL.replace("NETWORK",document.CashierForm.network.value);
		gameURL = gameURL.replace("GAMEID",gameID);
		var sh = screen.height / 2 - 250;				
		biWH = "width=" + width + ",height=" + height + ",top="+sh+",left=150";
		wn = window.open(gameURL,'igw','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,'+biWH);
		try{wn.focus()}
		catch(e){}			
	}