function setImg(imatge,txt){
		
	//REMOVE CONTENT DIV
	$('#gammaModel').html('');
	//SET LOADING
	$('#gammaModel').addClass('loading');
	var srcImg='./phimg-model-370-1-0/'+imatge;
	var img = new Image();
	
	$(img).load(function () {
	    //$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
	    $(this).hide();
	    $(this).attr('alt',txt)
	    $('#gammaModel').removeClass('loading');
	    $('#gammaModel').append(this);
	    $(this).fadeIn();
	}).error(function () {
	    // notify the user that the image could not be loaded
	}).attr('src', srcImg);
}

function getModel()
	{
	var x=$("#marca").val();
	models(x)
	}

function models(id) {
   $('#model').removeAttr("disabled");
   //Inserto a la sessiÃ³
	$.ajax({
		type: "GET",
		async: false,
		url: "http://"+location.hostname+"/lib/llista_models.php",
		data: "marca="+id,
		success: function(msg){
			if (msg!='') {
				//Actualitzo el nÃºmero de desitjos
				$("#model").html(msg);
			}
		}
	});
}

function setImgPlayer(imatge,idCar,idFoto){
		
	//REMOVE CONTENT DIV
	$('#ocasio-fitxa-imgppal').html('');
	//SET LOADING
	$('#ocasio-fitxa-imgppal').addClass('loading');
	var srcImg='./img-vehicle-300-200-1-0/'+imatge;
	var img = new Image();
	$('#player_imatges').hide();
	$(img).load(function () {
		$.ajax({
			type: "GET",
			async: false,
			url: "http://"+location.hostname+"/lib/llista_imatges.php",
			data: "id="+idCar+"&foto="+idFoto+"&img="+imatge,
			success: function(msg){
				if (msg!='') {
					//Actualitzo el nÃºmero de desitjos
					$("#ocasio-fitxa-imgppal").html(msg);
					$('#player_imatges').show();
				}
			}
		});
	}).error(function () {
	    // notify the user that the image could not be loaded
	}).attr('src', srcImg);
}
