function setPrep()  {
window.onload = prepareGallery();
                    }
var ctrPix = 0;
var maxPix = 1;
var links;
var gallery;
var imags;
function  prepareGallery()   {
//var picHt = source.height;
//var picWd = placeholder.style.width;
//alert(" screen HW are : " + scrHt + scrWd + "pixels;  img HW are " + picHt + picWd);

if (!document.getElementsByTagName) return false;
if (!document.getElementById) return false;
if (!document.getElementById("galleryThumbTbl"))   return false; 

gallery = document.getElementById("galleryThumbTbl");
links = gallery.getElementsByTagName("a");
imags = gallery.getElementsByTagName("img");
maxPix = imags.length - 1;

for (var i = 0; i < links.length; i++) {

links[i].alt = links[i].title;
links[i].onclick = function() {
return showPic(this);
                              }                     
links[i].onkeypress = links[i].onclick;

                                       }

showPic(links[ctrPix]);
return;                              }

function showPic(whichpic)                 {
if (!document.getElementById("galleryBigImg")) return true;
var source=whichpic.getAttribute("href");
var placeholder = document.getElementById("galleryBigImg");
if (placeholder.nodeName != "IMG") return true;
placeholder.setAttribute("src",source);

if (!document.getElementById("galleryCaption")) return false;
var text = whichpic.getAttribute("title") ?   whichpic.getAttribute("title")  : " ";
var description = document.getElementById("galleryCaption");
if (description.firstChild.nodeType == 3) { description.firstChild.nodeValue = text;}
description.setAttribute("alt",text);
 for (var i = 0; i <=maxPix; i++)  		{
 imags[i].style.borderColor =  "#4e545e";
if (links[i] == whichpic) 	{
			ctrPix= i;    
			}
                                                   		 }
  			imags[ctrPix].style.borderColor = "white"; 
 return false;
                                            }

function StuHChgProp(objectID, state)  {
var object=document.getElementById('dropmenu2');
//object.style.visibility = 'hidden';
//object=document.getElementById(objectID);
//object.style.visibility = 'visible';
 alert("state is "+ state);

object.style.visibility = state;
 alert("state is " );
//object.style.visibility = state;
object.style.zIndex = 50;
if (state == 'hidden')  {object.style.zIndex = -10};
 
              }

function MEGpause(func,interval)  {
var MyDelay = setTimeout(func,interval);
                                  }

function backfwd(bumpCtr)  {

ctrPix = ctrPix + bumpCtr;
if (ctrPix > maxPix) ctrPix = 0;
if (ctrPix < 0) ctrPix = maxPix;
showPic(links[ctrPix]);
return;
}

function footer()  {
//document.writeln('</td></tr></table></div>');
document.writeln('<div id="ftr"><p>Website contents copyright 2005-2011.  All Rights Reserved.  Colleen Spencer Henderson.  ');
document.writeln('The entire contents of this website are protected under United States and international copyright'); 
document.writeln('<br/>laws.  Unauthorized use will be prosecuted to the full extent of the law.  ');
document.writeln('Images from this website may not be used in any form without ');
document.writeln('written permission from Colleen Spencer Henderson.');
document.writeln('</div>  ');
return;
}

function HeadLiner(navCtr)  {
//document.writeln('  <table id="ctrTable" class="centeredImage"> <tr><td>   ');
//document.writeln('  <div id="outerBox"  > <div id="qhdr">  ');
//document.writeln('  <img src = "yytitlebar.gif"  id="titleBar"  alt="Examples of Fine Art Photos"   /></div>');
document.writeln('<div id="hrbox">    </div>  ');
document.writeln('<div id="hdrbar">');
document.writeln(' <table id="btnTbl"   ');
document.writeln('  <tr><td id="btn1">    <a      href = "index.html"  id= "qbutton1">&nbsp;  &nbsp;  Home&nbsp;  &nbsp;  &nbsp;   </a></td>');
document.writeln('<td id="btn2" ><a    href = "Galleries.html" 	 ');
document.writeln('id = "qbutton2"  >&nbsp;  &nbsp;  Portfolios&nbsp;  &nbsp;  </a></td>');
document.writeln('<td id="btn3"><a   href = "Workshops.html" id = "qbutton3"    >&nbsp;  &nbsp;  Workshops &nbsp;  &nbsp;   </a></td>');
document.writeln('<td id="btn4"><a href = "Print_Info.html"  id = "qbutton4"    >&nbsp;  &nbsp;   Prints &nbsp;  &nbsp;  </a></td>');
document.writeln('<td id="btn6"><a href = "About_Colleen.html"  id = "qbutton6"    >&nbsp;  &nbsp;   About / Contact &nbsp;  &nbsp;  </a></td>');
document.writeln('<td id="btn8"><a href = "links.html"  id = "qbutton8"    > &nbsp;  &nbsp;    Links &nbsp;  &nbsp;    </a></td>');
document.writeln('<td id="btn10"><a href = "reviews.html"  id = "qbutton10"    > &nbsp;  &nbsp;    Exhibits/Reviews &nbsp;  &nbsp;    </a></td>');
document.writeln('  </tr>');

document.writeln('</table>');
document.writeln('</div>  ');
var btnBold=document.getElementById("btn1");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn2");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn3");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn4");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn6");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn8");
btnBold.style.fontWeight = "normal";
var btnBold=document.getElementById("btn10");
btnBold.style.fontWeight = "normal";

