	var now = new Date();
	var w_id = "LadbrokesPokerHome_";
	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 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 findPosY(obj)
	  {
	    var curtop = 0;
	    if(obj.offsetParent)
	        while(1)
	        {
	          curtop += obj.offsetTop;
	          if(!obj.offsetParent)
	            break;
	          obj = obj.offsetParent;
	        }
	    else if(obj.y)
	        curtop += obj.y;
	    return curtop;
	  }
	
function showmenu() {
	var navitem = document.getElementById("idlang");
	navitem.style.zIndex=100;
	divpostop = navitem.offsetTop;
	divposleft = navitem.offsetLeft;
	divposwidth = navitem.offsetWidth;
	divposheight = navitem.offsetHeight;

	dropHi = document.getElementById("footer").offsetTop;

	if (document.documentElement && document.documentElement.scrollTop){
		theTop = document.documentElement.clientHeight;
	}else{
		if (document.body) {
			theTop = document.body.clientHeight;
		}
	}

	navitem.style.position = "absolute";
	navitem.style.top = dropHi - divposheight+8;

	if (navitem.style.visibility != "visible") {
		navitem.style.display = "block";
		if(navitem.filters){
			navitem.filters[0].Apply();
			navitem.filters[0].Play();
		}
		navitem.style.visibility="visible";
	}
}

//STEVES NEW FUNCTION
function getParent(obj,objThis){
	//obj is objDepartedNode
	while(obj){
		//alert("obj.id="+obj.id)
		if(obj == objThis){
			return obj;
		}
		obj = obj.parentNode;
	}
	return null
}

function IsChildHovered(e,objThis){
	var isChildHovered = false;
	var objDepartedNode = (e.relatedTarget)?e.relatedTarget:e.toElement;
	/*
	var strAlert = ""
	for(var obj in e){
	strAlert+=obj + "="+eval("e."+obj) + "      ";
	}
	alert("strAlert:\n\n"+strAlert)
	*/
	var objParent = getParent(objDepartedNode,objThis);
	if(objParent){
		isChildHovered = true;
	}
	return isChildHovered;
}

function isMouseOutObjectArea(e,objThis){//,obj2,obj3
	//this is to detect if a user mouseout from one object to another object
	//for example, a user will mouseout from MORE to HIDEMELAYER or vice versa
	//in which case all further mouseout functionality will be void.
	var objDepartedNode = (e.relatedTarget)?e.relatedTarget:e.toElement;
	for(var a = 1; a < isMouseOutObjectArea.arguments.length; ++a){
		if(objDepartedNode == isMouseOutObjectArea.arguments[a]){
			return false;
		}
	}
	//a mouseout will trigger even if a user does a mouseover onto a node inside the parent node
	//so this detects if the mouseout was triggered by mouseover onto the parents child nodes.
	//and if it does then all further mouseout functionality will be void.
	if(IsChildHovered(e,objThis)){return false}
	return true;
}

function ID(strId){
	return document.getElementById('id'+strId);
}

function moreinfo(strId){
	return document.getElementById('moreinfo'+strId);
}

function hidemenu(e,objThis){
	var e=(e)?e:window.event;
	if(isMouseOutObjectArea(e,objThis)){
		objThis.style.visibility="hidden";
	}
}

function showInfo(objItem) {
	navitem = document.getElementById("id"+objItem);

	parentitem = navitem.parentNode;
	divpostop = navitem.offsetTop;
	divposleft = navitem.offsetLeft;
	divposwidth = navitem.offsetWidth;
	divposheight = navitem.offsetHeight;

	dropHi = parentitem.offsetTop+parentitem.offsetParent.offsetTop+parentitem.parentNode.offsetParent.offsetTop+parentitem.offsetHeight+3;
	if (document.documentElement && document.documentElement.scrollTop){
		theTop = document.documentElement.clientHeight;
	}else{
		if (document.body) {
			theTop = document.body.clientHeight;
		}
	}
	navitem.style.position = "absolute";
	navitem.style.top = dropHi;


	if (navitem.style.visibility != "visible") {
		navitem.style.display = "block";
		navitem.style.visibility="visible";
		if(navitem.filters){
			navitem.filters[0].Apply();
			navitem.filters[0].Play();
		}
	}
}

