/* Smooth scrolling
   Changes links that link to other parts of this page to scroll
   smoothly to those links rather than jump to them directly, which
   can be a little disorienting.
   
   sil, http://www.kryogenix.org/
   
   v1.0 2003-11-11
   v1.1 2005-06-16 wrap it up in an object
*/

var ss = {
  fixAllLinks: function() {
    // Get a list of all links in the page
    var allLinks = document.getElementsByTagName('a');
    // Walk through the list
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
  //    if ((lnk.href && lnk.href.indexOf('#') != -1) && 
  //        ( (lnk.pathname == location.pathname) ||
//	    ('/'+lnk.pathname == location.pathname) ) && 
 //         (lnk.search == location.search)) {
        // If the link is internal to the page (begins in #)
        // then attach the smoothScroll function as an onclick
        // event handler
 //       ss.addEvent(lnk,'click',ss.smoothScroll);
  //    }

//rewrite
//if (lnk.hash.length<2) document.getElementsByTagName('a')[i].hash.value='#onlinecasinoguidebottom';
     if ((lnk.href && lnk.href.indexOf('#') != -1 && lnk.hash.length>2) && 
         ( (lnk.pathname == location.pathname) ||
	    ('/'+lnk.pathname == location.pathname) ) && 
          (lnk.search == location.search)) {
        // If the link is internal to the page (begins in #)
        // then attach the smoothScroll function as an onclick
        // event handler
        ss.addEvent(lnk,'click',ss.smoothScroll);
       }



    }
  },



  smoothScroll2: function(target) {
        anchor = target.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
  
    // And stop the actual click happening
    if (window.event) {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
    }
    if (e && e.preventDefault && e.stopPropagation) {
      e.preventDefault();
      e.stopPropagation();
    }
  },


















  smoothScroll: function(e) {
    // This is an event handler; get the clicked on element,
    // in a cross-browser fashion
    if (window.event) {
      target = window.event.srcElement;
    } else if (e) {
      target = e.target;
    } else return;

    // Make sure that the target is an element, not a text node
    // within an element
    if (target.nodeName.toLowerCase() != 'a') {
      target = target.parentNode;
    }
  
    // Paranoia; check this is an A tag
    if (target.nodeName.toLowerCase() != 'a') return;
  
    // Find the <a name> tag corresponding to this href
    // First strip off the hash (first character)
    anchor = target.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
  
    // And stop the actual click happening
    if (window.event) {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
    }
    if (e && e.preventDefault && e.stopPropagation) {
      e.preventDefault();
      e.stopPropagation();
    }
  },

  scrollWindow: function(scramount,dest,anchor) {
    wascypos = ss.getCurrentYPos();
    isAbove = (wascypos < dest);
    window.scrollTo(0,wascypos + scramount);
    iscypos = ss.getCurrentYPos();
    isAboveNow = (iscypos < dest);
    if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
      // if we've just scrolled past the destination, or
      // we haven't moved from the last scroll (i.e., we're at the
      // bottom of the page) then scroll exactly to the link
      window.scrollTo(0,dest);
      // cancel the repeating timer
      clearInterval(ss.INTERVAL);
      // and jump to the link directly so the URL's right
      location.hash = anchor;
    }
  },

  getCurrentYPos: function() {
    if (document.body && document.body.scrollTop)
      return document.body.scrollTop;
    if (document.documentElement && document.documentElement.scrollTop)
      return document.documentElement.scrollTop;
    if (window.pageYOffset)
      return window.pageYOffset;
    return 0;
  },

  addEvent: function(elm, evType, fn, useCapture) {
    // addEvent and removeEvent
    // cross-browser event handling for IE5+,  NS6 and Mozilla
    // By Scott Andrew
    if (elm.addEventListener){
      elm.addEventListener(evType, fn, useCapture);
      return true;
    } else if (elm.attachEvent){
      var r = elm.attachEvent("on"+evType, fn);
      return r;
    } else {
      alert("Handler could not be removed");
    }
  } 
}

ss.STEPS = 25;

