function trim(str) {
    return str.replace(/^\s*|\s*$/g, "");
}
function IsOfficialEmailCheck(strEmail){
	var strArray=strEmail.split("@");var strstr=strArray[1].toLowerCase();
	if(strstr=="hotmail.com"){return false;}
	else if(strstr=="gmail.com"){return false;}
	else if(strstr=="yahoo.co"){return false;}
	else if(strstr=="yahoo.com"){return false;}
	else if(strstr=="mailinator.com"){return false;}
	else if(strstr=="gmail.co.in"){return false;}
	else if(strstr=="aol.com"){return false;}
	else if(strstr=="yandex.com"){return false;}
	else if(strstr=="msn.com"){return false;}
	else if(strstr=="gawab.com"){return false;}
	else if(strstr=="inbox.com"){return false;}
	else if(strstr=="gmx.com"){return false;}
	else if(strstr=="rediffmail.com"){return false;}
	else if(strstr=="in.com"){return false;}
	else if(strstr=="live.com"){return false;}
	else if(strstr=="hotmail.co.uk"){return false;}
	else if(strstr=="hotmail.fr"){return false;}
	else if(strstr=="yahoo.fr"){return false;}
	else if(strstr=="wanadoo.fr"){return false;}
	else if(strstr=="wanadoo.fr"){return false;}
	else if(strstr=="comcast.net"){return false;}
	else if(strstr=="yahoo.co.uk"){return false;}
	else if(strstr=="yahoo.com.br"){return false;}
	else if(strstr=="yahoo.co.in"){return false;}
	else if(strstr=="rediffmail.com"){return false;}
	else if(strstr=="free.fr"){return false;}
	else if(strstr=="gmx.de"){return false;}
	else if(strstr=="gmx.de"){return false;}
	else if(strstr=="yandex.ru"){return false;}
	else if(strstr=="ymail.com"){return false;}
	else if(strstr=="libero.it"){return false;}
	else if(strstr=="outlook.com"){return false;}
	else if(strstr=="uol.com.br"){return false;}
	else if(strstr=="bol.com.br"){return false;}
	else if(strstr=="mail.ru"){return false;}
	else if(strstr=="cox.net"){return false;}
	else if(strstr=="hotmail.it"){return false;}
	else if(strstr=="sbcglobal.net"){return false;}
	else if(strstr=="sfr.fr"){return false;}
	else if(strstr=="live.fr"){return false;}
	else if(strstr=="verizon.net"){return false;}
	else if(strstr=="live.co.uk"){return false;}
	else if(strstr=="googlemail.com"){return false;}
	else if(strstr=="yahoo.es"){return false;}
	else if(strstr=="ig.com.br"){return false;}
	else if(strstr=="live.nl"){return false;}
	else if(strstr=="bigpond.com"){return false;}
	else if(strstr=="terra.com.br"){return false;}
	else if(strstr=="yahoo.it"){return false;}
	else if(strstr=="neuf.fr"){return false;}
	else if(strstr=="yahoo.de"){return false;}
	else if(strstr=="live.com"){return false;}
	else if(strstr=="yahoo.de"){return false;}
	else if(strstr=="rocketmail.com"){return false;}
	else if(strstr=="att.net"){return false;}
	else if(strstr=="laposte.net"){return false;}
	else if(strstr=="facebook.com"){return false;}
	else if(strstr=="bellsouth.net"){return false;}
	else if(strstr=="yahoo.in"){return false;}
	else if(strstr=="hotmail.es"){return false;}
	else if(strstr=="charter.net"){return false;}
	else if(strstr=="yahoo.ca"){return false;}
	else if(strstr=="yahoo.com.au"){return false;}
	else if(strstr=="rambler.ru"){return false;}
	else if(strstr=="hotmail.de"){return false;}
	else if(strstr=="tiscali.it"){return false;}
	else if(strstr=="shaw.ca"){return false;}
	else if(strstr=="yahoo.co.jp"){return false;}
	else if(strstr=="sky.com"){return false;}
	else if(strstr=="earthlink.net"){return false;}
	else if(strstr=="optonline.net"){return false;}
	else if(strstr=="freenet.de"){return false;}
	else if(strstr=="t-online.de"){return false;}
	else if(strstr=="aliceadsl.fr"){return false;}
	else if(strstr=="virgilio.it"){return false;}
	else if(strstr=="home.nl"){return false;}
	else if(strstr=="qq.com"){return false;}
	else if(strstr=="telenet.be"){return false;}
	else if(strstr=="me.com"){return false;}
	else if(strstr=="yahoo.com.ar"){return false;}
	else if(strstr=="tiscali.co.uk"){return false;}
	else if(strstr=="yahoo.com.mx"){return false;}
	else if(strstr=="gmx.net"){return false;}
	else if(strstr=="mail.com"){return false;}
	else if(strstr=="planet.nl"){return false;}
	else if(strstr=="tin.it"){return false;}
	else if(strstr=="live.it"){return false;}
	else if(strstr=="ntlworld.com"){return false;}
	else if(strstr=="arcor.de"){return false;}
	else if(strstr=="yahoo.co.id"){return false;}
	else if(strstr=="frontiernet.net"){return false;}
	else if(strstr=="hetnet.nl"){return false;}
	else if(strstr=="live.com.au"){return false;}
	else if(strstr=="yahoo.com.sg"){return false;}
	else if(strstr=="zonnet.nl"){return false;}
	else if(strstr=="club-internet.fr"){return false;}
	else if(strstr=="juno.com"){return false;}
	else if(strstr=="optusnet.com.au"){return false;}
	else if(strstr=="blueyonder.co.uk"){return false;}
	else if(strstr=="bluewin.ch"){return false;}
	else if(strstr=="skynet.be"){return false;}
	else if(strstr=="sympatico.ca"){return false;}
	else if(strstr=="windstream.net"){return false;}
	else if(strstr=="mac.com"){return false;}
	else if(strstr=="centurytel.net"){return false;}
	else if(strstr=="chello.nl"){return false;}
	else if(strstr=="live.ca"){return false;}
	else if(strstr=="aim.com"){return false;}
	else if(strstr=="bigpond.net.au"){return false;}
	else{return true;}
}
function validateEmail(strValue){
	var objRegExp=/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,10}$/;
	return objRegExp.test(strValue);
}

