function validate_phone(field,alerttxt) {

	with (field) {
		var mys=value.substring(0,2);
		var mys1=value.substring(4,10);
		var mys2=value.substring(3,10);
		if ((value.length !== 10)||(mys1 == "123456")||(mys1 == "000000")||(mys1 == "111111")||(mys1 == "222222")||(mys1 == "333333")||(mys1 == "444444")||(mys1 == "555555")||(mys1 == "666666")||(mys1 == "777777")||(mys1 == "888888")||(mys1 == "999999")||(mys2 == "1234567")||(mys !== "04")||(value == "0422330077")||(value == "0407000101")||(value == "0412345678")||(value == "0404040404")||(value == "0412121212")||(value == "0412312312")||(value == "0407000101")||(value == "0400000000")||(value == "0411111111")||(value == "0422222222")||(value == "0433333333")||(value == "0444444444")||(value == "0455555555")||(value == "0466666666")||(value == "0477777777")||(value == "0488888888")||(value == "0499999999")) {
			alert(alerttxt);
			return false;}
		else {
		return true;}
	}
}

function validate_required(field,alerttxt) {
	with (field) {
		if (value==null||value=="") {
			alert(alerttxt);
			return false;
		}
		else {
			return true;
		}
	}
}

function validate_email(field,alerttxt) {
	with (field) {
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);
			return false;
		} else {
			return true;
		}
	}
}

function validate_mobile(thisform) {
	with (thisform) {
	
			if (validate_required(Contact0FirstName,"Please specify your First Name!")==false) {
			Contact0FirstName.focus();
			return false;
		}
		if (validate_required(Contact0Email,"Please enter a valid Email Address!")==false) {
			Contact0Email.focus();
			return false;
		}
		if (validate_email(Contact0Email,"Please enter a valid Email Address!")==false) {
			Contact0Email.focus();
			return false;
		}
		if (validate_phone(Contact0Phone1,"Please enter a Correct Mobile Number!")==false) {
			Contact0Phone1.focus();
			return false;
		}

	}
}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;
else if ((("0123456789").indexOf(keychar) > -1))
   return true;
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}