// JavaScript Document
function checkValid()
{
	document.getElementById("conname").style.display = "none";
	document.getElementById("conemail").style.display = "none";
	document.getElementById("convalidemail").style.display = "none";
	document.getElementById("conphone").style.display = "none";
	document.getElementById("consubject").style.display = "none";
	document.getElementById("concomment").style.display = "none";
    
	resetstyle(document.frmcontactus);
	
    if(Trim(document.frmcontactus.vName.value)=="")
	{
		inputvalidation_red('vName');
        document.getElementById("conname").style.display = "";
		document.frmcontactus.vName.value = '';
        document.frmcontactus.vName.focus();
		return false;
	}

	if(Trim(document.frmcontactus.vEmail.value)=="")
	{
	    inputvalidation_red('email');
        document.getElementById("conemail").style.display = "";
		document.frmcontactus.vEmail.value = '';		
		document.frmcontactus.vEmail.focus();
		return false;
	}
	
	if(!isValidEmail(document.frmcontactus.vEmail.value,"convalidemail"))
	{
	    inputvalidation_red('email');
		document.frmcontactus.vEmail.focus();
		document.frmcontactus.vEmail.select();
		document.getElementById("convalidemail").style.display = "";
		return false;
	}
	
    if(Trim(document.frmcontactus.vPhone.value) != '')
	{
		if(!phoneformate(document.frmcontactus.vPhone.value,document.frmcontactus.vPhone.value.length))
		{
			inputvalidation_red('phone');
            document.getElementById("conphone").style.display = "";
            document.frmcontactus.vPhone.select();
			return false;
		}
	}
	if(Trim(document.frmcontactus.vSubject.value)=="")
	{
	    inputvalidation_red('subject');
		document.getElementById("consubject").style.display = "";
        document.frmcontactus.vSubject.value = "";
		document.frmcontactus.vSubject.focus();
		return false;
	}
	if(Trim(document.frmcontactus.vComment.value)=="")
	{
	    inputvalidation_red('comments');
        document.getElementById("concomment").style.display = "";
	    document.frmcontactus.vComment.value = "";
        document.frmcontactus.vComment.focus();
		return false;
	}
}

