//Functions for INA website

function showLogo() {
	document.write('<img src="images/logo.gif" alt="INA logo">')
}

function showTitle() {
	document.write('<img src="images/title.jpg" alt="Indian Nurserymen Association" align="right">')
}

function showTopBand() {
	document.write('<table summary="" class="boxTopImg" cellspacing="0" cellpadding="0">');
	document.write('	<tr>');
	document.write('		<td align="center">');
	document.write('			<img src="images/title.jpg" alt="Indian Nurserymen Association" align="left">')
	document.write('		</td>');
	document.write('	</tr>');
	document.write('</table>');
}

function showAddress() {
	document.write('<table class="boxAddress">');
	document.write('	<tr>');
	document.write('		<td class="bTitle">Indian Nurserymen Association</td>');
	document.write('		<td class="bAddress">Post Box No. 11, Kaithal, Haryana, India 136 027');
	document.write('			<br> Phone: (91) 1746 232484, Email: info@inaindia.com</td>');
	document.write('	</tr>');
	document.write('</table>');
}

function showNavBar() {
//	document.write('<form method="POST">');
//	document.write('<p class="navBtn"><input type="text" name="T1" size="16">');
//	document.write('<input class="searchBtn" type="submit" value="Search the site" name="B1"></p>');
//	document.write('</form>');
	document.write('<a href="default.htm"><div class="navBtn">Home</div></a>');
	document.write('<a href="aboutus.htm"><div class="navBtn">About Us</div></a>');
//	document.write('<a href="coming.htm"><div class="navBtn">Membership Benefits</div></a>');
//	document.write('<a href="nurserylist.htm"><div class="navBtn">Member Nurseries</div></a>');
	document.write('<a href="selectcountry.php"><div class="navBtn">Nurseries (Countrywise)</div></a>');
	document.write('<a href="alpha_nurseries.php"><div class="navBtn">Nurseries (Alphabetical)</div></a>');
	document.write('<a href="register_nursery.htm"><div class="navBtn">Register nursery</div></a>');
//	document.write('<a href="dbdown.htm"><div class="navBtn">Nurseries (Countrywise)</div></a>');
//	document.write('<a href="dbdown.htm"><div class="navBtn">Nurseries (Alphabetical)</div></a>');
//	document.write('<a href="dbdown.htm"><div class="navBtn">Register nursery</div></a>');
	document.write('<a href="govbody.htm"><div class="navBtn">Governing Body</div></a>');
	document.write('<a href="http://www.inaindia.com/inaforum"><div class="navBtn">Forums</div></a>');
//	document.write('<a href="forumdown.htm"><div class="navBtn">Forums</div></a>');
//	document.write('<a href="coming.htm"><div class="navBtn">Publications and Articles</div></a>');
//	document.write('<a href="coming.htm"><div class="navBtn">INA - Local Chapters</div></a>');
//	document.write('<a href="coming.htm"><div class="navBtn">Links</div></a>');
}

