	function NextPicture()
	{
		pvCurrent = GetNextIndex(pvCurrent);
		SetImageSources(pvCurrent);
	}
	
	function PrevPicture()
	{
		pvCurrent = GetPrevIndex(pvCurrent);
		SetImageSources(pvCurrent);
	}
	
	function SetImageSources(index)
	{
		SetImgSource(pvImg, "large", index);		
		SetImgSource(pvImgLeft, "small", GetPrevIndex(index) );
		SetImgSource(pvImgRight, "small", GetNextIndex(index) );
	}
	
	function PicViewerInit()
	{
		pvImg = document.getElementById('pvImg');
		pvImgLeft = document.getElementById('pvImgLeft');
		pvImgRight = document.getElementById('pvImgRight');
		
		pvLinkPrev = document.getElementById('pvLinkPrev');
		pvLinkNext = document.getElementById('pvLinkNext');
	}
	
	function ChangeLinkState(link, state)
	{
		link.style.display = state;
	}
		
	function GetPrevIndex(index)
	{
		if (index <= 0)
			return pvArr.length -1;
		else
			return index-1;
	}
	
	function GetNextIndex(index)
	{
		if (index >= pvArr.length -1)
			return 0;
		else
			return index+1;
	}
	
	function loadPanoramaView(hotelkey, url)
	{
		do_showVtour(hotelkey, url);
	}
	
	function SetImgSource(imgElement, type, index)
	{
		if (type == "large")
			imgElement.src = pvLargePath + pvArr[index];
		else
			imgElement.src = pvSmallPath + pvArr[index];
	}
	
	function startphoto()
	{
		$("#block_default").hide();
		
		$("#block_virtual").hide();
		$("#block_video").hide();
		
		$("#block_pv").show();
		
		pvCurrent = 0;
		SetImageSources(pvCurrent);
	}
	
	function startvirtual()
	{	
		$("#block_default").hide();
		
		$("#block_pv").hide();
		$("#block_video").hide();
		
		$("#block_virtual").show();
	}
	
	function video()
	{	
		$("#block_default").hide();
		
		$("#block_pv").hide();
		$("#block_virtual").hide();
		
		$("#block_video").show();
	}
	
	function CloseBlock()
	{		
		$("#block_virtual").hide();
		$("#block_pv").hide();
		$("#block_video").hide();
		
		$("#block_default").show();		
	}
		
