    function appendParameters(Atag,anchor)
    {
        if(Atag.href.indexOf('?')>-1)
        {
            Atag.href += '&' + sCut + anchor;
        }
        else
        {
            Atag.href += '?' + sCut + anchor;
        }
        
    }
    var ShowPopup = true;
    var FlagAr = sFlag.split("");                

    if(FlagAr[1]!="1")
    {
            var x = window.screen.availWidth;
            var y = window.screen.availHeight;
            window.moveTo(0,0);
            window.resizeTo(x,y);
    }

    if(FlagAr[2]=="1")
    {
        self.blur();
    }	


function Select1_onclick()
{
        var LangPath=document.getElementById("LangBox").value;
        if (LangPath !="none")
        {           
            if (LangPath =="it")
                window.location.href = "http://"+ItalyDomain+"/blackjack/?" + sCutLangSt + "&lang=" + LangPath; 
            else if ((LangPath =="en")||(LangPath =="tr"))
                window.location.href =  "http://www.888.com/blackjack/"+LangPath+"/?" + sCutLangSt + "&lang=" + LangPath;
            else
                window.location.href =  "http://"+LangPath+".888.com/blackjack/"+LangPath+"/?" + sCutLangSt + "&lang=" + LangPath;
        }
}
 function OpenDownPoker(loc)
        {
                //setDownloadStatus();  
                document.location.href = "/?page=download_short_poker&" + sCut;
                url="http://www.pacificpoker.com/PokerInstaller?" +sCut + "&dl="+loc;
                window.open(url,"popDown","width=1,height=1,top=0,left=0");
        }

function OpenPopUp(sSerial)
{
    var w = 314;
    var h = 459;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2; 

    window.open("/new888/popupgames.htm?lang=en&sr=" + sSerial,null,"height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resize=no,left="+l+",top="+t);
}

function OpenDown(loc)
{
    document.location.href = "/?page=download_short&" + sCut + "&dl="+loc;
    window.open("/CasinoInstaller?" + sCut + "&dl=" +loc ,"popDown","width=1,height=1,top=0,left=0");
}
function Download(sCut)
{
    document.location.href = "/?page=download_short&" + sCut + "&dl=0";
    window.open("/CasinoInstaller?" + sCut +"&dl=0","popDown","width=1,height=1,top=0,left=0");
}
    
function ContactUs(sCut,sLang)
{
    if (sLang == 'en')
    {
        var w = 793;
        var h = 517;
        var LocationString = "/new888/lang/" + sLang + "/texts/contactusform/contactus.htm?" + sCut;
        var l = 1; //(window.screen.width-w)/2;
        var t = 1; //(window.screen.height-h)/2;
        window.open(LocationString,"contactUsWnd","status=no,toolbar=no,menubar=no,location=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h)
    }
    else
    {
        window.location.href =  "/?" + sCut + "&page=contactus";        
    }
}

function isDownload()
{
    if( getCookie("downloaded") )
        return true;
    return false;
}

function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) 
			return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
    
}

function mouseDown()
{
   
    var theEvent = window.event || arguments.callee.caller.arguments[0];
    var ref = "";
    var srcEl = theEvent.srcElement || theEvent.target;
    //check if the element that was pressed was an anchor
    while ((srcEl != null) && (srcEl.tagName != "A") && (srcEl.tagName != "AREA") && (srcEl.tagName != "BODY"))
            srcEl = srcEl.parentElement || srcEl.parentNode;
   
    if ((srcEl.tagName == "A") || (srcEl.tagName == "AREA")  &&(srcEl != null))  
    {
        ShowPopup = false;
    }
}
                            

//for turkish we use sCutLang
 function appendParametersTK(Atag,anchor)
    {
        if(Atag.href.indexOf('?')>-1)
        {
            Atag.href += '&' + sCutLang + anchor;
        }
        else
        {
            Atag.href += '?' + sCutLang + anchor;
        }
        
    }

function addParams(a)
{
    
    //because players club opens in a new window we must not
    //concatinate parameters if it already has ones.
    if(a.href.indexOf("playersclub.888")==-1 ||  a.href.indexOf("?")==-1)
    {
        if(a.href.lastIndexOf("/") ==  a.href.length -1 || a.href.lastIndexOf("htm") ==  a.href.length -3)
            a.href+="?" +sCut;
        else
            a.href+="&" + sCut;
    }
    
}

