var menuArray=new Array(4);
menuArray[0]=new Array();
menuArray[1]=new Array();
menuArray[2]=new Array();
menuArray[3]=new Array();
menuArray[4]=new Array();
menuArray[0][0]=['Current Work',''];
menuArray[0][1]=['window.html','Window Series'];
menuArray[0][2]=['other.html','Other Currently Available Works'];
menuArray[0][3]=['new.html','Work in Progress'];
menuArray[1][0]=['Museum',''];
menuArray[1][1]=['win.html','<I>The Window Series</I>'];
menuArray[1][2]=['franceMus.html','South of France Paintings'];
menuArray[1][3]=['bridge.html','<I>The Bridgetown Series</I>'];
menuArray[1][4]=['misc.html','Miscellaneous Paintings and Drawings'];
menuArray[2][0]=['News &amp; Features',''];
menuArray[2][1]=['multimedia.html','Multimedia Studio Visit'];
menuArray[2][2]=['slide.html','Slide Shows'];
menuArray[2][3]=['mouse.html','Mouse of the Hill'];
menuArray[2][4]=['watercolour.html','Ken Tolmie&#146;s Watercolour Technique'];
menuArray[3][0]=['About the Artist',''];
menuArray[3][1]=['bio.html','Biography &amp; Exhibitions'];
menuArray[3][2]=['style.html','Style &amp; Technique'];
menuArray[4][0]=['Contact Information',''];
menuArray[4][1]=['address.html','Contact Information'];
menuArray[4][2]=['gallery.html','The Tolmie Gallery'];

if (document.layers) window.onresize = self.location.reload;

function writeMenus() {
	noCanDo = (navigator.userAgent.indexOf('iCab')!=-1)?true:false; // iCab can navigate from links but can't show/hide or position menus
	if (!noCanDo) {
		for (count=0;count<menuArray.length;count++) {
			document.write('<DIV ID=menu'+count+' CLASS=menu><SPAN CLASS=menuButtonText>'+menuArray[count][0][0]+'</SPAN><BR>&nbsp;<BR>');
			for (num=1;num<menuArray[count].length;num++) {
				document.writeln('<A HREF="'+menuArray[count][num][0]+'" CLASS=menuText>'+menuArray[count][num][1]+'</A><BR>');
			}
			document.writeln('<A HREF="#" CLASS=closeMenu onMouseOver="hideAllMenus()">Close Menu</A></DIV>');
		}
	}	
}

function getStyleObject(objectId) {
    obj=(document.getElementById && document.getElementById(objectId))?document.getElementById(objectId).style:((document.all && document.all(objectId))?document.all(objectId).style:document.layers[objectId]);
	return obj;
}

function changeObjectVisibility(objectId,vis) {
    var menuDiv=getStyleObject(objectId);
    if(menuDiv) {
		menuDiv.visibility=vis;
		return true;
    } else {
		return false;
    }
}

function hideAllMenus() {
    for (i=0;i<5;i++) {
		changeObjectVisibility('menu'+i,'hidden');
	}
}

function showMenu(menuNumber,eventObj) {
	hideAllMenus();
    var menuId='menu'+menuNumber;
    if (changeObjectVisibility(menuId,'visible')) {
		eventObj.cancelBubble = true;
		return true;
    } else {
		return false;
    }
}

function roll(url,thumb,div) {
	targ=url
	thb=(document.getElementById)?document.images.thumbnail:((document.all)?document.images.thumbnail:document.picture.document.images.thumbnail);
	thb.src=thumb
	show=(document.getElementById)?document.getElementById(div).style:((document.all)?document.all[div].style:document.layers[div]);
	for (i=0;i<mini.length;i++) {
		elem='info'+i;
		hide=(document.getElementById)?document.getElementById(elem).style:((document.all)?document.all[elem].style:document.layers[elem]);
		hide.visibility='hidden'
	}
	thb.src=thumb
	show.visibility='visible'
}

function position() {
	var winLeft=(window.innerWidth)?window.innerWidth/2:document.body.clientWidth/2;
	if (winLeft > 400) {
		if (document.getElementById) {
			if (document.getElementById('picture').style.pixelLeft) { //IE5+, Safari
				document.getElementById('picture').style.pixelLeft = winLeft;
				for (i=0;i<mini.length;i++) {
					elem='info'+i;
					document.getElementById(elem).style.pixelLeft=winLeft;
				}
			} else { //Mozilla, Opera 6
				document.getElementById('picture').style.left = winLeft + "px";
 				for (i=0;i<mini.length;i++) {
					elem='info'+i;
					document.getElementById(elem).style.left=winLeft+"px";
				}
			}
		} else if (document.all && !document.getElementById) { //IE4
			document.all.picture.style.pixelLeft = winLeft;
			for (i=0;i<mini.length;i++) {
				elem='info'+i;
				document.all[elem].style.pixelLeft=winLeft;
			}
		} else if (document.layers) { //NS4
			document.picture.left = winLeft;
  			for (i=0;i<mini.length;i++) {
				elem='info'+i;
				document.layers[elem].left=winLeft;
			}
		}
	}
}

function goPage(url) {
	self.location.href=url
}