<!--
document.write('<table cellpadding="0" cellspacing="0" style="width:100%;border:solid #000000 1px;background-color:#FFFFFF"><tr><td style="padding:10px">');
document.write('<form name="frmMortgage" method="POST" action="mortgage-app.php">');
document.write('<table border="0" style="width:100%;background-color:#FFFFFF">');
document.write('<tr><td colspan="3"><h3>Free Mortgage Loan Enquiry for Homeowners and Tenants</h3></td></tr>');
document.write('<tr><td class="tdAFLeft"></td><td style="width:8px" rowspan="16"></td><td class="tdAFRight"></td></tr>');
document.write('<tr><td class="lAF">*Housing Situation</td><td class="lAFright">');
document.write('<select class="inAF" name="hort"><option value="" selected="selected">Please Select Answer</option><option value="1">Council Tenant</option>');
document.write('<option value="2">MOD Tenant</option><option value="3">With Parents</option><option value="4">Housing Executive tenant</option>');
document.write('<option value="5">Private Landlord tenant</option><option value="6">Agency Rental Tenant</option><option value="7">Living with Friend</option>');
document.write('<option value="8">Housing Association</option><option value="0">Homeowner</option></select></td></tr>');
document.write('<tr><td class="lAF">*UK Resident</td><td class="lAFright"><select class="inAF" name="ukres"><option value="" selected="selected">Yes/No</option>');
document.write('<option value="Yes">Yes</option><option value="No">No</option></select></td></tr>');
document.write('<tr><td class="lAF">*First Name</td><td class="lAFright"><input class="inAF" type="text" name="firstname" maxlength="40"/></td></tr>');
document.write('<tr><td class="lAF">*Surname</td><td class="lAFright"><input class="inAF" type="text" name="surname" maxlength="40"/></td></tr>');
document.write('<tr><td class="lAF">*Date of Birth</td><td class="lAFright"><select name="dobdd" class="inAF">');
document.write('<option selected="selected">day</option><option>01</option><option>02</option><option>03</option><option>04</option><option>05</option>');
document.write('<option>06</option><option>07</option><option>08</option><option>09</option><option>10</option><option>11</option><option>12</option>');
document.write('<option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option>');
document.write('<option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option><option>26</option>');
document.write('<option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select>');
document.write('<select name="dobmm" class="inAF"><option value="" selected="selected">month</option><option value="01">Jan</option><option value="02">Feb</option>');
document.write('<option value="03">Mar</option><option value="04">Apr</option><option value="05">May</option><option value="06">Jun</option><option value="07">Jul</option>');
document.write('<option value="08">Aug</option><option value="09">Sep</option><option value="10">Oct</option><option value="11">Nov</option><option value="12">Dec</option>');
document.write('</select><input class="inAF" type="text" name="dobyy"  maxlength="4" value="yyyy" size="4" onfocus="this.value=\'\'"/></td></tr>');
document.write('<tr><td class="lAF">*Loan amount</td><td class="lAFright"><input class="inAF" type="text" name="loanamount" maxlength="9" size="9"/>&pound;</td></tr>');
document.write('<tr><td class="lAF">*Loan Type</td><td class="lAFright"><select class="inAF" name="loantype"><option value="" selected="selected">Please Select</option><option value="mortgage">Mortgage</option><option value="remortgage">Remortgage</option><option value="councilrighttobuy">Council Right to Buy</option></select><input type="hidden" name="cust_loantypeDesc"/><input type="hidden" name="cust_timetocallDesc"/></td></tr>');
document.write('<tr><td class="lAF">Work Phone</td><td class="lAFright"><input class="inAF" type="text" name="worktel" maxlength="30"/> * One </td></tr>');
document.write('<tr><td class="lAF">Home Phone</td><td colspan="2" class="lAFright"><input class="inAF" type="text" name="hometel" maxlength="30"/> * Tel</td></tr>');
document.write('<tr><td class="lAF">Mobile</td><td class="lAFright"><input class="inAF" type="text" name="mobile" maxlength="30"/> * Req.</td></tr>');
document.write('<tr><td class="lAF">Best Time to Call</td><td class="lAFright"><select class="inAF" name="timetocall"><option value="1" selected="selected">Please select</option>');
document.write('<option value="1">Any</option><option value="2">Morning</option><option value="3">Afternoon</option><option value="4">Evening</option></select></td></tr>');
document.write('<tr><td class="lAF">1st Line of Address</td><td class="lAFright"><input class="inAF" type="text" name="addr_line1" maxlength="40"/></td></tr>');
document.write('<tr><td class="lAF">PostCode</td><td class="lAFright"><input class="inAF" type="text" name="postcode"  maxlength="12"/></td></tr>');
document.write('<tr><td class="lAF">E-mail</td><td class="lAFright"><input class="inAF" type="text" name="email" maxlength="50"/></td></tr>');
document.write('<tr><td class="lAF">I have read &amp; I accept the <a href="#" onclick="window.open(\'http://www.help-finance.co.uk/common/mortgage/terms-mortgage.html\',\'_blank\',\'width=540,top=0,left=0,resizable,scrollbars,height=210\'); return false;"><b><u>Terms/DPA ');
document.write('Statement</u></b></a></td><td class="lAFright"><select class="inAF" name="ReadDPA"><option value="Y" selected="selected">Yes</option><option value="N">No</option></select></td></tr>');
document.write('<tr style="height:10px"><td colspan="4"></td></tr>');
document.write('<tr><td colspan="4" style="text-align:center"><input type="button" class="inButton" value="Submit Loan Enquiry" name="Submit" onClick=" return validate();"/>');
document.write('</td></tr> ');
document.write('<tr><td colspan="3" id="tdFooter"><scri'+'pt src="http://www.help-finance.co.uk/common/drop-footer-common.js"></sc'+'ript></td></tr>');
document.write('</table></form></td></tr></table>');

