function Trim(nStr){return nStr.replace(/(^\s*)|(\s*$)/g, "");}
function isNull(obj,msg){
	if(msg!="Password")
		obj1=Trim(obj.value);
	else
		obj1=obj.value;
	if (obj1==""){
		alert("Please enter the " +msg);
		obj.focus();
		return true;
	}else
		return false;
}
function notEmail(obj,msg){
	var exp=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if (!exp.test(obj.value)){
		alert("Please enter valid "+msg);
		obj.focus();
		return true;
	}else
		return false;
}

function fnValidate()
{
	if(Trim(document.mailform.txtName.value)=="Enter your Name")
		document.mailform.txtName.value="";
	if(Trim(document.mailform.txtMail.value)=="Enter your Email")
		document.mailform.txtMail.value="";
	if(Trim(document.mailform.txtPhoneNo.value)=="Enter your Email")
		document.mailform.txtPhoneNo.value="";	
	if(Trim(document.mailform.txtMsg.value)=="Enter your request")
		document.mailform.txtMsg.value="";
	if(isNull(document.mailform.txtName,"name")) return false;
	if(isNull(document.mailform.txtMail,"e-mail address")) return false;
	if(notEmail(document.mailform.txtMail,"e-mail address")) return false;
	return true;
}

function fnvalidatecontact()
{
	if(isNull(document.thisForm.Name,"name")) return false;
	if(isNull(document.thisForm.EMail,"E-mail")) return false;
	if(notEmail(document.thisForm.EMail,"E-mail")) return false;
	if(isNull(document.thisForm.Phone,"Mobile No")) return false;
	if(isNull(document.thisForm.Captcha_Text,"Security Code")) return false;
	return true;
}