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');
}    
var CorentLang = 'cns';

function oldHPshowFlash(flashPath) {
    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="567" height="147" id="main_image_colors_final" align="middle" VIEWASTEXT>');
        document.write('<param name="allowScriptAccess" value="always" />');
        document.write('<param name="movie" value="' + flashPath +'" />');
        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 +'" wmode="transparent"  quality="high" bgcolor="#ffffff" width="567" height="147" 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:OpenDownCasino(\'casino\');" name="rotate" id="rotate"><img id="rotateImg" src="' + sImgPath +'/'+ 'images/hp/main_image_casino.gif" border=0/>');    
        //document.write(' <a href="javascript:down(\'casino\');" name="rotate" id="rotate"><img id="rotateImg" src="' + sImgPath +'/'+ 'images/main_image.gif" border=0/>');    
        //rotateImages(0);
    }
}

function activateFlash(){
    window.open("http://www.888.com/wpc/2008/en/?"+sCut);
}


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);
}
function OpeneCograCasino(page){
    var w = 496;
    var h = 506;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    if (page =='casino'){
        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);
    }
    else{
        window.open("/new888/lang/en/texts/888ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
    }
}
function OpenPCPeCogra(){
    var w = 520;
    var h = 520;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    window.open("/new888/lang/en/texts/pcpEcogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
function ChangeIMG(IMG,name){
    var index = name.indexOf("_o.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 + "_o.gif";
    }
    IMG.src = sPicName;
}

function ChangeMenuIMG(name) {
    var menuImg = document.getElementById(name);
    ChangeIMG(menuImg,menuImg.src)
}

function timeimgs(numb) { // Reusable timer
    thetimer = setTimeout("imgturn('" +numb+ "')", 2000);
}

/*-------------------*/

function menuOpen(src) {
    src.className="menuOver";   
}

function menuClose(src) {
    src.className="menuOut";
}

/********this is for affliliate rediect ********/


function OpenRigntNowCasino() {
    var w = 620;
    var h = 730;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    /*there are no inner pages for jp so it  has a reference to 'en'*/
    window.open("/new888/lang/en/texts/faq.htm","faq","resizable=no,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
    
}

function OpenRigntNowPoker() {
    var w = 620;
    var h = 730;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    window.open("http://www.pacificpoker.com/en/online-poker-help/faq--3,6.htm?flag=1100","faq","resizable=no,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}
