var photos=new Array()
var photoscaption=new Array()
var photosdescription=new Array()
var photoslink=new Array()
var photosname=new Array()
var photosorder=new Array()

var which=1
var linkornot=1

photos[0]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_00.jpg"
photoslink[0]="http://www.hainesrealestate.com/uploads/010100a_regular_00.jpg"
photoscaption[0]="Snowy Mountain Peaks - Haines, Alaska"
photosdescription[0]=""
photosorder[0]=0
photos[1]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_01.jpg"
photoslink[1]="http://www.hainesrealestate.com/uploads/010100a_regular_01.jpg"
photoscaption[1]="Battery Point & Eagle - Haines, Alaska"
photosdescription[1]=""
photosorder[1]=1
photos[2]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_02.jpg"
photoslink[2]="http://www.hainesrealestate.com/uploads/010100a_regular_02.jpg"
photoscaption[2]="A sunny day over Chilkat Inlet - Haines, Alaska"
photosdescription[2]=""
photosorder[2]=2
photos[3]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_03.jpg"
photoslink[3]="http://www.hainesrealestate.com/uploads/010100a_regular_03.jpg"
photoscaption[3]="The Chilkat River - Winter's Thaw"
photosdescription[3]=""
photosorder[3]=3
photos[4]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_04.jpg"
photoslink[4]="http://www.hainesrealestate.com/uploads/010100a_regular_04.jpg"
photoscaption[4]="Davidson Glacier - Haines, Alaska"
photosdescription[4]=""
photosorder[4]=4
photos[5]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_05.jpg"
photoslink[5]="http://www.hainesrealestate.com/uploads/010100a_regular_05.jpg"
photoscaption[5]="Dungeness Crab Taking in the Solstice Sun - Lynn Canal"
photosdescription[5]=""
photosorder[5]=5
photos[6]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_06.jpg"
photoslink[6]="http://www.hainesrealestate.com/uploads/010100a_regular_06.jpg"
photoscaption[6]="The Council of Eagles - Chilkat Bald Eagle Preserve"
photosdescription[6]=""
photosorder[6]=6
photos[7]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_07.jpg"
photoslink[7]="http://www.hainesrealestate.com/uploads/010100a_regular_07.jpg"
photoscaption[7]="Fort Wm. H. Seward - Haines, Alaska"
photosdescription[7]=""
photosorder[7]=7
photos[8]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_08.jpg"
photoslink[8]="http://www.hainesrealestate.com/uploads/010100a_regular_08.jpg"
photoscaption[8]="Sawmill Creek in full spate - Haines, Alaska"
photosdescription[8]=""
photosorder[8]=8
photos[9]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_09.jpg"
photoslink[9]="http://www.hainesrealestate.com/uploads/010100a_regular_09.jpg"
photoscaption[9]="Sealion Rock - Haines, Alaska"
photosdescription[9]=""
photosorder[9]=9
photos[10]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_10.jpg"
photoslink[10]="http://www.hainesrealestate.com/uploads/010100a_regular_10.jpg"
photoscaption[10]="Haines' Small Boat Harbor & Chilkoot Mtn. Range"
photosdescription[10]=""
photosorder[10]=10
photos[11]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_11.jpg"
photoslink[11]="http://www.hainesrealestate.com/uploads/010100a_regular_11.jpg"
photoscaption[11]="Sunshine Mountain - Yukon, Canada"
photosdescription[11]=""
photosorder[11]=11
photos[12]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_12.jpg"
photoslink[12]="http://www.hainesrealestate.com/uploads/010100a_regular_12.jpg"
photoscaption[12]="Haines Hwy - Through the Pass - Yukon, Canada"
photosdescription[12]=""
photosorder[12]=12
photos[13]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_13.jpg"
photoslink[13]="http://www.hainesrealestate.com/uploads/010100a_regular_13.jpg"
photoscaption[13]="Tlingit Park Opening - May 2003 - Haines, Alaska"
photosdescription[13]=""
photosorder[13]=13
photos[14]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_14.jpg"
photoslink[14]="http://www.hainesrealestate.com/uploads/010100a_regular_14.jpg"
photoscaption[14]="Tlingit Park Opening - May 2003 - Haines, Alaska"
photosdescription[14]=""
photosorder[14]=14
photos[15]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_15.jpg"
photoslink[15]="http://www.hainesrealestate.com/uploads/010100a_regular_15.jpg"
photoscaption[15]="Haines' Small Boat Harbor - Typical Winter Snowfall"
photosdescription[15]=""
photosorder[15]=15
photos[16]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_17.jpg"
photoslink[16]="http://www.hainesrealestate.com/uploads/010100a_regular_17.jpg"
photoscaption[16]="Whales - Lynn Fjord - Haines, Alaksa"
photosdescription[16]=""
photosorder[16]=17
photos[17]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_18.jpg"
photoslink[17]="http://www.hainesrealestate.com/uploads/010100a_regular_18.jpg"
photoscaption[17]="Whales - Lynn Fjord - Haines, Alaksa"
photosdescription[17]=""
photosorder[17]=18
photos[18]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_19.jpg"
photoslink[18]="http://www.hainesrealestate.com/uploads/010100a_regular_19.jpg"
photoscaption[18]="Whales - Lynn Fjord - Haines, Alaksa"
photosdescription[18]=""
photosorder[18]=19
photos[19]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_20.jpg"
photoslink[19]="http://www.hainesrealestate.com/uploads/010100a_regular_20.jpg"
photoscaption[19]="Whales - Lynn Fjord - Haines, Alaksa"
photosdescription[19]=""
photosorder[19]=20
photos[20]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_21.jpg"
photoslink[20]="http://www.hainesrealestate.com/uploads/010100a_regular_21.jpg"
photoscaption[20]="Chilkoot Bear - Fishing Without A License!"
photosdescription[20]=""
photosorder[20]=21
photos[21]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_22.jpg"
photoslink[21]="http://www.hainesrealestate.com/uploads/010100a_regular_22.jpg"
photoscaption[21]="Fresh Salmon - My Favorite!"
photosdescription[21]=""
photosorder[21]=22
photos[22]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_23.jpg"
photoslink[22]="http://www.hainesrealestate.com/uploads/010100a_regular_23.jpg"
photoscaption[22]="Hey Guys ... Fishin's Good Here!"
photosdescription[22]=""
photosorder[22]=23
photos[23]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_25.jpg"
photoslink[23]="http://www.hainesrealestate.com/uploads/010100a_regular_25.jpg"
photoscaption[23]="Maybe I Will Catch Some Dessert!"
photosdescription[23]=""
photosorder[23]=25
photos[24]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_26.jpg"
photoslink[24]="http://www.hainesrealestate.com/uploads/010100a_regular_26.jpg"
photoscaption[24]="Moose"
photosdescription[24]=""
photosorder[24]=26
photos[25]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_27.jpg"
photoslink[25]="http://www.hainesrealestate.com/uploads/010100a_regular_27.jpg"
photoscaption[25]=" "
photosdescription[25]=""
photosorder[25]=27
photos[26]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_28.jpg"
photoslink[26]="http://www.hainesrealestate.com/uploads/010100a_regular_28.jpg"
photoscaption[26]=" "
photosdescription[26]=""
photosorder[26]=28
photos[27]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_29.jpg"
photoslink[27]="http://www.hainesrealestate.com/uploads/010100a_regular_29.jpg"
photoscaption[27]=" "
photosdescription[27]=""
photosorder[27]=29
photos[28]="http://www.hainesrealestate.com/uploads/mid_size/010100a_regular_30.jpg"
photoslink[28]="http://www.hainesrealestate.com/uploads/010100a_regular_30.jpg"
photoscaption[28]=" "
photosdescription[28]=""
photosorder[28]=30
 
