// JavaScript Document
function Validate_Signup(frm)
{
	with(frm)
	{
		if(!IsEmpty(user_id, 'Please enter User Name.'))
		{
			return false;
		}
		else if (frm.user_id.value.length > 15 )
		{
			alert("User ID must be less then 15 characters long.");
			frm.user_id.focus();
			return (false);
		}
		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
		var checkStr = frm.user_id.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
			  if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length)
			{
			  allValid = false;
			  break;
			}
		}   
		if (!allValid)
		{
			alert ("Your User Name has special characters. These are not allowed.\n Please remove them and try again.");
			frm.user_id.focus();
			return false;
		}   
		if(!IsEmail(email_id,'Please Enter valid E-mail'))
		{
			return false;
		}
		if(!IsEmail(verify_email_id,'Please Enter valid Verify E-Mail'))
		{
			return false;
		}
		if(email_id.value != verify_email_id.value)
		{
			alert("Please confirm your Verify E-Mail.");
			return false;
		}
		if(!IsEmpty(password, 'Please enter Password.'))
		{
			return false;
		}
		if(!IsEmpty(confirm_password, 'Please enter Password.'))
		{
			return false;
		}
		if(password.value != confirm_password.value)
		{
			alert("Please confirm your Confirm Password.");
			return false;
		}
		if(agree_terms.checked == false )
		{
			alert("Please make sure you are agree to our terms and conditions.");
			return false;
		}
		return true;
	}
}

function Validate_Inquiry(frm)
{
	with(frm)
	{
		if(!IsEmpty(CompanyName, 'Please enter Company Name.'))
		{
			return false;
		}
		if(!IsEmpty(contact_person, 'Please enter Conatct Person Name.'))
		{
			return false;
		}
		if(!IsEmpty(Address, 'Please enter Address.'))
		{
			return false;
		}
		if(!IsEmpty(City, 'Please enter City.'))
		{
			return false;
		}
		if(!IsEmpty(Pincode, 'Please enter Pin Code.'))
		{
			return false;
		}
		else if(isNaN(Pincode.value))
		{
			alert("Please enter valid Pin Code.");
			return false;
		}
		if(!IsEmpty(telNo, 'Please enter Phone No.'))
		{
			return false;
		}
		else if(isNaN(telNo.value))
		{
			alert("Please enter valid Phone No.");
			return false;
		}
		if(!IsEmpty(faxNo, 'Please enter Fax No.'))
		{
			return false;
		}
		else if(isNaN(faxNo.value))
		{
			alert("Please enter valid Fax No.");
			return false;
		}
		if(!IsEmail(from, 'Please enter Email.'))
		{
			return false;
		}

		if(!IsEmpty(requirement_details, 'Please Requirment Details.'))
		{
			return false;
		}
		return true;
	}
}
