
   /* Nav Menu Script for IE browsers */
sfHover = function TopNavMenuPatch (){	
	var sfEls = document.getElementById("siteNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


       function openLangs() {
         if(document.getElementById){
          var el = document.getElementById('langs');
          if(el.style.display != "block"){    
             el.style.display = "block";
             el.style.top = "23px";
             el.style.left = "138px";
          }else{
             el.style.display = "none";
           }
        }
    }
    
    function changeColor(obj,status) {
        if (status=="on") {
            obj.style.background = '#333333';
            obj.style.color = '#ffffff';
        } else {
             obj.style.background = '#444444';
            obj.style.color = '#989898';
         }
     }    
     
                       
     function closeList() {
        var langs = document.getElementById('langs');
        langs.style.display = "none";
      }



   var ShowPopup = true;                          
var FlagAr = sFlag.split("");                
if (FlagAr[0]=="1"){byFlag = true;}

if(FlagAr[1]!="1")
{
        var x = window.screen.availWidth;
        var y = window.screen.availHeight;
        window.moveTo(0,0);
        window.resizeTo(x,y);
}

function isDownload()
{
    if( getCookie("downloaded") )
        return true;
    return false;
}

function openExitPage()
{
    if (ShowPopup)
   {
        if(!document.layers && isDownload()== false)
        {
            if(FlagAr[3]=="2")
            {
                    var w =788;
                    var h = 364;
                    var l = (window.screen.width-w)/2;
                    var t = (window.screen.height-h)/2;
                    window.open('http://www.littlewoodscasino.com/webpagesincludes/exit.htm','ExitPage',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,height=" + h + ",width=" + w + ",left="+l+",top="+t);
            }			
        }
     }
}     
           
function setDownloadStatus()
{
    setCookie("downloaded","1","/");
}

function setCookie(name,value)
{
    var argv = setCookie.arguments;
    var argc = setCookie.arguments.length;
    var path = (argc > 2) ? argv[2] : null;
    var expires = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;

    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain))
}

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


   function open_casino()
{
      OpenDownCasino('2323');
}

function OpenDownCasino(location)
{ 
        OpenAndDownload(location,'littlewoodscasinog2');
}

function OpenDownPoker(location)
{ 
        OpenAndDownload(location,'littlewoodspokerg2');
}

function OpenAndDownload(location,brand)
{
    try {
        ntptAddPair("dl",location);
        ntptEventTag("ev=download_" + brand);
     }catch(err){}
    //this to avoid javascript errors in SWOT pages
     try {
     setDownloadStatus();
    }catch(err){} 
    var sURLreg = "/downloadclient.htm?"+ "&dl=" + location + "&DownloadBrand=" + brand;
    window.open(sURLreg,"popDown","width=1,height=1,top=0,left=0");
    document.location.href="/download.htm";
}

function setDownloadStatus()
{
    setCookie("downloaded","1","/");
}



function setCookie(name,value)
{
    var argv = setCookie.arguments;
    var argc = setCookie.arguments.length;
    var path = (argc > 2) ? argv[2] : null;
    var expires = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;

    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain))
}

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));
    
}


   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 showFlash(flashPath,imgPath,imgHref ,imgWidth, imgHeight)
{
    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="' + imgWidth + '" height="' + imgHeight + '" id="main_lw" align="middle" VIEWASTEXT>');
        document.write('<param name="movie" value="' + flashPath + '" />');
        document.write('<param name="quality" value="high" />');
        document.write('<param name="bgcolor" value="#000000" />');
        document.write('<param name="wmode" VALUE="transparent" />');
        document.write('<param name="allowScriptAccess" value="always" />');
       
        document.write('<embed src="'+ flashPath + '"  wmode="transparent" quality="high" bgcolor="#000000" width="' + imgWidth + '" height="' + imgHeight + '" name="main_lw" allowScriptAccess="always" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>');
    }
    else
    {
        document.write('<a  href="' + imgHref + '"><img alt="Littlewoods Casino" width="' + imgWidth + '" height="' + imgHeight + '" border="0" src="' + imgPath + '"></a>');
    }
}


function showOnlyFlash(flashPath,flashWidth, flashHeight)
{
    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="flashWidth" height="flashHeight" hspace="30" id="main_lw" align="middle" VIEWASTEXT>');
        document.write('<param name="movie" value="' + flashPath + '" />');
        document.write('<param name="quality" value="high" />');
        document.write('<param name="allowScriptAccess" value="always" />');
       
        document.write('<embed src="'+ flashPath + '" width="flashWidth" height="flashHeight" hspace="30" quality="high" name="main_lw" allowScriptAccess="always" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>');
    }
}

