function lanzaMensaje(msg) {
  msg = msg.replace(/xxx/i, "\n");
  alert (msg);
}

function send(f) {
  f.submit();
}

function confirmOperation(f,op) {
  var msg;
  switch (op) {
    case "CompraSMS":
      msg = "Se dispone a comprar mediante mensaje SMS";
      break;
    case "CompraBONO":
      var marcado;
      marcado = false;
      for (i=0;i<f.radIdBono.length;i++){
        if (f.radIdBono[i].checked) {
          marcado = true;
          break;
        }
      }
      if (marcado) {
        msg = "Se dispone a comprar mediante un Bono";
      } else {
        alert("Debe de marcar uno de los bonos disponibles");
        return;
      }
  }
  if (confirm(msg+'.\n\n¿Desea continuar?')) f.submit();
}

var ventana;

function openIT(URL,name,prop) {
  if (ventana) {
    if (ventana.closed) {
      ventana=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      ventana.focus();
    }
    else {
      ventana=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      ventana.focus();
    }
  }
  else {
      ventana=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");          
      ventana.focus();
  }
}

function printIt() {
  window.print();
}

function zoomText(Accion,Elemento){
  //inicializaciones
  obj=document.getElementById(Elemento);
  if (obj.style.fontSize==""){
  obj.style.fontSize="100%";
  }
  actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto
  incremento=10;// el valor del incremento o decremento en el tamaño
  
  //accion sobre el texto
  if(Accion=="reestablecer"){
  obj.style.fontSize="100%"
  }
  if(Accion=="aumentar"){
  valor=actual+incremento;
  obj.style.fontSize=valor+"%"
  }
  if(Accion=="disminuir"){
  valor=actual-incremento;
  obj.style.fontSize=valor+"%"
  }
}


function login(f) {
  if ((f.pass.value != "") && (f.user.value != ""))
    f.submit();
  else
    alert("Debe rellenar obligatoriamente\nel usuario y la password");
}

//mostrar y ocultar capas (div)

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
//With nested layers for netscape, this function hides the layer if it's visible and visa versa
function showHide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	if(obj.visibility=='visible' || obj.visibility=='show') obj.visibility='hidden'
	else obj.visibility='visible'
}

//Shows the div
function show(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='visible'
}
//Hides the div
function hide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='hidden'
}