/* ******************** Home Page *************************** */

/* Random for Homepage - Slotgames images */
function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="images/homepage/slotgames/desert-treasuer.gif"
  myimages[2]="images/homepage/slotgames/LottoMania.gif"
  myimages[3]="images/homepage/slotgames/ANightOut.gif"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe"
  imagelinks[2]="http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe"
  imagelinks[3]="http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
	 ry=1
	 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border="0" alt="{$var.site_name}" /></a>')
}

function flg_mn(){
	
	$('#language').hover(
			function() {
							onImg = true;
							$('#dropmenudiv').fadeIn('fast');
						}, 
			function(){
							onImg = false;
							setTimeout(function(){if (!onMenu) $('#dropmenudiv').fadeOut('fast');},50);
					  }
					);

	$('#dropmenudiv').hover(
		function(){
					onMenu = true;
				}, 
		function(){ 
					onMenu = false; 
					setTimeout(function(){if (!onImg) $('#dropmenudiv').fadeOut('fast');},50);
			});
}

/* /Random for Homepage - Slotgames images */



/* Homepage - Winner Switcher 

function switchWinner1(){
	$("td.winnersBox div.winnerDiv1").fadeOut("slow",
		function(){
			$("td.winnersBox div.winnerDiv2").fadeIn("slow");
		}
	);
	setTimeout('switchWinner2()', 6000);
}


function switchWinner2(){
	$("td.winnersBox div.winnerDiv2").fadeOut("slow",
		function(){
			$("td.winnersBox div.winnerDiv1").fadeIn("slow");
		}
	);
	setTimeout('switchWinner1()', 6000);
}

 /Homepage - Winner Switcher */
/*
// Slider Popup
function runFlash(){
	document.getElementById('flashPopup').innerHTML = 
//	'<object type="application/x-shockwave-flash" data="images/popup/sp_300x250.swf" width="300" height="250" id="WS_300x250" align="middle">' +
//		'<param name="allowScriptAccess" value="sameDomain" /> ' +
//		'<param name="movie" value="images/popup/sp_300x250.swf" />' +
//		'<param name="flashvars" value="lnk=http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe" />' +
//		'<param name="quality" value="high" />' +
//		'<param name="bgcolor" value="#000000" />' +
//	'</object>';
	'<a href="http://banner.clubdicecasino.com/cgi-bin/SetupCasino.exe"><img src="images/popup/german_secure.jpg" width="300" height="250" border="0" /></a>';
}*/

// Preload media in body
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}


/* ******************** General *************************** */

/* Arrays for the Date */
var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";

var monthname=new Array(7);
monthname[0]="Jan";
monthname[1]="Feb";
monthname[2]="Mar";
monthname[3]="Apr";
monthname[4]="May";
monthname[5]="Jun";
monthname[6]="Jul";
monthname[7]="Aug";
monthname[8]="Sep";
monthname[9]="Oct";
monthname[10]="Nov";
monthname[11]="Dec";

/* /Arrays for the Date */

/* General Stuff */

// General Popup
function openFlashWin(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Script the opening-closing boxes
function ne(el)
{
var e = document.getElementById(el);
if (e.style.display=='none')
	e.style.display='';
else
	e.style.display='none';
}


function popwin(url)
{
	win = window.open(url,'window','width=800,height=600');
	win.focus();
}

// VIP Popup
function popwin2(url)
{
	win = window.open(url,'window','width=400,height=420');
	win.focus();
}
/* /General Stuff */


// Closes all before opens the clicked one
function closebox(el)
{
	e2 = document.getElementById(el);
	if (e2.style.display=='none'){
		for(i=1; i<tabsum; i++) {
		  divnum = ("tab"+i);
		  var e = document.getElementById(divnum);
		  e.style.display='none';
		}
		e2.style.display='';
	}else{
		e2.style.display='none';
	}
}