ss.addEvent(window,"load",ss.fixAllLinks);





function window_onnscroll()
{
the_timeout= setTimeout('window_onnscroll();',500);
  var el = document.getElementById('Menu');
  if(el!=null)
  {
    if(typeof(document.media)=='string')
    {// only do this for ie
      var s;
      // scrolling offset calculation via www.quirksmode.org
      if (self.pageYOffset){
        s = self.pageYOffset;
      }else if (document.documentElement && document.documentElement.scrollTop) { 
        s = document.documentElement.scrollTop; 
      }else if (document.body) { 
        s = document.body.scrollTop; 
      }
	//var h=document.body.height-500;
      if (s<600) el.style.top= s + 50;
	if (s>50) el.style.top= s+20;
	
    }

    if(typeof(window.print)=='function')
    {// only do if not ie
      var x;
      // scrolling offset calculation via www.quirksmode.org
      if (self.pageXOffset){ 
        x = self.pageXOffset;
      }else if (document.documentElement && document.documentElement.scrollTop){ 
        x = document.documentElement.scrollLeft; 
      }else if (document.body) { 
        x = document.body.scrollLeft;
      }
      el.style.left = (548 - x) + "px";
    }
  }
cleartimeout(the_timeout);

}

var tempX=5;

function window_oxnscroll()
{
//the_timeout= setTimeout('window_onscroll();',500);
//mouse positions
//var tempX = event.clientX +document.body.scrollLeft;
//tempY = event.clientY + document.body.scrollTop;
// 
//alert(event.clientX);

if ((window.event.clientX+document.body.scrollLeft)<10)
//event.clientX;
 {Menu.style.top = document.body.scrollTop; nav.style.top = document.body.scrollTop;}
//cleartimeout(the_timeout); 
}


function hdr_ref(object)
{
	if (document.getElementById)
	{
		return document.getElementById(object);
	}
	else if (document.all)
	{
		return eval('document.all.' + object);
	}
	else
	{
		return false;
	}
}

function hdr_expand(object)
{
	var object = hdr_ref(object);

	if( !object.style )
	{
		return false;
	}
	else
	{
		object.style.display = '';
	}

	if (window.event)
	{
		window.event.cancelBubble = true;
	}
}

function hdr_contract(object)
{
	var object = hdr_ref(object);

	if( !object.style )
	{
		return false;
	}
	else
	{
		object.style.display = 'none';
	}

	if (window.event)
	{
		window.event.cancelBubble = true;
	}
}

function hdr_toggle(object, open_close, open_icon, close_icon)
{
	var object = hdr_ref(object);
	var icone = hdr_ref(open_close);

	if( !object.style )
	{
		return false;
	}

	if( object.style.display == 'none' )
	{
		object.style.display = '';
		icone.src = close_icon;
	}
	else
	{
		object.style.display = 'none';
		icone.src = open_icon;
	}
}


function handleerror(){
return true;
}
onerror = handleerror

sfHover = function() {
	var sfEls = document.getElementById("nav").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 && top.location==location) window.attachEvent("onload", sfHover);


function pagesize()
{
if (top.location==location) {
var mess; mess="";
diff=0; //non IE browsers don't need this check
if (document.all && navigator.userAgent.indexOf("Opera") < 0) diff=(1000-document.body.clientWidth);
if (diff>0) window.open('reload2.html','_self');
} // end frame check
}

//
// phpOpenTracker - The Website Traffic and Visitor Analysis Solution
//
// Copyright 2000 - 2005 Sebastian Bergmann. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

var client_id = 1;

// Taken from http://www.jan-winkler.de/hw/artikel/art_j02.htm

