// JavaScript Document : Real Office Centers
// Created by C2H5 LLC
jQuery(document).ready(function(){

	//topmargin
	 function marginresize() {
	 var windowheight = $(window).height(); 
	 var topmargin = ($(window).height()-710)/2; 
	 
	 if ((windowheight) > '710'){
	 $('#website').css('margin-top',topmargin);
	 } else {
	 $('#website').css('margin','0 auto');
	 }
	 }
	
	 marginresize();//Triggers when document first loads    
	
	 $(window).bind("resize", function(){//Adjusts image when browser resized
	 marginresize();
	 });
	
	//startslideshow
	//jQuery('#slideshow').fadeSlideShow();
	$("#slider").easySlider();
	
	
	//When page loads...
	$("#slider").hide(); //Hide slider
	$(".tab_container").hide(); //Hide container
	$(".nav2").hide(); //Hide nav
	$.fn.pause = function(duration) {
		$(this).animate({ dummy: 1 }, duration);
		return this;
	};
	$("#slider").pause(100).slideDown();
	$(".tab_container").pause(300).slideDown();
	$(".nav2").pause(500).slideDown();
	
	//LEFT NAV TRANSITION
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).slideDown(); //Fade in the active ID content
		return false;
	});	
	
});
