	var currentgalleryitem = 0;
	var gallerypicnum = 0;
	
	function showPictureGallery() {
		//pozíciók beállítása
		  var myWidth = 0, myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myWidth = window.innerWidth;
		    myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
		  }
	
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfY = window.pageYOffset;
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfY = document.body.scrollTop;
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrOfY = document.documentElement.scrollTop;
		    scrOfX = document.documentElement.scrollLeft;
		  }

          scrollWidth = document.body.scrollWidth;
          scrollHeight = document.body.scrollHeight;
		  	
          $("gallerycontainer").style.top = Math.round((myHeight - 440) / 2) + scrOfY + "px";
          $("gallerycontainer").style.left = Math.round((myWidth - 600) / 2) + "px";
        
          $("galleryshadow").style.top = Math.round((myHeight - 440) / 2) + scrOfY + 6 + "px";
          $("galleryshadow").style.left = Math.round((myWidth - 600) / 2) + 6 + "px";

          $("overlay").style.width = scrollWidth  + "px";
          $("overlay").style.height = scrollHeight + "px";
        
	      //megjelenítés
	      $("gallerycontainer").fade(1);
	      $("galleryshadow").fade(0.3);
	      $("overlay").fade(0.5);
	}
	
	function hidePictureGallery() {
		//$("hotellistgooglemapcontainer").style.display = "none";
        $("gallerycontainer").fade(0);
        $("galleryshadow").fade(0);		
        $("overlay").fade(0);
	}

	function prevGaleryPic() {
		$("galleryitem_"+currentgalleryitem).fade(0);
		currentgalleryitem--;		
		showGalleryPicture();
	}

	function nextGaleryPic() {
		$("galleryitem_"+currentgalleryitem).fade(0);
		currentgalleryitem++;		
		showGalleryPicture();
	}


	function showGalleryPicture() {
		//jelenlegi kép eltüntetése		
		
		if (currentgalleryitem < 0) currentgalleryitem = gallerypicnum-1;
		if (currentgalleryitem > gallerypicnum-1) currentgalleryitem = 0;
		$("galleryitem_"+currentgalleryitem).fade(1);
	}



window.addEvent('domready', function() {
	$('gallerycontainer').setStyles({
		display:'block',
		opacity: 0
	});
	$('galleryshadow').setStyles({
		display:'block',
		opacity: 0
	});

	$('overlay').setStyles({
		display:'block',
		opacity: 0
	});	
	
    $$("div.galleryitem").each(function(o) {
		 if (gallerypicnum > 0) {
		 	o.setStyles({
				display:'block',
				opacity: 0
			});	
		 } else {
		 	o.setStyles({
				display:'block',
				opacity: 1
			});			
		 }
		 gallerypicnum++;
    }); 
    //alert(gallerypicnum);
    
});



