//mouse over image swap restore
<!--
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_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_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;
}

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];}
}
//-->


//verify for netscape/mozilla
var isNS4 = (navigator.appName=="Netscape")?1:0;

// ----- FUNCTIONS ----- \\

	function numbersOnly(){ // only allow numbers, no periods
		if(!isNS4){if(event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;}else{if(event.which < 48 || event.which > 57) returnfalse;}
	}

	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_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_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;
	}
	
	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_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}

	function printpage() {
	 if (typeof(window.print) != 'undefined') {
	     window.print();
	 } 
	}
	function PopClose(){
		if (window.opener && !window.opener.closed){
		  self.close();
		}else{
		 window.location="http://www.hollywoodpoker.com/";
		}
	}

	function modelPopClose(){
		if (window.opener && !window.opener.closed){
		  window.opener.location="http://www.hollywoodpoker.com/hollywood-models-search/index.html";
		  self.close();
		}else{
		 window.location="http://www.hollywoodpoker.com/hollywood-models-search/index.html";
		}
	}
	function PopGotoClose(goWhere){
		if (window.opener && !window.opener.closed){
		  window.opener.location=goWhere;
		  self.close();
		}else{
		  window.location=goWhere;
		}
	}
	
	function timerDownload(name,path){
		set_src = window.location.search;
		set_src = set_src.substring(1,set_src.length);
		if(window.location.search.indexOf("&np") != -1){
			var postionOfnp = set_src.indexOf("&np");
			set_src = set_src.slice(0,postionOfnp);
		}
		setTimeout("downloadHollywoodPoker(set_src)", 500);
	}
	
	function downloadHollywoodPoker(set_src){
		var msg = 'Would you like to Download Hollywood Poker while browsing?';
		var currentCookies = document.cookie;
		if (currentCookies.indexOf("askOnce=") == -1){
			if (confirm(msg)){
				var pathToExe = "http://www.pokernetwork.co.uk/games/204/Z4PW/";
				if (set_src.length > 0) { 
					pathToExe += set_src + "/";
				}
				pathToExe += "NetInstallHollywoodPoker.exe";
				window.location = pathToExe;
			}
			var expiresAt = new Date();
			expiresAt.setFullYear(expiresAt.getFullYear() + 1);
			document.cookie = "askOnce=yes; expires=" + expiresAt.toGMTString();
		} 
	}

// ----- VALIDATION FORM COMMON ----- \\
	function validateLogin(f)
	{	
		// validate nickname
		if (f.alias.value.length == 0)
		{
			alert("Please enter a nickname.");
			f.alias.focus();
			return false; 
		}
		
		if ((f.alias.value.length < 2) || (f.alias.value.length > 12))
		{
			alert("The nickname must be between 2 and 12 letters and/or numbers.");
			f.alias.focus();
			return false; 
		}
		if (f.password.value.length == 0)
		{
			alert("Please enter a password.");
			f.password.focus();
			return false; 
		}
		
		if ((f.password.value.length < 8) || (f.password.value.length > 12))
		{
			alert("The password must be between 8 and 12 letters and/or numbers.");
			f.password.focus();
			return false; 
		}
	}


// ----- VALIDATION FORM COMMON ----- \\
	function isValid(obj, objType)
	{
		if (objType == "text")
		{
			if (obj.value.length == 0) 
				return false;
			else 
				return true;
		}
		else if (objType == "select")
		{
			if (obj.options[0].selected)
				return false;
			else
				return true;
		}
		else if (objType == "checkbox")
		{
			if (obj.checked)
				return true;
			else
		   		return false;	
		} 
		return true;
	}

