function validateformSubmitTwo(){
	if ((validateNames_popTwo()==true) && (emailLength_popTwo()==true) && (emailValid_popTwo(document.submitTwo.from.value)==true)){
		return true;
	}else{
		return false;
	}
}

function validateNames_popTwo(){
	var fullnames=document.submitTwo.name.value;
	
	if (fullnames==null || fullnames==""){
		alert ("Please enter your Name");
		document.submitTwo.name.focus();
		return false;
	}
	return true;
}

function emailLength_popTwo(){
  var emailIDs=document.submitTwo.from.value;

  if ((emailIDs==null)||(emailIDs=="")){
	  alert("Please enter your Email address.");
	  document.submitTwo.from.focus();
	  return false;
  }
  
  if ((emailIDs.length < 5)){
	  alert("Email address should be a valid one and more than 5 characters.");
	  document.submitTwo.from.focus();
	  return false;
  }
  return true;
}


function emailValid_popTwo(strs){
    var at="@"
    var dot="."
    var lat=strs.indexOf(at)
    var lstr=strs.length
    var ldot=strs.indexOf(dot)
  
	if (strs.indexOf(at)==-1){
	   alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
	   document.submitTwo.from.focus();
	   return false;
	}

	if (strs.indexOf(at)==-1 || strs.indexOf(at)==0 || strs.indexOf(at)==lstr){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}

	if (strs.indexOf(dot)==-1 || strs.indexOf(dot)==0 || strs.indexOf(dot)==lstr){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}

	if (strs.indexOf(at,(lat+1))!=-1){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}

	if (strs.substring(lat-1,lat)==dot || strs.substring(lat+1,lat+2)==dot){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}

	if (strs.indexOf(dot,(lat+2))==-1){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}
		
	if (strs.indexOf(" ")!=-1){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}
	
	if (strs.indexOf(dot)==lstr-1){
		alert("OOPS! The e-mail you entered is not valid. Please edit and try again. Thanks");
		document.submitTwo.from.focus();
		return false;
	}
	
 	return true;
}