jQuery(document).ready( function($) {


	$("#category").change(function(){
	    id = $('#category').val();
	    $("#marka").load("includes/ajax.php", {'task': 'marka','id':id});
	    /*$.ajax({
   			type: "GET",
   			url: "includes/ajax.php",
   			data: "task=marka&id="+id,
   			success: function(msg){
     			alert( "Data Saved: " + msg );
   			}
 		});*/
		$("#dop_complect").load("includes/ajax.php", {'task': 'complect1','id':id});
		$("#dop_complect2").load("includes/ajax.php", {'task': 'complect2','id':id});
	    id = $('#marka').val();
		$("#model").load("includes/ajax.php", {'task': 'model','id':id});		
	});
	
	$("#marka").change(function(){
	    id = $('#marka').val();
		$("#model").load("includes/ajax.php", {'task': 'model','id':id});
	});
	
      var button = $('#button1'), interval;
	  new Ajax_upload('#button1',{
		//action: 'upload-test.php', // I disabled uploads in this example for security reasons
		action: 'includes/upload.php', 
		name: 'myfile',
		onSubmit : function(file, ext){
			// change button text, when user selects file			

			
			// If you want to allow uploading only 1 file at time,
			// you can disable upload button
			this.disable();
			
		},
		onComplete: function(file, response){


						
			window.clearInterval(interval);
						
			// enable upload button
			this.enable();
			
			// add file to the list
			//$('<li></li>').appendTo('.files').text(response);									
			$('<li></li>').appendTo('.files').html(response);
		}
	});	
//pavel
});