var h2_curr_domain = "asp.crmfacil.com" // "asp4.humano2.com"
var h20Home = "http://www.humano2.com/";
var h2_title = document.title;
var h2_referrer = document.referrer ;
var h2_href = document.URL ;
var h2_search = document.location.search
var h2_browser = BrowserSniffer();
var prefix = " ";
var h2_ASimg;
var h2_helpImg;
var h2_quitImg;
var h2_rejected = 'no';
var h2_timer = 0;
var h2_currpos = - 30;
var h2_loop_state = 1;
var h2_loop_count = 1;
var h2_retries = 0;
var h2_animstep = 3;
var h2_fborder = 100;
var h2_isNS = (document.layers) ? true : false;
var h2_isIE = (document.all) ? true : false;
var h2_gotImage = false;
var h2_dispLayer = false;
var h2_isSlidding = false;
var h2_ischatting = false;
var h2_gotimg = true;
var h2_goanimate = false;
var h2_dnloadComplete = true;
var h2_fdir = h2_animstep;
var h2_debug = false;
var h2_debug_asp = false;
var h2_login = false;
var h2_debug_win;
var h2_clid = '1530';
var h2_nick = '';
if (typeof h2_session == 'undefined')
h2_session = h2_readcookie("h2_session");
if ((typeof h2_session == 'undefined') || (h2_session == '')){
h2_session = "D58BF18C-A3B8-4121-A91C-E7838BDA43B1"
document.cookie = "h2_session = " + h2_session + "; path=/";
}
if (typeof h2_section == 'undefined') var h2_section='';
if (typeof h2_uid == 'undefined' && typeof h2_cookie_name != 'undefined')
h2_uid = h2_readcookie(h2_cookie_name);
if (typeof h2_uid != 'undefined' && h2_uid != "")
h2_login = true;
if ((typeof h2_uid == 'undefined')|| (h2_uid == ''))
h2_uid = h2_readcookie("h2_uid");
if ((typeof h2_uid == 'undefined') || (h2_uid == ''))
h2_uid = h2_session;
if ((typeof h2_nick == 'undefined') || (h2_nick == ''))
h2_nick = h2_uid
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
function layer_load(){
// REVISEMOS LOS DOMINIOS EN LISTA NEGRA
if ((h2_clid == '1416') || (h2_clid =='1851')){
// alert("ret -1" + h2_clid)
return (-1)
}
if (!h2_debug){
if (h2_search.indexOf("h2_debug") > 0)
h2_debug = true
}
if (!h2_debug_asp){
if (h2_search.indexOf("h2_debug_asp") > 0)
h2_debug = true
}
if (h2_debug){
h2_debug_win = open("","h2_debug_win", "'menubar=no,resizable=yes,scrollbars=yes,status=no,width=450,height=555');")
h2_debug_win.document.open("text/html", "replace");
h2_debug_win.document.write("Debugging on 200.27.248.139
");
}
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("just Opened window
");
if (h2_href.substr(0,5) == "https")
prefix = "https://"
else
prefix = "http://"
h2_gif_help = prefix + h2_curr_domain + "/as/gfx/" + h2_clid + "/need_help_on.gif"; // "../tools/need_help_on.gif"
h2_gif_help_alt = "Si hace clic en el globo se puede comunicar instantáneamente con un operador para obtener ayuda o más información. Pruébelo.";
h2_gif_close = prefix + h2_curr_domain + "/as/gfx/" + h2_clid + "/close.gif"; // "../tools/close.gif"
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("v2.0
");
if (h2_isIE) {
document.write('
');
document.write('
');
document.write('![]() |
');
document.write('![]() |
');
document.write('
');
} else if (h2_isNS) {
document.write('');
document.write('');
document.write(' |
');
document.write(' |
');
document.write('
');
}
urlstr = "";
document.write(urlstr);
return (0)
}
function h2_downloadImg(){
h2_ASimg= new Image;
var h2_params = "?h2_clid="+h2_clid+"&h2_session="+h2_session+"&h2_section="+h2_section+"&h2_title="+h2_title+
"&h2_uid="+h2_uid+"&h2_nick="+h2_nick+"&h2_rejected="+h2_rejected+"&h2_referrer="+h2_referrer +
"&h2_curr_url="+h2_href + "&h2_browser="+h2_browser + "&h2_debug_asp="+h2_debug_asp +
"&h2_login="+ h2_login + "×tamp="+h2_now();
h2_ASimg.src = prefix + h2_curr_domain + '/tools/default.asp' + h2_params;
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed){
h2_debug_win.document.writeln("Cookies: " + document.cookie + "
");
h2_debug_win.document.writeln("src: " + h2_ASimg.src + "
");
}
h2_gotImage = true;
}
function h2_checkWidth()
{
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("h2_gotImage: " + h2_gotImage + " downloaded? " + h2_ASimg.complete + "
");
if (h2_gotImage) {
h2_section = ""
if ((! h2_ASimg.complete))
{
h2_dnloadComplete = false;
return;
}
h2_retries = 0;
var w = h2_ASimg.width;
h2_dnloadComplete = true;
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("Width: " + w + "
");
if (w == 0)
return;
h2_gotImage = false;
if (w == 4) {
h2_asChat();
} else if (w == 2) {
h2_imgDisp();
} else if (w == 1) {
h2_imgHide();
}
}
}
function h2_now(){
var now = new Date();
return now.getTime();
}
function h2_ASloop()
{
var h2_maxRetries =6 // after 60 seconds we give up...
if (h2_retries > h2_maxRetries){
// alert("disabled")
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("LOOP DISABLED..");
return;
}
if ( h2_dnloadComplete)
{
h2_downloadImg();
h2_timer = 0;
h2_loop_count++;
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("
h2_loop_count "+ h2_loop_count + "
");
if (h2_loop_count == 4){
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("
Checking MSGS
");
h2_checkMsgs();
}
}
else
{
h2_timer++;
if (h2_timer == 10) // after 10 seconds it forces a reload of the image
{
// h2_ASimg.src = prefix + h2_curr_domain + "/h2/gfx/1x1.gif"; // "../tools/close.gif"
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("Forcing reload " + h2_retries + "
");
h2_retries++;
h2_gotImage = false;
h2_downloadImg();
h2_timer = 0;
}
}
h2_checkWidth();
if (h2_ischatting){
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("Chatting so reloading in 10 seconds
");
setTimeout('h2_ASloop()', 10000);
}else
setTimeout('h2_ASloop()', 3000);
}
function h2_asChat(){
h2_ischatting = true;
window.open(prefix + h2_curr_domain + '/as/Chatlogin.asp?clid='+h2_clid+'&h2_sess='+h2_session,'as_'+h2_clid,'resizable=yes,menubar=no,scrollbars=no,status=no,width=500,height=555');
}
function h2_dispLayerCheck()
{
if (h2_dispLayer) {
if (h2_isIE)
document.all.h2_ASlayer.style.visibility = "visible";
else if (h2_isNS)
document.layers.h2_ASlayer.visibility = "visible";
h2_setlayer();
}
setTimeout('h2_dispLayerCheck()', 1000);
}
function h2_takeRequest()
{
h2_rejected = 'no'
h2_imgHide();
h2_asChat();
return false;
}
function h2_denyRequest()
{
h2_rejected = 'yes'
h2_imgHide();
return false;
}
function h2_imgHide()
{
h2_dispLayer = false;
if (h2_isIE) {
document.all.h2_ASlayer.style.visibility = "hidden";
} else if (h2_isNS) {
document.layers.h2_ASlayer.visibility = "hidden";
}
}
function h2_imgDisp()
{
if (!h2_ischatting ) {
h2_dispLayer = true;
h2_checkimg("need_help").src =h2_gif_help;
h2_checkimg("h2_close").src =h2_gif_close;
h2_goanimate = true;
h2_helpImg = new Image();
h2_helpImg.src = h2_gif_help;
h2_quitImg = new Image();
h2_quitImg.src = h2_gif_close;
h2_goanimateStart();
}
}
function h2_goanimateStart()
{
if (h2_isIE) {
h2_fborder = document.body.clientWidth;
} else if (h2_isNS) {
h2_fborder = window.innerWidth;
}
if( !h2_isSlidding ) {
h2_goanimateImage();
h2_isSlidding = true;
}
}
function getImageWidth(name)
{
if (h2_isIE)
return (document.all(name)).width;
else
if (h2_isNS)
return (document[name]).width;
else
return null;
}
function h2_goanimateImage()
{
if (h2_gotimg && h2_goanimate)
h2_currpos = h2_currpos + h2_fdir;
if (h2_currpos > h2_fborder - 160)
h2_fdir = - h2_animstep;
if (h2_currpos < 10)
h2_fdir = h2_animstep
h2_setlayer();
// if ((h2_currpos > 30) || (h2_fdir > 0))
setTimeout("h2_goanimateImage()", 20);
}
function h2_setlayer()
{
var y = 40;
if (h2_isIE) {
document.all.h2_ASlayer.style.left = document.body.scrollLeft + h2_currpos;
document.all.h2_ASlayer.style.top = document.body.scrollTop + y;
} else if (h2_isNS) {
document.layers.h2_ASlayer.left = pageXOffset + h2_currpos;
document.layers.h2_ASlayer.top = pageYOffset + y;
}
}
function h2_checkimg(name)
{
var lays = document.layers;
if (! lays)
return document[name];
for (var i = 0; i < document.images.length; i++) {
if (document.images[i].name == name)
return document.images[i];
}
for (var l = 0; l < lays.length; l++) {
img = h2_checkimg(lays[l].document, name);
if (img != null)
return img;
}
return null;
}
function h2_cookie_test(){
var now = new Date();
timestamp1 = now.getTime()
setCookie("H2CookieTest",timestamp1,"","/")
timestamp2 = h2_readcookie("H2CookieTest")
if (timestamp1 == timestamp2)
return true;
else
return false;
}
function h2_checkMsgs(){
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("h2_login in h2_checkMsgs: " + h2_debug + "
");
if (h2_login == true) {
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("Message Refresh: " + prefix + h2_curr_domain + "/h2/asp/messages_refresh.asp?h2_session=" + h2_session +"&h2_debug=" + h2_debug+ "
");
else
document.invisible_h2.location = prefix + h2_curr_domain + "/h2/asp/messages_refresh.asp?h2_session=" + h2_session +"&h2_debug=" + h2_debug
}
}
//********************************************************************************************
// THIS IS WHERE IT ALL STARTS
//********************************************************************************************
if (layer_load() == 0 && window.navigator.cookieEnabled && h2_cookie_test()){
h2_ASloop();
setTimeout('h2_dispLayerCheck()', 1000);
// setTimeout('h2_checkMsgs()', 5000);
}
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("
typeof h2_cart" + typeof h2_cart);
if (typeof h2_cart != 'undefined') {
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("
Registering follow through
");
h2_AMimg= new Image;
id_contacto = ""
id_campaign = ""
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("id_contacto: " + id_contacto + "
id_campaign:" + id_campaign +"
");
if (id_contacto != "" && id_campaign != ""){
var h2_params = "?dominio="+h2_clid+"&id_contacto="+id_contacto+"&id_campaign="+id_campaign+
"&id_cart="+h2_cart + "×tamp="+h2_now();
h2_AMimg.src = prefix + h2_curr_domain + '/am/follow_up.asp' + h2_params;
if (h2_debug && h2_debug_win.open && !h2_debug_win.closed)
h2_debug_win.document.writeln("src: " + h2_AMimg.src + "
");
}
}
function BrowserSniffer()
{
// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
// is_nav, is_ie
// (2) browser version number:
// is_major (integer indicating major version number: 2, 3, 4 ...)
// is_minor (float indicating full version number: 2.02, 3.01, 4.04 ...)
// (3) OS platform and version:
// is_win,is_mac
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
// *** BROWSER VERSION ***
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
// Note: On IE, start of appVersion return 3 or 4
// which supposedly is the version of Netscape it is compatible with.
// So we look for the real version further on in the string
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
is_major = parseInt(is_minor);
}
// Netscape6 is mozilla/5 + Netscape6/6.0!!!
// Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
var nav6Pos = agt.indexOf('netscape6');
if (nav6Pos !=-1) {
is_minor = parseFloat(agt.substring(nav6Pos+10))
is_major = parseInt(is_minor)
}
// *** BROWSER VENDOR ***
var is_getElementById = (document.getElementById) ? "true" : "false"; // 001121-abk
var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
var is_ie = (iePos!=-1);
// *** PLATFORM ***
var is_win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac = (agt.indexOf("mac")!=-1);
var BrowserInfo="";
if (is_ie) BrowserInfo=BrowserInfo + "IE";
if (is_nav) BrowserInfo=BrowserInfo + "NAV";
BrowserInfo=BrowserInfo + "/" + is_minor + "/";
if (is_win) BrowserInfo=BrowserInfo + "WIN";
if (is_mac) BrowserInfo=BrowserInfo + "MAC";
return BrowserInfo;
}
function h2_readcookie(CookieName){
var CookieSet = document.cookie.split(';');var SetSize = CookieSet.length;
var CookiePieces;var ReturnValue ="";var x = 0;for (x = 0; ((x < SetSize)
&& (ReturnValue == "")); x++){CookiePieces = CookieSet[x].split ('=');
if (CookiePieces[0].substring (0,1) == ' ') CookiePieces[0] = CookiePieces[0].substring
(1, CookiePieces[0].length); if (CookiePieces[0] == CookieName) ReturnValue =
CookiePieces[1];}return ReturnValue;}
function message_write_name(id_login, subject){
args="&id_dest_user=" + id_login + "&subject=" + subject + "&h2_session=" + h2_session ;
url_str = prefix + h2_curr_domain +"/h2/asp/msg_write-0055.asp?msg_type=1" + args
msg_write = window.open(url_str,'msg_write','resizable=yes,menubar=no,location=no,toolbar=no,status=no,directories=no,width=350,height=450');
msg_write.focus();
// document.formShowOpen.submit();
}
function show_chat_dialog(room){
url_str = prefix + h2_curr_domain +"/h2/chat/MessagesLog.asp?usergrp=" + room
msg_write = window.open(url_str,'msg_write','resizable=yes,menubar=no,location=no,toolbar=no,status=no,directories=no,width=350,height=450,scrollbars=auto');
msg_write.focus();
}
function show_endbong(){
url_str = prefix + h2_curr_domain + "/h2/asp/edbong_contactos-0015.pasp"
edbong_win=window.open(url_str, 'edbong_win','resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=212,height=370');
}
function h2_showAR(id){
url_str = prefix + h2_curr_domain + "/ar/Genera_Form.asp?cuenta=" + id
edbong_win=window.open(url_str, 'showAR','resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,directories=no,width=212,height=370');
}
function h2_showAM(){
url_str = prefix + h2_curr_domain + "/am2/Formulario_AM.asp?dominio=" + h2_clid
edbong_win=window.open(url_str, 'showAM','resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,directories=no,width=212,height=370');
}