var fromMenu = null;
var holdtime = 100;
var htmlTags = "";
var indent = 240;
var isIE;
var isNav;
var layerlevel = 0;
var mouseOutTimer = null;
var mouseOverTimer = null;
var mouseoverhold = 300;
var navmenu = null;
var rollingtop = 100;
var rootMenu = null;
var submenu = null;
var timer;
var normalStyle = "solid";
var hiliteStyle = "solid";
var sitemenuProp1, sitemenuProp2, sitemenuProp3, sitemenuProp4
var menuItems = new Array();
var menuItemProps = new Array();
var menuid = null;

function OpenMenuSection(imgName, catid, imgWidth, imgHeight, imgAltText, imgSrc) {
	var imghtml
	var lyr
	var scrollX, scrollY
	var RootMenuContents
	
	imghtml = "<img align=bottom border=0 alt='" + imgAltText + "' "
	imghtml += "src='" + imgSrc + "' "
	imghtml += "height=" + imgHeight + " "
	imghtml += "width=" + imgWidth + ">"

	rollingtop = rollingtop +80;
	layerlevel = catid
	CreateLayer(layerlevel,indent,rollingtop,0,0,"",0);

	if (isIE) {
		scrollX = document.body.scrollLeft;
		scrollY = document.body.scrollTop;
	} 
	else if (isNav) {
		scrollX = window.pageXOffset;
		scrollY = window.pageYOffset;
	}
	
	RootMenuContents = loadmenus(catid)
	if (RootMenuContents == null) { return }

	openRootMenu(RootMenuContents,scrollX + indent,scrollY + rollingtop,0);
	rollingtop = rollingtop + 10;
	return;
}

function window_onload() {
	rollingtop = 100;
	if (isNav) {
		origWidth = window.innerWidth;
        origHeight = window.innerHeight;
        window.onresize = resizeHandler;

		if (document.layers['subscribe']) { rollingtop = 145; } 

	} else if (isIE) {

		if (document.all('subscribe')) { rollingtop = 145; }

	}
	window.scrollTo(0,0);
	
	OpenMenuSection("depimage",1,52,15,"Events/Demos","/graphics/departments.gif");	

	if (isNav) {
		if (document.layers['subscribe']) { document.layers['subscribe'].visibility='show'; }
		if (document.layers['menujava']) { document.layers['menujava'].visibility='show'; }
	}
}

function resizeHandler() {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		origWidth = innerWidth;
		origHeight = innerHeight;
		location.reload();
	}
}

function collapseRootMenu() {

	if (rootMenu) {
		rootMenu.hide();
		if (rootMenu.navmenu == 1) {
				  rootMenu = null;
		}
	}
}

function collapseMenu(e) {

	var iSep;
	var sToParse;
	var longstring;
	if (rootMenu) {
		rootMenu.hide();
		if (rootMenu.navmenu == 1) {
			rootMenu = null;
		}
	}

	sToParse = this.id;
	if (sToParse) {
		if (sToParse.indexOf("enu") > 0) {
			sTemp=sToParse.substring(4)		

			currMenuItem=menuItems[sTemp];
			currmenu=currMenuItem;

			if (currMenuItem.haschildren || currmenu.level==1){}
			else {
				if (timer) {
					clearTimeout(timer);
				}
				clearTimeout(mouseOverTimer);
				clearTimeout(mouseOutTimer);

				collapseRootMenu();
			}
		}
	}

	if (menuItems[menuid].onclick==null){return};	

	sToParse = menuItems[menuid].onclick;

	if (sToParse.indexOf("categoryDisplay")>0) {

		iSep = sToParse.indexOf("'")
		iSep = eval(iSep + 1)
		sTemp= sToParse.substring(iSep)
		iSep = sTemp.indexOf("'")
		grpid = sTemp.substring(0,iSep)
		
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		
		subid = sTemp.substring(0,iSep)
		
		

		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
	
		catid = sTemp.substring(0,iSep)
		
		
		
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)

		custom = sTemp.substring(0,iSep)
		

		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		//iSep = eval(iSep+90)
	
		page = sTemp.substring(0,iSep)
	
		categoryDisplay(grpid,catid,subid,custom,page)

	} else if (sToParse.indexOf("urlDisplay") > 0) {

		var iSep = sToParse.indexOf("'")
		iSep = eval(iSep + 1)
		sTemp=sToParse.substring(iSep)
		iSep = sTemp.indexOf("'")
		mURL = sTemp.substring(0,iSep)
		
		iSep = sTemp.indexOf(",")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf(")")
		mCatID = sTemp.substring(0,iSep)
		
		urlDisplay(mURL,mCatID);				
	}  else {

		iSep = sToParse.indexOf("'")
		iSep = eval(iSep + 1)
		sTemp=sToParse.substring(iSep)
		iSep = sTemp.indexOf("'")
		mCatTyp = sTemp.substring(0,iSep)
			
		iSep = sTemp.indexOf(",")
		iSep = eval(iSep + 1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf(",")
		mCatId = sTemp.substring(0,iSep)
			
		iSep = sTemp.indexOf("'")
		iSep = eval(iSep+1)
		sTemp = sTemp.substring(iSep)
		iSep = sTemp.indexOf("'")
		mCatTempl = sTemp.substring(0,iSep)
			
		categoryDisplay(grpid,catid,subid,custom,page);
	}
}

function openRootMenu(menu, left, top, z_index) {
	if (rootMenu) {
	  if (rootMenu.navmenu != 1) {
		  collapseRootMenu();
		}
	}
	
	if (timer) {
		clearTimeout(timer);
	}
	
	rootMenu = menu;

	z_index = 0;
	rootMenu.expand(left, top, z_index);
	rootMenu.show(left, top);
}

function showRootMenu(menu, left, top, z_index) {
	
	if (rootMenu) {
		collapseRootMenu();
	}

	if (timer) {
		clearTimeout(timer);
	}
	
	rootMenu = menu;
	
	z_index = 0;
 	rootMenu.show(left, top);
}

function menuItemProp(width, bgcolor, highlightcolor, borderwidth, imagesrc, imagewidth) {
	var id = menuItemProps.length;

	this.id = id;
	this.className = "menuProp" + id;
	this.width = width;
	this.bgcolor = bgcolor;
	this.highlightcolor = highlightcolor;
	this.borderwidth = borderwidth;
	this.imagesrc = imagesrc;
	this.imagewidth = imagewidth;
	menuItemProps[id] = this;
	return this;
}

