/*
 *  Author : JAMES	  
 *  Created Date : 28/11/2550 17:38
 *  Module : Show Hotel Gellery for Hotel Description 
 *  Description : Show Hotel Gellery for Hotel Description 
 *  Involve People : JAMES
 *  Last Updated : JAMES 28/11/2550 17:38
 */
var hotelgallery = new function (){
	this.resultPage = 0;
	this.aryImage = new Array();
	this.aryImageAlt = new Array();
	this.aryImageTitle = new Array();
	this.posPage = 1;

	this.getFirstImage  = function (){	
		$("imgMain").src = this.aryImage[0]; 
		$("imgMain").alt = this.aryImageAlt[0];
		$("imgMain").title = this.aryImageTitle[0];
	};

	this.chnImg = function (pos){		
		$("imgMain").src = this.aryImage[pos];
		$("imgMain").alt = this.aryImageAlt[pos];	
		$("imgMain").title = this.aryImageTitle[pos];
	};

	 this.chnPage = function (pos){
		 var i = 1; 
		 while(i <= this.resultPage){ 
			$("pg"+i).style.display="none";
			$("lyChPage"+i).className="pg-lnk";
			i++; 
		 } 
		$("lyChPage"+pos).className="pg-act";
		$("pg"+pos).style.display="";
		this.posPage = pos;
	 };

	 this.ctrlPage = function (type){
		 var i = 1; 
		 while(i <= this.resultPage){
			$("pg"+i).style.display="none";
			$("lyChPage"+i).className="pg-lnk";
			 i++; 
		 } 

		if(type == 'Previous'){
			(this.posPage ==1 ) ? this.posPage =1: this.posPage = this.posPage-1;
		} else {		
			(this.posPage >= this.resultPage ) ? this.posPage = this.resultPage : this.posPage = this.posPage+1;
		}
		
		$("lyChPage"+this.posPage).className="pg-act";
		$("pg"+this.posPage).style.display="";
	};

}
