// JavaScript Document




function findaddress(policytype)
{
//	alert(policytype)
    var rawaddress = document.all["postcode"].value;
    var product = document.all["product"].value;
	var correct = -1
	freddy = rawaddress.toLowerCase();
    fourcell = document.all["cellfour"];
	fourcell.innerText="";
	if (freddy.indexOf(" ",0) == -1 )
	{
	            fourcell.innerText = "Please enter full postcode with a space between the outer and inner half e.g. 'NE8 4DP'";
	            correct = 0;
	}
	if (correct == -1)
	{
		var outercode = freddy.substring(0, freddy.indexOf(" ",0))
		var innercode = freddy.substring(freddy.indexOf(" ",0)+1)
// outercode should be in the form 'ne8' and innercode of the form '4dp' - I only need the sector so convert '4dp' to '4'
        var test = innercode.substring(0,1)
//		alert("policytype will be : " + policytype)
//		alert("Outercode will be : " + outercode)
//		alert("Innercode will be : " + innercode)
//		alert("new location will be : " + "http://www.portwood.co.uk/mlibsearch.asp?policy=" + policytype + "&outercode=" + outercode +"&innercode=" + test)
        location.href ="http://www.portwood.co.uk/mlibsearch.asp?policy=" + product + "&outercode=" + outercode +"&innercode=" + test
	}
}

function findcounty()
{
var actcounty = document.all["County"].value;
var product = document.all["product"].value;
location.href = "http://www.portwood.co.uk/mlibschemes.asp?policy=" + product + "&county=" + actcounty
}