weekdays 	= new Array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");
months 		= new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
today 		= new Date();
weekday 	= today.getDay();
monthday 	= today.getDate();
month 		= today.getMonth();
year 		= today.getFullYear();
weekday		= weekdays[weekday];
month 		= months[month];
dateString	= (String(weekday))+" "+(String(monthday))+" "+(String(month))+" de "+(String(year));
var xmlHttp;
var xmlHttpStream;
var xmlHttp1;
var xmlHttpStream1;
var OW   = new Object();
function GetXmlHttpObject(handler){
	var objXmlHttp=null;	
	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		objXmlHttp = new XMLHttpRequest();
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 		
	}
	if(window.ActiveXObject){// code for IE6, IE5
		objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		objXmlHttp.onreadystatechange=handler 		
	}
	if(objXmlHttp==null){alert("Your Browser Does Not Suppport AJAX")}
	return objXmlHttp;
}
function AplicarCernicalos(){
	var ids = document.form.id.value;
	var nic = document.form.nic.value;
	if (nic=="" || nic <= 0) {alert("Este Expediente No posee NIC asociado, por lo que esta operacion no procede .....");return}
	var str = "lan=es&appid=RTM_v30&clase=inmueble&id="+ids+"&nic="+nic;
    var URL	= "/cgi-bin/RTM_v30/pl/aplicar_cernicalos_s.pl";
	//alert(URL+"?"+str);
    xmlHttp	= GetXmlHttpObject(stateAplicarCernicalos);
    xmlHttp.open("POST",URL,true) ;
    xmlHttp.send(str);
}
function stateAplicarCernicalos(){
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
        xmlHttpStream = xmlHttp.responseText;
		if (xmlHttpStream=="Los Datos se Guardaron Correctamente.") {
			alert(xmlHttpStream);
			//this.close();
		}else{
			alert(xmlHttpStream);			
		}
    }
}
function EliminarCernicalosSistema(){
	var ids = document.form.id.value;
	var nic = document.form.nic.value;
	if (nic=="" || nic <= 0) {alert("Este Expediente No posee NIC asociado, por lo que esta operacion no procede .....");return}
	var str = "lan=es&appid=RTM_v30&clase=inmueble&id="+ids+"&nic="+nic;
    var URL	= "/cgi-bin/RTM_v30/pl/eliminar_cernicalos_sistema_s.pl";
	//alert(URL+"?"+str);
    xmlHttp	= GetXmlHttpObject(stateEliminarCernicalosSistema);
    xmlHttp.open("POST",URL,true) ;
    xmlHttp.send(str);
}
function stateEliminarCernicalosSistema(){
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
        xmlHttpStream = xmlHttp.responseText;
		if (xmlHttpStream=="Los Datos se Eliminaron Correctamente.") {
			alert(xmlHttpStream);
			//this.close();
		}else{
			alert(xmlHttpStream);			
		}
    }
}