	$(document).ready(function() {
		$("div#logoParade").smoothDivScroll({autoScroll: "always", autoScrollDirection: "endlessloopright", autoScrollStep: 1, autoScrollInterval: 15});
		
			// Logo parade
			$("div#logoParade").bind("mouseover", function() {
				$(this).smoothDivScroll("stopAutoScroll");
			}).bind("mouseout", function() {
				$(this).smoothDivScroll("startAutoScroll");
			});
		
		
		$('.faq-answer-seeker').hide();
		$('.faq-answer-poster').hide();
		
		$('#sq1').click(function() {
			$('#seeker1').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#sq2').click(function() {
			$('#seeker2').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#sq3').click(function() {
			$('#seeker3').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#sq4').click(function() {
			$('#seeker4').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq1').click(function() {
			$('#poster1').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		})
		$('#pq2').click(function() {
			$('#poster2').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq3').click(function() {
			$('#poster3').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq4').click(function() {
			$('#poster4').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq5').click(function() {
			$('#poster5').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq6').click(function() {
			$('#poster6').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq7').click(function() {
			$('#poster7').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq8').click(function() {
			$('#poster8').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq9').click(function() {
			$('#poster9').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq10').click(function() {
			$('#poster10').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		$('#pq11').click(function() {
			$('#poster11').animate({"height": "toggle"}, { duration: 50 });
			if ($(this).hasClass('off')) {
				$(this).removeClass('off').addClass('on');
			} else if ($(this).hasClass('on')) {
				$(this).removeClass('on').addClass('off');
			} else {
				$(this).addClass('off');
			}
		});
		
if($.cookie("njbpopup") != 'true')
{
     // on page load show the modal box
    // more info about the options you can find on the fancybox site
    $("#opening").fancybox({
            'width'             : 550,
            'height'            : 660,
			'autoDimensions'    : false,
			'autoScale'			: false,
            'transitionIn'      : 'elastic',
            'transitionOut'     : 'elastic',
            'centerOnScroll'    : false,
            'overlayOpacity'    : 0.7,
            'overlayColor'      : '#000',
            'modal'             : true,
			'showCloseButton'   : true,
			'padding'       : 10
        });

    // in the message is a link with the id "modal_close"
    // when you click on that link the modal will close and the cookie is set to "true"
    // path "/" means it's active for the entire root site.. if you set it to "/admin" will be active on the "admin" folder
    // expires in 7 days
    // "modal" is the name i gave the cookie, you can name it anything you want
   $('#fancybox-close').live('click', function(e) {
           $.cookie("njbpopup", "true", { path: '/', expires: 7 });    
           $.fancybox.close()
       });
	 $('#modal_close').live('click', function(e) {
           $.cookie("njbpopup", "true", { path: '/', expires: 7 });    
           $.fancybox.close()
       }); 
 }    
	
	 $.tablesorter.defaults.sortList = [[0,1]]; 
	 
	 $("#browse").tablesorter({
	 	headers: { 
	 		0: { sorter: "usLongDate" },
	 		4: { sorter: false },
	 		5: { sorter: "usLongDate" }
	 	} 
	 
	 });
	
	
		});
		
function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  
window.onload = externalLinks;

