function checker(){

	var target = Array();

	target[0] = Array('text', 'personname', 4, 'Please enter your name');
	target[1] = Array('text', 'location',  4, 'Please enter the location where you are based');
	target[2] = Array('text', 'email', 4, 'Please enter your contact email address' );
	target[3] = Array('text', 'telephone', 17, 'Please enter your contact telephone number' );
	target[4] = Array('option', 'contract_type', 1, 'Please choose the contract type you wish to persuit');
	target[5] = Array('option', 'contract', 1, 'Please specify the length of the contract you are interested in');
	target[6] = Array('text', 'budget', 4, 'Please specify the estimated monthly budget for the vehicle');
	target[7] = Array('option', 'deposit', 1, 'Please specify the nature of deposit to be placed');
	target[8] = Array('text', 'annual_mileage', 4, 'Please enter the expected annual mileage');
	target[9] = Array('text', 'maintenance', 1, 'Please choose the maintance service you wish to receive');
	target[10] = Array('text', 'make', 2, 'Please choose the vehicle manufacturer');
	target[11] = Array('text', 'Model', 2, 'Please sepcify the model(s) you are enquiring about');
	target[12] = Array('text', 'engine', 2, 'Please specify the engine capacity');
	target[13] = Array('check', 'fuel', 4, 'Please choose the fuel type you would prefer');
	target[14] = Array('option', 'shape', 1, 'Please specify the body type you would prefer');
	target[15] = Array('check', 'transmission', 4, 'Please choose the type of transmission you would like');
	target[16] = Array('check', 'p_exchange', 1, 'Please let us know if you would like to take advantage of our Part Exchange Service');
	target[17] = Array('option', 'refer', 1, 'Please let us know how you heard about our company');
	target[18] = Array('text', 'colour', 1, 'Please let us know the colour you would prefer of the vehicle');
	target[19] = Array('option', 'c_when', 1, 'Please let us know when you would like the contract to take effect');

	var quoteQ = document.all;

	var i;
	var k;
	var errCount = 0;
	var errMsg = 'Error! \n You must complete the form for us to provide you with a quote.\n';

	for(i = 0; i < target.length; i++){
		if(target[i][0] == 'text'){
			if( (quoteQ[target[i][1]].length < target[i][2]) || quoteQ[target[i][1]].value == '') {
				errMsg = errMsg + "\n - " + target[i][3]
				errCount ++ ;
			}
		}else if(target[i][0] == 'option'){
			if(quoteQ[target[i][1]].options.selectedIndex >= target[i][2]){
				//do nothing
			}else{
				errMsg = errMsg + "\n - " + target[i][3];
				errCount ++ ;
			}
		}else if(target[i][0] == 'check'){
			k = 0;
			for (j = 0; j < quoteQ[target[i][1]].length ; j++){
				if( quoteQ[target[i][1]][j].checked == true){
					j = quoteQ[target[i][1]].length;
					k = 1
				}
			}
			if(k == 0){
				errMsg = errMsg + "\n - " + target[i][3]
				errCount ++ ;
			}
		}
	}

	if(errCount > 0){

		alert(errMsg);

		return false;

	}

}

function descriptor(){

	var target = Array();

	target[0] = Array('');
	target[1] = Array('Business hands vehicle back at the end of agreement');
	target[2] = Array('Business either hands vehicle back or pays to buy it at end of agreement');
	target[3] = Array('Business either sells vehicle or can take ownership if desired');
	target[4] = Array('Individual hands vehicle back at the end of agreement');
	target[5] = Array('Individual either hands vehicle back or pays to buy it at end of agreement');
	target[6] = Array('Individual or Business');
	target[7] = Array('Call Me To Discuss');
	target[8] = Array('');

	var quoteQ = document.all;

	contract_type_desc.innerHTML =  target[quoteQ['contract_type'].options.selectedIndex]

}
