//  Global scripts
  var ie4 = document.all
  var ns6 = document.getElementById&&!document.all
  var ns  = navigator.userAgent.indexOf('Netscape') != -1 && navigator.userAgent.indexOf('Gecko') != -1
  var opr = navigator.userAgent.indexOf('Opera/') != -1 | navigator.userAgent.indexOf('Opera ') != -1;   // Opera identifying Opera or Other
  var moz = navigator.userAgent.indexOf('Gecko') != -1

 var nav    = ie4 ? document.all.nav : document.getElementById('nav')
 var ddMenu = ie4 ? document.all.ddMenu : document.getElementById('ddMenu')
 var menuActive = 0
 var timeOn = null
 var menu
 var navW = 750   //set navbar width
 var topO = 194   //set top offset

  //------------------ show menu ------------------
function showMenu(menuName,wide){
 ddMenu = ie4 ? document.all.ddMenu : document.getElementById('ddMenu')
 menu   = ie4 ? document.all[menuName] : document.getElementById(menuName)
    pos = 195  // set box left start position
    wide= 140  // default box width
    add = '<div class="navbox" onMouseOver="swapBg(this,\'a4\'),menuOver(this);" onMouseOut="swapBg(this,\'b4\'),menuOut(this);" onClick="location.href=\''

  //------------------ DROPDOWN MENUS ------------------
if(menuName == 'listB'){
pos  = pos + 0
wide = 180
var menu1  = ''
    menu1 += add + 'galleries.htm\'">Gallery Index</div>'
    menu1 += add + '_barrett1.htm\'">Roy BARRETT</div>'
    menu1 += add + '_brierton1.htm\'">Irene BRIERTON</div>'
    menu1 += add + '_butt1.htm\'">Alistair BUTT</div>'
    menu1 += add + '_butterworth1.htm\'">Geoff BUTTERWORTH</div>'
    menu1 += add + '_cowden1.htm\'">David COWDEN</div>'
//    menu1 += add + '_chandler1.htm\'">Cynthia CHANDLER</div>'
    menu1 += add + '_dyson1.htm\'">Paul DYSON</div>'
    menu1 += add + '_freeman1.htm\'">John FREEMAN</div>'
    menu1 += add + '_harrison1.htm\'">Terry HARRISON</div>'
//    menu1 += add + '_hemming1.htm\'">Nigel HEMMING</div>'
//    menu1 += add + '_hemming_s1.htm\'">Sue HEMMING</div>'
    menu1 += add + '_holland1.htm\'">David HOLLAND</div>'
    menu1 += add + '_hutchinson1.htm\'">Andrew HUTCHINSON</div>'
    menu1 += add + '_makinson1.htm\'">Bill MAKINSON</div>'
    menu1 += add + '_mason1.htm\'">Gayle MASON</div>'
    menu1 += add + '_melling1.htm\'">Keith MELLING</div>'
//    menu1 += add + '_riley1.htm\'">Caroline RILEY</div>'
    menu1 += add + '_sibson1.htm\'">John SIBSON</div>'
//    menu1 += add + '_varnish1.htm\'">Will VARNISH</div>'
    menu1 += add + '_vokes1.htm\'">Colin VOKES</div>'
//    menu1 += add + '_white1.htm\'">Ken WHITE</div>'

ddMenu.innerHTML = menu1
}

//-------- DO NOT EDIT BELOW THIS POINT --------------------------------

	// position menu
 if (window.innerWidth) {
  innerW = window.innerWidth
  } else {
  innerW = document.body.clientWidth
  }
leftMark = ((innerW - navW)/2)
  if(ie4 && !opr){leftMark = leftMark + 8}
  if(moz)        {leftMark = leftMark + 16}
  if(ns)         {leftMark = leftMark - 6}
  if(opr)        {leftMark = leftMark - 3}
topMark  = topO
  if(moz){topMark  = topMark + 0}
  if(ns) {topMark  = topMark + 0}
  if(opr){topMark  = topMark - 2}

if (timeOn != null) {
    clearTimeout(timeOn)
    hideMenu(menu)
 }

 ddMenu.style.top        = topMark + 'px'
 ddMenu.style.left       = leftMark + parseInt(pos) + 'px'
 ddMenu.style.width      = parseInt(wide) + 'px'
 ddMenu.style.visibility = "visible"
}

	// hide menu
function hideMenu(menu){
 if (menuActive == 0) {
 ddMenu.style.visibility = "hidden"
 }
}
	// timer for button mouse out
