function show(id)
{
 document.getElementById(id).className='visibleobject';
}
function hide(id)
{
 document.getElementById(id).className='invisibleobject';
}
function toggle_display(id)
{
 if (document.getElementById(id).className=='visibleobject')  
  { hide(id); }
 else
 { show(id); }
}
// JavaScript Document
	var whitespace = " \t\n\r";
// Function to check whether the value in a Text Field is Null
	function isEmpty(s)
	{  return ((s == null) || (s.length == 0))
	}
// Function to check whether the value in a Text Field is a WhiteSpace
	function isWhitespace (s)
	{  var i;
 	  // Is s empty?
 	  if (isEmpty(s)) return true;
 	   // Search through string's characters one by one
 	   // until we find a non-whitespace character.
 	   // When we do, return false; if we don't, return true.
 	   for (i = 0; i < s.length; i++)
 	   {   
 	  // Check that current character isn't whitespace.
 	  var c = s.charAt(i);
 	  if (whitespace.indexOf(c) == -1) return false;
 	   }
 	   // All characters are whitespace.
	  return true;
	}
// Function to ensure that the email address is in proper format
	function isEmail (s)
  	{
    var i = 1;
    var sLength = s.length;
    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
	  // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
    }
 function isWebsite (s)
  	{
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
    }
  function isCharsInBag (s, bag)
  {  
  var i;
  for (i = 0; i < s.length; i++)
  {   
    var c = s.charAt(i);
    if (bag.indexOf(c) == -1)
	 return false;
  }
  return true;
  }
function validatereg()
{
var username= document.registration_form.username.value;
 if(username=="")
 {
		alert( "Please Enter  Username");
		document.registration_form.username.focus( );
		return false;
 }
 else{
	if (!isEmail(username))
		{
			alert("Please enter the username in the Email Format");
			document.registration_form.username.focus( );	
			return false;
		}
	}	
 var password = document.registration_form.password.value;
	if((password=="") || (password.length<4))
	{
		alert("Please enter the Password");
		document.registration_form.password.focus( );
		return false;
	}
	var confirm_password = document.registration_form.confirm_password.value;
	if(confirm_password!=password)
	{
	  alert("Password & Confirm Password are not same");
	  document.registration_form.confirm_password.focus();
	  return false;
	}
	
var first_name= document.registration_form.first_name.value;
 if((first_name=="") || (first_name=="First Name"))
 {
		alert( "Please Enter First Name");
		document.registration_form.first_name.focus( );
		return false;
 }
var last_name= document.registration_form.last_name.value;
 if((last_name=="") || (last_name=="Last Name"))
 {
		alert( "Please Enter Last Name");
		document.registration_form.last_name.focus( );
		return false;
 }
  var email = document.registration_form.email.value;
	if(email=="")
	{
		alert("Please enter the Email");
		document.registration_form.email.focus( );
		return false;
	}
	else{
	if (!isEmail(email))
		{
			alert("Please enter the Email address in the proper Format");
			document.registration_form.email.focus( );	
			return false;
		}
	}	
	}
function validatecompanyreg()
{
var username= document.registration_form.username.value;
 if(username=="")
 {
		alert( "Please Enter  Username");
		document.registration_form.username.focus( );
		return false;
 }
 else{
	if (!isEmail(username))
		{
			alert("Please enter the username in the Email Format");
			document.registration_form.username.focus( );	
			return false;
		}
	}
 var password = document.registration_form.password.value;
	if((password=="") || (password.length<4))
	{
		alert("Please enter the Password");
		document.registration_form.password.focus( );
		return false;
	}
	var confirm_password = document.registration_form.confirm_password.value;
	if(confirm_password!=password)
	{
	  alert("Password & Confirm Password are not same");
	  document.registration_form.confirm_password.focus();
	  return false;
	}
var first_name= document.registration_form.first_name.value;
 if((first_name=="") || (first_name=="First Name"))
 {
		alert( "Please Enter First Name");
		document.registration_form.first_name.focus( );
		return false;
 }
var last_name= document.registration_form.last_name.value;
 if((last_name=="") || (last_name=="Last Name"))
 {
		alert( "Please Enter Last Name");
		document.registration_form.last_name.focus( );
		return false;
 }
  var email = document.registration_form.email.value;
	if(email=="")
	{
		alert("Please enter the Email");
		document.registration_form.email.focus( );
		return false;
	}
	else{
	if (!isEmail(email))
		{
			alert("Please enter the Email address in the proper Format");
			document.registration_form.email.focus( );	
			return false;
		}
	}	
	}
	
	<!--
	function validateenquiryform()
{
var name= document.enquiry_form.name.value;
 if(name=="")
 {
		alert( "Please Enter  Name");
		document.enquiry_form.name.focus( );
		return false;
 }var job_title= document.enquiry_form.job_title.value;
 if(job_title=="")
 {
		alert( "Please Enter Job Title");
		document.enquiry_form.job_title.focus( );
		return false;
 }
 var company= document.enquiry_form.company.value;
 if(company=="")
 {
		alert( "Please Enter company");
		document.enquiry_form.company.focus( );
		return false;
 }	
  var email = document.enquiry_form.email.value;
	if(email=="")
	{
		alert("Please enter the Email");
		document.enquiry_form.email.focus( );
		return false;
	}
	else{
	if (!isEmail(email))
		{
			alert("Please enter the Email address in the proper Format");
			document.enquiry_form.email.focus( );	
			return false;
		}
	}
	var remark= document.enquiry_form.remark.value;
 if(remark=="")
 {
		alert( "Please Enter Remarks");
		document.enquiry_form.remark.focus( );
		return false;
 }	
 getRequest('enquiry_mail.php?name='+document.enquiry_form.name.value+'&job_title='+document.enquiry_form.job_title.value+'&company='+document.enquiry_form.company.value+'&email='+document.enquiry_form.email.value+'&telephone='+document.enquiry_form.telephone.value+'&enquiry_type='+document.enquiry_form.enquiry_type.value+'&remarks='+document.enquiry_form.remark.value+'&subscribe='+document.enquiry_form.subscribe.value,'enquiry_result','');
	}
	-->