var linkornot=1
 


// var preloadedimages=new Array()
// var preloadedimagesfull=new Array()
// for (i=0;i<photos.length;i++){
// preloadedimages[i]=new Image()
// preloadedimages[i].src=photos[i]
// preloadedimagesfull[i]=new Image()
// preloadedimagesfull[i].src=photoslink[i]
// 
// }



function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
showwinda()
}


function applyeffect(){
if (document.all){
photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}


function playeffect(){
if (document.all)
photoslider.filters.revealTrans.play()
}

function playit(){
if (document.all)
photoslider.filters.play()
}


function rmovechild(){
	// get a reference to an existing object
	obj = document.getElementById("div1");
	// empty this object of its children
	nodelist = obj.childNodes;
	// now loop and remove them all
	c = nodelist.length;	// needed because changes dynamically
	for(i = 0; i < c; i++)
	{
		this_node = nodelist[0];	// reference changes dynamically
		removed_node = obj.removeChild(this_node);
	}
}
function showwinda(){
	// get a reference to an existing object
	obj = document.getElementById("div1");
	// empty this object of its children
	nodelist = obj.childNodes;
	// now loop and remove them all
	c = nodelist.length;	// needed because changes dynamically
	for(i = 0; i < c; i++)
	{
		this_node = nodelist[0];	// reference changes dynamically
		removed_node = obj.removeChild(this_node);
	}
	
	obj = document.getElementById("div2");
	// empty this object of its children
	nodelist = obj.childNodes;
	// now loop and remove them all
	c = nodelist.length;	// needed because changes dynamically
	for(i = 0; i < c; i++)
	{
		this_node = nodelist[0];	// reference changes dynamically
		removed_node = obj.removeChild(this_node);

	}	


	
var newText = document.createTextNode(photoscaption[which])
document.getElementById("div1").appendChild(newText)

newText = document.createTextNode(photosdescription[which])
document.getElementById("div2").appendChild(newText)

}

function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}


function jump(jump_to){
if (which>-1){
which=jump_to
document.images.photoslider.src=photos[which]
keeptrack()
}
}


function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

   function DetectImageSize(picName,picTitle){
      picURL=picName;
	  popImage(picName,picTitle);  
//      picURL=picName.src
//      newWindow=window.open(picURL,'newWin','toolbar=no, width='+picName.width+',height='+picName.height)
//      newWindow.document.write('<html><head><title>'+picTitle+' </title><\/head><body background="'+picURL+'"><\/body><\/html>')
//      newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth, picName.height-newWindow.document.body.clientHeight)
//      newWindow.focus()
   } 


function transport(){
picTitle='Haines Real Estate - Full-Size Pictures';
picName=photoslink[which];
DetectImageSize(picName, picTitle)
// picTitle='Haines Real Estate - Full-Size Pictures';
// picName=preloadedimagesfull[which];
// DetectImageSize(picName,picTitle)
}

  function ClickPhoto(pass)
  {
    var filename = photos[pass];
	var filenamex = photoscaption[pass];
	var phorder = photosorder[pass];
	phorder=phorder+1;
	document.form1.checkvals.value=filename;
	document.form1.caption.value=filenamex;
	document.form1.phorder.value=phorder;
    var valid = true
    return valid
  }


