// Some site pages are now hosted under a different domain,
// so need a fully qualified path for the resource root.
siteResourceRoot = "http://vigilan.com/"

// JavaScript Document
aboutUsOn=new Image()
aboutUsOn.src=siteResourceRoot + "pix/nav/aboutUs_on.gif"
aboutUsOff=new Image()
aboutUsOff.src=siteResourceRoot + "pix/nav/aboutUs_off.gif"

productsOn=new Image()
productsOn.src=siteResourceRoot + "pix/nav/productsSolutions_on.gif"
productsOff=new Image()
productsOff.src=siteResourceRoot + "pix/nav/productsSolutions_off.gif"

serviceOn=new Image()
serviceOn.src=siteResourceRoot + "pix/nav/serviceSupport_on.gif"
serviceOff=new Image()
serviceOff.src=siteResourceRoot + "pix/nav/serviceSupport_off.gif"

testimonialsOn=new Image()
testimonialsOn.src=siteResourceRoot + "pix/nav/testimonialsCaseStudies_on.gif"
testimonialsOff=new Image()
testimonialsOff.src=siteResourceRoot + "pix/nav/testimonialsCaseStudies_off.gif"

newsOn=new Image()
newsOn.src=siteResourceRoot + "pix/nav/newsEvents_on.gif"
newsOff=new Image()
newsOff.src=siteResourceRoot + "pix/nav/newsEvents_off.gif"

function swingMenu(itemID, whichWay, hideLeft, hideRight) {
	if(whichWay == 'open') {
		if (document.layers) {
			swingCommand = "document." + itemID + ".dispaly = 'block'";
		} else if (document.all) {
			swingCommand = "document.all." + itemID + ".style.display='block';";
		} else if (document.getElementById) {
			swingCommand = "document.getElementById('" + itemID + "').style.display = 'block'";
		}
		eval(swingCommand);
		if (hideLeft != '') {
			if (document.layers) {
				hideLeftCommand = "document." + hideLeft + ".dispaly = 'none'";
			} else if (document.all) {
				hideLeftCommand = "document.all." + hideLeft + ".style.display='none';";
			} else if (document.getElementById) {
				hideLeftCommand = "document.getElementById('" + hideLeft + "').style.display = 'none'";
			}
			eval(hideLeftCommand);
		}
		if (hideRight != '') {
			if (document.layers) {
				hideRightCommand = "document." + hideRight + ".dispaly = 'none'";
			} else if (document.all) {
				hideRightCommand = "document.all." + hideRight + ".style.display='none';";
			} else if (document.getElementById) {
				hideRightCommand = "document.getElementById('" + hideRight + "').style.display = 'none'";
			}
			eval(hideRightCommand);
		}	
	} else if (whichWay == 'close') {
		if (document.layers) {
			swingCommand = "document." + itemID + ".dispaly = 'none'";
		} else if (document.all) {
			swingCommand = "document.all." + itemID + ".style.display='none';";
		} else if (document.getElementById) {
			swingCommand = "document.getElementById('" + itemID + "').style.display = 'none'";
		}
		setTimeout("eval(swingCommand)", 500);
	}
}

function imHotTop(whosHot,whosOpen){
	eval('document.' + whosHot + '.src=' + whosHot + 'On.src');
	if (whosOpen != ''){
		switch(whosOpen) {
			case 'aboutSub':
				whosLeft = '';
				whosRight = 'productsSub';
				break
			case 'productsSub':
				whosLeft = 'aboutSub';
				whosRight = 'serviceSub';
				break
			case 'serviceSub':
				whosLeft = 'productsSub';
				whosRight = 'testimonialsSub';
				break
			case 'testimonialsSub':
				whosLeft = 'serviceSub';
				whosRight = 'newsSub';
				break
			case 'newsSub':
				whosLeft = 'testimonialsSub';
				whosRight = '';
				break	
			default:
				whosLeft = '';
				whosRight = '';
		} 
		eval("swingMenu('" + whosOpen + "', 'open','" + whosLeft + "','" + whosRight + "');");
	}	
}

function imColdTop(whosCold,whosClosed){
	eval('document.' + whosCold + '.src=' + whosCold + 'Off.src');
	if (whosClosed != ''){
		switch(whosClosed) {
			case 'aboutSub':
				whosLeft = '';
				whosRight = 'productsSub';
				break
			case 'productsSub':
				whosLeft = 'aboutSub';
				whosRight = 'serviceSub';
				break
			case 'serviceSub':
				whosLeft = 'productsSub';
				whosRight = 'testimonialsSub';
				break
			case 'testimonialsSub':
				whosLeft = 'serviceSub';
				whosRight = 'newsSub';
				break
			case 'newsSub':
				whosLeft = 'testimonialsSub';
				whosRight = '';
				break
			default:
				whosLeft = '';
				whosRight = '';
		} 
		eval("swingMenu('" + whosClosed + "', 'close','" + whosLeft + "','" + whosRight + "');");
	}	
}
function imHot(whosHot) {
	whosHot.style.backgroundColor='#CBC6DA';
	// whosHot.style.textDecoration='underline';
}
function imCold(whosHot) {
	whosHot.style.backgroundColor='#E3E0EB';
	// whosHot.style.textDecoration='none';
}