function menuItem(label, onclick, img, sub_menu, props, haschildren, catid, level) {
	var id = menuItems.length;
	if (isIE) {
		htmlTags += "<div id=\"" + id + "\"";
		htmlTags += " class=\"" + props.className + "\"";
		htmlTags += " style=\"";
		htmlTags += " position: absolute;";
		htmlTags += " visibility: inherit;";
		htmlTags += " left: 0;";
		htmlTags += " top: 0;";
		htmlTags += " width: " + props.width + ";";
		//htmlTags += " width: 100;";
		htmlTags += " background-color: " + props.bgcolor +";";
		if (props.className == "menuProp0") {
			htmlTags += " padding: 0;";				// override CSS setting for menuProp
		} else {
			htmlTags += " padding: 1; line-height:1.1;";				// override CSS setting for menuProp
		}
		htmlTags += " z-index: -1;";
		htmlTags += "\"";
		htmlTags += " onmouseover=\"menuItem_mouseoverdelay('" + id + "');\"";
		htmlTags += " onmouseout=\"menuItem_mouseoutdelay('" + id + "');\"";
		if (onclick) {
			htmlTags += " onclick=\"collapseRootMenu();" + onclick + ";\"";
		}
		htmlTags += ">";
		if (haschildren) {
			htmlTags += "<img src=\"\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"2\">"	
		}else {
			if (level == 1){
		 		htmlTags += "<img src=\"\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"2\">"
			}else {
				htmlTags += "<img src=\"\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"\">"
				if(img == 1){
					htmlTags += "<img src=\"HIMAGES/menu_popupline.gif\" border=\"0\" width=\"50\" height=\"1\" vspace=\"3\">";
					htmlTags += "<img src=\"HIMAGES/orangedot.gif\" border=\"0\"  width=\"5\" height=\"5\" vspace=\"1\" hspace=\"0\">";
				}else{
					htmlTags += "<img src=\"\" border=\"0\" align=\"\" width=\"50\" height=\"1\" vspace=\"3\">";
					htmlTags += "<img src=\"\" border=\"0\"  align=\"\" width=\"5\" height=\"5\" vspace=\"1\" hspace=\"0\">";
				}
			}
		}
		htmlTags += "&#160;" + label
		if (label =='Home Wiring' || label =='Audio/Video'||label =='Cat6 Channel Solutions'){
		htmlTags += " " +"<font color=#FF0000></font>";
		}
		htmlTags += "</div>";
	} else if (isNav){
		htmlTags += "<layer id=\"" + "menu" + id + "\"";
		htmlTags += " class=\"" + props.className + "\"";
		htmlTags += " position=\"relative\"";
		htmlTags += " visibility=\"inherit\"";
		htmlTags += " left=0";
		htmlTags += " top=0";
		htmlTags += " width=" + props.width;
		htmlTags += " bgcolor=" + props.bgcolor;	
		if (props.className == "menuProp0") {
			htmlTags += " padding: 0;";				// override CSS setting for menuProp
		} else {
			htmlTags += " padding: 1; line-height:1.1;";				// override CSS setting for menuProp
		}
		htmlTags += " z-index=-1";
		htmlTags += " onmouseover=\"menuItem_mouseoverdelay('" + id + "');\"";
		htmlTags += " onmouseout=\"menuItem_mouseoutdelay('" + id + "');\"";
		
		htmlTags += ">";
		if (haschildren) {
		  //htmlTags += "<img src=\"" + props.imagesrc + "\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"2\">"
		} else {
		  //htmlTags += "<img src=\"/graphics/noimage.gif\" border=\"0\" align=right width=\"" + props.imagewidth + "\" vspace=\"2\">"
		}
		htmlTags += "&#160;" + label
		htmlTags += "</layer>";
	
		if (onclick) {
			this.onclick = onclick;
		} else {
			this.onclick = null;
		}
}
	this.menu = null;
	this.subMenu = sub_menu;

	this.img = null;
	this.seperator = null;
	this.haschildren = haschildren;
	this.submenuloaded = false;
	this.catid = catid;
	this.level = level;
	
	this.bgcolor = props.bgcolor;
	this.highlightcolor = props.highlightcolor;
	this.borderwidth = props.borderwidth;
	this.normalstyle = normalStyle;
	this.hilitestyle = hiliteStyle;

	menuItems[id] = this;
	return this;
}

function getMenuItem(id) {
	if (isIE) {
		return eval("document.all(\"" + id + "\")");
	} else if (isNav) {
		return eval("document.layers[\"" + id + "\"]");
	}
	return null;
}

function menuItem_mouseoverdelay(id) {
	var currMenuItem = menuItems[id];
	var currMenu = currMenuItem.menu;
	var obj = currMenuItem.obj;
	var objLeft, objTop, objWidth, objHeight, objZIndex;
	var pageLeft, pageRight, pageBottom, pageTop;
  
	if (timer) {
		clearTimeout(timer);
	}
	clearTimeout(mouseOverTimer);
	clearTimeout(mouseOutTimer);

	mouseOverTimer = setTimeout("menuItem_mouseover(" + id + ");",mouseoverhold)
	currMenu.setActiveMenuItem(currMenuItem);
	if (currMenuItem.level == 1) {
		if (currMenuItem.menu != rootMenu) {
			collapseRootMenu();
		}
		if (timer) {
			clearTimeout(timer);
		}
		rootMenu = currMenu;
	}
	
	if (isIE) {
		objLeft = obj.parentElement.style.pixelLeft;
		objTop = obj.style.pixelTop + obj.parentElement.style.pixelTop;
		objWidth = obj.offsetWidth;
		objHeight = obj.offsetHeight;
		objZIndex = obj.style.zIndex;
		pageLeft = document.body.scrollLeft;
		pageRight = document.body.clientWidth + document.body.scrollLeft;
		pageBottom = document.body.clientHeight + document.body.scrollTop;
		pageTop = document.body.scrollTop;
		if (objTop + objHeight > pageBottom) {
			window.scrollTo(0,pageTop + objHeight);
		}
		if (objTop - objHeight/2 < pageTop) {
			window.scrollTo(0,pageTop - objHeight);
		}
	}
	else if (isNav) {
		objLeft = obj.parentLayer.left;
		objTop = obj.top + obj.parentLayer.top;
		objWidth = obj.parentLayer.clip.width;
		objHeight = obj.clip.height;
		objZIndex = obj.zIndex;
		pageLeft = pageXOffset;
		pageRight = window.innerWidth + pageXOffset;
		pageBottom = window.innerHeight + pageYOffset;
		pageTop = window.pageYOffset;
		if (objTop + objHeight > pageBottom) {
			window.scrollTo(0,pageTop + objHeight);
		}
		if (objTop - objHeight/2 < pageTop) {
			window.scrollTo(0,pageTop - objHeight);
		}
		menuid = id
	}
}

function menuItem_mouseover(id) {
	var currMenuItem = menuItems[id];
	var currMenu = currMenuItem.menu;
	var obj = currMenuItem.obj;
	var submenu = null;
	var left, top, z_index;
	var objLeft, objTop, objWidth, objHeight, objZIndex;
	var pageLeft, pageRight, pageBottom;

	clearTimeout(timer);

	layerlevel = currMenuItem.catid;
	fromMenu = obj;
	
	if (currMenuItem.level == 1) {
		if (currMenuItem.menu != rootMenu) {
			collapseRootMenu();
		}
		if (timer) {
			clearTimeout(timer);
		}
		rootMenu = currMenu;
	}
	
	if ((currMenuItem.haschildren) && (! currMenuItem.submenuloaded)) {
   		htmlTags = ""; 
   		if (isIE) {
   			x = fromMenu.style.pixelLeft + fromMenu.style.pixelWidth - 4;
   			y = fromMenu.style.pixelTop + fromMenu.parentElement.style.pixelTop + 4;  
   			objZIndex = obj.style.zIndex
   		} else if (isNav) { 
   		x = fromMenu.left + fromMenu.clip.width - 4;
   		y = fromMenu.top + fromMenu.parentLayer.top + 4;  
  		 objZIndex = obj.zIndex;
   		}
   		if (fromMenu.navmenu == 1) {
   			layerlevel = rootMenu.id + layerlevel + "nav"
   		}
   		CreateLayer(layerlevel,x,y,0,0,"",0);
   		
		submenu = loadmenus(currMenuItem.catid);
		currMenuItem.subMenu = submenu;
		currMenuItem.submenuloaded = true;
		var left, top, z_index;
		z_index = objZIndex + 1;
		currMenuItem.subMenu.expand(0, 0, z_index);
	}
	
	currMenu.setActiveMenuItem(currMenuItem);

	if (currMenu.openSubMenu) {
		currMenu.openSubMenu.hide();
		currMenu.openSubMenu = null;
	}

	if (currMenuItem.subMenu) {
		if (currMenuItem.subMenu.width <= 0 || currMenuItem.subMenu.height <= 0) {
			currMenuItem.subMenu.calculateDimensions();
		}
		if (isIE) {
			objLeft = obj.parentElement.style.pixelLeft;
			objTop = obj.style.pixelTop + obj.parentElement.style.pixelTop;
			objWidth = obj.offsetWidth;
			objHeight = obj.offsetHeight;
			objZIndex = obj.style.zIndex;
			pageLeft = document.body.scrollLeft;
			pageRight = document.body.clientWidth + document.body.scrollLeft;
			pageBottom = document.body.clientHeight + document.body.scrollTop;
		}
		else if (isNav) {
			objLeft = obj.parentLayer.left;
			objTop = obj.top + obj.parentLayer.top;
			objWidth = obj.parentLayer.clip.width;
			objHeight = obj.clip.height;
			objZIndex = obj.zIndex;
			pageLeft = pageXOffset;
			pageRight = window.innerWidth + pageXOffset;
			pageBottom = window.innerHeight + pageYOffset;
		}
		if (currMenu.direction == "right" && (objLeft + objWidth - 4 + currMenuItem.subMenu.width > pageRight)) {
			currMenu.direction = "left";
		}
		else if (currMenu.direction == "left" && (objLeft + 4 - currMenuItem.subMenu.width < pageLeft)) {
			currMenu.direction = "right";
		}
		currMenuItem.subMenu.direction = currMenu.direction;
		if (currMenu.direction == "right") {
			left = objLeft + objWidth - 4;
		}
		else {
			left = objLeft + 4 - currMenuItem.subMenu.width;
		}
		top = objTop + 4;
		if (top + currMenuItem.subMenu.height > pageBottom) {
			top -= currMenuItem.subMenu.height - objHeight + 8; 
			if (isIE) {
				if (top < currMenu.menuItems[0].obj.style.pixelTop) {
					top = obj.parentElement.style.pixelTop - 4
				}
			}
			else if (isNav) {
				if (top < currMenu.menuItems[0].obj.top) {
					top =  obj.parentLayer.top + 4;
				}
			}
		}
		z_index = objZIndex + 1;
		
		currMenuItem.subMenu.show(left,top);
		currMenu.openSubMenu = currMenuItem.subMenu;
	}
}

