//-------------------------------------------------------//
// Author:Rodolfo Machon
// Company:WebSoft, SA de CV 
// Nombre del archivo: inmueble_observaciones_gdfl.js
// Created: 2016-07-25
// Updates: 2016-07-25
// Copyright - All Rights Reserved
//-------------------------------------------------------//
//-------------------------------------------------------//
var xmlHttp1;
var xmlHttpStream1;
var xmlHttpStream;
//-------------------------------------------------------//
window.onload = function(){
	getUserName();	
}
//-------------------------------------------------------//
function GetXmlHttpObject(handler){ 
    var objXmlHttp=null
    if (navigator.userAgent.indexOf("Opera")>=0){
		alert("This program doesn't work in Opera") 
		return 
    }
    if (navigator.userAgent.indexOf("MSIE")>=0){ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0){
			strName="Microsoft.XMLHTTP"
		} 
		try{ 
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler 
			return objXmlHttp
		}catch(e){ 
			alert("Error. Scripting for ActiveX might be disabled") 
			return 
		} 
    } 
    if (navigator.userAgent.indexOf("Mozilla")>=0){
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
    }
}
function getUserName(){      
    var appid 	= "RTM_v30";
    var lan 	= "es";
    var URL     = "/cgi-bin/RTM_v30/pl/user.name.get.pl?appid="+appid+"&lan="+lan+"";
    xmlHttp1	= GetXmlHttpObject(getUserNameSC);
    xmlHttp1.open("GET",URL,true) ;
    xmlHttp1.send(null);
}
function getUserNameSC(){
    if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete"){ 
        xmlHttpStream1=xmlHttp1.responseText;
        if (xmlHttpStream1!="false" && xmlHttpStream1!=""){
			var user_a = xmlHttpStream1.split("|");
           document.master.i8_user_id.value	= user_a[0];
           document.master.v32_fname.value	= user_a[1];
           document.master.v32_lname.value	= user_a[2];
        }
    } 
}
//-------------------------------------------------------//