$(document).ready(function() {
	
	// Print Page
	//----------------------------------------
		$(".printbtn").click( function() {
			$('#printarea').jqprint();
			return false;
		});
		
	// Tabs
	//----------------------------------------
		$("#attributes").semantictabs({
		  panel:'panel',                //-- Selector of individual panel body
		  head:'h5',                    //-- Selector of element containing panel head
		  active:':first'               //-- Selector of panel to activate by default
		});


	// Testimonials
	//----------------------------------------
		$(".testimonial").hide(); //Hide all content
		$("ul.sender li:first").addClass("active").show(); //Activate first tab
		$(".testimonial:first").show(); //Show first tab content
	
		//On Click Event
		$("ul.sender li").click(function() {
	
			$("ul.sender li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".testimonial").hide(); //Hide all tab content
	
			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});

	// Slider
	//----------------------------------------
		$('.slider').loopedSlider({
			autoStart: 10000,
			restart: 15000,
			container: '.slider', // Class or ID of main container
			slides: '.slides', // Class or ID of slide container
			pagination: '.pagination', // Class or ID of pagination container
			containerClick: true, // Click container for next slide
			slidespeed: 300, // Speed of slide animation
			fadespeed: 300 // Speed of fade animation
			//autoHeight: false // Set to positive number for auto height and animation speed
		});
		
	// EqualHeights Columns
	//----------------------------------------
			equalHeight($(".infobox"));
        
	// Did you know text resize
	//----------------------------------------			
			$('.textfill').textfill({ maxFontPixels: 24, innerTag: 'p' });

	// Pretty Photo
	//----------------------------------------
			$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square'});

	// Pretty Popin
	//----------------------------------------
			$("a[rel^='selector']").prettyPopin({width: 800,height: 680,followScroll:false});

		
	// IE PNG Fix
	//----------------------------------------
			$(document).pngFix(); 
			
	//Accordian
	//----------------------------------------
			$("#faqs h5:first").addClass("active");
			$("#faqs div:not(:first)").hide();
			$("#faqs h5").click(function(){
	  		$(this).next("div").slideToggle("normal")
	  			.siblings("div:visible").slideUp("normal");
	 		 $(this).toggleClass("active");
	  		$(this).siblings("h5").removeClass("active");
		});

	//Media
	//----------------------------------------
			$('.media').media();

	// Solutions Toggle
	//----------------------------------------
			$('.computer, .other').hide();	
			$(".solution").change(function(){
				switch ($(this).val()){
				case 'Computer':
				$(".computer").show();
				$(".home, .other").hide();
				break;
				case 'Other':
				$(".other").show();
				$(".home, .computer").hide();
				break;
				default:
				$(".home").show();
				$(".computer, .other").hide();}
				
			});
			
	// Office Map
	//----------------------------------------			
        $('.active_office').fadeIn();
        $('.office_link').live('click', function(event){
            event.preventDefault();
            $('.office_link_selected').removeClass('office_link_selected');
            $(this).addClass('office_link_selected');
            var container_id = $(this).attr('title');
            $('.active_office').animate({ 
                height : 'toggle' , opacity : 'toggle' 
            },function(){
                $(this).removeClass('active_office');
                $(container_id).addClass('active_office');
                $('.active_office').animate({
                    height : 'toggle' , opacity : 'toggle'
                });
            });
        });
        
	// Dealer Login
	//----------------------------------------
		 $.pop();
        
});