		var highlightcolor="#FFFFCC"
		
		var ns6=document.getElementById&&!document.all
		var previous=''
		var eventobj
		
		//Regular expression to highlight only form elements
		var intended=/INPUT|TEXTAREA|SELECT|OPTION/
		
		//Function to check whether element clicked is form element
		function checkel(which){
		if (which.style&&intended.test(which.tagName)){
		if (ns6&&eventobj.nodeType==3)
		eventobj=eventobj.parentNode.parentNode
		return true
		}
		else
		return false
		}
		
		//Function to highlight form element
		function highlight(e){
		eventobj=ns6? e.target : event.srcElement
		if (previous!=''){
		if (checkel(previous))
		previous.style.backgroundColor=''
		previous=eventobj
		if (checkel(eventobj))
		eventobj.style.backgroundColor=highlightcolor
		}
		else{
		if (checkel(eventobj))
		eventobj.style.backgroundColor=highlightcolor
		previous=eventobj
		}
		}
		
		function validate(form)
		{
			
			if(document.getElementById('Name').value == "")
				{
					
					alert("Please enter your name !!!");
					document.getElementById('Name').focus();
					return false;
				}
				
		//--------------------------------contact no validator		
			if (document.getElementById('Phone').value == "")
				  {
					alert("Please enter a value for the \"Contact number\" field.");
					document.getElementById('Phone').focus();
					return (false);
				  }
				
				  // only allow numbers to be entered
				  var checkOK = "0123456789";
				  var checkStr = document.getElementById('Phone').value;
				  var allValid = true;
				  var allNum = "";
				  for (i = 0;  i < checkStr.length;  i++)
				  {
					ch = checkStr.charAt(i);
					for (j = 0;  j < checkOK.length;  j++)
					  if (ch == checkOK.charAt(j))
						break;
					if (j == checkOK.length)
					{
					  allValid = false;
					  break;
					}
					if (ch != ",")
					  allNum += ch;
				  }
				  if (!allValid)
				  {
					alert("Please enter only digit characters in the \"Contact Number\" field.");
					document.getElementById('Phone').focus();
					return (false);
				  }	
					
			if(document.getElementById('Email').value=="")
				{
					alert("Please enter your email address !!!");
					document.getElementById('Email').focus();
					return false;
				}
			if (!checkemail1(document.getElementById('Email').value))
				{ 
						alert(document.getElementById('Email').value + " is not a valid Email ID");
						document.getElementById('Email').focus();	 
						return false;	
				}
			if (document.getElementById('Code').value == "")
				{
					alert("Please fill in confirmation code");
					document.getElementById('Code').focus();
					return false;
				}
		function checkemail1(emailadd)
			{	
			var result = false;
			var theStr = new String(emailadd);
			var index = theStr.indexOf("@");
				if (index > 0)
				{
					var pindex = theStr.indexOf(".",index);
					if ((pindex > index+1) && (theStr.length > pindex+2))
					result = true;
				}
				
			return result;
			}
		}
		function validate_form()
		{
			
			if(document.getElementById('Name2').value == "")
				{
					
					alert("Please enter company name !!!");
					document.getElementById('Name2').focus();
					return false;
				}
				
				if(document.getElementById('contactperson').value == "")
				{
					
					alert("Please enter contact person name !!!");
					document.getElementById('contactperson').focus();
					return false;
				}
		//--------------------------------contact no validator		
			if (document.getElementById('Phone').value == "")
				  {
					alert("Please enter a value for the \"Contact number\" field.");
					document.getElementById('Phone').focus();
					return (false);
				  }
				
				  // only allow numbers to be entered
				  var checkOK = "0123456789";
				  var checkStr = document.getElementById('Phone').value;
				  var allValid = true;
				  var allNum = "";
				  for (i = 0;  i < checkStr.length;  i++)
				  {
					ch = checkStr.charAt(i);
					for (j = 0;  j < checkOK.length;  j++)
					  if (ch == checkOK.charAt(j))
						break;
					if (j == checkOK.length)
					{
					  allValid = false;
					  break;
					}
					if (ch != ",")
					  allNum += ch;
				  }
				  if (!allValid)
				  {
					alert("Please enter only digit characters in the \"Contact Number\" field.");
					document.getElementById('Phone').focus();
					return (false);
				  }	
					
			if(document.getElementById('email').value=="")
				{
					alert("Please enter your email address !!!");
					document.getElementById('email').focus();
					return false;
				}
			if (!checkemail1(document.getElementById('email').value))
				{ 
						alert(document.getElementById('email').value + " is not a valid Email ID");
						document.getElementById('email').focus();	 
						return false;	
				}
			if (document.getElementById('code').value == "")
				{
					alert("Please fill in confirmation code");
					document.getElementById('code').focus();
					return false;
				}
		function checkemail1(emailadd)
			{	
			var result = false;
			var theStr = new String(emailadd);
			var index = theStr.indexOf("@");
				if (index > 0)
				{
					var pindex = theStr.indexOf(".",index);
					if ((pindex > index+1) && (theStr.length > pindex+2))
					result = true;
				}
				
			return result;
			}
		}