
   /* 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 addEvent(obj ,evt, fnc)
      {
        if (obj.addEventListener)
          obj.addEventListener(evt,fnc,false);
        else if (obj.attachEvent)
          obj.attachEvent('on'+evt,fnc);
        else
          return false;
        return true;
      }

      function removeEvent(obj ,evt, fnc)
      {
        if (obj.removeEventListener)
          obj.removeEventListener(evt,fnc,false);
        else if (obj.detachEvent)
          obj.detachEvent('on'+evt,fnc);
        else
          return false;
        return true;
      }

      //----------

      function appendElement(node,tag,id,htm)
      {
        var ne = document.createElement(tag);
        if(id) ne.id = id;
        if(htm) ne.innerHTML = htm;
        node.appendChild(ne);
      }

      //----------

      function showRedirectionPopup(p)
      {
        greyout(true);
        document.getElementById(p).style.display = 'block';
      }

      function hidePopup(p)
      {
        greyout(false);
        document.getElementById(p).style.display = 'none';
      }

      //----------

      function greyout(d,z)
      {
        var obj = document.getElementById('greyout');

        if(!obj)
        {
          appendElement(document.body,'div','greyout');
          obj = document.getElementById('greyout');
          obj.style.position = 'absolute';
          obj.style.top = '0px';
          obj.style.left = '0px';
          obj.style.background = '#111';
          obj.style.opacity = '.5';
          obj.style.filter = 'alpha(opacity=70)';
        }
        if(d)
        {
          var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
          var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
          var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
          if(document.body.scrollHeight) sh = Math.max(sh,document.body.scrollHeight)
          var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
          if(document.body.scrollWidth) sw = Math.max(sw,document.body.scrollWidth)
          var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
          var ww = window.innerWidth ? window.innerWidth : document.body.offsetWidth;
          if(!z){ z = 50 }
          obj.style.zIndex = z;
          obj.style.height = Math.max(wh, Math.max(sh,ch))+'px';
          obj.style.width  = Math.max(ww, Math.max(sw,cw))+'px';
          obj.style.display = 'block';
          if (window.addEventListener)
          {
              // adding handler for FF and other non-IE browsers
              window.addEventListener("resize", greyoutResize, false);
          }
          else
          {
              // adding handler for IE browsers
              document.body.onresize = greyoutResize;
          }
        }
        else
        {
          obj.style.display = 'none';   
          if (window.removeEventListener)
          {
              // removing handler for FF and other non-IE browsers
              window.removeEventListener("resize", greyoutResize, false);
          }
          else
          {
              // removing handler for IE browsers
              document.body.onresize = null;
          }
        }
      }

      function greyoutResize()
      {
        var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
        var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
        if(document.body.scrollHeight) sh = Math.max(sh,document.body.scrollHeight)
        var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
        if(document.body.scrollWidth) sw = Math.max(sh,document.body.scrollWidth)
        var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
        var ww = window.innerWidth ? window.innerWidth : document.body.offsetWidth;
        var obj = document.getElementById('greyout');
        obj.style.height = ch+'px';
        obj.style.width  = cw+'px';
        obj.style.height = Math.max(wh,Math.max(sh,ch))+'px';
        obj.style.width  = Math.max(ww, Math.max(sw,cw))+'px';
      }



   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)
{
   showFlash(flashPath,imgPath,imgHref , 'blank', imgWidth, imgHeight);
}

function showFlash(flashPath,imgPath,imgHref , linkTarget, 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 + '" target="' + linkTarget + '"><img alt="Online Games" 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>');
    }
}

function showOnlyFlashExtended(flashPath, flashWidth, flashHeight, hspace, quality, align, wmode)
{
    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="' + hspace + '" id="main_lw" align="' + align + '" VIEWASTEXT>');
        document.write('<param name="movie" value="' + flashPath + '" />');
        document.write('<param name="quality" value="' + quality + '" />');
        document.write('<param name="allowScriptAccess" value="always" />');
        document.write('<param name="wmode" VALUE="' + wmode + '" />');
        document.write('<embed src="'+ flashPath + '" width="' + flashWidth + '" height="' + flashHeight + '" hspace="' + hspace + '" quality="' + quality + '" name="main_lw" allowScriptAccess="always" align="' + align + '" wmode="' + wmode + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>');
    }
}


   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));
    
}


       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;

function mouseDown(event) {
    var ref = "";
    var srcEl = event.srcElement || event.target;
    // do nothing if event source is undefined (clicking on scrollbars, etc.)
    if (srcEl == null) {
        return;
    }

    // do not display exit popup when clicking language menu
    if (srcEl.id == "languageSelect") {
        ShowPopup = false;
        return;
    }

    // do not display exit popup after Entry Popup confirmation clicks
    if (srcEl.tagName == "AREA") {
        if(srcEl.href != null && srcEl.href.indexOf("EntryPopupDown") >= 0)
        {
            ShowPopup = false;
            return;
        }
    }

    // handle exit popup when clicking language menu or entry popup cancellations
    var currentNode = srcEl;
    while (currentNode.tagName != "BODY") {
        var currentParentNode = currentNode.parentNode;
        if (currentParentNode == null) {
            break;
        }
        if (currentParentNode.id == "languageSelect") {
            ShowPopup = false;
            return;
        }
        else if (currentParentNode.id == "popdiv") {
            // ignore the Entry Popup all other clicks
            ShowPopup = true;
            return;
        }
        else {
            currentNode = currentParentNode;
        }
    }

    //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;

    // do not display exit popup when clicking links
    if ((srcEl != null) && (srcEl.tagName == "A" || srcEl.tagName == "AREA")) {
        ShowPopup = false;
    }
}

function OpenExitPage(event) {
    if (ShowPopup && isHandlingNeeded(event)) {
        if (window.confirm(ExitPopupConfirmation)) {
            try {
                ntptEventTag("ev=" + OkEvent);
            } catch (err) { /* do nothing if error */ }
            window.open(ExitPopupURL, 'ExitPage', ExitPopupWindowParameters);
        } else {
            try {
                ntptEventTag("ev=" + ExitPopupCancelEvent);
            } catch (err) { /* do nothing if error */ }
        }
    }
}

function isIEBrowser() {
    if (navigator.appVersion.indexOf("IE") > 0) {
        return true;
    }
    return false;
}

function isHandlingNeeded(event) {
    if ((event.type == "beforeunload" && isIEBrowser()) || (event.type == "unload" && !isIEBrowser())) {
        return false;
    }
    return true;
}


   var ev_site_id = "";
window["EngagerTag"] = {};
EngagerTag.start = function(){}
EngagerTag.end = function(){}
document.write(unescape("%3Csc" + "ript src='" + location.protocol + "//serve.eyeviewdigital.com/engager.php?sid="+ev_site_id+"' type='text/javascript'%3E%3C/sc"+"ript%3E"));

//Send Unica wrapper function
function SendUnicaCode(msg)
{
    try 
    {
        ntptEventTag("ev=" + msg);
    } catch (err) { }
}