function btnTimer() {
 timeOn = setTimeout("btnOut()",100)
}
	// button mouse out
function btnOut(menuName) {
 if (menuActive == 0) {
 hideMenu(menu)
 }
}
	// menu mouse over
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
}
	// menu mouse out
function menuOut(itemName) {
 menuActive = 0
 timeOn = setTimeout("hideMenu(menu)", 300)
}

	// PRELOAD
icon2 = new Image();icon2.src = "images/icon_zoom.gif"
icon3 = new Image();icon3.src = "images/icon_zoom2.gif"
icon4 = new Image();icon4.src = "images/icon_zoom_out.gif"
icon5 = new Image();icon5.src = "images/icon_zoom_out2.gif"


 if (self != top) top.location = self.location;

	//  ROLLOVERS
function swapBg(mo,ab) {
 if (ab=='a') {mo.style.backgroundColor = '#5F8714'
	   	mo.style.cursor = 'pointer'}
 if (ab=='b') {mo.style.backgroundColor = '';
	   	mo.style.color  = '#aeaeae'}
 if (ab=='a2'){mo.style.backgroundColor = '#aeaeae'
		mo.style.cursor = 'pointer'}
 if (ab=='b2'){mo.style.backgroundColor = '#5F8714'}
 if (ab=='a3'){mo.style.backgroundColor = '#5F8714';
		mo.style.color  = '#ffffff';
		mo.style.cursor = 'pointer';}
 if (ab=='b3'){mo.style.backgroundColor = '';
		mo.style.color  = '#5F8714'}
 if (ab=='a4'){mo.style.backgroundColor = '#5F8714'
		mo.style.cursor = 'pointer'}
 if (ab=='b4'){mo.style.backgroundColor = '#aeaeae'}
}

	// AUTO GALLERY NAVIGATION
function galleryNav() {
  var write = ''
gOff = '<div class="galoff">' + gallery + '</div>'
gOn  = '<div class="galon" onMouseOver="swapBg(this,\'a3\')" onMouseOut="swapBg(this,\'b3\')" onClick="location.href=\'_' + artist
gDim = '<div class="galdim">X</div>'
    if(gallery==1){write += gOff}else{if(gall_of > 1){write += gOn + '1.htm\'">1</div>'}else{write += gDim}}
    if(gallery==2){write += gOff}else{if(gall_of > 1){write += gOn + '2.htm\'">2</div>'}else{write += gDim}}
    if(gallery==3){write += gOff}else{if(gall_of > 2){write += gOn + '3.htm\'">3</div>'}else{write += gDim}}
    if(gallery==4){write += gOff}else{if(gall_of > 3){write += gOn + '4.htm\'">4</div>'}else{write += gDim}}
    if(gallery==5){write += gOff}else{if(gall_of > 4){write += gOn + '5.htm\'">5</div>'}else{write += gDim}}
    if(gallery==6){write += gOff}else{if(gall_of > 5){write += gOn + '6.htm\'">6</div>'}else{write += gDim}}
    if(gallery==7){write += gOff}else{if(gall_of > 6){write += gOn + '7.htm\'">7</div>'}else{write += gDim}}
	return write
}
function galleryNav2() {
  var write2 = '<table width="150" border=0 cellspacing=2 cellpadding=0 align=center><tr>'

gNavb = '<tr><td align="center" class="nextdim">back</td>'
gNav1 = '<td align="center" class="nextbox" onMouseOver="swapBg(this,\'a2\')" onMouseOut="swapBg(this,\'b2\')" onClick="location.href=\'_' + artist + (gallery-1) + '.htm\'">back</td>'
gNav2 = '<td align="center" class="nextbox" onMouseOver="swapBg(this,\'a2\')" onMouseOut="swapBg(this,\'b2\')" onClick="location.href=\'_' + artist + (gallery+1) + '.htm\'">next</td>'
gNavn = '<td align="center" class="nextdim">next</td>'
    if(gallery==1){write2 += gNavb; if(gall_of > 1){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==2){write2 += gNav1; if(gall_of > 2){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==3){write2 += gNav1; if(gall_of > 3){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==4){write2 += gNav1; if(gall_of > 4){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==5){write2 += gNav1; if(gall_of > 5){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==6){write2 += gNav1; if(gall_of > 6){write2 += gNav2}else{write2 += gNavn}}
    if(gallery==7){write2 += gNav1 + gNavn}
	write2 += '</tr></table>'
	return write2
}




