//define image objects for mouse over fx
gb = new Image(); gb.src = 'images/giclee_button.jpg'; 
gbF  = new Image(); gbF.src  = 'images/giclee_buttonF.jpg'; 
bb = new Image(); bb.src = 'images/bio_button.jpg'; 
bbF  = new Image(); bbF.src  = 'images/bio_buttonF.jpg'; 
lb = new Image(); lb.src = 'images/link_button.jpg'; 
lbF  = new Image(); lbF.src  = 'images/link_buttonF.jpg'; 
cb = new Image(); cb.src = 'images/contact_button.jpg'; 
cbF  = new Image(); cbF.src  = 'images/contact_buttonF.jpg'; 
prevb = new Image(); prevb.src = 'images/prev_button.png'; 
prevbF  = new Image(); prevbF.src  = 'images/prev_buttonF.png'; 
playb = new Image(); playb.src = 'images/play_button.png'; 
playbF  = new Image(); playbF.src  = 'images/play_buttonF.png'; 
nextb = new Image(); nextb.src = 'images/next_button.png'; 
nextbF  = new Image(); nextbF.src  = 'images/next_buttonF.png'; 

//Function imgon enables mouse on img swap 
//
function imgOn(what, temp) 
{ 
  what.src = temp; 
} 

//Function imgon enables mouse off img swap 
//
function imgOff(what, temp) 
{ 
  what.src = temp; 
} 

//Function loadPic pushes the img defined by parameter img in the function call
//  to the background of the focus div
//
function loadPic(img){
 var element = document.getElementById("Focus");
 element.style.backgroundImage = "url(photos/"+img+")";
//   PushTxt(arrPORT[current]);
}  //end function loadPic


//Function pushTXT pushes the desc defined txt variable to the info div
//
//
function pushTXT(desc){
 var objDESC=document.getElementById("info");
 objDESC.innerHTML="<p>"+desc+"</p>";
}//end function pushTXT


//Function loadPage pushes an existing html document defined by parameter page into 
//  the focus div and changes the background of said div to an image defined by
//  the img parameter by calling loadPic()
//
function loadPage(page, img, desc){
 var xmlHttp;
 try {// Firefox, Opera 8.0+, Safari
 xmlHttp = new XMLHttpRequest();	
 } catch (e) {// Internet Explorer
 try {
 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
 try {
 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 } catch (e) {
 alert("Your browser does not support AJAX!");
 return false;
 }
 }
 }

 xmlHttp.onreadystatechange = function(){
 if (xmlHttp.readyState == 4) {
 //Get the response from the server and extract the section that comes in the body section of the second html page avoid inserting the header part of the second page in your first page's element
 var respText = xmlHttp.responseText.split('<body>');
 elem.innerHTML = respText[0].split('</body>')[0];
 }
 }

 var elem = document.getElementById("Focus");
 if (!elem) {
 alert('The element with the passed ID doesn\'t exists in your page');
 return;
 }

 if (img=="transparent.gif"){
 hideSlideShow("yes");
 }//end if
 else{
 hideSlideShow("no");
 }//end else

 loadPic(img);
 pushTXT(desc);
 xmlHttp.open("GET", page, true);
 xmlHttp.send(null);
}//end function loadPage


//Function loadFrame pushes a new source page into the photos iFrame as defined by parameter
//  page and updates div focus to the first image of the new portfolio selected as defined
//  by parameter img by calling loadPic
//
function loadFrame(page, img, desc){
 var objFrame=document.getElementById("photos"); 
 objFrame.src=page;
 loadPage("empty.html", img, desc);
}//end function loadFrame

//Function hideSlideShow hides or displays the slideshow navigation buttons based on the
//  parameter hide passed to the function on its call
//
function hideSlideShow(hide){
 var objD=document.getElementById("SSNavi");

 if(hide=="yes"){
 objD.style.display='none';
 }//end if
 else{
 objD.style.display='block';
 }//end else
}//end hideSlideShow


function loadNext(){
 imageNum=(imageNum+1) % totalImages;
 loadPage('empty.html', imageArray[imageNum], descArray[imageNum]);
}//end loadNext

function loadPrev(){
 imageNum=(imageNum-1) % totalImages;
 if (imageNum<0){
  imageNum=totalImages-1;
 }//end if
 loadPage('empty.html', imageArray[imageNum], descArray[imageNum]);
}//end loadPrev

