jQuery(document).ready(function(){
function bringBoard() {
	//jQuery("#home-print-1-img").delay(3200).fadeIn("3000");
	//jQuery("#home-print-2-img").delay(3800).fadeIn("3000");
	//jQuery("#home-web-1-img").delay(2600).fadeIn("3000");
	//jQuery("#home-web-2-img").delay(2400).fadeIn("3000");
	//jQuery("#home-web-3-img").delay(3400).fadeIn("3000");
	//jQuery("#home-featured-img").delay(2200).fadeIn("3000");
	//jQuery("#home-video-1-img").delay(3600).fadeIn("3000");
	//jQuery("#home-video-2-img").delay(2800).fadeIn("3000");
	//jQuery("#home-bto-img").delay(3000).fadeIn("3000");
	jQuery("#home-print-1-img").delay(170).fadeIn("3000");
	jQuery("#home-print-2-img").delay(110).fadeIn("3000");
	jQuery("#home-web-1-img").delay(130).fadeIn("3000");
	jQuery("#home-web-2-img").delay(220).fadeIn("3000");
	jQuery("#home-web-3-img").delay(20).fadeIn("3000");
	jQuery("#home-featured-img").delay(120).fadeIn("3000");
	jQuery("#home-video-1-img").delay(200).fadeIn("3000");
	jQuery("#home-video-2-img").delay(180).fadeIn("3000");
	jQuery("#home-bto-img").delay(100).fadeIn("3000");
	//jQuery(".tooltip").show().delay(20000).fadeOut(400);
}

jQuery(window).bind("load", function() {
	bringBoard();
});


	
	function clearBoard() {
		jQuery('.front-port-body-inner').hide();
	}

	// Return Button
	jQuery('#goback-link').click(function(){
		jQuery(document).scrollTo( { top: 0, left: 0 }, 600 );
		clearBoard();
	});
	
	jQuery(".home-panel > a").click(function(){
		clearBoard();
		var hbId = jQuery(this).parent().attr("id");
		jQuery('#port-'+hbId).show();
		jQuery(document).scrollTo('#front-port-wrap', 2200 );	
	});
	
	jQuery(".home-panel").hoverIntent(
		function(){
			jQuery(this).children('a').children('img').fadeOut("slow");
		},
		function(){
			jQuery(this).children('a').children('img').fadeIn("slow");
		}
	);	
	
	// BeTheOutlier Button		
	jQuery("#home-be-the-outlier").hoverIntent(
		function(){
			jQuery("#home-bto-img").fadeOut("slow");
		},
		function(){
			jQuery("#home-bto-img").fadeIn("slow");
		}
	);
	
	// Site Slogan
	jQuery("#site-slogan").hoverIntent(
		function(){
			jQuery("#home-print-1-img").fadeOut("slow");
			jQuery("#home-print-2-img").fadeOut("slow");
			jQuery("#home-web-1-img").fadeOut("slow");
			jQuery("#home-web-2-img").fadeOut("slow");
			jQuery("#home-web-3-img").fadeOut("slow");
			jQuery("#home-featured-img").fadeOut("slow");
			jQuery("#home-video-1-img").fadeOut("slow");
			jQuery("#home-video-2-img").fadeOut("slow");
			jQuery("#home-bto-img").fadeOut("slow");
		},
		function(){
			jQuery("#home-print-1-img").fadeIn("slow");
			jQuery("#home-print-2-img").fadeIn("slow");
			jQuery("#home-web-1-img").fadeIn("slow");
			jQuery("#home-web-2-img").fadeIn("slow");
			jQuery("#home-web-3-img").fadeIn("slow");
			jQuery("#home-featured-img").fadeIn("slow");
			jQuery("#home-video-1-img").fadeIn("slow");
			jQuery("#home-video-2-img").fadeIn("slow");
			jQuery("#home-bto-img").fadeIn("slow");
		}
	);
	
	jQuery('#whatSize').click(function() {		
		checkBrowserSize();	
	});
	
	function getWindowSize() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		return myWidth;
	}
	
	function showWidowSize(){
		alert(getWindowSize());
	}
	
	//Check Browser windows
	function checkBrowserSize(){
		myWidth = getWindowSize();
		//This if for the main home page. We like hiding the scroll bar so the click and scroll feature works well
		//but if your window is less than 1100 you won't see all projects and tobnav. 
		//So if >1100 take the scroll bars out.
		if(myWidth>1130){
			jQuery('body').css('overflow-x','hidden');			
		}
		else{
			jQuery('body').css('overflow-x','visible');	
		}	
	}
	checkBrowserSize();
	jQuery(window).resize(function() {
		checkBrowserSize();
	});
	
	//on click, hide the currently displayed div and show the next.
	jQuery('#port-fwd').click(function(){
		currentDiv =  jQuery("div.front-port-body-inner:visible");
		if(currentDiv.next('.front-port-body-inner').length == 0) {
			currentDiv.slideUp();
			jQuery("div.front-port-body-inner:first").slideDown();
		}
		else {
			currentDiv.slideUp();
			currentDiv.next('.front-port-body-inner').slideDown();
		}
	});
	
	//on click, hide the currently displayed div and show the next.
	jQuery('#port-prev').click(function(){
		currentDiv =  jQuery("div.front-port-body-inner:visible");
		if(currentDiv.prev('.front-port-body-inner').length == 0) {
			currentDiv.slideUp();
			jQuery("div.front-port-body-inner:last").slideDown();
		}
		else {
			currentDiv.slideUp();
			currentDiv.prev('.front-port-body-inner').slideDown();
		}
	});	
});
;

