var photos=new Array()
var photoslink=new Array()
var preloadedimages=new Array()

var which=0


//define images. You can have as many as you want:
//photos[0]="./images/featured/" + property + "1.jpg";
//photos[1]="./images/featured/" + property + "2.jpg"
//photos[2]="./images/featured/" + property + "2.jpg"
//photos[3]="./images/featured/" + property + "3.jpg"
//photos[4]="./images/featured/" + property + "4.jpg"
//photos[5]="./images/featured/" + property + "5.jpg"
//photos[6]="./images/featured/" + property + "6.jpg"
//photos[7]="./images/featured/" + property + "7.jpg"
//photos[8]="./images/featured/" + property + "8.jpg"
//photos[9]="./images/featured/" + property + "9.jpg"


//Specify whether images should be linked or not (1=linked)
var linkornot=1

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]=""
photoslink[1]=""
photoslink[2]=""

//do NOT edit pass this line



function loadPics(propertyName, propertyType){
	
	if(propertyType ==0){//featured property
		photos[0] = "./images/featured/" + propertyName + "1.jpg";
		photos[1] = "./images/featured/" + propertyName + "2.jpg";
		photos[2] = "./images/featured/" + propertyName + "3.jpg";
		photos[3] = "./images/featured/" + propertyName + "4.jpg";
		photos[4] = "./images/featured/" + propertyName + "5.jpg";
		photos[5] = "./images/featured/" + propertyName + "6.jpg";
		photos[6] = "./images/featured/" + propertyName + "7.jpg";
		photos[7] = "./images/featured/" + propertyName + "8.jpg";
		photos[8] = "./images/featured/" + propertyName + "9.jpg";
		photos[9] = "./images/featured/" + propertyName + "10.jpg";	
	}else if(propertyType ==1){//buildings
		photos[0] = "./images/buildings/" + propertyName + "/" + propertyName + "1.jpg";
		photos[1] = "./images/buildings/" + propertyName + "/" + propertyName + "2.jpg";
		photos[2] = "./images/buildings/" + propertyName + "/" + propertyName + "3.jpg";
		photos[3] = "./images/buildings/" + propertyName + "/" + propertyName + "4.jpg";
		photos[4] = "./images/buildings/" + propertyName + "/" + propertyName + "5.jpg";
		photos[5] = "./images/buildings/" + propertyName + "/" + propertyName + "6.jpg";
		photos[6] = "./images/buildings/" + propertyName + "/" + propertyName + "7.jpg";
		photos[7] = "./images/buildings/" + propertyName + "/" + propertyName + "8.jpg";
		photos[8] = "./images/buildings/" + propertyName + "/" + propertyName + "9.jpg";
		photos[9] = "./images/buildings/" + propertyName + "/" + propertyName + "10.jpg";
	}else{//listings
		photos[0] = "./images/listings/" + propertyName + "/" + propertyName + "_1.jpg";
		photos[1] = "./images/listings/" + propertyName + "/" + propertyName + "_2.jpg";
		photos[2] = "./images/listings/" + propertyName + "/" + propertyName + "_3.jpg";
		photos[3] = "./images/listings/" + propertyName + "/" + propertyName + "_4.jpg";
		photos[4] = "./images/listings/" + propertyName + "/" + propertyName + "_5.jpg";
		photos[5] = "./images/listings/" + propertyName + "/" + propertyName + "_6.jpg";
		photos[6] = "./images/listings/" + propertyName + "/" + propertyName + "_7.jpg";
		photos[7] = "./images/listings/" + propertyName + "/" + propertyName + "_8.jpg";
		photos[8] = "./images/listings/" + propertyName + "/" + propertyName + "_9.jpg";
		photos[9] = "./images/listings/" + propertyName + "/" + propertyName + "_10.jpg";
	}
		
	for (i=0;i<photos.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=photos[i]
	}
	
	//return photos[0];
	document.images.photoslider.src=photos[0]
	//alert(photos[0]);
}








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


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


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

function transport(){
window.location=photoslink[which]
}


