function setMotor(motor,type)
{
	aantal = $("motor_sel").length;
	for(i=0;i<aantal;i++)
	{
		if($("motor_sel").options[i].value==motor)
		{
			$("motor_sel").options[i].selected = 'selected';
		}
	}
	setTypes2(motor,type);
	
		
	
	
}
function checkArtSearch()
{
	if($('artcode').value!='search'&&$('artcode').value!='')
	{
		$('searchForm2').submit();	
	}
}



	function setTypes(el)
	{
			id = el.options[el.options.selectedIndex].value;
			$('sb1').enable();
			$('sb1').removeAttribute('disabled');
		   new Ajax.Request("ajax/types.php",
		   	  {	   	  		
			    postBody : "id="+id,
		           onComplete : function(t)
		           {		           		
//				alert(t.responseText);
		    	      $('type_sel').innerHTML = t.responseText;
		           }
		       }
		   )
	}	
	function goSearch(el)
	{
		waarde = el.options[el.selectedIndex].value;

		if(waarde!='Select a motor first'&&waarde!=''&&waarde!='Select a model')
		{
			$('sb1').removeAttribute('disabled');
		}
	}
	function setTypes2(motor,selectedType)
	{
			id = motor;
			$('sb1').removeAttribute('disabled');
		   new Ajax.Request("ajax/types.php",
		   	  {	   	  		
				   postBody : "id="+id+"&sel="+selectedType,
		           onComplete : function(t)
		           {
		           		//alert(t.responseText);
		    	      $('type_sel').innerHTML = t.responseText;
		           }
		       }
		   )
	}		
