// set up variables for layer animation
// up for home page
var direction = "home";


///////////////////////
// Mouseover scripts here
///////////////////////

//preload highlighted

communitiesHi = new Image(135, 26);
communitiesHi.src = "new_images/communities_on.gif";
companyHi = new Image(105, 26);
companyHi.src = "new_images/company_on.gif";
careHi = new Image(110, 26);
careHi.src = "new_images/care_on.gif";
improvementHi = new Image(170, 26);
improvementHi.src = "new_images/improvement_on.gif";
plansHi = new Image(106, 26);
plansHi.src = "new_images/smart_on.gif";
buyHi = new Image(142, 26);
buyHi.src = "new_images/buying_on.gif";

//lowlighted icon substitutions

communitiesLo = new Image(135, 26);
communitiesLo.src = "new_images/communities_off.gif";
companyLo = new Image(105, 26);
companyLo.src = "new_images/company_off.gif";
careLo = new Image(110, 26);
careLo.src = "new_images/care_off.gif";
improvementLo = new Image(170, 26);
improvementLo.src = "new_images/improvement_off.gif";
plansLo = new Image(106, 26);
plansLo.src = "new_images/smart_off.gif";
buyLo = new Image(142, 26);
buyLo.src = "new_images/buying_off.gif";

function hiLite(icon) {
	theMouseItem = icon;
	turnedOn = eval(icon + "Hi.src");	
		if (ie || dom) {document.images[theMouseItem].src = turnedOn;}
		if (nn) {document.navigation.document.images[theMouseItem].src = turnedOn;}
}


// Non is for assorted mouseovers that aren't in the nav bar

function hiLiteNon(nonicon) {
	thenonMouseItem = nonicon;
	turnedOn = eval(nonicon + "Hi.src");
		if (ie || dom) {document.images[thenonMouseItem].src = turnedOn;}
		if (nn) {document.background.document.images[thenonMouseItem].src = turnedOn;}
}

function loLiteNon(nonicon) {
	thenonMouseItem = nonicon;
	turnedOff = eval(thenonMouseItem + "Lo.src");
		if (ie || dom) {document.images[thenonMouseItem].src = turnedOff;}
		if (nn) {document.background.document.images[thenonMouseItem].src = turnedOff;}
}

// hilite and lolite TD for nav items
function hiLiteNavTD(cell) {
      if (ie) {
         thisObj = eval("document.all." + cell + ".style");
      }
      if (nn) {
        thisObj = eval("document.layers['" + cell + "'].style");
      }
      if (dom) {
        thisObj = eval("document.getElementById('" + cell + "').style");
      }
      thisObj.background="#333333";
      }
      
function loLiteNavTD(cell) {
      if (ie) {
         thisObj = eval("document.all." + cell + ".style");
      }
      if (nn) {
        thisObj = eval("document.layers['" + cell + "'].style");
      }
      if (dom) {
         thisObj = eval("document.getElementById('" + cell + "').style");
      }
      thisObj.background="#333333";
      }


// script for spawning new window

function openWindow(page,windowName,width,height,tools) {

// if window has already been opened and is behind main window,
// bring to front

		if (tools != 1) {
				showTools = ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no";
				} else {
				showTools = ",resizable=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes";
				} 

    if (navigator.appName == 'Netscape') {
        adjWidth = width + 16;
        adjHeight = height + 16;
    }
    else {
        adjWidth = width + 16;
        adjHeight = height + 16;
    }
    
    myWin = window.open(page,'windowName','width=' + adjWidth + ',height=' + adjHeight + showTools);

	if (!myWin.focus()) {
		myWin.focus();
	}
	
}
