/* CSS Document */

if(typeof VehicleApplication=='undefined') {
    var VehicleApplication = {};
}

VehicleApplication.setYear = function(year_select){
		var reloadurl = '/navigation/application';  
		new Ajax.Request(
					reloadurl, 
					{ 
						method: 	"get", 
						parameters: "search_year=" + year_select.value, 
						onComplete: 
							function(transport)
							{
								//alert(transport.responseText);
								var theurl = location.href
								var path = location.pathname
								if (path != "/index.php" && path != "/")
								{	
									theurl = theurl.replace("p=","_p=");				// replace the page in the url
									theurl = theurl.replace("search_year=","lastsearchyear="); 	// replace the year in the url
									theurl = theurl.replace("#","&"); 				// stop the page form scrolling to an ahchor
									location.href = theurl;
								}
							}
					}
		);		
}
