//-------------------browsercheck.js--------------------
function BrowserCheck() {
  var b = navigator.appName
  var vn = navigator.appVersion;
  if (b=="Netscape") this.b = "ns"
  else if (b=="Microsoft Internet Explorer") this.b = "ie"
  else this.b = b;
  this.v = parseInt(navigator.appVersion)
  this.ns = (this.b=="ns" && this.v>=4)
  this.ns4 = (this.b=="ns" && this.v==4)
  this.ns5 = (this.b=="ns" && this.v==5)
  this.ie = (this.b=="ie" && this.v>=4)
  this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
  this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
  this.mac = (vn.indexOf("Mac") != -1);
  this.linux = (vn.indexOf("Linux") != -1);
  this.pc = (true);
  if (this.ie5) this.v = 5
  this.min = (this.ns||this.ie)
  this.dom = (document.all && document.getElementById) ? 2 : (document.getElementById) ? 3 : (document.layers) ? 1 : 0;
}

// automatically create the "is" object
is = new BrowserCheck();

loadStr = "";

//function stat(s) {
//    window.status = s;
//    return true;
//}
function stat(s) {
  setTimeout("window.status = '" + s + "'",10);
}

function kBase() { var kBaseWin=window.open('http://server.iad.liveperson.net/hc/s-40989059/cmd/kb/kbvisitorcontrol.jsp','knowledgebase','width=700,height=500,scrollbars=yes,resizable=yes'); kBaseWin.focus();}

function viewDemo(){
  if (typeof(demoWin) == "undefined" || demoWin.closed) {
    demoWin=window.open("/demo/start_collab.html","NextPageDemo","width=560,height=510"); demoWin.focus();
  } else {
    demoWin.focus();
  }
}
function viewRetentionDemo(){
  if (typeof(demoWin) == "undefined" || demoWin.closed) {
    demoWin=window.open("/demo/start_retention.html","NextPageDemo","width=560,height=510"); demoWin.focus();
  } else {
    demoWin.focus();
  }
}

function loadImages() {
  if(document.images) {
    if (!document.arImages) arImages=new Array(); arList = loadImages.arguments;
    for (i=0; i < arList.length; i++) { arImages[i] = new Image(); arImages[i].src = arList[i]; }
  }
}

loadImages("/assets/images/home/arrow_on.gif");

loadImages("/i/global/nav-arrow-on.gif");
loadImages("/i/global/nav-bullet-on.gif");
function liteArrow(id,lev,on) { var img=document.images["navarrow" + id]; if (img) img.src='/i/global/nav-'+ ((lev==2)?'bullet':'arrow') +((on)?'-on':'')+'.gif'; }

////////////////////// START SEARCH BOX CODE //////////////////////////
if (typeof(adjLeft) == "undefined") adjLeft = 514;
if (typeof(adjTop) == "undefined") adjTop = 102;

t2 = true;
function posSearchBox() {
  headTop = 0;
  if (is.ie) {
    headTop = document.all.imHead.offsetTop;
    headLeft = document.all.imHead.offsetLeft;
  }
  if (is.dom == 3) {
    headTop = document.getElementById('imHead').offsetTop;
    headLeft = document.getElementById('imHead').offsetLeft;
  }
  searchTop = adjTop + headTop;
  searchLeft = adjLeft + headLeft;
  if (is.mac && is.ie) {
    document.all.searchBox.style.top = (searchTop - 1 - document.all.imBottom.offsetTop) + "px";
    document.all.searchBox.style.left = (searchLeft-2) + "px";
  } else if (is.ns4) {
    document.layers.searchBox.moveTo(searchLeft,(document.images.imHead.y + searchTop));
  } else if (is.dom > 2) {
      document.getElementById("searchBox").style.zIndex = "top";
      document.getElementById("searchBox").style.top = (searchTop) + "px";
      document.getElementById("searchBox").style.left = (searchLeft) + "px";
  } else {
      document.all.searchBox.style.zIndex = 1000;
    document.all.searchBox.style.top = (searchTop) + "px";
    document.all.searchBox.style.left = (searchLeft) + "px";
  }
}
//loadStr += "posSearchBox();";

searchHtmlStr = "";

if (is.ns4) {
  searchHtmlStr = "<layer id='searchBox' top='60' left='" + adjLeft + "' width='172' z-index='70' visibility='hide'>";
} else if (is.mac && is.ie) {
  searchHtmlStr = "<div id='searchBox' style='position:absolute; top:0px; left:0px; width:172px; z-index:70; visibility:hidden'>";
} else {
  searchHtmlStr = "<div id='searchBox' style='position:absolute; top:60px; left:" + adjLeft + "px; width:172px; z-index:70; visibility:hidden'>";
}

