function DetectUK(ver,location)
{
    OpenDown('750');
}
	
function OpenDown(location)
{
    document.location.href = "/?page=download_short&" + sCut +"&dl=" + location;
    window.open("/CasinoInstaller?" + sCut + "&dl=" + location,"popDown","width=1,height=1,top=0,left=0");
}
function Download(location)
{
    document.location.href = "/?page=download_short&" + sCut + "&dl=" + location;
    window.open("/CasinoInstaller?" + sCut +"&dl="+location,"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;
    }
}
                          
function Select1_onclick()
{
        var LangPath=document.getElementById("LangBox").value;    
        if (LangPath !="none")
        {
            if (LangPath =="it")
                window.location.href = "http://"+ItalyDomain+"/video-slots/?" + sCutLangSt + "&lang=" + LangPath;
            else if (LangPath =="en")
                window.location.href =  "http://www.888.com/video-slots/en/?" + sCutLangSt + "&lang=" + LangPath;
            else if ((LangPath =="tk")||(LangPath =="tr"))
                window.location.href =  "http://www.888.com/video-slots/tk/?" + sCutLangSt + "&lang=" + LangPath;
            else
                window.location.href =  "http://"+LangPath+".888.com/video-slots/"+LangPath+"/?" + sCutLangSt + "&lang=" + LangPath;
        }
}
 function appendParameters(Atag,anchor)
    {
        if(Atag.href.indexOf('?')>-1)
        {
            Atag.href += '&' + sCut + anchor;
        }
        else
        {
            Atag.href += '?' + sCut + 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;
    }
    
}