var NSEmail = {
	Write: function(pStr) {
		var sPrefix = 'm&#97;&#105;lt&#111;:';
		var sPath = 'hr' + 'ef' + '=';
		var sAddress = pStr.replace(/\[at\]/g, '&#64;');
		document.write( '<a ' + sPath + '\"' + sPrefix + sAddress + '\">' + sAddress + '<\/a>' );
	}
}

var ImageGallery = {

	aImagesSlide: null,
	nWaitDuration: null,
	nCurrentImg: 0,
	oPlayTimer: null,
	nImgCount: null,

	SwapImage: function(x,y) {
		$(this.aImagesSlide[x]).appear({ duration: 1.5 });
		$(this.aImagesSlide[y]).fade({duration: 1.5});
	} , 

	StartSlideShow: function() {
		this.nImgCount = this.aImagesSlide.length;
		for (var j = 1; j < this.nImgCount; j++) { $(this.aImagesSlide[j]).fade({duration: 0}); }
		this.oPlayTimer = setInterval('ImageGallery.Play()', this.nWaitDuration);			
	} ,

	Play: function() {
		var imageShow, imageHide;
		imageShow = this.nCurrentImg+1;
		imageHide = this.nCurrentImg;
		if (imageShow == this.nImgCount) {
			this.SwapImage(0,imageHide);	
			this.nCurrentImg = 0;					
		} else {
			this.SwapImage(imageShow,imageHide);			
			this.nCurrentImg++;
		}
	} , 

	Stop: function() { clearInterval(this.oPlayTimer); } , 

	GoNext: function() {
		this.Stop();
		var imageShow, imageHide;
		imageShow = this.nCurrentImg + 1;
		imageHide = this.nCurrentImg;	
		if (imageShow == nImgCount) {
			this.SwapImage(0,imageHide);	
			this.nCurrentImg = 0;					
		} else {
			this.SwapImage(imageShow,imageHide);			
			this.nCurrentImg++;
		}
	} , 

	GoPrevious: function() {
		this.Stop();
		var imageShow, imageHide;			
		imageShow = this.nCurrentImg-1;
		imageHide = this.nCurrentImg;	
		if (this.nCurrentImg == 0) {
			this.SwapImage(nImgCount-1,imageHide);	
			this.nCurrentImg = this.nImgCount-1;							
		} else {
			this.SwapImage(imageShow,imageHide);			
			this.nCurrentImg--;
		}
	}
}
