var is_available=false;var client_url="https://www.interactive-host.com/ls/customer_session.jsf?ac=1198148241369";var combo_code=null; //************************************************************************* //* //* HBR Labs CONFIDENTIAL //* ___________________ //* //* Copyright 2008 HBR Labs Incorporated //* All Rights Reserved. //* //* NOTICE: All information contained herein is, and remains //* the property of HBR Labs Incorporated and its suppliers, //* if any. The intellectual and technical concepts contained //* herein are proprietary to HBR Labs Incorporated and its //* suppliers and may be covered by U.S. and Foreign Patents, //* patents in process, and are protected by trade secret or copyright law. //* Dissemination of this information or reproduction of this material //* is strictly forbidden unless prior written permission is obtained //* from HBR Labs Incorporated. //**************************************************************************/ var HBR_URL = "https://www.interactive-host.com"; var ts = (new Date()).getTime(); var is_ie = 0; //var is_ie7 = 0; var is_ie6 = 0; var is_quirks_mode = 0; var available_url = ""; var wdw; loadjscssfile(HBR_URL + "/SWF/hbrCloser.swf", "swf"); init_browser_params(); //window_maximize function maximazes browser window //this function does not work with IE tabbed window function window_maximize() { window.moveTo(0,0); if (document.all) { window.resizeTo(screen.availWidth,screen.availHeight); } else if (document.layers || document.getElementById) { if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth){ top.window.outerHeight = top.screen.availHeight; top.window.outerWidth = top.screen.availWidth; } } } function init_browser_params(){ if(navigator.appName.indexOf("Microsoft")!=-1){ is_ie = 1; } //if(parseFloat(navigator.appVersion.split('MSIE')[1]) == 7){ // is_ie7 = 1; //} if(parseFloat(navigator.appVersion.split('MSIE')[1]) == 6){ is_ie6 = 1; } } function hbr_load2(){ hbr_load(client_url); } function hbr_load(ref) { if(is_ie){ wdw = window.open(ref, "InteractiveSession", "resizable=yes, fullscreen=yes"); }else{ wdw = window.open(ref, "InteractiveSession", "width=" + screen.width +", height=" + screen.height + ", top=0, left=0, resizable=yes"); } return false; } function hbr_load_window(ref) { window_maximize(); var scrollXY = getScrollXY(); var sizeHW = getSize(); document.getElementById('hbr_content').style.top=scrollXY[1] + "px"; document.getElementById('hbr_content').style.left=scrollXY[0] + "px"; if(is_ie6 || is_quirks_mode){ slowlyResizeIE6(0,0,ref,sizeHW[0],sizeHW[1]); }else{ slowlyResize(0,0,ref); } return true; } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; } function getSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; is_quirks_mode = 1; } return [ myHeight, myWidth ]; } //this function requires iframe size in pixels function loadContentIE6(ref,iframe_height,iframe_width){ var page_ref = ref + "&hbrp=" + ts; document.getElementById('hbr_content').innerHTML =''; } //this function works with % size to enable window resizing in the future function loadContent(ref){ var page_ref = ref + "&hbrp=" + ts; document.getElementById('hbr_content').innerHTML =''; } //this function requires iframe size in pixels function slowlyResizeIE6(div_height,div_width,ref,iframe_height, iframe_width){ if(div_width <= iframe_width){ document.getElementById('hbr_content').style.width = div_width + "px"; document.getElementById('hbr_content').style.height = div_height + "px"; div_height=div_height + iframe_height/100; div_width=div_width + iframe_width/100; if(div_width <= iframe_width){ setTimeout("slowlyResizeIE6("+ div_height + "," + div_width + ",'" + ref + "'," + iframe_height + "," + iframe_width + ")",10); }else{ loadContentIE6(ref,iframe_height,iframe_width); } } } function slowlyResize(div_height,div_width,ref){ if(div_width <= 100){ document.getElementById('hbr_content').style.width = div_width + "%"; document.getElementById('hbr_content').style.height = div_height + "%"; div_height=div_height + 1; div_width=div_width + 1; if(div_width <= 100){ setTimeout("slowlyResize("+ div_height + "," + div_width + ",'" + ref + "')",10); }else{ loadContent(ref); } } } function hbr_close_window(){ document.getElementById('hbr_content').innerHTML = ''; document.getElementById('hbr_content').style.width = '0px'; document.getElementById('hbr_content').style.height = '0px'; return true; } function loadjscssfile(filename, filetype){ if (filetype=="js"){ //if filename is a external JavaScript file var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", filename); document.getElementsByTagName("head")[0].appendChild(fileref); }else if (filetype=="css"){ //if filename is an external CSS file var fileref=document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", filename); document.getElementsByTagName("head")[0].appendChild(fileref); }else if (filetype=="swf"){ //if filename is an external SWF file document.getElementById('hbr_flash_div').innerHTML = "" + "" + "" + "" + "" + "" + ""; } } function get_image(av_url){ if(is_available == true){//at list one expert available document.getElementById('hbr_availability_image').src = av_url; document.getElementById('hbr_availability_image').onclick=hbr_load2; document.getElementById('hbr_availability_image').onmouseover=document.getElementById('hbr_availability_image').style.cursor='hand'; document.getElementById('hbr_availability_image').onmouseout=document.getElementById('hbr_availability_image').style.cursor='pointer'; } } // ***************************** account combobox ******************************** function combo_call(){ var combo = document.getElementById("combo"); var ac = combo.options[combo.selectedIndex]; hbr_load(HBR_URL + '/ls/customer_session.jsf?ac='+ ac.value); } function load_combo_code(){ if(is_available == true){ //set hbr button visible document.getElementById("hbr_image").style.display="";//inline //set combobox code document.getElementById('hbr_combo_div').innerHTML = combo_code; } } if(combo_code != null){ load_combo_code(); } // ***************************** for backup ******************************** function get_image1(ref,av_url){ var ac = ""; var aid = ""; var url = ""; var ac_index = ref.indexOf("?ac="); var aid_index = ref.indexOf("?aid="); available_url = av_url; client_url=ref; if(ac_index > 0){ ac = ref.substring(ac_index + 4, ref.length); url = HBR_URL + "/ls/iav?ac=" + ac + "&ts=" + new Date().getTime(); } if(aid_index > 0){ aid = ref.substring(aid_index + 5, ref.length); url = HBR_URL + "/ls/iav?aid=" + aid + "&ts=" + new Date().getTime(); } var xmlhttp = createReguest(); alert(xmlhttp); xmlhttp.open("GET",url ,true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { var is_available = xmlhttp.responseText; if(is_available == "true"){ document.getElementById('hbr_availability_image').src = available_url; document.getElementById('hbr_availability_image').onclick=hbr_load2; document.getElementById('hbr_availability_image').onmouseover=document.getElementById('hbr_availability_image').style.cursor='hand'; document.getElementById('hbr_availability_image').onmouseout=document.getElementById('hbr_availability_image').style.cursor='pointer'; } } } xmlhttp.send(null); } function createReguest(){ var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; }