// JavaScript Document

function submit_dir()

{


if(document.form1.directory_name.value=="" || document.form1.directory_name.value=="Directory Name") {

alert('Please Enter Directory Name');
document.form1.directory_name.value='';
document.form1.directory_name.focus();

return false;

}

if(document.form1.url.value=="" || document.form1.url.value=="Directory URL") {

alert('Please Write Your Directory URL');
document.form1.url.value='';
document.form1.url.focus();

return false;

}

if(document.form1.category.value=="") {

alert('Please Select Category!!!');

document.form1.category.focus();

return false;

}

if(document.form1.type_of_link1.checked==false && 
   document.form1.type_of_link2.checked==false && 
   document.form1.type_of_link3.checked==false) {

alert('Please select type of link you allow !!!');
document.form1.type_of_link1.focus();

return false;

}

if(document.form1.deep_link.value=="") {

alert('Please select deep link option!!');

document.form1.deep_link.focus();

return false;

}

if(document.form1.description.value=="" || document.form1.description.value.length<30) {

alert('Please explain about your directory with minimum 30 characters!!');

document.form1.description.focus();

return false;

}

if(document.form1.your_name.value=="" || document.form1.your_name.value=="Your Name") {

alert('Please put your name!!');

document.form1.your_name.focus();

return false;

}


	var x = document.form1.email.value;
	
	if(document.form1.email.value=="" || document.form1.email.value=="Email ID")
	{
		alert("Enter The Email !");
		document.form1.email.focus();
		document.form1.email.value='';
		return false;
	}
	if(document.form1.email.value!="" && !checkMail(document.form1.email.value))
	{
		alert("Email must contain an email address.\n");
		
			document.form1.email.focus();
		
		return false;
	}
	
	if(document.form1.terms.checked==false) {

alert('You must be agree to terms & conditions!!!');
document.form1.terms.focus();

return false;

}
	
	
}

function checkMail(email)
{
	var x = email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) 
	
	{
	 return true;
	}
	else 
	{
	  return false;
	}

}
	
	
	
	function change_password() { 
	
	if(document.form1.password.value=="") {

alert('Password Field can not be blank!!!');
document.form1.password.focus();

return false;

}
		if(document.form1.cpassword.value=="") {

alert('Confirm Password Field can not be blank!!!');
document.form1.cpassword.focus();

return false;

}
	if(document.form1.password.value!=document.form1.cpassword.value) {
		
		
	alert('Password and Confirm Password Must Match!');
	
	return false;
		
	}
	
	
	}
	
	
	

