	
	var showHideMenu = new Array();
	var heightSpacer = 130; // space required in the flash player to show text
	var curImage;
	/**
	* @param selected: Bool		true to keep arrow yellow
	*/
	function togCatalog(catid,selected) {
		
		//subcat_fx[catid].toggle();
		
		targ_cat 	= getEl('category['+catid+']');
		//targ_button = getEl('category_button['+catid+']');
		targ_arrow	= getEl('arrow['+catid+']');
		
		if(!showHideMenu[catid] || showHideMenu[catid] == 'off') { // the table is currently 'OFF'
			// Make the arrow point down to indicate options now available
			if(selected) {
				imgsrc = 'images/menu_arrow_light_down.gif';
			}else {
				imgsrc = 'images/menu_arrow_down.gif';
			}
			
			// Show the table of subcategories
			targ_cat.className = 'show';
			
			//targ_button.innerHTML = 'LESS- ';
			//targ_button.className = 'contract padding';
			
			showHideMenu[catid] = 'on';
			
			if(is.ie) {
				targ_arrow.src = 'images/spacer.gif';
				targ_arrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgsrc+"', sizingMethod='scale')";
			}else {
				targ_arrow.src = imgsrc;
			}
			
		}else {
			// Make the arrow point down to indicate options now available
			if(selected) {
				imgsrc = 'images/menu_arrow_light.gif';
			}else {
				imgsrc = 'images/menu_arrow.gif';
			}
			
			targ_cat.className = 'hide';
			
			//targ_button.innerHTML = 'MORE+ ';
			//targ_button.className = 'expand padding';
			
			showHideMenu[catid] = 'off';
			
			if(is.ie) {
				targ_arrow.src = 'images/spacer.gif';
				targ_arrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgsrc+"', sizingMethod='scale')";
			}else {
				targ_arrow.src = imgsrc;
			}
		}
		
	}
	
	
	function loadProd(id, img, price, desc, name, subprod_exists) {
		li = getEl('lrgimg');
		pn = getEl('prodName');
		pd = getEl('prod_dollar');
		pc = getEl('prod_cent');
		ep = getEl('existing_subprod');
		it = getEl('item');
		holdit = getEl('holditem');
		
		li.src = img;
		pn.innerText = name.toUpperCase();
		pd.innerText = '$' + parseInt(price);
		
		cent = ((parseFloat(price) - parseInt(price))*100);
		if(!cent) {
			cent = '00';
		}
		pc.innerText = '.' + cent;


		if(subprod_exists) {
			ep.value = 1;
			it.value = getEl('subproduct').value;
		}else {
			ep.value = 0;
			it.value = id;
		}
		holdit.value = id;
	}
	
	function checkCartFrm(frm) {
		spe = frm.existing_subprod.value; // sub product exists
		if(spe == 1) {
			if(frm.subproduct.value < 1) {
				id = frm.item.value;
				animSubProd('open', 0, id);
				getEl('item').value = getEl('subproduct').value;
			}else {
				getEl('item').value = getEl('subproduct').value;
				return frm.submit();
			}
		}else {
			return frm.submit();
		}
		return false;
	}
	
	
	/**	For the large image hover/drag
	*
	*/
	function viewImage(id,counter,w,h) {
		
		w = 500;
		h = h + heightSpacer;
		
		var container = getEl('preview_div');
		
		// 1. Embed the flash file with accompanying product id
		if(curImage != id) {
			// auto injects
				container.className = 'floatdiv';
				container.style.width = w;
				container.style.height = h;
				
				defaultimageheight = h; // so we get the correct coordinates for the preview_div to move left or right
				defaultimagewidth = w + 10;
				
			var inject = activeEmbed("flash/imageLoader.swf?imgid="+id,"imageViewer",0,0,false,false,false,'preview_div');

			curImage = id;
			
			
			// everything is injected and showing, now follow the mousetrail
			document.onmousemove=followmouse; 
			
		}else {
			// SHOW IMAGE (dont need to re-embed)
			container.className = 'floatdiv';
			document.onmousemove=followmouse;
		}
	}
	
	/** 
	*	Close the hover /drag image on  a time, recursive to call after a momentary pause
	*/
	function closeImage(runme) {
		hidetrail();
		var container = getEl('preview_div');
		container.className = 'hide';
	}