function netejar(ide, comprovacio){
	if (document.getElementById(ide).value==comprovacio){
		document.getElementById(ide).value = '';
	}
}
	
function omplir(ide, comprovacio){
	if (document.getElementById(ide).value==''){
		document.getElementById(ide).value = comprovacio;
	}
}

function canviarImatge(ide){
	document.getElementById('imgGRAN').style.width = 'auto';
	document.getElementById('imgGRAN').style.height = 'auto';
	
	document.getElementById('imgGRAN').src = document.getElementById(ide).src;
	
	var width = document.getElementById('imgGRAN').width;
	var new_width = 591; //nou tamany
	if (width > new_width){
		var height = document.getElementById('imgGRAN').height;
		var calcul = Math.round((100*new_width)/ width); //percentatge
		var new_height = Math.round((height*calcul)/100);
		document.getElementById('imgGRAN').width = new_width;
		document.getElementById('imgGRAN').height = new_height;
	}
	
	var height = document.getElementById('imgGRAN').height;
	var new_height = 444; //nou tamany
	if (height > new_height){
		var width = document.getElementById('imgGRAN').width;
		var calcul = Math.round((100*new_height)/ height); //percentatge
		var new_width = Math.round((width*calcul)/100);
		document.getElementById('imgGRAN').style.width = new_width+'px';
		document.getElementById('imgGRAN').style.height = new_height+'px';
	}
}

function veureREF(ref){
	document.getElementById('referencia').innerHTML = "<strong>REF.:</strong> " + ref;
}

//CANVIAR CONTINGUT INFORMACIO
function canviarContingut(contingut){
	antic = document.getElementById('contingut-actiu').value;
	if (antic != 'contingut-' + contingut){
		//$('#' + antic).slideUp(600).dequeue().fadeOut(600);
		document.getElementById(antic).style.display = "none";
		document.getElementById('contingut-actiu').value = 'contingut-' + contingut;
		//$('#contingut-' + contingut).slideDown(600).dequeue().fadeIn(600);
		document.getElementById('contingut-' + contingut).style.display = "block";
		document.getElementById("modificar").value = contingut;
	}
}
//FI CANVIAR CONTINGUT INFORMACIO
