var opcodes = new Array();
	opcodes[0] = new Array();
	opcodes[0][0] = new Array();
	opcodes[0][0][0] = "POF";
	opcodes[0][0][1] = "P&O Ferries";
	opcodes[0][1] = new Array();
	opcodes[0][1][0] = "Dover - Calais";
	opcodes[0][1][1] = "POF_DOCA";
	opcodes[0][2] = new Array();
	opcodes[0][2][0] = "Calais - Dover";
	opcodes[0][2][1] = "POF_CADO";
	opcodes[0][3] = new Array();
	opcodes[0][3][0] = "Hull - Europoort";
	opcodes[0][3][1] = "POF_HUEU";
	opcodes[0][4] = new Array();
	opcodes[0][4][0] = "Europoort - Hull";
	opcodes[0][4][1] = "POF_EUHU";
	opcodes[0][5] = new Array();
	opcodes[0][5][0] = "Hull - Zeebrugge";
	opcodes[0][5][1] = "POF_HUZE";
	opcodes[0][6] = new Array();
	opcodes[0][6][0] = "Zeebrugge - Hull";
	opcodes[0][6][1] = "POF_ZEHU";
	opcodes[0][7] = new Array();
	opcodes[0][7][0] = "Portsmouth - Bilbao";
	opcodes[0][7][1] = "POF_POBI";
	opcodes[0][8] = new Array();
	opcodes[0][8][0] = "Bilbao - Portsmouth";
	opcodes[0][8][1] = "POF_BIPO";
	opcodes[1] = new Array();
	opcodes[1][0] = new Array();
	opcodes[1][0][0] = "SFR";
	opcodes[1][0][1] = "SeaFrance";
	opcodes[1][1] = new Array();
	opcodes[1][1][0] = "Dover - Calais";
	opcodes[1][1][1] = "SFR_DOCA";
	opcodes[1][2] = new Array();
	opcodes[1][2][0] = "Calais - Dover";
	opcodes[1][2][1] = "SFR_CADO";
	opcodes[2] = new Array();
	opcodes[2][0] = new Array();
	opcodes[2][0][0] = "NFL";
	opcodes[2][0][1] = "Norfolkline";
	opcodes[2][1] = new Array();
	opcodes[2][1][0] = "Dover - Dunkerque";
	opcodes[2][1][1] = "NFL_DODU";
	opcodes[2][2] = new Array();
	opcodes[2][2][0] = "Dunkerque - Dover";
	opcodes[2][2][1] = "NFL_DUDO";
	opcodes[3] = new Array();
	opcodes[3][0] = new Array();
	opcodes[3][0][0] = "STL";
	opcodes[3][0][1] = "Stena Line";
	opcodes[3][1] = new Array();
	opcodes[3][1][0] = "Fishguard - Rosslare";
	opcodes[3][1][1] = "STL_FGRL";
	opcodes[3][2] = new Array();
	opcodes[3][2][0] = "Rosslare - Fishguard";
	opcodes[3][2][1] = "STL_RLFG";
	opcodes[3][3] = new Array();
	opcodes[3][3][0] = "Fleetwood - Larne";
	opcodes[3][3][1] = "STL_FLLA";
	opcodes[3][4] = new Array();
	opcodes[3][4][0] = "Larne - Fleetwood";
	opcodes[3][4][1] = "STL_LAFL";
	opcodes[3][5] = new Array();
	opcodes[3][5][0] = "Harwich - Hook of Holland";
	opcodes[3][5][1] = "STL_HAHK";
	opcodes[3][6] = new Array();
	opcodes[3][6][0] = "Hook of Holland - Harwich";
	opcodes[3][6][1] = "STL_HKHA";
	opcodes[3][7] = new Array();
	opcodes[3][7][0] = "Holyhead - Dun Laoghaire";
	opcodes[3][7][1] = "STL_HHDL";
	opcodes[3][8] = new Array();
	opcodes[3][8][0] = "Dun Laoghaire - Holyhead";
	opcodes[3][8][1] = "STL_DLHH";
	opcodes[3][9] = new Array();
	opcodes[3][9][0] = "Holyhead - Dublin";
	opcodes[3][9][1] = "STL_HODB";
	opcodes[3][10] = new Array();
	opcodes[3][10][0] = "Dublin - Holyhead";
	opcodes[3][10][1] = "STL_DBHO";
	opcodes[3][11] = new Array();
	opcodes[3][11][0] = "Stranraer - Belfast";
	opcodes[3][11][1] = "STL_SHBF";
	opcodes[3][12] = new Array();
	opcodes[3][12][0] = "Belfast - Stranraer";
	opcodes[3][12][1] = "STL_BFSH";
	opcodes[4] = new Array();
	opcodes[4][0] = new Array();
	opcodes[4][0][0] = "ETL";
	opcodes[4][0][1] = "Eurotunnel";
	opcodes[4][1] = new Array();
	opcodes[4][1][0] = "Folkestone - Calais";
	opcodes[4][1][1] = "ETL_FTCT";
	opcodes[4][2] = new Array();
	opcodes[4][2][0] = "Calais - Folkestone";
	opcodes[4][2][1] = "ETL_CTFT";
	opcodes[5] = new Array();
	opcodes[5][0] = new Array();
	opcodes[5][0][0] = "BRI";
	opcodes[5][0][1] = "Brittany Ferries";
	opcodes[5][1] = new Array();
	opcodes[5][1][0] = "Plymouth - Santander";
	opcodes[5][1][1] = "BRI_PYSA";
	opcodes[5][2] = new Array();
	opcodes[5][2][0] = "Santander - Plymouth";
	opcodes[5][2][1] = "BRI_SAPY";
	opcodes[5][3] = new Array();
	opcodes[5][3][0] = "Plymouth - Roscoff";
	opcodes[5][3][1] = "BRI_PYRS";
	opcodes[5][4] = new Array();
	opcodes[5][4][0] = "Roscoff - Plymouth";
	opcodes[5][4][1] = "BRI_RSPY";
	opcodes[5][5] = new Array();
	opcodes[5][5][0] = "Poole - Cherbourg";
	opcodes[5][5][1] = "BRI_PLCH";
	opcodes[5][6] = new Array();
	opcodes[5][6][0] = "Cherbourg - Poole";
	opcodes[5][6][1] = "BRI_CHPL";
	opcodes[5][7] = new Array();
	opcodes[5][7][0] = "Portsmouth - Caen";
	opcodes[5][7][1] = "BRI_POCE";
	opcodes[5][8] = new Array();
	opcodes[5][8][0] = "Caen - Portsmouth";
	opcodes[5][8][1] = "BRI_CEPO";
	opcodes[5][9] = new Array();
	opcodes[5][9][0] = "Portsmouth - Cherbourg";
	opcodes[5][9][1] = "BRI_POCH";
	opcodes[5][10] = new Array();
	opcodes[5][10][0] = "Cherbourg - Portsmouth";
	opcodes[5][10][1] = "BRI_CHPO";
	opcodes[5][11] = new Array();
	opcodes[5][11][0] = "Portsmouth - St Malo";
	opcodes[5][11][1] = "BRI_POSM";
	opcodes[5][12] = new Array();
	opcodes[5][12][0] = "St Malo - Portsmouth";
	opcodes[5][12][1] = "BRI_SMPO";
	opcodes[6] = new Array();
	opcodes[6][0] = new Array();
	opcodes[6][0][0] = "DFD";
	opcodes[6][0][1] = "DFDS Seaways";
	opcodes[6][1] = new Array();
	opcodes[6][1][0] = "Amsterdam - Newcastle";
	opcodes[6][1][1] = "DFD_AMNE";
	opcodes[6][2] = new Array();
	opcodes[6][2][0] = "Newcastle - Amsterdam";
	opcodes[6][2][1] = "DFD_NEAM";
	opcodes[6][3] = new Array();
	opcodes[6][3][0] = "Copenhagen - Oslo";
	opcodes[6][3][1] = "DFD_KOOS";
	opcodes[6][4] = new Array();
	opcodes[6][4][0] = "Oslo - Copenhagen";
	opcodes[6][4][1] = "DFD_OSKO";
	opcodes[6][5] = new Array();
	opcodes[6][5][0] = "Esbjerg - Harwich";
	opcodes[6][5][1] = "DFD_ESHR";
	opcodes[6][6] = new Array();
	opcodes[6][6][0] = "Harwich - Esbjerg";
	opcodes[6][6][1] = "DFD_HRES";
	opcodes[6][7] = new Array();
	opcodes[6][7][0] = "Newcastle - Bergen";
	opcodes[6][7][1] = "DFD_NEBG";
	opcodes[6][8] = new Array();
	opcodes[6][8][0] = "Bergen - Newcastle";
	opcodes[6][8][1] = "DFD_BGNE";
	opcodes[6][9] = new Array();
	opcodes[6][9][0] = "Newcastle - Haugesund";
	opcodes[6][9][1] = "DFD_NEHG";
	opcodes[6][10] = new Array();
	opcodes[6][10][0] = "Haugesund - Newcastle";
	opcodes[6][10][1] = "DFD_HGNE";
	opcodes[6][11] = new Array();
	opcodes[6][11][0] = "Newcastle - Stavanger";
	opcodes[6][11][1] = "DFD_NESV";
	opcodes[6][12] = new Array();
	opcodes[6][12][0] = "Stavanger - Newcastle";
	opcodes[6][12][1] = "DFD_SVNE";
	opcodes[7] = new Array();
	opcodes[7][0] = new Array();
	opcodes[7][0][0] = "SPF";
	opcodes[7][0][1] = "SpeedFerries";
	opcodes[7][1] = new Array();
	opcodes[7][1][0] = "Dover - Boulogne";
	opcodes[7][1][1] = "SPF_DOBO";
	opcodes[7][2] = new Array();
	opcodes[7][2][0] = "Boulogne - Dover";
	opcodes[7][2][1] = "SPF_BODO";
	opcodes[8] = new Array();
	opcodes[8][0] = new Array();
	opcodes[8][0][0] = "POI";
	opcodes[8][0][1] = "P&O Irish Ferries";
	opcodes[8][1] = new Array();
	opcodes[8][1][0] = "Cairnryan - Larne";
	opcodes[8][1][1] = "POI_CRLA";
	opcodes[8][2] = new Array();
	opcodes[8][2][0] = "Larne - Cairnryan";
	opcodes[8][2][1] = "POI_LACR";
	opcodes[8][3] = new Array();
	opcodes[8][3][0] = "Dublin - Liverpool";
	opcodes[8][3][1] = "POI_DBLI";
	opcodes[8][4] = new Array();
	opcodes[8][4][0] = "Liverpool - Dublin";
	opcodes[8][4][1] = "POI_LIDB";
	opcodes[8][5] = new Array();
	opcodes[8][5][0] = "Larne - Troon";
	opcodes[8][5][1] = "POI_LATR";
	opcodes[8][6] = new Array();
	opcodes[8][6][0] = "Troon - Larne";
	opcodes[8][6][1] = "POI_TRLA";
	opcodes[9] = new Array();
	opcodes[9][0] = new Array();
	opcodes[9][0][0] = "CNR";
	opcodes[9][0][1] = "Condor Ferries";
	opcodes[9][1] = new Array();
	opcodes[9][1][0] = "Cherbourg - Portsmouth";
	opcodes[9][1][1] = "CNR_CHPM";
	opcodes[9][2] = new Array();
	opcodes[9][2][0] = "Portsmouth - Cherbourg";
	opcodes[9][2][1] = "CNR_PMCH";
	opcodes[9][3] = new Array();
	opcodes[9][3][0] = "Guernsey - Poole";
	opcodes[9][3][1] = "CNR_GUPA";
	opcodes[9][4] = new Array();
	opcodes[9][4][0] = "Poole - Guernsey";
	opcodes[9][4][1] = "CNR_PAGU";
	opcodes[9][5] = new Array();
	opcodes[9][5][0] = "Guernsey - Portsmouth";
	opcodes[9][5][1] = "CNR_GUPM";
	opcodes[9][6] = new Array();
	opcodes[9][6][0] = "Portsmouth - Guernsey";
	opcodes[9][6][1] = "CNR_PMGU";
	opcodes[9][7] = new Array();
	opcodes[9][7][0] = "Guernsey - Weymouth";
	opcodes[9][7][1] = "CNR_GUWE";
	opcodes[9][8] = new Array();
	opcodes[9][8][0] = "Weymouth - Guernsey";
	opcodes[9][8][1] = "CNR_WEGU";
	opcodes[9][9] = new Array();
	opcodes[9][9][0] = "Jersey - Portsmouth";
	opcodes[9][9][1] = "CNR_JSPM";
	opcodes[9][10] = new Array();
	opcodes[9][10][0] = "Portsmouth - Jersey";
	opcodes[9][10][1] = "CNR_PMJS";
	opcodes[9][11] = new Array();
	opcodes[9][11][0] = "St Malo - Weymouth";
	opcodes[9][11][1] = "CNR_SMWE";
	opcodes[9][12] = new Array();
	opcodes[9][12][0] = "Weymouth - St Malo";
	opcodes[9][12][1] = "CNR_WESM";
	opcodes[9][13] = new Array();
	opcodes[9][13][0] = "Poole - St Malo";
	opcodes[9][13][1] = "CNR_PASM";
	opcodes[9][14] = new Array();
	opcodes[9][14][0] = "St Malo - Poole";
	opcodes[9][14][1] = "CNR_SMPA";
	opcodes[9][15] = new Array();
	opcodes[9][15][0] = "Jersey - St Malo";
	opcodes[9][15][1] = "CNR_JSSM";
	opcodes[9][16] = new Array();
	opcodes[9][16][0] = "St Malo - Jersey";
	opcodes[9][16][1] = "CNR_SMJS";
	opcodes[9][17] = new Array();
	opcodes[9][17][0] = "Guernsey - St Malo";
	opcodes[9][17][1] = "CNR_GUSM";
	opcodes[9][18] = new Array();
	opcodes[9][18][0] = "St Malo - Guernsey";
	opcodes[9][18][1] = "CNR_SMGU";
	opcodes[9][19] = new Array();
	opcodes[9][19][0] = "Jersey - Guernsey";
	opcodes[9][19][1] = "CNR_JSGU";
	opcodes[9][20] = new Array();
	opcodes[9][20][0] = "Guernsey - Jersey";
	opcodes[9][20][1] = "CNR_GUJS";
	opcodes[9][21] = new Array();
	opcodes[9][21][0] = "Weymouth - Jersey";
	opcodes[9][21][1] = "CNR_WEJS";
	opcodes[9][22] = new Array();
	opcodes[9][22][0] = "Jersey - Weymouth";
	opcodes[9][22][1] = "CNR_JSWE";
	opcodes[9][23] = new Array();
	opcodes[9][23][0] = "Poole - Jersey";
	opcodes[9][23][1] = "CNR_PAJS";
	opcodes[9][24] = new Array();
	opcodes[9][24][0] = "Jersey - Poole";
	opcodes[9][24][1] = "CNR_JSPA";
	var opPrices = new Array();
	opPrices[0] = new Array();
	opPrices[0][0] = "POF";
	opPrices[0][1] = "28";
	opPrices[0][2] = "36";
	opPrices[0][3] = "110";
	opPrices[1] = new Array();
	opPrices[1][0] = "SFR";
	opPrices[1][1] = "29";
	opPrices[1][2] = "31";
	opPrices[1][3] = "70";
	opPrices[2] = new Array();
	opPrices[2][0] = "NFL";
	opPrices[2][1] = "";
	opPrices[2][2] = "32";
	opPrices[2][3] = "64";
	opPrices[3] = new Array();
	opPrices[3][0] = "STL";
	opPrices[3][1] = "";
	opPrices[3][2] = "113";
	opPrices[3][3] = "211";
	opPrices[4] = new Array();
	opPrices[4][0] = "ETL";
	opPrices[4][1] = "54";
	opPrices[4][2] = "52";
	opPrices[4][3] = "136";
	opPrices[5] = new Array();
	opPrices[5][0] = "BRI";
	opPrices[5][1] = "";
	opPrices[5][2] = "142";
	opPrices[5][3] = "317";
	opPrices[6] = new Array();
	opPrices[6][0] = "DFD";
	opPrices[6][1] = "";
	opPrices[6][2] = "140";
	opPrices[6][3] = "340";
	opPrices[7] = new Array();
	opPrices[7][0] = "SPF";
	opPrices[7][1] = "";
	opPrices[7][2] = "37";
	opPrices[7][3] = "75";
	opPrices[8] = new Array();
	opPrices[8][0] = "POI";
	opPrices[8][1] = "";
	opPrices[8][2] = "82";
	opPrices[8][3] = "172";
	opPrices[9] = new Array();
	opPrices[9][0] = "CNR";
	opPrices[9][1] = "";
	opPrices[9][2] = "132";
	opPrices[9][3] = "255";
	var leadIn = new Array();
	
	
	
	function displayRoutes(opcodes, operator){		
		var x;
		var y;
		var z;
		document.forms['frm_operator_selection'].outwardOperatorRoute.options.length = 0;
		document.forms['frm_operator_selection'].returnOperatorRoute.options.length = 0;
		//document.forms['frm_operator_selection'].Submit.disabled = false;
		document.forms['frm_operator_selection'].returnOperatorRoute.disabled = false;
		document.forms['frm_operator_selection'].outwardOperatorRoute.disabled = false;
		document.forms['frm_operator_selection'].journeyType.disabled = false;
		document.forms['frm_operator_selection'].journeyType.disabled = false;
		document.getElementById("frm_operator").value = operator;
			for(x=0; x<opcodes.length; x++){
				for(y=1; y<opcodes[x].length; y++){
					if(opcodes[x][0][0] == operator){
						document.forms['frm_operator_selection'].outwardOperatorRoute.options[y-1] = new Option(opcodes[x][y][0],opcodes[x][y][1]);
						document.forms['frm_operator_selection'].returnOperatorRoute.options[y-1] = new Option(opcodes[x][y][0], opcodes[x][y][1]);
					}
				}
			}
		killReturn();
		
		
		 document.forms['frm_operator_selection'].returnOperatorRoute.options[1].selected = true;
		// SET DEFAULT ROUTES BELOW
		if(operator == "POI"){
			document.forms['frm_operator_selection'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "BRI"){
			document.forms['frm_operator_selection'].outwardOperatorRoute.options[6].selected = true;
			document.forms['frm_operator_selection'].returnOperatorRoute.options[7].selected = true;
		}
		if(operator == "STL"){
			document.forms['frm_operator_selection'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "CNR"){
			document.forms['frm_operator_selection'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection'].returnOperatorRoute.options[0].selected = true;
		}
		
		
		
	}
	
	function displayRoutes1(opcodes, operator){
		var x;
		var y;
		var z;
		document.forms['frm_operator_selection_1'].outwardOperatorRoute.options.length = 0;
		document.forms['frm_operator_selection_1'].returnOperatorRoute.options.length = 0;
		//document.forms['frm_operator_selection_1'].submit.disabled = false;
		document.forms['frm_operator_selection_1'].returnOperatorRoute.disabled = false;
		document.forms['frm_operator_selection_1'].outwardOperatorRoute.disabled = false;
		document.forms['frm_operator_selection_1'].journeyType.disabled = false;
		document.forms['frm_operator_selection_1'].journeyType.disabled = false;
		document.getElementById("frm_operator").value = operator;
			for(x=0; x<opcodes.length; x++){
				for(y=1; y<opcodes[x].length; y++){
					if(opcodes[x][0][0] == operator){
						document.forms['frm_operator_selection_1'].outwardOperatorRoute.options[y-1] = new Option(opcodes[x][y][0],opcodes[x][y][1]);
						document.forms['frm_operator_selection_1'].returnOperatorRoute.options[y-1] = new Option(opcodes[x][y][0], opcodes[x][y][1]);
					}
				}
			}
		killReturn();
		
		 document.forms['frm_operator_selection_1'].returnOperatorRoute.options[1].selected = true;
		// SET DEFAULT ROUTES BELOW
		if(operator == "POI"){
			document.forms['frm_operator_selection_1'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_1'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "BRI"){
			document.forms['frm_operator_selection_1'].outwardOperatorRoute.options[6].selected = true;
			document.forms['frm_operator_selection_1'].returnOperatorRoute.options[7].selected = true;
		}
		if(operator == "STL"){
			document.forms['frm_operator_selection_1'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_1'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "CNR"){
			document.forms['frm_operator_selection_1'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_1'].returnOperatorRoute.options[0].selected = true;
		}
		
		
	}
	
	function displayRoutes2(opcodes, operator){
		var x;
		var y;
		var z;
		document.forms['frm_operator_selection_2'].outwardOperatorRoute.options.length = 0;
		document.forms['frm_operator_selection_2'].returnOperatorRoute.options.length = 0;
		//document.forms['frm_operator_selection_2'].submit.disabled = false;
		document.forms['frm_operator_selection_2'].returnOperatorRoute.disabled = false;
		document.forms['frm_operator_selection_2'].outwardOperatorRoute.disabled = false;
		document.forms['frm_operator_selection_2'].journeyType.disabled = false;
		document.forms['frm_operator_selection_2'].journeyType.disabled = false;
		document.getElementById("frm_operator").value = operator;
			for(x=0; x<opcodes.length; x++){
				for(y=1; y<opcodes[x].length; y++){
					if(opcodes[x][0][0] == operator){
						document.forms['frm_operator_selection_2'].outwardOperatorRoute.options[y-1] = new Option(opcodes[x][y][0],opcodes[x][y][1]);
						document.forms['frm_operator_selection_2'].returnOperatorRoute.options[y-1] = new Option(opcodes[x][y][0], opcodes[x][y][1]);
					}
				}
			}
		killReturn();
		
		 document.forms['frm_operator_selection_2'].returnOperatorRoute.options[1].selected = true;
		// SET DEFAULT ROUTES BELOW
		if(operator == "POI"){
			document.forms['frm_operator_selection_2'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_2'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "BRI"){
			document.forms['frm_operator_selection_2'].outwardOperatorRoute.options[6].selected = true;
			document.forms['frm_operator_selection_2'].returnOperatorRoute.options[7].selected = true;
		}
		if(operator == "STL"){
			document.forms['frm_operator_selection_2'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_2'].returnOperatorRoute.options[0].selected = true;
		}
		if(operator == "CNR"){
			document.forms['frm_operator_selection_2'].outwardOperatorRoute.options[1].selected = true;
			document.forms['frm_operator_selection_2'].returnOperatorRoute.options[0].selected = true;
		}
		
		
	}
function selecter(that){
		var others = getElementsByClassName(document,'op_sel');
		for (var i=0; i<others.length; i++){
		//others[i].className = "op_out";
		}
		//that.className = 'op_sel';
		var IDER = that.id;		
		//document.getElementById("selectedop").innerHTML = that.innerHTML;
		
		if(IDER=="BRI"){
			displayRoutes1(opcodes, IDER);
		}else if(IDER=="STL"){
			displayRoutes2(opcodes, IDER);
		}else{
			displayRoutes(opcodes, IDER);
		}
		//displayPrices(opPrices, IDER);
		//Plus prefill routes and hidden form fields
		
	}
	
	function selecterPO(){	
			var others =getElementsByClassName(document,'op_sel');
			if(others[1].checked==true){
				displayRoutes(opcodes, "BRI");	
			}else if(others[2].checked==true){
				displayRoutes(opcodes, "STL");	
			}else {
				displayRoutes(opcodes, "POF");	
			}
	
			document.getElementById("location").value="Street, town or postcode";				
	}
	
	function getElementsByClassName(node, classname){
	    var a = [];
	    var re = new RegExp('\\b' + classname + '\\b');
	    var els = node.getElementsByTagName("*");
	    for(var i=0,j=els.length; i<j; i++)
	        if(re.test(els[i].className))a.push(els[i]);
	    return a;
	}
	function killReturn(){
		if(document.forms['frm_operator_selection'].journeyType.options[1].selected == true){
			document.forms['frm_operator_selection'].returnOperatorRoute.disabled = true;
		}else{
			document.forms['frm_operator_selection'].returnOperatorRoute.disabled = false;
		}
	}
	
	
	
	// country arrays
	 var arrayCountryISOCode=		new Array('FR','IT','ES','PT');
	 var arrayCountryDesc=			new Array('France','Italy','Spain','Portugal');
	
	// area/region arrays
	 var arrayCountryCodeID=		new Array('ES','ES','ES','ES','ES','ES','ES','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','FR','IT','IT','IT','IT','IT','IT','IT','IT','PT','PT','PT','PT','PT');
	 var arrayAreaCodeID2=			new Array('SPA','SPA:CAT','SPA:ANE','SPA:IBZ','SPA:MAL','SPA:VAL','SPA:ANW','ALP','ALP:F74','ALP:F38','ALP:F73','ALS','ALS:F67','ALS:F68','ALS:F55','ALS:F57','ALS:F88','ARD','BRI','BRI:F22','BRI:F29','BRI:F35','BRI:F44','BRI:F56','BUR','BUR:F21','BUR:F58','BUR:F71','BUR:F89','CHA','CHA:F08','CHA:F10','CHA:F52','CHA:F51','CHR','CHR:F16','CHR:F17','CDA','CDA:F06','CDA:F83','DOR','DOR:F12','DOR:F32','DOR:F46','DOR:F47','DOR:F81','DOR:F82','IDF','IDF:F91','IDF:F92','IDF:F77','IDF:F95','IDF:F75','IDF:F78','JUR','JUR:F25','JUR:F70','LAN','LAN:F09','LAN:F11','LAN:F30','LAN:F34','LAN:F66','LMS','LMS:F19','LMS:F23','LMS:F87','LOI','LOI:F18','LOI:F28','LOI:F36','LOI:F37','LOI:F45','LOI:F41','LOI:F49','LOI:F53','LOI:F72','LOI:F86','MAS','MAS:F43','MAS:F69','NOR','NOR:F14','NOR:F27','NOR:F50','NOR:F61','NOR:F76','PDC','PDC:F59','PIC','PIC:F02','PIC:F60','PIC:F80','PRO','PRO:F04','PRO:F13','PRO:F26','PRO:F05','PRO:F84','PYR','PYR:F31','PYR:F65','SWC','SWC:F33','SWC:F40','SWC:F64','VEN','VEN:F79','ITL','ITL:AMC','ITL:LAZ','ITL:LIG','ITL:SIC','ITL:TUS','ITL:UMB','ITL:VNT','POR','POR:ALG','POR:PRA','POR:LIS','POR:VER'); 
	 var arrayAreaDescription=		new Array('Spain','Catalunya','Eastern Andalucia','Ibiza','Mallorca','Valencia','Western Andalucia','Alps','Haute-savoie','Isere','Savoie','Alsace and Lorraine','Bas-rhin','Haut-rhin','Meuse','Moselle','Vosges','Ardeche','Brittany','Cotes-d\'Armor','Finistere','Ille-et_vilane','Loire-atlantique','Morbihan','Burgundy','Cote-d\'Or','Nievre','Saone-et-loire','Yonne','Champagne','Ardennes','Aube','Haute-marne','Marne','Charentes','Charente','Charente-maritime','Cote-d\'Azur','Alpes-maritimes','Var','Dordogne','Aveyron','Gers','Lot','Lot-et-garonne','Tarn','Tarn-et-garonne','Ile-de-france and Paris','Essonne','Hauts-de-seine','Seine-et-marne','Val-d\'Oise','Ville-de-paris','Yvelines','Jura Region','Doubs','Haute-saone','Languedoc-roussillon','Ariege','Aude','Gard','Herault','Pyrenees-orientales','Limousin','Correze','Creuse','Haute-vienne','Loire','Cher','Eure-et-loire','Indre','Indre-et-loire','Loiret','Loir-et-cher','Maine-et-loire','Mayenne','Sarthe','Vienne','Massif Central','Haute-loire','Rhone','Normandy','Calvados','Eure','Manche','Orne','Seine-maritime','Pas-de-calais','Nord','Picardy','Aisne','Oise','Somme','Provence','Alpes-de-haute-provence','Bouches-du-rhone','Drome','Hautes-alpes','Vaucluse','Pyrenees','Haute-garonne','Hautes-pyrenees','South West Coast and Vineyards','Gironde','Landes','Pyrenees-atlantiques','Vendee','Deux-sevres','Italy','Amalfi Coast','Lazio','Liguria','Sicily','Tuscany','Umbria','Veneto','Portugal','Algarve','Costa de Prata','Costa Lisboa','Costa Verde');
	 var arrayAreaType=				new Array(1,2,2,2,2,2,2,1,2,2,2,1,2,2,2,2,2,1,1,2,2,2,2,2,1,2,2,2,2,1,2,2,2,2,1,2,2,1,2,2,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1,2,2,1,2,2,2,2,2,1,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,2,2,1,2,1,2,2,2,1,2,2,2,2,2,1,2,2,1,2,2,2,1,2,1,2,2,2,2,2,2,2,1,2,2,2,2);
	
	 function getCountries(){
	
		 //wipe the area options, we are changing country, note: this also clears and repops the sub-area options
			//clearAreas();
			objSelect=document.mbQuickSearch.iso_country_code;
					
		 //walk the arrays adding the OPTION values
			for (i = 0; i < arrayCountryISOCode.length; i++){
			
				//show the countries
				//alert(arrayCountryDesc[i]);
				
				
				strLabel2=arrayCountryDesc[i];
				lngThisNodesItemID=arrayCountryISOCode[i];		
				fooOption = new Option(strLabel2, lngThisNodesItemID);
				
				//objSelect.options[i+1]=fooOption;
				objSelect.options.add(fooOption,-1);
					
				
						if (lngThisNodesItemID==''){
							fooOption.selected=true;
						}
				}
	
			//we have a single element so don't show the 'Please select' option
			if (i==1){
				objSelect.options[0]=null;
				}
		} 
	
	 function getAreas(strCountryID){
	
		  try{
			getAirports(strCountryID);  
		  	}
		  catch(e){}
	
		  // clear and repop the property types
		 	getPropertyTypesByCountry(strCountryID);
	
		 //wipe the area options, we are changing country, note: this also clears and repops the sub-area options
			clearAreas();
			objSelect=document.getElementById('eurocottagesRegion');
					
		 //walk the arrays adding the OPTION values
			for (i = 0; i < arrayAreaCodeID2.length; i++){
				if (strCountryID==arrayCountryCodeID[i]){
					
						strIndent="";
						if (arrayAreaType[i] !=1){strIndent="  ";}
						
						strLabel2=strIndent + arrayAreaDescription[i];
								
					lngThisNodesItemID=arrayAreaCodeID2[i];
					fooOption = new Option(strLabel2, lngThisNodesItemID);
							
					objSelect.options.add(fooOption,-1);
					//objSelect.options[i+1]=fooOption;
					}
				}
				
			//we have a single element so don't show the 'Please select' option
			if (i==1){
				objSelect.options[0]=null;
				}
		} 
	
	
	 
	
	
	
	function getPropertyTypesByCountry(strCountryID){
	
		//wipe the SELECT OPTIONS to avoid dupes
		objSelect=document.mbQuickSearch.propertyType;
		
		try{
			lngSELECTLength=objSelect.options.length;
				for (i = 0; i <= lngSELECTLength; i++){
					objSelect.options[lngSELECTLength-i]=null;
					}
			}
		catch(e){
			var foo=foo;
			}
	
		//property type arrays
		arrPropertyName=			new Array();
		arrPropertyValue=			new Array();
	
			
		//ILL integration
	
	arrPropertyNameFR=new Array('Cottage');
	arrPropertyValueFR=new Array('C');
	if(strCountryID=='FR'){arrPropertyName=arrPropertyNameFR;arrPropertyValue=arrPropertyValueFR;}
	
	arrPropertyNameIT=new Array('Cottage');
	arrPropertyValueIT=new Array('C');
	if(strCountryID=='IT'){arrPropertyName=arrPropertyNameIT;arrPropertyValue=arrPropertyValueIT;}
	
	arrPropertyNameES=new Array('Cottage');
	arrPropertyValueES=new Array('C');
	if(strCountryID=='ES'){arrPropertyName=arrPropertyNameES;arrPropertyValue=arrPropertyValueES;}
	
	arrPropertyNamePT=new Array('Cottage');
	arrPropertyValuePT=new Array('C');
	if(strCountryID=='PT'){arrPropertyName=arrPropertyNamePT;arrPropertyValue=arrPropertyValuePT;}
			
	try{
	 	//walk the arrays adding the OPTION values
		fooOption = new Option('Property type',-99);
		objSelect.options.add(fooOption,-1);
		
		for (i = 0; i < arrPropertyName.length; i++){
			strLabel=arrPropertyName[i];
			lngThisNodesItemID=arrPropertyValue[i];		
			fooOption = new Option(strLabel, lngThisNodesItemID);
			objSelect.options.add(fooOption,-1);
			}
		
		if (i==1){objSelect.selectedIndex=1;}
		}
	catch(e){
		var foo=foo;
		}
	}
	
	
	function getAirports(strCountryID){
			
	//alert("-==AIRPORT==-");		
		//wipe the airport options, we are changing country
		clearAirports();
		objSelect=document.mbCitySearch.cityD1;
		
	 	//walk the arrays adding the OPTION values
		for (i = 0; i < arrAirportName.length; i++){
			if (strCountryID==arrAirportCountryCode[i]){	
				fooOption = new Option(arrAirportName[i],arrAirportValue[i]);
				objSelect.options.add(fooOption,-1);
				}
			}			
	}
	
	function clearAirports(){
		//wipe the SELECT OPTIONS to avoid dupes
		objSelect=document.mbCitySearch.cityD1;
		lngSELECTLength=objSelect.options.length;
		for (i = 0; i <= lngSELECTLength; i++){
			objSelect.options[lngSELECTLength-i]=null;
			}
		 //add the control's title option, used to force a user selection
		strLabel2='Airport destination';
		lngThisNodesItemID=-99;
		fooOption = new Option(strLabel2, lngThisNodesItemID);
		objSelect.options.add(fooOption,-1);
		//we have a single element so don't show the 'Please select' option
		if (i==1){
			objSelect.options[0]=null;
			}	
	}
	
	function clearAreas(){
		
		//wipe the SELECT OPTIONS to avoid dupes
		objSelect=document.getElementById('eurocottagesRegion');
		lngSELECTLength=objSelect.options.length;
		for (i = 0; i <= lngSELECTLength; i++){
			objSelect.options[lngSELECTLength-i]=null;
			}
	
		 //add the control's title option, used to force a user selection
		strLabel2='All Regions';
		lngThisNodesItemID=-99;
		fooOption = new Option(strLabel2, lngThisNodesItemID);
		objSelect.options.add(fooOption,-1);
	}
	
	function preSubmit(){
		var strError='';
	
		if (document.getElementById('iso_country_code').value=='-99'){strError+='Country \n';}
		
		if (document.getElementById('eurocottagesPeople').selectedIndex==0){strError+='Number in party \n';}
		
		if (strError !=''){
			alert('The following details must be submitted. \n\n' + strError);
		}
	}
	
	function setETTDay()
	{
		var xF = document.forms['quickbooking'];
		var Tag = Number(getListValue( xF.ETADay ));
		var Monat = Number(getListValue( xF.ETAMonth ));
		var Jahr = Number(getListValue( xF.ETAYear ));
		var xDiff1= 1
		var xDiff2= 3
		var Diff = xDiff2 - xDiff1;
		var Stop = 31;
	   if(Monat==4 ||Monat==6 || Monat==9 || Monat==11 )
	   {
	       --Stop;
	       xxx = "monat = 4,6,9,oder 11";
	   }
	   if(Monat==2)
	{
	 Stop =28;
	 xxx = "monat = 2";
	 if(Jahr%4==0) Stop++;
	 if(Jahr%100==0) Stop--;
	 if(Jahr%400==0) Stop++;
	}
	if ((Tag + Diff) > Stop)
	{
	    if (Monat == 12)
	    {
	       var  xMonat = 1;
	        var xTag =  Tag + Diff - Stop;
	        var xJahr = Jahr+1;
	    }
	    else
	    {
	      var xMonat = Monat+1;
	      var xTag =  Tag + Diff - Stop;
	      var xJahr = Jahr;
	    }
	}
	else
	{
	        xMonat = Monat;
	        xTag = Tag + Diff;
	        xJahr = Jahr;
	}
	xF.ETTDay.selectedIndex = xTag-1;
	xF.ETTMonth.selectedIndex = xMonat-1;
	xF.ETTYear.selectedIndex = getYr( xJahr);
	}
	
	function submitThisForm(){
		var val=document.getElementById("carhireMembers").value;	
	}
	
	
	
	function getListValue( option_object  ){
	  return option_object[ option_object.selectedIndex ].value;
	}
	function setListValue( option_object, value  ){
	  option_object.selectedIndex = value;
	}

	function getYr(iYear)
	{
	xF = document.forms['quickbooking'];
	var TargetElement = xF.ETAYear;
	      for( i=0; i < TargetElement.length; i++)
	        {
	            if( TargetElement[i].value == iYear)
	            {
	                var YearIndex= i;
	             }     
	         }
	  return YearIndex;
	}

	function setETTDay()
	{
		var xF = document.forms['quickbooking'];
		var Tag = Number(getListValue( xF.ETADay ));
		var Monat = Number(getListValue( xF.ETAMonth ));
		var Jahr = Number(getListValue( xF.ETAYear ));
		var xDiff1= 1
		var xDiff2= 3
		var Diff = xDiff2 - xDiff1;
		var Stop = 31;
	   if(Monat==4 ||Monat==6 || Monat==9 || Monat==11 )
	   {
	       --Stop;
	       xxx = "monat = 4,6,9,oder 11";
	   }
	   if(Monat==2)
	{
	 Stop =28;
	 xxx = "monat = 2";
	 if(Jahr%4==0) Stop++;
	 if(Jahr%100==0) Stop--;
	 if(Jahr%400==0) Stop++;
	}
	if ((Tag + Diff) > Stop)
	{
	    if (Monat == 12)
	    {
	       var  xMonat = 1;
	        var xTag =  Tag + Diff - Stop;
	        var xJahr = Jahr+1;
	    }
	    else
	    {
	      var xMonat = Monat+1;
	      var xTag =  Tag + Diff - Stop;
	      var xJahr = Jahr;
	    }
	}
	else
	{
	        xMonat = Monat;
	        xTag = Tag + Diff;
	        xJahr = Jahr;
	}
	xF.ETTDay.selectedIndex = xTag-1;
	xF.ETTMonth.selectedIndex = xMonat-1;
	xF.ETTYear.selectedIndex = getYr( xJahr);
	}


	function submitMembers(){
		var AAMemNo = document.getElementById("AAMemNo").value;							//AA membership No
		
		if(AAMemNo.substr(0,6) != "635601" || AAMemNo.length != 16){					//Validate
		
			if(AAMemNo.length != 16){
				alert("The AA Membership number you entered appears to be incorrect.\n\nPlease try re-entering your number or click the 'non-member quote' button");
			}else{
				alert("The AA Membership number you entered appears to be incorrect.\n\nPlease try re-entering your number or click the 'non-member quote' button");
			}
			document.getElementById("AAMemNo").select();								//select for re-editing
			
		}else{
			var cciNo = AAMemNo.substr(6,AAMemNo.length);
			var serverPath = "http://www.avis.co.uk/avisonline/gb";						//Server & path
			var scrpt = "/IBE.nsf/Prefill?OpenAgent&ResStep=";							//script
			
			//var serverPath = "http://clkuk.tradedoubler.com/";						//Server & path
			//var scrpt = "click?p=23745&a=1141519&g=16262036&OpenAgent&ResStep=";	
			
			var frmStp = "ReservationStep1&OpenForm&";									//reservationStep1
			var mst = "MST=77D12E26EC35CEDFC12570F2005F57EB"; 							//AA microsite
			if(document.getElementById("airportcode").value != ""){
				var country = "";
				var STA = "&STA="+document.getElementById("airportcode").value.toUpperCase();
				var ILC = "&ILC="+document.getElementById("airportcode").value.toUpperCase();
			}else{
				var country = "&Country="+document.getElementById("carCountry").value;			//Country of rental
				var STA = "";
				var ILC = "";
			}
			var CCI = "&CCI="+cciNo;													//CCI No
			var ETA = "&ETA="+document.getElementById("ETADay").value;
			if(document.getElementById("ETAMonth").value == "01"){
				ETA += "jan";
			}else if(document.getElementById("ETAMonth").value == "02"){
				ETA += "feb";
			}else if(document.getElementById("ETAMonth").value == "03"){
				ETA += "mar";
			}else if(document.getElementById("ETAMonth").value == "04"){
				ETA += "apr";
			}else if(document.getElementById("ETAMonth").value == "05"){
				ETA += "may";
			}else if(document.getElementById("ETAMonth").value == "06"){
				ETA += "jun";
			}else if(document.getElementById("ETAMonth").value == "07"){
				ETA += "jul";
			}else if(document.getElementById("ETAMonth").value == "08"){
				ETA += "aug";
			}else if(document.getElementById("ETAMonth").value == "09"){
				ETA += "sep";
			}else if(document.getElementById("ETAMonth").value == "10"){
				ETA += "oct";
			}else if(document.getElementById("ETAMonth").value == "11"){
				ETA += "nov";
			}else if(document.getElementById("ETAMonth").value == "12"){
				ETA += "dec";
			}
				//ETA += document.getElementById("ETAMonth").value;
				ETA += document.getElementById("ETAYear").value+"/";
				ETA += document.getElementById("ETAHour").value;
				ETA += document.getElementById("ETAMinute").value;
			var ETT = "&ETT="+document.getElementById("ETTDay").value;
			if(document.getElementById("ETTMonth").value == "01"){
				ETT += "jan";
			}else if(document.getElementById("ETTMonth").value == "02"){
				ETT += "feb";
			}else if(document.getElementById("ETTMonth").value == "03"){
				ETT += "mar";
			}else if(document.getElementById("ETTMonth").value == "04"){
				ETT += "apr";
			}else if(document.getElementById("ETTMonth").value == "05"){
				ETT += "may";
			}else if(document.getElementById("ETTMonth").value == "06"){
				ETT += "jun";
			}else if(document.getElementById("ETTMonth").value == "07"){
				ETT += "jul";
			}else if(document.getElementById("ETTMonth").value == "08"){
				ETT += "aug";
			}else if(document.getElementById("ETTMonth").value == "09"){
				ETT += "sep";
			}else if(document.getElementById("ETTMonth").value == "10"){
				ETT += "oct";
			}else if(document.getElementById("ETTMonth").value == "11"){
				ETT += "nov";
			}else if(document.getElementById("ETTMonth").value == "12"){
				ETT += "dec";
			}
				//ETT += document.getElementById("ETTMonth").value;
				ETT += document.getElementById("ETTYear").value+"/";
				ETT += document.getElementById("ETTHour").value;
				ETT += document.getElementById("ETTMinute").value;
			var preFillParams = country+STA+ILC+CCI+ETA+ETT;									//cost control unit
			var newLocation = serverPath+scrpt+frmStp+mst+preFillParams;
			var browserName=navigator.appName; 
			var browserVer=parseInt(navigator.appVersion);		
			window.location.href = newLocation;			
			
		}
			
			
	}

	var partnerId ='8068';
	var s_cookieDomainPeriods=document.location.href.indexOf('www')>-1?2:3;
	var s_account='lastminenGB';
	var s_server='';
	  var s_channel='Category Homepage';
	sectionIndexLocation = '';
	var s_pageName = 'Hotels: hotels' + sectionIndexLocation;
	var s_pageType='';
	var s_prop2='';
	var s_eVar4='Hotels';
	var s_prop3='zcp: hotels/homepage_greatgetaways';
	var s_eVar3=s_prop3;
	var s_prop4=s_eVar4;
	s_products = s_prop4+';dummy_'+s_prop4+'_product_IGNORE';
	var s_prop5='';
	var s_prop20='505050,606060,9780';
	var formID;
	
	function submitOnClick(e){e=window.attachEvent?window.event:null;var s_objectID=s_pageName+'_form_'+formID;}
	function get_s_objectIDs(){if(document.getElementsByTagName){for(formID=0;formID<document.forms.length;formID++){inputTags=document.forms[formID].getElementsByTagName('input');for (i=0;i<inputTags.length;i++){tag=inputTags.item(i);if ((tag.type == 'image')||(tag.type=='submit')){if(window.addEventListener){tag.addEventListener("click",submitOnClick,false);tag.addEventListener("keypress",submitOnClick,false);}else if (window.attachEvent){tag.attachEvent("onClick", submitOnClick);tag.attachEvent("onKeyPress", submitOnClick);}}}}}}
	
	
  
    function setStyleById(id, styleName) {
              var n = document.getElementById(id);
              n.className = styleName;
              n.setAttribute('class', styleName);
    }
    //setStyleById('Ferrytickets', 'active');
    
    function init() {
    	  xF = document.forms['quickbooking'];
    	  
    	  //months
    	  //months
    	  var today = new Date();
    	  var month = today.getMonth();
    	  var date = today.getDate() +14;
    	  var bdate = today.getDate() +16 ;
    	  
    	  setListValue( xF.ETAHour, 9 )
    	  if (date > "32"){
    	  setListValue( xF.ETAMonth, month +1  )
    	  setListValue( xF.ETADay, date-31 )
    	  }
    	  else if (date < "32"){
    	  setListValue( xF.ETAMonth, month  )
    	  setListValue( xF.ETADay, date-1 )
    	  }
    	  
    	  setListValue( xF.ETAYear, 0 )
    	  setListValue( xF.ETTHour, 9 )
    	   if (bdate > "32"){
    	  setListValue( xF.ETTMonth, month +1  )
    	  setListValue( xF.ETTDay, bdate-31 )
    	  }
    	   else if (bdate < "32"){
    	  setListValue( xF.ETTMonth, month  )
    	    setListValue( xF.ETTDay, bdate-1 )
    	  }
    	  setListValue( xF.ETTYear, 0 )
     
    	var xMonths = new Array( 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' );
    	var xSep='%';
    	var xCountry ="";
    	var xETA  ="";
    	var xETT ="";
    	var xAirportCode ="";
    	var xWizardNumber ="";
    	var xName ="";
    	var xCountryOfResidence="";
    	var xIATA ="";

    }

 	

	//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	//document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	
	//var pageTracker = _gat._getTracker("UA-5570336-1");
	//pageTracker._trackPageview();

	function changeLocation() {
		//alert("Current location = " + window.location.href);
		var loc="http://www.avis.co.uk/avisonline/gb/IBE.nsf/Prefill?OpenAgent&ResStep=ReservationStep1&OpenForm&MST=515AEECC0BB13B9CC12570F400468944&Country=IT2&ETA=25feb09/0000&ETT=13Mar09/0000";
		window.location.href =loc ;
		//alert("Current location = " + window.location.href);
	}

	function submitNonMembers(){
	var serverPath = "http://www.avis.co.uk/avisonline/gb";						//Server & path
	var scrpt = "/IBE.nsf/Prefill?OpenAgent&ResStep=";							//script
	var frmStp = "ReservationStep1&OpenForm&";									//reservationStep1
	var mst = "MST=515AEECC0BB13B9CC12570F400468944"; 							//AA non-members microsite
	if(document.getElementById("airportcode").value != ""){
		var country = "";
		var STA = "&STA="+document.getElementById("airportcode").value.toUpperCase();
		var ILC = "&ILC="+document.getElementById("airportcode").value.toUpperCase();
	}else{
		var country = "&Country="+document.getElementById("carCountry").value;			//Country of rental
		var STA = "";
		var ILC = "";
	}
	var ETA = "&ETA="+document.getElementById("ETADay").value;
	var val1= document.getElementById("ETAMonth").value;			
	
	if(document.getElementById("ETAMonth").value == "01"){
		ETA += "jan";
	}else if(document.getElementById("ETAMonth").value == "02"){
		ETA += "feb";
	}else if(document.getElementById("ETAMonth").value == "03"){
		ETA += "mar";
	}else if(document.getElementById("ETAMonth").value == "04"){
		ETA += "apr";
	}else if(document.getElementById("ETAMonth").value == "05"){
		ETA += "may";
	}else if(document.getElementById("ETAMonth").value == "06"){
		ETA += "jun";
	}else if(document.getElementById("ETAMonth").value == "07"){
		ETA += "jul";
	}else if(document.getElementById("ETAMonth").value == "08"){
		ETA += "aug";
	}else if(document.getElementById("ETAMonth").value == "09"){
		ETA += "sep";
	}else if(document.getElementById("ETAMonth").value == "10"){
		ETA += "oct";
	}else if(document.getElementById("ETAMonth").value == "11"){
		ETA += "nov";
	}else if(document.getElementById("ETAMonth").value == "12"){
		ETA += "dec";
	}

		//ETA += document.getElementById("ETAMonth").value;
		ETA += document.getElementById("ETAYear").value+"/";
		ETA += document.getElementById("ETAHour").value;
		ETA += document.getElementById("ETAMinute").value;
	
	var ETT = "&ETT="+document.getElementById("ETTDay").value;

	var val= document.getElementById("ETTMonth").value;		
	
	if(document.getElementById("ETTMonth").value == "01"){
		ETT += "jan";
	}else if(document.getElementById("ETTMonth").value == "02"){
		ETT += "feb";
	}else if(document.getElementById("ETTMonth").value == "03"){
		ETT += "mar";
	}else if(document.getElementById("ETTMonth").value == "04"){
		ETT += "apr";
	}else if(document.getElementById("ETTMonth").value == "05"){
		ETT += "may";
	}else if(document.getElementById("ETTMonth").value == "06"){
		ETT += "jun";
	}else if(document.getElementById("ETTMonth").value == "07"){
		ETT += "jul";
	}else if(document.getElementById("ETTMonth").value == "08"){
		ETT += "aug";
	}else if(document.getElementById("ETTMonth").value == "09"){
		ETT += "sep";
	}else if(document.getElementById("ETTMonth").value == "10"){
		ETT += "oct";
	}else if(document.getElementById("ETTMonth").value == "11"){
		ETT += "nov";
	}else if(document.getElementById("ETTMonth").value == "12"){
		ETT += "dec";
	}

		//ETT += document.getElementById("ETTMonth").value;
		ETT += document.getElementById("ETTYear").value+"/";
		ETT += document.getElementById("ETTHour").value;
		ETT += document.getElementById("ETTMinute").value;

		var preFillParams = country+STA+ILC+ETA+ETT;
		var newLocation=serverPath+scrpt+frmStp+mst+preFillParams;
		var browserName=navigator.appName; 
		var browserVer=parseInt(navigator.appVersion);	
		window.location.href = newLocation;
		
	}
	

	function formGroupString(thisForm) {
		var optionString = "";

		var checkBoxList = thisForm.locationChecks;

		//pass in these as the default
		optionString = "112|113";
		for (var i=0;i<checkBoxList.length;i++) {
			if(checkBoxList[i].checked==true) {
				optionString += '|';
				optionString += checkBoxList[i].value;
			}
		}
		thisForm.searchoptions.value = optionString;
		thisForm.submit();
	}

    function toggleDiv(t){                  
          if((t=='d1')||(t=='')){                     
          	document.getElementById('eurostarForm').style.visibility = 'visible';
          	document.getElementById('breaksbycarForm').style.visibility = 'hidden';
          }else{                        
          	document.getElementById('eurostarForm').style.visibility = 'hidden';
          	document.getElementById('breaksbycarForm').style.visibility = 'visible';
          }  
     }   
    
	var unanimis_zone="tr_pl_stay";
	var unanimis_kv='';
	document.write(
					'<scr'+'ipt type="text/javascript" src="http://d.unanimis.co.uk/TAA/TAA-Header.js?d='
					+(new Date()).getFullYear()+(new Date()).getMonth()+(new Date()).getDate()+'"></scr'+'ipt>'
				  );



	function addOption(selectbox,text,value ){
		var optn = document.createElement("OPTION");
		optn.text = text;
		optn.value = value;
		selectbox.options.add(optn);
	}

	function populatecombo(t){
		document.getElementById('miniSearch').name="miniSearch1";
		document.getElementById('destination').length = 0;
		document.getElementById('departure').length = 0;		
		var dest = new Array(); 
		var destVal = new Array();
		var orig = new Array(); 
		var origVal = new Array(); 
		if((t=='euroStar')||(t=='')){ 
			orig = new Array("London St Pancras (Eurostar)",
							 "Ebbsfleet Kent (Eurostar)",
							 "Ashford Kent (Eurostar)",
							 "Accommodation-only");
			 
			origVal = new Array("SPX,TR,TO,London St Pancras (Eurostar)",
								"EBF,TR,TO,Ebbsfleet Kent (Eurostar)",
								"ASI,TR,TO,Ashford Kent (Eurostar)",
								"Accommodation-only,SE,BR,Accommodation-only");
						
			dest = new Array("Brussels","Paris","Lille","Liege","Bruges","Ghent","Antwer"); 
			destVal = new Array("RESBRX,RE,TO,Brussels","RESPAR,RE,TO,Paris","RESLIL,RE,TO,Lille",
								"RESLIE,RE,TO,Liege","RESBGU,RE,TO,Bruges","RESGHE,RE,TO,Ghent",
								"RESANT,RE,TO,Antwerp");
			
	      }else{
	    	  document.getElementById('miniSearch').name="miniSearch2"; 
	    	  
	    	orig = new Array("Folkestone (Eurotunnel)","Dover (Ferries)"); 
	    	origVal = new Array("FOT,PO,TO,Folkestone (Eurotunnel)","DOVE,PO,TO,Dover (Ferries)");
	                  
	    	dest = new Array(
	            			 "St. Omer",
			               	 "Bruges",
			               	 "Montreuil sur Mer",
			               	 "Lille",
			               	 "Arras",
			               	 "Calais",
			               	 "Le Touquet",
	    					 "Honfleur",
	    					 "Chantilly",
	    					 "Cambrai",
	    					 "Ghent"
	    					 ); 
	
	    	destVal = new Array(
	            				"RESSTOMER,RE,TO,St. Omer",
			                	"RESBGU,RE,TO,Bruges",
			                	"RESMONTREUIL,RE,TO,Montreuil sur Mer",
			        			"RESLIL,RE,TO,Lille",
			        			"RESARRAS,RE,TO,Arras",
			        			"RESCAL,RE,TO,Calais",
			        			"RESLTQ,RE,TO,Le Touquet",
			        			"RESHONFLEUR,RE,TO,Honfleur",
	    						"RESCHA,RE,TO,Chantilly",
	    						"RESCAMBRAI,RE,TO,Cambrai",
	    						"RESGHE,RE,TO,Ghent"
	    						);
	    				
	    	  
	      }
			for (var i=0; i < dest.length;++i){
				addOption(document.miniSearchForm.Search_Destination, dest[i], destVal[i]);
			}
	
			for (var i=0; i < orig.length;++i){
				addOption(document.miniSearchForm.Origin, orig[i], origVal[i]);
			}
	
	}

	function hideFerryDiv(){ 
		tag = document.getElementsByTagName("div"); 
		for(x=0;x<tag.length; x++){ 
			
			if(tag[x].getAttribute('id')!=null && tag[x].getAttribute('id').indexOf("ferry_") != -1){ 
				tag[x].style.display = "none"; 
			} 
		} 
	} 
	
	function viewFerry(id){ 
	ge = document.getElementById('ferry_' + id.value); 
	hideFerryDiv(); 
	ge.style.display = "block"; 
	} 
	
	function hideParkingDiv(){ 
	tag = document.getElementsByTagName("div"); 
		for(x=0;x<tag.length; x++){ 
			if(tag[x].getAttribute('id').indexOf("parking_") != -1){ 
				tag[x].style.display = "none"; 
			} 
		} 
	}
