// JavaScript Document
<!-- 
//Browser Support Code
function ajaxFunctionCat(){
	var ajaxRequest2;  // The variable that makes Ajax possible!
	//reset the other choices
	document.getElementById("category_div").innerHTML = "<select style=\"width: 130px;\" disabled><option>Choose...</option></select>";
	document.getElementById("brand_div").innerHTML = "<select disabled><option>Choose...</option></select>";
	document.getElementById("sizes_div").innerHTML = "<select disabled><option></option></select>";
	document.getElementById("catsearch_div").innerHTML = "";
	

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest2 = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest2 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest2.onreadystatechange = function(){
		if(ajaxRequest2.readyState == 4){
			//document.myForm.time.value = ajaxRequest2.responseText;
			document.getElementById("category_div").innerHTML = ajaxRequest2.responseText;
			document.getElementById("catsearch_div").innerHTML = "<input class=\"searchbox\" type=\"submit\" name=\"submit\" id=\"submit\" value=\"submit\" />";

		}
	}
	//ajaxRequest2.open("GET", "ajax-truck.php", true);
	//ajaxRequest2.send(null);
	
	var classvar = document.getElementById('class').value;
			if (classvar == "1"){
			document.getElementById('sizes_div').innerHTML = "<select name=\"size1\"><option value=\"\">ALL</option><option value=\"155\">155</option><option value=\"160\">160</option><option value=\"165\">165</option><option value=\"170\">170</option><option value=\"175\">175</option><option value=\"180\">180</option><option value=\"185\">185</option><option value=\"190\">190</option><option value=\"195\">195</option><option value=\"200\">200</option><option value=\"205\">205</option><option value=\"215\">215</option><option value=\"225\">225</option><option value=\"235\">235</option><option value=\"245\">245</option><option value=\"255\">255</option><option value=\"265\">265</option><option value=\"275\">275</option></select><font color=\"black\"> <strong>/</strong> </font><select name=\"size2\"><option value=\"\">ALL</option><option value=\"30\">30</option><option value=\"35\">35</option><option value=\"40\">40</option><option value=\"45\">45</option><option value=\"50\">50</option><option value=\"55\">55</option><option value=\"60\">60</option><option value=\"65\">65</option><option value=\"70\">70</option><option value=\"75\">75</option><option value=\"80\">80</option></select><font color=\"black\"> <strong>R</strong></font><select name=\"size3\"><option value=\"\">ALL</option><option value=\"13\">13</option><option value=\"14\">14</option><option value=\"15\">15</option><option value=\"16\">16</option><option value=\"17\">17</option><option value=\"18\">18</option><option value=\"19\">19</option><option value=\"20\">20</option></select>";
			}
			if (classvar == "2"){
			document.getElementById('sizes_div').innerHTML = "<select name=\"size1\"><option value=\"\">ALL</option><option value=\"205\">205</option><option value=\"215\">215</option><option value=\"225\">225</option><option value=\"235\">235</option><option value=\"245\">245</option><option value=\"255\">255</option><option value=\"265\">265</option><option value=\"275\">275</option><option value=\"285\">285</option><option value=\"305\">305</option><option value=\"315\">315</option><option value=\"325\">325</option></select><font color=\"black\"> <strong>/</strong> </font><select name=\"size2\"><option value=\"\">ALL</option><option value=\"50\">50</option><option value=\"55\">55</option><option value=\"60\">60</option><option value=\"65\">65</option><option value=\"70\">70</option><option value=\"75\">75</option><option value=\"80\">80</option><option value=\"85\">85</option></select><font color=\"black\"> <strong>R</strong></font><select name=\"size3\"><option value=\"\">ALL</option><option value=\"14\">14</option><option value=\"15\">15</option><option value=\"16\">16</option><option value=\"17\">17</option><option value=\"18\">18</option><option value=\"19\">19</option><option value=\"20\">20</option></select>";
			}
	
	
	//var wpm = document.getElementById('wpm').value;
	//var sex = document.getElementById('sex').value;
	//var queryString = "?model=" + model + "&wpm=" + wpm + "&sex=" + sex;
	var queryString = "?class=" + classvar;
	ajaxRequest2.open("GET", "/ajax-catalogue/category.php" + queryString, true);
	ajaxRequest2.send(null); 


}

function ajaxFunctionBrand(){
	var ajaxRequest2;  // The variable that makes Ajax possible!
	//reset the other choices
	document.getElementById('brand_div').innerHTML = "<select disabled><option>Choose...</option></select>";
	//document.getElementById("sizes_div").innerHTML = "<select disabled><option></option></select>";
	//document.getElementById("edition_div").innerHTML = "<select disabled><option>Select Your Vehicle Edition</option></select>";
	//document.getElementById("size_div").innerHTML = "<select disabled><option></option></select>";
	//document.getElementById("search_div").innerHTML = "";
	

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest2 = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest2 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest2.onreadystatechange = function(){
		if(ajaxRequest2.readyState == 4){
			//document.myForm.time.value = ajaxRequest2.responseText;
			document.getElementById("brand_div").innerHTML = ajaxRequest2.responseText;
		}
	}
	//ajaxRequest2.open("GET", "ajax-truck.php", true);
	//ajaxRequest2.send(null);
	
	var classvar = document.getElementById('class').value;
	var Groupvar = document.getElementById('Groupvar').value;
	//var wpm = document.getElementById('wpm').value;
	//var sex = document.getElementById('sex').value;
	//var queryString = "?model=" + model + "&wpm=" + wpm + "&sex=" + sex;
	var queryString = "?class=" + classvar + "&Group=" + Groupvar;
	ajaxRequest2.open("GET", "/ajax-catalogue/brand.php" + queryString, true);
	ajaxRequest2.send(null); 


}

function ajaxFunctionSizes(){
	var ajaxRequest2;  // The variable that makes Ajax possible!
	//reset the other choices
	//document.getElementById("sizes_div").innerHTML = "<select disabled><option></option></select>";
	//document.getElementById("edition_div").innerHTML = "<select disabled><option>Select Your Vehicle Edition</option></select>";
	//document.getElementById("size_div").innerHTML = "<select disabled><option></option></select>";
	//document.getElementById("search_div").innerHTML = "";
	

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest2 = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest2 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest2.onreadystatechange = function(){
		if(ajaxRequest2.readyState == 4){
			//document.myForm.time.value = ajaxRequest2.responseText;
			document.getElementById("sizes_div").innerHTML = ajaxRequest2.responseText;
		}
	}
	//ajaxRequest2.open("GET", "ajax-truck.php", true);
	//ajaxRequest2.send(null);
	
	var classvar = document.getElementById('class').value;
	var Group = document.getElementById('Group').value;
	var brand = document.getElementById('brand').value;
	//var wpm = document.getElementById('wpm').value;
	//var sex = document.getElementById('sex').value;
	//var queryString = "?model=" + model + "&wpm=" + wpm + "&sex=" + sex;
	var queryString = "?class=" + classvar + "&Group=" + Group;
	ajaxRequest2.open("GET", "/ajax-catalogue/brand.php" + queryString, true);
	ajaxRequest2.send(null); 


}
//-->
