$(document).ready(function() {
    

	// Setup Testimonial Toggling
	$('#testimonials div:not(:first)').hide();
	$('#testimonial-links a:first').addClass('active');
	
	$('#testimonial-links a').click(function(){
		$('#testimonial-links a').removeClass('active');
		$(this).addClass('active');
		$('#testimonials div').fadeOut('fast');
		var link = this.href;
		var id = link.substr(link.indexOf('#'), link.length);
		$(id).fadeIn('slow');
		return false;
	});
	
	// Open external links in new window
	$("a[@href^=http]").each(function() {
		if(this.href.indexOf(location.hostname.replace(/www./gi, "")) == -1) {
			$(this).click(function() { window.open(this.href, "_blank"); return false; });
		}
	});
	
	// Open print version of report in new window
	$("a#print-report").click(function(){
		var report = window.open(this.href, "_blank", "resizable=yes,scrollbars=yes,width=612").focus();
		return false;
	});
	
	// Checkbox fix for `none` addition
	$('.sform :checkbox').click(function(){
		if($(this).val() == 'None') {
			$(this).siblings().removeAttr('checked')
		} else {
			$(this).siblings('[@value="None"]').removeAttr('checked');
		}
	});


});
