

// left navigation popups
 
var Timers = new Object(); // array of timeout elements
Timers.show = new Array();
Timers.hide = new Array();
Timers.popup_delay = 125;

function showSubCategories(topcatId) {

	// cancel any hide timer
	clearTimeout(Timers.hide[topcatId]);
	
	var popupEl = document.getElementById('child_popup'+ topcatId);

	if (popupEl.style.display != 'block') {
		// prevent unnecessary popups
		
		for ( id in Timers.show ) {
			if (Timers.show[id]) {
				clearTimeout(Timers.show[id]);
				Timers.show[id] = null;
			}
		}

		// retard popup slightly... with hour glass if needed	
		Timers.show[topcatId] = setTimeout('showPopup("'+ topcatId +'")', Timers.popup_delay);
	
	}

}

function hideSubCategories(topcatId) {
	if (Timers.hide[topcatId]) clearTimeout(Timers.hide[topcatId]);
	Timers.hide[topcatId] = setTimeout('hidePopup("'+ topcatId +'")', Timers.popup_delay);
}

function showPopup(topcatId) {
	var popupEl = document.getElementById('child_popup'+ topcatId);
	if ( topcatId != '_featured' ) {
		var categoryEl = document.getElementById('category'+ topcatId);
		categoryEl.className = 'categoryOn';	

		var dl = popupEl.getElementsByTagName('dl');
		if ( dl.length < 2 ) {
			popupEl.style.width = '227px';
			if ( IE6 == 'yes' ) { 
				popupEl.style.backgroundImage = "url('"+ IMG_SERVER +"/bg_subcategoriesFlyout227x191.gif')";
			}
			else {
				popupEl.style.backgroundImage = "url('"+ IMG_SERVER +"/bg_subcategoriesFlyout227x191.png')";
			}
		}
	}
	popupEl.style.display = 'block';
	Timers.show[topcatId] = null;
}

function hidePopup(topcatId) {
	var popupEl = document.getElementById('child_popup'+ topcatId);
	popupEl.style.display = 'none';
	if ( topcatId != '_featured' ) {
		var categoryEl = document.getElementById('category'+ topcatId);
		categoryEl.className = 'categoryOff';	
	}
	Timers.hide[topcatId] = null;
}

