/*********************************************
* change the main thumbnails when the mini thumbs are pressed
*********************************************/	
function showThumb(thumbID) {
	
	// Make sure there is an image to show first as we might not have one if this is a product specific dropdown
	if($("#mainThumb"+thumbID).attr('href') != null) {
	
		// Hide all of them
		$(".mainThumb").attr({ 
						style: "display:none"
					});
		
		$(".mainThumbLink").attr({ 
					style: "display:none"
				});
	
		
		// Show the ones we want
		$("#mainThumb"+thumbID).attr({ 
						style: "display:block"
					});
	
		$("#mainThumbLink"+thumbID).attr({ 
						style: "display:block"
					});
		
	}
	
}


/*********************************************
* switch the registration form beween individuals and companies
*********************************************/	
function changeRegForm(selectField) {

	var typeReg = selectField.options[selectField.selectedIndex].value;
	
	var scriptAction = document.getElementById('scriptAction');
	
	var indivForm = document.getElementById('indivRegForm');
	var compRegForm = document.getElementById('compRegForm');
	
	indivForm.style.display = 'none';
	compRegForm.style.display = 'none';
	
	if(typeReg == 'Company') {
		compRegForm.style.display = 'block';
		scriptAction.value = 'Approval';
	}
	else if (typeReg == 'Individual') {
		indivForm.style.display = 'block';
		scriptAction.value = 'Register';
	}
	
}

