function showMemberZone()
{
	msg = "You need to be a member to see the current forecasts.";
	alert (msg);
}

function check_contact_form() {
	var msg="";
	
	if ( isEmpty(document.contact_form.fullname) )
		msg += "- Please fill out your name.\n";
	
	if ( isEmpty(document.contact_form.email) )
		msg += "- Please fill out the email address.\n";
	else if ( !isEmail(document.contact_form.email) )
		msg += "- Please fill out a valid email address.\n";
		
	if ( document.contact_form.category.value == 0 )
		msg += "- Please select the category.\n";
	
	if ( isEmpty(document.contact_form.message) )
		msg += "- Please fill out the message.\n";
		
	if ( msg.length > 1 ) {
		alert ( msg );	return false;
	}
	
	return true;
}

function check_signup_form() {

	var msg="";
	var epass = 0;
	if ( document.suf.package.value == 0 )
		msg += "- Please select the package.\n";
		
	if ( isEmpty(document.suf.email) )
		msg += "- Please fill out the email address.\n";
	else if ( !isEmail(document.suf.email) )
		msg += "- Please fill out a valid email address.\n";
		
	if ( isEmpty(document.suf.pass) )	{
		msg += "- Please fill out your password.\n";
		epass++;
	}else if ( document.suf.pass.value != document.suf.cpass.value )	{
		msg += "- Your passwords do not match.\n";
		epass++;
	}else if ( document.suf.pass.value.length < 6 )
		msg += "- Please fill out your password with 6 characters or more.\n";
	if ( isEmpty(document.suf.cpass) ) {
		msg += "- Please fill out your confirm password.\n";
		epass++;
	} else if ( document.suf.cpass.value.length < 6 )
		msg += "- Please fill out your confirm password with 6 characters or more.\n";
	if ( epass==0 && (document.suf.pass.value != document.suf.cpass.value ) )
		msg += "- Password and confirm password do not match.\n";
	
	if ( isEmpty(document.suf.firstName) )
		msg += "- Please fill out your first name.\n";
	
	if ( isEmpty(document.suf.lastName) )
		msg += "- Please fill out your last name.\n";
	
	if ( isEmpty(document.suf.address) )
		msg += "- Please fill out the address.\n";
	
	if ( isEmpty(document.suf.city) )
		msg += "- Please fill out the city.\n";
	
	if ( isEmpty(document.suf.zip) )
		msg += "- Please fill out the zip / post code.\n";
	
	if ( (document.suf.package.value == 3) && isEmpty(document.suf.cellphone) )
		msg += "- Please fill out the cell phone number\n";
	
	if ( isEmpty(document.suf.cctype) )
		msg += "- Please select the credit card type.\n";
		
	if ( isEmpty(document.suf.ccnumber) )
		msg += "- Please fill out the credit card number.\n";
		
	if ( isEmpty(document.suf.ccv2) )
		msg += "- Please fill out the ccv2 number.\n";
		
	if ( !document.suf.tou.checked )
		msg += "- Please check the box to agree our terms and conditions.\n";
		
	if ( document.suf.state == 0 )
		msg += "- Please select a state.";

	if ( msg.length > 1 ) {
		alert ( msg );	return false;
	}
	
	return true;
}

function isEmail ( emailField ) {
 emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
 if( !emailpat.test( emailField.value ) ) {
  return false;
 }
 return true;
}

function isEmpty(aTextField) {
	if ( (aTextField.value.length==0 ) || (aTextField.value==null) ) 
		return true;
	else
		return false;
}

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.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];}
}
