// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function actualizar(quinacapa) {
		if (document.getElementById) {
		// this is the way the standards work
				var style2 = document.getElementById(quinacapa).style;
				style2.display = style2.display? "none":"block";
		} else if (document.all) {	
		// this is the way old msie versions work
				var style2 = document.all[quinacapa].style;
				style2.display = style2.display? "none":"block";
		} else if (document.layers) {
		// this is the way nn4 works
				var style2 = document.layers[quinacapa].style;
				style2.display = style2.display? "none":"block";
		}
}



function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}


function mostrar(nombreCapa){
document.getElementById(nombreCapa).style.visibility="visible";
}
function ocultar(nombreCapa){
document.getElementById(nombreCapa).style.visibility="hidden";
}


// FUNCIONS PER PLEGAR/DESPLEGAR EL MENU SUPERIOR

var tope0=30;
var tam='';
var tam2='';
var altura='';
var alt='';
var imatge='';
var img='';
var vel_cortina=10;
var vel_crida=1;
var alcada_img=26;
function comenca(capa,tanquem){
	if(tanquem=='si'){document.getElementById(capa).style.height=alcada_img+'px';}
	
	imatge=document.getElementById(capa).style.backgroundImage;
	img='';
	for (var i=0; i< imatge.length; i++){
		if(i==imatge.length-5){
			img=img+'_over';
		}
		img=img+imatge.charAt(i);
	}
	document.getElementById(capa).style.backgroundImage=img;
}
function para(capa,tanquem){
	if(tanquem=='si'){document.getElementById(capa).style.height=alcada_img+1+'px';}
		
	imatge=document.getElementById(capa).style.backgroundImage;
	img='';
	for (var i=0; i< imatge.length; i++){
		if(i==imatge.length-10){
			i=i+5;
		}
		img=img+imatge.charAt(i);
	}
	document.getElementById(capa).style.backgroundImage=img;
}
function obre_plega(capa,tope2){
	altura=document.getElementById(capa).style.height;
	alt='';
	for (var i=0; i< altura.length-2; i++){
		alt=alt+altura.charAt(i);
	}
	if(alt==alcada_img){
		tam=document.getElementById(capa).style.width;
		tam2='';
		for (var i=0; i< tam.length-2; i++){
			tam2=tam2+tam.charAt(i);
		}
		if(tam2<tope2){
			tam2=parseInt(tam2)+vel_cortina;
			if(tam2>tope2) tam2=tope2;
			tam2=tam2+'px';
			document.getElementById(capa).style.width=tam2;
			setTimeout("obre_plega('"+capa+"',"+tope2+")", vel_crida);
		}
	}
	if(alt==alcada_img+1){
		tam=document.getElementById(capa).style.width;
		tam2='';
		for (var i=0; i< tam.length-2; i++){
			tam2=tam2+tam.charAt(i);
		}
		if(tam2>tope0){
			tam2=parseInt(tam2)-vel_cortina;
			if(tam2>tope2) tam2=tope2;
			tam2=tam2+'px';
			document.getElementById(capa).style.width=tam2;
			setTimeout("obre_plega('"+capa+"',"+tope2+")", vel_crida);
		}
	}
}



//-->