 var MM_contentVersion = 6;
var MM_FlashCanPlay;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}    

function rouletteShowFlash(flashPath)
{
    debbuging; 
    if (MM_FlashCanPlay)
    {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="479" height="208" id="main_image_colors_final" align="middle" VIEWASTEXT>');
        document.write('<param name="allowScriptAccess" value="always" />');
        document.write('<param name="movie" value="' + flashPath+".swf"+'" />');
        document.write('<param name="wmode" value="transparent" />');
        document.write('<param name="quality" value="high" />');
        document.write('<param name="bgcolor" value="#ffffff" />');
        document.write('<embed src="' + flashPath+".swf" +'" wmode="transparent"  quality="high" bgcolor="#ffffff" width="479" height="208" name="mov_slide" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>');
    }
    else
    {
        //document.write(" <a  href='javascript:down(\'casino\');'  name='rotate'  id='rotate'><img id='rotateImg'  src=flashPath+'.gif'   " );    
    }
}
function DetectUK(ver,location)
{
    OpenDown(sCut);
}
	
function OpenDown(sCut)
{
    document.location.href = "/?page=download_short&" + sCut +"&dl=739";
    window.open("/CasinoInstaller?" + sCut + "&dl=739","popDown","width=1,height=1,top=0,left=0");
}
function Download(sCut)
{
    document.location.href = "/?page=download_short&" + sCut + "&dl=739";
    window.open("/CasinoInstaller?" + sCut +"&dl=739","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()
{
        alert("Select_onclick");
        var LangPath=document.getElementById("LangBox").value;    
        if (LangPath !="none")
        {
                window.location.href =  "http://"+LangPath+".888.com/keno/"+LangPath+"/?" + sCutLangSt + "&lang=" + LangPath;
        }
}
 function appendParameters(Atag,anchor)
    {
        if(Atag.href.indexOf('?')>-1)
        {
            Atag.href += '&' + sCut + anchor;
        }
        else
        {
            Atag.href += '?' + sCut + anchor;
        }
        
    }
//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;
    }    
}

function activateFlash()
{
    OpenDown(sCut);
}
    
