<!--
var now = new Date();

	var w_id = "LadbrokesGamesHome_";

	w_id += now.getYear();
	w_id += now.getDate();
	w_id += now.getMonth();
	w_id += now.getHours();
	w_id += now.getMinutes();
	w_id += now.getSeconds();

	self.window.name = w_id;


function launchfromdropdown(game) {
	if (game.value > "0") {
		launchgame(game.value, "false");
	}
	document.atoz.games.selectedIndex = 0;
}

function moregame () {
	document.genrepage.submit();
}

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 open_oxigame(skip, game) {
		try {
			var retURL_g = document.location.href;
		} catch(err) {

		}
		if (retURL_g.indexOf("?") == -1) {
			retURL_g = retURL_g + "?noportal=1&game="+game;
		} else {
			retURL_g = retURL_g + "&noportal=1&game="+game;
		}
		var retURL_g = encode_url(retURL_g);

		var login_url = encode_url2(url_base_ssl + "?action=go_splash&w_id=" + w_id + "&retURL_g=" + retURL_g);

		ggoptions = "skip="+skip;	
		thetoken = getcookie("LIL_Login");
		ggoptions = "skip="+skip+"&token="+thetoken+"&login_url="+login_url;

		switch (game) {
			case "9":
				if(skip == "true"){
					url = url_9+"game.jsp?"+ggoptions;
				}else{
					url = url_9+"menu.jsp?"+ggoptions;
				}
				break;
			case "penaltyshootout":
				url = url_penaltyshootout+"penaltyShooter.jsp?"+ggoptions;
				break;
		}
	}

	function launchgame(game,state,type,product){
	//fix to redirect bingo and backgammon to thier respective sites.
	if ((game==37 || game==60 || game==78 || game==103) && product != 'BNG' )
	{window.location.href ="http://bingo.ladbrokes.com"; return;}
		switch(game){
			case "1":
        		width = "565";
				height = "480";
				break;
			case "2":
        		width = "735";
				height = "550";
				break;
			case "9":
        		width = "700";
				height = "440";
				break;
			case "19":
        		width = "740";
				height = "520";
				break;
			case "24":
        		width = "692";
				height = "550";
				break;
			case "27":
        		width = "740";
				height = "440";
				break;
			case "28":
        		width = "700";
				height = "440";
				break;
			case "42":
        		width = "802";
				height = "582";
				break;
			case "147":
				width = "786";
				height = "505";
				break;
			default:
        		width = "750";
				height = "550";
		}
		var ret_url = encode_url(document.location.href);
		
		options = "resizable=1,scrollbars=0,menubar=0,status=1,width="+width+",height="+height;
		url = "http://games.ladbrokes.com/gr/gamelaunch/gamewin?gameID="+game+"&langversion=gr&state=real&site=ext";
		//alert (ret_url);
		//url = "/gr/gamewin?product="+product+"&winname="+w_id+"&game="+game+"&state="+state+"&ret_url="+ret_url;
		//alert (url);
		if (type) {
			url = url+"&type="+type;
		}
		
		if (state == "link" && game != "40") {
				winName = "game_"+game;
			newWin = window.open(url,winName);
 		}else{
							winName = "game_"+game;
			newWin = window.open(url, winName ,options);
		//	newWin = window.open(url, game ,options);
		}
		newWin.focus();
    }
function encode_url (u) {url = "" + u;l = url.length;i=0;ret = "";c="";	
		for (i = 0; i < l; i++) 
		{
			c = url.charAt(i);
			if (c == '&') ret = ret + '~';
			else {
				if (c == ':') ret = ret + '^';
				else ret = ret + c;
			     }
		}
		
		return (ret);
			}
function encode_url2 (u) {
		var url = "" + u;
		var l = url.length;
		var i;
		var ret = "";
		var c;
		for (i = 0; i < l; i++) {
			c = url.charAt(i);
			if (c == '&') {
				ret = ret + '%26';
			} else {
				if (c == ':') {
					ret = ret + '%3a';
				} else {
					if (c == '+') {
						ret = ret + '%2B';
					}else{
						ret = ret + c;
					}
				}
			}
		}
		return ret;
	}
	function getcookie(thecookie) {
		lf = "\n";
		CookieString = document.cookie;
	    CookieSet = CookieString.split (';');
	    SetSize = CookieSet.length;
	    ReturnValue = "";
	    x = 0;
	    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
			CookiePieces = CookieSet[x].split ('=');
			if (CookiePieces[0].substring (0,1) == ' ') {
				CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
			}
			if (CookiePieces[0] == thecookie) {
				ReturnValue = CookiePieces[1];
			}
		}
		if(ReturnValue==""){
			return -1
		}else{
			return ReturnValue
		}
	 }

	function openGame(game, state) {
		if (state == "real")
			state = "true";
		launchgame(game, state);
	}

function change_language (sel) {
	var opt = sel.options[sel.selectedIndex].value;
	var parts = opt.split(',');

	if (parts.length == 4) {
		document.location.href = "/?LANG=" + parts[0] + "&STYLE=" + parts[1] + "&VIEW=" + parts[2] + "&LAYOUT=" + parts[3];		

	}
}

function openWin(url, width, height,name) {
	options = "resizable=1,scrollbars=1,menubar=0,status=1,width="+width+",height="+height;
	new2Win = window.open(url, name ,options);
}

function account (start,mid,stat) {
		var ret_url = encode_url(document.location.href);
		var url = 'https://www.ladbrokes.com/lbr_portal?action=go_acct_main&casino_aff=default&ret_url=http^//games.ladbrokes.com/phpParameters.php?LANG=EN~gameid=86';
		if (start != null) {
			url = url + "&start=" + start;
		}
		if (mid != null) {
			url += "&mid=" + mid;
		}
		if (stat != null) {
			url += "&static=" + stat;
		}
		acct_win = openWin(url,750,650,'acctwindow'); 
}

//-->