/*********************************************
* state/county based on country change scripts
*********************************************/	
	
	function loadvalues()
	{

		allCountries = Array('CA','GB','US');

		stateName =  Array();
		stateVal = Array();

		stateName['NA'] = Array();
		stateVal['NA'] = Array();
		stateName['NA'][0] = "Other";
		stateVal['NA'][0] = "";

		stateName['GB'] = Array();
		stateVal['GB'] = Array();
		stateName['GB'][-1] = "Please Select...";
		stateVal['GB'][-1] = "";

		stateName['CUST-EN'] = Array();
		stateVal['CUST-EN'] = Array();
		stateName['CUST-EN'][-1] = "Please Select...";
		stateVal['CUST-EN'][-1] = "";

		stateName['CUST-NI'] = Array();
		stateVal['CUST-NI'] = Array();
		stateName['CUST-NI'][-1] = "Please Select...";
		stateVal['CUST-NI'][-1] = "";

		stateName['CUST-SC'] = Array();
		stateVal['CUST-SC'] = Array();
		stateName['CUST-SC'][-1] = "Please Select...";
		stateVal['CUST-SC'][-1] = "";

		stateName['CUST-WA'] = Array();
		stateVal['CUST-WA'] = Array();
		stateName['CUST-WA'][-1] = "Please Select...";
		stateVal['CUST-WA'][-1] = "";

		stateName['CA'] = Array();
		stateVal['CA'] = Array();
		stateName['CA'][-1] = "Please Select...";
		stateVal['CA'][-1] = "";

		stateName['US'] = Array();
		stateVal['US'] = Array();
		stateName['US'][-1] = "Please Select...";
		stateVal['US'][-1] = "";


		stateName['CA'][0] = "Alberta"
		stateVal['CA'][0] = "Alberta"
		stateName['CA'][1] = "British Columbia"
		stateVal['CA'][1] = "British Columbia"
		stateName['CA'][2] = "Manitoba"
		stateVal['CA'][2] = "Manitoba"
		stateName['CA'][3] = "Newfoundland"
		stateVal['CA'][3] = "Newfoundland"
		stateName['CA'][4] = "Northwest Territory"
		stateVal['CA'][4] = "Northwest Territory"
		stateName['CA'][5] = "Nova Scotia"
		stateVal['CA'][5] = "Nova Scotia"
		stateName['CA'][6] = "Nunavut Territory"
		stateVal['CA'][6] = "Nunavut Territory"
		stateName['CA'][7] = "Ontario"
		stateVal['CA'][7] = "Ontario"
		stateName['CA'][8] = "Prince Edward Island"
		stateVal['CA'][8] = "Prince Edward Island"
		stateName['CA'][9] = "Quebec"
		stateVal['CA'][9] = "Quebec"
		stateName['CA'][10] = "Saskatchewan"
		stateVal['CA'][10] = "Saskatchewan"
		stateName['CA'][11] = "Yukon Territory"
		stateVal['CA'][11] = "Yukon Territory"

		stateName['CUST-EN'][0] = "Tyne and Wear"
		stateVal['CUST-EN'][0] = "Tyne and Wear"
		stateName['CUST-EN'][1] = "Warwickshire"
		stateVal['CUST-EN'][1] = "Warwickshire"
		stateName['CUST-EN'][2] = "Westmorland"
		stateVal['CUST-EN'][2] = "Westmorland"
		stateName['CUST-EN'][3] = "Wiltshire"
		stateVal['CUST-EN'][3] = "Wiltshire"
		stateName['CUST-EN'][4] = "Worcestershire"
		stateVal['CUST-EN'][4] = "Worcestershire"
		stateName['CUST-EN'][5] = "Yorkshire"
		stateVal['CUST-EN'][5] = "Yorkshire"
		stateName['CUST-EN'][6] = "Buckinghamshire"
		stateVal['CUST-EN'][6] = "Buckinghamshire"
		stateName['CUST-EN'][7] = "Cambridgeshire"
		stateVal['CUST-EN'][7] = "Cambridgeshire"
		stateName['CUST-EN'][8] = "Channel Isles"
		stateVal['CUST-EN'][8] = "Channel Isles"
		stateName['CUST-EN'][9] = "Cheshire"
		stateVal['CUST-EN'][9] = "Cheshire"
		stateName['CUST-EN'][10] = "Cornwall"
		stateVal['CUST-EN'][10] = "Cornwall"
		stateName['CUST-EN'][11] = "County Durham"
		stateVal['CUST-EN'][11] = "County Durham"
		stateName['CUST-EN'][12] = "Cumbria"
		stateVal['CUST-EN'][12] = "Cumbria"
		stateName['CUST-EN'][13] = "Derbyshire"
		stateVal['CUST-EN'][13] = "Derbyshire"
		stateName['CUST-EN'][14] = "Devon"
		stateVal['CUST-EN'][14] = "Devon"
		stateName['CUST-EN'][15] = "Dorset"
		stateVal['CUST-EN'][15] = "Dorset"
		stateName['CUST-EN'][16] = "East Sussex"
		stateVal['CUST-EN'][16] = "East Sussex"
		stateName['CUST-EN'][17] = "Essex"
		stateVal['CUST-EN'][17] = "Essex"
		stateName['CUST-EN'][18] = "Gloucestershire"
		stateVal['CUST-EN'][18] = "Gloucestershire"
		stateName['CUST-EN'][19] = "Greater London"
		stateVal['CUST-EN'][19] = "Greater London"
		stateName['CUST-EN'][20] = "Greater Manchester"
		stateVal['CUST-EN'][20] = "Greater Manchester"
		stateName['CUST-EN'][21] = "Hampshire"
		stateVal['CUST-EN'][21] = "Hampshire"
		stateName['CUST-EN'][22] = "Herefordshire"
		stateVal['CUST-EN'][22] = "Herefordshire"
		stateName['CUST-EN'][23] = "Hertfordshire"
		stateVal['CUST-EN'][23] = "Hertfordshire"
		stateName['CUST-EN'][24] = "Huntingdonshire"
		stateVal['CUST-EN'][24] = "Huntingdonshire"
		stateName['CUST-EN'][25] = "Avon"
		stateVal['CUST-EN'][25] = "Avon"
		stateName['CUST-EN'][26] = "Isle of Islay"
		stateVal['CUST-EN'][26] = "Isle of Islay"
		stateName['CUST-EN'][27] = "Isle of Lewis"
		stateVal['CUST-EN'][27] = "Isle of Lewis"
		stateName['CUST-EN'][28] = "Isle of Man"
		stateVal['CUST-EN'][28] = "Isle of Man"
		stateName['CUST-EN'][29] = "Isle of Skye"
		stateVal['CUST-EN'][29] = "Isle of Skye"
		stateName['CUST-EN'][30] = "Isle of Wight"
		stateVal['CUST-EN'][30] = "Isle of Wight"
		stateName['CUST-EN'][31] = "Isles of Scilly"
		stateVal['CUST-EN'][31] = "Isles of Scilly"
		stateName['CUST-EN'][32] = "Kent"
		stateVal['CUST-EN'][32] = "Kent"
		stateName['CUST-EN'][33] = "Lancashire"
		stateVal['CUST-EN'][33] = "Lancashire"
		stateName['CUST-EN'][34] = "Leicestershire"
		stateVal['CUST-EN'][34] = "Leicestershire"
		stateName['CUST-EN'][35] = "Lincolnshire"
		stateVal['CUST-EN'][35] = "Lincolnshire"
		stateName['CUST-EN'][36] = "London"
		stateVal['CUST-EN'][36] = "London"
		stateName['CUST-EN'][37] = "Merseyside"
		stateVal['CUST-EN'][37] = "Merseyside"
		stateName['CUST-EN'][38] = "Middlesex"
		stateVal['CUST-EN'][38] = "Middlesex"
		stateName['CUST-EN'][39] = "Norfolk"
		stateVal['CUST-EN'][39] = "Norfolk"
		stateName['CUST-EN'][40] = "North Yorkshire"
		stateVal['CUST-EN'][40] = "North Yorkshire"
		stateName['CUST-EN'][41] = "Northamptonshire"
		stateVal['CUST-EN'][41] = "Northamptonshire"
		stateName['CUST-EN'][42] = "Northumberland"
		stateVal['CUST-EN'][42] = "Northumberland"
		stateName['CUST-EN'][43] = "Nottinghamshire"
		stateVal['CUST-EN'][43] = "Nottinghamshire"
		stateName['CUST-EN'][44] = "Oxfordshire"
		stateVal['CUST-EN'][44] = "Oxfordshire"
		stateName['CUST-EN'][45] = "Bedfordshire"
		stateVal['CUST-EN'][45] = "Bedfordshire"
		stateName['CUST-EN'][46] = "Rutland"
		stateVal['CUST-EN'][46] = "Rutland"
		stateName['CUST-EN'][47] = "Berkshire"
		stateVal['CUST-EN'][47] = "Berkshire"
		stateName['CUST-EN'][48] = "Shropshire"
		stateVal['CUST-EN'][48] = "Shropshire"
		stateName['CUST-EN'][49] = "Somerset"
		stateVal['CUST-EN'][49] = "Somerset"
		stateName['CUST-EN'][50] = "South Yorkshire"
		stateVal['CUST-EN'][50] = "South Yorkshire"
		stateName['CUST-EN'][51] = "Staffordshire"
		stateVal['CUST-EN'][51] = "Staffordshire"
		stateName['CUST-EN'][52] = "Suffolk"
		stateVal['CUST-EN'][52] = "Suffolk"
		stateName['CUST-EN'][53] = "Surrey"
		stateVal['CUST-EN'][53] = "Surrey"
		stateName['CUST-EN'][54] = "Sussex"
		stateVal['CUST-EN'][54] = "Sussex"
		stateName['CUST-EN'][55] = "Tayside"
		stateVal['CUST-EN'][55] = "Tayside"
		stateName['CUST-NI'][0] = "County Antrim"
		stateVal['CUST-NI'][0] = "County Antrim"
		stateName['CUST-NI'][1] = "County Armagh"
		stateVal['CUST-NI'][1] = "County Armagh"
		stateName['CUST-NI'][2] = "County Down"
		stateVal['CUST-NI'][2] = "County Down"
		stateName['CUST-NI'][3] = "County Fermanagh"
		stateVal['CUST-NI'][3] = "County Fermanagh"
		stateName['CUST-NI'][4] = "County Londonderry"
		stateVal['CUST-NI'][4] = "County Londonderry"
		stateName['CUST-NI'][5] = "County Tyrone"
		stateVal['CUST-NI'][5] = "County Tyrone"
		stateName['CUST-SC'][0] = "Aberdeenshire"
		stateVal['CUST-SC'][0] = "Aberdeenshire"
		stateName['CUST-SC'][1] = "West Lothian"
		stateVal['CUST-SC'][1] = "West Lothian"
		stateName['CUST-SC'][2] = "Wigtownshire"
		stateVal['CUST-SC'][2] = "Wigtownshire"
		stateName['CUST-SC'][3] = "Buteshire"
		stateVal['CUST-SC'][3] = "Buteshire"
		stateName['CUST-SC'][4] = "Caithness"
		stateVal['CUST-SC'][4] = "Caithness"
		stateName['CUST-SC'][5] = "Clackmannanshire"
		stateVal['CUST-SC'][5] = "Clackmannanshire"
		stateName['CUST-SC'][6] = "Angus"
		stateVal['CUST-SC'][6] = "Angus"
		stateName['CUST-SC'][7] = "Dumfriesshire"
		stateVal['CUST-SC'][7] = "Dumfriesshire"
		stateName['CUST-SC'][8] = "Dunbartonshire"
		stateVal['CUST-SC'][8] = "Dunbartonshire"
		stateName['CUST-SC'][9] = "East Lothian"
		stateVal['CUST-SC'][9] = "East Lothian"
		stateName['CUST-SC'][10] = "Fife"
		stateVal['CUST-SC'][10] = "Fife"
		stateName['CUST-SC'][11] = "Argyllshire"
		stateVal['CUST-SC'][11] = "Argyllshire"
		stateName['CUST-SC'][12] = "Inverness-shire"
		stateVal['CUST-SC'][12] = "Inverness-shire"
		stateName['CUST-SC'][13] = "Kincardineshire"
		stateVal['CUST-SC'][13] = "Kincardineshire"
		stateName['CUST-SC'][14] = "Kinross-Shire"
		stateVal['CUST-SC'][14] = "Kinross-Shire"
		stateName['CUST-SC'][15] = "Kirkcudbrightshire"
		stateVal['CUST-SC'][15] = "Kirkcudbrightshire"
		stateName['CUST-SC'][16] = "Ayrshire"
		stateVal['CUST-SC'][16] = "Ayrshire"
		stateName['CUST-SC'][17] = "Lanarkshire"
		stateVal['CUST-SC'][17] = "Lanarkshire"
		stateName['CUST-SC'][18] = "Midlothian"
		stateVal['CUST-SC'][18] = "Midlothian"
		stateName['CUST-SC'][19] = "Banffshire"
		stateVal['CUST-SC'][19] = "Banffshire"
		stateName['CUST-SC'][20] = "Morayshire"
		stateVal['CUST-SC'][20] = "Morayshire"
		stateName['CUST-SC'][21] = "Nairnshire"
		stateVal['CUST-SC'][21] = "Nairnshire"
		stateName['CUST-SC'][22] = "Orkney"
		stateVal['CUST-SC'][22] = "Orkney"
		stateName['CUST-SC'][23] = "Peeblesshire"
		stateVal['CUST-SC'][23] = "Peeblesshire"
		stateName['CUST-SC'][24] = "Perthshire"
		stateVal['CUST-SC'][24] = "Perthshire"
		stateName['CUST-SC'][25] = "Renfrewshire"
		stateVal['CUST-SC'][25] = "Renfrewshire"
		stateName['CUST-SC'][26] = "Ross-shire"
		stateVal['CUST-SC'][26] = "Ross-shire"
		stateName['CUST-SC'][27] = "Roxburghshire"
		stateVal['CUST-SC'][27] = "Roxburghshire"
		stateName['CUST-SC'][28] = "Selkirkshire"
		stateVal['CUST-SC'][28] = "Selkirkshire"
		stateName['CUST-SC'][29] = "Shetland"
		stateVal['CUST-SC'][29] = "Shetland"
		stateName['CUST-SC'][30] = "Stirlingshire"
		stateVal['CUST-SC'][30] = "Stirlingshire"
		stateName['CUST-SC'][31] = "Sutherland"
		stateVal['CUST-SC'][31] = "Sutherland"
		stateName['CUST-SC'][32] = "Berwickshire"
		stateVal['CUST-SC'][32] = "Berwickshire"
		stateName['CUST-WA'][0] = "Brecknockshire"
		stateVal['CUST-WA'][0] = "Brecknockshire"
		stateName['CUST-WA'][1] = "Caernarfonshire"
		stateVal['CUST-WA'][1] = "Caernarfonshire"
		stateName['CUST-WA'][2] = "Cardiganshire"
		stateVal['CUST-WA'][2] = "Cardiganshire"
		stateName['CUST-WA'][3] = "Carmarthenshire"
		stateVal['CUST-WA'][3] = "Carmarthenshire"
		stateName['CUST-WA'][4] = "Anglesey"
		stateVal['CUST-WA'][4] = "Anglesey"
		stateName['CUST-WA'][5] = "Denbighshire"
		stateVal['CUST-WA'][5] = "Denbighshire"
		stateName['CUST-WA'][6] = "Flintshire"
		stateVal['CUST-WA'][6] = "Flintshire"
		stateName['CUST-WA'][7] = "Glamorgan"
		stateVal['CUST-WA'][7] = "Glamorgan"
		stateName['CUST-WA'][8] = "Merioneth"
		stateVal['CUST-WA'][8] = "Merioneth"
		stateName['CUST-WA'][9] = "Monmouthshire"
		stateVal['CUST-WA'][9] = "Monmouthshire"
		stateName['CUST-WA'][10] = "Montgomeryshire"
		stateVal['CUST-WA'][10] = "Montgomeryshire"
		stateName['CUST-WA'][11] = "Pembrokeshire"
		stateVal['CUST-WA'][11] = "Pembrokeshire"
		stateName['CUST-WA'][12] = "Radnorshire"
		stateVal['CUST-WA'][12] = "Radnorshire"

		stateName['GB'][0] = "Aberdeenshire"
		stateVal['GB'][0] = "Aberdeenshire"
		stateName['GB'][1] = "Anglesey"
		stateVal['GB'][1] = "Anglesey"
		stateName['GB'][2] = "Angus"
		stateVal['GB'][2] = "Angus"
		stateName['GB'][3] = "Argyllshire"
		stateVal['GB'][3] = "Argyllshire"
		stateName['GB'][4] = "Avon"
		stateVal['GB'][4] = "Avon"
		stateName['GB'][5] = "Ayrshire"
		stateVal['GB'][5] = "Ayrshire"
		stateName['GB'][6] = "Banffshire"
		stateVal['GB'][6] = "Banffshire"
		stateName['GB'][7] = "Bedfordshire"
		stateVal['GB'][7] = "Bedfordshire"
		stateName['GB'][8] = "Berkshire"
		stateVal['GB'][8] = "Berkshire"
		stateName['GB'][9] = "Berwickshire"
		stateVal['GB'][9] = "Berwickshire"
		stateName['GB'][10] = "Brecknockshire"
		stateVal['GB'][10] = "Brecknockshire"
		stateName['GB'][11] = "Buckinghamshire"
		stateVal['GB'][11] = "Buckinghamshire"
		stateName['GB'][12] = "Buteshire"
		stateVal['GB'][12] = "Buteshire"
		stateName['GB'][13] = "Caernarfonshire"
		stateVal['GB'][13] = "Caernarfonshire"
		stateName['GB'][14] = "Caithness"
		stateVal['GB'][14] = "Caithness"
		stateName['GB'][15] = "Cambridgeshire"
		stateVal['GB'][15] = "Cambridgeshire"
		stateName['GB'][16] = "Cardiganshire"
		stateVal['GB'][16] = "Cardiganshire"
		stateName['GB'][17] = "Carmarthenshire"
		stateVal['GB'][17] = "Carmarthenshire"
		stateName['GB'][18] = "Channel Isles"
		stateVal['GB'][18] = "Channel Isles"
		stateName['GB'][19] = "Cheshire"
		stateVal['GB'][19] = "Cheshire"
		stateName['GB'][20] = "Clackmannanshire"
		stateVal['GB'][20] = "Clackmannanshire"
		stateName['GB'][21] = "Cornwall"
		stateVal['GB'][21] = "Cornwall"
		stateName['GB'][22] = "County Antrim"
		stateVal['GB'][22] = "County Antrim"
		stateName['GB'][23] = "County Armagh"
		stateVal['GB'][23] = "County Armagh"
		stateName['GB'][24] = "County Down"
		stateVal['GB'][24] = "County Down"
		stateName['GB'][25] = "County Durham"
		stateVal['GB'][25] = "County Durham"
		stateName['GB'][26] = "County Fermanagh"
		stateVal['GB'][26] = "County Fermanagh"
		stateName['GB'][27] = "County Londonderry"
		stateVal['GB'][27] = "County Londonderry"
		stateName['GB'][28] = "County Tyrone"
		stateVal['GB'][28] = "County Tyrone"
		stateName['GB'][29] = "Cumbria"
		stateVal['GB'][29] = "Cumbria"
		stateName['GB'][30] = "Denbighshire"
		stateVal['GB'][30] = "Denbighshire"
		stateName['GB'][31] = "Derbyshire"
		stateVal['GB'][31] = "Derbyshire"
		stateName['GB'][32] = "Devon"
		stateVal['GB'][32] = "Devon"
		stateName['GB'][33] = "Dorset"
		stateVal['GB'][33] = "Dorset"
		stateName['GB'][34] = "Dumfriesshire"
		stateVal['GB'][34] = "Dumfriesshire"
		stateName['GB'][35] = "Dunbartonshire"
		stateVal['GB'][35] = "Dunbartonshire"
		stateName['GB'][36] = "East Lothian"
		stateVal['GB'][36] = "East Lothian"
		stateName['GB'][37] = "East Sussex"
		stateVal['GB'][37] = "East Sussex"
		stateName['GB'][38] = "Essex"
		stateVal['GB'][38] = "Essex"
		stateName['GB'][39] = "Fife"
		stateVal['GB'][39] = "Fife"
		stateName['GB'][40] = "Flintshire"
		stateVal['GB'][40] = "Flintshire"
		stateName['GB'][41] = "Glamorgan"
		stateVal['GB'][41] = "Glamorgan"
		stateName['GB'][42] = "Gloucestershire"
		stateVal['GB'][42] = "Gloucestershire"
		stateName['GB'][43] = "Greater London"
		stateVal['GB'][43] = "Greater London"
		stateName['GB'][44] = "Greater Manchester"
		stateVal['GB'][44] = "Greater Manchester"
		stateName['GB'][45] = "Hampshire"
		stateVal['GB'][45] = "Hampshire"
		stateName['GB'][46] = "Herefordshire"
		stateVal['GB'][46] = "Herefordshire"
		stateName['GB'][47] = "Hertfordshire"
		stateVal['GB'][47] = "Hertfordshire"
		stateName['GB'][48] = "Huntingdonshire"
		stateVal['GB'][48] = "Huntingdonshire"
		stateName['GB'][49] = "Inverness-shire"
		stateVal['GB'][49] = "Inverness-shire"
		stateName['GB'][50] = "Isle of Islay"
		stateVal['GB'][50] = "Isle of Islay"
		stateName['GB'][51] = "Isle of Lewis"
		stateVal['GB'][51] = "Isle of Lewis"
		stateName['GB'][52] = "Isle of Man"
		stateVal['GB'][52] = "Isle of Man"
		stateName['GB'][53] = "Isle of Skye"
		stateVal['GB'][53] = "Isle of Skye"
		stateName['GB'][54] = "Isle of Wight"
		stateVal['GB'][54] = "Isle of Wight"
		stateName['GB'][55] = "Isles of Scilly"
		stateVal['GB'][55] = "Isles of Scilly"
		stateName['GB'][56] = "Kent"
		stateVal['GB'][56] = "Kent"
		stateName['GB'][57] = "Kincardineshire"
		stateVal['GB'][57] = "Kincardineshire"
		stateName['GB'][58] = "Kinross-Shire"
		stateVal['GB'][58] = "Kinross-Shire"
		stateName['GB'][59] = "Kirkcudbrightshire"
		stateVal['GB'][59] = "Kirkcudbrightshire"
		stateName['GB'][60] = "Lanarkshire"
		stateVal['GB'][60] = "Lanarkshire"
		stateName['GB'][61] = "Lancashire"
		stateVal['GB'][61] = "Lancashire"
		stateName['GB'][62] = "Leicestershire"
		stateVal['GB'][62] = "Leicestershire"
		stateName['GB'][63] = "Lincolnshire"
		stateVal['GB'][63] = "Lincolnshire"
		stateName['GB'][64] = "London"
		stateVal['GB'][64] = "London"
		stateName['GB'][65] = "Merioneth"
		stateVal['GB'][65] = "Merioneth"
		stateName['GB'][66] = "Merseyside"
		stateVal['GB'][66] = "Merseyside"
		stateName['GB'][67] = "Middlesex"
		stateVal['GB'][67] = "Middlesex"
		stateName['GB'][68] = "Midlothian"
		stateVal['GB'][68] = "Midlothian"
		stateName['GB'][69] = "Monmouthshire"
		stateVal['GB'][69] = "Monmouthshire"
		stateName['GB'][70] = "Montgomeryshire"
		stateVal['GB'][70] = "Montgomeryshire"
		stateName['GB'][71] = "Morayshire"
		stateVal['GB'][71] = "Morayshire"
		stateName['GB'][72] = "Nairnshire"
		stateVal['GB'][72] = "Nairnshire"
		stateName['GB'][73] = "Norfolk"
		stateVal['GB'][73] = "Norfolk"
		stateName['GB'][74] = "North Yorkshire"
		stateVal['GB'][74] = "North Yorkshire"
		stateName['GB'][75] = "Northamptonshire"
		stateVal['GB'][75] = "Northamptonshire"
		stateName['GB'][76] = "Northumberland"
		stateVal['GB'][76] = "Northumberland"
		stateName['GB'][77] = "Nottinghamshire"
		stateVal['GB'][77] = "Nottinghamshire"
		stateName['GB'][78] = "Orkney"
		stateVal['GB'][78] = "Orkney"
		stateName['GB'][79] = "Oxfordshire"
		stateVal['GB'][79] = "Oxfordshire"
		stateName['GB'][80] = "Peeblesshire"
		stateVal['GB'][80] = "Peeblesshire"
		stateName['GB'][81] = "Pembrokeshire"
		stateVal['GB'][81] = "Pembrokeshire"
		stateName['GB'][82] = "Perthshire"
		stateVal['GB'][82] = "Perthshire"
		stateName['GB'][83] = "Radnorshire"
		stateVal['GB'][83] = "Radnorshire"
		stateName['GB'][84] = "Renfrewshire"
		stateVal['GB'][84] = "Renfrewshire"
		stateName['GB'][85] = "Ross-shire"
		stateVal['GB'][85] = "Ross-shire"
		stateName['GB'][86] = "Roxburghshire"
		stateVal['GB'][86] = "Roxburghshire"
		stateName['GB'][87] = "Rutland"
		stateVal['GB'][87] = "Rutland"
		stateName['GB'][88] = "Selkirkshire"
		stateVal['GB'][88] = "Selkirkshire"
		stateName['GB'][89] = "Shetland"
		stateVal['GB'][89] = "Shetland"
		stateName['GB'][90] = "Shropshire"
		stateVal['GB'][90] = "Shropshire"
		stateName['GB'][91] = "Somerset"
		stateVal['GB'][91] = "Somerset"
		stateName['GB'][92] = "South Yorkshire"
		stateVal['GB'][92] = "South Yorkshire"
		stateName['GB'][93] = "Staffordshire"
		stateVal['GB'][93] = "Staffordshire"
		stateName['GB'][94] = "Stirlingshire"
		stateVal['GB'][94] = "Stirlingshire"
		stateName['GB'][95] = "Suffolk"
		stateVal['GB'][95] = "Suffolk"
		stateName['GB'][96] = "Surrey"
		stateVal['GB'][96] = "Surrey"
		stateName['GB'][97] = "Sussex"
		stateVal['GB'][97] = "Sussex"
		stateName['GB'][98] = "Sutherland"
		stateVal['GB'][98] = "Sutherland"
		stateName['GB'][99] = "Tayside"
		stateVal['GB'][99] = "Tayside"
		stateName['GB'][100] = "Tyne and Wear"
		stateVal['GB'][100] = "Tyne and Wear"
		stateName['GB'][101] = "Warwickshire"
		stateVal['GB'][101] = "Warwickshire"
		stateName['GB'][102] = "West Lothian"
		stateVal['GB'][102] = "West Lothian"
		stateName['GB'][103] = "West Midlands"
		stateVal['GB'][103] = "West Midlands"
		stateName['GB'][104] = "Westmorland"
		stateVal['GB'][104] = "Westmorland"
		stateName['GB'][105] = "Wigtownshire"
		stateVal['GB'][105] = "Wigtownshire"
		stateName['GB'][106] = "Wiltshire"
		stateVal['GB'][106] = "Wiltshire"
		stateName['GB'][107] = "Worcestershire"
		stateVal['GB'][107] = "Worcestershire"
		stateName['GB'][108] = "Yorkshire"
		stateVal['GB'][108] = "Yorkshire"

		stateName['US'][0] = "AA (military)"
		stateVal['US'][0] = "AA (military)"
		stateName['US'][1] = "AE (military)"
		stateVal['US'][1] = "AE (military)"
		stateName['US'][2] = "Alabama"
		stateVal['US'][2] = "Alabama"
		stateName['US'][3] = "Alaska"
		stateVal['US'][3] = "Alaska"
		stateName['US'][4] = "AP (military)"
		stateVal['US'][4] = "AP (military)"
		stateName['US'][5] = "Arizona"
		stateVal['US'][5] = "Arizona"
		stateName['US'][6] = "Arkansas"
		stateVal['US'][6] = "Arkansas"
		stateName['US'][7] = "California"
		stateVal['US'][7] = "California"
		stateName['US'][8] = "Colorado"
		stateVal['US'][8] = "Colorado"
		stateName['US'][9] = "Connecticut"
		stateVal['US'][9] = "Connecticut"
		stateName['US'][10] = "Delaware"
		stateVal['US'][10] = "Delaware"
		stateName['US'][11] = "District of Columbia"
		stateVal['US'][11] = "District of Columbia"
		stateName['US'][12] = "Florida"
		stateVal['US'][12] = "Florida"
		stateName['US'][13] = "Georgia"
		stateVal['US'][13] = "Georgia"
		stateName['US'][14] = "Hawaii"
		stateVal['US'][14] = "Hawaii"
		stateName['US'][15] = "Idaho"
		stateVal['US'][15] = "Idaho"
		stateName['US'][16] = "Illinois"
		stateVal['US'][16] = "Illinois"
		stateName['US'][17] = "Indiana"
		stateVal['US'][17] = "Indiana"
		stateName['US'][18] = "Iowa"
		stateVal['US'][18] = "Iowa"
		stateName['US'][19] = "Kansas"
		stateVal['US'][19] = "Kansas"
		stateName['US'][20] = "Kentucky"
		stateVal['US'][20] = "Kentucky"
		stateName['US'][21] = "Louisiana"
		stateVal['US'][21] = "Louisiana"
		stateName['US'][22] = "Maine"
		stateVal['US'][22] = "Maine"
		stateName['US'][23] = "Maryland"
		stateVal['US'][23] = "Maryland"
		stateName['US'][24] = "Massachusetts"
		stateVal['US'][24] = "Massachusetts"
		stateName['US'][25] = "Michigan"
		stateVal['US'][25] = "Michigan"
		stateName['US'][26] = "Minnesota"
		stateVal['US'][26] = "Minnesota"
		stateName['US'][27] = "Mississippi"
		stateVal['US'][27] = "Mississippi"
		stateName['US'][28] = "Missouri"
		stateVal['US'][28] = "Missouri"
		stateName['US'][29] = "Montana"
		stateVal['US'][29] = "Montana"
		stateName['US'][30] = "Nebraska"
		stateVal['US'][30] = "Nebraska"
		stateName['US'][31] = "Nevada"
		stateVal['US'][31] = "Nevada"
		stateName['US'][32] = "New Hampshire"
		stateVal['US'][32] = "New Hampshire"
		stateName['US'][33] = "New Jersey"
		stateVal['US'][33] = "New Jersey"
		stateName['US'][34] = "New Mexico"
		stateVal['US'][34] = "New Mexico"
		stateName['US'][35] = "New York"
		stateVal['US'][35] = "New York"
		stateName['US'][36] = "North Carolina"
		stateVal['US'][36] = "North Carolina"
		stateName['US'][37] = "North Dakota"
		stateVal['US'][37] = "North Dakota"
		stateName['US'][38] = "Ohio"
		stateVal['US'][38] = "Ohio"
		stateName['US'][39] = "Oklahoma"
		stateVal['US'][39] = "Oklahoma"
		stateName['US'][40] = "Oregon"
		stateVal['US'][40] = "Oregon"
		stateName['US'][41] = "Pennsylvania"
		stateVal['US'][41] = "Pennsylvania"
		stateName['US'][42] = "Rhode Island"
		stateVal['US'][42] = "Rhode Island"
		stateName['US'][43] = "South Carolina"
		stateVal['US'][43] = "South Carolina"
		stateName['US'][44] = "South Dakota"
		stateVal['US'][44] = "South Dakota"
		stateName['US'][45] = "Tennessee"
		stateVal['US'][45] = "Tennessee"
		stateName['US'][46] = "Texas"
		stateVal['US'][46] = "Texas"
		stateName['US'][47] = "Utah"
		stateVal['US'][47] = "Utah"
		stateName['US'][48] = "Vermont"
		stateVal['US'][48] = "Vermont"
		stateName['US'][49] = "Virginia"
		stateVal['US'][49] = "Virginia"
		stateName['US'][50] = "Washington"
		stateVal['US'][50] = "Washington"
		stateName['US'][51] = "West Virginia"
		stateVal['US'][51] = "West Virginia"
		stateName['US'][52] = "Wisconsin"
		stateVal['US'][52] = "Wisconsin"
		stateName['US'][53] = "Wyoming"
		stateVal['US'][53] = "Wyoming"
	
	}

	function setbillstate(index,fstatus, id, toChange)
	{
		loadvalues();
		document.getElementById(toChange).length=1;

		var countryStateAvailable = 0;
		var changeToSelected = 0;

		for(i=0; i<allCountries.length; i++) { if (index == allCountries[i]) { countryStateAvailable = 1; } }

//		if(stateName[index].length > 0)

		if(countryStateAvailable) {
			for(i=-1;i<stateName[index].length;i++) {
				document.getElementById(toChange).options[i+1]=new Option(stateName[index][i],stateVal[index][i]);
				if (stateVal[index][i] == stateToMatch) {
					changeToSelected = i+1;
				}
			}		

			if(stateName[index].length==1) {
				document.getElementById(toChange).options[1].selected=true;
			}

			if(stateName[index].length>1) {
				document.getElementById(toChange).style.background="#E8E8E8";
				document.getElementById(toChange).value="";
				document.getElementById(toChange).disabled=true;
				document.getElementById(toChange).style.background="#FFFFFF";			
				document.getElementById(toChange).disabled=false;	

				document.getElementById(toChange).options[changeToSelected].selected = true;	
				if(fstatus==2) {
					if ( (!surpressBillingAddressBlank) ) {
						document.getElementById(toChange).focus();
					}
				}
			}
			else {
				document.getElementById(toChange).style.background="#FFFFFF";
				document.getElementById(toChange).toChange.disabled=false;
				document.getElementById(toChange).style.background="#E8E8E8";
				document.getElementById(toChange).toChange.disabled=true;
			}
		}
		else {
			document.getElementById(toChange).options[0]=new Option(stateName['NA'][0],stateVal['NA'][0]);
			document.getElementById(toChange).style.background="#FFFFFF";
			document.getElementById(toChange).disabled=false;
			document.getElementById(toChange).style.background="#E8E8E8";
			document.getElementById(toChange).disabled=true;
		}
	}


    
    
