function unclick(imatge) {
	document.getElementById('Elbody').style.backgroundImage="url(./estils/imatges/"+imatge+")";
}
		
function unclick2(imatge) {
	document.getElementById('portada').style.backgroundImage="url(./imatges/"+imatge+")";
}
		
function CarregaMenus(IdPortada)	{
	document.getElementById('idiomes').innerHTML=parent.FrameMenus.document.getElementById('idiomes').innerHTML;
	document.getElementById(IdPortada).innerHTML=parent.FrameMenus.document.getElementById('ElsMenus').innerHTML;
}

function Finestra(nom,ample,alt,imatge) {
	var w = 480, h = 340;

	ample+=20;
	alt+=20;

    if (document.all) {
	   w = document.body.clientWidth; h = document.body.clientHeight;
	}
	else {
	   w = window.innerWidth;h = window.innerHeight;
	}				
				
				
	var leftPos = (w-ample)/2;
  		topPos = (h-alt)/2;
	
	lafinestra=window.open(imatge,nom,"width="+ample+",height="+alt+",top="+topPos+",left="+leftPos);

	if (lafinestra.focus) lafinestra.focus();
				
}
		
function move(sube,alt) {
 capa=document.getElementById('portada');
// alert(capa.style.backgroundPosition);
// debug=document.getElementById('deb');
 
 if (sube) {
 	 //debug.value=debug.value+" "+sube+" "+alt; 
	 alt+=2;
	 if (alt>30) sube=false;
 	 capa.style.backgroundPosition="0px -"+alt+"px";
	 temps=setTimeout("move("+sube+","+alt+")",1000);
	// clearTimeout(temps);
	 
 }
 else  if (!sube) {
	 //debug.value=debug.value+" "+sube+" "+alt; 
  	 alt-=2;
	 if (alt<1) sube=true;
 	 capa.style.backgroundPosition="0px -"+alt+"px";
	 setTimeout("move("+sube+","+alt+")",1000);
	// clearTimeout(temps);
 }
}

function PlayMp3(file) {
	ElFlash="<object id=\"reproductor\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"180\" height=\"70\">";
	ElFlash+="<param name=\"movie\" value=\"../mp3/player/mp3player.swf\">";
	ElFlash+="<param name=quality value=high><param name=\"LOOP\" value=\"false\">";
	ElFlash+="<param name=\"wmode\" value=\"opaque\">";
	ElFlash+="<param name=\"FlashVars\" VALUE=\"elfile=http://www.jordimatas.com/mp3/player/"+file+".xml&sautoplay=true\">";
	ElFlash+="<embed src=\"../mp3/player/mp3player.swf\" width=\"180\" height=\"70\" loop=\"false\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" wmode=\"opaque\" flashvars=\"elfile=http://www.jordimatas.com/mp3/player/"+file+".xml&sautoplay=true\" ></embed>";
	ElFlash+="</object>";

	document.getElementById('ReproductorMp3').innerHTML=ElFlash;
}

function ObreFinestra(ample,alt,url,nomfinestra) 
{
	var Finestra = window.open(url,nomfinestra,'width='+ample+',height='+alt);
	Finestra.moveTo(screen.availWidth/2-(ample/2),screen.availHeight/2-(alt/2));
	Finestra.focus();
}