function validcomment()
{
var text = tinyMCE.get('comment').getContent();
if(text=='')
{
 alert('Enter the comment')
 document.frmname.comment.focus();
 return false;
}
return ture;
}

function validations()
{	
	if(document.frmregist.username.value =="")
	{
		 alert("please enter username ");
		 document.frmregist.username.focus();
		 return false;
	}
	if(document.frmregist.password.value =="")
	{
		 alert("please enter password ");
		 document.frmregist.password.focus();
		 return false;
    }
	if(document.frmregist.name.value =="")
	{
		 alert("please enter First Name ");
	    document.frmregist.name.focus();
		return false;
	}
	if(document.frmregist.surname.value =="")
	{
		 alert("please enter Last Name ");
	    document.frmregist.surname.focus();
		return false;
	}
	if(document.frmregist.email.value =="")
	{
		 alert("please enter Email ");
	    document.frmregist.email.focus();
		return false;
	}
	if(document.frmregist.country.value =="")
	{
		 alert("please enter Country ");
	     document.frmregist.country.focus();
		 return false;
	}
	if(document.frmregist.state.value =="")
	{
		 alert("please enter State ");
	    document.frmregist.state.focus();
		return false;
	}
	if(document.frmregist.city.value =="")
	{	
		 alert("please enter City ");
	    document.frmregist.city.focus();
		return false;
	}
	if(document.frmregist.zip.value =="")
	{
		 alert("please enter Post code ");
		 document.frmregist.zip.focus();
		 return false;
	}
	if(document.frmregist.gradyear.value =="")
	{
		 alert("Please enter year of high school graduation  ");
		 document.frmregist.gradyear.focus();
		 return false;
	}
	if(document.frmregist.satscore.value =="")
	{
		 alert("please enter SAT Score ");
		 document.frmregist.satscore.focus();
		 return false;	
	}
	if(document.frmregist.gpa.value =="")
	{
		 alert("please enter GPA ");
		 document.frmregist.gpa.focus();
		 return false;
	}
	document.frmregist.submit();
	return true;
}

function chkagree()
{
   if(document.getElementById("chk").checked== false)
   {
      alert("Plese accept the terms and conditions.");
      return false;
   }
    if( document.frm.essay_title.value.length==0)
		   {
			   alert("Enter the title");
			   frm.essay_title.focus();
			   return false;
		   }
   document.frm.submit();
}

//remove the preceeding and ending spaces from a string.
function trimStr(str)
{var i, pBegin, pEnd, strTemp
 //find the preceeding spaces
 for (i = 0 ; i < String(str).length; i++)
 {if (String(str).charAt(i) != " ")
	{pBegin = i;
	 break;
	}
 }
 
 //find ending spaces
 for (i = String(str).length -1; i >= 0; i--)
 {if (String(str).charAt(i) != " ")
	{pEnd = i;
	 break;
	} 
 }
 
 //the new string.
 strTemp = String(str).substr(pBegin, pEnd - pBegin +1 );
 return (strTemp);
}

//FUNCTION TO VALIDATE EMAIL
function validateEmail(email)
{
//a valid email would have only one @ and one . after the @ in the string and a value before and after @ and .
 var iAtF = 0;
 var iDotF = 0;
 var iDotL = 0;
 var iSpace = 0;
 var iStrLength = 0; //for length of string

 iAtF = String(email).indexOf("@");
 iAtL = String(email).lastIndexOf("@");
 if (iAtF < 1 )
	return (false);
 if (iAtF != iAtL)
	return(false);
	
 iDotL = String(email).lastIndexOf(".");
 if (iDotL < iAtF + 2)
	return(false);

 iSpace = String(email).indexOf(" ");
 if (iSpace > 0 )
	return(false);

 iStrLength = String(email).length;
 if(iDotL==iStrLength-1 ||iDotL==iStrLength-2) 
	return(false);
		
 return(true);
}

