function gorizontalScroll (el)
{
	 var scrollWidth = 0;
	 $(el+' .fotopreview').each(function(){
		  scrollWidth += $(this).innerWidth()+15;
	 });
	  
	 $(el+' .overview').css('width',scrollWidth);
	 $(el+' .viewport').css('height',$(el+' .overview').innerHeight());
	 $(el).tinyscrollbar({ axis: 'x'});
	 $(el+' .thumb').css('width', $(el+' .thumb').innerWidth()-30);
	 $(el+' .fotopreview').click(function(){
		$(this).parent().parent().parent().prev('.scrollPageX_viewfoto').html('<img alt="" src="'+$(this).attr('href')+'"/>'); 
		return false;
	 });
}

function showControls()
{	
	var scrollWidth = 0;
	
	$('.scrollableArea img').each(function(){
		scrollWidth+=$(this).width();	
	});
	
	if(scrollWidth > 630){
		$('.scrollableArea').parent().parent().find(".scrollingHotSpotLeftVisible").show();
		$('.scrollableArea').parent().parent().find(".scrollingHotSpotRightVisible").show();
	}
}


$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$('.news_list:even').css('background-color', '#d5ae6d');
	//$('#scrollPage').tinyscrollbar();
	//gorizontalScroll ('#hotelRoom_scroll');
	
	/*gorizontalScroll ('#pianoRoom_scroll');
	gorizontalScroll ('#steikRoom_scroll');
	gorizontalScroll ('#bordoRoom_scroll');*
	gorizontalScroll ('#vostRoom_scroll');
	gorizontalScroll ('#damaRoom_scroll');
	gorizontalScroll ('#winterRoom_scroll');
	gorizontalScroll ('#normRoom_scroll');
	gorizontalScroll ('#vinoRoom_scroll');*/
	
	// Smooth Div Scroll
	
	$("div.block-scrollable").smoothDivScroll({ 
		autoScrollDirection: "endlessloopright", 
		autoScrollStep: 1, 
		autoScrollInterval: 10,	
		scrollStep : 2,
		visibleHotSpots: "always"
	});
	
	showControls();
});
