//  Drop Down Menu 
// Find DOM 
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else {
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else {
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}
// End of Find DOM
var menuTop = 45;
var menuLeft = 400;

var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var lDelay = 3;
var lCount = 0;
var pause = 100;

function dropMenu(menuNum){
	if (isDHTML) {
///// Sets the previous menu's visibility to hidden
		t = 2;
		if (oldDomSMenu) {
			oldDomSMenu.visibility = 'hidden';
			oldDomSMenu.zIndex = '0';
			t = 2;
			lCount = 0;
		}

///// Defines the DOMs	of the menu objects
		var idMenu = 'menuHead';
		var domMenu = findDOM(idMenu,0);

		var idMenuOpt = 'menuHead' + menuNum;
		var domMenuOpt = findDOM(idMenuOpt,0);

		var idSMenu = 'menu' + menuNum;
		var domSMenu = findDOM(idSMenu,1);

///// Defines the positions of the sub-menus
	if (isID || isAll) {
				var menuLeft = (domMenu.offsetLeft) + (domMenuOpt.offsetLeft) + 5;
				var menuTop = (domMenu.offsetTop) + (domMenu.offsetHeight) + 0;
			}
		if (isLayers) {
				var menuLeft = document.layers[idMenu].layers[idMenuOpt].pageX - 5;
				var menuTop = domMenu.pageY + domMenu.clip.height - 5;
		}

///// Positions and shows the menu
		if (oldDomSMenu != domSMenu) {
			domSMenu.left = menuLeft;
			domSMenu.top = menuTop;
			domSMenu.visibility = 'visible';
			domSMenu.zIndex = '100';
			oldDomSMenu = domSMenu;
		}

///// Resets oldDom if it is the same as the current DOM
		else { oldDomSMenu = null; }
	}

////// Returns a 'null' value for non-DHTML Browsers
	else { return null; }
}

function hideDelay() {
///// Checks to see if there is a menu showing and whether
///// the global variable 't' has been set to 0
    if ((oldDomSMenu) && (t == 0)) {

///// Hides the old menu, resets menu conditions,
///// and stops the function running
        oldDomSMenu.visibility = 'hidden';
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0;
        return false;
    }

///// Interupts the function if another menu is opened
    if (t == 2) { lCount = 0; return false; }

///// Repeats the function adding 1 to lCount each time until
///// lCount is equal to lDelay and then sets 't' to 0 so that
///// the menu will hide when it runs again
    if (t == 1) {
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('hideDelay(' + t + ')',pause); }
    }
}
//  End of Drop Down Menu 
// Pop Box
function findLivePageWidth() {
	if (window.innerWidth != null)
		return window.innerWidth;
	if (document.body.clientWidth != null)
		return document.body.clientWidth;
	return (null);
}

function popUp(evt,objectID){
	if (isDHTML) { // Makes sure this is a DHTML browser
		var livePageWidth = findLivePageWidth();
		//alert(livePageWidth);
		domStyle = findDOM(objectID,1);
		dom = findDOM(objectID,0);
		state = domStyle.visibility;
		if (dom.offsetWidth) elemWidth = dom.offsetWidth;
		else { if (dom.clip.width)	elemWidth = dom.clip.width; }
		if (state == "visible" || state == "show")  { domStyle.visibility = "hidden"; }
		else {
			if (evt.pageY) { //Calculates the position for Navigator 4 
				topVal = evt.pageY + 4;
				leftVal = evt.pageX - (elemWidth / 2); 
			}
			else { 
				if (evt.y) { // Calculates the position for IE4
					topVal = evt.y + 4 + document.body.scrollTop;
					leftVal = evt.x - (elemWidth / 2) + document.body.scrollLeft;
				}
			}
		/*If the element goes off the page to the left, this moves it back */
			if(leftVal < 2) { leftVal = 2; }
			else { 
				if ((leftVal + elemWidth) > livePageWidth) { leftVal = leftVal - (elemWidth / 2); }
			}
			
			/*If the element goes off the page to the bottom, this moves it back */
			if(topVal > 200) { topVal = 80; }

			domStyle.top = topVal; // Positions the element from the top
			domStyle.left = leftVal; // Positions the element from the left
			domStyle.visibility = "visible"; // Makes the element visable 
		}
	}
}

