// JavaScript Document
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/images/skihaines/skihaines01.jpg"
photoslink[0]="http://www.hainesrealestate.com/images/skihaines/skihaines01.jpg"
photoscaption[0]="Ski Haines, Alaska!"
photosdescription[0]=""
photosorder[0]=0
photos[1]="http://www.hainesrealestate.com/images/skihaines/skihaines02.jpg"
photoslink[1]="http://www.hainesrealestate.com/images/skihaines/skihaines02.jpg"
photoscaption[1]="Ski Haines, Alaska!"
photosdescription[1]=""
photosorder[1]=1
photos[2]="http://www.hainesrealestate.com/images/skihaines/skihaines03.jpg"
photoslink[2]="http://www.hainesrealestate.com/images/skihaines/skihaines03.jpg"
photoscaption[2]="Ski Haines, Alaska!"
photosdescription[2]=""
photosorder[2]=2
photos[3]="http://www.hainesrealestate.com/images/skihaines/skihaines04.jpg"
photoslink[3]="http://www.hainesrealestate.com/images/skihaines/skihaines04.jpg"
photoscaption[3]="Ski Haines, Alaska!"
photosdescription[3]=""
photosorder[3]=3
photos[4]="http://www.hainesrealestate.com/images/skihaines/skihaines05.jpg"
photoslink[4]="http://www.hainesrealestate.com/images/skihaines/skihaines05.jpg"
photoscaption[4]="Ski Haines, Alaska!"
photosdescription[4]=""
photosorder[4]=4
photos[5]="http://www.hainesrealestate.com/images/skihaines/skihaines06.jpg"
photoslink[5]="http://www.hainesrealestate.com/images/skihaines/skihaines06.jpg"
photoscaption[5]="Ski Haines, Alaska!"
photosdescription[5]=""
photosorder[5]=5
photos[6]="http://www.hainesrealestate.com/images/skihaines/skihaines07.jpg"
photoslink[6]="http://www.hainesrealestate.com/images/skihaines/skihaines07.jpg"
photoscaption[6]="Ski Haines, Alaska!"
photosdescription[6]=""
photosorder[6]=6
photos[7]="http://www.hainesrealestate.com/images/skihaines/skihaines08.jpg"
photoslink[7]="http://www.hainesrealestate.com/images/skihaines/skihaines08.jpg"
photoscaption[7]="Ski Haines, Alaska!"
photosdescription[7]=""
photosorder[7]=7
photos[8]="http://www.hainesrealestate.com/images/skihaines/skihaines09.jpg"
photoslink[8]="http://www.hainesrealestate.com/images/skihaines/skihaines09.jpg"
photoscaption[8]="Ski Haines, Alaska!"
photosdescription[8]=""
photosorder[8]=8

photos[9]="http://www.hainesrealestate.com/images/skihaines/skihaines09a.jpg"
photoslink[9]="http://www.hainesrealestate.com/images/skihaines/skihaines09a.jpg"
photoscaption[9]="Ski Haines, Alaska!"
photosdescription[9]=""
photosorder[9]=9

photos[10]="http://www.hainesrealestate.com/images/skihaines/skihaines09b_1.jpg"
photoslink[10]="http://www.hainesrealestate.com/images/skihaines/skihaines09b_1.jpg"
photoscaption[10]="Ski Haines, Alaska!"
photosdescription[10]=""
photosorder[10]=10

photos[11]="http://www.hainesrealestate.com/images/skihaines/skihaines09c_1.jpg"
photoslink[11]="http://www.hainesrealestate.com/images/skihaines/skihaines09c_1.jpg"
photoscaption[11]="Ski Haines, Alaska!"
photosdescription[11]=""
photosorder[11]=11

photos[12]="http://www.hainesrealestate.com/images/skihaines/skihaines09d_1.jpg"
photoslink[12]="http://www.hainesrealestate.com/images/skihaines/skihaines09d_1.jpg"
photoscaption[12]="Ski Haines, Alaska!"
photosdescription[12]=""
photosorder[12]=12

photos[13]="http://www.hainesrealestate.com/images/skihaines/skihaines09e_1.jpg"
photoslink[13]="http://www.hainesrealestate.com/images/skihaines/skihaines09e_1.jpg"
photoscaption[13]="Ski Haines, Alaska!"
photosdescription[13]=""
photosorder[13]=13

photos[14]="http://www.hainesrealestate.com/images/skihaines/skihaines09f_1.jpg"
photoslink[14]="http://www.hainesrealestate.com/images/skihaines/skihaines09f_1.jpg"
photoscaption[14]="Ski Haines, Alaska!"
photosdescription[14]=""
photosorder[14]=14

photos[15]="http://www.hainesrealestate.com/images/skihaines/skihaines09g_1.jpg"
photoslink[15]="http://www.hainesrealestate.com/images/skihaines/skihaines09g_1.jpg"
photoscaption[15]="Ski Haines, Alaska!"
photosdescription[15]=""
photosorder[15]=15

photos[16]="http://www.hainesrealestate.com/images/skihaines/skihaines09h_1.jpg"
photoslink[16]="http://www.hainesrealestate.com/images/skihaines/skihaines09h_1.jpg"
photoscaption[16]="Ski Haines, Alaska!"
photosdescription[16]=""
photosorder[16]=16

photos[17]="http://www.hainesrealestate.com/images/skihaines/skihaines09i_1.jpg"
photoslink[17]="http://www.hainesrealestate.com/images/skihaines/skihaines09i_1.jpg"
photoscaption[17]="Ski Haines, Alaska!"
photosdescription[17]=""
photosorder[17]=17

photos[18]="http://www.hainesrealestate.com/images/skihaines/skihaines09j_1.jpg"
photoslink[18]="http://www.hainesrealestate.com/images/skihaines/skihaines09j_1.jpg"
photoscaption[18]="Ski Haines, Alaska!"
photosdescription[18]=""
photosorder[18]=18

photos[19]="http://www.hainesrealestate.com/images/skihaines/skihaines10.jpg"
photoslink[19]="http://www.hainesrealestate.com/images/skihaines/skihaines10.jpg"
photoscaption[19]="Ski Haines, Alaska!"
photosdescription[19]=""
photosorder[19]=19
 
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='Ski Haines!';
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
  }



