	//~ jQuery(document).ready(function() {
    		//~ jQuery('#mycarousel').jcarousel({
        	//~ vertical: true,
			//~ scroll: 3,
			//~ visible: 6,
			//~ wrap: "both",
			//~ buttonPrevHTML: "<button id='prev'>&nbsp;</button>",
			//~ buttonNextHTML: "<button id='next'>&nbsp;</button>"
    		//~ });
	//~ });

	window.onload = function() {
			var myUrls=new Array();
				myUrls[1]="1";
				myUrls[2]="11";
				myUrls[3]="16";
				myUrls[4]="5";
			var links = document.getElementById('search_option');
			var images = links.getElementsByTagName('img');
			for (i=0;i<images.length;i++) {
				images[i].onmouseover = function() {
					this.src = this.src.replace(/a.gif/,'b.gif');
					this.style.cursor = 'pointer';
				};
				images[i].onmouseout = function() {
					this.src = this.src.replace(/b.gif/,'a.gif');
				};
				images[i].onclick = function() {
					lex = explode("/",this.src);
					var label = lex[lex.length-1];
					label = label.replace(/b.gif/,'');
					label = label.replace(/00/,'');
					location.href = 'pretraga-p1-s1D-vt-'+myUrls[label]+'.html';
				}
			}
		}

	function ClearSelect(make_id) {
		endSelect = document.getElementById('Models2Pop');
		while (endSelect.options.length > 0) {
    		endSelect.options[0] = null;
		}
		document.getElementById('Models2Pop').disabled = false;
		PopulateSelect('Models2Pop',make_id);
	}

	function PopulateSelect(id2pop,make_id) {
		var xmlHttp;
		try {
	  		// Firefox, Opera 8.0+, Safari
	  		xmlHttp=new XMLHttpRequest();
  		}
		catch (e) {
  			// Internet Explorer
  			try {
    			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  			catch (e) {
    			try {
    	  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	  		}
    			catch (e) {
    	  			alert("Your browser does not support AJAX!");
    	  			return false;
    	  		}
    		}
  		}
  		xmlHttp.onreadystatechange=function() {
			if(xmlHttp.readyState==4) {
  				endSelect = document.getElementById(id2pop);
  				var xmlDoc = xmlHttp.responseXML.documentElement.getElementsByTagName("model");
  				for (i=0;i<xmlDoc.length;i++) {
    	            var sID = xmlDoc[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
    	            var sNM = xmlDoc[i].getElementsByTagName("name")[0].childNodes[0].nodeValue;
    	            endSelect.options[i] = new Option(sNM, sID);
    	        }
  			}
		}
		var url2get = "scripts/models.php?mid=" + make_id;
		xmlHttp.open("GET",url2get,true);
		xmlHttp.send(null);
	}	
	
	function UpdateFilterCount() {
		var query = "";
		if (document.forms[1].elements[0].value != "") {
			query += "filter[make]="+document.forms[1].elements[0].value+"&";
		}
		if (document.forms[1].elements[1].value != "") {
			query += "filter[price_from]="+document.forms[1].elements[1].value+"&";
		}
		if (document.forms[1].elements[2].value != "") {
			query += "filter[price_to]="+document.forms[1].elements[2].value+"&";
		}
		if (document.forms[1].elements[3].value != "") {
			query += "filter[mileage_from]="+document.forms[1].elements[3].value+"&";
		}
		if (document.forms[1].elements[4].value != "") {
			query += "filter[mileage_to]="+document.forms[1].elements[4].value+"&";
		}

		//var city = document.forms[1].elements[5].value;
		
		if (document.forms[1].elements[6].value != "") {
			query += "filter[model]="+document.forms[1].elements[6].value+"&";
		}
		if (document.forms[1].elements[7].value != "") {
			query += "filter[production_date_from]="+document.forms[1].elements[7].value+"&";
		}
		if (document.forms[1].elements[8].value != "") {
			query += "filter[production_date_to]="+document.forms[1].elements[8].value+"&";
		}
		if (document.forms[1].elements[9].value != "") {
			query += "filter[fuel]="+document.forms[1].elements[9].value+"&";
		}
  		var mypostrequest=new ajaxRequest();
		mypostrequest.onreadystatechange=function(){
			if (mypostrequest.readyState==4){
 				if (mypostrequest.status==200 || window.location.href.indexOf("http")==-1){
	 				document.getElementById("filter_count").innerHTML = mypostrequest.responseText;
  				}
  				else{
   					alert("Greška prilikom obrade zahteva.");
  				}
 			}
		}
		var parameters=query;
		mypostrequest.open("POST", "scripts/filter_count.php", true);
		mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		mypostrequest.send(parameters);
	}