jQuery(function( $ ){

	
	$("#MobileNav .Button A").toggle( 
	function(){  $("#MobileNav").addClass('Open'); $("#Nav").addClass('Open').animate({ 'top':'-80' },200);   $("#SiteWrapper").css('margin-top','1350px'); },
	function(){  $("#MobileNav.Open").removeClass('Open'); $("#Nav.Open").removeClass('Open').animate({ 'top':'-1538' },200); $("#SiteWrapper").css('margin-top','0');  });

/* HOMEPAGE SLIDESHOW */
	$('#Feature').cycle({ 
		fx:     'fade', 
		timeout: 7000, 
		pager:  '#Pager'
	});
	$(".Tweet").tweet({
		username: "looknorthinc",
		join_text: "auto",
		count: 1,
		refresh_interval: 60,
		template: "<b>Latest:</b> {text} <br />Posted {time}"
	});
	
	$(".BlogTweet").tweet({
		username: "looknorthinc",
		join_text: "auto",
		count: 2,
		refresh_interval: 60,
		template: "{text} <br />Posted {time}"
	});
	
	$('#Client-Trigger A').click(function(){
		$('#Client-Portal').toggle();
		if( $(this).hasClass('Selected')){
			$(this).removeClass('Selected');
		}
		else $(this).addClass('Selected');
		
	});

	$('a.Fancybox').fancybox({
		'titlePosition'  : 'inside'
	});
	
	$("#About img.A").hover(
		function() {
			$(this).stop().animate({"opacity": "0"}, "slow");
		},
		function() {
			$(this).stop().animate({"opacity": "1"}, "slow");
	});

	/*-=-=-=-=-=-=-= Portfolio -=-=-=-=-=-=- */
	$( "#Detail-Tabs" ).tabs({
		select: function(event, ui) {
			var url = $.data(ui.tab, 'load.tabs');
			if( url ) {
				window.open(url);
				return false;
			}
			return true;
		}
	});
	
	$(".LazyLoad").lazyload({
		placeholder : "/images/white.gif",
		threshold : -50,
		effect : "fadeIn"
	});
	
	
	/*
	$(".Photo").cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev',
        next:    '#next',
        after:     onAfter,
        pagerAnchorBuilder: pagerFactory
    });
    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>';
    };
    
	function onAfter(curr,next,opts) {
		var Sidebar = '<div class="Count">Image ' + (opts.currSlide + 1) + ' of ' + opts.slideCount + '</div><div class="Caption">' + $(this).attr('alt')  + '</div>';
		$('#Sidebar').html(Sidebar);
	}
	function onAfter(curr,next,opts) {
		var Sidebar = '<div class="Count">Image ' + (opts.currSlide + 1) + ' of ' + opts.slideCount + '</div>';
		$('#Sidebar').html(Sidebar);
	}*/
	/*-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=- */

	
	
});



