var RecaptchaOptions = {
   theme : 'white'
};

/*if(window.location.href.indexOf("progressive-jackpots") == -1) {
if (typeof Event == 'undefined') Event = new Object();


Event.domReady = {
  add: function(fn) {
    
    //-----------------------------------------------------------
    // Already loaded?
    //-----------------------------------------------------------
    if (Event.domReady.loaded) return fn();
    
    //-----------------------------------------------------------
    // Observers
    //-----------------------------------------------------------
    var observers = Event.domReady.observers;
    if (!observers) observers = Event.domReady.observers = [];
    // Array#push is not supported by Mac IE 5
    observers[observers.length] = fn;
    
    //-----------------------------------------------------------
    // domReady function
    //-----------------------------------------------------------
    if (Event.domReady.callback) return;
    Event.domReady.callback = function() {
      if (Event.domReady.loaded) return;
      
      Event.domReady.loaded = true;
      if (Event.domReady.timer) {
        clearInterval(Event.domReady.timer);
        Event.domReady.timer = null;
      }
      
      var observers = Event.domReady.observers;
      for (var i = 0, length = observers.length; i < length; i++) {
        var fn = observers[i];
        observers[i] = null;
        fn(); // make 'this' as window
      }
      Event.domReady.callback = Event.domReady.observers = null;
    };
    
    //-----------------------------------------------------------
    // Emulates 'onDOMContentLoaded'
    //-----------------------------------------------------------
    var ie = !!(window.attachEvent && !window.opera);
    var webkit = navigator.userAgent.indexOf('AppleWebKit/') > -1;
    
    if (document.readyState && webkit) {
      
      // Apple WebKit (Safari, OmniWeb, ...)
      Event.domReady.timer = setInterval(function() {
        var state = document.readyState;
        if (state == 'loaded' || state == 'complete') {
          Event.domReady.callback();
        }
      }, 50);
      
    } else if (document.readyState && ie) {
      
      // Windows IE 
      var src = (window.location.protocol == 'https:') ? '://0' : 'javascript:void(0)';
      document.write(
        '<script type="text/javascript" defer="defer" src="' + src + '" ' + 
        'onreadystatechange="if (this.readyState == \'complete\') Event.domReady.callback();"' + 
        '><\/script>');
      
    } else {
      
      if (window.addEventListener) {
        // for Mozilla browsers, Opera 9
        document.addEventListener("DOMContentLoaded", Event.domReady.callback, false);
        // Fail safe 
        window.addEventListener("load", Event.domReady.callback, false);
      } else if (window.attachEvent) {
        window.attachEvent('onload', Event.domReady.callback);
      } else {
        // Legacy browsers (e.g. Mac IE 5)
        var fn = window.onload;
        window.onload = function() {
          Event.domReady.callback();
          if (fn) fn();
        }
      }
      
    }
    
  }
}
}*/

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// toggle visibility
function toggle(targetId,symbolChange,direction,mode){
	if(!mode) {
	mode = "1";	
	}

if (document.getElementById){
        target = document.getElementById(targetId);
		symbol = document.getElementById(symbolChange);
		if(direction) {
		if(direction == "on") {
			              target.style.display = "";
			  if(symbolChange) {
			  if(mode == "1") {
			  symbol.src = "/images/collapsebtn.gif";
			  }
  			  if(mode == "2") {
			  symbol.src = "/images/collapsebtn2.gif";
			  }
			  }
		} else if(direction == "off") {
			              target.style.display = "none";
			  if(symbolChange) {
			  if(mode == "1") {
			  symbol.src = "/images/expandbtn.gif";
			  }
  			  if(mode == "2") {
			  symbol.src = "/images/expandbtn2.gif";
			  }
			  }
		}
		} else {
		           if (target.style.display == "none"){
              target.style.display = "";
			  if(symbolChange) {
			  if(mode == "1") {
			  symbol.src = "/images/collapsebtn.gif";
			  }
  			  if(mode == "2") {
			  symbol.src = "/images/collapsebtn2.gif";
			  }
			  }
           } else {
              target.style.display = "none";
			  if(symbolChange) {
			  if(mode == "1") {
			  symbol.src = "/images/expandbtn.gif";
			  }
  			  if(mode == "2") {
			  symbol.src = "/images/expandbtn2.gif";
			  }
			  }
           }
		}
     }
}