//_________________________
function hideInfo(e,objThis,strHideId,objAllowMouseout1,objAllowMouseout2){
	var e=(e)?e:window.event;

	if(isMouseOutObjectArea(e,objThis,objAllowMouseout1,objAllowMouseout2)){

		//the reason i have put this line here is just to make the code look neater in the HTML
		var objHide = ID(strHideId)

		objHide.style.visibility="hidden";
	}
}

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
	e=(e)?e:window.event;
	/*e.stopPropagation();
	e.cancelBubble = true;*/

	var IE = (document.all)
	if (IE) { // grab the x-y pos.s if browser is IE
		var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
		tempX = event.clientX + iebody.scrollLeft
		tempY = event.clientY + iebody.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	}
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	mousepos=tempX+","+tempY;
	//document.title = mousepos
}

function getMouseXYIE(e){
	e=(e)?e:window.event;
	var IE = (document.all)
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	}
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}

	alert(tempX + ","+tempY);
	return tempX+","+tempY;
}

function banner_DoFSCommand(command, args){
	alert(command + "  " + args)
	if(command=="click"){
		switch (args) {
			case "ff":
			alert(args);
			break;
			default:
		}
	}
}

function newWindow(url,name,w,h) {
	wi= "width=" + w + ",height=" + h
	sb = ",scrollbars=yes"
	wi = wi+sb
	win = window.open(url,"",wi,sb);
}



/**
 * 
 * @param url
 * @param width
 * @param height
 * @param new_win
 * @param name
 * @param resize
 * @param scroll
 * @param menu
 */
function openpopUp(url,width,height,new_win,name,resize,scroll,menu) {

	  if (new_win=="Y") {
	    if (resize == "N") {
	      resize = "no";
	    } else {
	      resize = "yes";
	    }
	    if (scroll == "N") {
	      scroll = "no";
	    } else {
	      scroll = "yes";
	    }
	    if (menu == "Y") {
	      menu = "yes";
	    } else {
	      menu = "no";
	    }
	    var dimensions = "";
	    if (width != "") {
	      dimensions += ",width=" + width;
	    }
	    if (height != "") {
	      dimensions += ",height=" + height;
	    }
	    if (name == "") {
	      name == "helpwin";
	    }
	    var newWindow = window.open(url, name, "scrollbars=" + scroll + ",resizable=" + resize + ",menubar=" + menu + dimensions);
	    newWindow.focus();
	  } else {
	    document.location.href=url;
	  }
}
function dolaunchKanaRealtime() {
	launchKanaRealtime( location.href,"https://livehelp.ladbrokes.com/KanaImail/ladbrokespoker_Imail/KanaRealtime/KanaRealtime.html?_REQUESTED-CHANNEL_=IMAIL&IMAIL_FORMPAGE=AskFirstQuestionForm.html&IMAIL_FORMTYPE=test&IMAIL_FORMTITLE=Please%20complete%20your%20details%20below&IMAIL_REFERRINGURL=http%3A//www.ladbrokespoker.com/help/contact/%3Fsubsection%3DContact%20Ladbrokes&IMAIL_DAYOFWEEK=Monday","","test","Please complete your details below" );
}
var mousepos;
document.onmouseover = getMouseXY;
document.onmouseout = getMouseXY;

// begin absolutely positioned scrollable area object scripts
function verifyCompatibleBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

bw=new verifyCompatibleBrowser()
lstart = 15;
incr = 16;
curr = lstart;
next = lstart+incr;
loop=true
speed=25
pr_step=1

function ConstructObject(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.newsScroll=newsScroll;
	this.moveIt=b_moveIt; this.x; this.y;
	this.obj = obj + "Object"
	eval(this.obj + "=this")
	return this
}