function base64_encode(decStr) {
  var base64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  var bits;
  var dual;
  var i = 0;
  var encOut = '';

  while(decStr.length >= i + 3) {
    bits = (decStr.charCodeAt(i++) & 0xff) <<16 |
           (decStr.charCodeAt(i++) & 0xff) <<8 |
            decStr.charCodeAt(i++) & 0xff;

    encOut += base64s.charAt((bits & 0x00fc0000) >>18) +
              base64s.charAt((bits & 0x0003f000) >>12) +
              base64s.charAt((bits & 0x00000fc0) >> 6) +
              base64s.charAt((bits & 0x0000003f));
  }

  if(decStr.length -i > 0 && decStr.length -i < 3) {
    dual = Boolean(decStr.length -i -1);

    bits = ((decStr.charCodeAt(i++) & 0xff) <<16) |
           (dual ? (decStr.charCodeAt(i) & 0xff) <<8 : 0);

    encOut += base64s.charAt((bits & 0x00fc0000) >>18) +
              base64s.charAt((bits & 0x0003f000) >>12) +
              (dual ? base64s.charAt((bits & 0x00000fc0) >>6) : '=') +
              '=';
  }

  return(encOut);
}


function getVPos() {

var scrolled; //Declaring a local variable
if (top.location!=location)
{
if (document.documentElement && document.documentElement.scrollTop) { scrolled = document.documentElement.scrollTop; } //Sniffing for IE5
else if (document.body) { scrolled = document.body.scrollTop; } //Sniffing for IE6
else { scrolled = window.pageYOffset; } //Sniffing for Netscape
if (scrolled<25) scrollTo(0,25);
} //end if in frame


}

var lastposition=0;

function movingmenu(e) {
var z;
// capture the mouse position 
    var posx = 0; 
    var posy = 0; 
    if (!e) var e = window.event; 
    if (e.pageX || e.pageY) 
    { 
	   
	posx = e.pageX; 
      posy = e.pageY; 
    } 
    else if (e.clientX || e.clientY) 
    { 
        posx = e.clientX; 
        posy = e.clientY; 
    } 



// replace window.event.clientX   with posx
if ((posx)<20)   //+document.body.scrollLeft causes flashes in menu
//event.clientX;
 {


Menu.style.top = (document.body.scrollTop+50)+'px';  lastposition=document.body.scrollTop;

if (get_cookie('menureminder')==''){
alert('To save time scrolling, you can bring the Main Menu down by moving the mouse to the left side of the page!');
document.cookie="menureminder=yes"
                 }

}// nav.style.top = document.body.scrollTop+30; }




// {Menu.style.top = 30; nav.style.top = 30;  }

if ((posx>350) && Menu.style.top!='50px')
//event.clientX;
//{	for (z=lastposition;z>50;z=z-10)
{Menu.style.top = 50+'px';}  //} // nav.style.top = 50;}

//document.getElementById('Menu').innerHTML = ': X='+posx+' Y='+posy; 

}



var diff;
var locallink=false;
var inlinelink="http://www.fair"+domainname+".com/forum/topcasinos.php";
var warning=0;
var win = null;