function menuItem_mouseoutdelay(id) {
	clearTimeout(mouseOutTimer);
	mouseOutTimer = setTimeout("menuItem_mouseout();",mouseoverhold)
}

function menuItem_mouseout(id) {
	timer = setTimeout("collapseRootMenu();", holdtime);
}




function menu_calculateDimensions() {
	var menuItemWidth = 0;
	var menuItemHeight = 0;
	
	for (var i = 0;i < this.menuItems.length;i++) {
		var borderwidth = this.menuItems[i].borderwidth;
		var obj = this.menuItems[i].obj;
		if (isIE) {
			menuItemWidth = obj.offsetWidth;
			menuItemHeight = obj.offsetHeight - borderwidth;
		} else if (isNav) {
			menuItemWidth = obj.clip.width;
			menuItemHeight = obj.clip.height - borderwidth;
		}
		this.width = menuItemWidth > this.width ? menuItemWidth : this.width;
		this.height += menuItemHeight;
	}
}

function menu_setActiveMenuItem(menuItem) {
	// Unhighlight previous activeMenuItem.
	if (this.activeMenuItem) {
		var obj = this.activeMenuItem.obj;
		var bgcolor = this.activeMenuItem.bgcolor;
		
		if (isIE) {
			obj.style.textDecoration = "";
			if (bgcolor =="#FFFFFC"){
			obj.style.color = "#000000";
			}	
			else{		
			obj.style.color = "#666699";		
			obj.style.backgroundColor = bgcolor;
			obj.style.borderStyle = this.activeMenuItem.normalstyle;
			}
		}
		else if (isNav) {
			obj.bgColor = bgcolor;
		}
		this.activeMenuItem = null;
	}
	
	if (menuItem) {
		var obj = menuItem.obj;
		var highlightcolor = menuItem.highlightcolor
		
		if (isIE) {				
			obj.style.color = "#666633";	
			obj.style.backgroundColor = highlightcolor;
			obj.style.borderStyle = menuItem.hilitestyle;
			if (bgcolor =="#FFFFFC" );
			else
				obj.style.textDecoration = "underline";
		} else if (isNav) {
			obj.bgColor = highlightcolor;
		}
		this.activeMenuItem = menuItem;
	}
}

function menu_expand(left, top, z_index) {
	var origtop = top;
	top = 0;
	left = 0;
	
	for (var i = 0; i < this.menuItems.length; i++) {
		var obj = this.menuItems[i].obj;
		var borderwidth = this.menuItems[i].borderwidth
		z_index = 100;
		if (isIE) {
			obj.style.zIndex = z_index;
			obj.style.pixelLeft = left;
			obj.style.pixelTop = top;
			top += 15 - borderwidth;
      
		} else if (isNav) {
			obj.zIndex = z_index;
			obj.moveTo(left, top);
			top += obj.clip.height
		}
		z_index = z_index + 1
	}
	
	if (isNav) {
		obj.parentLayer.clip.height = top;
		obj.parentLayer.clip.width = obj.clip.width;
		rollingtop = origtop +  top;
		obj.parentLayer.zIndex = 100;
		
	} else if (isIE) {
		obj.parentElement.height = top;
		obj.parentElement.width = obj.width;
		obj.parentElement.style.zIndex = 100;
		rollingtop = origtop  + top
	}
}

function menu_show(left,top) {
	var obj = this.menuItems[0].obj;
	
	if (isIE) {
		obj.parentElement.style.visibility = "visible";
		obj.parentElement.style.pixelTop = top;
		obj.parentElement.style.pixelLeft = left;
		obj.parentElement.style.zIndex = 100;
	}
	else if (isNav) {
		obj.parentLayer.visibility = "show";
		obj.parentLayer.moveTo(left,top);
		obj.parentLayer.zIndex = 100;
	}
}

function menu_hide() {
	
	var obj
	
	if (this.openSubMenu) {
		this.openSubMenu.hide();
		this.openSubMenu = null;
	}

	this.setActiveMenuItem(null);
	
	this.direction = "right";

	obj = this.menuItems[0].obj;
		
	if ((this.menuItems[0].menu == rootMenu) && (rootMenu.navmenu == 0)) {
	} else {
		if (isIE) {
			obj.parentElement.style.visibility = "hidden";
		} else if (isNav) {
			obj.parentLayer.visibility = "hide";
		}
	}
}

function CreateLayer(layerName, xpos, ypos, layerHeight, layerWidth, layerContent, zpos) {
	var id = "lyr" + layerName;
	
	if (isIE) {
		var objTag
		objTag = ""
		objTag += "<div"
		objTag += " id=\"" + id + "\""
		objTag += " style=\""
		objTag += " position: absolute;"
		objTag += " top: " + ypos + ";"
		objTag += " left: " + xpos + ";"
		objTag += " height: " + layerHeight + ";"
		objTag += " width: " + layerWidth + ";"
		objTag += " z-index: " + zpos + ";"
		objTag += "\""
		objTag += ">"
		objTag += layerContent
		objTag += "</div>"
		document.body.insertAdjacentHTML("BeforeEnd",objTag);
							
	} else if (isNav) {
		var lyr = document.layers[id] = new Layer(layerWidth)
		eval("document." + id + " = lyr")
		lyr.name = id;
		lyr.visibility = "hide"
		lyr.moveTo(xpos,ypos)
		lyr.clip.width = layerWidth
		lyr.clip.height = layerHeight
		lyr.zIndex = zpos
		lyr.document.open();
		lyr.document.write(layerContent);
		lyr.document.close();
		lyr.visibility = "show"
	}
}