function onlyChar(strValue){
	var objRegExp=/^[a-zA-Z ]+$/;
	return objRegExp.test(strValue);
}
function validateCompany(strValue){
	var objRegExp=/^[a-zA-Z0-9 !@#$%^&*)(]{2,100}$/;
	return objRegExp.test(strValue);
}


function validatePhone(strValue){
	//var objRegExp=/^[^\s]+(\s.*)?$/;
    var objRegExp=/^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{1,3})[-. )]*(\d{1,3})[-. ]*(\d{4,10})(?: *x(\d+))?\s*$/;
	return objRegExp.test(strValue);
}

function validateZip(strValue) {

    var objRegExp = /^[^a-z\s]{6,18}/;
    return objRegExp.test(strValue);
}


function trim(str) {
    return str.replace(/^\s*|\s*$/g, "");
}


function fnValidation(ff) {
    
 if (!(onlyChar(trim(ff.name.value)))) {
        alert("Please enter Name");
        ff.name.focus();
        return false;
    }
 
    if(!(validateEmail(trim(ff.email.value))))
	{
		alert("Please Enter Valid email id");
		ff.email.focus();
		return false;
	}
	
	if (!(validatePhone(trim(ff.phone.value)))) {
	alert("Please enter Phone no");
	ff.phone.focus();
	return false;
	}


}


function contactValidation(fn) {
    
 if (!(onlyChar(trim(fn.name.value)))) {
        alert("Please enter Name");
        fn.name.focus();
        return false;
    }
    if(!(validateEmail(trim(fn.email.value))))
	{
		alert("Please Enter Valid email id");
		fn.email.focus();
		return false;
	}
	
	if (!(validatePhone(trim(fn.phone.value)))) {
	alert("Please enter Phone no");
	fn.phone.focus();
	return false;
	}
}












