//-------------------------------------------------------//
// Author:Rodolfo Machon
// Company:WebSoft, SA de CV 
// Nombre del archivo: inmueble.balance.rept.js
// Created: 2016-08-02
// Updates: 2016-08-02
// Copyright - All Rights Reserved
//-------------------------------------------------------//
//-------------------------------------------------------//
var isIE    = document.all?true:false;
var isNS    = document.layers?true:false;
var lan	    = document.form.lan.value;
var appid	= document.form.appid.value;
var clase   = document.form.clase.value;
var id      = document.form.id.value;
var xmlHttp11;
var xmlHttpStream11;
//-------------------------------------------------------//
window.onload = function(){

}
//-------------------------------------------------------//
function getUserCajaDepartamento(){
    var URL     = "/cgi-bin/RTM_v30/pl/user.caja.departamento.get.pl?appid=RTM_v30&lan=es";
    //alert(URL);
    xmlHttp11	= GetXmlHttpObject(getUserCajaDepartamentoSC);
    xmlHttp11.open("GET",URL,true) ;
	xmlHttp11.setRequestHeader("Content-type", "application/x-www-form-urlencoded");    
    xmlHttp11.send(null);
}
function getUserCajaDepartamentoSC(){
    if (xmlHttp11.readyState==4 || xmlHttp11.readyState=="complete"){ 
        xmlHttpStream11=xmlHttp11.responseText;
		//alert(xmlHttpStream11);
        var datos=xmlHttpStream11.split("|");
        document.form.i8_user_id.value				= datos[0];
        document.form.v128_user.value				= datos[1]+" "+datos[2];
        document.form.i2_tipo_departamento_id.value	= datos[3];
        document.form.v64_tipo_departamento.value	= datos[4];
    }
}
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;
}