$(document).ready(function() {
	
	$('.jqtransform').jqTransform();
	
	$('#cars_other_pictures').jcarousel();
	
	$(".offers_cars_main_picture a[rel^='prettyPhoto']").prettyPhoto({
		theme:'facebook',
		opacity: 0.7
	});
	
	$('#slider').s3Slider({
		timeOut: 3000
	});
	
});


function change_picture(new_medium_picture_src, new_big_picture_src, selected_file)
{
	document.getElementById('medium_picture').src = new_medium_picture_src;
	document.getElementById('big_picture').href = new_big_picture_src;
	
	$(".car_one_big_picture").each(function()
	{
		this.rel = "prettyPhoto[gallery]";
	});
	
	document.getElementById(selected_file).rel = '';
	
	return false;
}


function show_makes_in_motion(auto_type_id)
{
	$.ajax({
	  type: "POST",
	  url: 'ajax/show_makes_in_motion',
	  data: "auto_type_id=" + auto_type_id,
	  success: function(result) {
		$('#makes_in_motion').html(result);
	  }
	});
}


function show_makes_on_parts(auto_type_id)
{
	$.ajax({
	  type: "POST",
	  url: 'ajax/show_makes_on_parts',
	  data: "auto_type_id=" + auto_type_id,
	  success: function(result) {
		$('#makes_on_parts').html(result);
	  }
	});
}
