// JavaScript Document


// text links
function restyle(id, newClass) {
  var identity=document.getElementById(id);
  identity.className=newClass;
}




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// newer ones


if (document.images) {

var onImgArray = new Array();

onImgArray["star"] = new Image;
onImgArray["star1"] = new Image;
onImgArray["star2"] = new Image;
onImgArray["star3"] = new Image;
onImgArray["star4"] = new Image;
onImgArray["star5"] = new Image;
onImgArray["star6"] = new Image;
onImgArray["star7"] = new Image;
onImgArray["star8"] = new Image;
onImgArray["star9"] = new Image;

onImgArray["circle"] = new Image;
onImgArray["circle1"] = new Image;
onImgArray["circle2"] = new Image;
onImgArray["circle3"] = new Image;
onImgArray["circle4"] = new Image;
onImgArray["circle5"] = new Image;
onImgArray["circle6"] = new Image;
onImgArray["circle7"] = new Image;
onImgArray["circle8"] = new Image;
onImgArray["circle9"] = new Image;

onImgArray["homebutton1"] = new Image;
onImgArray["homebutton2"] = new Image;

onImgArray["corpchat"] = new Image;
onImgArray["corpemail"] = new Image;
onImgArray["corpfaq"] = new Image;


onImgArray["nav1"] = new Image;
onImgArray["nav2"] = new Image;
onImgArray["nav3"] = new Image;
onImgArray["nav4"] = new Image;
onImgArray["nav5"] = new Image;
onImgArray["nav6"] = new Image;

onImgArray["nav1"].src = "images/home-on.gif";
onImgArray["nav2"].src = "images/services-on.gif";
onImgArray["nav3"].src = "images/skills-on.gif";
onImgArray["nav4"].src = "images/product-on.gif";
onImgArray["nav5"].src = "images/partners-on.gif";
onImgArray["nav6"].src = "images/contactus-on.gif";


onImgArray["star"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star1"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star2"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star3"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star4"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star5"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star6"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star7"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star8"].src = "http://www.liveperson.com/images/star_on.gif";
onImgArray["star9"].src = "http://www.liveperson.com/images/star_on.gif";

onImgArray["circle"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle1"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle2"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle3"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle4"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle5"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle6"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle7"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle8"].src = "http://www.liveperson.com/images/circle_on.gif";
onImgArray["circle9"].src = "http://www.liveperson.com/images/circle_on.gif";

onImgArray["homebutton1"].src = "http://www.liveperson.com/images/HM_BTN_ON.gif";
onImgArray["homebutton2"].src = "http://www.liveperson.com/images/HM_BTN_ON.gif";

onImgArray["corpchat"].src = "http://www.liveperson.com/images/corp_btn_on.gif";
onImgArray["corpemail"].src = "http://www.liveperson.com/images/corp_email_btn_on.gif";
onImgArray["corpfaq"].src = "http://www.liveperson.com/images/corp_faq_btn_on.gif";



var offImgArray = new Array ();

offImgArray["star"] = new Image;
offImgArray["star1"] = new Image;
offImgArray["star2"] = new Image;
offImgArray["star3"] = new Image;
offImgArray["star4"] = new Image;
offImgArray["star5"] = new Image;
offImgArray["star6"] = new Image;
offImgArray["star7"] = new Image;
offImgArray["star8"] = new Image;
offImgArray["star9"] = new Image;

offImgArray["circle"] = new Image;
offImgArray["circle1"] = new Image;
offImgArray["circle2"] = new Image;
offImgArray["circle3"] = new Image;
offImgArray["circle4"] = new Image;
offImgArray["circle5"] = new Image;
offImgArray["circle6"] = new Image;
offImgArray["circle7"] = new Image;
offImgArray["circle8"] = new Image;
offImgArray["circle9"] = new Image;

offImgArray["homebutton1"] = new Image;
offImgArray["homebutton2"] = new Image;

offImgArray["corpchat"] = new Image;
offImgArray["corpemail"] = new Image;
offImgArray["corpfaq"] = new Image;


offImgArray["nav1"] = new Image;
offImgArray["nav2"] = new Image;
offImgArray["nav3"] = new Image;
offImgArray["nav4"] = new Image;
offImgArray["nav5"] = new Image;
offImgArray["nav6"] = new Image;


offImgArray["nav1"].src = "images/home.gif";
offImgArray["nav2"].src = "images/services.gif";
offImgArray["nav3"].src = "images/skills.gif";
offImgArray["nav4"].src = "images/product.gif";
offImgArray["nav5"].src = "images/partners.gif";
offImgArray["nav6"].src = "images/contactus.gif";


offImgArray["star"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star1"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star2"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star3"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star4"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star5"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star6"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star7"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star8"].src = "http://www.liveperson.com/images/star_off.gif";
offImgArray["star9"].src = "http://www.liveperson.com/images/star_off.gif";

offImgArray["circle"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle1"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle2"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle3"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle4"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle5"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle6"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle7"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle8"].src = "http://www.liveperson.com/images/circle_off.gif";
offImgArray["circle9"].src = "http://www.liveperson.com/images/circle_off.gif";

offImgArray["homebutton1"].src = "http://www.liveperson.com/images/HM_BTN_Off.gif";
offImgArray["homebutton2"].src = "http://www.liveperson.com/images/HM_BTN_Off.gif";

offImgArray["corpchat"].src = "http://www.liveperson.com/images/corp_btn_off.gif";
offImgArray["corpemail"].src = "http://www.liveperson.com/images/corp_email_btn_off.gif";
offImgArray["corpfaq"].src = "http://www.liveperson.com/images/corp_faq_btn_off.gif";

}


function imageOn(imgName) { 
	if (document.images) {
		document.images[imgName].src = onImgArray[imgName].src;
		}
}


function imageOff(imgName) { 
	if (document.images) {
		document.images[imgName].src = offImgArray[imgName].src;
		}
}


// for news bar  and quotes

// JavaScript Document

// Extension written by David G. Miles (http://www.z3roadster.net/dreamweaver/) 
//based in part on code written by Thomas Brattli (http://www.bratta.com)
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/

function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
  
var speed=50 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('newsContainer') 
    objScroller=new ConstructObject('newsContent','newsContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 

} 

function displayStatusMsg(msgStr) { 
  status=msgStr;
  document.returnValue = true;
}

function preloadImages() { 
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImgRestore() { 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); return x;
}

function swapImage() { 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

// this is for the menu ... 

/*
 * menuDropdown.js - implements a dropdown menu based on a HTML list
 * Author: Dave Lindquist (http://www.gazingus.org)
 */

var currentMenu = null;

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    actuator.onmouseover = function() {
        if (currentMenu) {
            currentMenu.style.visibility = "hidden";
            this.showMenu();
        }
    }

    actuator.onclick = function() {
        if (currentMenu == null) {
            this.showMenu();
        }
        else {
            currentMenu.style.visibility = "hidden";
            currentMenu = null;
        }

        return false;
    }
	

    actuator.showMenu = function() {
        menu.style.left = this.offsetLeft + "px";
        menu.style.top = this.offsetTop + this.offsetHeight + "px";
        menu.style.visibility = "visible";
        currentMenu = menu;
    }
}
		
		

