// Copia de AGENDA.JS

function agenda(strFecha) {
	//var pagina = self.location.href.match( /\/([^/]+)$/ )[1];
	var pagina = self.location.href;
	//alert( pagina );
	if (pagina != "eventos.php"){
		
		
		var frm = document.FormAgenda;
		frm.hidFecha.value = strFecha;
		frm.submit();
		
		/*var div = document.getElementById("");
		var strValues = "hidFecha="+strFecha;
		ajaxHTML("POST", "eventos.php", div, strValues);
		*/
		return;
		
		
		
		
	}
	
	else{
		
	  var frm = document.Form;
	  frm.action = "eventos.php";
	  if(strFecha) {
		frm.hidFecha.value = strFecha;
		frm.submit();
		return;
	  } else {
		frm.hidFecha.value = "";
		var objCheck = new check("Form");
		objCheck.checkString("txtFiltro", "buscador", 4, 100, true);
		strError = objCheck.toString();
		if(strError == "") {
			frm.submit();
		} else {
			alert(strError);
		}
	  }	
	}
}



function verMes(intMes, intAno){
	div = document.getElementById("divAgenda");
	div.innerHTML = '<img src="images/ajax.gif">';
	var d = (new Date()).getSeconds();
	ajaxHTML("GET", "ajaxAgenda.php?mes=" + intMes + "&ano=" + intAno + "&d=" + d, div);
}


function verMesCalendario(intMes, intAno){
	div = document.getElementById("divCalendario");
	div.innerHTML = '<img src="images/ajax.gif">';
	var d = (new Date()).getSeconds();
	ajaxHTML("GET", "ajaxCalendario.php?mes=" + intMes + "&ano=" + intAno + "&d=" + d, div);
}

// FIN Copia de AGENDA.JS


// Copia de LOGIN.JS

function iniciar() {
		var frm = document.FormLogin;
		var strError = '';
		var objCheck = new check("FormLogin");
		
		/* Limpio los campos */
		LimpiarCampo(frm.txtEmail, 'E-mail');
		LimpiarCampo(frm.txtPassword, 'clave');

		//objCheck.checkEmail("txtEmail", "email", 1, 255, false);
		objCheck.checkString("txtEmail", "email", 1, 50, false);
		objCheck.checkString("txtPassword", "contraseņa", 1, 30, false);
		
		strError = objCheck.toString();
		
		if (strError == "") {
			frm.hidEnviar.value = "1";
			frm.submit();
		}
		else {
			alert (strError);
		}

}


// Fin Copia de LOGIN.JS

// Copia de MAPA.JS


function actualizarMapa(intTipo){
	//div = document.getElementById("map2");
	//div.innerHTML = '<img src="images/ajax.gif">';
	//ajaxHTML("GET", "ajaxMapa_completo.php?tipo=" + intTipo , div);
	simple_ajax('ajaxMapa_completo.php', 'GET', 'tipo=' + intTipo)
}

function tiempoMunicipio(intId){
	//div = document.getElementById("map2");
	//div.innerHTML = '<img src="images/ajax.gif">';
	//ajaxHTML("GET", "ajaxMapa_completo.php?tipo=" + intTipo , div);
	simple_ajax('ajaxMapa_tiempo_municipios.php', 'GET', 'id=' + intId)
}

// FIN Copia de MAPA.JS

// Copia FUNCIONES_GENERALES.JS
function CapturarEnter(e, strFuncion){
		if(document.all){
       intTecla=event.keyCode;
    } else {
       intTecla=e.which; 
    }
 	  if(intTecla==13){
        eval(strFuncion);
  	}
}
// FIN
