/*Dropdown menus*/
	$(document).ready(function(){
		$('li.headlink').hoverIntent({
			    
			over: function() { 
				$('ul', this).slideToggle("fast");
				$(this).children('a.inactive').animate({backgroundColor: "#333"}, 300);
			},
			out: 
				function() { $('ul', this).slideToggle("fast");  
				$(this).children('a.inactive').animate({backgroundColor: "#999"}, 100);
			}	 
			});
	});

/*img info hover*/
	$(document).ready(function(){
	   $(".infoHover li em.seen").animate({opacity: "show"}, "fast");
	   $(".infoHover li em span").animate({opacity: "hide"}, "fast");

	   $(".infoHover li em").hover(
	   function(over) {
	     $(this).find("span").animate({opacity: "show"}, "fast");
	   },
	   function(out) {
	     $(this).find("span").animate({opacity: "hide"}, "slow");
	   });


	 $(".infoHover li").hover(
	   function(over) {
	     $(this).find("em.hover").animate({opacity: "show"}, "fast");
	   },
	   function(out) {
	     $(this).find("em.hover").animate({opacity: "hide"}, "slow");
	   });
	
	}); 
	

/* td img info hover*/
	$(document).ready(function(){
	   $(".infoHover td em.seen").animate({opacity: "show"}, "fast");
	   $(".infoHover td em span").animate({opacity: "hide"}, "fast");

	   $(".infoHover td em").hover(
	   function(over) {
	     $(this).find("span").animate({opacity: "show"}, "fast");
	   },
	   function(out) {
	     $(this).find("span").animate({opacity: "hide"}, "slow");
	   });


	 $(".infoHover td").hover(
	   function(over) {
	     $(this).find("em.hover").animate({opacity: "show"}, "fast");
	   },
	   function(out) {
	     $(this).find("em.hover").animate({opacity: "hide"}, "slow");
	   });
	
	}); 

/*projectSlider*/
		function $_GET(q,s) {
		s = (s) ? s : window.location.search; 
		var re = new RegExp('&amp;'+q+'=([^&amp;]*)','i');
		return (s=s.replace(/^\?/,'&amp;').match(re)) ?s=s[1] :s='';
		}
	$(function() {

	    $('#projectslide').cycle({
	        fx:      'scrollHorz',
	        timeout:  0,
	        prev:    '#prev',
	        next:    '#next',
	        pager:	 '#projectNav', 
			speed: 500,
			startingSlide: $_GET('p'),
			pagerAnchorBuilder: function(idx, slide) { 
        	var s = idx > 2 ? ' ' : '';
	        return '<a href="#">Project '+(idx+1)+'</a>'; 
	        }
	    });

	});
	
/*brokerageSlider*/
$(function() {
$('#slideshow-brokerage').cycle({
    fx:      'scrollHorz',
	        timeout:  0,
	        prev:    '#prev',
	        next:    '#next',
			speed: 500,
    		pager:  '#sliderNav',
			startingSlide: $_GET('p'),

// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<a href="'+slide.src+'">'+slide.title+'</a>';
    }
});
});

/*delay function*/
	jQuery.fn.delay = function(time,func){
	    return this.each(function(){
	        setTimeout(func,time);
	    });
	};

/*faux splash page*/
	$(document).ready(function(){		
		$("#splashes").click(function() {
	    $(this).animate({opacity: "hide"}, "slow");
	  });
	$('#splashes').delay(10000, function(){$('#splash').fadeOut()})
	});

/*content nav color shift*/

		$(document).ready(function(){
		interval: 10;
		$(".contentNav a").hoverIntent({
			over: function() {			
			$(this).parent().parent().find("a").not(this).animate({color: "#51515c"}, "fast "), 
			$(this).animate({backgroundColor: "#444"}, "fast").animate({color: "#fff"}, "fast");    
			},
			
			out: function() {
			$(this).animate({color: "#51515c"}, 10).animate({backgroundColor: "#15151c"}, 10);
			}
		});
		
		$("ul.contentNav").hoverIntent({
			out: function() {
			$(this).find("a").animate({color: "#fff"}, 50) ;
			}
		});
	});
	
/*color box*/
	$(document).ready(function(){
		$(".colorbox").colorbox({width:"800px", height:"90%"});
	});


/* background content slider */
	$(document).ready(function(){
	$('#scroller').serialScroll({
		items:'li',
		prev:'a.prev',
		next:'a.next',
		offset:-225, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		duration:900,
		stop:true,
		lock:false,
		cycle:false, //don't pull back once you reach the end
		jump: true //click on the images to scroll to them
	});
		function clickNext()
			{
			    $('a.next').trigger('click');
			    setTimeout(clickNext, 2500);
			}
			
			clickNext();
	
	});
