 var MM_contentVersion = 6;
var MM_FlashCanPlay;

function NoDownUK(ver,loc)
{
   openGame('1',loc)
}

function OpeneCogra()
{
        var w = 520;
        var h = 520;
        var l = (window.screen.width-w)/2;
        var t = (window.screen.height-h)/2;
        window.open("/new888/lang/nl/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

function changeImage(class_postfix, id, class_name)
{
    var tmpMainPic = document.getElementById(id);    
    tmpMainPic.className=class_name + class_postfix;
}

function OpenPopUp()
{
    var w = 314;
    var h = 459;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2; 
    var filename = "/new888/popupgames.htm";

    window.open(filename + "?" + sCut ,null,
    "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resize=no,left="+l+",top="+t);
}

function OpenCasino(location)
{
        sCut = sCut+ '&dl=' + location;
        var UKWindow="";
        var windowY = ((screen.availHeight-561)/2);
        var windowX = ((screen.width-804)/2);
        parent.isDownload = true;
        if (sIC !="0")
        {
                if(UKWindow){UKWindow.close();}
                UKWindow = window.open("/ukpopup.htm?" + sCut ,"Offline","width=795,height=545,left="+windowX+",top="+windowY+",resizable=no,status=no,scrollbars=no,toolbar=no,menubar=no");
        }
        else
        {
            //function code in nodownload_js.htm
            openGame('1',location);
        }
}

function OpenInfo(sLang)
{
    var w = 405;
    var h = 252;
    var LocationString;
    var l = (window.screen.width-w)/2 - 12;
    var t = (window.screen.height-h)/2 - 12;
    var windowprops = "location=no,status=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
    var filename = "http://www.pacificpoker.com/pokerinfo.htm" + "?lang=" + sLang;
    var pokerinfo = window.open(filename,"PokerInfo",windowprops);
}

function menuOpen(src)
{
    src.className="menuOver";   
}

function menuClose(src)
{
    src.className="menuOut";
}

function Download(loc)
{
    OpenDownCasino(loc);
}

function ChangeIMG(IMG,name){
    var index = name.indexOf("_o.gif");
    var sPicName="";
    if (index!=-1){
        sPicName= name.substr(0,index);
        sPicName = sPicName + ".gif"
    }
    else{
        index = name.indexOf(".gif");
        sPicName= name.substr(0,index);
        sPicName = sPicName + "_o.gif";
    }
    IMG.src = sPicName;
}

function ChangeMenuIMG(name) {
    var menuImg = document.getElementById(name);
    ChangeIMG(menuImg,menuImg.src)
}

		function ContactUs(brand)
		{
			var w = 793;
			var h = 517;
			var l = 1; //(window.screen.width-w)/2;
			var t = 1; //(window.screen.height-h)/2;
			var LocationString ="";
			if(brand=="casino")
				LocationString = "/new888/lang/nl/texts/contactusform/contactus.htm?" + sCut;
			else
				LocationString= "http://www.pacificpoker.com/?page=contactus&flag=1100";
			var x = window.open(LocationString,"contactUsWnd","status=no,toolbar=no,menubar=no,location=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h)   
		}
                
                
                
function ChangeIMG(IMG,name){
    var index = name.indexOf("_o.gif");
    var sPicName="";
    if (index!=-1){
        sPicName= name.substr(0,index);
        sPicName = sPicName + ".gif"
    }
    else{
        index = name.indexOf(".gif");
        sPicName= name.substr(0,index);
        sPicName = sPicName + "_o.gif";
    }
    IMG.src = sPicName;
}

function ChangeMenuIMG(name) {
    var menuImg = document.getElementById(name);
    ChangeIMG(menuImg,menuImg.src)
}
function Select1_onclick()
{
   
    
        var LangPath=document.getElementById("LangBox").value;
      
        if (LangPath !="none")
        {           
            if (sGoPage == "bbc_bonus")
            {
                if (LangPath == "da" || LangPath == "de" || LangPath == "en" || LangPath == "es" || LangPath == "fr" || LangPath == "it" || LangPath == "sv")
                    window.top.location.href =  "/?" + sCutLangSt + "&page=bbc_bonus&lang=" + LangPath;   
                else
                    window.top.location.href =  "/?" + sCutLangSt + "&lang=" + LangPath;           
            }        
            else
            {
                window.top.location.href =  "/?" + sCutLangSt + "&lang=" + LangPath;           
            }
        }
        
}

function timeimgs(numb)
 { // Reusable timer
    thetimer = setTimeout("imgturn('" +numb+ "')", 2000);
}

function imgturn(numb) 
{ // Reusable image turner
    if (document.images) 
    {
        var tmpMainPic = document.getElementById("main_pic");

        if (numb == "4") 
        { // This will loop the image
            tmpMainPic.src = eval("pic_04.Src");
            timeimgs('1');
        }
        else 
        { 
           tmpMainPic.src=eval( "pic_0" + numb + ".Src");
           timeimgs(numb = ++numb);
        }
    }
}

function putCookie(cookieName,cookieValue,expireMiliSeconds)
{
    var myLocation = window.location.hostname;
    var d = new Date();
    d.setTime(d.getTime() + expireMiliSeconds);
    document.cookie = cookieName + "=" + cookieValue + ";expires=" + d.toGMTString() + ";path=/";
}

/*-------------------*/

function menuOpen(src)
{
    src.className="menuOver";   
}

function menuClose(src)
{
    src.className="menuOut";
}

function ChangeIMGDwl_on()
{      
    var tmp = document.getElementById('downIMG');
    tmp.src = sImgPath+'888download_menu_o.gif';
}

function ChangeIMGDwl_off()
{
    var tmp = document.getElementById('downIMG');
    tmp.src = sImgPath+'888download_menu.gif';
}

function OpenDownBgmn(loc)
{
    var w = 802;
    var h = 602;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    filename = "http://ndl.888.com/bg/?" + sCutNoST + "&st=256&dl="+loc;
    window.open(filename,null, "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resize=no,left="+l+",top="+t);
}


function PopPhoneBgmn(Content,name)
{
    var PhoneWindow
   
    var tmp = document.getElementById(name);
    if(tmp.selectedIndex!=0)
    {
        PhoneWindow = window.open('','',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=360,height=170,left=320,top=320");
        PhoneWindow.document.write('<html><head><title>Contact Support by Telephone -888 Backgammon</title></head><body bgcolor="#4b9e3b"><table width="100%" align="center"><tr><td valign="middle"><br><a style="color:#ffffff;FONT-WEIGHT: bold;FONT-SIZE: 12px;FONT-FAMILY: Verdana;" >' + Content + '</a></td></tr></table></body></html>');
    }
}

function PopPhoneBingo(Content,name)
{
    var PhoneWindow
   
    var tmp = document.getElementById(name);
    if(tmp.selectedIndex!=0)
    {
        PhoneWindow = window.open('','',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=360,height=170,left=320,top=320");
        PhoneWindow.document.write('<html><head><title>Contact Support by Telephone -888 Bingo</title></head><body bgcolor="#4b9e3b"><table width="100%" align="center"><tr><td valign="middle"><br><a style="color:#ffffff;FONT-WEIGHT: bold;FONT-SIZE: 12px;FONT-FAMILY: Verdana;" >' + Content + '</a></td></tr></table></body></html>');
    }
}

function Terminology(strTerm)
{
    window.document.location.href="/site2/backgammon/terminology.htm#"+strTerm;
}

function OpenBingoTutorial()
{
    var filename = "http://info.thejoyofbingo.com/howto/bingo_howto_888.php?prod=888&sr=" + sSerial;
    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 OpenPacificPokerPage(path)
{
    var currentDomain = location.host;  
    var pcpDomain = "";
    if (currentDomain.indexOf("10.20.40") >  -1) 
        pcpDomain ="10.20.40.14:5500/";
    else if (currentDomain.indexOf(".stage") >  -1) 
        pcpDomain ="newstage.pacificpoker.com/";
    else if (currentDomain.indexOf(".888.com") >  -1)
    {
        if (sLang == "en")   
            pcpDomain = "www.pacificpoker.com/";
        else
            pcpDomain = sLang + ".pacificpoker.com/";
    }
   else if (currentDomain.indexOf(".dev") >  -1) 
   {
       var pos = currentDomain.indexOf(":");
       var port = currentDomain.substring(pos+1);
       var startPos = currentDomain.indexOf("casino.");
       var endPos = currentDomain.indexOf(".dev");
       pcpDomain = "newpoker." + currentDomain.substring(startPos+7, endPos) + ".dev:" + port + "/"; 
   }
   
    var fullPath = "http://" + pcpDomain + sLang + "/" + path + "?" + sCut;
        alert (fullPath);
    window.open(fullPath ,'newwindow') 
}


var t;
function scrollGame(direction) {
    changeGame(direction);
    if (direction=="right")
        t=setTimeout("scrollGame('right')",800);
    else
        t=setTimeout("scrollGame('left')",800);
}

function stopScrollGame() {
    clearTimeout(t);
}

function changeGame(direction) {

var gamesNum =5;

var gameImage = document.getElementById("bonus");
var imageName =gameImage.src;
var index = imageName.substring(imageName.indexOf("con_img")+7,imageName.indexOf("con_img")+8);


    if (direction=="right") {
        if (gamesNum-index==0) index=1;
        else index = (index-0)+1;
    }
    else if  (direction=="left") {
        if (index-1==0) index=gamesNum;
         else index = index-1;
    }
     gameImage.src= (sLook != "35") ? sImgPath+"888-hp/con_img"+index+".gif" :  sImgPath+"888-hp/con_img"+index+"_uk.gif";
}

//for 2 rows' links
function changeLinkColor(linkNum,color) {
    document.getElementById("link"+linkNum+"a").style.color = color;
    document.getElementById("link"+linkNum+"b").style.color = color;
    if (linkNum == '1')
        document.getElementById("link"+linkNum+"c").style.color = color;
}

function rotateImagesOld(i) {
    var t;
    var brands = new Array("casino","bingo","sport","poker");

    if (i == brands.length) i=0;

    imageCommandOld(brands[i]);
    i = i+1;
    t=setTimeout("rotateImagesOld("+ i +")",3000);
}

function imageCommandOld(brand) {
    document.getElementById("rotate").href = "javascript:downOld('"+brand+"')";
    document.getElementById("rotateImg").src = sImgPath + "main_image_" + brand+".v1.gif";
}

function downOld(brand) {

    if (brand == "casino")
        OpenDownCasino('1379');
    else if (brand=="poker")
        OpenDownPoker('1380');
    else if (brand=="bingo")
        window.open("http://www.888ladies.com/?"+sCut);
     else if (brand=="sport")
        window.open("http://www.888sport.com/bet?"+sCut);
}

function open_xmass()
{
    try{
      ntptEventTag("ev=promo_xmass_888_NL");
     }
     catch(err){}
     window.open("http://promo.888.com/santacruise/nl/?"+sCut );
}

function OpenRightNow()
{
     var w = 582;
     var h = 702;
     var l = (window.screen.width-w)/2;
     var t = (window.screen.height-h)/2;
     window.open("http://888-external-nl.custhelp.com?p_pv=1.1&p_prods=1","faq","resizable=no,status=no,scrollbars=yes,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

function OpenRightNowPoker()
{
      var w = 582;
      var h = 702;
      var l = (window.screen.width-w)/2;
      var t = (window.screen.height-h)/2;
      window.open("http://888-external-nl.custhelp.com?p_pv=1.4&p_prods=4","faq","resizable=no,status=no,scrollbars=yes,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}