
	function turnDisplay(id) {
		if (document.getElementById(id).style.display == 'none' ) {
			document.getElementById(id).style.display = '' ;
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
	
	function turnOffDisplay(id) {
		document.getElementById(id).style.display = 'none';
	}
	
	function turnOnDisplay(id) {
		document.getElementById(id).style.display = '';
	}

	function getData( url, data , objId ) {
		req = false;
	    // branch for native XMLHttpRequest object
	    if(window.XMLHttpRequest) {
	    	try {
				req = new XMLHttpRequest();
	        } catch(e) {
				req = false;
	        }
	    // branch for IE/Windows ActiveX version
	    } else if(window.ActiveXObject) {
	       	try {
	        	req = new ActiveXObject("Msxml2.XMLHTTP");
	      	} catch(e) {
	        	try {
	          		req = new ActiveXObject("Microsoft.XMLHTTP");
	        	} catch(e) {
	          		req = false;
	        	}
			}
	    }
		if(req) {
			// Asigna el manejador de eventos.
			req.onreadystatechange = function () {
					if (req.readyState == 4) {
						if (req.status == 200) {
						    document.getElementById(objId).innerHTML = req.responseText;
						} else {
						    alert("There was a problem retrieving the data =( :\n" +
						        req.statusText);
						}
					}
				};
			req.open("GET", url + '?' + data, true);
			req.send('');
		}
			
	}
	
	function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("E-mail Inválido")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("E-mail Inválido")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("E-mail Inválido")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("E-mail Inválido")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("E-mail Inválido")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("E-mail Inválido")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("E-mail Inválido")
		    return false
		 }

 		 return true					
	}
	
	function checkNotNull(id) {
		if (document.getElementById(id).value.length > 0) {
			return true;
		} else {
		    document.getElementById(id).focus();
		    alert('El campo ' + id + ' es obligatorio');
		    return false;	
		}
	}
	