
function submitenter(myfield,e)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13){
	   myfield.form.submit();
	   return false;
	}
	else{
	   return true;
	}
}



function surt_formulari(f,text){
	if(f.value.length==0)f.value=text;
}

function entra_formulari(f,text){
	if(f.value==text)f.value="";
}

function buscar(){
	f=document.form_buscador;
	if(f.query.value=="¿Busques alguna cosa?"||f.query.value.length==0){
		alert("Introdueix el text a buscar");
	}
	else if(f.query.value.length<4){
		alert("La paraula introduida és massa curta");
	}
	else{
		f.submit();
	}
}

function reproductor_online(){
	//720
	window.open('/online/online.php', 'reproductor' ,'width=397,height=265,status=no, scrollbars=yes, menubar=no, resizable=no');
}

function reproductor_online_video(){
	//720
	window.open('/online/online_video.php', 'reproductor' ,'width=720,height=265,status=no, scrollbars=yes, menubar=no, resizable=no');
}

function download(direccio){
	location.href=direccio;
}

function podcast_in(num,foto,url){
	podcast_out('1');
	podcast_out('2');
	podcast_out('3');
	podcast_out('4');
	podcast_out('5');
	document.getElementById("podcast"+num).className="fons_menu text";
	document.getElementById("podcast_foto").src="/img/downloads/"+foto;
	document.getElementById("podcast_link"+num).className="petit negre negreta";

	var FO = { movie:"mp3player.swf",width:"255",height:"20",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
		flashvars:"file="+url };
	UFO.create(FO,"player");


}

function podcast_out(num){
	document.getElementById("podcast"+num).className="fons_menu_clar";
	document.getElementById("podcast_link"+num).className="petit negre";
}

function traducir(f){
	if(!f)f=document.formtraductor;
	f.hl.value=f.tl.value;
	f.u.value=window.location;
	f.submit();
}

function guardar_comentari_podcast(){
	f=document.formcomentaris;
	if(f.nom.value.length=="0") alert("Escriu el teu nom");
	else if(f.comentari.value.length=="0") alert("Escriu els comentaris");
	else f.submit();
}

