imageType="jpg"
fileRelLoc="./"

function hilight(index, state) {
	var obj=document.getElementById("butt"+index);
	obj.src=fileRelLoc+"images/button_"+index+(state==1?"_over":"")+"."+imageType;
}

function newImage(arg) { 
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
		
function preloadButtons(c) {
	for (i=2; i<(c+1); i++) {
		imgz=newImage(fileRelLoc+"images/button_"+i+"_over."+imageType);
	}
}

blinkMe=new Array("#33ccff", "#cccccc", "#33ccff", "#cccccc", "#33ccff", "#cccccc");
function blinkText(f, i) {
	obj=document.getElementById(f);
	obj.style.color=blinkMe[i++];
	if (i<blinkMe.length) setTimeout("blinkText('"+f+"', "+i+")", 500);
}
		
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(fileRelLoc+'music/'+mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindow(mypage, myname, 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(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}

function swapVisible() {
	obj=document.getElementById(swapVisible.arguments[0]);
	obj.style.display="block";
	obj=document.getElementById(swapVisible.arguments[1]);
	obj.style.display="none";
	
	if (swapVisible.arguments.length>3) {	// Then I have that cookie to deal with
		openTabs=openTabs+Math.pow(2,swapVisible.arguments[2])*swapVisible.arguments[3];
		document.cookie="admin_tabs="+openTabs;
	}
}

function sendWarning() {
	return confirm("Are you sure? Click \"OK\" to post your message, otherwise, press \"Cancel\" now.");
}

function rossFindHeight(arg) {
	obj=document.getElementById(arg);
	if (obj.offsetHeight) return obj.offsetHeight;
	else return 0;
}

function talkHeight() {
	maxxie=0;
	for(i=0; i<talkHeight.arguments.length; i++) { // alert(isNaN(talkHeight.arguments[i]));
		if (isNaN(talkHeight.arguments[i])) maxxie=Math.max(maxxie, rossFindHeight(talkHeight.arguments[i]));
		else maxxie=Math.max(maxxie, parseInt(talkHeight.arguments[i]));
	}
	document.getElementById(talkHeight.arguments[0]).style.height=maxxie+"px";
}

function setMail(id, before, after, subject) {
	document.getElementById(id).href="mailto:"+before+"@"+after+"?subject="+subject;
}			

