function jumpto(url) {
if(url.indexOf('www.') == 0)
{
 url = "http://" + url; 
 window.open(url,'_blank')
}
else
{
 document.location.href = url;
}
}
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
frontpage = 1;
function cdp_player_DoFSCommand(command, args) {
	var cdp_player_Obj = isInternetExplorer ? document.all.cdp_player : document.cdp_player;
	//
	// Place your code here.
	//
	download();
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub cdp_player_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call cdp_player_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
function printVideo(url,play)
{
 cdPlayer = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="390" height="262" id="cdp_player" align="middle">'
+'<param name="allowScriptAccess" value="sameDomain">'
+'<param name="movie" value="'+url+'&getStart='+String(play)+'">'
+'<param name="wmode" value="transparent">'
+'<param name="quality" value="high">'
+'<param name="bgcolor" value="#ffffff">'
+'<embed src="'+url+'&getStart='+String(play)+'" quality="high" bgcolor="#ffffff" wmode="transparent" width="395" height="262" ID="cdp_player" name="cdp_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
+'</object>';
document.getElementById('flashPlayerHolder').innerHTML = cdPlayer;
} 
function printBonus(bonus)
{
cdPlayer = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="434" height="195" id="flash_bonus" align="middle">'
+'<param name="allowScriptAccess" value="sameDomain">'
+'<param name="movie" value="'+bonus+'">'
+'<param name="quality" value="high">'
+'<param name="wmode" value="transparent">'
+'<embed wmode="transparent" src="'+bonus+'" quality="high" bgcolor="#000000" width="434" height="195" name="flash_bonus" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
+'</object>';
document.getElementById('flashBonusHolder').innerHTML = cdPlayer;
}
function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information


/*
 tabs by leviev
*/

	var tabnum= 3;
	var curtab = 1;
	var cur= 1;
	var show = 1;
	var reset = 0;

	
function stop() {
    reset =1;
    window.clearTimeout(offdivID);

  }
  
  function start() {
   reset = 0;
   offdivID = window.setTimeout("changeTab()",4000);
  }
	
function	show_menu(idx)
 {
  
  for(i=1;i<=tabnum;i++){
  	tohidetab = 'tab'+i;
  	tohideleft = 'tab'+i+'-left';
  	hide_tab(tohidetab,tohideleft);  	
  }
  //alert(show)
	show_tab('tab'+idx,'tab'+idx+'-left')
  hide_menu(cur)
  cur = idx;
  document.getElementById('tab'+idx+'content').style.display="block";
 }

function	hide_menu(idx)
 {
   document.getElementById('tab'+idx+'content').style.display="none";
 }

function calculate(show)
{
	 id = "tab"+ show +"content"; 
   show_menu(show)
   tabid = "tab"+ show;
   tabidleft = "tab"+ show +"-left";
   
   show_tab(tabid,tabidleft)
   
   /*
   tabid = "tab"+ curtab;
   tabidleft = "tab"+ curtab +"-left";
  
   hide_tab(tabid,tabidleft)*/
   curtab = show;
   
}

function show_tab(tabid,tabidleft)
{
	//alert(tabid+' : '+tabidleft)
	 document.getElementById(tabid).className ="tab-hold-active";
   document.getElementById(tabidleft).className ="tab-left-active";
}
function hide_tab(tabid,tabidleft)
{
	 document.getElementById(tabid).className ="tab-hold";
   document.getElementById(tabidleft).className ="tab-left";
}

function changeTab()
{
	if(!reset)
	{
	offdivID = window.setTimeout("changeTab()",3000);
  }
  calculate(show)
    
 if(show >= tabnum)
 {
 	show=1;
 }
 else
 	{
 		show ++;
 	}

}

function hideWelcomeVideo(flag,url)
{
  printVideo(url,flag)
  document.getElementById('welcome-video').style.display="none";
}

function coolTool(param,url,downloadUrl)
{
 if(param)
 {
  document.getElementById('cool-tool').style.display="none";
  hideWelcomeVideo(param,url)
 }
 else
 {
  document.getElementById('cool-tool').style.display="none"; 
  download();
 } 
 document.getElementById('hide-site').style.display="none";
}


 links = 
 {
'1':{url:'http://www.willhill.com/en/getting-started',title:'Getting Started'},
'2':{url:'http://www.willhill.com/en/poker-tournaments',title:'Tournaments'},
'3':{url:'http://www.willhill.com/en/poker-bonuses',title:'Promotions'},
'4':{url:'http://www.willhill.com/en/vip-club',title:'VIP Club'},
'5':{url:'http://www.willhill.com/en/contact-us.html',title:'Contact Us'},
'6':{url:'http://www.willhill.com/en/security.html',title:'Security'},
'7':{url:'http://www.willhill.com/en/privacy.html',title:'Privacy'},
'8':{url:'http://www.willhill.com/en/terms.html',title:'Terms & Conditions'},
'9':{url:'http://www.willhill.com/en/about-us.html',title:'About Us'}
}

function drawLanding()
{
var menu = "";
     for(li in links)
     {
     menu += printLinks(links[li].url,links[li].title);
     }
     document.getElementById('portal-globalnav').innerHTML += menu;
}

function printLinks(url,title)
{
   var     contentHtml = '<li class="plain">';
           contentHtml +='<a title="" href="'+url+'">'+title+'</a>';
   return  contentHtml +='</li>'; 
}

function offCoolTool()
{
  document.getElementById('cool-tool').style.display = "block";
  document.getElementById('hide-site').style.display = "block";
}

function TestMsg()
{
try
{
tetsma = document.getElementById('contentview-folderContents').className;
document.getElementById('msg-site').style.display = "none";
}
catch(e){document.getElementById('msg-site').style.display = "block";}
}


/*
cool tool
*/
var msgOkLang =
{
'en':{ok:'OK',cancel:'CANCEL'},
'it':{ok:'OK',cancel:'CANCELLA'},
'de':{ok:'OK',cancel:'ABBRECHEN'},
'es':{ok:'ACEPTAR',cancel:'CANCELAR'},
'fr':{ok:'OK',cancel:'ANNULER'}
}


code = ''
		+'<div id="newpop" style="position: absolute;display:none;margin-left:auto;margin-right:auto;" />'
		+'<table cellspacing=0 style="z-index:8;" cellpadding=0 border=0 width="448" height="144" background="http://cachewww.williamhillpoker.com/popnew2.gif" width="448" height="144">'
		+'<tr id="newpoptop"><td width=431 style="color:white;font-family:arial;font-size:12px;font-weight:bold;padding-left:4px;padding-top:2px;text-align:left;">'
		+'WilliamHill'
		+'</td><td height=14 align=right style="padding-right:3px;padding-top:3px;*padding-top:0px;" width=16>'
		+'<img src="http://cachewww.williamhillpoker.com/x.gif" width="21" height="21" border="0" onclick="Close(\'\')">'
		+'</td>'
		+'</tr>'
		+'<tr><td valign="top" align="center" style="font-family:arial;font-size:12px;padding-left:60px;padding-right:15px;padding-top:28px;color:black;" colspan=2>'
		+cooltoolmsg + ''
		+'</td>'
		+'</tr>'
		+'<tr><td align=center valign=top colspan=2 style="padding-bottom:7px;">'
		+'<input type="button" value="'+msgOkLang[langNow()].ok+'" class="but" onclick="Close(\'1\');">&nbsp;'
		+'<input type="reset" value="'+msgOkLang[langNow()].cancel+'" class="but" onclick="Close(\'\')">'
		+'</td>'
		+'</tr></table>'
		+'</div>';

codeEN = ''
		+'<div id="newpop" style="position: absolute;display:none;margin-left:auto;margin-right:auto;" />'
		+'<table cellspacing=0 style="z-index:8;" cellpadding=0 border=0 width="788" height="165" background="popnewbig.gif" width="788" height="135">'
		+'<tr id="newpoptop"><td width=431 valign=top style="color:white;font-family:arial;font-size:12px;font-weight:bold;padding-left:4px;padding-top:6px;text-align:left;">'
		+'WilliamHill'
		+'</td><td height=14 valign=top align=right style="margin-left:3px;padding-top:3px;" width=16>'
		+'<img src="http://cachewww.williamhillpoker.com/x.gif" width="21" height="21" border="0" onclick="Close(\'\')">'
		+'</td>'
		+'</tr>'
		+'<tr><td valign="top" align="center" style="font-family:arial;font-size:12px;padding-left:60px;padding-right:15px;padding-top:28px;color:black;" colspan=2> If you already have a William Hill account click on the OK button to download our brand new Poker Room. To open a new account click on the cancel button'
		+'</td>'
		+'</tr>'
		+'<tr><td align=center valign=top colspan=2 style="padding-bottom:7px;">'
		+'<input type="button" value="'+msgOkLang[langNow()].ok+'" class="but" onclick="Close(\'1\');">&nbsp;'
		+'<input type="reset" value="'+msgOkLang[langNow()].cancel+'" class="but" onclick="Close(\'\')">'
		+'</td>'
		+'</tr></table>'
		+'</div>';

var cooltoolId;
/* Cancel the js popup */
function Close(curl){
	try{
		hideOverlay();
	}catch(e){};
    var p=el(cooltoolId);
    p.style.display="none";
	if(curl != ''){
		if(getMember(name) != "")
		{
			download();
		}
		else
		{
			javaDownload();
		}
	};
};
/* close the js popup */
function XClose(xurl){
	try{
		hideOverlay();
	}catch(e){};
    var p=el(cooltoolId);
    p.style.visibility="hidden";
	if(xurl != ''){
		jumpto(xurl,SITELANG);
	};
};
Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};