function Gk_PopTart(mypage,myname,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0';
  win = window.open(mypage,myname,settings);
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function strpos(str, ch) { for (var i = 0; i < str.length; i++) if (str.substring(i, i+1) == ch) return i; return -1; }

function setupLinks(){
//if (top.location==location) {
//var mess; mess="";
//diff=0; //non IE browsers don't need this check
//if (document.all && navigator.userAgent.indexOf("Opera") < 0) diff=(1000-document.body.clientWidth);
//if (diff>0) {if (screen.width<1024) mess='You need to change your resolution to at least 1024x768 to allow the //page to fit the screen.';
//window.open('reload2.html','_self');
//}

//} //if not in frame
document.onmousemove=movingmenu;
var j=0;
getVPos();
for (var i=0;i<document.forms.length;i++){
if (document.forms[i].name!="post" && document.forms[i].name!="fred" && document.forms[i].target!="Counters") document.forms[i].onsubmit = function(){ for (ii = 0; ii < this.length; ii++) {
			var formElement = this.elements[ii];
				if (formElement.type=='bmit') {
					formElement.disabled = true;
				}
}
 locallink = true; this.action=this.action+'#online'+domainname+'guidebottom';}
if (document.forms[i].target=="Counters") document.forms[i].onsubmit = function(){for (ii = 0; ii < this.length; ii++) {
			var formElement = this.elements[ii];
				if (formElement.type=='bmit') {
					formElement.disabled = true;
				}
} window.open('#online'+domainname+'guide','_self'); frame = document.getElementById('smallframe'); objToResize = (frame.style) ? frame.style : frame;objToResize.height = 300;previous=300; locallink=true;} 
}
var yPos		= 100;		// Distance in pixels from top of screen
var showMulti	= false;	// Set true to show every page load

//ccopen('Casino','http://www.fair'+domainname+'.com/forum/redirect.php?URL=http%3A%2F%2Frecord.commissionking.com%2F_214d9da69f5ebbe62031664759ed283a%2F1%2F&name=Canbet+Casino+%28Queens+Club%29',yPos,showMulti);





for (var i=0;i<document.links.length;i++){
//first IF excludes the obvious ones not to to add hash value # - _top is used for links to homepage  _blank is used to force target to iframe 'Counters'
if (document.links[i].href.indexOf("#")<1 && document.links[i].target!="_self" && document.links[i].target!="_top" && document.links[i].href.substring(0, 4)!="java" && document.links[i].innerText!="BACK" && document.links[i].innerText!="Here" && document.links[i].innerText!="FORWARD" && document.links[i].innerText!="BACK" && document.links[i].innerText!="[+]" && document.links[i].innerText!="[-]" && document.links[i].target!="Vote")

if ((document.links[i].href.substring(0, 4) != 'http') || (document.links[i].href.substring(0, (26+strlenoffset)) == 'http://www.fair'+domainname+'.com') || (document.links[i].href.substring(0, (22+strlenoffset)) == 'http://fair'+domainname+'.com') || document.links[i].href.indexOf('http://www.fair')>-1 || document.links[i].href.indexOf('http://fair')>-1 || document.links[i].href.indexOf("/babelfish/")>1)

{document.links[i].onclick = function()
				{if (this.target=="_blank") 
					{this.target="Counters"; if (this.href.indexOf("redirect.php?ban")!=-1)
									 {if (confirm('You are visiting one of the few highly reputable and recommended gaming sites.\n\nYou will see the site open up in a frame within Fair'+domainname.substr(0, 1).toUpperCase() + domainname.substr(1)+'.com and then open up in the same window.\n\nHold CTRL key and click the Cancel button if you prefer to view the gaming site on its own window.'))
											 {currentTime = new Date(); this.href = this.href + '&millisecs='+currentTime.getTime(); this.target=="Counters";} else
											 {window.open(this.href,'_blank'); return false;}
									} 
					} 
					if (this.target=="Counters") 
									{//window.open('#online'+domainname+'guide','_self');
this.hash='#online'+domainname+'guide';// Find the <a name> tag corresponding to this href
    // First strip off the hash (first character)
    anchor = this.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);







 frame = document.getElementById('smallframe');
objToResize = (frame.style) ? frame.style : frame;objToResize.height = 300;previous=300;
									} 
					locallink = true;
						 if (this.innerText!="WHOLE WINDOW") 
										{if (top.location==location)
												 {inlinelink=this.href;} else {parent.inlinelink=this.href;}
										 if (this.target!="Counters" )
												{ // moved to next line window.open(this.href,'_self');
this.hash='#online'+domainname+'guidebottom'; window.open(this.href,'_self');
// Find the <a name> tag corresponding to this href
    // First strip off the hash (first character)
    anchor = this.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);


return false;}
										} 
							else {wholewindow(); return false;}
				} 
} else 
{document.links[i].onclick = function() {
//window.open('#online'+domainname+'guide','_self'); 

this.hash='#online'+domainname+'guide';
// Find the <a name> tag corresponding to this href
    // First strip off the hash (first character)
    anchor = this.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);




if (this.innerText!="WHOLE WINDOW") {if (top.location==location) {inlinelink=this.href;} else {parent.inlinelink=this.href;} this.target="Counters";frame = document.getElementById('smallframe');
objToResize = (frame.style) ? frame.style : frame;objToResize.height = 300;previous=300;} else {wholewindow(); return false;} } }

} //end for