function categoryDisplay(grpid,catid,subid,custom,page) {
	var shopperid = location.search;
	var shopid = shopperid.indexOf("mscssid");
	var customproductpos = page.indexOf("?pagetype=custom");	
	if (shopid < 0) {
	  if (document.frmShopperID) {
		  shopperid = document.frmShopperID.hdnShopperID.value;
	  }
	}
	shopperid = shopperid.substring(shopid);
	if (customproductpos > 0) {
		top.location = "/" + page;
	}
	else {
		top.location = "/" + page ;
	}
	return;
}

function urlDisplay(NewPageURL,catid) {
	var ShopIDpos = NewPageURL.indexOf("?mscssid?");
	var querystring = location.search
	var shopperid

	if (ShopIDpos > 0) {
		NewPageURL = NewPageURL.substring(0,ShopIDpos);

		ShopIDpos = querystring.indexOf("mscssid");
		if (ShopIDpos < 0) {
			shopperid = document.frmShopperID.hdnShopperID.value;
		}
		else {
			shopperid = querystring.substring(ShopIDpos);
		}
		NewPageURL += "?" + shopperid
			
	}
	
	if (isNav) {
	if (navigator.appVersion.indexOf('4.0') != -1 || navigator.appVersion.indexOf('6.0') != -1) {
		if (NewPageURL.indexOf('linkshare') == 0) NewPageURL = "http://" + location.host + "/test/" + NewPageURL
	} }
	
	location.href = NewPageURL
	return;
}

if (document.all || document.layers) {
	if (navigator.appName == "Netscape") {
		isNav = true;
	} else {
		isIE = true;
	}
}
if (!isNav){ 
sitemenuProp1 = new menuItemProp(180,"#FFFFFC","",1,"",0);
sitemenuProp2 = new menuItemProp(330,"","",1,"",0);
}else{
sitemenuProp1 = new menuItemProp(150,"#FFFFFF","#CCCC99",1,"",0);
sitemenuProp2 = new menuItemProp(220,"","#CCCC99" ,1,"",0);
}
if (isNav) {
	window.onload = window_onload;
}

function loadmenus(catid) {
  submenu = loadmenus1(catid);
  if (submenu) {
    return submenu;
  }
  submenu = loadmenus2(catid);
  if (submenu) {
    return submenu;
  }
  return submenu;
}


