ns4 = (document.layers)? true:falseie4 = (document.all)? true:false        // velocidad del scrollvar vel = 3        //pixels de desplazamientovar desp = 1        // variable de control de carga completavar cargado = 0;function init() {         cargado=1 // se completo la carga de la página         scrollWindow = new DynLayer('scrollWindowDiv');         scrollContent = new DynLayer('scrollContentDiv','scrollWindowDiv')         myscroll = new MiniScroll(scrollWindow,scrollContent)         }function MiniScroll(window,content) {        this.window = window        this.content = content        this.content.slideInit()        this.contentHeight = (ns4)? this.content.doc.height : this.content.event.scrollHeight        this.offsetHeight = this.contentHeight        this.up = MiniScrollUp        this.down = MiniScrollDown        this.stop = MiniScrollStop}function MiniScrollUp() {	this.content.slideTo(null,0,desp,vel)}function MiniScrollDown() {	this.content.slideTo(null,-this.offsetHeight,desp,vel)}function MiniScrollStop() {        this.content.slideActive = false}var Ventana2;// width=""function popup(URL,name,prop) {  if (Ventana2) {    if (Ventana2.closed) {      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");      Ventana2.focus();    }    else {      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");      Ventana2.focus();    }  }  else {      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");                Ventana2.focus();  }}function lanzaMensaje(msg) {  msg = msg.replace(/xxx/g, "\n");  alert (msg);}// Copia el valor de un desplegable a un campo de texto de un mismo formulario.function copia(f,ori,des) {  var sel = 0;  eval('sel=f.'+ori+'.options.selectedIndex');  if (sel!=0) {	  eval('f.'+des+'.value=f.'+ori+'.options[sel].text');	}}function esVacio(s) {     for(var i = 0; i < s.length; i++) {         var c = s.charAt(i);         if ((c != ' ') && (c != '\n') && (c != '\t')) return false;     }     return true; }  function tieneComilla(s) {     for(var i = 0; i < s.length; i++) {         var c = s.charAt(i);         if (c == '\'') return true;     }     return false; }function validaFecha(f) {    dia=Number(f.substring(0,2));     mes=Number(f.substring(3,5));     ano=Number(f.substring(6,10));        sep1=f.charAt(2);     sep2=f.charAt(5);      if ((isNaN(dia) || isNaN(mes) || isNaN(ano)) ||         (sep1!='/' || sep2!='/') ||           !((dia>=1 && dia<=31) && (mes>=1 && mes<=12)) || (f.length!=10)) return false;      return true; }function enviar(f) {  errors = false;  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';  for (i=0; i < f.length; i++) {    e = f.elements[i];        if ((e.type=="select-one") || (e.type=="select-multiple")) {      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }    }        if ((e.type=="text") || (e.type == "textarea")) {      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }            if (e.fecha == "true" && !validaFecha(e.value)) {        if (e.value != "") {          msg += '-- Formato de fecha erróneo.\n';          errors = true;          continue;        }      }                   if (tieneComilla(e.value)) {        msg += '-- '+e.label+' tiene un carácter no válido.\n';        errors = true;        continue;      }    }  }    if (!errors) {    if (confirm('Se dispone a '+f.label+' registro/s.\n\n¿Desea continuar?')) f.submit();  }  else alert(msg);    }function enviar2(f) {  errors = false;  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';  for (i=0; i < f.length; i++) {    e = f.elements[i];        if ((e.type=="select-one") || (e.type=="select-multiple")) {      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }    }        if ((e.type=="text") || (e.type == "textarea")) {      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }            if (e.fecha == "true" && !validaFecha(e.value)) {        if (e.value != "") {          msg += '-- Formato de fecha erróneo.\n';          errors = true;          continue;        }      }                   if (tieneComilla(e.value)) {        msg += '-- '+e.label+' tiene un carácter no válido.\n';        errors = true;        continue;      }    }  }    if (!errors) {    f.submit();  }  else alert(msg);    }function busca(f) {  errors = false;  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';  for (i=0; i < f.length; i++) {    e = f.elements[i];        if ((e.type=="select-one") || (e.type=="select-multiple")) {      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }    }        if ((e.type=="text") || (e.type == "textarea")) {      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {        msg += '-- '+e.label+' es un campo obligatorio.\n';        errors = true;        continue;      }            if (e.fecha == "true" && !validaFecha(e.value)) {        if (e.value != "") {          msg += '-- Formato de fecha erróneo.\n';          errors = true;          continue;        }      }            if (tieneComilla(e.value)) {        msg += '-- '+e.label+' tiene un carácter no válido.\n';        errors = true;        continue;      }    }  }    if (!errors) {    f.submit();  }  else alert(msg);    }function confirma(URL,op) {  if (confirm('Se dispone a '+op+' registro/s.\n\n¿Desea continuar?')) document.location=URL;}function recarga(f,URL) {  f.action = URL;  f.submit();}function recarga2(f,URL) {  f.action = URL;  enviar(f);}function checkall(f) {  for (i=0; i < f.length; i++) {    e = f.elements[i];    e.checked = true;  }}function convert(what) {  val = eval('document.busc.'+what+'.value');  if (val!="") {    val = Math.ceil(val * 166.386);    if (isNaN(val))       val = '  Error en formato';    else         val = '   '+val+' ptas';    document.forms[what].texto.value = val;    return true;  }  return false;  }function 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 menuover(src,color,imageName) {     src.bgColor=color;    src.style.cursor="hand";     document[imageName+"flecha"].src = "imagenes/flecha.gif";    document[imageName+"cola"].src = "imagenes/cola.gif";} function menuout(src,color,imageName) {     src.bgColor=color;    src.style.cursor="default";    document[imageName+"flecha"].src = "imagenes/fondoblancotrans.gif";    document[imageName+"cola"].src = "../img_comunes/trans.gif";    }function botonover(src,color,imageName) {     src.bgColor=color;    src.style.cursor="hand";     document[imageName].src = "imagenes/flechaon.gif";} function botonout(src,color,imageName) {     src.bgColor=color;    src.style.cursor="default";    document[imageName].src = "imagenes/flechaoff.gif";} 