window.onscroll=getVPos
//window.onresize=pagesize


}


function loadornot(){
var nowDate = new Date();
if (!locallink)
 {

if (get_cookie('popover')==''){
loadpopover()
document.cookie="popover=yes"
                 }

 }
}

function loadpopover(){
doyou = false;//confirm("You were not signed in at Fair"+domainname.substr(0, 1).toUpperCase() + domainname.substr(1)+".com.\n\n If you are not registered, please click OK to register to be able to participate and enter the competitions.\n\n You can also provide feedback about the site if you don't wish to register.\n\n IMPORTANT: You should hold the Ctrl key down when you click OK to ensure the popup registration window is not blocked."); 
if (doyou == true) 
//window.location = 'privmsg.php?folder=inbox'; 
Gk_PopTart('exit_popup_question.html','Question','500','650','0')
}


/******************************************
* Snow Effect Script- By Altan d.o.o. (snow@altan.hr, http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
* Modified Dec 31st, 02' by DD. This notice must stay intact for use

  

  //Configure below to change URL path to the snow image
  var snowsrc="http://www.fair"+domainname+".com/snow.gif"
  // Configure below to change number of snow to render
  var no = 10;

  var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width , doc_height;
  
//  if (ns4up||ns6up) {
//    doc_width = self.innerWidth;
//indent=140+(self.innerWidth-850)/2;
//    doc_height = self.innerHeight;
//  } else if (ie4up) {
//    doc_width = document.body.clientWidth;
//indent=140+(document.body.clientWidth-850)/2;
//    doc_height = document.body.clientHeight;
//  }
 doc_width=725;
 doc_height = 230;
indent=240;
  
  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  
  for (i = 0; i < no; ++ i) {  
    dx[i] = 0;                        // set coordinate variables
    xp[i] = indent+Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();     // set step variables
    if  (ns4up) {
                     // set layers
      if (i == 0) {
        document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http:\/\/www.fair"+domainname+".com\/forum\/online-casino-guide-10896.html#online"+domainname+"guidebottom\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/layer>");
      } else {
        document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http:\/\/www.fair"+domainname+".com\/forum\/online-casino-guide-10896.html#online"+domainname+"guidebottom\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/layer>");
      }
    } else if  (ie4up||ns6up) {
      if (i == 0) {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http:\/\/www.fair"+domainname+".com\/forum\/online-casino-guide-10896.html#online"+domainname+"guidebottom\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
      } else {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http:\/\/www.fair"+domainname+".com\/forum\/online-casino-guide-10896.html#online"+domainname+"guidebottom\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
      }
    }
  }
  
  function snowNS() {  // Netscape main animation function
    for (i = 0; i < no; ++ i) {  // iterate for every dot
      yp[i] += sty[i];
      if (yp[i] > doc_height-50) {
        xp[i] = indent+Math.random()*(doc_width-am[i]-30);
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
        doc_width = self.innerWidth;
        doc_height = 230; doc_width=725;
indent=140+(self.innerWidth-850)/2;
      }
      dx[i] += stx[i];
      document.layers["dot"+i].top = yp[i];
      document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowNS()", 10);
  }

  function snowIE_NS6() {  // IE and NS6 main animation function
    for (i = 0; i < no; ++ i) {  // iterate for every dot
     yp[i] += sty[i];
     if (yp[i] > doc_height-50) {
        xp[i] = indent+Math.random()*(doc_width-am[i]-30);
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
        //doc_width = ns6up?window.innerWidth : document.body.clientWidth;
        doc_height = 230;
doc_width=725;
indent=140+(document.body.clientWidth-850)/2;
      }
      dx[i] += stx[i];
      if (ie4up){
      document.all["dot"+i].style.pixelTop = yp[i];
      document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
      }
      else if (ns6up){
      document.getElementById("dot"+i).style.top=yp[i];
      document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]);
      }   
    }
    setTimeout("snowIE_NS6()", 20);
  }

if (top.location==location) {
  if (ns4up) {
    snowNS();
  } else if (ie4up||ns6up) {
    snowIE_NS6();
 }
}

******************************************/

