
function MM_findObj(n, d) { //v3.0
  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); 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_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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function coloca()
{   
	capa=document.getElementById('total');
	ns = (document.layers)? true:false
	winW = (ns)? window.innerWidth-16 : document.body.offsetWidth-20
	winH = (ns)? window.innerHeight : document.body.offsetHeight
	//if (winW-529>0) capa.style.left=(winW-529)/2; else capa.style.left=0;
    //if (winH-391>0) capa.style.top=(winH-391)/2; else capa.style.top=10;	
}


// CONTROL ROLLOVER MENÚ

// OPCIÓ SELECCIONADA PER A CADA MENÚ
var AmbClick = new Array();
AmbClick[0] = 0; //MENU principal
AmbClick[1] = 0; //MENU Servicios
AmbClick[2] = 0; //SUBMENU Jurídico
AmbClick[3] = 0; //SUBMENU Tributario
AmbClick[4] = 0; //SUBMENU Tecnología
AmbClick[5] = 0; //SUBMENU EsNoticia


// NUMERO D'OPCIONS DELS MENÚS
var NMenus = new Array();
NMenus[0] = 8;
NMenus[1] = 3;
NMenus[2] = 5;
NMenus[3] = 2;
NMenus[4] = 3;
NMenus[5] = 12;


function MsOver(qui,index,nom,marc) {
	for (var cont = 1; cont < NMenus[index]+1; cont++)
	{ if (qui==cont && AmbClick[index]!=cont) {
	    x=document.getElementById(nom+cont);
	    x.src = "rcs/"+nom+cont+"_f2.gif";
	    }
	}
}

function MsOut(qui,index,nom,marc) {
	for (var cont = 1; cont < NMenus[index]+1; cont++)
	{ if (qui==cont && AmbClick[index]!=cont) {
	    x=document.getElementById(nom+cont);
	    x.src = "rcs/"+nom+cont+".gif";
 	    }
	}
}

function MsOnclick(qui,index,nom,marc) {
	MsOver(qui,index,nom,marc);
	for (var cont = 1; cont < NMenus[index]+1; cont++)
	{ if (AmbClick[index]==cont) {
	    x=document.getElementById(nom+cont);
	    x.src = "rcs/"+nom+cont+".gif";
	    }
	}
	AmbClick[index]=qui;
}


function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


// OBRE FRAMES

function dobleFrame(pag1,pag2) {
	
	parent.submenu.location.href = pag1;
	parent.contenido.location.href = pag2;
}

function tripleFrame(pag1,pag2,ban) {
	
	parent.submenu.location.href = pag1;
	parent.contenido.location.href = pag2;
	parent.banner.location.href = ban;
}

// CONTROLA TAULES AMB LAYERS

function showMenu(divNum){
	x=document.getElementById(divNum);
	y=document.getElementById("i"+divNum);

	if(x.style.display != "block"){
		x.style.display="block";
		y.src="img/i.arrow.grey.open.gif";
	}else{
		x.style.display="none";
		y.src="img/i.arrow.grey.gif";
    }
}

