
	var GalleryPage_Class = function(){
	
		this.init();
		
	};
	
	GalleryPage_Class.prototype.init = function(){
	
		this.slideshow = $("div#slideShow");
		this.gallery = $("div#galleryLoader");
	
		this.gallery.show();
		this.slideshow.hide();
	
		this.galleryImages = $("img.galleryImages");
	
		this._assignEvents();
		
	};
	
	GalleryPage_Class.prototype._assignEvents = function(){
	
		/*$("a#imgGallerySlideShow").bind("click", {galleryPage: this}, function(e) {
		
			e.preventDefault();
			
			$(this).hide();
			$("a#imgThumbs").show();
			
			var galleryPage = arguments[0].data.galleryPage;
			
			$(galleryPage.gallery).hide();
			
			$(galleryPage.slideshow).show();
			
			var slideshow = $(galleryPage.slideshow);
			
			slideshow.html("<div class='offsetTop10 offsetBottom10'><img id='slideshowImg' src='images/gallery/pageGallery1/slide/IMG_1.jpg' /></div>");
			
			slideshow.append("<div>Previous &nbsp;&nbsp;&nbsp;&nbsp; Next</div>");
			
		});	
		
		$("a#imgThumbs").bind("click", {galleryPage: this}, function(e) {
		
			e.preventDefault();
			
			$(this).hide();
			$("a#imgGallerySlideShow").show();
			
			var galleryPage = arguments[0].data.galleryPage;
			
			$(galleryPage.gallery).show();
			
			$(galleryPage.slideshow).hide();
			
		});
		*/
		this.galleryImages.css({"cursor":"pointer"});
		
		this.galleryImages.bind("click", {}, function() {
			
			var _imgSrc = String(this.getAttribute("src")).split("\/");
			var imgSrc = _imgSrc[_imgSrc.length - 1];
			
			var mask = $("div#mask");
			
			mask.css({"background-color":"#000000"});
			mask.show();

			var lightBox = $("div#photoLightBox");
			
			if (lightBox.length == 0) {
			
				$(document.body).append("<div id='photoLightBox'></div>");
				
				lightBox = $("div#photoLightBox");
				
			}
					
			var docBody = {
				width: $(document.body).width()
				, height: $(document.body).height()
			};
			
			var oCSS = {
				"position":"absolute"
				, "background-color":"#FFFFFF"
				, "border": "2px solid #222222"
				, "width": "820px"
				, "height": "575px"
				, "top": "10px"
				, "left": (docBody.width/2 - 425) + "px"
				, "z-index": "1000"
			};
			
			lightBox.css(oCSS);
			
			lightBox.html("<div id='lightBoxClose'>X</div>");
			
			var imgNumber = String(String(imgSrc).split("_")[1]).split(".")[0];
			
			lightBox.append("<div class='center'><img src='images/gallery/pageGallery1/full/" + imgSrc + "' width='800' height='533' alt='Image " + imgNumber + "' /></div>");
			
			$("div#photoLightBox").show();
			
			$("div#lightBoxClose").bind("click", function() {
			
				$("div#photoLightBox").hide();
				$("div#mask").hide();
				
			});
			
			window.scrollTo(0,0);
			
		});
		
	};
		
	var galleryPage = new GalleryPage_Class();