function SlideShowHandler(){
 if (SSon==false){
  SSon=true;
  loadSlideShow();
 }//end if
 else{
  SSon=false;
 }//end else
}//end SlideShowHandler

function loadSlideShow(){
 if (SSon==true){
  loadNext();
  var recur_call = "loadSlideShow()"
  timerID = setTimeout(recur_call, interval);
 }//end if
}//end loadSlideShow

function changeGallery(gallery){
imageArray = new Array();
descArray = new Array();
imageNum=0;
SSon=false;

switch(gallery)
{
case "bw":
 imageArray = ["bw00_LG.jpg", "bw01_LG.jpg", "bw02_LG.jpg", "bw03_LG.jpg", "bw04_LG.jpg", "bw05_LG.jpg", "bw06_LG.jpg", "bw07_LG.jpg", "bw08_LG.jpg", "bw09_LG.jpg", "bw10_LG.jpg", "bw11_LG.jpg", "bw12_LG.jpg", "bw13_LG.jpg", "bw14_LG.jpg", "bw15_LG.jpg", "bw16_LG.jpg", "bw17_LG.jpg", "bw18_LG.jpg", "bw19_LG.jpg", "bw20_LG.jpg", "bw21_LG.jpg", "bw22_LG.jpg", "bw23_LG.jpg", "bw24_LG.jpg", "bw25_LG.jpg"];
 descArray = ['Mount Saint Helens<br>After the eruption of Mt. St. Helens in May of 1980, Vancouver, Wash',
 'Oak Alley Plantation<br> Oak Alley plantation Louisiana',
 'Orchids and Palms<br> Orchids and Palms still Life',
 'The Great Sand Dunes<br> The Great Sand Dunes National Park, Colorado',
 'Snow with Fence<br> The Pagosa Barrens snow with fence, Colo.',
 'Taos Pueblo Mission<br> The Mission at Taos Pueblo, New Mexico',
 'Tuscany Trees<br> Trees planted in rows near Sienna Italy, Tuscany',
 'Arroyo Seco, New Mexico<br> Winter sunrise over Taos Mtn, Arroyo Seco, NM',
 'Corn Plant Olympic forest,Wash<br> Corn Plant on Mt. Ranier, Washington',
 'White House Ruins<br> The White House Ruins at Canyon De Chelley, Arizona',
 'Yellowstone Falls<br> Yellowstone Falls in Yellowstone National Park, Wyoming',
 'The sun through the fire<br> The smoke through the fire at Yellowstone National Park, Wy. 1989',
 'Yucca plant<br>The Yucca Plant at Walnut Canyon Arizona used by the Anasazi in ancient times',
 'California Dogwood tree<br> California Dogwood at Yosemite',
 'Chimney Rock Colorado<br> Chimney rock used by the Anasazi for solar ceremonys',
 'Cliff Palace, Mesa Verde<br> Cliff Palace ruins at Mesa Verde NP Colo.',
 'Part of the Grand Gallery<br> The area in Horse Shoe Canyon, Utah of 10,000 year old rock art',
 'The Holy Ghost<br> The Grand Gallery art in Horse Shoe Canyon, Utah',
 'Mesa Verde Kivas<br> The Kivas at Long House in Mesa Verde NP Colo.',
 'The town of Silverton Co.<br> Silverton Colorado',
 'Door above Kiva<br> The entry to a kiva at Spruce Tree House, Mesa Verde, NP Colo',
 'Spruce Tree House<br> Evening shadows at Spruce Tree House, Mesa Verde NP Colo.',
 'Sun Dagger at Hovenweep<br> Very rare sundagger at the Summer solstice at Hovenweep NM Utah',
 'The Grand Teton<br> Grand Teton NP, Wyoming',
 'Santuario De Chimayo<br> The Santurio De Chimayo at Chimayo NM',
 'The ruins at Canyon De Chelley AZ.<br> White House Ruins at Canyon De Chelley, AZ'];
 break;
case "c":
 imageArray = ["c00_LG.jpg", "c01_LG.jpg", "c02_LG.jpg", "c03_LG.jpg", "c04_LG.jpg", "c05_LG.jpg", "c06_LG.jpg", "c07_LG.jpg", "c08_LG.jpg", "c09_LG.jpg", "c10_LG.jpg", "c11_LG.jpg", "c12_LG.jpg", "c13_LG.jpg", "c14_LG.jpg", "c15_LG.jpg", "c16_LG.jpg", "c17_LG.jpg"];
 descArray = ['Aspen near Chama NM<br>Fall Aspen near Chama New Mexico',
 'Colorado Aspen<br>Colorado Aspen Colors',
 'Boats<br>Fishermans boats on Lake Chapala, Mexico',
 'Old Carousel in Florence Italy<br> Carousel on the square in Florence, Italy',
 'Cave Dwellers<br>Antelope Canyon Arizona',
 'The Cumbres and Toltec Railroad<br>The Cumbres And Toltec Train headed to Antonito, Colo.',
 'Holyhocks<br>Taos Holyhocks in full bloom',
 'Mesa Arch<br>Mesa Arch in the Canyonlands District, Utah',
 'New York City<br>The view from the Empire State Building in New York City',
 'Old adobe wall<br>Ytpical New Mexico colors and Adobe wall',
 'Purple wall and goat horn<br>Vibrant colors with goat horn on New Mexico building',
 'Red Wall with tree<br>Red wall and tree in Ajijic, Mexico',
 'Reeds<br>Reeds on Eagle Lake, California',
 'Rio Grande Gorge<br>The 1000Ft deep Rio Grande Gorge near Taos, NM',
 'Siena, Italy<br>Siena, Itally Clock Tower and Square',
 'Taos Angel<br>Cloud formed into a cross over the Taos Pueblo Church',
 'Taos moonrise<br>The Harvest Moon rising over Taos NM',
 'Upper San Luis Valley<br>Sunset over the San Luis Valley NM'];
 break;
case "CO":
 imageArray = ["CO00_LG.jpg", "CO01_LG.jpg", "CO02_LG.jpg"];
 descArray = ['Crystal Mill<br> Abandoned mill near Marble, Colorado',
 'Fire In the Sky<br> Taken off the Colorado River near the Utah border',
 'Leadville, Colorado<br> Old mining town -- still life of door'];
 break;
case "f":
 imageArray = ["f00_LG.jpg", "f01_LG.jpg", "f02_LG.jpg", "f03_LG.jpg", "f04_LG.jpg", "f05_LG.jpg", "f06_LG.jpg", "f07_LG.jpg", "f08_LG.jpg", "f09_LG.jpg", "f10_LG.jpg", "f11_LG.jpg", "f12_LG.jpg", "f13_LG.jpg"];
 descArray = ['Cute Blonde <br> Who is the cute blonde?',
 'That had to hurt<br>That had to hurt',
 'Sometimes I feel blue<br>Sometimes I feel blue',
 'It pays to be different<br>It pays to be different',
 'Couch Potato<br>She is a  Couch Potato',
 'My better half<br>My better half',
 'Hillbilly Hot Tub<br>Hillbilly Hot Tub',
 'Checkout the hot redhead<br>Checkout  the hot redhead',
 'Watermelon Kiwi<br>When I grow up I want to be a watermelon',
 'My BFF<br>Are you my BFF?',
 'My Fruity Friends<br>These are a few of my Fruity Friends',
 'Pink Mushrooms<br>I think I am Hallucinating',
 'Green Pepper<br>It is not easy being Green',
 'Spud and Cherries<br>We told her she needed a Stud!'];
 break;
case "n":
 imageArray = ["ns00_LG.jpg", "ns01_LG.jpg", "ns02_LG.jpg", "ns03_LG.jpg", "ns04_LG.jpg", "ns05_LG.jpg", "ns06_LG.jpg", "ns07_LG.jpg", "ns08_LG.jpg", "ns09_LG.jpg", "ns10_LG.jpg", "ns11_LG.jpg", "ns13_LG.jpg", "ns15_LG.jpg", "ns16_LG.jpg", "ns17_LG.jpg", "ns18_LG.jpg", "ns19_LG.jpg"];
 descArray = ['Albert Badone', 'Alyssa Shorty', 'Tiinesha Begaye', 'Harley Chee', 'Jumbo Billy', 'Lonnie Yazee', 'Eliza Charley', 'Navajo girl', 'Grace Henderson Nez', 'Dick James', 'Navajo Girl', 'Sally Kaye', 'Clara Buckinghorse', 'Maggie Benally', 'Harrison Ashley', 'Sally Kaye', 'Shay Benny', 'Shirley Chee'];
 break;
}
totalImages=imageArray.length;
}//end changeGallery