function kapas(nombre,estado) {
	
	nombre=document.getElementById(nombre);
	nombre.style.visibility = estado;
}
function imprimir() {
   if (document.all){
     var OLECMDID_PRINT = 6;
     var OLECMDEXECOPT_DONTPROMPTUSER = 2;
     var OLECMDEXECOPT_PROMPTUSER = 1;
     var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
     document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
     WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);
     WebBrowser1.outerHTML = "";
   }
   else{
     self.print();
   }
}
function Item(){
this.length = Item.arguments.length 
for (var i = 0; i < this.length; i++)
  this[i] = Item.arguments[i]
}
function Fecha() {
var ndia = new Item('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado')
var nmes = new Item('enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre')
var ahora
var fecha = new Date()
var ano = fecha.getYear()
var mes = fecha.getMonth()
var dia = fecha.getDay()
var aux = "" + fecha

if (ano<10) {
 ano2 = "200" + eval(ano)
}
else if (ano<80) {
 ano2 = "20" + ano
} 
else if (ano<=99) {
 ano2 = "19" + ano
}
else if (ano<1000) {
 ano2 = eval(ano) + eval(1900)
}
else {
 ano2 = ano
}
ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " de " + nmes[mes] + " de " + ano2
return ahora
}
function Fechacat() {
var ndia = new Item('Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte')
var nmes = new Item('gener','febrer','març','abril','maig','juny','juliol','agost','setembre','octubre','novembre','desembre')
var ahora
var fecha = new Date()
var ano = fecha.getYear()
var mes = fecha.getMonth()
var dia = fecha.getDay()
var aux = "" + fecha

if (ano<10) {
 ano2 = "200" + eval(ano)
}
else if (ano<80) {
 ano2 = "20" + ano
} 
else if (ano<=99) {
 ano2 = "19" + ano
}
else if (ano<1000) {
 ano2 = eval(ano) + eval(1900)
}
else {
 ano2 = ano
}
if (nmes[mes] == 'abril' || nmes[mes] == 'agost' || nmes[mes] == 'octubre' ){
ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " d'" + nmes[mes] + " de " + ano2
return ahora
}
else {
ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " de " + nmes[mes] + " de " + ano2
return ahora
}
}
function Fechaing() {
var ndia = new Item('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
var nmes = new Item('January','February','March','April','May','June','July','August','September','October','November','December')
var ahora
var fecha = new Date()
var ano = fecha.getYear()
var mes = fecha.getMonth()
var dia = fecha.getDay()
var aux = "" + fecha

if (ano<10) {
 ano2 = "200" + eval(ano)
}
else if (ano<80) {
 ano2 = "20" + ano
} 
else if (ano<=99) {
 ano2 = "19" + ano
}
else if (ano<1000) {
 ano2 = eval(ano) + eval(1900)
}
else {
 ano2 = ano
}
if (eval(aux.substring(7, 10)) == '1' || eval(aux.substring(7, 10)) == '21' || eval(aux.substring(7, 10)) == '31'){
ahora = ndia[dia] +" "+ eval(aux.substring(7, 10))+ "st" +" "+ nmes[mes] +" "+ ano2
return ahora
}
else if (eval(aux.substring(7, 10)) == '2' || eval(aux.substring(7, 10)) == '22'){
ahora = ndia[dia] +" "+ eval(aux.substring(7, 10))+ "nd" +" "+ nmes[mes] +" "+ ano2
return ahora
}
else if (eval(aux.substring(7, 10)) == '3' || eval(aux.substring(7, 10)) == '23'){
ahora = ndia[dia] +" "+ eval(aux.substring(7, 10))+ "rd" +" "+ nmes[mes] +" "+ ano2
return ahora
}
else {
ahora = ndia[dia] +" "+ eval(aux.substring(7, 10))+ "th" +" "+ nmes[mes] +" "+ ano2
return ahora
}
}
function doPopUp(){
doPopUpWindow = window.open("carrera.htm","CARRERA_PROFESIONAL","resizable=no,width=420,height=250");
}
function doPopUpcat(){
doPopUpWindow = window.open("carrera.htm","CARRERA_PROFESSIONAL","resizable=no,width=420,height=250");
}
function doPopUping(){
doPopUpWindow = window.open("carrera.htm","CARRERA_PROFESIONAL","resizable=no,width=420,height=250");
}
function acceso_cas(){
doPopUpWindow = window.open("extranet/acceso.clientes.php","EXTRANET","resizable=no,scrollbars=auto,top=0,left=0,width=800,height=718");
}
function acceso_cat(){
doPopUpWindow = window.open("../extranet/acceso.clientes.php","EXTRANET","resizable=no,scrollbars=auto,top=0,left=0,width=800,height=718");
}
function acceso_ing(){
doPopUpWindow = window.open("../extranet/acceso.clientes.php","EXTRANET","resizable=no,scrollbars=auto,top=0,left=0,width=800,height=718");
}
function politica(){
doPopUpWindow = window.open("politica.htm","POLITICA_DE_PRIVACIDAD","resizable=no,scrollbars=yes,width=500,height=400");
}

function accesoclientes_ingteclat(){
  if (window.event.keyCode == 13){	
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Incorrect Data");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=no,scrollbars=no,top=0,left=0,width=800,height=600");
        window.close();
    }
  }
}
function accesoclientes_ing(){
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Incorrect Data");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=no,scrollbars=no,top=0,left=0,width=800,height=600");
        window.close();
    }
}
function accesoclientes_casteclat(){
  if (window.event.keyCode == 13){	
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Datos Incorrectos");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=yes,scrollbars=yes,top=0,left=0,width=800,height=600");
        window.close();
    }
 }
}