function validate() {
	with (document.frmMortgage)
	{
		if (hort.selectedIndex == 0) {
			alert("Please select Housing Situation.");
			hort.focus();
			return false;
		}

		if (ukres.selectedIndex == 0) {
			alert("Please select UK resident Y/N.");
			ukres.focus();
			return false;
		}
		if (ukres.selectedIndex == 2) {
			alert("Applications not accepted from Non UK Residents");
			ukres.focus();
			return false;
		}
		if (firstname.value == "") {
			alert("Please enter your First Name.");
			firstname.focus();
			return false;
		}
		if (surname.value == "") {
			alert("Please enter your Surname.");
			surname.focus();
			return false;
		}
		if (dobdd.selectedIndex == 0) {
			alert("Please select DOB day.");
			dobdd.focus();
			return false;
		}
		if (dobmm.selectedIndex == 0) {
			alert("Please select DOB month.");
			dobmm.focus();
			return false;
		}
		if (dobyy.value == "yyyy" || dobyy.value == "") {
			alert("Please select DOB year.");
			dobyy.focus();
			return false;
		}

		if (hometel.value=="" && worktel.value=="" && mobile.value=="") {
			alert("Please enter a Telephone Number.");
			worktel.focus();
			return false;
		}

		if (loanamount.value == "") {
			alert("Please enter Loan Amount.");
			loanamount.focus();
			return false;
		}
		if (loantype.value == "") {
			alert("Please enter Loan Type.");
			loantype.focus();
			return false;
		}
		if (hort.value=="0") {
			//check that 1st line of address and postcode entered	
			if (addr_line1.value=="") {
			 	alert("Please enter the first line of your address");
				addr_line1.focus();
				return false;
			}
			if (postcode.value=="") {
			 	alert("Please enter your postcode");
				postcode.focus();
				return false;
			}
		}
				   
		if (email.value != "" && (email.value.indexOf("@") == "-1" || email.value.indexOf(".") == "-1")){

			alert("Please re-enter your email address - '@' or '.' missing.");
			email.focus();
			return false; 
		}
		if (ReadDPA.value=="N") {
			alert("Please read our terms and data protection statement and select 'Yes' if you agree to them.");
			ReadDPA.focus();
			return false;
		}
		cust_timetocallDesc.value=timetocall.options[timetocall.selectedIndex].text;
		cust_loantypeDesc.value=loantype.options[loantype.selectedIndex].text;

		document.frmMortgage.submit();
	}
}

//-->