function showCountryList(nAddr) {
	document.write('<select size="1" name="AdCntry'+nAddr+'" class="inp">');
	document.write('	<option>Afghanistan'); 
	document.write('	<option>Albania');
	document.write('	<option>Algeria');
	document.write('	<option>American Samoa');
	document.write('	<option>Andorra');
	document.write('	<option>Angola');
	document.write('	<option>Anguilla');
	document.write('	<option>Antarctica');
	document.write('	<option>Antigua and Barbuda');
	document.write('	<option>Argentina');
	document.write('	<option>Armenia');
	document.write('	<option>Aruba');
	document.write('	<option>Australia');
	document.write('	<option>Austria');
	document.write('	<option>Azerbaijan');
	document.write('	<option>Bahamas');
	document.write('	<option>Bahrain');
	document.write('	<option>Bangladesh');
	document.write('	<option>Barbados');
	document.write('	<option>Belarus');
	document.write('	<option>Belgium');
	document.write('	<option>Belize');
	document.write('	<option>Benin');
	document.write('	<option>Bermuda');
	document.write('	<option>Bhutan');
	document.write('	<option>Bolivia');
	document.write('	<option>Bosnia and Herzegowina');
	document.write('	<option>Botswana');
	document.write('	<option>Bouvet Island');
	document.write('	<option>Brazil');
	document.write('	<option>British Indian Ocean Territory');
	document.write('	<option>Brunei Darussalam');
	document.write('	<option>Bulgaria');
	document.write('	<option>Burkina Faso');
	document.write('	<option>Burundi');
	document.write('	<option>Cambodia');
	document.write('	<option>Cameroon');
	document.write('	<option>Canada');
	document.write('	<option>Cape Verde');
	document.write('	<option>Cayman Islands');
	document.write('	<option>Central African Republic');
	document.write('	<option>Chad');
	document.write('	<option>Chile');
	document.write('	<option>China');
	document.write('	<option>Christmas Island');
	document.write('	<option>Cocos (Keeling) Islands');
	document.write('	<option>Colombia');
	document.write('	<option>Comoros');
	document.write('	<option>Congo');
	document.write('	<option>Congo, the Democratic Republic of the');
	document.write('	<option>Cook Islands');
	document.write('	<option>Costa Rica');
	document.write('	<option>Cote d\'Ivoire'); 
	document.write('	<option>Croatia (Hrvatska)');
	document.write('	<option>Cuba');
	document.write('	<option>Cyprus');
	document.write('	<option>Czech Republic');
	document.write('	<option>Denmark');
	document.write('	<option>Djibouti');
	document.write('	<option>Dominica');
	document.write('	<option>Dominican Republic');
	document.write('	<option>East Timor');
	document.write('	<option>Ecuador');
	document.write('	<option>Egypt');
	document.write('	<option>El Salvador');
	document.write('	<option>Equatorial Guinea');
	document.write('	<option>Eritrea');
	document.write('	<option>Estonia');
	document.write('	<option>Ethiopia');
	document.write('	<option>Falkland Islands (Malvinas)');
	document.write('	<option>Faroe Islands');
	document.write('	<option>Fiji');
	document.write('	<option>Finland');
	document.write('	<option>France');
	document.write('	<option>France, Metropolitan');
	document.write('	<option>French Guiana');
	document.write('	<option>French Polynesia');
	document.write('	<option>French Southern Territories');
	document.write('	<option>Gabon');
	document.write('	<option>Gambia');
	document.write('	<option>Georgia');
	document.write('	<option>Germany');
	document.write('	<option>Ghana');
	document.write('	<option>Gibraltar');
	document.write('	<option>Greece');
	document.write('	<option>Greenland');
	document.write('	<option>Grenada');
	document.write('	<option>Guadeloupe');
	document.write('	<option>Guam');
	document.write('	<option>Guatemala');
	document.write('	<option>Guinea');
	document.write('	<option>Guinea-Bissau');
	document.write('	<option>Guyana');
	document.write('	<option>Haiti');
	document.write('	<option>Heard and Mc Donald Islands');
	document.write('	<option>Holy See (Vatican City State)');
	document.write('	<option>Honduras');
	document.write('	<option>Hong Kong');
	document.write('	<option>Hungary');
	document.write('	<option>Iceland');
	document.write('	<option selected>India');
	document.write('	<option>Indonesia');
	document.write('	<option>Iran (Islamic Republic of)');
	document.write('	<option>Iraq');
	document.write('	<option>Ireland');
	document.write('	<option>Israel');
	document.write('	<option>Italy');
	document.write('	<option>Jamaica');
	document.write('	<option>Japan');
	document.write('	<option>Jordan');
	document.write('	<option>Kazakhstan');
	document.write('	<option>Kenya');
	document.write('	<option>Kiribati');
	document.write('	<option>Korea, Democratic People\'s Republic of');
	document.write('	<option>Korea, Republic of');
	document.write('	<option>Kuwait');
	document.write('	<option>Kyrgyzstan');
	document.write('	<option>Lao People\'s Democratic Republic');
	document.write('	<option>Latvia');
	document.write('	<option>Lebanon');
	document.write('	<option>Lesotho');
	document.write('	<option>Liberia');
	document.write('	<option>Libyan Arab Jamahiriya');
	document.write('	<option>Liechtenstein');
	document.write('	<option>Lithuania');
	document.write('	<option>Luxembourg');
	document.write('	<option>Macau');
	document.write('	<option>Macedonia, The Former Yugoslav Republic of');
	document.write('	<option>Madagascar');
	document.write('	<option>Malawi');
	document.write('	<option>Malaysia');
	document.write('	<option>Maldives');
	document.write('	<option>Mali');
	document.write('	<option>Malta');
	document.write('	<option>Marshall Islands');
	document.write('	<option>Martinique');
	document.write('	<option>Mauritania');
	document.write('	<option>Mauritius');
	document.write('	<option>Mayotte');
	document.write('	<option>Mexico');
	document.write('	<option>Micronesia, Federated States of');
	document.write('	<option>Moldova, Republic of');
	document.write('	<option>Monaco');
	document.write('	<option>Mongolia');
	document.write('	<option>Montserrat');
	document.write('	<option>Morocco');
	document.write('	<option>Mozambique');
	document.write('	<option>Myanmar');
	document.write('	<option>Namibia');
	document.write('	<option>Nauru');
	document.write('	<option>Nepal');
	document.write('	<option>Netherlands');
	document.write('	<option>Netherlands Antilles');
	document.write('	<option>New Caledonia');
	document.write('	<option>New Zealand');
	document.write('	<option>Nicaragua');
	document.write('	<option>Niger');
	document.write('	<option>Nigeria');
	document.write('	<option>Niue');
	document.write('	<option>Norfolk Island');
	document.write('	<option>Northern Mariana Islands');
	document.write('	<option>Norway');
	document.write('	<option>Oman');
	document.write('	<option>Pakistan');
	document.write('	<option>Palau');
	document.write('	<option>Panama');
	document.write('	<option>Papua New Guinea');
	document.write('	<option>Paraguay');
	document.write('	<option>Peru');
	document.write('	<option>Philippines');
	document.write('	<option>Pitcairn');
	document.write('	<option>Poland');
	document.write('	<option>Portugal');
	document.write('	<option>Puerto Rico');
	document.write('	<option>Qatar');
	document.write('	<option>Reunion');
	document.write('	<option>Romania');
	document.write('	<option>Russian Federation');
	document.write('	<option>Rwanda');
	document.write('	<option>Saint Kitts and Nevis');
	document.write('	<option>Saint LUCIA');
	document.write('	<option>Saint Vincent and the Grenadines');
	document.write('	<option>Samoa');
	document.write('	<option>San Marino');
	document.write('	<option>Sao Tome and Principe');
	document.write('	<option>Saudi Arabia');
	document.write('	<option>Senegal');
	document.write('	<option>Seychelles');
	document.write('	<option>Sierra Leone');
	document.write('	<option>Singapore');
	document.write('	<option>Slovakia (Slovak Republic)');
	document.write('	<option>Slovenia');
	document.write('	<option>Solomon Islands');
	document.write('	<option>Somalia');
	document.write('	<option>South Africa');
	document.write('	<option>South Georgia and the South Sandwich Islands');
	document.write('	<option>Spain');
	document.write('	<option>Sri Lanka');
	document.write('	<option>St. Helena');
	document.write('	<option>St. Pierre and Miquelon');
	document.write('	<option>Sudan');
	document.write('	<option>Suriname');
	document.write('	<option>Svalbard and Jan Mayen Islands');
	document.write('	<option>Swaziland');
	document.write('	<option>Sweden');
	document.write('	<option>Switzerland');
	document.write('	<option>Syrian Arab Republic');
	document.write('	<option>Taiwan, Province of China');
	document.write('	<option>Tajikistan');
	document.write('	<option>Tanzania, United Republic of');
	document.write('	<option>Thailand');
	document.write('	<option>Togo');
	document.write('	<option>Tokelau'); 
	document.write('	<option>Tonga');
	document.write('	<option>Trinidad and Tobago');
	document.write('	<option>Tunisia');
	document.write('	<option>Turkey');
	document.write('	<option>Turkmenistan');
	document.write('	<option>Turks and Caicos Islands');
	document.write('	<option>Tuvalu');
	document.write('	<option>Uganda');
	document.write('	<option>Ukraine');
	document.write('	<option>United Arab Emirates');
	document.write('	<option>United Kingdom');
	document.write('	<option>United States');
	document.write('	<option>United States Minor Outlying Islands');
	document.write('	<option>Uruguay');
	document.write('	<option>Uzbekistan');
	document.write('	<option>Vanuatu');
	document.write('	<option>Venezuela');
	document.write('	<option>Viet Nam');
	document.write('	<option>Virgin Islands (British)');
	document.write('	<option>Virgin Islands (U.S.)');
	document.write('	<option>Wallis and Futuna Islands');
	document.write('	<option>Western Sahara');
	document.write('	<option>Yemen');
	document.write('	<option>Yugoslavia');
	document.write('	<option>Zambia');
	document.write('	<option>Zimbabwe');
	document.write('</select>');
}

