function openWindow(page)	 {
	window.open("includes/pop.php?page=" + page,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=450,left=30,top=80");
	}

function checkSetCookie()	{
	if (document.getElementById('remember').checked)	{
		setCookie(document.getElementById('username').value);
		}
	}

function setCookie(value)	{
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + 365);
	document.cookie = "eproofsheetlogin=" +escape(value)+";expires="+exdate.toGMTString();
	}

function checkCookie()	{

	var username = getCookie('eproofsheetlogin');

	if (username != null && username!="")	{
		if (document.getElementById('username'))	{
			document.getElementById('username').value = username;		
			}
		}
	}

function getCookie(c_name)	{

	var username = "";

	if (document.cookie.length > 0)	 {

	  c_start = document.cookie.indexOf(c_name + "=");

	  if (c_start != -1)	 { 

		c_start= c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);

		if (c_end== -1) c_end=document.cookie.length;
			username = unescape(document.cookie.substring(c_start, c_end));
			} 

		}
	return username;
	}

function flipFields()	{
	if (document.getElementById('non_us').checked) { 
		document.getElementById('p_state').disabled = true; 
		document.getElementById('non_us_prov').style.display = 'block'; 
		} 
	else { 
		document.getElementById('p_state').disabled = false; 
		document.getElementById('non_us_prov').style.display = 'none'; 
		}
	}

function showPlan()	{
	
	if (document.getElementById('plan').selectedIndex != 0)	{
		document.getElementById("plan_" + document.getElementById('plan').selectedIndex).style.display = 'block';
		}

	for (x = 1 ; x <= 8 ; x++)	{
		
		if (x != document.getElementById('plan').selectedIndex)	{
			document.getElementById("plan_" + x).style.display = 'none';
			}

		}
	}

function writeTracker()	{
	document.write("<a href='http://t.extreme-dm.com/?login=eproof'><img src='http://t1.extreme-dm.com/i.gif' name='EXim' border='0' height='38' width='41' alt='eXTReMe Tracker'></a>");
	EXs=screen;
	EXw=EXs.width;
	navigator.appName!="Netscape" ? EXb=EXs.colorDepth:EXb=EXs.pixelDepth;
	var EXlogin='eproof' // Login
	var EXvsrv='s9' // VServer
	navigator.javaEnabled()==1?EXjv="y":EXjv="n";
	EXd=document;
	EXw?"":EXw="na";
	EXb?"":EXb="na";
	EXd.write("<img src=\"http://e0.extreme-dm.com", "/"+EXvsrv+".g?login="+EXlogin+"&amp;","jv="+EXjv+"&amp;j=y&amp;srw="+EXw+"&amp;srb="+EXb+"&amp;", "l="+escape(EXd.referrer)+"\" height=1 width=1>");
	}

function checkForgotLogin()	{
	var emailPat = /[\w\-]+\@[\w\-]+\.\w{2,3}/;
	if (!emailPat.test(document.getElementById('emailAddy').value))	{
		alert("The email you have entered appears incorrect\n\nPlease check it and resubmit the form");
		document.getElementById('emailAddy').focus();
		return false;
		}
	if (!document.getElementById('custTypePhotog').checked && !document.getElementById('custTypeClient').checked)	{
		alert("Please tell us what member type you are by checking either phtographer or photographer's client");
		return false;
		}
	}

function swapImage(imageId, swapName)	{
	document.getElementById(imageId).src = '/images/'+swapName;
	}

function checkContactForm()	{
	var emailPat = /[\w\-]+\@[\w\-]+\.\w{2,3}/;

	if (document.getElementById('conName').value.length < 5)	{
		alert("Please enter your name");
		document.getElementById('conName').focus();
		return false;
		}
	if (!emailPat.test(document.getElementById('conEmail').value))	{
		alert("The email you have entered appears incorrect\n\nPlease check it and resubmit the form");
		document.getElementById('conEmail').focus();
		return false;
		}
	if (document.getElementById('conReason').selectedIndex == 0)	{
		alert("Please select the department to direct this contact form to");
		document.getElementById('conReason').focus();
		return false;
		}
	if (document.getElementById('comments').value.length < 10 || document.getElementById('comments').value == 'Comments, Suggestions')	{
		alert("Please add your comments, suggestion or any other information in the comments text area");
		document.getElementById('comments').focus();
		return false;
		}
	}
