var NS6 = false;
var IE4 = (document.all)? true:false
var NS4 = (document.layers)? true:false
var NS6 = (document.getElementById)? true:false
var yesMac = false;
if (navigator.userAgent.indexOf("Mac")!=-1) yesMac = true;

var pageScroll = false;
var moveit = false;
var scrolldir = 0;

//from mfah v2
function troll(xcell,xcol,xcol2){
	nc = "nc" + xcell;	//nc the cell + n
	tc = "tc" + xcell;	//tc the a + n
	window.document.getElementById(nc).style.background = xcol;
	window.document.getElementById(tc).style.color = xcol2;
}


function rollover(button,axtn,lname){
	if (document.images){document.images[button].src="../graphics/library/"+button+axtn+".gif";	}
}


function popup(newurl,winWidth,winHeight,tb){
	starttext = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizeable=no,";
	if(tb=="print") starttext = "toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizeable=no,";
	featuretext = starttext + "width="+winWidth+",height="+winHeight+",left=5,top=5";
	mainView = window.open(newurl,'ImagePreview',featuretext);
	mainView.focus();
}

function xLink(whereto){
	newLoc = "http://www.mfah.org/xlink.asp?nL=" + whereto
	popup(newLoc,440,275)
	}
	
function switchMsg(mID) {
	textstring = "<span style='width:175; height:83; background-color:" + msgC[mID] + ";'>"
	textstring = textstring + "<table cellspacing='0' cellpadding='0' border='0' width='175' height='83'><tr><td valign='middle' align='center' class='bodytext' style='color:white'>"
	textstring = textstring + msgA[mID] + "</td></tr></table></span>"
	
	if(IE4){
			document.all("thumbhint").innerHTML=textstring;
			}
	else if(NS4) {
			lname = "thumbhint"
			document.layers["thumbhint"].document.write(textstring);
	  		document.layers["thumbhint"].document.close();
			}
	else if(NS6) {
			document.getElementById("thumbhint").innerHTML=textstring;		
	}
}