function showStateList(nAddr) {
	document.write('<select size="1" name="AdState'+nAddr+'" class="inp">');
	document.write('	<option>Andaman Nicobar</option>');
	document.write('	<option>Andhra Pradesh</option>');
	document.write('	<option>Arunachal Pradesh</option>');
	document.write('	<option>Assam</option>');
	document.write('	<option>Bihar</option>');
	document.write('	<option>Chandigarh</option>');
	document.write('	<option>Chattisgarh</option>');
	document.write('	<option>Dadra & Nagar Haveli</option>');
	document.write('	<option>Daman & Diu</option>');
	document.write('	<option>Delhi</option>');
	document.write('	<option>Goa</option>');
	document.write('	<option>Gujarat</option>');
	document.write('	<option>Haryana</option>');
	document.write('	<option>Himachal Pradesh</option>');
	document.write('	<option>Jammu & Kashmir</option>');
	document.write('	<option>Jharkhand</option>');
	document.write('	<option>Karnataka</option>');
	document.write('	<option>Kerala</option>');
	document.write('	<option>Madhya Pradesh</option>');
	document.write('	<option selected>Maharashtra</option>');
	document.write('	<option>Manipur</option>');
	document.write('	<option>Meghalaya</option>');
	document.write('	<option>Mizoram</option>');
	document.write('	<option>Nagaland</option>');
	document.write('	<option>Orissa</option>');
	document.write('	<option>Punjab</option>');
	document.write('	<option>Rajasthan</option>');
	document.write('	<option>Sikkim</option>');
	document.write('	<option>Tamilnadu</option>');
	document.write('	<option>Tripura</option>');
	document.write('	<option>Uttar Pradesh</option>');
	document.write('	<option>Uttaranchal</option>');
	document.write('	<option>West Bengal</option>');
	document.write('</select>');
}

