// shared.js script, version 2.1, 08-13-03, Hot Pepper, Inc., http://www.hotpepper.com

// global vars ======================================================
var loc = location.pathname.split('/');
loc.length = loc.length - 1; // removes filename 

var d = location.pathname.replace(/\/[^\/]*/g,'../'); // return one depth too deep, see next line for fix
d = d.substring(0,(d.length-3)); // turns this: ../../ into this ../
// /global vars ======================================================

// img preloads =====================================================
/*
hh = new Image(); hh.src = "/pix/hh.gif"; hh_roll = new Image(); hh_roll.src = "/pix/hh_roll.gif";
*/	
// /img preloads =====================================================

// popup window functions ==========================================
function popFlex(URL,winName,W,H,scroll) {
	if (scroll == "no")
		{scroll = "scrollbars=no";}
	else if (scroll == "yes")
		{scroll = "scrollbars";}
	window.open(URL, winName,"top=0,left=30,width="+W+",height="+H+",resizable=no,"+scroll+"");
	}	
// /popup window functions ==========================================

var n = 0;
function crossfade(speed) {
	dissolve(divs_to_fade[n],100,'up',speed);
	n++;
	if (n == divs_to_fade.length) {n = 0;}
	dissolve(divs_to_fade[n],1,'down',speed);
	}
function dissolve(obj_id,o_v,updown,speed) {
	var obj = document.getElementById(obj_id);
	if (obj == null) {return;}
	if (obj.filters) {obj.style.filter = 'alpha(opacity='+o_v+')';}
	obj.style.KHTMLOpacity = o_v/100;
	obj.style.MozOpacity = o_v/100;
	obj.style.opacity = o_v/100;
	if (updown == 'down') {
		if (o_v <= 100) {
			o_v += 5;
			window.setTimeout('dissolve("'+obj_id+'",'+(o_v)+',"'+updown+'","'+speed+'")',speed);
			}
		}
	if (updown == 'up') {
		if (o_v >= 0) {
			o_v -= 5;
			window.setTimeout('dissolve("'+obj_id+'",'+(o_v)+',"'+updown+'","'+speed+'")',speed);
			}
		}
	}