function fnValidEditorialTeam()
{	
	document.reg.firstname.value = trimStr(document.reg.firstname.value);
	document.reg.lastname.value = trimStr(document.reg.lastname.value);
	document.reg.email.value = trimStr(document.reg.email.value);
	document.reg.message.value = trimStr(document.reg.message.value);
	
	if(document.reg.firstname.value=='')
	{
		alert("Enter the First Name.");
		reg.firstname.focus();
		return false;
	}
	if(document.reg.lastname.value=='')
	{
		alert("Enter the Last Name.");
		reg.lastname.focus();
		return false;
	}
	if(document.reg.email.value=='')
	{
		alert("Enter the Email ID.");
		reg.email.focus();
		return false;
	}
	if(validateEmail(document.reg.email.value) == false)
	{
		alert('Enter the correct Email ID.');
		document.reg.email.focus();
		return false;
	}	
			
	return true;	
}
//- this is used to edit validaction.
function fnValidEditorialupdatetTeam()
{
	document.student.name.value = trimStr(document.student.name.value);
	document.student.from.value = trimStr(document.student.from.value);
	document.student.email.value = trimStr(document.student.email.value);
	document.student.message.value = trimStr(document.student.message.value);
	
	if(document.student.name.value.length==0)
	{
		alert("Enter the Name");
		student.name.focus();
		return false;
	}
	if(document.student.from.value.length==0)
	{
		alert("Enter the Last name");
		student.from.focus();
		return false;
	}
	if(document.student.email.value.length==0)
     
	{
		alert("Enter the Email Id");
		student.email.focus();
		return false;
	}	
	if(validateEmail(document.student.email.value) == false)
	{
		alert('Enter the correct Email ID.');
		document.student.email.focus();
		return false;
	}			
	return true;	
}
	
function validsubmit()	
{
    document.frm.essay_title.value = trimStr(document.frm.essay_title.value);	
    document.frm.name.value = trimStr(document.frm.name.value);
    document.frm.emailid.value = trimStr(document.frm.emailid.value);
	//document.frm.essaydescription.value = trimStr(document.frm.essaydescription.value);
    //document.frm.essaydescription.value = trimStr(document.frm.essaydescription.value);
    var text = tinyMCE.get('essaydescription').getContent();
	
   	if( document.frm.essay_title.value.length==0)
   	{
	   alert("Enter the Essay Title");
	   frm.essay_title.focus();
	   return false;
   	}
   	if(document.getElementById('category_type_id').selectedIndex == 0 )
   	{
	   alert('Please select the category.');
	   document.getElementById('category_type_id').focus();
       return false;
   	}
   	//if( document.frm.name.value.length==0)
//   	{
//	   alert("Enter the First Name");
//	   frm.name.focus();
//	   return false;
//   	}
//   	if( document.frm.surname.value.length==0)
//   	{
//	   alert("Enter the Last Name");
//	   frm.surname.focus();
//	   return false;
//   	}	
 	if( document.frm.emailid.value.length==0)
	{
	   alert("Enter the Email Id");
	   frm.emailid.focus();
	   return false;
	}
    if(validateEmail(document.frm.emailid.value) == false)
    {
	   alert('Enter the correct Email ID.');
	   document.frm.emailid.focus();
	   return false;
	}
	if(text=='')
	{
	   alert("Enter Essay Description");
	   frm.essaydescription.focus();
	   return false;
	}

  	if(document.getElementById("chp").checked== true)
    {
	   if(validateEmail(document.frm.email1.value) == false)
       {
		   alert('Enter the correct Email ID.');
		   document.frm.email1.focus();
		   return false;
	   }	
  	else
	{
	   if(document.frm.email2.value !='')
	   {
    	if(validateEmail(document.frm.email2.value) == false)
	  	{
	  	alert('Enter the correct Email ID.');
	  	document.frm.email2.focus();
	   	return false;
	  	}
		else
		if(document.frm.email3.value !='')
	    {
		{
		if(validateEmail(document.frm.email3.value) == false)
	  	{
	  		alert('Enter the correct Email ID.');
	  		document.frm.email3.focus();
	   		return false;
	    }
		else
		if(document.frm.email4.value !='')
	    {
		{
		if(validateEmail(document.frm.email4.value) == false)
	  	{
	  		alert('Enter the correct Email ID.');
	  		document.frm.email4.focus();
	   		return false;
	  	}
		}
	    }
	    }
	    }
	    }
	    } 
	    }
	 /* if(validateEmail(document.frm.email3.value) == false)
      {
	  alert('Enter the correct Email ID.');
	  document.frm.email3.focus();
	   return false;
	  }			
	  if(validateEmail(document.frm.email4.value) == false)
      {
	  alert('Enter the correct Email ID.');
	  document.frm.email4.focus();
	   return false;
	  }*/
  if(document.getElementById("chk").checked== false)
     {
	  alert("Plese accept the terms and conditions.");
   	  return false;
     }
      document.frm.submit();
	   return true;
	
}