searchHtmlStr += "<table cellpadding=0 cellspacing=0 border=0><tr><td><form name='searchForm' action='/search/index.asp' method='post'><input type='hidden' name='NewQuery' value='yes'/></td><td>";
searchHtmlStr += "<table cellpadding=0 cellspacing=0 border=0 width='160' class='sBoxBG'>";
searchHtmlStr += "<tr class='sBox'><td nowrap='nowrap' class='searchcopy'>Search for:</td>";
searchHtmlStr += "<td align='right'><a href='javascript:void(0)' onclick='hideSearch()'><img src='/assets/images/close.gif' alt='' border=0></a><br></td>";
searchHtmlStr += "</tr><tr class='sBoxBG'><td colspan='2' height='4'></td></tr><tr class='sBoxBG'>";
searchHtmlStr += "<td colspan='2'>";
if (is.ns4 || is.mac) {
  searchHtmlStr += "<input onkeyup='checkEnter(event);' type='text' name='searchQuery' size='18'>";
} else {
  searchHtmlStr += "<input onkeyup='checkEnter(event);' type='text' name='searchQuery' class='sInput'>";
}
searchHtmlStr += "</td>";
if (is.mac && is.ie) searchHtmlStr += "</tr><tr><td colspan='2' height='4'></td>";
searchHtmlStr += "</tr><tr class='sBoxBG'>";
searchHtmlStr += "<td colspan=2>";
if (imHome) {
	searchHtmlStr += "<input type=\"submit\" value=\"Go\" border=0 vspace='7'/><br>";
} else {
	searchHtmlStr += "<input type=\"image\" src=\"/assets/images/buttons/search_go_btn.gif\" border=0 vspace='7'/><br>";
}
searchHtmlStr += "</td>";
searchHtmlStr += "</tr></table>";
searchHtmlStr += "</td><td></form></td></tr></table>";
if (is.ns4) {
  searchHtmlStr += "</layer>";
} else {
  searchHtmlStr += "</div>";
}

function showSearch(){
  if(t2) {
    posSearchBox();
    if(is.dom == 3){
      var elmt = document.getElementById("searchBox");
      elmt.style.visibility = "visible";
    } else if (is.ie) {
      document.all["searchBox"].style.visibility = "visible";
    } else if (is.ns4) {
      document["searchBox"].visibility = "show";
    }
    if (is.ns4) {
      setTimeout("document.layers.searchBox.document.searchForm.searchQuery.focus();", 30);
    } else {
      setTimeout("document.searchForm.searchQuery.focus();", 30);
    }
  } else {
    document.location = "/search/index.asp"
  }
}

function hideSearch(){
  if(is.dom == 3){
    var elmt = document.getElementById("searchBox");
    elmt.style.visibility='hidden';
  } else if (is.ie) {
    document.all["searchBox"].style.visibility = "hidden";
  } else if (is.ns4) {
    document["searchBox"].visibility = "hide";
  }
}

function checkEnter(evnt) {
  var characterCode;
  if (evnt && evnt.which) characterCode = evnt.which;
  else characterCode = evnt.keyCode;
  if (characterCode == 13) {
    //document.searchForm.submit();
    return false;
  }
  return true;
}

function openLivePerson() {
  var livePersonWin = window.open('http://server.iad.liveperson.net/hc/40989059/?cmd=file&file=visitorWantsToChat&site=40989059&referrer='+escape(document.location),'chat40989059','width=472,height=320');
  livePersonWin.focus();
//  return false;
}

////////////////////// END SEARCH BOX CODE //////////////////////////
/*
if (typeof(window.onload) != "function") {
  eval("window.onload = function() {" + loadStr + "}");
} else {
  strOnLoad = window.onload.toString();
  eval("window.onload = " + strOnLoad.substring(0, strOnLoad.lastIndexOf("}")) + loadStr + "};");
}
*/
frstAlrt = true;
function verAlert(num){
  verStr = "NextPage 1.5 works only with Office XP and 2003. If you have any questions, please contact npsupport@nextpage.com.";
  if (frstAlrt && (num.toString() == "3" || num.toString() == "4")) {
    alert(verStr);
    frstAlrt = false;
  }
}
startList = function() {
	//alert("i");
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}