function validateSignUpform()
{
	var first=document.forms["signup"]["first"].value;
	if (first==null || first=="")
  		{	
  			 document.getElementById("warning").innerHTML="First Name Must Be filled";
  			return false;
  		}
	var last=document.forms["signup"]["last"].value;
	if (last==null || last=="")
  		{	
  			 document.getElementById("warning").innerHTML="Last Name Must Be filled";
  			return false;
  		}
	var password=document.forms["signup"]["password"].value;
	if (password==null || password=="")
  		{	
  			 document.getElementById("warning").innerHTML="Password Must Be filled";
  			return false;
  		}
		if (password.length<=5)
		{
			document.getElementById("warning").innerHTML="Password must be 6 characters long";
  			return false;
		}
	var rpassword=document.forms["signup"]["rpassword"].value;
	if (rpassword==null || rpassword=="")
  		{	
  			 document.getElementById("warning").innerHTML="Re-type Password Must Be filled";
  			return false;
  		}
	var email=document.forms["signup"]["email"].value;
	if (email==null || email=="")
  		{	
  			 document.getElementById("warning").innerHTML="Email Must Be filled";
  			return false;
  		}
	var remail=document.forms["signup"]["remail"].value;
	if (remail==null || remail=="")
  		{	
  			 document.getElementById("warning").innerHTML="Re-Enter Email Must Be filled";
  			return false;
  		}
	var sex=document.getElementById("sex");
	if(sex.selectedIndex<=0)
  		{	
  			 document.getElementById("warning").innerHTML="Gender Must Be filled";
  			return false;
  		}
	var birthday_month=document.getElementById("birthday_month");
	if (birthday_month.selectedIndex<=0)
  		{	
  			 document.getElementById("warning").innerHTML="Birthday Month Must Be filled";
  			return false;
  		}
	var birthday_date=document.getElementById("birthday_date");
	if (birthday_date.selectedIndex<=0)
  		{	
  			 document.getElementById("warning").innerHTML="Birthday Date Must Be filled";
  			return false;
  		}
	var birthday_year=document.getElementById("birthday_year");
		if (birthday_year.selectedIndex<=0)
  		{	
  			 document.getElementById("warning").innerHTML="Birthday Year Must Be filled";
  			return false;
  		}
		
		
		
		if (password!=rpassword)
		{
			document.getElementById("warning").innerHTML="Password Mismatch";
  			return false;
		}
	var atpos=email.indexOf("@");
	var dotpos=email.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
	  {
	  document.getElementById("warning").innerHTML="Not a valid e-mail address";
	  return false;
	  }
	  else
	  {
		  if(email!=remail)
		  {
			  document.getElementById("warning").innerHTML="Email Address Mismatch";
			  return false;
		  }
	  }
	  var code=document.forms["signup"]["code"].value;
	  if (code==null || code=="")
  		{	
  			 document.getElementById("warning").innerHTML="Security Check Must Be filled";
  			return false;
  		}
}

function validatesubject(str)
{
	if(str.length<15)
	document.getElementById("subject warning").innerHTML="That title is too short to be useful. Can you add some more detail?";
	else
	document.getElementById("subject warning").innerHTML="&nbsp;";
}

function validateAboutus()
{
	var content=document.forms["aboutus"]["content"].value;
	if (content==null || content=="")
  		{	
  			 document.getElementById("warning").innerHTML="Content Name Must Be filled";
  			return false;
  		}
	else if(content.length<10)
	{
		 document.getElementById("warning").innerHTML="Content Is Too Short. Can you add some more detail?";
		 return false;
	}
	var email=document.forms["aboutus"]["email"].value;
	if (email==null || email=="")
  		{	
  			 document.getElementById("warning").innerHTML="Email Must Be filled";
  			return false;
  		}
	var atpos=email.indexOf("@");
	var dotpos=email.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
	  {
	  document.getElementById("warning").innerHTML="Not a valid e-mail address";
	  return false;
	  }
}
