rossCollapse=false;
toPullUp=0;
ext=".jpg";
fileLoc="./images/";
collapseDelay=1500;
overBefore='over/';
normBefore='buttons/';
overAfter='';

sizesArray=new Array(1, 4, 6, 7, 4, 1);

function newImage(arg) { 
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
		
function preload_buttons() {
// the main buttons are already loaded in HTML. Use this routine to load rollovers
	for (i=1; i<(1+sizesArray.length); i++) {
		for (j=1; j<(1+sizesArray[i-1]); j++) {
			newImage(fileLoc+overBefore+"button_"+i+"_"+j+overAfter+ext);
			newImage(fileLoc+normBefore+"button_"+i+"_"+j+ext);
		}
	}
}

function rossPulldown(n) { // hide all the other pulldowns but n
	for (i=1; i<(1+sizesArray.length); i++) {
		obj=document.getElementById("button"+i);
		obj.style.display=(i==n?"none":"block");
		obj=document.getElementById("pulldown"+i);
		obj.style.display=(i==n?"block":"none");
	}
	rossCollapse=false;
	if (n>0) { rossOver(n, 1, 1); } // display the top rollover by default
}

function rossPullup() {
	if (rossCollapse) {
		rossPulldown(0);
	}
}

function rossSchedulePullup(n) { //alert ("schedule pull up "+n);
	toPullUp=n;
	rossCollapse=true;
	setTimeout("rossPullup()", collapseDelay);
}


function rossDelayCollapse() {
	rossCollapse=false;
}

function rossOver(n, s, state) {
	obj=document.getElementById("pb_"+n+"_"+s);
	obj.src=fileLoc+(state==1?overBefore:normBefore)+"button_"+n+"_"+s+(state==1?overAfter:"")+ext;
}

function rossNewWindow(mypage, myname, title, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "height="+h+",width="+w+",top="+wint+",left="+winl+",scrollbars="+scroll
	win = window.open('./image_ref.php?i='+mypage+'&t='+title, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function isCookieSet(findMe) {
	if (document.cookie) {
		thisCookie=document.cookie.split("; ");
		for (i=0; i<thisCookie.length; i++) {
			zooberCookie=thisCookie[i].split("=")[0];
			if (zooberCookie==findMe) { return true; }
		}
	}
	return false;
}
