    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=LangBox.value; 
        LangBox.selectedIndex=1;
        if (LangPath !="none")
        { 
                  window.top.location.href =  "/?" + sCutLang + "&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)
{
    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)
}

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;
    }
}
                          
function openExitPage(sCut,sLang)
{   
    if (ShowPopup)
    {
        if(!document.layers && isDownload()== false)
        {
            if(FlagAr[3]=="2" && "en" == sLang)
            {
                    var w = 770;
                    var h = 485;
                    var l = (window.screen.width-w)/2;
                    var t = (window.screen.height-h)/2;
                    window.open('../new888/lang/en/texts/exitpage.htm?' + sCut,'ExitPage',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,height=" + h + ",width=" + w + ",left="+l+",top="+t);
            }			
        }
     }
}     

function OpeneCogra()
{
        var w = 496;
        var h = 506;
        var l = (window.screen.width-w)/2;
        var t = (window.screen.height-h)/2;
        window.open("../new888/lang/en/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}