////////////////////////////////////////////////////////////
// Global Variables
////////////////////////////////////////////////////////////
var goExit = 0;

////////////////////////////////////////////////////////////////
// Global Functions / MX Generated
////////////////////////////////////////////////////////////////




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;
}
/* Functions that swaps images. */
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 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;
}

/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}  
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

////////////////////////////////////////////////////////////////
// Get Cookie from client
////////////////////////////////////////////////////////////////
function getCookie(nameP){
	if (document.cookie.length > 0){
		// check if there are any 
		offset = document.cookie.indexOf(nameP);
		if (offset != -1){
			// if cookie exists
			offset += nameP.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;
			}
			return unescape(document.cookie.substring(offset, end))
			}
	}
	return "";
}

////////////////////////////////////////////////////////////////
// Pop Up?
////////////////////////////////////////////////////////////////
function PopExitTraffic(){
		// Refresh or close
		if(goExit == 0){
				// Comment if you want to pop everytime that somebody refresh
				if(getCookie("exit") == ""){
					window.open('http://www.slotfevercasino.com/affiliates/aiddownload.asp?affid=883&redirect=%2Fhome%2Easp','exit');
				}
				// Set cookie on client
				document.cookie = "exit=yes";
		}
}

////////////////////////////////////////////////////////////////
// Add Bookmark
////////////////////////////////////////////////////////////////
function addbookmark(){ 
	var strBookUrl, strBookTxt;
	strBookUrl = "http://www.vegasmagic.com";
	strBookTxt = "Vegas Magic Casino";
	if(document.all){
			window.external.AddFavorite(strBookUrl,strBookTxt);
	}
}

////////////////////////////////////////////////////////////////
// Email Validator
////////////////////////////////////////////////////////////////
function Download_Validator(theForm){
  if ( theForm.Email.value == "" || theForm.Email.value.length < 6 || theForm.Email.value.search('@') == -1 || theForm.Email.value.search('.') == -1 || theForm.Email.value.search(' ') != -1){
    alert("Please enter your E-mail.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}
////////////////////////////////////////////////////////////////
// Scroller Ticker
////////////////////////////////////////////////////////////////
// Vars for ticker
//Change script's width (in pixels)
var marqueewidth=400;
//Change script's height (in pixels, pertains only to NS)
var marqueeheight=20;
//Change script's scroll speed (larger is faster)
var speed=5;
// Message of ticker
//Change script's contents
//var marqueecontents='<font face="Arial" font color="#FFFFFF"><big>Play Vegas Magic Progressive Games and you could win over $100,000.00 instantly!  Over 1.5 million dollars in payouts to date! <a href="promotions.html">Click Here to see our latest promotional offers for new players</a></big></strong></font><background color="#00080">'
var marqueecontents = '<font color="#FFFFFF" size="4" face="Arial"><strong>Play Vegas Magic Progressive Games and you could win over $100,000.00 instantly!  Over 1.5 million dollars in payouts to date! <a href="promotions.html">Click Here to see our latest promotional offers for new players</a></strong></font>';


////////////////////////////////////////////////////////////////
// Functions for Ticker
////////////////////////////////////////////////////////////////
function StartTicker(){
	if (document.all){
		document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>');
	}
	// Start Ticker
	//window.onload=regenerate2;
}

function regenerate(){
	window.location.reload()
}

function regenerate2(){
	if (document.layers){
		setTimeout("window.onresize=regenerate",450)
		intializemarquee()
	}
}

function intializemarquee(){
	document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>');
	document.cmarquee01.document.cmarquee02.document.close();
	thelength=document.cmarquee01.document.cmarquee02.document.width;
	scrollit();
}

function scrollit(){
	if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
		document.cmarquee01.document.cmarquee02.left-=speed;
		setTimeout("scrollit()",100);
	}else{
		document.cmarquee01.document.cmarquee02.left=marqueewidth;
		scrollit();
	}
}