// ----- SIGNUP VALIDATION ----- \\
	function  validateSignupForm(f)
	{
		// validate nickname
		if (f.nickname.value.length == 0)
		{
			alert("Please enter a nickname.");
			f.nickname.focus();
			return false; 
		}
		
		if ((f.nickname.value.length < 2) || (f.nickname.value.length > 12))
		{
			alert("The nickname must be between 2 and 12 letters and/or numbers.");
			f.nickname.focus();
			return false; 
		}
	
		// validate email
		if (f.email.value.length == 0)
		{
			alert("Please enter your email address.");
			f.email.focus();
			return false; 
		}
	
		if (f.email.value != f.email1.value)
        {
            alert("The two emails do not match. Please retype.");
            f.email.focus();
            return false;
        }

		var i = 1;
		var s = f.email.value;
		var l = s.length;
	
		while ((i < l) && (s.charAt(i) != "@"))
		{
			i++;
		}
	
		if ((i >= l) || (s.charAt(i) != "@"))
		{
			alert("The email address is invalid. Please enter your full email address (eg. name@server.com)");
			f.email.focus();
			return false;
		}
		else
		{
			i += 2;
		}
		
		while ((i < l) && (s.charAt(i) != "."))
		{
			i++;
		}
	
		if ((i >= l - 1) || (s.charAt(i) != "."))
		{
			alert("The email address is invalid. Please enter your full email address (eg. name@server.com)");
			f.email.focus();
			return false;
		}
	
		// validate password
		if (f.password1.value.length == 0)
		{
			alert("Please enter a password.\n-it must be 8-12 numbers AND letters long\n-it must contain BOTH numbers and letters.");
			f.password1.focus();
			return false; 
		}
		
		var numberOfDigits = 0;
		var numberOfLetters = 0;
		var numberOfGarbageChars = 0;
		s = f.password1.value;
		
		for (i = 0; i < s.length; i++)
		{   
			var c = s.charAt(i);
			if ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
			{
				numberOfLetters++;
			}
			else if ((c >= "0") && (c <= "9"))
			{
				numberOfDigits++;
			}
			else
			{
				numberOfGarbageChars++;
			}
		}
	
		if (numberOfGarbageChars > 0)
		{
			alert("The password may only contain letters (a-z A-Z) and numericals (0-9).");
			f.password1.focus();
			return false; 
		}
	
		if (((f.password1.value.length < 8) || (f.password1.value.length > 12)) && ((numberOfDigits == 0) || (numberOfLetters == 0)))
		{
			alert("The password must be between 8 and 12 numbers and letters.");
			f.password1.focus();
			return false; 
		}
		else if ((numberOfDigits == 0) || (numberOfLetters == 0))
		{
			alert("The password must contain both letters AND numbers.");
			f.password1.focus();
			return false; 
		}
		else if ((f.password1.value.length < 8) || (f.password1.value.length > 12))
		{
			alert("The password must be between 8 and 12 characters.");
			f.password1.focus();
			return false; 
		}
	
		if (f.password2.value.length == 0)
		{
			alert("Please retype your password in the second password box.");
			f.password2.focus();
			return false; 
		}
	
		if (f.password1.value != f.password2.value)
		{
			alert("The two passwords do not match. Please retype.");
			f.password1.focus();
			return false; 
		}
		
		return true; //confirmSignupWindow(f);
	}

// ----- CONFIRM SIGNUP WINDOW ----- \\
	function  confirmSignupWindow(f)
	{
		f.submit();
	}

// ----- ACTIVATION VALIDATION ----- \\
	function LZ(x) {return(x<0||x>9?"":"0")+x}

	
	function formatDate(date,format) {
	format=format+"";
	var result="";
	var i_format=0;
	var c="";
	var token="";
	var y=date.getYear()+"";
	var M=date.getMonth()+1;
	var d=date.getDate();
	var E=date.getDay();
	var H=date.getHours();
	var m=date.getMinutes();
	var s=date.getSeconds();
	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
	// Convert real date parts into formatted versions
	var value=new Object();
	if (y.length < 4) {y=""+(y-0+1900);}
	value["y"]=""+y;
	value["yyyy"]=y;
	value["yy"]=y.substring(2,4);
	value["M"]=M;
	value["MM"]=LZ(M);
	value["d"]=d;
	value["dd"]=LZ(d);
	value["H"]=H;
	value["HH"]=LZ(H);
	if (H==0){value["h"]=12;}
	else if (H>12){value["h"]=H-12;}
	else {value["h"]=H;}
	value["hh"]=LZ(value["h"]);
	if (H>11){value["K"]=H-12;} else {value["K"]=H;}
	value["k"]=H+1;
	value["KK"]=LZ(value["K"]);
	value["kk"]=LZ(value["k"]);
	if (H > 11) { value["a"]="PM"; }
	else { value["a"]="AM"; }
	value["m"]=m;
	value["mm"]=LZ(m);
	value["s"]=s;
	value["ss"]=LZ(s);
	while (i_format < format.length) {
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		if (value[token] != null) { result=result + value[token]; }
		else { result=result + token; }
		}
	return result;
	}



	function OfAgeClick(clicker)
	{
	   if (clicker.value == "on") {
		   var dateVar = formatDate(new Date(),"yyyyMMddHHmmss");
		   document.f.OfAgeClicked.value = dateVar;
	   }
	}
	
	function TermsClick(clicker)
	{
	   if (clicker.value == "on") {
		   var dateVar = formatDate(new Date(),"yyyyMMddHHmmss");
		   document.f.TermsClicked.value = dateVar;
	   }
	}
	
	function  validateActivation(f)
	{
		if (!isValid(f.terms, "checkbox"))
		{
			alert("Please acknowledge that you agree to the terms and conditions! You have to do this before you can activate your account.");
			f.terms.focus();
			return false; 
		}
		if (!isValid(f.ru21, "checkbox"))
		{
			alert("Residents of the US must be over the age of 21. Residents outside the US must be over the age of 18. ");
			f.ru21.focus();
			return false; 
		}
		if (!isValid(f.activationCode, "text")) 
		{
			alert("Please enter your activation code!");
			f.activationCode.focus();
			return false; 
		}	
		return true;
	}

