/* Author: Steve Ambielli
	Home JS file for all functions used in BERTL
*/
jQuery.noConflict();
jQuery(document).ready(function() {
		
		//tabs function on home page		
		//auto set first tab active
		jQuery('.content #news').show();
		jQuery('#tabs .tabs a:first-child').addClass('on');
		
		jQuery('#tabs .tabs a').click(function(){
			var idLink = jQuery(this).attr('href');
			var homeTabCookiename = "lastHomePageTab";
			var homeTabCookieage = 6;
			var lastActiveTab = null;
			var tabNames = new Array('News','Report','Research');
			createCookie(homeTabCookiename,idLink,homeTabCookieage);
			jQuery('#tabs .tabs a').removeClass('on');
			jQuery(this).addClass('on');
			jQuery('#tabs .content #news').hide();
			jQuery('#tabs .content #reports').hide();
			jQuery('#tabs .content #research').hide();
			jQuery('#tabs .content '+idLink).show();
			if (idLink = '#reports') {
				showTab('reports');	
			}
			return false;
		});		
});

function showTab(id) {
	if (id == 'news') {
		val = '#'+jQuery('#category').val();
		jQuery('#tabs #news #hardware').hide();
		jQuery('#tabs #news #software').hide();
		jQuery('#tabs #news #business').hide();
		jQuery('#tabs #news #people').hide();
		jQuery('#tabs .content '+val).show();
	} 
	if (id == 'reports') {
		val = '#'+jQuery(' #category2').val();
		jQuery('#tabs #reports #report6').hide();
		jQuery('#tabs #reports #report90').hide();
		jQuery('#tabs #reports #report7').hide();
		jQuery('#tabs #reports #report3').hide();
		jQuery('#tabs #reports #report4').hide();
		jQuery('#tabs #reports #report30').hide();
		jQuery('#tabs #reports #report9').hide();
		jQuery('#tabs #reports #report28').hide();
		jQuery('#tabs #reports #report2').hide();
		jQuery('#tabs #reports #report5').hide();
		jQuery('#tabs #reports #report29').hide();
		jQuery('#tabs #reports #report50').hide();
		jQuery('#tabs #reports #report70').hide();
		jQuery('#tabs .content '+val).show();
	}
// REPORT TAB MAPPING
// 	    report3 Printer
//		report4 Fax
//		report6 Digital Duplicator
//		report7 Scanner - Production
//		report30 Wide Format - MFP
//		report9 Wide Format - Ink Based
//		report28 Wide Format - Scanner
//		report5 Wide Format - Toner Based
//		report2 MFP
//		report50 Wide Format - Printer
//		report29 Scanner - Desktop
//		report70 Software
}