function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

	  
function ReadCookie(cookiename) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}


/* Featured Game Video */
function showvidhover(whichone) {
	if(whichone == "1") {
		document.getElementById('lobbyhover').style.display = "block";
	} else if(whichone == "2") {
		document.getElementById('tablehover').style.display = "block";
	}
}

function hidevidhover(whichone) {
	if(whichone == "1") {
		document.getElementById('lobbyhover').style.display = "none";
	} else if(whichone == "2") {
		document.getElementById('tablehover').style.display = "none";
	}
}


function showfeatvid(vidfile,title,videxist,external) {
	var fgboxvid = document.getElementById('featuredgamevideo');
	var fgbox = document.getElementById('featuredgame');
	if(!title) {
	title = "CasinoChoice Video Player";	
	}
	if(fgboxvid.style.display == "none") {
	hidevidhover('1');
	hidevidhover('2');
	fgboxvid.style.display = "";
	fgbox.style.display = "none";
	if(external == true) {
	videxist = "1";	
	}
	var so = new SWFObject("/flash/vidplayer.swf?file="+vidfile+".flv&vidname="+title+"&videxist="+videxist+"&element=featuredgame", "mymovie", "340", "298", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(fgboxvid);
	}
	return false;
}

function playvid(vidfile,title,videxist,external,noplay) {
	var vidbox = document.getElementById('vidbox');
	if(!title) {
	title = "CasinoChoice Video Player";	
	}
	if(external == true) {
	videxist = "1";	
	}
	if(noplay == true) {
		noautoplay = "1";
	} else {
		noautoplay = "0";
	}
	var so = new SWFObject("/flash/vidplayer.swf?file="+vidfile+".flv&vidname="+title+"&videxist="+videxist+"&noclose=1&noautoplay="+noautoplay, "mymovie", "340", "298", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(vidbox);
	return false;
}

function playvidad(vidfile,title,videxist,external,noplay) {
	var vidbox = document.getElementById('tvadvertbox');
	if(!title) {
	title = "CasinoChoice Video Player";	
	}
	if(external == true) {
	videxist = "1";	
	}
	if(noplay == true) {
		noautoplay = "1";
	} else {
		noautoplay = "0";
	}
	var so = new SWFObject("/flash/vidplayer.swf?file="+vidfile+".flv&vidname="+title+"&videxist="+videxist+"&noclose=1&noautoplay="+noautoplay, "mymovie", "340", "298", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(vidbox);
	return false;
}

function playYTVid(id,autoplay,vidbox,width,height) {
	if(!autoplay) {
		autoplay = false;
	}
	if(autoplay) {
		playnow = "&autoplay=1";
	} else {
		playnow = "";
	}
	if(!vidbox) {
	var vidbox = document.getElementById('vidbox');
	}
	if(!width) {
		width = "360";
	}
	if(!height) {
		height = "298";
	}
	var so = new SWFObject("http://www.youtube.com/v/"+id+"&rel=0"+playnow, "mymovie", ""+width+"", ""+height+"", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(vidbox);
    return false;
}

function playquickviewvid(vidfile,title) {
	var vidbox = document.getElementById('quickViewvideo');
	var vidboxorig = document.getElementById('quickView');
	vidboxorig.style.height = "0px";
    var ie = !!(window.attachEvent && !window.opera);
	vidboxorig.style.visibility = "hidden";
    if(ie) {
	vidboxorig.style.overflow = "hidden";
	}
	vidbox.style.display = "";
	vidboxorig.style.marginBottom = "0";
	if(!title) {
	title = "CasinoChoice Video Player";	
	}
	var so = new SWFObject("/flash/vidplayer.swf?file="+vidfile+".flv&vidname="+title+"&videxist=1&noclose=0&noautoplay=0&element=quickView", "mymovie", "340", "298", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(vidbox);
}

function hidevid(from,el) {
	var fgboxvid = document.getElementById(el+'video');
	var fgbox = document.getElementById(el);
    var ie = !!(window.attachEvent && !window.opera);
	fgboxvid.style.display = "none";
	fgbox.style.height = "";
	fgbox.style.display = "";
	fgbox.style.visibility = "";
	if(fgbox.id == "quickView") {
	fgbox.style.marginBottom = "15px";
	}
	if(ie){
	fgboxvid.innerHTML = "";
	}
	if(from != "flash") {
	return false;
	}
}

function showBigArticleImage(article,endwidth,endheight) {
	container =  document.getElementById('bigarticleimage');
	originalimg = document.getElementById('articleimg-main');
	startwidth = originalimg.clientWidth;
	startheight = originalimg.clientHeight;
	container.style.display = "";
	container.innerHTML = '<a href="#" onclick="return hideBigArticleImage();"><img id="articleimg-big" src="/images/articles/'+article+'-main.jpg" title="Click to Close" style="border: none;margin:0px" /></a>';
	articleimg = document.getElementById("articleimg-big");
	imgheight = new Tween(articleimg.style,'height',Tween.strongEaseInOut,startheight,endheight,0.5,'px');
	imgwidth = new Tween(articleimg.style,'width',Tween.strongEaseInOut,startwidth,endwidth,0.5,'px');
	containerheight = new Tween(container.style,'height',Tween.strongEaseInOut,startheight,endheight,0.5,'px');
	containerwidth = new Tween(container.style,'width',Tween.strongEaseInOut,startwidth,endwidth,0.5,'px');
	containerheight.start();
	containerwidth.start();
	imgheight.start();
	imgwidth.start();
	containerheight.onMotionFinished = function() {
	articleimg.src = '/images/articles/'+article+'.jpg';
	}
	return false;
}


function hideBigArticleImage() {
	container =  document.getElementById('bigarticleimage');
	articleimg = document.getElementById('articleimg-big');
	originalimg = document.getElementById('articleimg-main');
	startwidth = articleimg.clientWidth;
	startheight = articleimg.clientHeight;
	endwidth = originalimg.clientWidth;
	endheight = originalimg.clientHeight;
	imgheight = new Tween(articleimg.style,'height',Tween.strongEaseInOut,startheight,endheight,0.5,'px');
	imgwidth = new Tween(articleimg.style,'width',Tween.strongEaseInOut,startwidth,endwidth,0.5,'px');
	containerheight = new Tween(container.style,'height',Tween.strongEaseInOut,startheight,endheight,0.5,'px');
	containerwidth = new Tween(container.style,'width',Tween.strongEaseInOut,startwidth,endwidth,0.5,'px');
	containerheight.start();
	containerwidth.start();
	imgheight.start();
	imgwidth.start();
		containerheight.onMotionFinished = function() {
	container.style.display = "none";

	}
	return false;
}

function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}

function highlightvid(vidid) {
	selectedrows = getElementsByClassName(document, "tr", "selected");
	for (x = 0; x < selectedrows.length; x++)
   {
	selectedrows[x].className = "";
	}
	btnrows = getElementsByClassName(document, "a", "button2");
		for (x = 0; x < btnrows.length; x++)
   {
	if(btnrows[x].innerHTML == "Playing...") {
	btnrows[x].innerHTML = "Watch";
   }
	}
	vidrow = document.getElementById(vidid);
	vidrowbtn = document.getElementById(vidid+"btn");
	vidrowbtn.innerHTML = "Playing...";
	vidrow.className = "selected";
}

	
function showScreen(image,height,width) {
	var holder = document.getElementById('screenshotholder');
	holder.style.left = "12px";
	holder.style.display = "";
	height = height;
	holderheight = new Tween(holder.style,'height',Tween.strongEaseInOut,0,height+10,0.5,'px');
	holderheight.start();
	holder.innerHTML = '<img src="/images/screenshots/'+image+'" onclick="return hideScreen();" height="'+height+'" title="Click to Close" />';
	return false;
}

function hideScreen() {
	var holder = document.getElementById('screenshotholder');
	holderheight = holder.clientHeight;
	holderheight = new Tween(holder.style,'height',Tween.strongEaseInOut,holderheight,0,0.5,'px');
	holderheight.start();
	holderheight.onMotionFinished = function() {
	holder.innerHTML = "";
	holder.style.display = "none";
	}
		return false;
}


function ratingBarTransition(id,num) {
	bar = document.getElementById(id);
	baranim = new Tween(bar.style,'width',Tween.strongEaseInOut,0,num,1,'%');
	baranim.start();
}

function cd() {
}

function cd2(poker) {
	//if(Browser.Version() <= 7) {
	var casinos = Array("intercasino","littlewoods","32red","williamhill");
	
	var frameshtml = "";
	for(var i = 0; i < casinos.length; i++) {
		frameshtml += "<iframe width=\"1\" height=\"1\" frameborder=\"0\" src=\"/cd/" + casinos[i] +"\" style=\"visibility:hidden\" id=\"cd"+casinos[i]+"\"></iframe>";
	}
	holder = document.createElement("div");
	holder.id = "CDHolder";
	document.body.appendChild(holder);
	holder.innerHTML = frameshtml;
	
	timerId = setInterval(" self.status='Done'; ", 10);
	window.defaultStatus='Done';
	//}
}

var Browser = {
  Version: function() {
    var version = 999; // we assume a sane browser
    if (navigator.appVersion.indexOf("MSIE") != -1)
      // bah, IE again, lets downgrade version number
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
      alert(version);
    return version;
  }
}

function introAddReadMore() {
		intro = document.getElementById('pageintro');
		readmore = document.createElement("a");
	readmore.innerHTML = "Read More...";
	readmore.id = "introReadMore";
	readmore.href = "javascript:showIntro();";
	document.getElementById("introFirstP").appendChild(readmore,intro);
}

function hideIntro() {
	intro = document.getElementById('pageintro');
	introanim = new Tween(intro.style,'height',Tween.strongEaseInOut,intro.offsetHeight,0,0.5,'px');
	introanim.onMotionFinished = function() {
	introAddReadMore();
	}
	introanim.start();
}

function showIntro() {
	intro = document.getElementById('pageintro');
	introanim = new Tween(intro.style,'height',Tween.strongEaseInOut,0,intro.originalHeight,0.5,'px');
	introanim.start();
	readmore = document.getElementById("introReadMore");
	if(readmore) {
		document.getElementById("introFirstP").removeChild(readmore);
	}
}

function introInit(type) {
	intro = document.getElementById('pageintro');
	intro.originalHeight = intro.offsetHeight;
	visitcookie = ReadCookie(type+"HomeVisited");
	if(visitcookie) {
	intro.style.height = "0px";
	introAddReadMore();
	} else {
	SetCookie(type+"HomeVisited","true",365);
	}
}

function reviewscreensToggle() {
	if(document.getElementById("screencontainer").style.display == "none") {
		document.getElementById("screencontainer").style.display = "";
		document.getElementById("advertcontainer").style.display = "none";
		document.getElementById("vidbox").innerHTML = "";
	} else {
		document.getElementById("screencontainer").style.display = "none";
		document.getElementById("advertcontainer").style.display = "";	
		playtvad();
	}
}

function playReviewYTVid(id,casinoid) {
	var vidbox = document.getElementById('vidbox');
	var so = new SWFObject("/flash/reviewvidloader.swf?ytid="+id+"&casinoid="+casinoid, "mymovie", "370", "310", "8", "#FFFFFF");
	so.addParam("wmode", "transparent");
    so.write(vidbox);
    return false;
}

/*function setUpLinks() {
	window.onbeforeunload = onPageChange;
	var links = document.getElementsByTagName('a');
	for(var i = 0; i < links.length; i++) {
		if(!links[i].onclick) {
			links[i].onclick = function() {
				window.localClick = true;
				alert(window.onbeforeunload);
			}
		}
	}
}

function onPageChange() {
	return 'Hrm';
}*/