<!--  Gallery Pic -->
function drawPic(picID,picL,picT,picW,picH,picw,pich,picName,picTitle,blurb) {
document.write('<span id="'+picID+'" class="popPic" style="position: absolute; z-index:60;" onClick="popUp(event,\''+picID+'\')">')
document.write('<img border="0" src="imgs/300/300'+picName+'.jpg" width="'+picW+'" height="'+picH+'" alt="'+picTitle+'"><br><br><b>'+picTitle+'</b><br>'+blurb+'</span>')
document.write('<div class="frame" style="position: absolute; z-index:50; left: '+picL+'; top: '+picT+'" onClick="popUp(event,\''+picID+'\')">')
document.write('<img border="0" src="imgs/120/'+picName+'.jpg" src="imgs/300/300'+picName+'.jpg" width="'+picw+'" height="'+pich+'" alt="Click on a picture for more detail"></div>')
}
//   navMenuBar
function writeNavMenuBar(gLast,page_name,gNext,boxno) {
document.write('<div id="titlebar">')
document.write('<br><table border="0" width="98%" cellspacing="0" cellpadding="0">')
document.write('<tr><td rowspan=3 align="center">')
document.write('<a href="index.html"><img src="imgs/logojaovalgrey.jpg" border="0" alt="Home Page" title=" JonART " width="90" height="30"></a>')
document.write('</td><td class="blankLine">.</td></tr><tr>')
document.write('<td class="headerNavL">')
document.write('<a class="headerNavigation" title=" Back " href="javascript:history.go(-1);">&nbsp;&nbsp;&lt;&lt;</a>&nbsp;|&nbsp;')
document.write('<a class="headerNavigation" class="menuHead"  onmouseover="popUp(event,\''+boxno+'\')" onmouseout="popUp(event,\''+boxno+'\')"> '+page_name+' </a> |')
document.write('<a class="headerNavigation" title=" Next Gallery " class="menuHead" href="'+gNext+'.html">&nbsp;&nbsp;&gt;&gt;&nbsp; </a> |</div>')

document.write('</td>')
document.write('<td id="menuHead" class="headerNavR" align="center">|&nbsp;')
document.write('<a class="headerNavigation" title=" Click on the Gallery you want to see. " id="menuHead1" href="g1.html" onMouseOut="t=1; hideDelay()" onMouseOver="dropMenu(1)">Galleries</a> |')
document.write('<a class="headerNavigation" title=" Click on Art Course information you want to see. " id="menuHead2" href="course.html" onMouseOut="t=1; hideDelay()" onMouseOver="dropMenu(2)">&nbsp;Courses</a> |')
document.write('<a class="headerNavigation" title=" Click on a page you want to see. " id="menuHead3" href="help.html" onMouseOut="t=1; hideDelay()" onMouseOver="dropMenu(3)">&nbsp;Reference</a> |')
document.write('</td></tr><tr><td class="blankLine">.</td></tr>')
document.write('</table><br>')

document.write('<span id="box1" class="popBox">This is just the name of this page,')
document.write('<br><br>|&lt;&lt;|&nbsp;&nbsp;&nbsp;goes back to the previous page.')
document.write('<br>|&gt;&gt;|&nbsp;&nbsp;&nbsp;goes to the next gallery.')
document.write('<br><br> |Galleries| shows a drop down menu of all the galleries.')
document.write('<br><br> |Courses| shows information on art courses.')
document.write('<br><br> |Reference| shows help,contacts,etc.')
document.write('<br><br> Click on a picture for more information.')
document.write('<br><br> Click on an enlargement to get rid of it. </span>')

document.write('<span id="null" class="popNon">')
document.write('</span>')

document.write('<div id="menu1" class="menuStyle"><b>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="g1.html">Gallery 1</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="g2.html">Gallery 2</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="g3.html">Gallery 3</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="g4.html">Gallery 4</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="g5.html">Gallery 5</a><br>')
document.write("</b></div>")

document.write('<div id="menu2" class="menuStyle">')
document.write('<b>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t = 2;"  onClick="t = 0; hideDelay();"  href="course.html">Courses</a><br>')
document.write('</b>')
document.write('</div>')

document.write('<div id="menu3" class="menuStyle">')
document.write('<b>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="biog.html">Biography</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="links.html">Links</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="mail.html">e-Mail</a><br>')
document.write('<a class="menuLink" onMouseOut="t=1; hideDelay()" onMouseOver="t=2;"  onClick="t=0; hideDelay();"  href="help.html">Help</a><br>')
document.write('</b>')
document.write('</div>')

document.write('</div>')
}
// end of navMenuBar 

var picT, pic = 0;

function DisplayPic(pics,picDelay1) {
   picDelay = picDelay1;
   if (pic == pics.length)
     pic = 0;
   document.picImg.src = pics[++pic];
   picT = setTimeout("DisplayPic(pics,picDelay)", picDelay1);
}

function MakeArray() {
    this.length = MakeArray.arguments.length;
    for (var i = 0; i < this.length; i++)
      this[i+1] = MakeArray.arguments[i];
}

//Print
function printPage(){  
if (navigator.appName == "Netscape") {
    window.print() ;  
} else {
    var ob = '<object id="WebBrowser1" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
document.body.insertAdjacentHTML('beforeEnd', ob);
    WebBrowser1.ExecWB(6, 2);
}
}

// titlebar and copyright
var offsetleft=30
var offsettop=10

var ns4=document.layers?1:0
var ie4=document.all?1:0
var moz=document.getElementById&&!document.all?1:0

function makeStatic() {
if (ie4) {titlebar.style.pixelTop=document.body.scrollTop+offsettop}
else if (moz) {document.getElementById("titlebar").style.top=window.pageYOffset+offsettop}
else if (ns4) {eval(document.title.top=eval(window.pageYOffset+offsettop));}

setTimeout("makeStatic()",0);
}
//window.onload=makeStatic; defaultStatus="© Jon-ART.com 2004. All Rights Reserved.";
window.onload=  defaultStatus="© JohnLowry.org 2007. All Rights Reserved."; 
window.onUnload="clearTimeout(picT)";

//reduce spam
obfuscate = 'not@soton.ac.uk';
local = new Array (221,216,223,217,247,221,216,223,217,219,216,192,197,206,153,216,197,208); //jon
local_part = '';
for (i=0; i<local.length; local_part += String.fromCharCode(local[i] ^ 183), i++) ;
   astring = local_part;
//
if (top.location != self.location) {
top.location = self.location
}
