// JavaScript Document
var navArray = new Array("welcome","currentartists","meet","publications","directions","history","join");

for (var x=0; x<=6; x++) {
	eval("var " + navArray[x] + "_on = new Image;");
	eval(navArray[x] + "_on.src = 'images/global/" + navArray[x] + "_on.gif';");
	eval("var " + navArray[x] + "_off = new Image;");
	eval(navArray[x] + "_off.src = 'images/global/" + navArray[x] + "_off.gif';");
}
//}

function rollOn(name){
	eval("document.images."+name+".src = "+name+"_on.src");
	return true;
}
function rollOff(name){
	eval("document.images."+name+".src = "+name+"_off.src");
	return true;
}

function writeNav(pagename){
	document.writeln("<DIV ID='navigation' name='navigation' style='position:absolute; left:15px; top:10px; z-index:12;'>");
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	//welcome
    document.writeln("<tr><td><a href='welcome.html' onMouseOver='rollOn(&quot;welcome&quot;);' onMouseOut='rollOff(&quot;welcome&quot;);'><img src='images/global/welcome_off.gif' alt='Welcome' width='190' height='24' border='0' name='welcome'/></a></td></tr>");
	//current exhibition
    document.writeln("<tr><td><a href='current.html' onMouseOver='rollOn(&quot;currentartists&quot;);' onMouseOut='rollOff(&quot;currentartists&quot;);'><img src='images/global/currentartists_off.gif' alt='Current Exhibition' width='190' height='24' border='0' name='currentartists'/></a></td></tr>");
	//meet our artists
    document.writeln("<tr><td><a href='artists.html' onMouseOver='rollOn(&quot;meet&quot;);' onMouseOut='rollOff(&quot;meet&quot;);'><img src='images/global/meet_off.gif' alt='Meet the Artists' width='190' height='24' border='0' name='meet'/></a></td></tr>");
	//directions map
   	document.writeln("<tr><td><a href='directions.html' onMouseOver='rollOn(&quot;directions&quot;);' onMouseOut='rollOff(&quot;directions&quot;);'><img src='images/global/directions_off.gif' alt='Directions' width='190' height='24' border='0' name='directions'/></a></td></tr>");
	//publications
    document.writeln("<tr><td><a href='publications.html' onMouseOver='rollOn(&quot;publications&quot;);' onMouseOut='rollOff(&quot;publications&quot;);'><img src='images/global/publications_off.gif' alt='Publications' width='190' height='24' border='0' name='publications'/></a></td></tr>");
	//history
    document.writeln("<tr><td><a href='history.html' onMouseOver='rollOn(&quot;history&quot;);' onMouseOut='rollOff(&quot;history&quot;);'><img src='images/global/history_off.gif' alt='History of the Gallery' width='190' height='24' border='0' name='history'/></a></td></tr>");
	//join mailing list
    document.writeln("<tr><td><a href='join.html' onMouseOver='rollOn(&quot;join&quot;);' onMouseOut='rollOff(&quot;join&quot;);'><img src='images/global/join_off.gif' alt='Join our Mailing List' width='190' height='24' border='0' name='join'/></a></td></tr>");
    
    document.writeln("</table>");
	document.writeln("</DIV>");
}

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
W3C = document.getElementById ? 1 : 0;

function showText() {
	if (ns4) {
		eval("document.textbox.visibility = 'show'");
	} else if (ie4) {
		eval("document.all.textbox.style.visibility = 'visible'");
	} else if (W3C) {
		eval("document.getElementById('textbox').style.visibility = 'visible'");
	}
}

function hideText(){
	if (ns4) {
		eval("document.textbox.visibility = 'hide'");
	} else if (ie4) {
		eval("document.all.textbox.style.visibility = 'hidden'");
	} else if (W3C) {
		eval("document.getElementById('textbox').style.visibility = 'hidden'");
	}
}

var blueDot = new Image;
blueDot.src = "images/artists/blue_dot.gif";
var spacer = new Image;
spacer.src = "images/global/spacer.gif";
function rollOnDot(name){
	eval("document.images."+name+".src = blueDot.src");
	return true;
}
function rollOffDot(name){
	eval("document.images."+name+".src = spacer.src");
	return true;
}

function writeArtistList(){
	var arrLen = artArray.length;
	for(i=1 ; i<arrLen ; i++){								//loop starts with 1 because 0 is for current artist
		var spacePos = artArray[i].lastIndexOf(" ");
		var nameLen = artArray[i].length;
		var artName = artArray[i].substr(spacePos+1,nameLen);
		var nameIndex = i+1;
		var upperName = artArray[i].toUpperCase();
		document.writeln('<tr><td><img src="images/global/spacer.gif" name="artist'+i+'" width="30" height="30" border="0" /></td> ');
		document.writeln('<td valign="middle"><a href="archive.html?artist='+artName+'&indice='+i+'" onMouseOver="javascript:rollOnDot(&quot;artist'+i+'&quot;);" onMouseOut="javascript:rollOffDot(&quot;artist'+i+'&quot;);">');
		document.writeln(upperName);
		document.writeln('</a></td></tr>');
	}
}

function getQuery(query) {
	quStrng = window.location.search.substring(1);
	quSub = quStrng.split("&");
	for (i=0;i<quSub.length;i++) {
		ft = quSub[i].split("=");
		if (ft[0] == query) {
			return ft[1];
		}
	}
}
function showMap(mapname){
	if (ie4) {
		eval("document.all."+mapname+".style.visibility = 'visible'");
	} else {
		eval("document.getElementById('"+mapname+"').style.visibility = 'visible'");
	}
}

function hideMap(mapname){
	if (ie4) {
		eval("document.all."+mapname+".style.visibility = 'hidden'");
	} else {
		eval("document.getElementById('"+mapname+"').style.visibility = 'hidden'");
	}
}