// JavaScript for Portfolio pages// loading flag - true while loading, false afterwardvar loading = true;// currently shown paintingvar shown = "";// browservar NS = (navigator.appName == "Netscape");IE4 = document.all; NS4 = document.layers; NS6a = document.getElementById;if (NS6a && NS) {NS6=1;} else {NS6=0;}// start function - hides loading layer and shows first paintingfunction start(which) {  MM_showHideLayers("loadingdiv","","hide");  loading = false;  show(which);}// preload highlighted thumbnailsfunction thumbpreload() {  // derived from MM_preloadImages()  var d = document;  if (d.images) {    if(!d.MM_p)      d.MM_p = new Array();    var i, j;    for (i = 0, j = d.MM_p.length; i < imglist.length; i++, j++) {      d.MM_p[j] = new Image;      d.MM_p[j].src = imgprefix + "thumbs/" + imglist[i] + "-h.jpg";    }  }}// mouseover and mouseout for thumbnailsfunction thumbmouseover(which) {  if (!loading) {    if (which != shown) {      var x = MM_findObj("th"+which);      if (x != null)        x.src = imgprefix + "thumbs/" + which + "-h.jpg";    }  }}function thumbmouseout(which) {  if (!loading) {    if (which != shown) {      var x = MM_findObj("th"+which);      if (x != null)        x.src = imgprefix + "thumbs/" + which + ".jpg";    }  }}// show a paintingfunction show(which) {  if (!loading) {    // translate "previous" and "next"    if (which == "previous") {      var i;      for (i = 0; i < imglist.length; i++) {        if (shown == imglist[i]) {          which = (i > 0 ? imglist[i-1] : imglist[imglist.length-1]);          break;        }      }    }    else if (which == "next") {      var i;      for (i = 0; i < imglist.length; i++) {        if (shown == imglist[i]) {          which = (i < imglist.length-1 ? imglist[i+1] : imglist[0]);          break;        }      }    }    // hide current painting    if (shown != "" && which != shown) {      // unhighlight thumbnail      var x = MM_findObj("th"+shown);      if (x != null)        x.src = imgprefix + "thumbs/" + shown + ".jpg";      // hide image and caption      MM_showHideLayers("img"+shown+"div","","hide","cap"+shown+"div","","hide");      shown = "";    }    // show new painting    if (which != "") {      // highlight thumbnail      var x = MM_findObj("th"+which);      if (x != null)        x.src = imgprefix + "thumbs/" + which + "-h.jpg";      // show image and caption      MM_showHideLayers("img"+which+"div","","show","cap"+which+"div","","show");      shown = which;    }  }}// position layer based on current browser width, then show the layer// NOT USED SINCE PAGE IS FLUSH LEFT//function position_and_show(menulayer, nominalleft) {//  var obj;//  if ((obj=MM_findObj(menulayer))!=null) {//    if (obj.style) { obj=obj.style; }//    var minwidth = 750;   // the minimum width//    var newwidth = minwidth;//    var newleft = nominalleft; // the left position of the layer when the content is flush left//    if (IE4) {//      newwidth = (document.body.clientWidth > minwidth ? document.body.clientWidth : minwidth);//      newleft = newleft + Math.floor((newwidth-minwidth)/2);//    }//    else if (NS4) {//      var innerWidth2 = innerWidth - 16; // subtract width of scrollbar//      newwidth = (innerWidth2 > minwidth ? innerWidth2 : minwidth);//      newleft = newleft + Math.floor((newwidth-minwidth)/2);//    }//    else if (NS6) {//      newwidth = (innerWidth > minwidth ? innerWidth : minwidth);//      newleft = newleft + Math.floor((newwidth-minwidth)/2);//    }//    if (IE4 || NS6) {//      newleft = ""+newleft+"px";//    }//    obj.left = newleft;//    MM_showHideLayers(menulayer,'','show');//  }//}// called on page reload// NOT USED SINCE PAGE IS FLUSH LEFT - USE MM FUNCTION IN DWCODE.JS INSTEAD//function reloadPage(init) {  //adapted from MM function//  if (init == true) {//    if (NS4) {//      document.MM_pgW = innerWidth;//      document.MM_pgH = innerHeight;//    }//    onresize = reloadPage; // call this function on resize//  }//  else {//    if (NS4) {//      if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)//        location.reload();//    }//    else {//      show(shown);//    }//  }//}//reloadPage(true); // initialize