var mywin = null;
var movieName = "home_promo";

	function clickbutton(){
		isOpenCasino = 0;
		openCasino('/loadCasino.jsp','avcasino',800,600);	
		self.location.href="/default.jsp?stopFlash=true";
	}

	function clickbutton1(){

	if (confirm ("Please note: We will be permanently retiring the Ausvegas site effective 13th October 2008.\n\nWould you like to register at our sister site www.lasseters.com instead and receive a ($ £ €) 20 FREE CASH BONUS, no deposit required?")) {
		self.location.href = "https://austrust.lasseters.com.au/portal?action=GoLoginSuccess&doreg=1&lang_choice=en";
	} else {
		isOpenCasino = 0;
		openCasino('/loadCasino.jsp?isNew=yes','avcasino',800,600);
		self.location.href="/default.jsp?stopFlash=true";
	}
			

	}//clickbutton1

	function clickbutton2(){
		isOpenCasino = 0;
		openCasino('/loadCasino.jsp','avcasino',800,600);	
		self.location.href="/default.jsp?stopFlash=true";
	}

	function popupform(myform, windowname)
	{	
		isOpenCasino = 0;
		if ((myform.id.value == '') || (myform.id.value == null)) {
			alert('please enter your casino login user name.');
			return false;
		}
		if ((myform.pass.value == '') || (myform.pass.value == null)) {
			alert('please enter your casino login password.');
			return false;
		}
		
		if (! window.focus)	return true;		
		myform.UserID.value=myform.id.value;
		myform.password.value=myform.pass.value;
		myform.id.value='';
		myform.pass.value='';
		
		//alert('Status of MyWin: [' + mywin + ']');
		if ((mywin == null) || (mywin.closed)) {
			x = (screen.width/2)-(800/2);
		    y = (screen.height/2)-(600/2);
			mywin=window.open('', windowname, 'height=600,width=800,scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,alwaysRaised=yes,hotkeys=no,innerHeight=580,innerWidth=795,left='+x+',top='+y);
			myform.target=windowname;
		}else {
			mywin.focus();
		}

		var date = new Date ();
		date.setTime(date.getTime()+(10*365*24*60*60*1000));
		var sessCookie="AusVegasRego=1;expires="+date.toGMTString();
		document.cookie = sessCookie;
		
		self.location.href="/default.jsp?stopFlash=true";
		mywin.focus;
		return true;
	}

	var tempWin = null;
	
	function openWindow(url, w, h, s) {
		var windowprops = "width=" + w + ",height=" + h + ",scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,alwaysRaised=yes,hotkeys=no,innerHeight=580,innerWidth=795";
		//var windowprops = "width=" + w + ",height=" + h + ",scrollbars=" + s;
		popup = window.open(url,'avcasino',windowprops);
	}

	function bName()
	{
		var is_major = parseInt(navigator.appVersion);
      		var agt=navigator.userAgent.toLowerCase();

	    	// return 1 for Internet Explorer
      		if (navigator.appName == "Microsoft Internet Explorer") return 1;

			// return 2 for Navigator
	       	if (navigator.appName == "Netscape") return 2;		// return 0 for other browsers
       		return 0;
	}	

	function openCasino(url,name,w, h)
	{
		w=800;h=600;
		//url="/loadCasino.jsp"
		x = (screen.width/2)-(w/2);
	    y = (screen.height/2)-(h/2);
		
		var size = "width=" + w + ",height=" + h + ",scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,alwaysRaised=yes,hotkeys=no,innerHeight=580,innerWidth=795,left="+x+",top="+y;
		var browser=bName();
	
		if (browser == 1)
		{
			if (navigator.userAgent.indexOf("Opera")!=-1) {
				tempWin = window.open(url, 'avcasino', size);
			}else if ((tempWin == null) || (tempWin.closed))
			{
				tempWin = window.open(url, 'avcasino', size);
			}
		}
		else if (browser == 2)
		{
			if (tempWin == null)
			{	
			    tempWin = window.open(url, 'avcasino', size);
			}
			else
			{
				//if (!tempWin.opener)
			    tempWin = window.open(url, 'avcasino', size);
			}
		}
		else
		{
		    tempWin = window.open(url, 'avcasino', size);
		}

	    tempWin.focus();
		window.location.href="/default.jsp?stopFlash=true";
	}

	function RemoveBad(strTemp) {
		str = strTemp.value;
		str = str.replace(/\<|\>|\"|\'|\%|\;|\(|\)|\&|\+/g,"");
		if (str!=strTemp.value) {
		    alert("Some characters, such as \"<\" or \"%\" cannot be used in this text field.\rYou cannot proceed until you remove them.");
		    strTemp.value="";
		    strTemp.focus();
		}//if
	}//end function

	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;
	}

	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_findObj(n, d) { //v4.0
	  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 && document.getElementById) x=document.getElementById(n); return x;
	}

	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];}
	}
	// -->