	
	/* For site verision (05) */
	

	$(function() {
	
		// *** DEV *** Grid Toggle
		$('#gridtoggle').toggle(function(){
			$('#columnleft, #columnright').addClass("grid");
			}, function () {
			$('#columnleft, #columnright').removeClass("grid");
		});
	
		// Custom toggle/fade(s)
		jQuery.fn.fadeToggle = function(speed, easing, callback) { 
	   	return this.animate({opacity: 'toggle'},500,'easeInOutQuad');
		};
	
		// Hide/Open The Collections and The Story Navigation 
		$('#collectionmenu, #storymenu').hide();
		
		// Check to see if your within Collection or Story
		if(window.location.toString().indexOf("collection-") > 0) {
		$('#collectionmenu').show();
		}
		
		if(window.location.toString().indexOf("story-") > 0) {
		$('#storymenu').show();
		}
		
		// Hide/Open Contact Details
		$('#contactdetails').hide();
		
		if(window.location.toString().indexOf("contact") > 0) {
		$('#contactdetails').fadeIn();
		}
		
		// Hide/Open Press Celeb Details
		$('#pressmenu').hide();
		
		if(window.location.toString().indexOf("press") > 0) {
		$('#pressmenu').fadeIn();
		}
		
		// Hide/Open Subscribe(s)
		$('#subscribe, #subscribe-thanks, #subscribe-archive').hide();
		
		if(window.location.toString().indexOf("subscribe.htm") > 0) {
		$('#subscribe, #subscribe-archive').fadeIn();
		}
		
		if(window.location.toString().indexOf("subscribe-archive-jan2010.htm") > 0) {
		$('#subscribe, #subscribe-archive').fadeIn();
		}
		
		if(window.location.toString().indexOf("subscribe-thanks.htm") > 0) {
		$('#subscribe-thanks, #subscribe-archive').fadeIn();
		}
		

		// Activate & de-activate Collect/Story Nav actions
		$('#collectnav h2').click(function() {
		if(window.location.toString().indexOf("collection-") < 0)
		$('#collectionmenu').fadeToggle();
		});
		
		$('#storynav h2').click(function() {
		if(window.location.toString().indexOf("story-") < 0)
		$('#storymenu').fadeToggle();
		});
		
			
						// *** ON/OFF Hover menus DEV ***
						  /*$("#collectnav").hover(function() {
					      	//$(this).append($("<span>*</span>"));
					      	//$('#collectionmenu').hide();
					      	$(this).append("<ul id='collectionmenu'><li><a href='collection-bespoke-about.htm' class='dim'>Bespoke Commissions</a> / </li><li><a href='collection-messenger-1.htm' class='dim'>Messenger Of The Gods</a> / </li><li><a href='collection-jewels-1.htm' class='dim'>Jewels Of The Urban Night</a> / </li><li><a href='collection-wind-1.htm' class='dim'>Wind Up Archive</a> / </li><li><a href='collection-select-1.htm' class='dim'>Select</a></li></ul>");
					      }, 
					      function () {
					        $(this).find("ul:last").remove();
					      });
					      
						  $("#storynav").hover(function() {
					      	//$(this).append($("<span>*</span>"));
					      	$(this).append("<ul id='storymenu'><li><a href='story-jessica.htm' class='dim'>Jessica Mccormack</a> / </li><li><a href='story-salon.htm' class='dim'>The Salon</a></li></ul>");
					      }, 
					      function () {
					        $(this).find("ul:last").remove();
					      });*/
					      
		// Showing collection description on hover
	  	/*$("#collection-wind-about").click(function() {
      	$("#lrgimgwrap").hide().append("<div id='bodycopy'><h3>Wind Up Archive</h3><p>This collection is inspired by the world of antique pocket watches, which have been made redundant and discarded by modern society.</p><p><a href='javascript:void()' id='close'>x</a></p></div>").fadeIn();
      	return false;
      	},
      	function () {
        $("#lrgimgwrap").find("div:last").fadeOut();
      	});*/
      	
      	/*$('#collection-wind-about').click(function() {
      	
      		$("#lrgimgwrap").append("<div id='bodycopy'></div>");
      		$("#columnright").append("<p><a href='javascript:void()' id='close'>Close</a></p>");
			$('#bodycopy').load('collection-wind-about.htm #bodycopy', function() {
				$(this).hide().fadeIn(500); 
				});
			return false;
		});*/
		
				//Close It
				$('#close').click(function(about_remove) {
				//$('#close').click(function(about_remove) {
					//$('p').css('color','blue');
		      		//$('#bodycopy').fadeOut();
		      		//$("#TB_closeWindowButton").click(tb_remove);
		      		//$('#bodycopy').addClass('hide');
					//return false;
				});
				
				function about_remove() {
					//$('p').css('color','blue');
				 	$("#bodycopy").unbind("click");
					//$("#lrgimgwrap").show();
					//return false;
				}
				
	
		// Fading in all #columright content
		$('#columnright, #bodycopy').hide();
		$('#columnright, #bodycopy').fadeIn(500);
		
		
		// Setting mainnav highlights
		
		//if(window.location.pathname = "/index") {$('#filmnav a').css('backgroundPosition','0 -48px');}
		//if(window.location.pathname = "http://www.jessicamccormack.com") {$('#filmnav a').css('backgroundPosition','0 -48px');}
		//if(window.location="http://www.jessicamccormack.com") {$('#filmnav a').css('backgroundPosition','0 -48px');return false;}
		//if(window.location.toString().indexOf("index") > 0) {$('#filmnav a').css('backgroundPosition','0 -48px');}
		{$('#home #filmnav a').css('backgroundPosition','0 -48px');}
		if(window.location.toString().indexOf("story-") > 0) {$('#thestorynav a').css('backgroundPosition','0 -24px');}
			if(window.location.toString().indexOf("story-salon") > 0) {$('#salonnav').css('color','white');}
			if(window.location.toString().indexOf("story-jessica") > 0) {$('#jessnav').css('color','white');}
		if(window.location.toString().indexOf("jmnews") > 0) {$('#jmnewsnav a').css('backgroundPosition','0 -408px');}
		if(window.location.toString().indexOf("collection-") > 0) {$('#thecollectionnav a').css('backgroundPosition','0 0');}
			if(window.location.toString().indexOf("collection-bespoke") > 0) {$('#bespokenav').css('color','white');}
			if(window.location.toString().indexOf("collection-messenger") > 0) {$('#messengernav').css('color','white');}
			if(window.location.toString().indexOf("collection-jewels") > 0) {$('#jewelsnav').css('color','white');}
			if(window.location.toString().indexOf("collection-wind") > 0) {$('#windnav').css('color','white');}
			if(window.location.toString().indexOf("collection-select") > 0) {$('#selectnav').css('color','white');}
		if(window.location.toString().indexOf("film") > 0) {$('#filmnav a').css('backgroundPosition','0 -48px');}
		if(window.location.toString().indexOf("blog") > 0) {$('#blognav a').css('backgroundPosition','0 -72px');}
		if(window.location.toString().indexOf("press") > 0) {$('#pressnav a').css('backgroundPosition','0 -264px');}
			if(window.location.toString().indexOf("press-celebrities") > 0) {$('#celebritiesnav').css('color','white');}
		if(window.location.toString().indexOf("stockists") > 0) {$('#stockistsnav a').css('backgroundPosition','0 -312px');}
		if(window.location.toString().indexOf("subscribe") > 0) {$('#subscribenav a').css('backgroundPosition','0 -360px');}
			if(window.location.toString().indexOf("subscribe-archive-jan2010") > 0) {$('#jan2010nav').css('color','white');}
		if(window.location.toString().indexOf("contact") > 0) {$('#contactnav a').css('backgroundPosition','0 -96px');}
		
		
		// Ajax loading
		/*$('#collectionmenu li a').click(function(){
									  
			var toLoad = $(this).attr('href')+' #columnright';
			$('#columnright').fadeOut('normal',loadContent);
			$('#load').remove();
			$('#allscreen').append('<span id="load">Loading...</span>');
			$('#load').fadeIn('normal');
			window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4);
			function loadContent() {
				$('#columnright').load(toLoad,'',showNewContent())
			}
			function showNewContent() {
				$('#columnright').fadeIn('1000	',hideLoader());
			}
			function hideLoader() {
				$('#load').fadeOut('normal');
			}
			return false;
			
		});*/
		
	});