var mywin = null;
var movieName = "home_promo";
var existcookie=getCookie1("LassCurrency");
var isOpenCasino=false;

	function clickbutton(){
		isOpenCasino = true;

		if (parent.topframe!=null) {
			parent.topframe.openCasino('/loadCasino.jsp','LassCasino',800,600);
		}else{ 
			openCasino('/loadCasino.jsp','LassCasino',800,600);
		}
		if (self.location.href.indexOf('/portal') == -1) {
                        self.location.href="/default.jsp?stopFlash=true";
                } else {
                        self.location.href=self.location.href;
                }
		//self.location.href="/default.jsp?stopFlash=true";				
	}//clickbutton

	function clickbutton1(){
		isOpenCasino = true;
		if (parent.topframe!=null) {						
			parent.topframe.openCasino('/loadCasino.jsp?isNew=yes','LassCasino',800,600);
		}else{ 
			openCasino('/loadCasino.jsp?isNew=yes','LassCasino',800,600);
		}
		if (self.location.href.indexOf('/portal') == -1) {
                        self.location.href="/default.jsp?stopFlash=true";
                } else {
                        self.location.href=self.location.href;
                }
	}//clickbutton1

	function SBlogin(isNew, isAsianPlayer, trackinginfo){

		if (isNew == "yes")
		{
			window.location.href="/loadSportsbook.jsp?isNew=yes&fromAsian=" + isAsianPlayer + "&" + trackinginfo;
		}else{
			window.location.href="/loadSportsbook.jsp?fromAsian=" + isAsianPlayer + "&" + trackinginfo;
		}
	}//SBlogin

	function getCookie1(name){
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1)
		{
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
			}else{
				begin += 2;
			}
			var end = document.cookie.indexOf(";", begin);
			if (end == -1)
			{
				end = dc.length;
			}
			return unescape(dc.substring(begin + prefix.length, end));
	}//getCookie

	function popupform(myform, windowname)
	{	
		isOpenCasino = true;
		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.username.value=myform.id.value;
		myform.pwd.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="LassRego=1;domain=lasseters.com.au;path=/;expires="+date.toGMTString();
		document.cookie = sessCookie;	
		
		mywin.focus;

		if (self.location.href.indexOf('/portal') == -1) {
			self.location.href="/default.jsp?stopFlash=true";
		} else {
			self.location.href=self.location.href;
		}
	
		//mywin.focus;
		return true;
	}

	var tempWin = null;
	var popup = new Array();
	
	function setPopup()
	{
		var i;
		for(i=0; i<10; i++)	popup[i] = null;
	}

	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 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,'LassCasino',windowprops);
	}

	function openWinwithname(url, w, h, s, name, position) 
	{
		var windowprops = "width=" + w + ",height=" + h + ",scrollbars=" + s;

		if (bName() == 1)
		{
			if ((popup[position] == null) || (popup[position].closed))
			{
				popup[position] = window.open(url,name,windowprops);
				popup[position].focus();
			}
			else
			{
				popup[position].focus();
			}
		}
		else if (bName() == 2)
		{
			if (popup[position] == null)
			{
			    popup[position] = window.open(url,name,windowprops);
			    popup[position].focus();
			}
			else
			{
				if (popup[position].opener)
				{
				    popup[position].focus();
				}
				else
				{
				    popup[position] = window.open(url,name,windowprops);
				    popup[position].focus();
				}
			}
		}
		else
		{
		    popup[position] = window.open(url,name,windowprops);
		    popup[position].focus();
		}
	}

	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;

	    	tempWin = window.open(url, 'LassCasino', size);

/*
		var browser=bName();

		if (browser == 1)
		{
			if (navigator.userAgent.indexOf("Opera")!=-1) {
				tempWin = window.open(url, 'LassCasino', size);
			}else if ((tempWin == null) || (tempWin.closed))
			{
				tempWin = window.open(url, 'LassCasino', size);
			}
		}
		else if (browser == 2)
		{
			if (tempWin == null)
			{	
			    tempWin = window.open(url, 'LassCasino', size);
			}
			else
			{
				//if (!tempWin.opener)
			    tempWin = window.open(url, 'LassCasino', size);
			}
		}
		else
		{
		    tempWin = window.open(url, 'LassCasino', size);
		}
*/

		//tempWin.resizeTo(w,h);
	    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();
		}
	} 
	function clearLoginFields() {
		if (document.member_login.id.value == "Username") {
			document.member_login.id.value = "";
			document.member_login.pass.value = "";
		}
	}
	
	//flash detection code
	var MM_contentVersion = 6;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
			}
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}

