function formvalid()
{
  var form = document.con;

  if(isBlank(form.nam.value))
   {
     alert("Please enter your Name");
     form.nam.value="";
     form.nam.focus();
     return false; 
   }
   
  else if(!isNaN(form.nam.value))
   {
     alert("Name should be in Characters(For Ex:Center for Organisational and professional Excellence)");
     form.nam.focus();
     return false;
   }
  else if(Email(form.ema.value) || emailName(form.ema.value)) 
    { 
     alert("Please enter the valid Email Address 'eg:dir@cope-chennai.com'"); 
     form.ema.value="";     
     form.ema.focus();                      
    return false; 
    }  
  
  return true;
}


function isBlank(p)
{
  var len = p.length;

  for(i=0;i<len;i++)
   {
     temp3=p.substring(i,i+1);
     
     if(p.charAt(i) != ' ') return false;
     else if(temp3 == ' ') return false;
     
   }
  return true;
}

function Email(str)  
{ 
   
  var supported = 0; 
  if (window.RegExp)  
  { 
    var tStr = "a"; 
    var tReg = new RegExp(tStr); 
    if (tReg.test(tStr)) supported = 1; 
  } 
  if (!supported)  
    return (str.indexOf(".") <= 2) || (str.indexOf("@") < 0); 
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); 
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); 
  return (r1.test(str) || !r2.test(str)); 
}
 
function emailName(str) 
  { 
  if(str != "") 
      { 
 
        var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-@."; 
           for(var i=0; i <  str.length; i++) 
	       { 
                temp3=  str.substring(i,i+1); 
		if((chars.indexOf(temp3) == -1) ) 
			 { 
			  return true;   
			 } 
	       } 
    
       } 
 
  }