function showFormAddress(nAddr) {
	document.write('<table cellspacing="0" border="1" class="boxReg" style="background-color: #ccffff;">');
	document.write('	<caption class="pHead2">Address ' + nAddr + '</caption>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Address Type:</td>');
	document.write('		<td width="66%"><select size="1" name="AdTyp'+nAddr+'" class="inp">');
	document.write('		<option selected>Nursery</option>');
	document.write('		<option>Office</option>');
	document.write('		<option>Farm</option>');
	document.write('		</select></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		Address/Survey No./<br>House No.:</td>');
	document.write('		<td width="66%"><input type="text" name="AdHou'+nAddr+'" size="61" id="fp6" class="inp" maxlength="50"></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		At post/Street:</td>');
	document.write('		<td width="66%"> <input type="text" name="AdSt'+nAddr+'" size="61" id="fp7" class="inp" maxlength="50"></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		Taluka/Area:</td>');
	document.write('		<td width="66%"><input type="text" name="AdArea'+nAddr+'" size="61" id="fp8" class="inp" maxlength="50"></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		District/City:</td>');
	document.write('		<td width="66%"><input type="text" name="AdCity'+nAddr+'" size="61" id="fp9" class="inp" maxlength="50"></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Pin:</td>');
	document.write('		<td width="66%"><input type="text" name="AdPin'+nAddr+'" size="61" id="fp10" class="inp" maxlength="10"></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		State:</td>');
	document.write('		<td width="66%">');
	showStateList(nAddr)
	document.write(' OR <input type="text" name="AdStateB'+nAddr+'" size="29" title="Enter State for a country other than India" id="stateB" class="inp" maxlength="100">');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		Country:</td>');
	document.write('		<td width="66%">');
	showCountryList(nAddr)
	document.write(' 		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">');
	if (nAddr == 1) {
		document.write('*'); }
	document.write('		Phone 1:</td>');
	document.write('		<td width="66%">');
	document.write('			<input type="text" name="AdPh1Cn'+nAddr+'" size="7" value="+91" id="fp19" class="inp" maxlength="10">');
	document.write('			<input type="text" name="AdPh1Ar'+nAddr+'" size="7" value="STD code" id="fp20" class="inp" onfocus="blankIt(document.frmnurs.AdPh1Ar'+nAddr+')" maxlength="10">');
	document.write('			<input type="text" name="AdPh1No'+nAddr+'" size="37" id="fp13" class="inp" maxlength="20">');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Phone 2:</td>');
	document.write('		<td width="66%">');
	document.write('			<input type="text" name="AdPh2Cn'+nAddr+'" size="7" value="+91" id="fp21" class="inp" maxlength="10">');
	document.write('			<input type="text" name="AdPh2Ar'+nAddr+'" size="7" value="STD code" id="fp22" class="inp" onfocus="blankIt(document.frmnurs.AdPh2Ar'+nAddr+')" maxlength="10">');
	document.write('			<input type="text" name="AdPh2No'+nAddr+'" size="37" id="fp23" class="inp" maxlength="20">');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Phone 3:</td>');
	document.write('		<td width="66%">');
	document.write('			<input type="text" name="AdPh3Cn'+nAddr+'" size="7" value="+91" id="fp24" class="inp" maxlength="10">');
	document.write('			<input type="text" name="AdPh3Ar'+nAddr+'" size="7" value="STD code" id="fp25" class="inp" onfocus="blankIt(document.frmnurs.AdPh3Ar'+nAddr+')" maxlength="10">');
	document.write('			<input type="text" name="AdPh3No'+nAddr+'" size="37" id="fp26" class="inp" maxlength="20">');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Fax:</td>');
	document.write('		<td width="66%">');
	document.write('			<input type="text" name="AdPh4Cn'+nAddr+'" size="7" value="+91" id="fp27" class="inp" maxlength="10">');
	document.write('			<input type="text" name="AdPh4Ar'+nAddr+'" size="7" value="STD code" id="fp28" class="inp" onfocus="blankIt(document.frmnurs.AdPh4Ar'+nAddr+')" maxlength="10">');
	document.write('			<input type="text" name="AdPh4No'+nAddr+'" size="37" id="fp29" class="inp" maxlength="20">');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td class="tdLabel">Email Address:</td>');
	document.write('		<td width="66%"><input type="text" name="AdEmail'+nAddr+'" size="61" id="fp17" class="inp" maxlength="50"></td>');
	document.write('	</tr>');
	document.write('</table>');
}

