
	$(document).ready(function(){
		
		//So there is no hard show on first click
		$('#1').fadeTo("fast", 0).hide();
		
		//So there is no hard show on first click
		$('#2').fadeTo("fast", 0).hide();
		
		//so there is no hard show on first click
		$('#3').fadeTo("fast", 0).hide();
		
		//so there is no hard show on first click
		$('#4').fadeTo("fast", 0).hide();
		
		//so there is no hard show on first click
		$('#5').fadeTo("fast", 0).hide();
		
		// so there is no hard show on first click
		$('#6').fadeTo("fast", 0).hide();
	
		// FOR ON - OFF STATES OF TOP NAV
		var navnum = [ "0", "1", "2", "3", "4", "5", "6" ];
		
		$.each(navnum, function(index, item) {
			$('.nav' + item).click(function () {
				$("#header").find('.on').removeClass("on");
				$(this).removeClass("off");
				$(this).addClass("on");
			});
		});
		
		$('.navHome').click(function () {
			$("#header").find('.on').removeClass("on");
			$(".nav0").addClass("on");
		});
		
		// FOR ON - OFF STATES OF TOP NAV
		var fignum = [ "0", "1", "2", "3", "4", "5", "6" ];
		
		// FOR EACH ON HOME PAGE GALLERY
		$.each(fignum, function(index, item) {
			$('#fig' + item).hover(
			function () {
				$(".nav" + item).addClass("active");
			},
			function () {
				$(".nav" + item).removeClass("active");
			});
		});
		
		// FOR WHEN YOU CLICK ON EACH IMAGE IN GALLERY
		$.each(fignum, function(index, item) {
			$('#fig' + item).click(
			function () {
				$("#header").find('.nav0').removeClass("on");
				$("#header").find('.nav' + item).removeClass("off");
				$("#header").find(".nav" + item).addClass("on");	
			});
		});
		
		// page transitions
		$(".navigator").click(function () {
		    var divname= this.name;
		    $("#"+divname).fadeTo("slow", 1.0).show().siblings().fadeTo("slow", 0).hide();
		 });
		
		// fancybox loader
		$("a.fancy").fancybox({
			'padding': 20,
			'overlayOpacity': 0.7,
			'overlayColor': '#333'
		}); 
		
		//Full Caption Sliding (Hidden to Visible)
		//$('.boxgrid.captionfull').hover(function(){
		//	$(".cover", this).stop().fadeTo("slow", 1);
		//}, function() {
		//	$(".cover", this).stop().fadeTo("hide", 0);
		//});
		
	});
	
	
	var slidenum = [ "1", "2", "3", "4", "5", "6" ];
		
	$.each(slidenum, function(index, item) {
		$('#slider' + item).loopedSlider({
			autoStart: 0,
			restart: 0,
			slidespeed: 700,
			pagination: ".pagination"
		});
	});		

