if (document.images ) {
	var photos = new Array(7);
	
	photos[0] = new Image(516,395);
	photos[0].src='img/pho-property1.jpg';
	
	photos[1] = new Image(516,395);
	photos[1].src='img/pho-property2.jpg';
	
	photos[2] = new Image(516,395);
	photos[2].src='img/pho-property3.jpg';
	
	photos[3] = new Image(516,395);
	photos[3].src='img/pho-property4.jpg';
	
	photos[4] = new Image(516,395);
	photos[4].src='img/pho-property5.jpg';
	
	photos[5] = new Image(516,395);
	photos[5].src='img/pho-property6.jpg';
	
	photos[6] = new Image(516,395);
	photos[6].src='img/pho-property7.jpg';
	
	var thumbs = new Array(7);
	
	thumbs[0] = new Image(74,49)
	thumbs[0].src = 'img/property-image-thumb-1.jpg';
	
	thumbs[1] = new Image(74,49)
	thumbs[1].src = 'img/property-image-thumb-2.jpg';
	
	thumbs[2] = new Image(74,49)
	thumbs[2].src = 'img/property-image-thumb-3.jpg';
	
	thumbs[3] = new Image(74,49)
	thumbs[3].src = 'img/property-image-thumb-4.jpg';
	
	thumbs[4] = new Image(74,49)
	thumbs[4].src = 'img/property-image-thumb-5.jpg';
	
	thumbs[5] = new Image(74,49)
	thumbs[5].src = 'img/property-image-thumb-6.jpg';
	
	thumbs[6] = new Image(74,49)
	thumbs[6].src = 'img/property-image-thumb-7.jpg';
	
	var hover = new Array(7);
	
	hover[0] = new Image(74,49)
	hover[0].src = 'img/property-image-thumb-1-hover.jpg';
	
	hover[1] = new Image(74,49)
	hover[1].src = 'img/property-image-thumb-2-hover.jpg';
	
	hover[2] = new Image(74,49)
	hover[2].src = 'img/property-image-thumb-3-hover.jpg';
	
	hover[3] = new Image(74,49)
	hover[3].src = 'img/property-image-thumb-4-hover.jpg';
	
	hover[4] = new Image(74,49)
	hover[4].src = 'img/property-image-thumb-5-hover.jpg';
	
	hover[5] = new Image(74,49)
	hover[5].src = 'img/property-image-thumb-6-hover.jpg';
	
	hover[6] = new Image(74,49)
	hover[6].src = 'img/property-image-thumb-7-hover.jpg';
	
	var active = new Array(7);
	
	active[0] = new Image(74,49)
	active[0].src = 'img/property-image-thumb-1-active.jpg';
	
	active[1] = new Image(74,49)
	active[1].src = 'img/property-image-thumb-2-active.jpg';
	
	active[2] = new Image(74,49)
	active[2].src = 'img/property-image-thumb-3-active.jpg';

	active[3] = new Image(74,49)
	active[3].src = 'img/property-image-thumb-4-active.jpg';
	
	active[4] = new Image(74,49)
	active[4].src = 'img/property-image-thumb-5-active.jpg';
	
	active[5] = new Image(74,49)
	active[5].src = 'img/property-image-thumb-6-active.jpg';
	
	active[6] = new Image(74,49)
	active[6].src = 'img/property-image-thumb-7-active.jpg';
}

var currImage=0;
function prevImage(){changeThumb((currImage+6)%7);currImage = (currImage+6)%7;swap('property_photo',photos[currImage]);}
function nextImage(){changeThumb((currImage+1)%7);currImage = (currImage+1)%7;swap('property_photo',photos[currImage]);}
function showImage(i){
	swap('property_photo',photos[i]);
	if(i!=currImage) {
		changeThumb(i);
	}
	currImage=i;	
}
function changeThumb(i) {
	swap('property-thumb_' + (currImage+1).toString(), thumbs[currImage]);
	swap('property-thumb_' + (i+1).toString(), active[i]);
}