
	
	//===================================================================================
	// Pre-load images if any
	// The image objects aren't actually used anywhere, but it forces the image to preload

	var imgs = new Array();
	//imgs[0] = new Image();
	//imgs[0].src = "../img/tab2_1_on.gif";

	//===================================================================================

	// If tab is an image instead of text
	function tab_hover(obj, st) {
		var cn = false;
		if(st == 1) {
			cn = obj.className.replace(/_off$/g, "_hover");
		} else {
			cn = obj.className.replace(/_hover$/g, "_off");
		}
		if(cn) obj.className = cn;
	}

	function tab_select(tabset, tabnum, obj, additional) {
		var x = 1;
		var onoff, tab;

		// For HORCHOW only!
		// ==========================================================
		// 'Shop By' (if tab is ON, close tab completely)
		if(tabset == 1 && document.getElementById("tab" + tabset + "_" + tabnum).className.match(/_on/)) tabnum = "";

		// ==========================================================

		x = 1;
		while(tab = document.getElementById("tab" + tabset + "_" + x)) {
			onoff = x == tabnum ? "on" : "off";
			tab.className = printf("tab%s_%s tab%s_%s_%s", [tabset, onoff, tabset, x, onoff]);
			document.getElementById("tabcontent" + tabset + "_" + x).className = x == tabnum ? "tab_vis" : "tab_hid";
			x++; 
		}

		// For HORCHOW only!
		// ==========================================================
		if(additional == 'thumbs') {
			// Right-side thumbnails
			document.getElementById("tabcontent" + tabset + "_" + tabnum).className = "tab2_vis";
		}
		// ==========================================================

		if(obj) obj.blur(); // Remove focus from the link

		return false;
	}


	function printf(S, L) { 
		var nS = "";
		var tS = S.split("%s");
		for(var i=0; i<L.length; i++) nS += tS[i] + L[i];
		return nS + tS[tS.length-1]; 
	} 