function loadmenus2(catid) { 

	var submenu = null;


	switch (catid) {	
		case 1001:
			submenu = new menu (
				new menuItem("Modular Telephone Cord"," categoryDisplay('F7','A1','','','product.asp?category=Modular+Telephone+Line+Cord&class=A0')", 1, null, sitemenuProp2, false,0,0),
				//new menuItem("Cat6 GigaSpeed Patch Cable"," categoryDisplay('F7','F1','','','product.asp?category=Lucent+Cat6+GigaSpeed+Patch+Cable&class=A1')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("Cat6 MediaTwist Patch Cable"," categoryDisplay('F7','G1','','','product.asp?category=Cat6+MediaTwist+Patch+Cable&class=AW')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("Cat5 RJ45 cable-Assembly type"," categoryDisplay('F7','G1','','','product.asp?category=Cat5+Patch+cables+-+Assembly+type&class=A2')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("Cat5 RJ45 Cable-Assembly-Sangfree"," categoryDisplay('F7','G1','','','product.asp?category=Cat5+Patch+Cable+-+Assembly+type+with+Strain+Relief&class=A3')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("Cat5 RJ45 Cable-Molded"," categoryDisplay('F7','G1','','','product.asp?category=Cat5+Patch+Cable+-+Molded+type&class=A4')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("Cat5 RJ45 Cable-Molded-Sangfree"," categoryDisplay('F7','G1','','','product.asp?category=Cat5+Patch+Cable+-+Molded+type+with+Strain+Relief&class=A5')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E DataTwist Patch Cable"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+DataTwist+350+Patch+Cable&class=A6')", null, null, sitemenuProp2, false,1001,0),
				//new menuItem("MediaTwist Patch Cable"," categoryDisplay('F7','G1','','','product.asp?category=Media+Twist+Patch+Cable&class=A7')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E Lucent PowerSum RJ45 Cable"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+Lucent+PowerSum+Patch+Cable&class=A8')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Cable-Assembly"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+Patch+Cable+-+Assembly+type&class=AC')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Cable-Assembl-Snagfree"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+Patch+Cable+-+Assembly+type+with+Strain+Relief&class=AK')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Cable-Molded"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+Patch+Cable+-+Molded+type&class=AE')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Cable-Molded-Snagfree"," categoryDisplay('F7','G1','','','product.asp?category=Cat5E+Patch+Cable+-+Molded+type+with+Strain+Relief&class=AR')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Flexible & Thin Cable"," categoryDisplay('F7','G1','','','product.asp?category=Cat5e+Flexible+and+Thin+Cable&class=AT')", null, null, sitemenuProp2, false,1001,0),
				new menuItem("Cat5E RJ45 Flexible & Flat Cable"," categoryDisplay('F7','G1','','','product.asp?category=Cat5e+RJ45+Flexible+and+Flat+Cable&class=AF')", null, null, sitemenuProp2, false,1001,0)
					);
			return submenu;
			break;

		case 1002:
			submenu = new menu (
				new menuItem("UTP cable - Premise Wiring"," categoryDisplay('J7','H7','','','product.asp?category=UTP+cable+-+Premise+ Wiring&class=B1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("UTP Patch Cable - Stranded"," categoryDisplay('J7','H7','','','product.asp?category=UTP+Patch+Cable+-+Stranded&class=B2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Telco cable - Voice Grade"," categoryDisplay('J7','I7','','','product.asp?category=Telco+cable+-+voice+grade&class=B3')", null, null, sitemenuProp2, false,1025,0));
			return submenu;
			break;

		case 1003:
			submenu = new menu (
			new menuItem("Cat6 Patch Panel-110 style"," categoryDisplay('B2','A1','','','product.asp?category=Cat6+Patch+Panel+-+110+style&class=H1')", 1, null, sitemenuProp2, false,1018,0),
			new menuItem("Cat6 Patch Panel-Feed Through"," categoryDisplay('B2','A1','','','product.asp?category=Cat6+Patch+Panel+-+Feed+Through+style&class=H2')", null, null, sitemenuProp2, false,1018,0),
				new menuItem("Cat5E Patch Panel-110 style"," categoryDisplay('B2','A1','','','product.asp?category=Cat5E+Patch+Panel+-+110+style&class=C1')", null, null, sitemenuProp2, false,1018,0),
				new menuItem("Cat5E Patch Panel-Telco 50 pin Style"," categoryDisplay('B2','B1','','','product.asp?category=Cat5E+PowerSum+Patch+Panel+-+Telco+50+pin+Style&class=C6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat5E RJ45 Feed Through Panel"," categoryDisplay('B2','B1','','','product.asp?category=Cat5E+RJ45+Feed+Through+Panel&class=C2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Modular Jack Feed Through Panel"," categoryDisplay('B2','B1','','','product.asp?category=Modular+Jack+Feed+Through+Panel&class=C3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Modular Jack Blank Panel"," categoryDisplay('B2','B1','','','product.asp?category=Modular+Jack+Blank+Panel&class=C4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Wall Mount Panel,Block,Harmonica"," categoryDisplay('B2','B1','','','product.asp?category=Wall+Mount+Panel,+Block,+Harmonica+-+Cat5e+and+Cat+4&class=C5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat4 Patch Panel-Telco 50 pin style"," categoryDisplay('B2','B1','','','product.asp?category=Cat4+Telco+50+pin+Patch+Panel&class=C7')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat4 Patch Panel-110 Style"," categoryDisplay('B2','H1','','','product.asp?category=Cat4+110+Patch+Panel&class=C8')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("D-sub Feed Through Panel"," categoryDisplay('B2','H1','','','product.asp?category=D-sub+Feed+Through+Panel&class=C9')", null, null, sitemenuProp2, false,1025,0), 
				new menuItem("Video Balun Patch Panel"," categoryDisplay('B2','B1','','','product.asp?category=Video+Balun+Patch+Panel&class=XP')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("USB Feed Thru Panel"," categoryDisplay('B2','B1','','','product.asp?category=USB+Feed+Thru+Panel&class=U6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fire Wire Feed Thru Panel"," categoryDisplay('B2','H1','','','product.asp?category=Fire+Wire+Feed+Thru+Panel&class=U7')", null, null, sitemenuProp2, false,1025,0)
				 );
			return submenu;
			break;

		/*case 1004:
			submenu = new menu (
				new menuItem("Cables/Connectors/Patch Panels"," categoryDisplay('B2','H1','','','product.asp?category=Cables,+Jacks/Connectors,+Patch+Panels&class=D1')", 1, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;*/
		case 1005:
			submenu = new menu (
				new menuItem("Media Converter"," categoryDisplay('B2','A1','','','product.asp?category=Media+Converter&class=E1')", 1, null, sitemenuProp2, false,1018,0),
				/*new menuItem("10Base-NICs,Hubs,Transceivers"," categoryDisplay('B2','A1','','','product.asp?category=10Base-Ethernet+Cards,+Hubs,+Transceivers,+Adapters,+Repeater&class=E1')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("100Base-NICs,Hubs,Switches"," categoryDisplay('B2','B1','','','product.asp?category=100Base-Fast+Ethernet+Cards,+Hubs,+Switching+Hubs&class=E2')", null, null, sitemenuProp2, false,1019,0),*/
				new menuItem("Ethernet Cabling-10Base-5 Thicknet"," categoryDisplay('B2','B1','','','product.asp?category=Ethernet+Cabling+-+10Base-5+Thicknet&class=E3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Ethernet Cabling-10Base-2 Thinnet"," categoryDisplay('B2','B1','','','product.asp?category=Ethernet+Cabling+-+10Base-2+Thinnet&class=E4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10/100 Cross Over Cables/Adapter"," categoryDisplay('B2','H1','','','product.asp?category=10/100+Cross+Over+Cables/Adapter&class=E5')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1006:
			submenu = new menu (
				new menuItem("Multi-mode (62.5/125) Patch Cable"," categoryDisplay('B2','A1','','','product.asp?category=Multi-Mode+(62.5/125)+Patch+Cable&class=FM')",1, null, sitemenuProp2, false,1018,0),
				new menuItem("Multi-mode (50/125) Patch Cable"," categoryDisplay('B2','A1','','','product.asp?category=Multi-mode+(50/125)+Patch+Cable&class=F1')",null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G Laser Speed (50/125) Patch Cable"," categoryDisplay('B2','A1','','','product.asp?category=10G+Laser+Speed+(50/125)+Patch+Cable&class=FL')",null, null, sitemenuProp2, false,1019,0),
				new menuItem("Single-mode Patch Cable"," categoryDisplay('B2','A1','','','product.asp?category=Single-mode+Patch+Cable&class=FS')",null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fiber Optic Loop Back Cable"," categoryDisplay('B2','A1','','','product.asp?category=Fiber+Optic+Loop+Back+Cable&class=FP')",null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fiber Optic Bulk Cable"," categoryDisplay('B2','A1','','','product.asp?category=Fiber+Optic+Bulk+Cable&class=F5')",null, null, sitemenuProp2, false,1019,0),
				new menuItem("Accessories"," categoryDisplay('B2','B1','','','product.asp?category=Accessories+(Panel,+Connectors+and+Bulkheads)&class=F2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fiber Optic Loaded Panels"," categoryDisplay('B2','B1','','','product.asp?category=Fiber+Optic+Loaded+Panels&class=F3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Distribution Enclosures"," categoryDisplay('B2','H1','','','product.asp?category=Distribution+Units&class=F4')", null, null, sitemenuProp2, false,1025,0),
				new menuItem("Mode Conditioning Cable"," categoryDisplay('B2','H1','','','product.asp?category=Mode+Conditioning+Cable&class=FC')", null, null, sitemenuProp2, false,1025,0)
				);
			return submenu;
			break;
		case 1007:
			submenu = new menu (
				new menuItem("Raceway Molding"," categoryDisplay('B2','A1','','','product.asp?category=Multi-Raceway+Molding&class=G1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("High Ware Cove Molding"," categoryDisplay('B2','H1','','','product.asp?category=High+Ware+Cove+Molding&class=G2')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		/*case 1008:
			submenu = new menu (
				new menuItem("Connectors, Adapters & cables"," categoryDisplay('B2','H1','','','product.asp?category=Connectors,+Adapters+cables&class=H1')", 1, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;*/
		case 1009:
			submenu = new menu (
				new menuItem("IBM Token Ring cabling"," categoryDisplay('B2','A1','','','product.asp?category=IBM+Token+Ring+cabling&class=I1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("IBM 3270 cabling"," categoryDisplay('B2','B1','','','product.asp?category=IBM+3270+cabling&class=I2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("IBM 3X, AS400 cabling"," categoryDisplay('B2','H1','','','product.asp?category=IBM+3X,+AS400+cabling&class=I3')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1010:
			submenu = new menu (
				new menuItem("RJ45/RJ12 Keystone Jack"," categoryDisplay('B2','A1','','','product.asp?category=RJ45/RJ12+Keystone+Jack&class=J1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Bezel Type Wall Plates & Boxes"," categoryDisplay('B2','B1','','','product.asp?category=Bezel+Type+MIO+system&class=J2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Module Type Wall Plates & Boxes"," categoryDisplay('B2','B1','','','product.asp?category=Module+Type+MIO+system&class=J3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Multi-Port Wall Plate"," categoryDisplay('B2','B1','','','product.asp?category=Multi-port+face+plate&class=J4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Surface Mount Boxes"," categoryDisplay('B2','B1','','','product.asp?category=Surface+Mount+Box&class=J5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat5E RJ45 Jack"," categoryDisplay('B2','B1','','','product.asp?category=Cat5E+RJ45+jack/Flush+Surface+mount&class=J6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat4 Voice/Data Jack-Screw Terminal"," categoryDisplay('B2','B1','','','product.asp?category=Cat4+Screw+Terminal+Type+Jack+/+Flush+and+surface+mount&class=J7')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat4 Voice/Data Jack-110 Type"," categoryDisplay('B2','H1','','','product.asp?category=Cat4+110+Type+Jack+/+Flush+and+Surface+mount&class=J8')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1011:
			submenu = new menu (
				new menuItem("Modular Plugs"," categoryDisplay('B2','A1','','','product.asp?category=Modular+Plugs&class=K1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("RJ45 plug Strain Relief Boots"," categoryDisplay('B2','B1','','','product.asp?category=RJ45+plug+Strain+Relief+boots&class=K2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Adapters"," categoryDisplay('B2','H1','','','product.asp?category=Adapters&class=K3')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1012:
		    submenu = new menu (
				new menuItem("Apple Talk Balun"," categoryDisplay('B2','A1','','','product.asp?category=Apple+Talk+Balun&class=L1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Apple Talk Star Connector"," categoryDisplay('B2','B1','','','product.asp?category=Apple+Talk+Star+Connector&class=L2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Star Distribution Panel"," categoryDisplay('B2','B1','','','product.asp?category=Star+Distribution+Panel&class=L3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Accessories"," categoryDisplay('B2','H1','','','product.asp?category=Accessories&class=L4')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1013:
			submenu = new menu (
				new menuItem("Wire Organizer"," categoryDisplay('B2','A1','','','product.asp?category=Wire+Organizer&class=M1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Wall Mount Bracket"," categoryDisplay('B2','B1','','','product.asp?category=Wall+Mount+Bracket&class=M2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Rack & Accessories"," categoryDisplay('B2','B1','','','product.asp?category=Rack+and+Accessories&class=M3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cable Ties"," categoryDisplay('B2','B1','','','product.asp?category=Cable+Ties&class=M4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Wall Mount Cabinet"," categoryDisplay('B2','H1','','','product.asp?category=Wall+Mount+Cabinet&class=M5')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1014:
			submenu = new menu (
				new menuItem("Jacks/Connectors"," categoryDisplay('B2','A1','','','product.asp?category=Jacks/Connectors&class=N1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Panels"," categoryDisplay('B2','B1','','','product.asp?category=Panels&class=N2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cables"," categoryDisplay('B2','H1','','','product.asp?category=Cables&class=N3')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1015:
			submenu = new menu (
				new menuItem("Gender Changers"," categoryDisplay('B2','A1','','','product.asp?category=Gender+Changers&class=O1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Keyboard, Mouse, Video Adapters"," categoryDisplay('B2','B1','','','product.asp?category=Keyboard,+Mouse,+Video+Adapter&class=O2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Serial & Parallel Adapters"," categoryDisplay('B2','B1','','','product.asp?category=Serial+Parallel+Adapters&class=O3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Testers"," categoryDisplay('B2','B1','','','product.asp?category=Testers&class=O4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Signal Extenders"," categoryDisplay('B2','B1','','','product.asp?category=Signal+Extender&class=O5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Power Cord,Strip/Surge Protectors"," categoryDisplay('B2','B1','','','product.asp?category=Power+Cord,+Power+Strip/Surge+Protector&class=O6')", null, null, sitemenuProp2, false,1019,0),
				//new menuItem("Short Hall Modems"," categoryDisplay('B2','B1','','','product.asp?category=Short+Hall+Modem&class=O7')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Protocol Converters"," categoryDisplay('B2','H1','','','product.asp?category=Protocol+Converter&class=O8')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("DVI Adapter"," categoryDisplay('B2','B1','','','product.asp?category=DVI+Adapter&class=OD')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1016:
			submenu = new menu (
				new menuItem("Printer/Plotter Cables"," categoryDisplay('B2','A1','','','product.asp?category=Printer/Plotter+Cable&class=P1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Video/Monitor/S-Video Cables"," categoryDisplay('B2','B1','','','product.asp?category=Video/Monitor+Cable,+S-Video+Cable&class=P2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Keyboard/Mouse Cables"," categoryDisplay('B2','B1','','','product.asp?category=Keyboard/Mouse+Cable&class=P3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Null Modem Cables"," categoryDisplay('B2','B1','','','product.asp?category=Null+Modem+Cable&class=P4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Serial Cables"," categoryDisplay('B2','B1','','','product.asp?category=Serial+Cable&class=P5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Multi-Media/Speaker Cables"," categoryDisplay('B2','B1','','','product.asp?category=Multi-Media/Speaker+Cable&class=P6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Laplink Cables"," categoryDisplay('B2','B1','','','product.asp?category=Short+Hall+Modem&class=P7')", null, null, sitemenuProp2, false,1019,0),
				//new menuItem("Apple/Macintosh Cables"," categoryDisplay('B2','B1','','','product.asp?category=Apple/Macintosh+Cable&class=P8')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Internal Cables"," categoryDisplay('B2','B1','','','product.asp?category=Internal+Cable&class=P9')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cisco Router Cables"," categoryDisplay('B2','H1','','','product.asp?category=Cisco+Router+Cable&class=PC')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("DVI/HDMI Cables"," categoryDisplay('B2','H1','','','product.asp?category=DVI/HDMI+Cables&class=PD')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("KVM Cables"," categoryDisplay('B2','H1','','','product.asp?category=KVM Cables&class=PK')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1017:
			submenu = new menu (
				new menuItem("110 Cables"," categoryDisplay('B2','A1','','','product.asp?category=110+Cables&class=Q1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("110 Connectors"," categoryDisplay('B2','B1','','','product.asp?category=110+Connectors&class=Q2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("110 Wiring Block"," categoryDisplay('B2','A1','','','product.asp?category=110+Wiring+Block&class=Q3')", null, null, sitemenuProp2, false,1018,0),
				new menuItem("Field Installation Kits"," categoryDisplay('B2','H1','','','product.asp?category=Field+Installation+Kits&class=Q4')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1018:
			submenu = new menu (
				new menuItem("RS-232 Modular Adapter"," categoryDisplay('B2','A1','','','product.asp?category=RS-232+Modular+Adapter&class=R1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("RS-232 Connectors"," categoryDisplay('B2','H1','','','product.asp?category=RS-232+Connectors&class=R2')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1019:
			submenu = new menu (
				new menuItem("SCSI Cables-External"," categoryDisplay('B2','A1','','','product.asp?category=SCSI+Cable+-+External&class=S1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("SCSI Cables-Internal"," categoryDisplay('B2','B1','','','product.asp?category=SCSI+Cable+-+Internal&class=S2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("SCSI Adapters-External"," categoryDisplay('B2','B1','','','product.asp?category=SCSI+Adapter+-+External&class=S3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("SCSI Adapters-Internal"," categoryDisplay('B2','B1','','','product.asp?category=SCSI+Adapter+-+Internal&class=S4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("SCSI Terminators-External"," categoryDisplay('B2','B1','','','product.asp?category=SCSI+Terminator+-+External&class=S5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("SCSI Terminators-Internal"," categoryDisplay('B2','B1','','','product.asp?category=SCSI+Terminator+-+Internal&class=S6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("High Line Terminators/Adapter-Ext."," categoryDisplay('B2','B1','','','product.asp?category=High+Line+Terminator/Adapter+-+External&class=S7')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("High Line Terminators/Adapter-Int."," categoryDisplay('B2','H1','','','product.asp?category=High+Line+Terminator/Adapter+-+Internal&class=S8')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1020:
			submenu = new menu (
				new menuItem("Tools"," categoryDisplay('B2','A1','','','product.asp?category=Tool&class=T1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Testers"," categoryDisplay('B2','B1','','','product.asp?category=Tester&class=T2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Installation Kit"," categoryDisplay('B2','H1','','','product.asp?category=Installation+Kit&class=T3')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1021:
			submenu = new menu (
				new menuItem("USB 2.0 cables"," categoryDisplay('B2','A1','','','product.asp?category=USB+2.0+cables&class=U5')", 1, null, sitemenuProp2, false,1018,0),
				//new menuItem("USB 1.1 cables"," categoryDisplay('B2','A1','','','product.asp?category=USB+1.1+cables&class=U1')", null, null, sitemenuProp2, false,1018,0),
				new menuItem("USB adapters & converter"," categoryDisplay('B2','B1','','','product.asp?category=USB+adapters+converter&class=U2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("USB Feed Thru Panel"," categoryDisplay('B2','B1','','','product.asp?category=USB+Feed+Thru+Panel&class=U6')", null, null, sitemenuProp2, false,1019,0),
				//new menuItem("USB Hubs & Drive"," categoryDisplay('B2','B1','','','product.asp?category=USB+Hubs+and+Drive&class=U3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("IEEE 1394 Fire Wire"," categoryDisplay('B2','H1','','','product.asp?category=IEEE+1394+Fire+Wire&class=U4')", null, null, sitemenuProp2, false,1025,0),
				new menuItem("Fire Wire Adapter"," categoryDisplay('B2','H1','','','product.asp?category=Fire+Wire+Adapter&class=U8')", null, null, sitemenuProp2, false,1025,0),
				new menuItem("Fire Wire Feed Thru Panel"," categoryDisplay('B2','H1','','','product.asp?category=Fire+Wire+Feed+Thru+Panel&class=U7')", null, null, sitemenuProp2, false,1025,0)

				
				 );
			return submenu;
			break;
		case 1022:
			submenu = new menu (
				new menuItem("V.35 Accessories,Adapters,Connectors"," categoryDisplay('B2','A1','','','product.asp?category=V.35+Accessories,+Adapters,+Connectors&class=V1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("V.35 Cables"," categoryDisplay('B2','H1','','','product.asp?category=V.35+Cables&class=V2')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1023:
			submenu = new menu (
				new menuItem("Manual Switch Box"," categoryDisplay('B2','A1','','','product.asp?category=Manual+Switch+Box&class=W1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Bitronics Auto Switch Box"," categoryDisplay('B2','B1','','','product.asp?category=Bitronics+Auto+Switch+Box&class=W2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("KVM Switch"," categoryDisplay('B2','B1','','','product.asp?category=KVM+Switch&class=W4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Video Splitter"," categoryDisplay('B2','H1','','','product.asp?category=Video+Splitter&class=W5')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1024:
			submenu = new menu (
				new menuItem("Cat5E(525) Trunk Cable"," categoryDisplay('B2','A1','','','product.asp?category=Cat5E+(Lucent+525)+Trunk+Cable&class=X1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("Cat5E(525) Octopus Cable"," categoryDisplay('B2','B1','','','product.asp?category=Cat5E+(Lucent+525)+Octopus+Cable&class=X2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("25 Pair Trunk Cable"," categoryDisplay('B2','B1','','','product.asp?category=25+Pair+Trunk+Cable&class=X3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Octopus Cable"," categoryDisplay('B2','H1','','','product.asp?category=Octopus+Cable&class=X4')", null, null, sitemenuProp2, false,1025,0) );
			return submenu;
			break;
		case 1025:
			submenu = new menu (
				new menuItem("RJ45/110 Patch Panel"," categoryDisplay('B2','A1','','','product.asp?category=RJ45/110+Patch+Panel&class=H1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("RJ45 Feed Through Panel"," categoryDisplay('B2','B1','','','product.asp?category=RJ45+Feed+Through+Panel&class=H2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Jack/Coupler"," categoryDisplay('B2','B1','','','product.asp?category=Jack/Coupler&class=H3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Belden DT6 RJ45 Cables-Molded"," categoryDisplay('B2','B1','','','product.asp?category=Belden+DT6+RJ45+Cables-Molded&class=H4')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Belden DT6 RJ45-Molded/Snagless"," categoryDisplay('B2','B1','','','product.asp?category=Belden+DT6+RJ45+Cables-Molded/Snagless&class=H5')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Belden RJ45 MediaTwist Cables"," categoryDisplay('B2','H1','','','product.asp?category=Belden+RJ45+MediaTwist+Cables&class=HW')", null, null, sitemenuProp2, false,1025,0),
				new menuItem("Cat6 RJ45 Cables-Molded"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+RJ45+Cables-Molded&class=H6')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat6 RJ45 Cables-Molded/Snagless"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+RJ45+Cables-Molded/Snagless&class=H7')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat6 Certified RJ45 Cables"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+Certified+RJ45+Cables&class=HU')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat6 Shielded RJ45 Cables"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+Shielded+RJ45+Cables&class=H9')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat6 Bulk Cables-Unshielded"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+Bulk+Cables-Unshielded&class=H8')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Cat6 Bulk Cables-Shielded"," categoryDisplay('B2','B1','','','product.asp?category=Cat6+Bulk+Cables-Shielded&class=HS')", null, null, sitemenuProp2, false,1019,0)
				 );
			return submenu;
			break;
			case 1026:
			submenu = new menu (
				new menuItem("Home Wiring Box"," categoryDisplay('B2','B1','','','product.asp?category=Home+Wiring+Box&class=XH')", 1, null, sitemenuProp2, false,1019,0),
				new menuItem("Composite Cable"," categoryDisplay('B2','B1','','','product.asp?category=Composite+Cable&class=XA')", null, null, sitemenuProp2, false,1019,0)
				 );
			return submenu;
			break;
			
			case 1027:
			submenu = new menu (
				new menuItem("Digital Audio/Video Cable"," categoryDisplay('B2','B1','','','product.asp?category=Digital+Audio/Video+Cable&class=XD')", 1, null, sitemenuProp2, false,1019,0),
				new menuItem("Video Balun"," categoryDisplay('B2','B1','','','product.asp?category=Video+Balun&class=XV')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Video Balun Patch Panel"," categoryDisplay('B2','B1','','','product.asp?category=Video+Balun+Patch+Panel&class=XP')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("DVI/HDMI Cables"," categoryDisplay('B2','H1','','','product.asp?category=DVI/HDMI+Cables&class=PD')", null, null, sitemenuProp2, false,1019,0)
				 );
			break;
			case 1028:
			submenu = new menu (
				new menuItem("RJ45/110 Patch Panel"," categoryDisplay('B2','A1','','','product.asp?category=RJ45/110+Patch+Panel&class=HA')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("RJ45/RJ45 Feed Through Panel"," categoryDisplay('B2','B1','','','product.asp?category=RJ45+Feed+Through+Panel&class=HB')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Keystone Jack/Coupler"," categoryDisplay('B2','B1','','','product.asp?category=Keystone+Jack/Coupler&class=HC')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G RJ45 Patch Cable-Assembly Boot"," categoryDisplay('B2','B1','','','product.asp?category=10G+RJ45+Patch+Cable-Assembly+Boot&class=HD')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G RJ45 Patch Cable-Molded Boot"," categoryDisplay('B2','B1','','','product.asp?category=10G+RJ45+Patch+Cable-Molded+Boot&class=HE')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G RJ45 Shielded Patch Cable-Assembly Boot"," categoryDisplay('B2','B1','','','product.asp?category=10G+RJ45+Shielded+Patch+Cable-Assembly+Boot&class=HF')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G RJ45 Shielded Patch Cable-Molded Boot"," categoryDisplay('B2','B1','','','product.asp?category=10G+RJ45+Shielded+Patch+Cable-Molded+Boot&class=HG')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("10G Bulk Cables & Plugs"," categoryDisplay('B2','B1','','','product.asp?category=10G+Bulk+Cables+and+Plugs&class=HH')", null, null, sitemenuProp2, false,1019,0)
				);
			
			return submenu;
			break;
	case 1029:
			submenu = new menu (
				new menuItem("Audio/Video Adapters"," categoryDisplay('B2','A1','','','product.asp?category=Audio/Video+Adapters&class=JA')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("USB Adapters"," categoryDisplay('B2','B1','','','product.asp?category=USB+Adapters&class=JB')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fire Wire Adapters"," categoryDisplay('B2','B1','','','product.asp?category=Fire+Wire+Adapters&class=JC')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Copper Cable Adapters"," categoryDisplay('B2','B1','','','product.asp?category=Copper+Cable+Adapters&class=JD')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Fiber Optic Cable Adpaters"," categoryDisplay('B2','B1','','','product.asp?category=Fiber+Optic+Cable+Adpaters&class=JF')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("Panels & Wall Plates"," categoryDisplay('B2','B1','','','product.asp?category=Panels+and+Wall+Plates&class=J9')", null, null, sitemenuProp2, false,1019,0)
				);
			

			return submenu;
			break;
			
			//******* New Products 2008/12/25

			
			case 1031:
			submenu = new menu (
				new menuItem("EazyPull Basic Run Cables - PVC"," categoryDisplay('B2','A1','','','product.asp?category=EazyPull+Basic+Cables+-+PVC&class=Z1')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("EazyPull Basic Run Cables - Plenum"," categoryDisplay('B2','B1','','','product.asp?category=EazyPull+Basic+Cables+-+Plenum&class=Z2')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("EazyPull Adapter Cables"," categoryDisplay('B2','B1','','','product.asp?category=EazyPull+Adapter+Cables&class=Z3')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("EazyPull Wall Plates"," categoryDisplay('B2','B1','','','product.asp?category=EazyPull+Wall+Plates&class=Z4')", null, null, sitemenuProp2, false,1019,0)
				);
			
			return submenu;
			break;
			

			
			case 1032:
			submenu = new menu (
				new menuItem("MTP BreakOut Panels"," categoryDisplay('B2','A1','','','product.asp?category=MTP+BreakOut+Panels&class=FA')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("MTP BreakOut Boxes"," categoryDisplay('B2','B1','','','product.asp?category=MTP+BreakOut+Boxes&class=FB')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("MTP to MTP Cables"," categoryDisplay('B2','B1','','','product.asp?category=MTP+to+MTP+Cables&class=F0')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("MTP Fanout Cables"," categoryDisplay('B2','B1','','','product.asp?category=MTP+Fanout+Cables&class=FF')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("MTP Feed Through Panels"," categoryDisplay('B2','B1','','','product.asp?category=MTP+Feed+Through+Panels&class=FT')", null, null, sitemenuProp2, false,1019,0)
				

				);
			
			return submenu;
			break;
			
			case 1033:
			submenu = new menu (
				new menuItem("HDMI"," categoryDisplay('B2','A1','','','product.asp?category=HDMI&class=PH')", 1, null, sitemenuProp2, false,1018,0),
				new menuItem("DVI"," categoryDisplay('B2','B1','','','product.asp?category=DVI&class=PI')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("VGA"," categoryDisplay('B2','B1','','','product.asp?category=VGA&class=PV')", null, null, sitemenuProp2, false,1019,0),
				new menuItem("USB"," categoryDisplay('B2','B1','','','product.asp?category=USB&class=PU')", null, null, sitemenuProp2, false,1019,0)
				);
			
			return submenu;
			break;
			
	}
return submenu; }

function loadmenus1(catid) { 
	var submenu = null;
	switch (catid) {	
		case 1:
		submenu = new menu (
		// ******** New products 2008/12/25
		new menuItem('AV Electronics',  null, null, null, sitemenuProp1, true, 1033,0),
		new menuItem('EazyPull Solutions', null, null, null, sitemenuProp1, true, 1031,0),
		new menuItem('MTP Fiber Structure Cabling', null, null, null, sitemenuProp1, true, 1032,0),
		//*********************************
		new menuItem('Compact Multi Media Module', null, null, null, sitemenuProp1, true, 1029,0),
		new menuItem('Cat6A Cabling Solution', null, null, null, sitemenuProp1, true, 1028,0),
		new menuItem('Cat6 Channel Solutions', null, null, null, sitemenuProp1, true, 1025,0),
		new menuItem('Audio/Video',null, null, null, sitemenuProp1, true,1027,0),
		new menuItem('Network patch cables', null, null, null, sitemenuProp1, true, 1001, 0),
		new menuItem('PC Cables', null, null, null, sitemenuProp1, true, 1016, 0),
		new menuItem('Information Outlet/Jack', null, null, null, sitemenuProp1, true, 1010, 0),	
		new menuItem('SCSI', null, null, null, sitemenuProp1, true, 1019, 0),
			new menuItem('Bulk cable', null, null, null, sitemenuProp1, true, 1002, 0),
			new menuItem('Patch Panel', null, null, null, sitemenuProp1, true, 1003, 0),
			new menuItem('Fiber Optic', null, null, null, sitemenuProp1, true, 1006, 0),	
			new menuItem('Ethernet/Fast Ethernet', null, null, null, sitemenuProp1, true, 1005, 0),			
			
			new menuItem('PC Adapters/Converters', null, null, null, sitemenuProp1, true, 1015, 0),
			new menuItem('Raceway System', null, null, null, sitemenuProp1, true, 1007, 0),		
			new menuItem('IBM Networking', null, null, null, sitemenuProp1, true, 1009, 0),
			
			new menuItem('UTP Accessories', null, null, null, sitemenuProp1, true, 1011, 0),		
			new menuItem('Cable Management', null, null, null, sitemenuProp1, true, 1013, 0),
			new menuItem('STP Cabling - Shielded', null, null, null, sitemenuProp1, true, 1014, 0),		
			new menuItem('110 Cabling Products', null, null, null, sitemenuProp1, true, 1017, 0),	
			new menuItem('Tools & Tester', null, null, null, sitemenuProp1, true, 1020, 0),
			new menuItem('USB & Fire Wire', null, null, null, sitemenuProp1, true, 1021, 0),
			new menuItem('Switch Boxes', null, null, null, sitemenuProp1, true, 1023, 0),
			new menuItem('25 Pair Cabling', null, null, null, sitemenuProp1, true, 1024, 0),
//			new menuItem('Apple Talk', null, null, null, sitemenuProp1, true, 1012, 0),
			new menuItem('RS-232 Cabling', null, null, null, sitemenuProp1, true, 1018, 0),
			new menuItem('V.35', null, null, null, sitemenuProp1, true, 1022, 0),
			new menuItem('Home Wiring', null, null, null, sitemenuProp1, true, 1026, 0),
new menuItem('OEM Cable'," categoryDisplay('','','','','OEM_Cable.asp')", null, null, sitemenuProp1, false ,0,1)	
			)
			return submenu;
			break;
	}
return submenu; }

function menu() {
	var id;

	this.menuItems = new Array();
	for (var i = 0; i < menu.arguments.length; i++) {
		this.menuItems[i] = menu.arguments[i];
		menu.arguments[i].menu = this;
	}
	if (isNav) {
		var lyr = eval('document.layers["lyr' + layerlevel + '"]');
		//var lyr = eval("document.layers[\"lyr" + layerlevel + "\"]");
	} else if (isIE) {
		var lyr = eval("document.all(\"" + "lyr" + layerlevel + "\")");
	}
	if (isIE) {
		lyr.insertAdjacentHTML("BeforeEnd",htmlTags);
		htmlTags = "";
		for (var i = 0 ; i < menu.arguments.length; i++) {
		     id = menuItems.length - menu.arguments.length + i;
		     menu.arguments[i].obj = eval("document.all(\"" + id + "\")");
		}
	} else if (isNav) {

		lyr.document.open();
		lyr.document.write(htmlTags);
		lyr.document.close();
		htmlTags = "";
		var j = 0;
		for (var i = 0;i <  menu.arguments.length;i++) {
 			id = menuItems.length - menu.arguments.length + i
			var menuvar = "menu" +  id
		    var menuparent = eval("lyr.document." + menuvar + ".parentLayer");
		    if (menuparent == lyr) {
			     menuItems[id].obj =  eval("lyr.document.layers[" + j + "]");
			     j++;
  			}
			var menulyr = eval("lyr.document." + menuvar);
			menulyr.captureEvents(Event.MOUSEUP);
			menulyr.onmouseup = collapseMenu;
		}
	}
	
	testfornav = layerlevel + " "
	if (testfornav.indexOf("nav",1) > -1) {
		this.navmenu = 1;
	} else {
		this.navmenu = 0;
	}

	this.width = 0;
	this.height = 0;
	this.direction = "right";
	this.openSubMenu = null;
	this.activeMenuItem = null;
	this.show = menu_show;
	this.hide = menu_hide;
	this.expand = menu_expand;
	this.id = lyr.id
	
	this.calculateDimensions = menu_calculateDimensions;
	
	this.setActiveMenuItem = menu_setActiveMenuItem;

	return this;
}
