//this a java sctipt file for new style home pages: SV / IT / DA

var serial =  sSerial; //for flash version (openGame() js function)
var byFlag = false; // for welcome message
var PopupWindow = false; //for welcome message

function OpeneCograNew(lang)
{
	var w = 496;
	var h = 506;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/" + lang + "/texts/888ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
function OpeneCograCasino(lang)
{
	var w = 496;
	var h = 506;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/" + lang + "/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
function OpeneCograPcp(lang)
{
	var w = 496;
	var h = 506;
	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/" + lang + "/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 OpenDownPoker(loc)
{        
        try {
            ntptAddPair("dl",loc);
            ntptEventTag("ev=download_poker_from_"+sLang);
         }catch(err){}

        setDownloadStatus(); 
        if (sLang == 'it')
            url="http://" + ItalyDomainPoker + "/PokerInstaller?" +sCut + "&dl="+loc;
        else
            url="http://" + sLang + ".pacificpoker.com/PokerInstaller?" +sCut + "&dl="+loc;
        window.open(url,"popDown","width=1,height=1,top=0,left=0");
        document.location.href = "/new888/home.htm?page=download_short_poker&" + sCut;        
}

 function setDownloadStatus()
{   
    parent.isDownload = true;
}
function OpenCasino(location)
{
        var sCutNoDownload = 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?" + sCutNoDownload ,"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 openExitMessage()
{
     if(confirm(exitMsg))
    {
            OpenCasino('24');
    }
}

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 NoDownUK(ver,loc)
{
   openGame('1',loc)
}

function changeEventSv(brand)
{
    if (brand == 'casino')
    {
        var casinoEvents=document.getElementById("casinoEvents"); 
        casinoEvents.style.display="inline"; 
        casinoEvents.style.height="90px";
        
        var pokerEvent=document.getElementById("pokerEvents"); 
        pokerEvent.style.display="none"
         
        var casinoEventTitle=document.getElementById("casinoEventTitle");  
        casinoEventTitle.className="casinoEventTitleOn";
        
        var pokerEventTitle=document.getElementById("pokerEventTitle");  
        pokerEventTitle.className="pokerEventTitleOff";
        
        var events_news=document.getElementById("events_news");  
        events_news.className="casino_news";
    }
    else if (brand == 'poker')
    {
        var pokerEvents=document.getElementById("pokerEvents"); 
        pokerEvents.style.display="inline"; 
        pokerEvents.style.height="90px";
        
         var casinoEvents=document.getElementById("casinoEvents"); 
        casinoEvents.style.display="none"; 
        
        var casinoEventTitle=document.getElementById("casinoEventTitle");  
        casinoEventTitle.className="casinoEventTitleOff";
        
        var pokerEventTitle=document.getElementById("pokerEventTitle");  
        pokerEventTitle.className="pokerEventTitleOn";
        
         var events_news=document.getElementById("events_news");  
        events_news.className="poker_news";
    }
        
}

function ChangeIMG(IMG,name)
{

    var index = name.indexOf("_over.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 + "_over.gif";
   }
    IMG.src = sPicName;

}

function OpenDownCasinoEnglish(location)
{
    if (isBlockedCountry == "false")
    {
        document.location.href="/new888/home.htm?page=download_short&lang=en&" + sCutLang + "&dl=" + location;
        var sURLreg = "/CasinoInstaller?lang=en&" +sCutLang + "&dl=" + location;
        window.open(sURLreg,"popDown","width=1,height=1,top=0,left=0");
    }
    else
    {
        if (sLang == "en")
            document.location.href = "/new888/home.htm?page=us_message&" + sCutLang + "lang=en";
        else
            document.location.href = "/new888/home.htm?page=tr_message&" + sCutLang + "lang=en";
    }
}

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 menuOpen(src)
{
    src.className="menuOver";   
}

function menuClose(src)
{
    src.className="menuOut";
}
