var nav_img_type = (section == 'home' || (section == 'products' && subsection == 'slurpabowls')) ? '.b' : '';
load_img('nav_products_off','/img/nav.products.off' + nav_img_type + '.gif');
load_img('nav_products_on','/img/nav.products.on' + nav_img_type + '.gif');
load_img('nav_aboutus_off','/img/nav.aboutus.off' + nav_img_type + '.gif');
load_img('nav_aboutus_on','/img/nav.aboutus.on' + nav_img_type + '.gif');
load_img('nav_storelocator_off','/img/nav.storelocator.off' + nav_img_type + '.gif');
load_img('nav_storelocator_on','/img/nav.storelocator.on' + nav_img_type + '.gif');
load_img('nav_contactus_off','/img/nav.contactus.off' + nav_img_type + '.gif');
load_img('nav_contactus_on','/img/nav.contactus.on' + nav_img_type + '.gif');
load_img('nav_howtoorder_off','/img/nav.howtoorder.off' + nav_img_type + '.gif');
load_img('nav_howtoorder_on','/img/nav.howtoorder.on' + nav_img_type + '.gif');

var locked = new Array();
// image pre-loader
function load_img(imgObj,imgSrc) {
	if(document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

// rollover function
// pass bool r for "on" state
function roll(img,r) {
	if(document.images) {
		if(locked.length > 0) {
			for(i=0; i<locked.length; i++) {
				if(locked[i] == img) { return false; }
			}
		}
		(r) ? eval('document.images["'+img+'"].src = '+img+'_on.src') : eval('document.images["'+img+'"].src = '+img+'_off.src')
	}
}

// correctly handle PNG transparency in Win IE 5.5 or higher.
function fixPNG(myImage) {
	if (window.ie55up) {
		var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
		var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
		var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
		var imgStyle = "display:inline-block;" + myImage.style.cssText 
		var strNewHTML = "<span " + imgID + imgClass + imgTitle
		strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
		strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>" 
		myImage.outerHTML = strNewHTML
		}
	}

function mail(name,host,text) {
	str = "";
	str += '<a href=';
	str += '"mailto:';
	str += name;
	str += '@';
	str += host;
	str += '.com" class="maintext">';
	str += (text != '') ? text : name+"@"+host+".com";
	str += '</a>';
	return str;
	}