var btnName = "btn" + navCtr;
btnBold=document.getElementById(btnName);
btnBold.style.fontWeight = "bold";
 
return;
   }

 
function loadFrame()           {
   if (location.search) {
var input = unescape(location.search.substr(9))
if (input.substr(0,3) == "f01")  {self.main.location.href = input.slice(3)  }
                        }       }
var ShrMaxSpot = 6
var ShrMaxGals = 35
var ShrMaxPix  = 33
var ShrGalNo   = 0
var ShrGalNames = new Array()
var ShrGals = new Array()
var ShrTitles = new Array()
var ShrHiLites = new Array()


var ShrSrcs = new Array(ShrMaxGals+1)
for (var i = 0; i < ShrMaxGals; i++) {
     ShrGals[i]    = new Array()
     ShrHiLites[i] = new Array()
     ShrTitles[i]  = new Array()
     ShrTitles[i][1] = "title1"  
     for (var ii = 0; ii < ShrMaxPix; ii++) { ShrHiLites[i][ii] = 0}
 ShrSrcs[i] = new Array(ShrMaxSpot+ 1)
// for (var ii = 1;  ii <= ShrMaxSpot; ii++) {
//   ShrSrcs[i][ii] = "YPhotos/y" + ShrGals[i][0] + ii + "t" + ShrGals[i][ii] + ".jpg"
//}
}
var DebugSw = "N"
var ShrSpot = 1
var ShrMaxHist = 500
var ShrMaxLess4 = ShrMaxHist - 4
var ShrHistCnt = 0
var ShrBackFwd = 0
var ShrHist = new Array(ShrMaxHist + 4)
var ShrGalHist = new Array(ShrMaxHist + 4)
ShrHist[0] = "ymainhom.html"
ShrGalHist[0] = 0
var ShrBackFwdSw = "N"
function ShrHistUpdt(LastURL)  {
if (ShrBackFwdSw == "Y") ShrBackFwdSw = "N"
else ShrBackFwd = ShrHistCnt + 1
if (ShrBackFwd > ShrMaxLess4) ShrBackFwd = ShrMaxLess4
if (ShrHistCnt < 0 ) ShrHistCnt = 0
if (ShrHistCnt > (ShrMaxLess4)) 
 {
  ShrHistCnt = ShrMaxLess4
  for (var i = 0;  i < ShrMaxLess4 ; i++)  
     {
     ShrHist[i] = ShrHist[i+1] 
     ShrGalHist[i] = ShrGalHist[i+1] 
     } 
 }
if (isNaN(LastURL)) ShrHist[++ShrHistCnt] = LastURL
else {
   ShrGalHist[++ShrHistCnt] = ShrGalNo
   ShrHist[ShrHistCnt] = LastURL 
     }
}

function myDebug(caller)  {
if (DebugSw != "Y") return
window.alert("myDebug from: " + caller + " " + ShrHistCnt + "  /  "  + " BF: " + ShrBackFwd)
for (var ix = 0; ix <= ShrHistCnt; ix ++)  {
  window.alert(ShrHist[ix] + " <> " + ShrGalHist[ix])
}
}

function ShrBackURL()  {
//if (DebugSw == "Y") { window.alert("Now at ShrBackURL")}
ShrBackFwdSw = "Y"
if (--ShrBackFwd < 0) {ShrBackFwd = 0}
if (ShrBackFwd > ShrMaxHist) {ShrBackFwd = ShrMaxHist  - 1 }
if (!ShrHist[ShrBackFwd]) {main.window.location.href = "ymainhom.html" 
  return}
if (DebugSw == "Y") window.alert("index/ShrBack: ShrHist " + ShrHist[ShrBackFwd])
if ( isNaN(ShrHist[ShrBackFwd]) ) {main.window.location.href = ShrHist[ShrBackFwd]
 return }
if (ShrHist[ShrBackFwd] > ShrMaxSpot ) {main.window.location.href = ShrHist[ShrBackFwd]
  return}
if (ShrHist[ShrBackFwd] < 1 ) {main.window.location.href = ShrHist[ShrBackFwd]
  return}
ShrGalNo = ShrGalHist[ShrBackFwd] 
ShrSpot = ShrHist[ShrBackFwd] 
main.window.location.href = "yblowup.html"
}

function ShrFwdURL()  {
ShrBackFwdSw = "Y"
if (++ShrBackFwd > ShrHistCnt ) {ShrBackFwd = ShrHistCnt 
  return }
if (ShrBackFwd > ShrMaxHist) ShrBackFwd = ShrMaxHist - 1
if (!ShrHist[ShrBackFwd]){ main.window.location.href = "ymainhom.html"
  return }
if ( isNaN(ShrHist[ShrBackFwd]) ) { 
main.window.location.href = ShrHist[ShrBackFwd]
  return}
ShrSpot = ShrHist[ShrBackFwd] 
ShrGalNo = ShrGalHist[ShrBackFwd] 
main.window.location.href = "yblowup.html"
}


