var serial =  sSerial; //for flash version (openGame() js function)
var byFlag = false; // for welcome message
var PopupWindow = false; //for welcome message
isNewGermanSite=true; //for exit message we use it in new888/clientscripts/casino_lp_flag.js - openExitPage()

function OpeneCograDe()
{
	var w = 496;
	var h = 506;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/de/texts/888ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

function OpeneCograCasino()
{
	var w = 496;
	var h = 506;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/de/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

function OpeneCograPcp()
{
	var w = 520;
	var h = 520;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/de/texts/pcpEcogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

function changeLangPoker(lang)
{
    if (lang == "en")
        window.open('http://www.pacificpoker.com/?' + sCutLang,'newwindow')
    else
        window.open('http://' + lang + '.pacificpoker.com/?' + sCutLang,'newwindow')
}
function changeLangCasino(lang)
{
    if (lang == "fr" || lang=="en" || lang=="de" || lang=="es" || lang=="it" || lang=="kr" || lang=="nl" || lang=="pt" || lang=="sv" || lang=="cns" || lang=="cnt" || lang=="da")
    {
        if (sGoPage == "bbc_bonus")
        {
             if (lang == "da" || lang == "de" || lang == "en" || lang == "es" || lang == "fr" || lang == "it" || lang == "sv")
                window.location.href = "/?" + sCutLangSt + "&page=bbc_bonus&lang=" + lang;
             else
                window.location.href = "/?" + sCutLangSt + "&lang=" + lang;
         }
         else         
         {
            window.location.href = "/?" + sCutLangSt + "&lang=" + lang;
         }
        return;
    }
    else if (lang=="jp")
    {
          window.location.href =  "/?" + sCutLangSt + "&lang=" + lang; 
          return;
    }      
}

function OpenCasino(location)
{
        sCut = sCut+ '&dl=' + location;
        var UKWindow="";
        var windowY = ((screen.availHeight-561)/2);
        var windowX = ((screen.width-804)/2);

        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 PopPhonePoker(Content)
{
    var PhoneWindow
   
    if(window.document.FrmPhonePoker.SupportPhonesPoker.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>Kundendienst per Telefon - Pacific Poker</title></head><body bgcolor="#dcdcdc"><table width="100%" align="center"><tr><td valign="middle"><br><a style="color:#303030;FONT-WEIGHT: bold;FONT-SIZE: 12px;FONT-FAMILY: Verdana;" >' + Content + '</a></td></tr></table></body></html>');
    }
}

function PopPhone(Content)
{
    var PhoneWindow
    if(window.document.FrmPhone.SupportPhones.selectedIndex!=0)
    {
        PhoneWindow = window.open('','',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=360,height=140,left=300,top=240");
        PhoneWindow.document.write('<html><head><title>Kundendienst per Telefon - Casino-on-Net</title></head><body bgcolor="#dcdcdc"><table width="100%" align="center"><tr><td valign="middle"><br><a style="color:#303030;FONT-FAMILY: Verdana;FONT-WEIGHT: bold;FONT-SIZE: 12px;">' + Content + '</a></td></tr></table></body></html>');
    }
}

function openExitMessage()
{
     if(confirm(exitMsg))
    {
            OpenCasino('24');
    }
}

function timeimgs(numb)
 { // Reusable timer
    //alert(numb);
    thetimer = setTimeout("imgturn('" +numb+ "')", 4000);
}

function imgturn(numb) 
{ // Reusable image turner
  
        var tmpMainPic = document.getElementById("main_img");
        
        //alert(numb);
        if (numb == "5") 
        { // This will loop the image
            tmpMainPic.className="main_pic5";
            timeimgs('1');
        }
        else 
        {          
           //tmpMainPic.src=sImgPathNew+"/mainPic/img_bg_0" + numb + ".jpg";    
          
           tmpMainPic.className="main_pic" + numb;     
           numb = Number(numb) + 1;
           timeimgs(numb);
        }
}
function changeMainImg()
{
    var tmpMainPic = document.getElementById("main_img");    
    tmpMainPic.className="main_pic1";
}

function OpenBBC_Bonus()
{
    var w = 480; 
    var h = 350;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
    window.open("/de/casino/bonus_policy.htm","Flash",windowprops);
}


function open888dayPoker()
{
    try{
                  ntptEventTag("888_tabPoker_EN");
         }
     catch(err){}
     window.open("https://emails.888.com/888day/poker/en/?" + sCut);
}

function open888dayCasino()
{
    try{
                  ntptEventTag("888_tabCasino_EN");
         }
     catch(err){}
     window.open("https://emails.888.com/888day/casino/en/?" + sCut);
}

function open888dayHomePage()
{
    try{
                  ntptEventTag("888_main_image_EN ");
         }
     catch(err){}
     window.open("http://promo.888.com/888day/en/?"+sCut);
}

function OpenBingo()
{
    try{
      ntptEventTag("ev=open_bingo_from_de");
     }
     catch(err){}
     window.open("http://www.888ladies.com/?"+sCut );
}

function OpenBingoPromotions()
{
    try{
      ntptEventTag("ev=open_bingo_from_de");
     }
     catch(err){}
     window.open("http://www.888ladies.com/skin/promotions/promotions.php?"+sCut );
}

function OpenSport()
{
    try{
      ntptEventTag("ev=open_sport_from_de");
     }
     catch(err){}
     window.open("http://www.888sport.com/?"+sCut);
}

function CasinoDownMainImage()
{
    try{
      ntptEventTag("ev=down_casino_main_image_de");
     }
     catch(err){}
     javascript:OpenDownCasino('1385');
}


function OpenFromCasinoTab()
{
    try{
      ntptEventTag("ev=promo_888_casino_tab_DE");
     }
     catch(err){}
     window.open("http://promo.888.com/santacruise/de/?"+sCut );
}


function open_xmass()
{
    try{
      ntptEventTag("ev=promo_xmass_888_DE");
     }
     catch(err){}
     window.open("http://promo.888.com/santacruise/de/?"+sCut );
}

function OpenRigntNow()
{
      //var w = 620;
      var w = 580;
      //var h = 730;
      var h = 700;
      var l = (window.screen.width-w)/2;
      var t = (window.screen.height-h)/2;
      window.open("http://888-external-de.custhelp.com/cgi-bin/888_external_de.cfg/php/enduser/std_alp.php?p_pv=1.1&p_prods=1&prod_lvl1=1","faq","resizable=no,status=no,scrollbars=yes,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
function OpenRigntNowPoker()
{
       //var w = 620;
       var w = 580;
       //var h = 730;
       var h = 700;
        var l = (window.screen.width-w)/2;
        var t = (window.screen.height-h)/2;
        window.open("http://888-external-de.custhelp.com/cgi-bin/888_external_de.cfg/php/enduser/std_alp.php?p_pv=1.4&p_prods=4&prod_lvl1=4","faq","resizable=no,status=no,scrollbars=yes,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
