//	Por defecto se establece navegador firefox ...
var isIE = false;

//	Creamos una variable para el objeto XMLHttpRequest
var req;

//	Creamos una funcion para cargar los datos en nuestro objeto.

function vs_comm(modo,entrada,seccion,tipo) {
	//	Firefox...
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = vs_comm_process;
		req.open("GET", "vscomm/vscomm_java/vs_comm_modo.php?modo=" + modo + "&entrada=" + entrada + "&seccion=" + seccion + "&tipo=" + tipo, true);
		req.send(null);
	//	... Explorer
	} else if (window.ActiveXObject) {
		isIE = true;
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = vs_comm_process;
			req.open("GET", "vscomm/vscomm_java/vs_comm_modo.php?modo=" + modo + "&entrada=" + entrada + "&seccion=" + seccion + "&tipo=" + tipo, true);
			req.send();
		}
	}
}

//	Funcion que se llama cada vez que se dispara el evento onreadystatechange
//	del objeto XMLHttpRequest

function vs_comm_process(){
	var detalles = document.getElementById("vs_comm");
	if(req.readyState == 4){
		detalles.innerHTML = req.responseText;
	} else {
		detalles.innerHTML = '<div align="center"><img src="loading.gif" /></div>';
	}
}

function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('Todos los campos son obligatorios, el campo mail debe contener una direccion correcta.');
    document.MM_returnValue = (errors == '');
} }
//-->