

	window.seleccionado=null
	window.seleccionadomenu=null

	apartado = function(e,lnk)
	{
		location.href=lnk
		if (window.seleccionado) 
		{
			window.seleccionado.style.backgroundColor='#f4f4f0'
			window.seleccionado.style.color='#303030'
		}
		if (seleccionado) seleccionado.style.backgroundColor=''
		window.seleccionado=e
		window.seleccionado.style.backgroundColor='#303030'
		window.seleccionado.style.color='#F4F4F0'
	}
	
	enciende = function(e)
	{
		if (seleccionado!=e)
		{
		 	e.style.backgroundColor='#009DBA'
			//e.style.color='#FFFFFF'
		}	
	}
	enciendeM = function(e)
	{
		if (seleccionado!=e)
		{
		 	e.style.backgroundColor='#FFFFFF'
			//e.style.color='#FFFFFF'
		}	
	}
	
	apaga = function(e)
	{
		if (seleccionado!=e)
		{
		 	e.style.backgroundColor=''
			//e.style.color=''
		}	
	}
	
	escribir = function(contenido, donde){
		//usamos la propiedad responseText para recibir en una cadena lo que nos mandaron            
			vari=contenido.responseText
				//alert(vari)
			document.getElementById(donde).innerHTML = vari
	}
	escribir2 = function(contenido, donde){
		//usamos la propiedad responseText para recibir en una cadena lo que nos mandaron            
			vari=contenido
				//alert(vari)
			document.getElementById(donde).innerHTML = vari
	}
	
	nouAjax = function(){
	
		escribir2("carregant...",on);
		//creamos el objeto
	  	try {                
  			objetus = new ActiveXObject("Msxml2.XMLHTTP");        
		  } catch (e) {                
			  try {                    
    			  objetus= new ActiveXObject("Microsoft.XMLHTTP");                
			  } catch (E) {                        
  				 objetus= false;                
			  }        
		  }        
		  if (!objetus && typeof XMLHttpRequest!='undefined') {                
  			objetus = new XMLHttpRequest();        
		  } 
		  //una vez enviado los valores inmediatamente llamamos a la propiedad         
		//onreadystatechange    
		objetus.onreadystatechange=function() {                

			//dentro de la funcion comprobamos el estado del proceso                
			//si es 4 (terminado) pedimos lo que nos han mandado        
			if (objetus.readyState==4){                
				if (objetus.status == 200){ 
					escribir(objetus,on);
				 }else{ 
					alert("Error: "+_URL_+_values_send); 
				 } 
			   }    
			}    
		objetus.open("GET",_URL_+_values_send,true);  
		objetus.send(null);
	}
	function init()
	{
		if(document.all) winW = document.body.offsetWidth - 20
		else winW = window.innerWidth -16
			
		document.getElementById("wrap").style.left = (winW - 400)/2 + "px"
		document.getElementById("wrap").style.visibility = "visible"
	}	
	
	function destaca_menu()
	{
	  //RUZEE.Borders.render();
	  quin="m"+opcio_menu
	  document.getElementById(quin).style.backgroundColor='#303030'
	  document.getElementById(quin).style.color='#F4F4F4'
	  document.getElementById(quin).onmouseover = null
	  document.getElementById(quin).onmouseout = null
	}

		
	function checkDate(name)
{
	var x = document.forms[0].elements;
	var day = parseInt(x[name+"_day"].options[x[name+"_day"].selectedIndex].value);
	var month = parseInt(x[name+"_month"].options[x[name+"_month"].selectedIndex].value);
	var year = parseInt(x[name+"_year"].options[x[name+"_year"].selectedIndex].value);

	if (!day || !month || !year)
		return false;

	if (year/4 == parseInt(year/4))
		monthLength[1] = 29;

	if (day > monthLength[month-1])
		return false;

	monthLength[1] = 28;

	var now = new Date();
	now = now.getTime(); //NN3

	var dateToCheck = new Date();
	dateToCheck.setYear(year);
	dateToCheck.setMonth(month-1);
	dateToCheck.setDate(day);
	var checkDate = dateToCheck.getTime();

	var futureDate = (now < checkDate);
	var pastDate = (now > checkDate);

	return pastDate;
}