function b_moveIt(x,y){
	//this.x=x;
	this.y=y
	//this.css.left=this.x
	this.css.top=this.y
}

//Makes the object scroll up
function newsScroll(speed){
	if (curr < next) {
		if(this.y>-this.scrollHeight){
			this.moveIt(0,this.y-pr_step)
			setTimeout(this.obj+".newsScroll("+speed+")",speed)
			curr = curr + 1;
		}else if(loop) {
			curr = lstart;
			next = lstart+incr;
			this.moveIt(0,lstart)
			eval(this.obj+".newsScroll("+speed+")")
			//curr = curr + 1;
		}
	}else{
		next = next + incr;
		setTimeout(this.obj+".newsScroll("+speed+")",7000)
	}
}

//Makes the object
function InitialiseAutoScrollArea(){
	objContainer=new ConstructObject('tickerContainer')
	objContent=new ConstructObject('ticker','tickerContainer')
	objContent.moveIt(0,lstart)
	objContainer.css.visibility='visible'
	objContent.newsScroll(speed)
}
// end absolutely positioned scrollable area object scripts #

//promotions claim form validationion
function checkForm()
{
	var cemail, cusername;

	cemail 	=  document.forms.msgform.email_addy;
	cusername	=  document.forms.msgform.username;


	if(trim(cemail.value) == '')
	{
		alert('Enter your Email address');
		cemail.focus();
		return false;
	}
	else if(!isEmail(trim(cemail.value)))
	{
		alert('Email address is not valid');
		cemail.focus();
		return false;
	}
	else if(trim(cusername.value) == '')
	{
		alert('Enter your Username');
		cusername.focus();
		return false;
	}
	else
	{
		cemail.value 	 =  trim(cemail.value);
		cusername.value =  trim(cusername.value);
		return true;
	}
}

function trim(str)
{
	return str.replace(/^\s+|\s+$/g,'');
}

function isEmail(str)
{
	var regex = /^[-_.a-z0-9]+@(([-_a-z0-9]+\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i;
	return regex.test(str);
}

// ** New header scripts **
function newaccount() {
	var url;

	url = fromLobReg+"&w_id="+parent.w_id;
	reg_win = openWin(url,800,590,'regwindow');

}

function account (start,mid,stat) {
	var ret_url = encode_url(document.location.href);
	var url = ssl2url+"?action=go_acct_main&ret_url="+ret_url;
	if (start != null) {
		url = url + "&start=" + start;
	}
	if (mid != null) {
		url += "&mid=" + mid;
	}
	if (stat != null) {
		url += "&static=" + stat;
	}
	if (start == "go_account_cashier" || start == "go_acct_dep") {
		url = url + "&ext_acct=POKER";
	}
	url = url + "&system_source=MPP";
	acct_win = openWin(url,750,650,'acctwindow');
}

function go_unlock() {
	var ret_url = encode_url(document.location.href);
	var unlock_url = unlockUrl+'?action=GoUnlockCustAccount&retURL_good='+ret_url;
	unlockWindow = openWin(unlock_url,'560','400','Unlock');
}

function goBank(type) {
	if (type != '0') {
		if (type == "transfer") {
			account('go_acct_cashier');
		}else{
			account('go_acct_dep');
		}
	}else{
		account("accounthelp_deposit.html","accounthelp",1);
	}
}

function encode_url (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 + '~';
		} else {
			if (c == ':') {
				ret = ret + '^';
			} else {
				ret = ret + c;
			}
		}
	}
	return ret;
}

//end of claim form validation script


function clearField(elem, matStr)
{
      if(elem.value==matStr || elem.value=='password') {
            elem.value ='';
      }
}

function setField(elem, matStr)
{
      if(elem.value==matStr || elem.value=='password' || elem.value=='') {
            elem.value = matStr;
      }
}


function setStartPage(startPage)
{
  document.getElementById('startPage').value = startPage;
  form = document.getElementById('startPageForm');
  form.submit();
}
