// set up variables for 
var direction = "down";

///////////////////////
// Mouseover scripts here
///////////////////////

//preload highlighted

aboutHi = new Image(66, 25);
aboutHi.src = "../images/nav/about_on.gif";
newsHi = new Image(45, 25);
newsHi.src = "../images/nav/news_on.gif";
communitiesHi = new Image(115, 25);
communitiesHi.src = "../images/nav/communities_on.gif";
contactHi = new Image(75, 25);
contactHi.src = "../images/nav/contact_main_on.gif";
mortgageHi = new Image(132, 25);
mortgageHi.src = "../images/nav/mortgage_on.gif";
buildingHi = new Image(147, 25);
buildingHi.src = "../images/nav/building_on.gif";
homeHi = new Image(44, 25);
homeHi.src = "../images/nav/home_on.gif";
homeownerHi = new Image(115, 25);
homeownerHi.src = "../images/nav/homeowner_on.gif";



//lowlighted icon substitutions

aboutLo = new Image(66, 25);
aboutLo.src = "../images/nav/about.gif";
newsLo = new Image(45, 25);
newsLo.src = "../images/nav/news.gif";
communitiesLo = new Image(115, 25);
communitiesLo.src = "../images/nav/communities.gif";
contactLo = new Image(75, 25);
contactLo.src = "../images/nav/contact_main.gif";
mortgageLo = new Image(132, 25);
mortgageLo.src = "../images/nav/mortgage.gif";
buildingLo = new Image(147, 25);
buildingLo.src = "../images/nav/building.gif";
homeLo = new Image(44, 25);
homeLo.src = "../images/nav/home.gif";
homeownerLo = new Image(115, 25);
homeownerLo.src = "../images/nav/homeowner.gif";


function hiLite(icon) {
	theMouseItem = icon;
	turnedOn = eval(icon + "Hi.src");
		if (ie) {document.images[theMouseItem].src = turnedOn;}
		if (nn) {document.navigation.document.images[theMouseItem].src = turnedOn;}
		if (dom) {document.images[theMouseItem].src = turnedOn;}
}

// 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="#666666";
      }

// 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;
        myWin = window.open(page,'windowName','width=' + adjWidth + ',height=' + adjHeight + showTools)
    }
    else {
        adjWidth = width + 16;
        adjHeight = height + 16;
        myWin = window.open(page,'windowName','width=' + adjWidth + ',height=' + adjHeight + showTools);
    }

	if (!myWin.focus()) {
		myWin.focus();
	}
	
}