function fnShowHideFriendTable(obj,trFriend)
{
	if(obj.checked)
		document.getElementById(trFriend).style.display='block';
	else
		document.getElementById(trFriend).style.display='none';
}
	
		
function selectCategory(allow,chunk,notified,votes)
{

	//alert('hello');
//alert(document.getElementBYId(cat));
if(document.frm.category.value==2)
	{
		document.getElementById(allow).style.display='none';
		document.getElementById(notified).style.display='block';
		document.getElementById(chunk).style.display='block';
		document.getElementById(votes).style.display='block';
		
	}
if(document.frm.category.value==1)
	{
		document.getElementById(allow).style.display='block';
		document.getElementById(chunk).style.display='none';
		document.getElementById(notified).style.display='block';
		document.getElementById(votes).style.display='none';
		
		
	}
	
}

function admissionregister()
{
	
	 document.admission.collegename.value = trimStr(document.admission.collegename.value);
	 document.admission.collegewebsite.value = trimStr(document.admission.collegewebsite.value);
	 document.admission.username.value = trimStr(document.admission.username.value);
	 document.admission.password.value = trimStr(document.admission.password.value);
     document.admission.cpassword.value = trimStr(document.admission.cpassword.value);
	 document.admission.name.value = trimStr(document.admission.name.value);
	 document.admission.surname.value = trimStr(document.admission.surname.value);
	 document.admission.email.value = trimStr(document.admission.email.value);
	 //document.admission.phone.value = trimStr(document.admission.phone.value);
	 document.admission.fax.value = trimStr(document.admission.fax.value);
	 document.admission.country.value = trimStr(document.admission.country.value);
	 document.admission.state.value = trimStr(document.admission.state.value);
	 document.admission.city.value = trimStr(document.admission.city.value);
	 document.admission.zip.value = trimStr(document.admission.zip.value);
	 document.admission.blog.value = trimStr(document.admission.blog.value);
	 
	 var validateUrl = new RegExp();
    validateUrl.compile("^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
	numericRegExp = /^([0-9]+)((.[0-9]+)?)$/;

if(document.admission.collegename.value=='')
{
	alert("Enter the College Name");
	document.admission.collegename.focus();
	return false;
}
if(document.admission.collegewebsite.value=='')
{
	alert("Enter the College Website Name");
	document.admission.collegewebsite.focus();
	return false;
}
if (!validateUrl.test(document.admission.collegewebsite.value))
{
   	alert("Please enter a valid URL.");
	document.admission.collegewebsite.focus();
    return false;
}
if(document.admission.name.value=='')
{
	alert("Enter the Name");
	document.admission.name.focus();
	return false;
}
if(document.admission.surname.value=='')
{
	alert("Enter the Last Name");
	document.admission.surname.focus();
	return false;
}
if(document.admission.username.value=='')
{
	alert("Enter the User Name");
	document.admission.username.focus();
	return false;
}
if(document.admission.password.value=='')
{
	alert("Enter the Password");
	document.admission.password.focus();
	return false;
}
if(document.admission.cpassword.value=='')
{
	alert("Enter the Confirm Password");
	document.admission.cpassword.focus();
	return false;
}
if(document.admission.cpassword.value != document.admission.password.value)
{
	alert("password mis-match enter again.");
	document.admission.cpassword.value='';
	document.admission.cpassword.focus();
	return false;
}

if(document.admission.email.value=='')
{
	alert("Enter the Email-Id");
	document.admission.email.focus();
	return false;
}
if(validateEmail(document.admission.email.value) == false)
{
    alert('Enter the correct Email ID.');
    document.admission.email.focus();
    return false;
}	
//if(document.admission.phone.value=='')
//{
	//alert("Enter the Phone no");
	//document.admission.phone.focus();
	//return false;
//}
//if (!numericRegExp.test(document.admission.phone.value))
//{
	//alert('Please enter the numeric values.');
	//document.admission.phone.focus();
	//return false;
//}
if(document.admission.fax.value=='')
{
	alert("Enter the Fax");
	document.admission.fax.focus();
	return false;
}
if (!numericRegExp.test(document.admission.fax.value))
{
	alert('Please enter the numeric values.');
	document.admission.fax.focus();
	return false;
}
if(document.admission.country.value=='')
{
	alert("Enter the Country Name");
	document.admission.country.focus();
	return false;
}
if(document.admission.state.value=='')
{
	alert("Enter the State Name");
	document.admission.state.focus();
	return false;
}
if(document.admission.city.value=='')
{
	alert("Enter the City Name");
	document.admission.city.focus();
	return false;
}
if (!numericRegExp.test(document.admission.zip.value))
{
	alert('Please enter the numeric values.');
	document.admission.zip.focus();
	return false;
}
if(document.admission.blog.value=='')
{
	alert("Enter the Blog Name");
	document.admission.blog.focus();
	return false;
}
if (!validateUrl.test(document.admission.blog.value))
{
   	alert("Please enter a valid URL.");
	document.admission.blog.focus();
    return false;
}
if(document.getElementById("wekly").checked== true)
 {
 if(document.admission.limit.value=='')
 {
	alert("Enter the Limit ");
	document.admission.limit.focus();
	return false;
 }
 if (!numericRegExp.test(document.admission.limit.value))
 {
	alert('Please enter the numeric values.');
	document.admission.limit.focus();
	return false;
 }
 }
if(document.getElementById("daily").checked== true)
{
	
 if(document.admission.limitmonthly.value=='')
 {
	alert("Enter the Limit ");
	document.admission.limitmonthly.focus();
	return false;
 }
 if (!numericRegExp.test(document.admission.limitmonthly.value))
 {
	alert('Please enter the numeric values.');
	document.admission.limitmonthly.focus();
	return false;
 }
}
return true;
	
}

function admissionlogin()
{
	 document.add.username.value = trimStr(document.add.username.value);
	 document.add.password.value = trimStr(document.add.password.value);
 if(document.add.username.value=='')
 {
	 alert("Enter the Username.");
	 document.add.username.focus();
	 return false;
 }
 if(document.add.password.value=='')
 {
	 alert("Enter the Password.");
	 document.add.password.focus();
	 return false;
 }
 return true;	
}

function admissionofficers()
{
	 document.admissionofficersdetails.college_name.value = trimStr(document.admissionofficersdetails.college_name.value);
	 document.admissionofficersdetails.college_website_name.value = trimStr(document.admissionofficersdetails.college_website_name.value);
	 document.admissionofficersdetails.name.value = trimStr(document.admissionofficersdetails.name.value);
	 document.admissionofficersdetails.surname.value = trimStr(document.admissionofficersdetails.surname.value);
	 document.admissionofficersdetails.email.value = trimStr(document.admissionofficersdetails.email.value);
	 //document.admissionofficersdetails.phone.value = trimStr(document.admissionofficersdetails.phone.value);
	 document.admissionofficersdetails.country.value = trimStr(document.admissionofficersdetails.country.value);
	 document.admissionofficersdetails.state.value = trimStr(document.admissionofficersdetails.state.value);
	 document.admissionofficersdetails.city.value = trimStr(document.admissionofficersdetails.city.value);
	 document.admissionofficersdetails.zip.value = trimStr(document.admissionofficersdetails.zip.value);
	 document.admissionofficersdetails.blog_address.value = trimStr(document.admissionofficersdetails.blog_address.value);
	 
	 var validateUrl = new RegExp();
     validateUrl.compile("[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
	numericRegExp = /^([0-9]+)((.[0-9]+)?)$/;

if(document.admissionofficersdetails.college_name.value=='')
{
	alert("Enter the College Name");
	document.admissionofficersdetails.college_name.focus();
	return false;
}
if(document.admissionofficersdetails.college_website_name.value=='')
{
	alert("Enter the College Website Name");
	document.admissionofficersdetails.college_website_name.focus();
	return false;
}
if (!validateUrl.test(document.admissionofficersdetails.college_website_name.value))
{
   	alert("Please enter a valid URL.");
	document.admissionofficersdetails.college_website_name.focus();
    return false;
}
if(document.admissionofficersdetails.name.value=='')
{
	alert("Enter the Name");
	document.admissionofficersdetails.name.focus();
	return false;
}
if(document.admissionofficersdetails.surname.value=='')
{
	alert("Enter the Surname Name");
	document.admissionofficersdetails.surname.focus();
	return false;
}
if(document.admissionofficersdetails.email.value=='')
{
	alert("Enter the Email-Id");
	document.admissionofficersdetails.email.focus();
	return false;
}
if(validateEmail(document.admissionofficersdetails.email.value) == false)
{
    alert('Enter the correct Email ID.');
    document.admissionofficersdetails.email.focus();
    return false;
}	
//if(document.admissionofficersdetails.phone.value=='')
//{
	//alert("Enter the Phone no");
	//document.admissionofficersdetails.phone.focus();
	//return false;
//}
//if (!numericRegExp.test(document.admissionofficersdetails.phone.value))
//{
	//alert('Please enter the numeric values.');
	//document.admissionofficersdetails.phone.focus();
	//return false;
//}

if(document.admissionofficersdetails.country.value=='')
{
	alert("Enter the Country Name");
	document.admissionofficersdetails.country.focus();
	return false;
}
if(document.admissionofficersdetails.state.value=='')
{
	alert("Enter the State Name");
	document.admissionofficersdetails.state.focus();
	return false;
}
if(document.admissionofficersdetails.city.value=='')
{
	alert("Enter the City Name");
	document.admissionofficersdetails.city.focus();
	return false;
}
if(document.admissionofficersdetails.zip.value=='')
{
	alert("Enter the Post Code");
	document.admissionofficersdetails.zip.focus();
	return false;
}
if (!numericRegExp.test(document.admissionofficersdetails.zip.value))
{
	alert('Please enter the numeric values.');
	document.admissionofficersdetails.zip.focus();
	return false;
}
if(document.admissionofficersdetails.blog_address.value=='')
{
	alert("Enter the Blog Name");
	document.admissionofficersdetails.blog_address.focus();
	return false;
}
if (!validateUrl.test(document.admissionofficersdetails.blog_address.value))
{
   	alert("Please enter a valid Blog URL.");
	document.admissionofficersdetails.blog_address.focus();
    return false;
}
if(document.getElementById("wekly").checked== true)
 {
 if(document.admissionofficersdetails.limit.value=='')
 {
	alert("Enter the Limit ");
	document.admissionofficersdetails.limit.focus();
	return false;
 }
 if (!numericRegExp.test(document.admissionofficersdetails.limit.value))
 {
	alert('Please enter the numeric values.');
	document.admissionofficersdetails.limit.focus();
	return false;
 }
 }
if(document.getElementById("daily").checked== true)
{
 if(document.admissionofficersdetails.limitmonthly.value=='')
 {
	alert("Enter the Limit ");
	document.admissionofficersdetails.limitmonthly.focus();
	return false;
 }
 if (!numericRegExp.test(document.admissionofficersdetails.limitmonthly.value))
 {
	alert('Please enter the numeric values.');
	document.admissionofficersdetails.limitmonthly.focus();
	return false;
 }
}
return true;
	
}


function admin()
{
	
	 document.add.collegename.value = trimStr(document.add.collegename.value);	
	 document.add.collegesite.value = trimStr(document.add.collegesite.value);
	 document.add.username.value = trimStr(document.add.username.value);
	 document.add.surname.value = trimStr(document.add.surname.value);
	 document.add.password.value = trimStr(document.add.password.value);
	 document.add.name.value = trimStr(document.add.name.value);
	 document.add.surname.value = trimStr(document.add.surname.value);
	 document.add.email.value = trimStr(document.add.email.value);
	 document.add.phone.value = trimStr(document.add.phone.value);
	 document.add.fax.value = trimStr(document.add.fax.value);
	 document.add.country.value = trimStr(document.add.country.value);
	 document.add.state.value = trimStr(document.add.state.value);
	 document.add.city.value = trimStr(document.add.city.value);
	 document.add.zip.value = trimStr(document.add.zip.value);	
	 document.add.collegeurl.value = trimStr(document.add.collegeurl.value);
	 
	 var validateUrl = new RegExp();
    validateUrl.compile("^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
	numericRegExp = /^([0-9]+)((.[0-9]+)?)$/;

if(document.add.collegename.value=='')
{
	alert("Enter the College Name");
	document.add.collegename.focus();
	return false;
}
if(document.add.collegesite.value=='')
{
	alert("Enter the College Website Name");
	document.add.collegesite.focus();
	return false;
}
if (!validateUrl.test(document.add.collegesite.value))
{
   	alert("Please enter a valid URL.");
	document.add.collegesite.focus();
    return false;
}
if(document.add.username.value=='')
{
	alert("Enter the User Name");
	document.add.username.focus();
	return false;
}
if(document.add.password.value=='')
{
	alert("Enter the Password");
	document.add.password.focus();
	return false;
}
if(document.add.name.value=='')
{
	alert("Enter the Name");
	document.add.name.focus();
	return false;
}
if(document.add.surname.value=='')
{
	alert("Enter the Name");
	document.add.surname.focus();
	return false;
}

if(document.add.email.value=='')
{
	alert("Enter the Email-Id");
	document.add.email.focus();
	return false;
}
if(validateEmail(document.add.email.value) == false)
{
    alert('Enter the correct Email ID.');
    document.add.email.focus();
    return false;
}	
if(document.add.phone.value=='')
{
	alert("Enter the Phone no");
	document.add.phone.focus();
	return false;
}
if (!numericRegExp.test(document.add.phone.value))
{
	alert('Please enter the numeric values.');
	document.add.phone.focus();
	return false;
}
if(document.add.fax.value=='')
{
	alert("Enter the Fax");
	document.add.fax.focus();
	return false;
}
if (!numericRegExp.test(document.add.fax.value))
{
	alert('Please enter the numeric values.');
	document.add.fax.focus();
	return false;
}
if(document.add.country.value=='')
{
	alert("Enter the Country Name");
	document.add.country.focus();
	return false;
}
if(document.add.state.value=='')
{
	alert("Enter the State Name");
	document.add.state.focus();
	return false;
}
if(document.add.city.value=='')
{
	alert("Enter the City Name");
	document.add.city.focus();
	return false;
}
if (!numericRegExp.test(document.add.zip.value))
{
	alert('Please enter the numeric values.');
	document.add.zip.focus();
	return false;
}
if(document.add.collegeurl.value=='')
{
	alert("Enter the Blog Name");
	document.add.collegeurl.focus();
	return false;
}
if (!validateUrl.test(document.add.collegeurl.value))
{
   	alert("Please enter a valid URL.");
	document.add.collegeurl.focus();
    return false;
}
return true;
	
}

function adminedit()
{
	
	 document.add.collegename.value = trimStr(document.add.collegename.value);	
	 document.add.collegewebsite.value = trimStr(document.add.collegewebsite.value);
	 document.add.username.value = trimStr(document.add.username.value);
	 document.add.surname.value = trimStr(document.add.surname.value);
	 document.add.password.value = trimStr(document.add.password.value);
	 document.add.name.value = trimStr(document.add.name.value);
	 document.add.surname.value = trimStr(document.add.surname.value);
	 document.add.email.value = trimStr(document.add.email.value);
	 document.add.phone.value = trimStr(document.add.phone.value);
	 document.add.fax.value = trimStr(document.add.fax.value);
	 document.add.country.value = trimStr(document.add.country.value);
	 document.add.state.value = trimStr(document.add.state.value);
	 document.add.city.value = trimStr(document.add.city.value);
	 document.add.zip.value = trimStr(document.add.zip.value);	
	 document.add.collegeurl.value = trimStr(document.add.collegeurl.value);
	 
	 var validateUrl = new RegExp();
    validateUrl.compile("^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
	numericRegExp = /^([0-9]+)((.[0-9]+)?)$/;

if(document.add.collegename.value=='')
{
	alert("Enter the College Name");
	document.add.collegename.focus();
	return false;
}
if(document.add.collegewebsite.value=='')
{
	alert("Enter the College Website Name");
	document.add.collegewebsite.focus();
	return false;
}
if (!validateUrl.test(document.add.collegewebsite.value))
{
   	alert("Please enter a valid URL.");
	document.add.collegewebsite.focus();
    return false;
}
if(document.add.username.value=='')
{
	alert("Enter the User Name");
	document.add.username.focus();
	return false;
}
if(document.add.password.value=='')
{
	alert("Enter the Password");
	document.add.password.focus();
	return false;
}
if(document.add.name.value=='')
{
	alert("Enter the Name");
	document.add.name.focus();
	return false;
}
if(document.add.surname.value=='')
{
	alert("Enter the Name");
	document.add.surname.focus();
	return false;
}

if(document.add.email.value=='')
{
	alert("Enter the Email-Id");
	document.add.email.focus();
	return false;
}
if(validateEmail(document.add.email.value) == false)
{
    alert('Enter the correct Email ID.');
    document.add.email.focus();
    return false;
}	
if(document.add.phone.value=='')
{
	alert("Enter the Phone no");
	document.add.phone.focus();
	return false;
}
if (!numericRegExp.test(document.add.phone.value))
{
	alert('Please enter the numeric values.');
	document.add.phone.focus();
	return false;
}
if(document.add.fax.value=='')
{
	alert("Enter the Fax");
	document.add.fax.focus();
	return false;
}
if (!numericRegExp.test(document.add.fax.value))
{
	alert('Please enter the numeric values.');
	document.add.fax.focus();
	return false;
}
if(document.add.country.value=='')
{
	alert("Enter the Country Name");
	document.add.country.focus();
	return false;
}
if(document.add.state.value=='')
{
	alert("Enter the State Name");
	document.add.state.focus();
	return false;
}
if(document.add.city.value=='')
{
	alert("Enter the City Name");
	document.add.city.focus();
	return false;
}
if (!numericRegExp.test(document.add.zip.value))
{
	alert('Please enter the numeric values.');
	document.add.zip.focus();
	return false;
}
if(document.add.collegeurl.value=='')
{
	alert("Enter the Blog Name");
	document.add.collegeurl.focus();
	return false;
}
if (!validateUrl.test(document.add.collegeurl.value))
{
   	alert("Please enter a valid URL.");
	document.add.collegeurl.focus();
    return false;
}
return true;
	
}

