bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ((bName == "Netscape" && bVer>= 3) ||
(bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "n3";
else br = "n2";

if (br == "n3"){
img1off = new Image();
img1off.src = "images/nav/button1_off.gif";
img2off = new Image();
img2off.src = "images/nav/button2_off.gif";
img3off = new Image();
img3off.src = "images/nav/button3_off.gif";
img4off = new Image();
img4off.src = "images/nav/button4_off.gif";
img5off = new Image();
img5off.src = "images/nav/button5_off.gif";
img6off = new Image();
img6off.src = "images/nav/button6_off.gif";
img7off = new Image();
img7off.src = "images/nav/button7_off.gif";
img8off = new Image();
img8off.src = "images/nav/button8_off.gif";
img9off = new Image();
img9off.src = "images/nav/button9_off.gif";
img10off = new Image();
img10off.src = "images/nav/button10_off.gif";
img11off = new Image();
img11off.src = "images/nav/button11_off.gif";

img1on = new Image();
img1on.src = "images/nav/button1_on.gif";
img2on = new Image();
img2on.src = "images/nav/button2_on.gif";
img3on = new Image();
img3on.src = "images/nav/button3_on.gif";
img4on = new Image();
img4on.src = "images/nav/button4_on.gif";
img5on = new Image();
img5on.src = "images/nav/button5_on.gif";
img6on = new Image();
img6on.src = "images/nav/button6_on.gif";
img7on = new Image();
img7on.src = "images/nav/button7_on.gif";
img8on = new Image();
img8on.src = "images/nav/button8_on.gif";
img9on = new Image();
img9on.src = "images/nav/button9_on.gif";
img10on = new Image();
img10on.src = "images/nav/button10_on.gif";
img11on = new Image();
img11on.src = "images/nav/button11_on.gif";


img1needle = new Image();
img1needle.src = "images/nav/needle_1.gif";
img2needle = new Image();
img2needle.src = "images/nav/needle_2.gif";
img3needle = new Image();
img3needle.src = "images/nav/needle_3.gif";
img4needle = new Image();
img4needle.src = "images/nav/needle_4.gif";
img5needle = new Image();
img5needle.src = "images/nav/needle_5.gif";
img6needle = new Image();
img6needle.src = "images/nav/needle_6.gif";
img7needle = new Image();
img7needle.src = "images/nav/needle_7.gif";
img8needle = new Image();
img8needle.src = "images/nav/needle_8.gif";
img9needle = new Image();
img9needle.src = "images/nav/needle_9.gif";
img10needle = new Image();
img10needle.src = "images/nav/needle_10.gif";
img11needle = new Image();
img11needle.src = "images/nav/needle_11.gif";

img1needleoff = new Image();
img1needleoff.src = "images/nav/needle_1.gif";
img2needleoff = new Image();
img2needleoff.src = "images/nav/needle_2.gif";
img3needleoff = new Image();
img3needleoff.src = "images/nav/needle_3.gif";
img4needleoff = new Image();
img4needleoff.src = "images/nav/needle_4.gif";
img5needleoff = new Image();
img5needleoff.src = "images/nav/needle_5.gif";
img6needleoff = new Image();
img6needleoff.src = "images/nav/needle_6.gif";
img7needleoff = new Image();
img7needleoff.src = "images/nav/needle_7.gif";
img8needleoff = new Image();
img8needleoff.src = "images/nav/needle_8.gif";
img9needleoff = new Image();
img9needleoff.src = "images/nav/needle_9.gif";
img10needleoff = new Image();
img10needleoff.src = "images/nav/needle_10.gif";
img11needleoff = new Image();
img11needleoff.src = "images/nav/needle_11.gif";

}

function imgAct(imgName){
if (br == "n3"){
document[imgName].src = eval(imgName + "on.src");
document.needle.src = eval(imgName + "needle.src");
}
}
function imgInact(imgName){
if (br == "n3"){
document[imgName].src = eval(imgName + "off.src");
document.needle.src = eval(imgName + "needleoff.src");
}
}

/**
 * DHTML date validation script for dd/mm/yyyy. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var currdate = new Date();
var maxYear=currdate.getFullYear();

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("Please enter a valid date in the format dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month.  The date should be in the format dd/mm/yyyy")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day.  The date should be in the format dd/mm/yyyy")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear+".  The date should be in the format dd/mm/yyyy")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date in the format dd/mm/yyyy")
		return false
	}
return true
}


function isProposerOverTwentyFive(dtStr){
	// get the difference in years
	var todayDate = new Date();

	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	//Convert to integers.  Month is Minus 1 because getMonth() returns 0 - 11
	currmonth=parseInt(strMonth) - 1
	currday=parseInt(strDay)
	curryear=parseInt(strYr)

	var years = todayDate.getFullYear() - curryear;

	// subtract another year if we're before the birth day in the current year
	if (todayDate.getMonth() < currmonth || 
	   (todayDate.getMonth() == currmonth && todayDate.getDate() < currday)){
		years--;
	}

	if (years < 25){
		alert("The proposer is under 25 years of age.  Please call us on 08454 505145 to speak to an advisor")
		return false
	}

    return true
 }


function emailCheck (tempobj) {

	emailStr = tempobj.value
	/* The following variable tells the rest of the function whether or not
	to verify that the address ends in a two-letter country or well-known
	TLD.  1 means check it, 0 means don't. */
	
	var checkTLD=1;
	
	/* The following is the list of known TLDs that an e-mail address must end with. */
	
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	
	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */
	
	var emailPat=/^(.+)@(.+)$/;
	
	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address. 
	These characters include ( ) < > @ , ; : \ " . [ ] */
	
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	
	/* The following string represents the range of characters allowed in a 
	username or domainname.  It really states which chars aren't allowed.*/
	
	var validChars="\[^\\s" + specialChars + "\]";
	
	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */
	
	var quotedUser="(\"[^\"]*\")";
	
	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */
	
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	
	/* The following string represents an atom (basically a series of non-special characters.) */
	
	var atom=validChars + '+';
	
	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */

	var word="(" + atom + "|" + quotedUser + ")";

	// The following pattern describes the structure of the user

	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

	/* Finally, let's start trying to figure out if the supplied address is valid. */

	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */

	var matchArray=emailStr.match(emailPat);

	if (matchArray==null) {

		/* Too many/few @'s or something; basically, this address doesn't
		even fit the general mould of a valid e-mail address. */

		alert("Email address seems incorrect (check @ and .'s)");
		tempobj.focus();
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	// Start by checking that only basic ASCII characters are in the strings (0-127).

	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("Ths username contains invalid characters.");
			tempobj.focus();
			return false;
   		}
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			tempobj.focus();
			return false;
   		}
	}

	// See if "user" is valid 

	if (user.match(userPat)==null) {

		// user is not valid

		alert("The username doesn't seem to be valid.");
		tempobj.focus();
		return false;
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */

	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {

		// this is an IP address

		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				tempobj.focus();
				return false;
   			}
		}
		return true;
	}

	// Domain is symbolic name.  Check if it's valid.
 
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			tempobj.focus();
			return false;
   		}
	}

	/* domain name seems valid, but now make sure that it ends in a
	known top-level domain (like com, edu, gov) or a two-letter word,
	representing country (uk, nl), and that there's a hostname preceding 
	the domain or country. */

	if (checkTLD && domArr[domArr.length-1].length!=2 && 
		domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("The email address must end in a well-known domain or two letter " + "country.");
		tempobj.focus();
		return false;
	}

	// Make sure there's a host name preceding the domain.

	if (len<2) {
		alert("This address is missing a hostname!");
		tempobj.focus();
		return false;
	}

	// If we've gotten this far, everything's valid!
	return true;
}



