/**
 * Nightmare House 2 - by Daniel Ohayon (SmartWD.com)
*/

$(document).ready(function(){
	/** Top Menu smooth-scrolling (function) **/
		$('#headmenu a').click(function(){
			 $.scrollTo( $(this).attr('href'), 2000);return false;
		});	
		$('.csbutton a').click(function(){
			 $.scrollTo( $(this).attr('href'), 2000);return false;
		});	
		$('.toplink').click(function(){
			 $.scrollTo( $(this).attr('href'), 2000);return false;
		});	
		
		/** gallery Pages **/
			$('.pages a').click(function(){
				switch_tabs($(this));return false;
			});
		 
		});
		 
		function switch_tabs(obj)
		{
			$('.galleryPage').hide();
			$('.pages a').removeClass("selected");
			var id = obj.attr("rel");
		 
			$('#'+id).show();
			obj.addClass("selected");
		}

/** Videos choosing **/
	function changeVideo( num )
	{
		$(".video").hide();
		$("#video"+num).show();
		$('.avideo').removeClass('current');
		$('#avideo'+num).addClass('current');
	}
$(function() {
	$('#gallery .grid .galleryPage a').lightBox({fixedNavigation:true});
});
