");
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 + "