function overMenu(menu) {
	m = document.getElementById(menu);
	m.style.backgroundImage = 'url(img/menu_over.gif)';
}
function outMenu() { m.style.backgroundImage = ''; }

function overSubmenu(submenu) {
	s = document.getElementById(submenu);
	s.bgColor='#0D2534';
}

function outSubmenu() { s.bgColor='#153E56'; }

function overSubsubmenu(submenu) {
	s = document.getElementById(submenu);
	s.bgColor='#2E6485';
}
function outSubsubmenu() { s.bgColor='#26546F'; }


function overNews(td) { td.bgColor='#F1FAFC'; }
function outNews(td) { td.bgColor=''; }


function MM_openBrWindow (theURL,winName,ancho,alto){

   w = screen.availWidth;
   h = screen.availHeight;


var popW = ancho, popH = alto;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;

window.open(theURL,winName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',resizable=yes,scrollbars=yes');
}

/*
  comprova si l'element est? buit, si ??s aix?? mostra un alert
  amb el missatge que se l'hi ha passat com a segon argument,
  situa el focus a l'element i retorna un false
*/
function elementEstaBuit(element, msg){
  if(element.value == null || element.value == ""){
    alert(msg);
    element.focus();
    return true;
  }
  return false;
}

/*
  comprova si l'element cont?? un num??ric, si no ??s aix?? mostra un alert
  amb el missatge que se l'hi ha passat com a segon argument,
  situa el focus a l'element i retorna un false
*/
function elementEsNumeric(element, msg){
  if(isNaN(element.value)){
	  alert(msg);
	  element.focus();
	  return false;
  }

  return true;
}

function popup(img,titulo)
{
ventana=window.open('','ventana','resizable=yes,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no"><a href="#" onClick="window.close()"><img src="' + img + '" border="0" alt="Cerrar/Close" onLoad="opener.redimensionar(this.width, this.height)"></a>');
ventana.document.close();
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+8,alto+30);
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2);
}