 function validatelogin()
{
	//txtusername = document.getElementById(txtusername)
	//txtpassword = document.getElementById(txtpassword)
	with (document.frmlogin)
	{
		if(txtUID.value=="")
		{
			alert("Please enter UserName");
			txtUID.focus();
			return false;
		}
		if (txtPass.value=="")
				{
					alert("Please Enter your password");
					txtPass.focus();
					return false;
			}
		//document.formobject.NLFlag.value="subscribeME";
		document.frmlogin.submit();
	}
}
function validateEmail()
{
	with (document.formobject)
	{
		if(txtEmail.value=="")
		{
			alert("Please enter your email address");
			txtEmail.focus();
			return false;
		}else if (!(isEmail(txtEmail.value)))
		{
					alert("Please Enter a Valid Email( abc@abc.com )");
					txtEmail.focus();
					return false;
		}
		//document.formobject.NLFlag.value="subscribeME";
		document.formobject.submit();
	}
}

function restrictKeys(e) {
        var evt = (e) ? e : window.event;
        var key = (evt.keyCode) ? evt.keyCode : evt.which;

        if(key != null) {
            key = parseInt(key, 10);

			if(key==13)
				return false;
           /* if((key < 48 || key > 57) && (key < 96 || key > 105)) {
                if(key != 8 && key != 9 && key != 16 && (key < 35 || key > 40))
                    return false;
            }
			*/
        }

        return true;
    }

//Email validation Function
function isEmail (theStr) 
{
	var atIndex = theStr.indexOf('@');
 	var dotIndex = theStr.indexOf('.', atIndex);
 	var flag = true;
 	theSub = theStr.substring(0, dotIndex+1)
 	if ((atIndex < 1)||(atIndex != theStr.lastIndexOf('@'))||(dotIndex < atIndex + 2)||(theStr.length <= theSub.length)) 
 	{	 
 		flag = false; 
 	}
 	else 
	{ 
 		flag = true; 
 	}
 	return(flag);
}
function ValidateInquiry()
{
	//alert('hi');
	with (document.formobject1)
	{
		if(txtName.value=="")
		{
			alert("Please enter your Name");
			txtName.focus();
			return false;
		}
		if(txtInqEmail.value=="")
		{
			alert("Please enter your email address");
			txtInqEmail.focus();
			return false;
		}
		if (!(isEmail(txtInqEmail.value)))
				{
					alert("Please Enter a Valid Email( abc@abc.com )");
					txtInqEmail.focus();
					return false;
		}
		if(txtContact.value=="")
		{
			alert("Please enter your Contact");
			txtContact.focus();
			return false;
		}
		if(txtMsg.value=="")
		{
			alert("Please enter your Inquiry Matter");
			txtMsg.focus();
			return false;
		}
		document.formobject1.hdInqFlag.value="Inquire";
		document.formobject1.submit();
	}
}


function ValidateContact()
{	
	with(document.frmContact)
	{
		if(txtName.value<5)
		{
			alert("Please enter Name(Minimum 5 characters)");
			txtName.focus();
			return false;
		}
		if(txtComments.value<5)
		{
			alert("Please enter Comments(Minimum 5 characters)");
			txtComments.focus();
			return false;
		}
		if (!(isEmail(txtEmail1.value)))
				{
					alert("Please Enter a Valid Email( abc@abc.com )");
					txtEmail1.focus();
					return false;
			}
		
	}
	document.frmContact.hdContactFlag.value="Contact";
	document.frmContact.submit();	
}


function ValidateInquiry1()
{	
	with(document.frmInquiry)
	{
		if(txtName.value<5)
		{
			alert("Please enter Name(Minimum 5 characters)");
			txtName.focus();
			return false;
		}
		if (!(isEmail(txtEmail1.value)))
				{
					alert("Please Enter a Valid Email( abc@abc.com )");
					txtEmail1.focus();
					return false;
			}
			if(txtComment.value<5)
		{
			alert("Please enter Comments(Minimum 5 characters)");
			txtComment.focus();
			return false;
		}
		
		
	}
	document.frmInquiry.hdInquiryFlag.value="Inquiry";
	document.frmInquiry.submit();	
}

function ValidateSearch()
{
	with (document.frmSearch)
	{
		if(txtSearch.value=="")
		{
			alert("Please enter search criteria");
			txtSearch.focus();
			return false;
		}
		document.frmSearch.action="inside.php"
	document.frmSearch.submit();
	}
	
}