function trim(str){ return str.replace(/^\s+|\s+$/g,''); }
function isEmail(objField){ if(objField.value.length > 0){ if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(objField.value)){ return true; } } alert("Invalid E-mail Address! Please re-enter."); objField.select(); return false; }

function frmContact() {
	if(trim(document.getElementById("txtName").value)=="") {
		alert("Please enter the Name");
		document.getElementById("txtName").focus();
		return false;
	}
	if(trim(document.getElementById("txtEmailid").value)=="") {
		alert("Please enter the EmailId");
		document.getElementById("txtEmailid").focus();
		return false;
	}
	if(isEmail(document.getElementById("txtEmailid"))==false) {
		document.getElementById("txtEmailid").focus();
		return false;
	}
	if(trim(document.getElementById("txtaContent").value)=="") {
		alert("Please enter the Content");
		document.getElementById("txtaContent").focus();
		return false;
	}
	if(document.getElementById("txtaContent").value.lenght > 450) {
		alert("Please enter the Content maximum 450 character");
		document.getElementById("txtaContent").focus();
		return false;
	}
}

function frmSubmitUrl() {
	if(trim(document.getElementById("txtEmailid").value)=="") {
		alert("Please enter the EmailId");
		document.getElementById("txtEmailid").focus();
		return false;
	}
	if(isEmail(document.getElementById("txtEmailid"))==false) {
		document.getElementById("txtEmailid").focus();
		return false;
	}
	if(trim(document.getElementById("txtUrl").value)=="") {
		alert("Please enter the Site");
		document.getElementById("txtUrl").focus();
		return false;
	}
	if(trim(document.getElementById("captcha").value)=="") {
		alert("Please enter the Captcha");
		document.getElementById("captcha").focus();
		return false;
	}
}