function CheckRequiredRenewalRequest(which) {
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			
			if (tempobj.name=="initials"||tempobj.name=="firstname"||tempobj.name=="lastname"||
					tempobj.name=="birthday"||tempobj.name=="FullAddress"||tempobj.name=="Postcode"||
					tempobj.name=="telephone") {
				if (tempobj.value=='') {
						pass=false;
						break;
         			}
         		}
         		else if (tempobj.name=="title") {
				if (WhichListElementIsSelected(tempobj.name) == "--SELECT--") {
					pass=false;
					break;
				}
			}
			else if (tempobj.name=="sender") {
				var ret=emailCheck (tempobj);
				if(ret==false) {
					return false;
				}
			}
			else if (tempobj.name=="ConfirmSender") {
				if(tempobj.value != which.sender.value) {
					pass=false;
					break;
				}
			}

   		}
	}
	
	if (!pass) {
		if(tempobj.name=="title") {
			shortFieldName = "Please select your Title"
		}
		else if(tempobj.name=="initials") {
			shortFieldName = "Please enter your Initials"
		}
		else if(tempobj.name=="firstname") {
			shortFieldName = "Please enter your First Name"
		}
		else if(tempobj.name=="lastname") {
			shortFieldName = "Please enter your Last Name"
		}
		else if(tempobj.name=="birthday") {
			shortFieldName = "Please enter your Date Of Birth"
		}
		else if(tempobj.name=="FullAddress") {
			shortFieldName = "Please enter your Full Address"
		}
		else if(tempobj.name=="Postcode") {
			shortFieldName = "Please enter your Postcode"
		}
		else if(tempobj.name=="telephone") {
			shortFieldName = "Please enter your contact Telephone number"
		}
		else if(tempobj.name=="sender") {
			shortFieldName = "Please enter a valid Email Address"
		}
		else if(tempobj.name=="ConfirmSender") {
			shortFieldName = "The two Email Addresses do not match. Please confirm your Email Address"
		}

		alert(shortFieldName);
		tempobj.focus();
		return false;
	}
	else
		return true;
}