function setCoolTool(delay){
	delay = delay || 0;
	ttop = (document.viewport.getHeight() / 2) - ($(cooltoolId).getHeight() / 2);
	lleft = (document.viewport.getWidth() / 2) - ($(cooltoolId).getWidth() / 2);
	setTimeout("new Draggable($(cooltoolId).setStyle({display:'block',zIndex:'1000',position:'absolute',top:ttop + 'px',left:lleft + 'px'}), {handle:'newpoptop'})", delay);
};

// bonus area 

 sbb = 
 {
'win600':{pic:'win600'},
'win450':{pic:'win450'},
'win400':{pic:'win400'}
}


function printS()
{
 if(getS() == 0)
 {
el("bonus-area").innerHTML = '<a href="javascript:download();">'+
 '<img src="http://cachewww.williamhillpoker.com/bonus-'+langNow()+'.jpg" border="0">'
'</a>';

 }
 else
 {
  try 
  {
  el("bonus-area").innerHTML = '<a href="javascript:download();">'+
 '<img src="http://cachewww.williamhillpoker.com/'+ sbb[getS()].pic +'-'+langNow()+'.jpg" border="0">'
'</a>';

  }
  catch(e){}
 }
}

function getS()
{
if(document.location.href.indexOf('?') > 0)
 {
 return document.location.href.slice(document.location.href.indexOf('?')+1,document.location.href.length); 
 }
 else
 {
 return 0;
 }
}

function filterb(term, _id, cellNr){
	var suche = term.value.toLowerCase();
	var table = document.getElementById(_id);
//alert(table.rows[0].innerHTML);
	var ele;
	for (var r = 0; r < table.rows.length; r++){
		ele = table.rows[r].cells[cellNr].innerHTML.replace(/<[^>]+>/g,"");
		if (ele.toLowerCase().indexOf(suche)>=0 )
			table.rows[r].style.display = '';
		else table.rows[r].style.display = 'none';
	}
}