// JavaScript Document

/**
* Function to get order info and submit via ajax function below
* rid in function is detailsUID which is required for cookie tracking
*/

function addBasket(filename, uid, rid,  e) {
    
        /*var qtyValue = document.getElementById("qty"+uid).options[document.getElementById("qty"+uid).selectedIndex].value;*/
        var qtyValue = 1;
        
        var urlToSubmit = filename + "?quantity=" + qtyValue + "&productUID=" + uid + "&rid=" + rid + "&cartFormat=CartAjax&cartLineFormat=CartLineAjax&cartRows=2&time=" + new Date().getTime();        

        /*console.log('logging: ' + urlToSubmit);*/
        
        document.getElementById("link"+uid).innerHTML = "Added";
        
        showToolTip('<p><span>Item added to cart</span></p> <br /> <a href="/popupCart.php?isPopup=1&time=' + new Date().getTime() + '" onclick="return hs.htmlExpand(this, { objectType: \'iframe\', width: 800, minHeight: 200 }); closeToolTip(\'basketTooltip\'); return false;">View Cart</a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="#" onclick="javascript: closeToolTip(\'basketTooltip\'); return false;">Close</a>', 'html', '', '', e, 'basketTooltip', -130);

        ajaxFunction(urlToSubmit, 'updateBasket');
        var t=setTimeout("document.getElementById('link" + uid + "').innerHTML = 'Add to Cart';",1000);
        var t2=setTimeout("closeToolTip('basketTooltip');",3000);
        
}


/**
* Function to update the basket at the top of the page
*/
function updateBasket(result) {
    
    document.getElementById('ajaxCart').innerHTML = result;
}

/**
* Function to enable all Ajax function to work.
*/

function ajaxFunction(submissionUrl, successFunction)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
                if(successFunction == 'updateBasket') {
                        updateBasket(xmlHttp.responseText);
                }
      }
    }
        
  xmlHttp.open("GET",submissionUrl,true);
  xmlHttp.send(null);
  }

/**
* Function to submit a HTML form into a Highslide iframe popup.
*/
function submitToHighslide(form) {

    // identify the submit button to start the animation from
    var anchor;
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].type == 'submit') {
        anchor = form.elements[i];
        break;
    }
}

// open an expander and submit our form when the iframe is ready
hs.overrides.push('onAfterExpand');
hs.htmlExpand(anchor, {
    objectType: 'iframe',
    src: 'about:blank',
    width: 800,
    height: 600,
    onAfterExpand: function(expander) {
        form.target = expander.iframe.name;
        form.submit();
    }
});

// return false to delay the sumbit until the iframe is ready
return false;
}