function CheckRequiredAllInOne(which) {
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			
			if (tempobj.name=="initials"||tempobj.name=="firstname"||tempobj.name=="lastname"||
					tempobj.name=="birthday"||tempobj.name=="FullAddress"||tempobj.name=="Postcode"||
					tempobj.name=="telephone") {
				if (tempobj.value=='') {
						pass=false;
						break;
         			}
         		}
         		else if (tempobj.name=="title") {
				if (WhichListElementIsSelected(tempobj.name) == "--SELECT--") {
					pass=false;
					break;
				}
			}
			else if (tempobj.name=="sender") {
				var ret=emailCheck (tempobj);
				if(ret==false) {
					return false;
				}
			}
			else if (tempobj.name=="ConfirmSender") {
				if(tempobj.value != which.sender.value) {
					pass=false;
					break;
				}
			}

   		}
	}
	
	if (!pass) {
		if(tempobj.name=="title") {
			shortFieldName = "Please select your Title"
		}
		else if(tempobj.name=="initials") {
			shortFieldName = "Please enter your Initials"
		}
		else if(tempobj.name=="firstname") {
			shortFieldName = "Please enter your First Name"
		}
		else if(tempobj.name=="lastname") {
			shortFieldName = "Please enter your Last Name"
		}
		else if(tempobj.name=="birthday") {
			shortFieldName = "Please enter your Date Of Birth"
		}
		else if(tempobj.name=="FullAddress") {
			shortFieldName = "Please enter your Full Address"
		}
		else if(tempobj.name=="Postcode") {
			shortFieldName = "Please enter your Postcode"
		}
		else if(tempobj.name=="telephone") {
			shortFieldName = "Please enter your contact Telephone number"
		}
		else if(tempobj.name=="sender") {
			shortFieldName = "Please enter a valid Email Address"
		}
		else if(tempobj.name=="ConfirmSender") {
			shortFieldName = "The two Email Addresses do not match. Please confirm your Email Address"
		}

		alert(shortFieldName);
		tempobj.focus();
		return false;
	}
	else
		return true;
}

