PINT.vs = { 
menus : [{"title":"Desktop Monitors ", "href":"/chde/products/desktop-monitors/", "items": [{"title":"Size", "href":"/chde/products/desktop-monitors/search-results.php?&", "items": [{"title":"39cm-43cm (15-17&quot;)", "href":"/chde/products/desktop-monitors/search-results.php?&x=43&y=5&y=14", "items": [{"title":"VA703b ", "href":"/chde/products/desktop-monitors/lcd/value-series/va703b.htm? "}]},{"title":"48cm-51cm (19-20&quot;)", "href":"/chde/products/desktop-monitors/search-results.php?&x=31&y=15", "items": [{"title":"VA916", "href":"/chde/products/desktop-monitors/lcd/value-series/va916.htm"},{"title":"VA1916w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1916w.htm"},{"title":"VA926", "href":"/chde/products/desktop-monitors/lcd/value-series/va926.htm? "},{"title":"VA1926w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1926w.htm? "},{"title":"VA2013wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013wm.htm"},{"title":"VA2013w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013w.htm"},{"title":"VA1913wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913wm.htm"},{"title":"VX1932wm-LED", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1932wmled.htm"},{"title":"VG930m", "href":"#"},{"title":"VA1913w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913w.htm"},{"title":"VX1940w-3", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w-3.htm"},{"title":"VX1940w-4", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w.htm"}]},{"title":"56cm (22&quot;)", "href":"/chde/products/desktop-monitors/search-results.php?&x=28&y=13", "items": [{"title":"VG2230wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2230wm.htm? "},{"title":"VA2216w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2216w.htm"},{"title":"VX2260wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2260wm.htm"},{"title":"VA2213w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2213w.htm"},{"title":"VA2226w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2226w.htm? "},{"title":"VX2268wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2268wm.htm"},{"title":"VG2227wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2227wm.htm"}]},{"title":"58cm (23&quot;)", "href":"#", "items": [{"title":"VP2365wb", "href":"/chde/products/desktop-monitors/lcd/pro-series/vp2365wb.htm"}]},{"title":"61cm (24&quot;) -up", "href":"#", "items": [{"title":"VA2413wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2413wm.htm"},{"title":"VX2433wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2413wm.htm"},{"title":"VG2427wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2427wm.htm"}]}]},{"title":"Application", "href":"#", "items": [{"title":"Home &amp; Office", "href":"/chde/home-office/desktop-monitors/"},{"title":"Entertainment", "href":"/chde/entertainment/desktop-monitors/"},{"title":"Business", "href":"/chde/business/desktop-monitors/"}]},{"title":"Technology", "href":"#", "items": [{"title":"LED", "href":"/chde/products/desktop-monitors/lcd/led-lcd/", "items": [{"title":"VX1932wm-LED", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1932wmled.htm"}]},{"title":"LCD", "href":"/chde/products/desktop-monitors/lcd/", "items": [{"title":"VA1903wb ", "href":"/chde/products/desktop-monitors/lcd/value-series/va1903wb.htm"},{"title":"VA1926w ", "href":"/chde/products/desktop-monitors/lcd/value-series/va1926w.htm? "},{"title":"VA2026w ", "href":"/chde/products/desktop-monitors/lcd/value-series/va2026w.htm? "},{"title":"VA2226w ", "href":"/chde/products/desktop-monitors/lcd/value-series/va2226w.htm? "},{"title":"VA703b ", "href":"/chde/products/desktop-monitors/lcd/value-series/va703b.htm? "},{"title":"VA926 ", "href":"/chde/products/desktop-monitors/lcd/value-series/va926.htm? "},{"title":"VG2230wm ", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2230wm.htm? "},{"title":"VG930m ", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg930m.htm? "},{"title":"VA2216w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2216w.htm"},{"title":"VA916", "href":"/chde/products/desktop-monitors/lcd/value-series/va916.htm"},{"title":"VX2260wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2260wm.htm"},{"title":"VA2213w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2213w.htm"},{"title":"VA2413wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2413wm.htm"},{"title":"VA2013wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013wm.htm"},{"title":"VX2268wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2268wm.htm"},{"title":"VA2013w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013w.htm"},{"title":"VA1913wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913wm.htm"},{"title":"VP2365wb", "href":"/chde/products/desktop-monitors/lcd/pro-series/vp2365wb.htm"},{"title":"VG2427wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2427wm.htm"},{"title":"VA1913w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913w.htm"},{"title":"VG2227wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2227wm.htm"},{"title":"VX1940w-3", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w-3.htm"},{"title":"VX1940w-4", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w.htm"}]}]},{"title":"Series", "href":"/chde/products/desktop-monitors/", "items": [{"title":"X Series", "href":"/chde/products/desktop-monitors/lcd/x-series/", "items": [{"title":"VX2260wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2260wm.htm"},{"title":"VX2433wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2433wm.htm"},{"title":"VX2268wm", "href":"/chde/products/desktop-monitors/lcd/x-series/vx2268wm.htm"},{"title":"VX1932wm-LED", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1932wmled.htm"},{"title":"VX1940w-3", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w-3.htm"},{"title":"VX1940w-4", "href":"/chde/products/desktop-monitors/lcd/x-series/vx1940w.htm"}]},{"title":"Pro Series", "href":"/chde/products/desktop-monitors/lcd/pro-series/", "items": [{"title":"VP2365wb", "href":"/chde/products/desktop-monitors/lcd/pro-series/vp2365wb.htm"}]},{"title":"Graphic Series", "href":"/chde/products/desktop-monitors/lcd/graphic-series/", "items": [{"title":"VG930m", "href":"#"},{"title":"VG2230wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2230wm.htm"},{"title":"VG2427wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2427wm.htm"},{"title":"VG2227wm", "href":"/chde/products/desktop-monitors/lcd/graphic-series/vg2227wm.htm"}]},{"title":"Value Series", "href":"/chde/products/desktop-monitors/lcd/value-series/", "items": [{"title":"VA703b ", "href":"/chde/products/desktop-monitors/va703b.htm? "},{"title":"VA1926w ", "href":"/chde/products/desktop-monitors/va1926w.htm? "},{"title":"VA2226w ", "href":"/chde/products/desktop-monitors/va2226w.htm? "},{"title":"VA926 ", "href":"/chde/products/desktop-monitors/va926.htm? "},{"title":"VA1916w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1916w.htm"},{"title":"VA2216w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2216w.htm"},{"title":"VA916", "href":"/chde/products/desktop-monitors/lcd/value-series/va916.htm"},{"title":"VA2213w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2213w.htm"},{"title":"VA2413wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2413wm.htm"},{"title":"VA2013wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013wm.htm"},{"title":"VA2013w", "href":"/chde/products/desktop-monitors/lcd/value-series/va2013w.htm"},{"title":"VA1913wm", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913wm.htm"},{"title":"VA1913w", "href":"/chde/products/desktop-monitors/lcd/value-series/va1913w.htm"}]}]}]},{"title":"Projectors", "href":"/chde/products/projectors/", "items": [{"title":"Application", "href":"/chde/entertainment/", "items": [{"title":"Home &amp; Office", "href":"/chde/home-office/projectors/"},{"title":"Entertainment", "href":"/chde/entertainment/projectors/"},{"title":"Business", "href":"/chde/business/projectors/"}]},{"title":"Technology", "href":"#", "items": [{"title":"DLP", "href":"#", "items": [{"title":"PJ258D ", "href":"/chde/products/projectors/pj258d.htm? "},{"title":"PJ260D ", "href":"/chde/products/projectors/pj260d.htm? "},{"title":"PJ513D", "href":"/chde/products/projectors/pj513d.htm"},{"title":"PJD6210-WH", "href":"/chde/products/pjd6210wh.htm"},{"title":"PJ551D", "href":"/chde/products/projectors/pj551d.htm? "},{"title":"PJ568D", "href":"/chde/products/projectors/pj588d44128.htm"},{"title":"PJ588D", "href":"/chde/products/projectors/pj588d.htm"},{"title":"PJD6211", "href":"/chde/products/projectors/pjd6211.htm"},{"title":"PJD6221", "href":"/chde/products/projectors/pjd6221.htm"},{"title":"PJD6241", "href":"/chde/products/projectors/pjd6241.htm"},{"title":"PJD6381", "href":"/chde/products/projectors/pjd6381.htm"},{"title":"PJD6251", "href":"/chde/products/projectors/pjd6251.htm"},{"title":"PJD5111", "href":"/chde/products/projectors/pjd5111.htm"},{"title":"PJD5112", "href":"/chde/products/projectors/pjd5112.htm"}]},{"title":"LCD", "href":"#", "items": [{"title":"PJ1173 ", "href":"/chde/products/projectors/pj1173.htm? "},{"title":"PJ358 ", "href":"/chde/products/projectors/pj358.htm? "},{"title":"PJ359w ", "href":"/chde/products/projectors/pj359w.htm? "},{"title":"PJL7201", "href":"/chde/products/pjl7201.htm"},{"title":"PJL3211", "href":"/chde/products/projectors/pjl3211.htm"}]}]},{"title":"Wireless Presentation Gateway ", "href":"/chde/products/projectors/wireless-presentation-gateway/", "items": [{"title":"WPG-350", "href":"/chde/products/projectors/wireless-presentation-gateway/wpg350.htm"},{"title":"WPG-150", "href":"/chde/products/projectors/wireless-presentation-gateway/wireless-presentation-gateways-wpg150.htm"}]}]},{"title":"Digital Signage", "href":"/chde/products/digital-signage/", "items": [{"title":"Type", "href":"#", "items": [{"title":"Commercial Display", "href":"/chde/products/digital-signage/commercial-display/", "items": [{"title":"ND4210w", "href":"/chde/products/digital-signage/commercial-display/nd4210w.htm"},{"title":"CD3200", "href":"/chde/products/digital-signage/commercial-display/cd3200.htm"},{"title":"CD4620", "href":"/chde/products/digital-signage/commercial-display/cd4620.htm"},{"title":"CD4220", "href":"/chde/products/digital-signage/commercial-display/cd4220.htm"}]},{"title":"Media Players", "href":"/chde/products/digital-signage/media-players/", "items": [{"title":"NMP-530", "href":"/chde/products/digital-signage/media-players/nmp530.htm"}]}]},{"title":"Application", "href":"#", "items": [{"title":"Business", "href":"/chde/business/digital-signage/"}]}]},{"title":"Digital Photo Frames", "href":"/chde/products/digital-photo-frames/", "items": [{"title":"Application", "href":"#", "items": [{"title":"Home &amp; Office", "href":"/chde/home-office/digital-photo-frames/"},{"title":"Business", "href":"/chde/business/digital-photo-frames/"}]}]},{"title":"Computer", "href":"/chde/products/pcs/", "items": [{"title":"PC mini", "href":"/chde/products/pcs/pc-mini/", "items": [{"title":"PC mini 120", "href":"/chde/products/pcs/pc-mini/vot120.htm"},{"title":"PC mini 132", "href":"/chde/products/pcs/pc-mini/pc-mini-132.htm"},{"title":"PC mini 530", "href":"/chde/products/pcs/pc-mini/pc-mini-530.htm"},{"title":"PC mini 550", "href":"/chde/products/pcs/pc-mini/pc-mini-550.htm"}]}]},{"title":"Digital Media Player", "href":"/chde/products/digital-media-player/", "items": [{"title":"VMP72", "href":"/chde/products/digital-media-player/vmp72.htm"},{"title":"VMP52", "href":"/chde/products/digital-media-player/vmp52.htm"}]},{"title":"Portable Media Player", "href":"/chde/products/vpd400.htm", "items": [{"title":"VPD 500 /400", "href":"/chde/products/vpd400.htm"}]}],
_createMenu : function (items, level, genealogy) {

	// Create the menu element
	var div = document.createElement('div');
	
	// Add the genealogy ID and set the level className
	div.setAttribute('id', 'menu_' + genealogy.join('_'));
	div.className = 'level_'+level;
	
	// Begin the links inside our menu
	var html = '<div id="submenu_' + genealogy.join('_') + '" class="scroll"><ul>';
	for (var i=0; i<items.length; i++) {
		// If there are children inside the current list item
		var isParent = (items[i].items && items[i].items.length) ? true : false;
		html = html + '<li';
		if (i==items.length-1) html = html + ' class="last"';
		html = html + '><a href="'+items[i].href+'" class="link_'+(i+1);
		if (isParent) html = html + ' parent';
		html = html + '">'+items[i].title+'</a>';
		
		if (isParent) {
		
			// Increase the genealogy for the children
			genealogy[level]++;
			
			// Reset genealogy if we are on a top level item or a first level item 
			if (level == 0) genealogy = [genealogy[0]++,0,0];
			else if (level == 1) genealogy = [genealogy[0], genealogy[1], 0];

			// Recursion: create the child menu and increase the level by 1
			PINT.vs._createMenu(items[i].items, level+1, genealogy);
		}
	}
	html = html + '</ul></div>';
	div.innerHTML = html;
	
	// Add the menu to the document
	PINT.vs.menuContainer.appendChild(div);
	
	// Make the last div scrollable and then hide it (quirkiness of flexcroll)
	if (level == 3 && items.length > 6) { 
		
		// Creates the scroller and hides it (it has to be shown at first to get calculations right)
		CSBfleXcroll('submenu_' + genealogy.join('_'));
		div.style.display = 'none'; 
	}
	// Add listeners to the A tags
	YAHOO.util.Event.on(div.getElementsByTagName('a'), 'mouseover', PINT.vs._prepareMenu);
},
_prepareMenu : function(e) {
	var isLast = false;

	// Get the menu containing the link that was moused over.
	var menu = this.parentNode.parentNode.parentNode.parentNode;
	
	// Remove any previous selections
	YAHOO.util.Dom.removeClass(menu.getElementsByTagName('a'), 'selected');
	
	// Build out the genealogy of the current menu
	var genealogy = menu.id.split('_');
		genealogy = genealogy.slice(1,4);
		
	// Find the current menu level
	var level = menu.className.split('_')[1];
	
	// Find the level of the link (when added into the genealogy, we can figure out the menu to be shown)
	var nextLevel =  this.className.split(' ')[0].split('_')[1];
	if (genealogy[0] == 0) genealogy[0] = nextLevel;
	else if (genealogy[1] == 0) genealogy[1] = nextLevel;
	else if (genealogy[2] == 0) genealogy[2] = nextLevel;
	else isLast = true;
	
	if (!isLast) {
		// Select the link if it is a parent
		if (YAHOO.util.Dom.hasClass(this, 'parent')) YAHOO.util.Dom.addClass(this, 'selected');
		
		var genealogyId = 'menu_' + genealogy.join('_');
		
		// Hide previous divs by checking to see if they are a higher level than our current level AND making sure the next divToShow is not already showing
		var checkLevel = function(el) {
			return (el.className.split(' ')[0].split('_')[1] > level && el.id != genealogyId);
		}
		var divsToHide = YAHOO.util.Dom.getElementsBy(checkLevel, 'div', 'menu');
		YAHOO.util.Dom.setStyle(divsToHide, 'display', 'none');
		

		// Check to see if the next menu exists and that it's not currently showing
		var divToShow = YAHOO.util.Dom.get(genealogyId);
		
		// If it does, we show it
		if (divToShow && divToShow.style.display != 'block') PINT.vs._showMenu(divToShow, level);
	}
},
_showMenu : function(menu, level) {
	// by/from value default
	var position = [0,0];
	
	// Hardcoded by/from values
	if (level == 0) position = [162, 10];
	else if (level == 1) position = [182, 172];
	else if (level == 2) position = [182, 354];
	
	var slide = new YAHOO.util.Anim(menu, { 
	    left: { by : position[0], from : position[1] }  
	}, .25, YAHOO.util.Easing.easeOut); 
	slide.onStart.subscribe(function() { menu.style.left = position[1] + 'px'; menu.style.display = 'block'; });
	slide.animate();
	
	// Remove any pre-selections
	YAHOO.util.Dom.removeClass(menu.getElementsByTagName('a'), 'selected');
},
init : function() {
	PINT.vs.menuContainer = YAHOO.util.Dom.get('menu');	
    PINT.vs._createMenu(PINT.vs.menus, 0, [0,0,0]);
	PINT.vs.menuContainer.style.display = 'none';
	
	PINT.vs.menu = new PINT.MenuCreator({
        menus: [
			{ id: 'menu', trigger: 'productsMenuLink' },
			{ id: 'menu_shop', trigger: 'shopMenuLink' },
			{ id: 'menu_support', trigger: 'supportMenuLink' },
			{ id: 'menu_company', trigger: 'companyMenuLink' }

		],
        show:function(trigger,menu) {
			if (trigger.parentNode.className.substr(trigger.parentNode.className.length-6) !== '_hover') { 
                    trigger.parentNode.className += '_hover';
            }
			YAHOO.util.Dom.setStyle(menu, 'display', 'block');
			YAHOO.util.Dom.removeClass(menu.getElementsByTagName('a'), 'selected');
        },
        hide:function(trigger,menu) {
            if (trigger.parentNode.className.substr(trigger.parentNode.className.length-6) === '_hover') { 
                trigger.parentNode.className = trigger.parentNode.className.substr(0, trigger.parentNode.className.length-6);
            }
            if (menu.id == 'menu') YAHOO.util.Dom.setStyle(menu.childNodes, 'display', 'none');
           	YAHOO.util.Dom.setStyle(menu, 'display', 'none');
        }
	});

	// Removes the IE6 flicker during animation
	if (PINT.util.browser.bIe6) try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}
}
};

// This function creates a show/hide relationship between a trigger and menu object.
PINT.MenuCreator = function(obj) {
	PINT.checkMouseEvent = new YAHOO.util.CustomEvent();
	for (var oMenu in obj.menus) {
		(function(index, total) {
			var trigger = (obj.menus[index].trigger) ? YAHOO.util.Dom.get(obj.menus[index].trigger) : YAHOO.util.Dom.get(obj.menus[index]);
			var menu = (obj.menus[index].id) ? YAHOO.util.Dom.get(obj.menus[index].id) : YAHOO.util.Dom.get(obj.menus[index]).lastChild;

			if (!trigger || !menu || !obj.show || !obj.hide) return;

			function enterLink(e) {
				clearMenus();
				obj.show(trigger,menu);
				YAHOO.util.Event.stopEvent(e);
				YAHOO.util.Event.on(document.body, 'mouseout', exitField);
			}

			function exitLink(e) {
				if (!e) var e = window.event;
				if (e.stopPropagation) e.stopPropagation();
				else e.cancelBubble = true;
				var relTarg = e.relatedTarget || e.toElement;
				if (relTarg && relTarg != menu && relTarg.parentNode != menu && relTarg.parentNode.parentNode != menu) {
					obj.hide(trigger, menu);
                    YAHOO.util.Event.removeListener(document.body, 'mouseout', exitField);
					return false;
				}
				YAHOO.util.Event.stopEvent(e);
			}

			function exitField(e) {
				if (!e) var e = window.event;
				var tg = (window.event) ? e.srcElement : e.target;
				if (e.stopPropagation) e.stopPropagation();
				else e.cancelBubble = true;
				//if (tg.nodeName != 'DIV' && tg.nodeName != 'UL') return;
				var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
				while (reltg != tg && reltg.nodeName != 'BODY' && reltg.nodeName != 'HTML') {
					if (reltg == this) return;
					reltg = reltg.parentNode
				}
				if (reltg == tg) return;
				obj.hide(trigger, menu);
				YAHOO.util.Event.removeListener(document.body, 'mouseout', exitField);
				YAHOO.util.Event.stopEvent(e);
			}
			
			function clearMenus() {
				for (var i=0; i<total; i++) {
					obj.hide(YAHOO.util.Dom.get(obj.menus[i].trigger), YAHOO.util.Dom.get(obj.menus[i].id));
				}
			}
			YAHOO.util.Event.on(trigger, 'mouseover', enterLink);
			YAHOO.util.Event.on(trigger, 'mouseout', exitLink);
			YAHOO.util.Event.on(menu, 'mouseout', exitField);
		}(oMenu, obj.menus.length));
	}
};
if (!PINT.isEditing) YAHOO.util.Event.onAvailable('menu', PINT.vs.init);