function accesoclientes_cas(){
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Datos Incorrectos");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=yes,scrollbars=yes,top=0,left=0,width=800,height=600");
        window.close();
    }
}
function accesoclientes_catteclat(){
  if (window.event.keyCode == 13){	
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Dades Incorrectes");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=yes,scrollbars=no,top=0,left=0,width=800,height=600");
        window.close();
    }
  }
}
function accesoclientes_cat(){
    if (document.clientes.login.value != "empresa" || document.clientes.password.value != "extranet"){
        alert("Dades Incorrectes");
    }
    else{
        window.open ("../extranet/clientes.htm","EXTRANET","resizable=yes,scrollbars=no,top=0,left=0,width=800,height=600");
        window.close();
    }
}
function abrirmenu(id){
	x = document.getElementById('s'+id);
	x.style.display = 'block';
}

function cerrarmenu(id){
	x = document.getElementById('s'+id);
	x.style.display = 'none';
}

function web_audit(){
  if (document.webaudit.url.value == "" ){
	  alert("-Debe escribir una URL");
      document.webaudit.url.focus();	  
	  return false;
  }
  if (document.webaudit.email.value=="" ||  document.webaudit.email.value.indexOf('@',0) == -1 || document.webaudit.email.value.indexOf('.',0) == -1){
      alert("-E-mail de Contacto vacío o incorrecto");
      document.webaudit.email.focus();	  
      return false;
  }
  if (!document.webaudit.politica.checked){
      alert ("- Debe aceptar la Política de Privacidad");
	  return false;
  }	
}
<!--------------------------------------------------------------- FUNCIONS DEL FORMULARI DE BAIXA DE TREBALLADORS ---------------------------------------------------------->
function baja(){
  if (document.b.nombre.value==""){
      alert("-Debe escribir un nombre");
	  document.b.nombre.focus();
	  return false;
  }
  if (document.b.apellidos.value==""){
      alert("-Debe escribir los apellidos");
	  document.b.apellidos.focus();
	  return false;
  }
  if (document.b.fechabaja.value==""){
      alert("-Debe escribir la fecha de la baja");
	  document.b.fechabaja.focus();
	  return false;
  }
  if (document.b.motivo.selectedIndex==0){
      alert("-Debe escoger una opción");
	  document.b.motivo.focus();
	  return false;
  }
  if (document.b.empresa.value==""){
      alert("-Debe escribir el nombre de la empresa");
	  document.b.empresa.focus();
	  return false;
  }
  if (document.b.centro.value==""){
      alert("-Debe escribir el nombre del centro de trabajo");
	  document.b.centro.focus();
	  return false;
  }
  if (!document.b.politica.checked){
      alert ("- Debe aceptar la Política de Privacidad");
	  return false;
  }
}
<!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

