$(document).ready(function() {
	$(".search_toggle").click(function() {
		$("div.search").slideToggle('fast');
		$("div.search_open").slideToggle('fast');
	});
		
	$('a.hardware_tab, a.software_tab, a.services_tab')
		.mouseover(function(){
			$(this).animate({backgroundPosition: "10px 0"}, 100);
		})
		.mouseout(function(){
			$(this).animate({backgroundPosition: "0px 0"}, 100);
		});
});

// Page sub-tabs
$(document).ready(function() {
	//Default Action
	$(".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.secondary_nav li").click(function() {
		$("ul.secondary_nav 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 rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
});

// Slideshow in header and Success Storied in footer (doesn't work in IE7)
if (!$.browser.msie || parseInt($.browser.version) != 7) {
	$(document).ready(function() {
		$('.quote_cycle').cycle({timeout: 6100});
		$('.header_image').cycle({speed: 2000});
	});
}

// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24235053-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


