var menu;
	
	var XMLHttpRequestObject = false;
	
	if (window.XMLHttpRequest) {
	XMLHttpRequestObject = new XMLHttpRequest();
	XMLHttpRequestObject.overrideMimeType("text/xml");
	} else if (window.ActiveXObject) {
	XMLHttpRequestObject = new
	ActiveXObject("Microsoft.XMLHTTP");
	}
	
	function clearFilter(caseFilter)
	{
		switch (caseFilter)
		{
			case 1:
			//document.getElementById('marque').options.length = 0;
			document.getElementById('model').options.length = 0;
			document.getElementById('year').options.length = 0;
			//document.getElementById('year2').options.length = 0;
			break;
			
			case 2:
			//document.getElementById('model').options.length = 0;
			document.getElementById('year').options.length = 0;
			//document.getElementById('year2').options.length = 0;
			break;
			
			case 3:
			//document.getElementById('year').options.length = 0;
			break;
		}
	}
	
	function getmenu(filterType,filterID)
	{
		if(XMLHttpRequestObject) {
		XMLHttpRequestObject.open("GET", "index.php?option=com_matos&format=xml&type="+ filterType +"&id1=" + filterID);
		XMLHttpRequestObject.onreadystatechange = function()
		{
			if(XMLHttpRequestObject.readyState == 4 && 
			XMLHttpRequestObject.status == 200) {
			var xmlDocument = XMLHttpRequestObject.responseXML;
			menu = xmlDocument.getElementsByTagName("menuitem");
			menuvalue = xmlDocument.getElementsByTagName("menuvalue");
			listfilter(filterType);
			}
		}
		XMLHttpRequestObject.send(null);
		}
	}
	
	
	function listfilter(filterType)
	{
		var loopIndex;
		var selectControl = document.getElementById(filterType);
		for(loopIndex = 0; loopIndex < selectControl.length; loopIndex++)
		{
		  selectControl.options[loopIndex] = null;
		}
		for(loopIndex = 0; loopIndex < menu.length; loopIndex++)
		{
		  selectControl.options[loopIndex] = new 
		  Option(menu[loopIndex].firstChild.data)
		  selectControl.options[loopIndex].value = menuvalue[loopIndex].firstChild.data;
		}
	}
	
	function setfilter()
	{
		document.getElementById('targetDiv').innerHTML = 
		"You selected " + menu[document.getElementById('menuList').selectedIndex].firstChild.data;
	}