function toggleLayer(whichLayer) {
  var elem, vis;
  if(document.getElementById) // this is the way the standards work
    elem = document.getElementById(whichLayer);
  else if(document.all) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if(document.layers) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


var menuwidth='200px' //default menu width
var menubgcolor='white'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

//Contents for item 1
var item2=new Array()
item2[0]='<img src="art/IMG_7821.jpg" height="480" width="328">'

var item3=new Array()
item3[0]='<img src="art/1010.jpg" height="430" width="400">'
var item4=new Array()
item4[0]='<img src="art/1013.jpg" height="478" width="480">'
var item5=new Array()
item5[0]='<img src="art/IMG_7736.jpg" height="480" width="446">'
var item6=new Array()
item6[0]='<img src="art/IMG_7738.jpg" height="391" width="480">'
var item7=new Array()
item7[0]='<img src="art/7ece_12_desc_2.jpg" height="461" width="480">'
var item8=new Array()
item8[0]='<img src="art/IMG_7729.jpg" height="480" width="373">'
var item9=new Array()
item9[0]='<img src="art/IMG_7726.jpg" height="440" width="480">'
var item10=new Array()
item10[0]='<img src="art/IMG_7676.jpg" height="480" width="360">'
var item11=new Array()
item11[0]='<img src="art/1011.jpg" height="480" width="472">'
var item12=new Array()
item12[0]='<img src="art/1002.jpg" height="480" width="439">'
var item13=new Array()
item13[0]='<img src="art/1012.jpg" height="480" width="393">'
var item14=new Array()
item14[0]='<img src="art/1004.jpg" height="480" width="438">'
var item15=new Array()
item15[0]='<img src="art/1005.jpg" height="437" width="480">'
var item16=new Array()
item16[0]='<img src="art/1006.jpg" height="480" width="475">'
var item17=new Array()
item17[0]='<img src="art/1007.jpg" height="480" width="373">'
var item18=new Array()
item18[0]='<img src="art/1009.jpg" height="480" width="417">'
var item19=new Array()
item19[0]='<img src="art/IMG_7754.jpg" height="480" width="397">'
var item20=new Array()
item20[0]='<img src="art/IMG_7278.jpg" height="480" width="379">'
var item21=new Array()
item21[0]='<img src="art/IMG_7271.jpg" height="480" width="376">'
var item22=new Array()
item22[0]='<img src="art/13f5_12.jpg" height="354" width="350">'
var item23=new Array()
item23[0]='<img src="art/IMG_7230.jpg" height="480" width="440">'
var item24=new Array()
item24[0]='<img src="art/IMG_7379.jpg" height="480" width="387">'
var item25=new Array()
item25[0]='<img src="art/IMG_7380.jpg" height="478" width="480">'
var item26=new Array()
item26[0]='<img src="art/IMG_7407.jpg" height="478" width="456">'
var item27=new Array()
item27[0]='<img src="art/IMG_7674.jpg" height="478" width="476">'
var item28=new Array()
item28[0]='<img src="art/IMG_7676.jpg" height="478" width="360">'
var item29=new Array()
item29[0]='<img src="art/92cb_12.jpg" height="461" width="480">'
var item30=new Array()
item30[0]='<img src="art/IMG_7227.jpg" height="428" width="480">'
var item31=new Array()
item31[0]='<img src="art/IMG_7861.jpg" height="448" width="480">'
var item32=new Array()
item32[0]='<img src="art/IMG_7859.jpg" height="434" width="480">'
var item33=new Array()
item33[0]='<img src="art/1008_small.jpg" height="480" width="392">'
var item34=new Array()
item34[0]='<img src="art/1009.jpg" height="480" width="417">'
var item35=new Array()
item35[0]='<img src="art/13f5_12.jpg" height="480" width="476">'
var item36=new Array()
item36[0]='<img src="art/d795_12.jpg" height="482" width="480">'
var item37=new Array()
item37[0]='<img src="art/IMG_7738.jpg" height="391" width="480">'
var item38=new Array()
item38[0]='<img src="art/IMG_7736.jpg" height="480" width="446">'
var item39=new Array()
item39[0]='<img src="art/IMG_7924.jpg" height="480" width="415">'
var item40=new Array()
item40[0]='<img src="art/IMG_8100.jpg" height="482" width="480">'
var item41=new Array()
item41[0]='<img src="art/IMG_8133.jpg" height="480" width="369">'
var item42=new Array()
item42[0]='<img src="art/IMG_8097.jpg" height="480" width="398">'
var item43=new Array()
item43[0]='<img src="art/IMG_8104.jpg" height="480" width="415">'
var item44=new Array()
item44[0]='<img src="art/IMG_7907.jpg" height="472" width="480">'
var item45=new Array()
item45[0]='<img src="art/IMG_7889.jpg" height="480" width="480">'
var item46=new Array()
item46[0]='<img src="art/IMG_7862.jpg" height="480" width="369">'
var item47=new Array()
item47[0]='<img src="art/IMG_8293_titled.jpg" height="469" width="480">'
var item48=new Array()
item48[0]='<img src="art/IMG_8260_titled.jpg" height="445" width="480">'
var item49=new Array()
item49[0]='<img src="art/IMG_8216_titled.jpg" height="480" width="327">'

var item50=new Array()
item50[0]='<img src="art/Ornaments/IMG_1661.jpg" height="304" width="640">'
var item51=new Array()
item51[0]='<img src="art/Ornaments/IMG_1659.jpg" height="583" width="640">'
var item52=new Array()
item52[0]='<img src="art/Ornaments/IMG_1658.jpg" height="640" width="593">'

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-115 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-115 : window.pageYOffset+window.innerHeight-118
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.x = dropmenuobj.x+23
//document.write ("dropmenuobj.x = " + dropmenuobj.x)
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+150+"px"
}

return clickreturnvalue()
}
//-------------------

function dropdownmenuPIC(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.x = dropmenuobj.x
//document.write ("dropmenuobj.x = " + dropmenuobj.x)
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

//------------------
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
