// JavaScript Document///////////////////////////////////////////////////////////////////////////////////////////////function type_test() {	// set variable for opage tests	var address = 'http://www.holtmodelrailways.co.uk/';	var type = document.type.product_type.value;	var company = '';		var gauge = document.type.gauge.value;	if (gauge == '00') {var gauge_page ='00';} 	if (gauge == 'n') {var gauge_page ='n';}	if (gauge == 'O') {var gauge_page ='0';}		// Start tests	if(document.type.product_type.value == 0){		alert('The item you have choosen is not valid, please try another');		document.type.product_type.selectedIndex = 0;	}	else{		window.location.href = address + 'choose_' + gauge_page + '.php?gauge=' + gauge + '&product_type=' + type + '&company=' + company;	}}///////////////////////////////////////////////////////////////////////////////////////////////// open the window for the cartfunction additem(val){	var url = 'https://www.lgogroup.net/www.holtmodelrailways.co.uk/smallcart.php?action=add&productcode=' + document.forms[val].productcode.value + '&qty=' + document.forms[val].qty.value;	window.open(url,'','width=200,height=100');}///////////////////////////////////////////////////////////////////////////////////////////////function company_change() {	// set variable for opage tests	var address = 'http://www.holtmodelrailways.co.uk/';	var type = document.type.product_type.value;	var company = document.type.company.value;		var gauge = document.type.gauge.value;	if (gauge == '00') {var gauge_page ='00';} 	if (gauge == 'n') {var gauge_page ='n';}	if (gauge == 'O') {var gauge_page ='O';}		// change page	window.location.href = address + 'choose_' + gauge_page + '.php?gauge=' + gauge + '&product_type=' + type + '&company=' + company;}///////////////////////////////////////////////////////////////////////////////////////////////function iclass_change() {	// set variable for opage tests	var address = 'http://www.holtmodelrailways.co.uk/';	var type = document.type.product_type.value;	var company = document.type.company.value;	var iclass = document.type.iclass.value;		var gauge = document.type.gauge.value;	if (gauge == '00') {var gauge_page ='00';} 	if (gauge == 'n') {var gauge_page ='n';}	if (gauge == 'O') {var gauge_page ='O';}		// change page	window.location.href = address + 'choose_' + gauge_page + '.php?gauge=' + gauge + '&product_type=' + type + '&company=' + company + '&iclass=' + iclass;}///////////////////////////////////////////////////////////////////////////////////////////////function change_menu_type(){		for (var counter = 0; counter < document.type.product_type.length; counter++){			if (document.type.product_type.options[counter].value == document.type.lproduct_type.value){				document.type.product_type.selectedIndex = counter;			}		}}///////////////////////////////////////////////////////////////////////////////////////////////function change_menu_company(){	if (!document.type.company){}	else{		for (var counter = 0; counter < document.type.company.length; counter++){			if (document.type.company.options[counter].value == document.type.lcompany.value){				document.type.company.selectedIndex = counter;			}		}	}}///////////////////////////////////////////////////////////////////////////////////////////////function change_menu_iclass(){	if (!document.type.iclass){}	else{		for (var counter = 0; counter < document.type.iclass.length; counter++){			if (document.type.iclass.options[counter].value == document.type.liclass.value){				document.type.iclass.selectedIndex = counter;			}		}	}}///////////////////////////////////////////////////////////////////////////////////////////////function postage_change(){		if(document.cart.postage[0].checked) {		document.cart.postagedis.value = document.cart.postage[0].value;		//document.cart.total.value = (parseFloat(document.cart.postage[0].value) + parseFloat(document.cart.calctotal.value));				document.cart.total.value = ((Math.round((parseFloat(document.cart.postage[0].value) + parseFloat(document.cart.calctotal.value)) * 100))/100 );	}		if(document.cart.postage[1].checked) {		document.cart.postagedis.value = document.cart.postage[1].value;		//document.cart.total.value = (parseFloat(document.cart.postage[1].value) + parseFloat(document.cart.calctotal.value));				document.cart.total.value = ((Math.round((parseFloat(document.cart.postage[1].value) + parseFloat(document.cart.calctotal.value)) * 100))/100);				}}///////////////////////////////////////////////////////////////////////////////////////////////