<!--
function OK_PhoneFax(nFieldID)
{
	var returnValue=false;
	var sField;
	if (nFieldID == 3)
		sField = "Phone No. 1";
	else if (nFieldID == 4)
		sField = "Phone No. 2";
	else
		sField = "Fax number";
	if (document.forms[0].elements[nFieldID].value.length < 12)
	{
		alert("The " + sField + " that you have entered is too short. Please ensure that you have added \nthe Country and City Codes along with your " + sField + ". All three must be separated by dots.");
		return returnValue;
	}
	var nDot1, nDot2, nDotCount;
	nDotCount=0;
	nDot1=document.forms[0].elements[nFieldID].value.indexOf(".");
	if (nDot1 != -1) //1st Dot found
	{
		nDotCount = 1;
		nDot2 = document.forms[0].elements[nFieldID].value.indexOf(".", nDot1+1);
		if (nDot2 != -1) //2nd Dot found
		{
			nDotCount = 2;
			if (document.forms[0].elements[nFieldID].value.indexOf(".", nDot2+1) != -1) // more Dots found
			{
				alert("A maximum of 2 '.'(dots) are allowed in the " + sField + " field. These should be between \nthe Country Code, City Code and the " + sField + ".");
				return returnValue;
			}
		}
		else
		{
			alert("The " + sField + " that you have entered is too short. Please ensure that you have added \nthe Country and City Codes along with your " + sField + ". All three must be separated by dots.\nFor example: 91.512.2503565");
			return returnValue;
		}	
	}
	else
	{
		alert("The " + sField + " that you have entered is too short. Please ensure that you have added \nthe Country and City Codes along with your " + sField + ". All three must be separated by dots.\nFor example: 91.512.2503565");
		return returnValue;
	}
	var sTmp, nLastDot;
	var nPart1, nPart2, nPart3;
	nLastDot = nDot1 + 1;
	if (isNaN(parseInt(document.forms[0].elements[nFieldID].value.substr(0,nDot1)))==false)
	{
		if (parseInt(document.forms[0].elements[nFieldID].value.substr(0,nDot1)) > 0)
			sTmp =  parseInt(document.forms[0].elements[nFieldID].value.substr(0,nDot1)) + ".";
		else
		{
			alert("The Country Code in " + sField + " is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Country Code in " + sField + " is not a number. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	nLastDot = nDot2+1;
	if (isNaN(parseInt(document.forms[0].elements[nFieldID].value.substr(nDot1+1, nDot2)))==false)
	{
		if (parseInt(document.forms[0].elements[nFieldID].value.substr(nDot1+1, nDot2-nDot1-1)) > 0)
			sTmp =  sTmp + parseInt(document.forms[0].elements[nFieldID].value.substr(nDot1+1, nDot2)) + ".";
		else
		{
			alert("The City Code in " + sField + " is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The City Code in " + sField + " is not a number. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	if (isNaN(parseInt(document.forms[0].elements[nFieldID].value.substr(nLastDot)))==false)
	{
		if (parseInt(document.forms[0].elements[nFieldID].value.substr(nLastDot)) > 0)
			sTmp =  sTmp + parseInt(document.forms[0].elements[nFieldID].value.substr(nLastDot));
		else
		{
			alert("The Number in " + sField + " is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Number in " + sField + " is not a number. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	document.forms[0].elements[nFieldID].value = sTmp;
	if (document.forms[0].elements[nFieldID].value.length < 12)
		alert("The " + sField + " that you have entered is too short. Please ensure that you have added \nthe Country and City Codes along with your " + sField + ". All three must be separated by dots.\nFor example: 91.512.2503565");
	else
		returnValue = true;
	return returnValue;
}

function OK_Email()
{
	var returnValue=false;
	if (document.forms[0].elements.Email.value.length < 9)
	{
		alert("The E-Mail that you have entered is too short. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	var nSymbol1, nSymbol2;
	nSymbol1=document.forms[0].elements.Email.value.indexOf("@");
	if (nSymbol1 != -1) //Ampersand found
	{
		nSymbol2 = document.forms[0].elements.Email.value.indexOf(".", nSymbol1+1);
		if (nSymbol2 == -1) //Dot not found after the Ampersand
		{
			alert("The E-Mail that you have entered is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The E-Mail that you have entered is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	var sTmp, nLastPos;
	var nPart1, nPart2, nPart3;
	nLastPos = nSymbol1 + 1;
	if (document.forms[0].elements.Email.value.substr(0,nSymbol1).length >= 2)
		sTmp =  document.forms[0].elements.Email.value.substr(0,nSymbol1) + "@";
	else
	{
		alert("The ID in your E-Mail is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	if (isNaN(parseInt(document.forms[0].elements.Email.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1)))==true)
	{
		nLastPos = nSymbol2+1;
		if (document.forms[0].elements.Email.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1).length >= 2)
			sTmp =  sTmp + document.forms[0].elements.Email.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1) + ".";
		else
		{
			alert("The Domain Name in the E-mail is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Domain Name in the E-mail is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	if (isNaN(parseInt(document.forms[0].elements.Email.value.substr(nLastPos)))==true)
	{
		if (document.forms[0].elements.Email.value.substr(nLastPos).length >= 2)
			sTmp =  sTmp + document.forms[0].elements.Email.value.substr(nLastPos);
		else
		{
			alert("The Domain Extension in the E-mail is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Domain Extension in the E-mail is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	document.forms[0].elements.Email.value = sTmp;
	if (document.forms[0].elements.Email.value.length < 9)
		alert("The E-Mail that you have entered is too short. Please ensure that you have typed it correctly.");
	else
		returnValue = true;
	return returnValue;
}

function OK_Web()
{
	var returnValue=false;
	if (document.forms[0].elements.Website.value.length < 10)
	{
		alert("The Web-site that you have entered is too short. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	var nSymbol1, nSymbol2;
	nSymbol1=document.forms[0].elements.Website.value.indexOf(".");
	if (nSymbol1 != -1) //1st dot found
	{
		nSymbol2 = document.forms[0].elements.Website.value.indexOf(".", nSymbol1+1);
		if (nSymbol2 == -1) //2nd Dot not found
		{
			alert("The Web-site that you have entered is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Web-site that you have entered is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	var sTmp, nLastPos;
	var nPart1, nPart2, nPart3;
	nLastPos = nSymbol1 + 1;
	if (isNaN(parseInt(document.forms[0].elements.Website.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1)))==true)
	{
		if (document.forms[0].elements.Website.value.substr(0,nSymbol1).length >= 3)
			sTmp =  document.forms[0].elements.Website.value.substr(0,nSymbol1) + ".";
		else
		{
			alert("The Web-site that you have entered is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Web-site that you have entered is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	if (isNaN(parseInt(document.forms[0].elements.Website.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1)))==true)
	{
		nLastPos = nSymbol2+1;
		if (document.forms[0].elements.Website.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1).length >= 2)
			sTmp =  sTmp + document.forms[0].elements.Website.value.substr(nSymbol1+1, nSymbol2-nSymbol1-1) + ".";
		else
		{
			alert("The Domain Name in Web-site is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Domain Name in Web-site is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	if (isNaN(parseInt(document.forms[0].elements.Website.value.substr(nLastPos)))==true)
	{
		if (document.forms[0].elements.Website.value.substr(nLastPos).length >= 2)
			sTmp =  sTmp + document.forms[0].elements.Website.value.substr(nLastPos);
		else
		{
			alert("The Domain Extension in Web-site is invalid. Please ensure that you have typed it correctly.");
			return returnValue;
		}
	}
	else
	{
		alert("The Domain Extension in Web-site is invalid. Please ensure that you have typed it correctly.");
		return returnValue;
	}
	document.forms[0].elements.Website.value = sTmp;
	if (document.forms[0].elements.Website.value.length < 10)
		alert("The Web-site that you have entered is too short. Please ensure that you have typed it correctly.");
	else
		returnValue = true;
	return returnValue;
}

function ValidateAll()
{
	if (document.forms[0].elements.Company.value=="")
	{
		alert("Please enter your Organisation's Name");
		document.forms[0].elements.Company.focus();
		return false;
	}
	if (document.forms[0].elements.Person.value=="")
	{
		alert("Please enter the name of the Contact Person");
		document.forms[0].elements.Person.focus();
		return false;
	}
	if (document.forms[0].elements.Country.value=="")
	{
		alert("Please enter the name of your Country");
		document.forms[0].elements.Country.focus();
		return false;
	}
	if (document.forms[0].elements.Phone1.value=="")
	{
		alert("Please enter your Phone No.");
		document.forms[0].elements.Phone1.focus();
		return false;
	}
	if (document.forms[0].elements.Email.value=="")
	{
		alert("Please enter your Email ID");
		document.forms[0].elements.Email.focus();
		return false;
	}
	if (document.forms[0].elements.Enquiry.value=="")
	{
		alert("Please enter your Enquiry text");
		document.forms[0].elements.Enquiry.focus();
		return false;
	}
	if (OK_PhoneFax(3)==false)								// Phone 1
	{
		document.forms[0].elements.Phone1.focus();
		return false;
	}
	if (document.forms[0].elements.Phone2.value!="") 		// Phone 2
		if (OK_PhoneFax(4)==false)
		{
			document.forms[0].elements.Phone2.focus();
			return false;
		}
	if (document.forms[0].elements.Fax.value!="")			// Fax
		if (OK_PhoneFax(5)==false)
		{
			document.forms[0].elements.Fax.focus();
			return false;
		}
	if (document.forms[0].elements.Email.value!="")		// Email
		if (OK_Email()==false)
		{
			document.forms[0].elements.Email.focus();
			return false;
		}
	if (document.forms[0].elements.Website.value!="") 		// Website
		if (OK_Web()==false)
		{
			document.forms[0].elements.Website.focus();
			return false;
		}
	return true;
}
//-->
