function validateall(form) {
	for (var i = 0; i < form.elements.length; i++)	{
		var theElement = form.elements[i];
		//alert("&&& " + theElement);
		if (!checkFilled(theElement))
			return false;
	}
	return true;
}

function checkFilled(t)	{
  var tmflag
  tmflag=0;
//alert("go this side 2!!");
  if(t.value.length == 0 || t.value == " ")	{
		if(t.name=="name")
			newname="Name"
		else if (t.name=="company")
			newname="Company"
		else if (t.name=="email")
			newname="E-mail"
			
		alert("\" " + newname + "\"  is required.");
		t.focus();
		t.select();
		return false;
   }
  tm = t.value 	
     
  if(t.name=="email") {
	if ((tm.length < 5) && (tm.length!=0)) {
		alert("Invalid e-mail address!");
		t.focus();
		t.select();
		return false;
	}
	for (var i=0; i<tm.length; i++) {
		theChar = tm.charAt(i);		
		if((theChar=="/")||(theChar==":")||(theChar==" ")||(theChar==";")||(theChar==",")) {
			alert("Invalid e-mail address!");
			t.focus();
			t.select();
			return false;
		}
		if(theChar=="@")
			tmflag=1
		else if (theChar==".")
			tmflag=tmflag+1 
	}
	if(tmflag < 2) {
			alert("Invalid e-mail address!");
			t.focus();
			t.select();
			return false;
	}
  }
   return true;
}