function checkrequired(which) {
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			
			if (tempobj.name=="driverinitials"||tempobj.name=="driverfirstname"||tempobj.name=="driverlastname"||
				tempobj.name=="DriverFullAddress"||tempobj.name=="driverPostcode"||
					tempobj.name=="driverresidence"||tempobj.name=="driveroccupation"||tempobj.name=="driverTypeOfBusiness"||
					tempobj.name=="drivertelephone"||tempobj.name=="driverNumCarsHouse"||tempobj.name=="DriverClaimsConvictions"||
					tempobj.name=="make"||tempobj.name=="model"||tempobj.name=="engine"||tempobj.name=="reg"||
					tempobj.name=="value"||tempobj.name=="howhearaboutus"||tempobj.name=="DateOfPurchase"||
					tempobj.name=="NCBpercent"||tempobj.name=="insurer"||tempobj.name=="premium"||tempobj.name=="coverrequired") {
				if (tempobj.value=='') {
						pass=false;
						break;
         			}
         		}
         		else if (tempobj.name=="drivertitle"||tempobj.name=="driverlicense"||tempobj.name=="whotodrive"||tempobj.name=="isimported"||
					tempobj.name=="year"||tempobj.name=="owned"||tempobj.name=="garaged"||
					tempobj.name=="modified"||tempobj.name=="cover"||tempobj.name=="use"||tempobj.name=="mileage"||
					tempobj.name=="yearsNCB"||tempobj.name=="protectedNCB"||tempobj.name=="whichPolicyNCB"||
					tempobj.name=="breakdowncover"||tempobj.name=="claimsassistance") {
				if (WhichListElementIsSelected(tempobj.name) == "--SELECT--") {
					pass=false;
					break;
				}
			}

			else if (tempobj.name=="driverbirthday") {
				if (isDate(tempobj.value)==false){
					tempobj.focus()
					return false
				}
				else if (isProposerOverTwentyFive(tempobj.value)==false){
					tempobj.focus()
					return false
				}

			}
			else if (tempobj.name=="sender") {
				var ret=emailCheck (tempobj);
				if(ret==false) {
					return false;
				}
			}
			else if (tempobj.name=="garagepostcode") {
				if (WhichListElementIsSelected("garaged").indexOf("Garage") >= 0 && tempobj.value=="") {
						pass=false;
						break;
         			}
         		}
			else if (tempobj.name=="modifieddetails") {
				if (WhichListElementIsSelected("modified") == "Yes"&&tempobj.value=="") {
						pass=false;
						break;
         			}
         		}
			else if (tempobj.name=="driver2initials"||tempobj.name=="driver2firstname"||tempobj.name=="driver2lastname"||
					tempobj.name=="Driver2FullAddress"||tempobj.name=="driver2birthday"||tempobj.name=="driver2residence"||
					tempobj.name=="driver2occupation"||tempobj.name=="driver2Postcode"||tempobj.name=="driver2TypeOfBusiness"||
					tempobj.name=="Driver2NumCarsHouse	"||tempobj.name=="Driver2ClaimsConvictions") {
				if (WhichListElementIsSelected("whotodrive") != "Yourself Only"&&tempobj.value=="") {
						pass=false;
						break;
         			}
         		}
			else if (tempobj.name=="driver2relationship"||tempobj.name=="driver2title"||tempobj.name=="driver2license") {
				if (WhichListElementIsSelected("whotodrive") != "Yourself Only"&&WhichListElementIsSelected(tempobj.name) == "--SELECT--") {
						pass=false;
						break;
         			}
         		}
   		}
	}
	
	if (!pass) {
		//shortFieldName=tempobj.name.substring(8,40).toUpperCase();
		//shortFieldName=tempobj.name.substring(8,40);
		if(tempobj.name=="drivertitle") {
			shortFieldName = "Please select the Proposer's Title"
		}
		else if(tempobj.name=="driverinitials") {
			shortFieldName = "Please enter the Proposer's Initials"
		}
		else if(tempobj.name=="driverfirstname") {
			shortFieldName = "Please enter the Proposer's First Name"
		}
		else if(tempobj.name=="driverlastname") {
			shortFieldName = "Please enter the Proposer's Last Name"
		}
		else if(tempobj.name=="DriverFullAddress") {
			shortFieldName = "Please enter the Proposer's Full Address"
		}
		else if(tempobj.name=="driverPostcode") {
			shortFieldName = "Please enter the Proposer's Postcode"
		}
		else if(tempobj.name=="driverresidence") {
			shortFieldName = "Please enter the number of years the Proposer has been resident in the UK"
		}
		else if(tempobj.name=="driveroccupation") {
			shortFieldName = "Please enter the Proposer's Occupation"
		}
		else if(tempobj.name=="driverTypeOfBusiness") {
			shortFieldName = "Please enter the Type Of Business undertaken by the Proposer"
		}
		else if(tempobj.name=="drivertelephone") {
			shortFieldName = "Please enter the Proposer's Telephone Number"
		}
		else if(tempobj.name=="driverlicense") {
			shortFieldName = "Please select the number of years the Proposer has held a Full UK Driving Licence"
		}
		else if(tempobj.name=="sender") {
			shortFieldName = "Please enter a valid Email Address"
		}
		else if(tempobj.name=="whotodrive") {
			shortFieldName = "Please select who you would like to drive on this policy"
		}
		else if(tempobj.name=="driverNumCarsHouse") {
			shortFieldName = "Please enter the Number of Cars in the Proposer's household"
		}
		else if(tempobj.name=="DriverClaimsConvictions") {
			shortFieldName = "Please enter Details of any Claims/Convictions for the Proposer in the last 5 years";
		}
		else if(tempobj.name=="make") {
			shortFieldName = "Please enter the Make of the Vehicle";
		}
		else if(tempobj.name=="model") {
			shortFieldName = "Please enter the Model of the Vehicle";
		}
		else if(tempobj.name=="engine") {
			shortFieldName = "Please enter details of the Engine in the Vehicle";
		}
		else if(tempobj.name=="isimported") {
			shortFieldName = "Please specify if the vehicle is imported";
		}
		else if(tempobj.name=="year") {
			shortFieldName = "Please select the Year of the Vehicle";
		}
		else if(tempobj.name=="reg") {
			shortFieldName = "Please enter the Registration Letter of the Vehicle";
		}
		else if(tempobj.name=="value") {
			shortFieldName = "Please enter the Value of the Vehicle";
		}
		else if(tempobj.name=="owned") {
			shortFieldName = "Please select if the Vehicle is Owned by the Proposer";
		}
		else if(tempobj.name=="howhearaboutus") {
			shortFieldName = "Please specify how you heard about us";
		}
		else if(tempobj.name=="DateOfPurchase") {
			shortFieldName = "Please enter the Date Of Purchase of the Vehicle";
		}
		else if(tempobj.name=="garaged") {
			shortFieldName = "Please select if the Vehicle is stored in a Garage";
		}
		else if(tempobj.name=="garagepostcode") {
			shortFieldName = "Please enter the Postcode of the Garage where the Vehicle is stored";
		}
		else if(tempobj.name=="modified") {
			shortFieldName = "Please select if the Vehicle has been Modified";
		}
		else if(tempobj.name=="modifieddetails") {
			shortFieldName = "Please enter details of the Modifications to the Vehicle";
		}
		else if(tempobj.name=="driver2relationship") {
			shortFieldName = "Please select the Relationship between the Proposer and the Additional Driver";
		}
		else if(tempobj.name=="driver2title") {
			shortFieldName = "Please select the Additional Driver's Title";
		}
		else if(tempobj.name=="driver2initials") {
			shortFieldName = "Please enter the Additional Driver's Initials";
		}
		else if(tempobj.name=="driver2firstname") {
			shortFieldName = "Please enter the Additional Driver's First Name";
		}
		else if(tempobj.name=="driver2lastname") {
			shortFieldName = "Please enter the Additional Driver's Last Name";
		}
		else if(tempobj.name=="Driver2FullAddress") {
			shortFieldName = "Please enter the Additional Driver's Full Address";
		}
		else if(tempobj.name=="driver2birthday") {
			shortFieldName = "Please enter the Additional Driver's Date Of Birth";
		}
		else if(tempobj.name=="driver2residence") {
			shortFieldName = "Please enter the number of years the Additional Driver has been resident in the UK";
		}
		else if(tempobj.name=="driver2occupation") {
			shortFieldName = "Please enter the Additional Driver's Occupation";
		}
		else if(tempobj.name=="driver2Postcode") {
			shortFieldName = "Please enter the Additional Driver's Postcode";
		}
		else if(tempobj.name=="driver2TypeOfBusiness") {
			shortFieldName = "Please enter the Type Of Business undertaken by the Additional Driver";
		}
		else if(tempobj.name=="Driver2NumCarsHouse") {
			shortFieldName = "Please enter the Number of Cars in the Additional Driver's household";
		}
		else if(tempobj.name=="driver2license") {
			shortFieldName = "Please select the number of years the Additional Driver has held a Full UK Driving Licence";
		}
		else if(tempobj.name=="Driver2ClaimsConvictions") {
			shortFieldName = "Please enter Details of any Claims/Convictions for the Additional Driver in the last 5 years";
		}
		else if(tempobj.name=="cover") {
			shortFieldName = "Please select the type of Cover required";
		}
		else if(tempobj.name=="use") {
			shortFieldName = "Please select the Use for the Vehicle";
		}
		else if(tempobj.name=="mileage") {
			shortFieldName = "Please select the Annual Mileage";
		}
		else if(tempobj.name=="NCBpercent") {
			shortFieldName = "Please enter your No Claims Bonus Percentage";
		}
		else if(tempobj.name=="yearsNCB") {
			shortFieldName = "Please select the number of Years of No Claims Bonus";
		}
		else if(tempobj.name=="protectedNCB") {
			shortFieldName = "Please select if you have a protected No Claims Bonus";
		}
		else if(tempobj.name=="whichPolicyNCB") {
			shortFieldName = "Please select which policy the No Claims Bonus relates to";
		}
		else if(tempobj.name=="breakdowncover") {
			shortFieldName = "Please select if you want Breakdown Cover";
		}
		else if(tempobj.name=="claimsassistance") {
			shortFieldName = "Please select if you want Claims Assistance Cover";
		}
		else if(tempobj.name=="insurer") {
			shortFieldName = "Please enter your Present Insurer";
		}
		else if(tempobj.name=="premium") {
			shortFieldName = "Please enter your Current Premium";
		}
		else if(tempobj.name=="coverrequired") {
			shortFieldName = "Please enter the date you require Cover to commence";
		}
		alert(shortFieldName);
		tempobj.focus();
		return false;
	}
	else
		return true;
}


function checkrequiredContact(which) {
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			
			if (tempobj.name=="name"||tempobj.name=="sender") {
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&
					tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
					tempobj.selectedIndex==0)) {
						pass=false;
						break;
         		}
      		}
      		if(tempobj.name=="sender") {
				var ret=emailCheck (tempobj.value);
				if(ret==false) {
					return false;
				}
			}
   		}
	}
	
	if (!pass) {
		if(tempobj.name=="sender") {
			shortFieldName = "your Email Address"
		}
		else if(tempobj.name=="name") {
			shortFieldName = "your Name"
		}
		alert("Please make sure "+shortFieldName+" was properly completed.");
		return false;
	}
	else
		return true;
}

function WhichListElementIsSelected(sFieldName) {
	oForm = document.forms[0];
	oElement = oForm.elements(sFieldName);
	sRequest = oElement[oElement.selectedIndex].text;

	return(sRequest);
}
// -->