<!----------------------------------------------------------------- FUNCIONS DEL FORMULARI D'ALTA DE TREBALLADORS ----------------------------------------------------------->
function alta(){
   if (document.a.fecha.value==""){
      alert("-Debe escribir la fecha de alta");
	  document.a.fecha.focus();
	  return false;
  }
   if (document.a.nombre.value==""){
      alert("-Debe escribir un nombre");
	  document.a.nombre.focus();
	  return false;
  }
   if (document.a.apellidos.value==""){
      alert("-Debe escribir los apellidos");
	  document.a.apellidos.focus();
	  return false;
  }
   if (document.a.ss.value==""){
      alert("-Debe escribir el número de la Seg. Social");
	  document.a.ss.focus();
	  return false;
  }
   if (document.a.salario.value==""){
      alert("-Debe escribir el salario bruto anual");
	  document.a.salario.focus();
	  return false;
  }
   if (document.a.nacimiento.value==""){
      alert("-Debe escribir su fecha de nacimiento");
	  document.a.nacimiento.focus();
	  return false;
  }
   if (document.a.dni.value==""){
      alert("-Debe escribir el DNI/NIF/Pasaporte");
	  document.a.dni.focus();
	  return false;
  }
   if (document.a.provincia.value==""){
      alert("-Debe escribir la provincia");
	  document.a.provincia.focus();
	  return false;
  }
   if (document.a.municipio.value==""){
      alert("-Debe escribir el municipio");
	  document.a.municipio.focus();
	  return false;
  }
   if (document.a.domicilio.value==""){
      alert("-Debe escribir el domicilio");
	  document.a.domicilio.focus();
	  return false;
  }
   if (document.a.cp.value==""){
      alert("-Debe escribir el Código Postal");
	  document.a.cp.focus();
	  return false;
  }
   if (document.a.categoria.value==""){
      alert("-Debe escribir su categoría profesional");
	  document.a.categoria.focus();
	  return false;
  }
   if (document.a.pagas.selectedIndex==0){
      alert("-Debe seleccionar el número de pagas");
	  document.a.pagas.focus();
	  return false;
  }
   if (document.a.contrato.selectedIndex==0){
      alert("-Debe seleccionar el tipo de contrato");
	  document.a.contrato.focus();
	  return false;
  }
   if (document.a.duracion.selectedIndex==0){
      alert("-Debe seleccionar la duración del contrato");
	  document.a.duracion.focus();
	  return false;
  }
   if (document.a.jornada.selectedIndex==0){
      alert("-Debe seleccionar la jornada");
	  document.a.jornada.focus();
	  return false;
  }
   if (document.a.distribucion.value==""){
      alert("-Debe escribir la distribución de jornada");
	  document.a.distribucion.focus();
	  return false;
  }
  if (document.a.empresa.value==""){
      alert("-Debe escribir el nombre de la empresa");
	  document.a.empresa.focus();
	  return false;
  }
  if (document.a.centro.value==""){
      alert("-Debe escribir el nombre del centro de trabajo");
	  document.a.centro.focus();
	  return false;
  }
  if (!document.a.politica.checked){
      alert ("- Debe aceptar la Política de Privacidad");
	  return false;
  }
}
function otrospagas(valor) {
 if (valor == "Otros") {
	x = document.getElementById('pagasotros');
	x.innerHTML = '<input name="potros" type="text" class="formula4" id="potros" size="40" maxlength="40">';
 }
}
function otroscontrato(valor) {
 if (valor == "Otros") {
	x = document.getElementById('contratotros');
	x.innerHTML = '<td><input name="cotros" type="text" class="formula4" id="cotros" size="40" maxlength="40"></td>';
 }
}
function otrosduracion(valor) {
 if (valor == "Otros") {
	x = document.getElementById('duracionotros');
	x.innerHTML = '<td><input name="dotros" type="text" class="formula4" id="dotros" size="40" maxlength="40"></td>';
 }
}
<!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<!----------------------------------------------------------------- FUNCIONS DEL FORMULARI COMUNICACIO I.T.'S ----------------------------------------------------------->

function its(){
  if (document.comunicacionits.trabajador.value==""){
      alert("- Debe escribir el Nombre del Trabajador.");
	  document.comunicacionits.trabajador.focus();
	  return false;
  }
  if (document.comunicacionits.fecha.value==""){
      alert("- Debe escribir la Fecha del Parte.");
	  document.comunicacionits.fecha.focus();
	  return false;
  }
  if (document.getElementById('confirmacion').checked) {
  	if (document.comunicacionits.numparte.value=="") {
      	alert("- Debe escribir el Número del Parte.");
	  	document.comunicacionits.numparte.focus();
	  	return false;
  	}
  }
  if (!document.comunicacionits.politica.checked){
      alert ("- Debe aceptar la Política de Privacidad");
	  return false;
  }
}
<!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<!----------------------------------------------------------------- FUNCIONS DEL FORMULARI COMUNICACIO ACCIDENTE ----------------------------------------------------------->

function accidentes(){
  if (document.acc.trabajador.value==""){
      alert("- Debe escribir el Nombre del Trabajador.");
	  document.acc.trabajador.focus();
	  return false;
  }
  if (document.acc.accidente.value==""){
      alert("- Debe escribir la Fecha del Accidente.");
	  document.acc.accidente.focus();
	  return false;
  }

  if (document.acc.baja.value=="") {
      alert("- Debe escribir la Fecha de Baja.");
	  document.acc.baja.focus();
	  return false;
  }
  if (!document.acc.politica.checked){
      alert ("- Debe aceptar la Política de Privacidad");
	  return false;
  }
}