// ----- REAL VALIDATION ----- \\
function  validateRMEForm(f)
{
	if (!isValid(f.title, "select"))
	{
		alert("Please choose a title.");
		f.title.focus();
		return false; 
	}
	if (!isValid(f.firstName, "text")) 
	{
		alert("Please enter your first name.");
		f.firstName.focus();
		return false; 
	}
	if (!isValid(f.lastName, "text")) 
	{
		alert("Please enter your last name.");
		f.lastName.focus();
		return false; 
	}
	if (!isValid(f.address1, "text")) 
	{
		alert("Please enter your address.");
		f.address1.focus();
		return false; 
	}
	if (!isValid(f.city, "text")) 
	{
		alert("Please enter a city.");
		f.city.focus();
		return false; 
	}
	if (!isValid(f.zip, "text")) 
	{
		alert("Please enter your zip code or your postal code.");
		f.zip.focus();
		return false; 
	}
	if (!isValid(f.country, "select"))
	{
		alert("Please enter your country!");
		f.country.focus();
		return false; 
	}
//	if (f.timeZone.options[f.timeZone.selectedIndex].value == 'none')
//	{
//		alert("Please select a time zone.");
//		f.timeZone.focus();
//		return false; 
//	}
	if (!isValid(f.phone, "text"))
	{
		alert("Please enter your phone number.");
		f.phone.focus();
		return false; 
	}
	if (!isValid(f.year_of_birth, "select"))
	{
		alert("Please tell us what year you were born in.");
		f.year_of_birth.focus();
		return false; 
	}
	if (!isValid(f.month_of_birth, "select"))
	{
		alert("Please tell us what month you were born in.");
		f.month_of_birth.focus();
		return false; 
	}
	if (!isValid(f.day_of_birth, "select"))
	{
		alert("Please tell us what day of the month you were born on.");
		f.day_of_birth.focus();
		return false; 
	}
	if (!isValid(f.terms, "checkbox"))
		{
			alert("Please acknowledge that you agree to the terms and conditions! You have to do this before you can activate your account.");
			f.terms.focus();
			return false; 
		}
	if (f.id)
	{
		if (!isValid(f.idType, "select"))
		{
			alert("Please select a ID # Type.");
			f.idType.focus();
			return false; 
		}
		if (!isValid(f.id, "text")) 
		{
			alert("Please enter a ID #");
			f.id.focus();
			return false; 
		}
	}

	return true;
}

// ----- MODEL PIC SUBMIT VALIDATION ----- \\
	function  validateModelTerms(f)
	{
		if (!isValid(f.modelterms, "checkbox"))
		{
			alert("You must agree to the Model Terms and Conditions before you can submit your photos.");
			f.modelterms.focus();
			return false; 
		} else {
			//location.href="http://pokergirls.stage.hollywoodpoker.com/models/photo-submission.html";
			//location.reload("http://pokergirls.stage.hollywoodpoker.com/models/photo-submission.html");
		//document.write(location.href);
			return true;
		}
	}

// ----- CHECK BROWSWER FOR MENU ----- \\

	var SubA
	if (document.getElementById) { 
	 SubA=0;
	} 
	else if (document.layers) { 
	 SubA=1;
	} 
	else if (document.all) { 
	 SubA=1;
	} 
	
// ---- Div Hide Layer ---- \\

function toggle(theMenu){
     var elem = document.getElementById(theMenu);
     elem.style.display = (elem.style.display == "none")? "":"none";
}

// ---- AJAX Tracking Functions ---- \\
var http_request = false;
function track(s,p,q,a) {
    http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    http_request.onreadystatechange = alertContents;
    http_request.open('GET', 'process_tracking.php?q='+q+'&a='+a+'&s='+s+'&p='+p, false);
    http_request.send(null);
}
function alertContents() {
	//do nothing
}

// ------ MODELS -----------\\
	function checkSelected() {
		if ((document.getElementById("modelVote1").checked == true) ||
		  (document.getElementById("modelVote2").checked == true)) {
			document.getElementById("setnext").value = true;
		} else {
			document.getElementById("setnext").value = false;
			alert("Please select a model.");
			return false;
		}
		return true;
	}
	
// ------ DISABLE RIGHT CLICK -----------\\

function clickIE4(){
if (event.button==2){
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false");