function blankIt(areaCode) {
	if (areaCode.value == "STD code") {
		areaCode.value = ""
	}
}

function validate(passForm) {
//Mandatory fields
	//check for blank nursery name
	if (passForm.NuName.value == "") {
		alert("Please enter nursery name!")
		passForm.NuName.focus()
		return false
	}
	//Org.Type: check if 'other' option is checked. if yes, make sure the text box is filled
	if (!validOther(passForm.NuOrg[7], passForm.NuOrgOth, "organization type")) {
		return false
	}
	//Nursrey type: If 'other' option is checked, make sure the text box is filled
	if (!validOther(passForm.NuType[4], passForm.NuTypeOth, "nursrey type")) {
		return false
	}
	//Fruit tree nursrey: If 'other' option is checked, make sure the text box is filled
	if (!validOther(passForm.NuFru[5], passForm.NuFruOth, "fruit tree")) {
		return false
	}
	//Type of operation: verify at least one is checked
	if (passForm.NuOpProd.checked == false && passForm.NuOpWhol.checked == false
	&& passForm.NuOpRet.checked == false) {
		alert("Please select type of operation!")
		passForm.NuOpProd.focus()
		return false
	}
	//Owner name: Mandatory
	if (passForm.NuOwnName.value == "") {
		alert("Please enter nursery owner's name!")
		passForm.NuOwnName.focus()
		return false
	}
	if (passForm.NuOwnSurname.value == "") {
		alert("Please enter nursery owner's surname!")
		passForm.NuOwnSurname.focus()
		return false
	}
	//Address 1: Mandatory
	if (passForm.AdHou1.value == "") {
		alert("Please enter address!")
		passForm.AdHou1.focus()
		return false
	}
	if (passForm.AdSt1.value == "") {
		alert("Please enter street!")
		passForm.AdSt1.focus()
		return false
	}
	if (passForm.AdArea1.value == "") {
		alert("Please enter area!")
		passForm.AdArea1.focus()
		return false
	}
	if (passForm.AdCity1.value == "") {
		alert("Please enter city!")
		passForm.AdCity1.focus()
		return false
	}
	//Phone 1: Mandatory
	if (passForm.AdPh1Cn1.value == "") {
		alert("Please enter country code!")
		passForm.AdPh1Cn1.focus()
		return false
	}
	if (passForm.AdPh1Ar1.value == "" || passForm.AdPh1Ar1.value == "STD code") {
		alert("Please enter area code!")
		passForm.AdPh1Ar1.focus()
		return false
	}
	if (passForm.AdPh1No1.value == "") {
		alert("Please enter phone number!")
		passForm.AdPh1No1.focus()
		return false
	}
//Email format
	if (passForm.NuOwnEmail.value != "" && !validEmail(passForm.NuOwnEmail.value)) {
		alert("Invalid email address")
		passForm.NuOwnEmail.focus()
		passForm.NuOwnEmail.select()
		return false
	}
	if (passForm.AdEmail1.value != "" && !validEmail(passForm.AdEmail1.value)) {
		alert("Invalid email address")
		passForm.AdEmail1.focus()
		passForm.AdEmail1.select()
		return false
	}
	if (passForm.AdEmail2.value != "" && !validEmail(passForm.AdEmail2.value)) {
		alert("Invalid email address")
		passForm.AdEmail2.focus()
		passForm.AdEmail2.select()
		return false
	}
	if (passForm.AdEmail3.value != "" && !validEmail(passForm.AdEmail3.value)) {
		alert("Invalid email address")
		passForm.AdEmail3.focus()
		passForm.AdEmail3.select()
		return false
	}
	//Phone format (Phone 1 for Address 1 is mandatory. So start from phone 2)
	//Address 1
	if (!validPhone(passForm.AdPh2Cn1.value, passForm.AdPh2Ar1.value, passForm.AdPh2No1.value)) {
		passForm.AdPh2No1.focus()
		return false
	}
	if (!validPhone(passForm.AdPh3Cn1.value, passForm.AdPh3Ar1.value, passForm.AdPh3No1.value)) {
		passForm.AdPh3No1.focus()
		return false
	}
	if (!validPhone(passForm.AdPh4Cn1.value, passForm.AdPh4Ar1.value, passForm.AdPh4No1.value)) {
		passForm.AdPh4No1.focus()
		return false
	}
	//Address 2
	if (!validPhone(passForm.AdPh1Cn2.value, passForm.AdPh1Ar2.value, passForm.AdPh1No2.value)) {
		passForm.AdPh1No2.focus()
		return false
	}
	if (!validPhone(passForm.AdPh2Cn2.value, passForm.AdPh2Ar2.value, passForm.AdPh2No2.value)) {
		passForm.AdPh2No2.focus()
		return false
	}
	if (!validPhone(passForm.AdPh3Cn2.value, passForm.AdPh3Ar2.value, passForm.AdPh3No2.value)) {
		passForm.AdPh3No2.focus()
		return false
	}
	if (!validPhone(passForm.AdPh4Cn2.value, passForm.AdPh4Ar2.value, passForm.AdPh4No2.value)) {
		passForm.AdPh4No2.focus()
		return false
	}
	//Address 3
	if (!validPhone(passForm.AdPh1Cn3.value, passForm.AdPh1Ar3.value, passForm.AdPh1No3.value)) {
		passForm.AdPh1No3.focus()
		return false
	}
	if (!validPhone(passForm.AdPh2Cn3.value, passForm.AdPh2Ar3.value, passForm.AdPh2No3.value)) {
		passForm.AdPh2No3.focus()
		return false
	}
	if (!validPhone(passForm.AdPh3Cn3.value, passForm.AdPh3Ar3.value, passForm.AdPh3No3.value)) {
		passForm.AdPh3No3.focus()
		return false
	}
	if (!validPhone(passForm.AdPh4Cn3.value, passForm.AdPh4Ar3.value, passForm.AdPh4No3.value)) {
		passForm.AdPh4No3.focus()
		return false
	}
	return true
}

function validPhone(cn, ar, no) {
	if ((no != "" && (cn == "" || ar == "" || ar == "STD code"))
	|| (no == "" && cn != "" && ar != "" && ar != "STD code") ) {
		alert("Enter complete phone: Country code, STD code and phone number!")
		return false
	}
	return true
}

function validOther(radioBtn, otherTxt, strField) {
	if (radioBtn.checked && otherTxt.value == "") {
		alert("Please enter the other " + strField + "!")
		otherTxt.focus()
		return false
	}
	return true
}

function validEmail(email) {
	invalidChars = " /:,;"

//this check is needed only if the field is mandatory
//	if (email == "") {
//		return false
//	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false
		}
	}
	atPos = email.indexOf("@", 1)
	if (atPos == -1) {
		return false
	}
	if (email.indexOf("@", atPos+1) > -1) {
		return false
	}
	periodPos = email.indexOf(".", atPos)
	if (periodPos == -1) {
		return false
	}
	if (periodPos+3 > email.length) {
		return false
	}
	return true
}
