
var caption=new Array();
	caption[0]="";
	caption[1]="Entrance 1";
	caption[2]="Entrance 2";
	caption[3]="Entrance 3";
	caption[4]="Appearance 1";
	caption[5]="Appearance 2";
	caption[6]="Garden";
	caption[7]="Reception 1";
	caption[8]="Reception 2";
	caption[9]="Reception 3";
	caption[10]="Spa Treatment Room 1";
	caption[11]="Spa Treatment Room 2";
	caption[12]="Spa Treatment Room 3";
	caption[13]="CORAN original massage oil";
	caption[14]="Massage Treatment Room 1";
	caption[15]="Massage Treatment Room2";
	caption[16]="Foot Reflexology Space";
	caption[17]="Studio Type Massage Treatment Room";
	caption[18]="Hallway"; 

function showGallery(){
	document.getElementById('galleryBox').style.display='block';
	document.getElementById('fade').style.display='block';
	fadeIn('galleryBox', 2000);
	fadeIn2('fade', 2000);	
}

function gallery_close(){
	fadeOut('galleryBox', 2000);
	fadeOut2('fade', 2000);
	setTimeout("display_close()",1900);
}

function display_close(){
		
	parent.document.getElementById('galleryBox').style.display='none';
	parent.document.getElementById('fade').style.display='none';
}

function changeImg(no){
	document.getElementById('largePicture').src = "large/gallery"+no+".jpg"
	document.getElementById('caption').innerHTML = caption[no];
}

// Effect here
function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
}

function fadeIn (id, millisec) {
	opacity(id, 0, 100, millisec);
}

function fadeOut (id, millisec) {
	opacity(id, 100, 0, millisec);
}

function fadeIn2 (id, millisec) {
	opacity(id, 0, 10, millisec);
}

function fadeOut2 (id, millisec) {
	opacity(id, 10, 0, millisec);
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    if(document.getElementById(id)==undefined){
    	var object = parent.document.getElementById(id).style;
    }else{
    	var object = document.getElementById(id).style;
    }
    
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

