/* all custom jquery functions for luxor-quest */
		//Initialize each slider on the page. Each slider must have a unique id
			jQuery(window).bind("load", function() {
			jQuery("div#slider1").codaSlider()
			jQuery("div#slider2").codaSlider()
			// etc, etc. Beware of cross-linking difficulties if using multiple sliders on one page.
			});
		//VERTICALLY ALIGN FUNCTION PROJECT DESCRIPTIONS
			(function ($) {
			$.fn.vAlign = function() {
			return this.each(function(i){
			var ah = $(this).height();
			var ph = $(this).parent().height();
			var mh = (ph - ah) / 2;
			$(this).css('margin-top', mh);
			});
			};
			})(jQuery);
			$(document).ready(function(){
			$(".proj_overlay dl").vAlign();
			});
		//Initialise nav
			$(function() {
			$(".nav").nav()
			$(".blog-nav").nav()
			});
		//Remove text links in gallery and wrap with IE friendly a tag	
			$(document).ready(function(){
			$(".proj_overlay").each(function(){
				var $link = $(".link-to-remove a", this).attr("href");
				var $rel = $(".link-to-remove a", this).attr("rel");
				$(this).wrap('<a href="'+$link+'" rel="'+$rel+'" />');
			$(".link-to-remove", this).remove();
		})
		});
		//Pretty Photo
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'dark_rounded'});
			});
		//Animated page scroll
			$(function(){
			jQuery.fn.extend({
			scrollTo : function(speed, easing) {
			return this.each(function() {
			var targetOffset = $(this).offset().top;
			$('html,body').animate({scrollTop: targetOffset}, speed, easing);
			});
			}
			});
			$(".nav a").click(function(){
			$($(this).attr("href")).scrollTo(1200, "expoinout");
			return false;
			});
			$("#back-to-top").click(function(){
			$("body").scrollTo(1200, "expoinout");
			return false;
			});
			});
		
			//ROUNDED CORNERS
			$(document).ready( function(){
			 $(".rounded").corner("20px")
 			 });	
		
		

$(document).ready(function() {
   		// hides the slickbox as soon as the DOM is ready
   		// (a little sooner than page load)
        $('#more-testimonials').hide();
 		// toggles the slickbox on clicking the noted link  
  		$('a.test-toggle').click(function() {
   		$('#more-testimonials').slideToggle(400);
   		$(this).toggleClass("see-more").toggleClass("see-less");
  		return false;
        });
      });
      
$(document).ready(function() {
   		// hides the slickbox as soon as the DOM is ready
   		// (a little sooner than page load)
        $('#more-illus').hide();
 		// toggles the slickbox on clicking the noted link  
  		$('a.illus-toggle').click(function() {
   		$('#more-illus').slideToggle(400);
   		$(this).toggleClass("see-more").toggleClass("see-less");
  		return false;
        });
      });
      
$(document).ready(function() {
   		// hides the slickbox as soon as the DOM is ready
   		// (a little sooner than page load)
        $('#more-photos').hide();
 		// toggles the slickbox on clicking the noted link  
  		$('a.photos-toggle').click(function() {
   		$('#more-photos').slideToggle(400);
   		$(this).toggleClass("see-more").toggleClass("see-less");
  		return false;
        });
      });  

//DISTRACTIONS IMG ROLLOVER      
$(document).ready(function() {
		$("#distractions li img").css({opacity: 0.9}).wrap('<div />');
		$("#distractions li a").hover(function(){
		$("img", this).css({opacity: 0.4});
		},function(){
		$("img", this).css({opacity: 1});
		});
	  });
	  
	 
