var tMenuPicPath="../../img/";

var arrow_over = new Image();
arrow_over.src = tMenuPicPath+"triangle_over.gif";
var arrow_off = new Image();
arrow_off.src = tMenuPicPath+"triangle_on_off.gif";

var bkg_on = new Image();
bkg_on.src = tMenuPicPath+"stripe_on.gif";

function switchImg(imgSource, imgDest){
//	alert(imgSource);
//	alert(imgDest);
	imgDest = getImage(imgDest);
	imgDest.src = imgSource.src
}

function show(object) {
/* alert(object); */
if (document.getElementById && (document.getElementById(object)!=null)) {
	document.getElementById(object).style.visibility = 'visible';
	}
	if (document.getElementById('formselect') != null){		
		document.getElementById('formselect').style.visibility="hidden";		
	}
}

function hide(object) {
//alert(object)
if (document.getElementById && (document.getElementById(object)!=null)) {
	document.getElementById(object).style.visibility = 'hidden';
	}
	
	if (document.getElementById('formselect') != null){		
		document.getElementById('formselect').style.visibility="visible";		
	}
}

function getImage(name){
	if (document.all)	// IE
		return eval('document.all.' + name);
	else if (document.getElementById && !document.all)	// NS6
		//return document.getElementById(name);
		return findImage(name, document);
	if (document.layers)	// NS4
		return findImage(name, document);
	return null;
}

function findImage(name, doc) {
	var i, img;
	for (i = 0; i < doc.images.length; i++)
	if (doc.images[i].name == name)
		return doc.images[i];
	for (i = 0; i < doc.layers.length; i++)
	if ((img = findImage(name, doc.layers[i].document)) != null) {
		img.container = doc.layers[i];
		return img;
	}
	return null;
}

var url_over = "url("+tMenuPicPath+"stripe_over.gif) repeat-x";
function menuOver(navMenu) {
	if (navMenu == 2 || navMenu == 6) {
		switchImg(arrow_over,'navarr'+navMenu);
		document.getElementById('hd'+navMenu).style.background = url_over;
		document.getElementById('menu'+navMenu).style.color="#323218";
	}
}

var url_off = "url("+tMenuPicPath+"stripe_off.gif) repeat-x";
function menuOut(navMenu) {
	if (navMenu == 2 || navMenu == 6) {
		switchImg(arrow_off,'navarr'+navMenu);
		document.getElementById('hd'+navMenu).style.background = url_off;
		document.getElementById('menu'+navMenu).style.color="#ffffff";
	}
}

function popUp(url) {
	window.open(url, 'ContentWindow', 'width=600,height=500,menubar=no,location=no,resizable=yes,toolbar=no,scrollbars=yes,status=no,left=256,top=192')
}

// Set variables for Omniture
var pathName = window.location.pathname;
if (pathName.indexOf('www.homedepot.ca') > 0 || pathName.indexOf('secure.homedepot.ca') > 0) {
	var s_account="homedepotca";
} else {
	var s_account="homedepotcadev";
}