var previous=150;
Site_Search = new Array('Littlewoods','32Red','Aces High','RiverBelle','Cherry Casino','Home Casino','Lucky Nugget','Jackpot City','Showdown Casino');
Casino_Reviews = new Array('Littlewoods','32 Red','Aces High','RiverBelle','Cherry Casino','Home Casino','Lucky Nugget','Jackpot City','Showdown Casino');
Other_Sites = new Array('Casinomeister Forums|http://www.casinomeister.com/forums','WinnerOnline Forums|http://mb.winneronline.com','HodgePodge Forums|http://www.thehodge.com','http://www.','www.');
var siteurl='Lucky Nugget';

function auto_complete(n,ac,e){
if (ac=='Casino Reviews') {ac_array=Casino_Reviews; siteurl=n.value;} else
 if (ac=='Other Sites') {ac_array=Other_Sites;} else if (ac=='Site Search') {ac_array=Site_Search; siteurl=n.value;}
    if (n.value == "") return 0;
if (document.all) //IE keypress detect
{
if (event.keyCode == 8 && n.backspace){
       n.value = (n.value).substr(0,(n.value).length-1);
       n.backspace = false;
}
}
else{
   if (e.which == 8 && n.backspace){
       n.value = (n.value).substr(0,(n.value).length-1);
       n.backspace = false;
    }
  }//end non IE
    
    tmp= n.value;
    if (tmp == "")return 0;
    for (z=0;z<ac_array.length;z++){
        tmp2 = ac_array[z];
pos=tmp2.indexOf("|");
if (pos>0) {siteurl2=tmp2.substring(pos+1,tmp2.length); tmp2=tmp2.substring(0,pos);}

        count = 0;
        for (i = 0;i<tmp.length;i++){
            if ((tmp2.charAt(i)).toLowerCase() == (tmp.charAt(i)).toLowerCase()){
                count++
            }
         }
	    if (count == tmp.length){
            diff = tmp2.length - tmp.length;
            if (diff <= 0) break;
            kap = "";
            for (i=0;i<tmp2.length;i++){
                if (i >= tmp.length) kap += tmp2.charAt(i);
            }
            n.backspace = true;
     if (document.selection)
{var r = n.createTextRange();   
            r.text += kap;
            r.findText(kap,diff*-2);
            r.select();}
else // non IE support
{
var startPos = (n.value).length;
  var endPos = startPos+kap.length;
n.value+=kap;
n.focus();
        n.selectionStart = startPos; 
     n.selectionEnd = endPos; 

//n.setSelectionRange(startPos, endPos); 

}
if (pos>0) {siteurl=siteurl2} else {if (ac!='Other Sites') {siteurl=tmp2;}}

            return 0;
        }
    }
    n.backspace = false;
if (ac=='Other Sites') {pos=tmp.indexOf("."); if (pos>0) siteurl=n.value; }
    return 0;
}

function openurl()
{
append='';prepend='';
if (document.fred.selec.value=='Casino Reviews') {append='#review1'; prepend='reviewcasino.php?casino=';}
if (document.fred.selec.value=='Site Search') {siteurl=siteurl.toLowerCase(); append='-.html'; prepend='online-casino-guide_searchterm-';
re = new RegExp (' ', 'gi') ; siteurl = siteurl.replace(re, '_') ; re = new RegExp ('online', 'gi') ; siteurl = siteurl.replace(re, 'internet') ; re = new RegExp ('casino', 'gi') ; siteurl = siteurl.replace(re, 'casinos') ; 
re = new RegExp ('casinoss', 'gi') ; siteurl = siteurl.replace(re, 'casinos') ; }
if (document.fred.selec.value=='Other Sites') {pos=siteurl.indexOf("http"); if (pos==-1) prepend='http://'; pos=siteurl.indexOf("."); if (pos==-1) siteurl='www.com';}

inlinelink=prepend+siteurl+append;
frames['Counters'].location.href=prepend+siteurl+append; 

if ((inlinelink.substring(0, 4) != 'http') || (inlinelink.substring(0, (26+strlenoffset)) == 'http://www.fair'+domainname+'.com') || (inlinelink.substring(0, (22+strlenoffset)) == 'http://fair'+domainname+'.com')  || document.links[i].href.indexOf('http://www.fair')>-1 || document.links[i].href.indexOf('http://fair')>-1  ){locallink=true;}

frame = document.getElementById('smallframe');
//innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
//objToResize.height = innerDoc.body.scrollHeight + 5;
objToResize.height = 300;
previous=300;
window.open('#online'+domainname+'guide','_self');
}

