//location page only

var alts = new Array();
alts[1] = 'Bedroom';
alts[2] = 'Queenstown Map';
alts[3] = 'Queenstown Map';
alts[4] = 'Queenstown Map';
alts[5] = 'Queenstown Map';
alts[6] = 'Queenstown Map';
alts[7] = 'Queenstown Map';

var captions = new Array();
captions[1] = '<h3>Bedroom</h3>'
	+ '<ul><li></li></ul>';

captions[2] = '<h3>Ensuite Bathroom</h3>'
	+ '<ul><li></li></ul>';

captions[3] = '<h3>Kitchen Finesse</h3>'
	+ '<ul><li></li></ul>';

captions[4] = '<h3>Elegant Outside Dining</h3>'
	+ '<ul><li></li></ul>';

captions[5] = '<h3>Visual Essence</h3>'
	+ '<ul><li></li></ul>';

captions[6] = '<h3>Bedroom 2</h3>'
	+ '<ul><li></li></ul>';

captions[7] = '<h3>Queenstown views over Lake Wakatipu</h3>'
	+ '<ul><li></li></ul>';

captions[8] = '<h3>Sunset views of the Remarkables</h3>'
	+ '<ul><li></li></ul>';

captions[8] = '<h3>Sunset views down to Kingston</h3>'
	+ '<ul><li></li></ul>';

captions[9] = '<h3>Spacious Lounge</h3>'
	+ '<ul><li></li></ul>';

captions[10] = '<h3>Ample Parking</h3>'
	+ '<ul><li></li></ul>';

captions[11] = '<h3>Bedroom views</h3>'
	+ '<ul><li></li></ul>';

captions[12] = '<h3>Outdoor Dining</h3>'
	+ '<ul><li></li></ul>';

function changeDetails (which) 
{
    //change large image
	var lgImgObj    = document.getElementById('mainImg');
	lgImgObj.src    = 'images/gallery/'+ which +'.jpg'
	lgImgObj.alt    = alts[which];
	lgImgObj.title  = alts[which];

    //change caption
    var caption = document.getElementById('galleryCaption');
    caption.innerHTML = captions[which];
}

function addOnClicks() 
{
    if (!document.getElementsByTagName) return false;
    var items = document.getElementById('galleryNav').getElementsByTagName('a');
    for (var i=0; i < items.length; i++) {
        items[i].onclick = function() {
            changeDetails(this.id.substring(7));
//            alert(this.parentNode.style.className);//.value= 'current';
            return false;
        }
    }
}


//assign onclick events to all ul#rhNav a tags
window.onload = function () {
    addOnClicks();
}

