function selectAll(codetext) {
var tempval=eval("document."+codetext)
tempval.focus()
tempval.select()
}

function check_sendmail(theForm)
{
  if(checkspace(theForm.realname.value)) {
	theForm.realname.focus();
        alert("Please input real name");
	return false;
   }
     if(theForm.semail.value.length!=0)
  {
    if (theForm.semail.value.charAt(0)=="." ||        
         theForm.semail.value.charAt(0)=="@"||       
         theForm.semail.value.indexOf('@', 0) == -1 || 
         theForm.semail.value.indexOf('.', 0) == -1 || 
         theForm.semail.value.lastIndexOf("@")==theForm.semail.value.length-1 || 
         theForm.semail.value.lastIndexOf(".")==theForm.semail.value.length-1)
     {
      alert("Email address is incorrect ");
      theForm.semail.focus();      
      return false;
      }
      
   } 
   else
  {
   alert("Email address is incorrect ");
   theForm.semail.focus();
   return false;
   }
  if(checkspace(theForm.ssubject.value)) {
	theForm.ssubject.focus();
        alert("Please input subject");
	return false;
  }
  
   return true;

}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function check_addurl(theForm)
{
  if(checkspace(theForm.title.value)) {
	theForm.title.focus();
        alert("Please input Title of your site");
	return false;
   }
     if(checkspace(theForm.url.value)||theForm.url.value=='http://') {
	theForm.url.focus();
        alert("Please input URL of your web site");
	return false;
   }
     if(checkspace(theForm.page_url.value)||theForm.page_url.value=='http://') {
	theForm.page_url.focus();
        alert("Please input Page of your Web site where you placed our link");
	return false;
   }
   if(checkspace(theForm.description.value)) {
	theForm.description.focus();
        alert("Please input Site description");
	return false;
   }else{
   
    if(theForm.description.value.length>200){    	
    	theForm.description.focus();
        alert("up to 200 characters");
    	return false;
	}
   }
  
     if(theForm.contact_email.value.length!=0)
  {
    if (theForm.contact_email.value.charAt(0)=="." ||        
         theForm.contact_email.value.charAt(0)=="@"||       
         theForm.contact_email.value.indexOf('@', 0) == -1 || 
         theForm.contact_email.value.indexOf('.', 0) == -1 || 
         theForm.contact_email.value.lastIndexOf("@")==theForm.contact_email.value.length-1 || 
         theForm.contact_email.value.lastIndexOf(".")==theForm.contact_email.value.length-1)
     {
      alert("Email address is incorrect ");
      theForm.contact_email.focus();      
      return false;
      }
      
   } 
   else
  {
   alert("Email address is incorrect ");
   theForm.contact_email.focus();
   return false;
   }

  
   return true;

}