function openurl2(address)
{
append='';prepend=address;

inlinelink=prepend;
frames['Counters'].location.href=prepend; 

if ((inlinelink.substring(0, 4) != 'http') || (inlinelink.substring(0, (26+strlenoffset)) == 'http://www.fair'+domainname+'.com') || (inlinelink.substring(0, (22+strlenoffset)) == 'http://fair'+domainname+'.com')  || document.links[i].href.indexOf('http://www.fair')>-1 || document.links[i].href.indexOf('http://fair')>-1 ){locallink=true;}

frame = document.getElementById('smallframe');
//innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
//objToResize.height = innerDoc.body.scrollHeight + 5;
objToResize.height = 150;
previous=150;
window.open('#online'+domainname+'guide','_self');
}

function resizeup()
{
frame = document.getElementById('smallframe');
objToResize = (frame.style) ? frame.style : frame;
if (previous<1000) previous = previous+50;
objToResize.height = previous;
}

function resizedown()
{
frame = document.getElementById('smallframe');
objToResize = (frame.style) ? frame.style : frame;
if (previous>199) previous = previous-50;
objToResize.height = previous;
}

function wholewindow()
{
top.location.href=inlinelink;
if (!locallink) alert('Loading '+inlinelink+' in whole window.' );
}

function backorforward(m)
{
history.go(m);
frame = document.getElementById('smallframe');
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = 150;
previous=150; 
}

function scrolldown()
{
var scrolled; //Declaring a local variable
var maxypos;

//frame = document.getElementById('smallframe');
//objTochangestyle = (frame.style) ? frame.style : frame;
//objTochangestyle.overflow = "scroll";
//document.body.style.overflow="hidden";

//fix to stop it moving down during scroll
scrolled = self.window[0].document.body.scrollTop; window.frames['Counters'].scrollTo(0,scrolled+1); if (self.window[0].document.body.scrollTop<(scrolled+1)) {window.open('#online'+domainname+'guidebottom','_self');}

if (locallink)
{scrolled = self.window[0].document.body.scrollTop; // maxypos = self.window[0].document.body.offsetHeight;
for (z=0;z<previous;z++) {window.frames['Counters'].scrollTo(0,scrolled+z); if (self.window[0].document.body.scrollTop<(scrolled+z)) {z=previous;}}
} //if local link
else {window.status="Scroll arrows only work fully for local links!";window.open('#online'+domainname+'guidebottom','_self');}

//frame = document.getElementById('smallframe');
//objTochangestyle = (frame.style) ? frame.style : frame;
//objTochangestyle.overflow = "scroll";objTochangestyle.overflow = "visible";
//document.body.style.overflow="visible";
}

function scrollup()
{
var scrolled; //Declaring a local variable
var maxypos;
if (locallink)
{scrolled = self.window[0].document.body.scrollTop; // maxypos = self.window[0].document.body.offsetHeight;
for (z=0;z<previous;z++) {window.frames['Counters'].scrollTo(0,scrolled-z); if (self.window[0].document.body.scrollTop>(scrolled-z)) {if (z==1) window.open('#online'+domainname+'guide','_self'); z=previous;}}
} //if local link
else {window.status="Scroll arrows only work fully for local links!";window.open('#online'+domainname+'guide','_self');}
}
