$(document).ready(function () {

		
	$("#general_searchform label").inFieldLabels();
	
	$("#general_searchform input").attr("autocomplete","off");

    // navigation fix						
    $('#nav ul ul').hover(

    function () {
        $(this).prev().addClass('nav_fix');
    },

    function () {
        $(this).prev().removeClass('nav_fix');
    });

	
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.simple_tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.simple_tabs li").click(function() {
		$("ul.simple_tabs 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 href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

	
	/* sharing */
	$('a.share').click(function() {
		if( $(this).parent().hasClass("share_active") ){
			$(this).parent().removeClass("share_active")
		}else{
			$(this).parent().addClass("share_active");
		}

	  $(this).parent().parent().parent().find(".share_container").toggle();

	  
	  return false;
	});
	
    $('a.new-window').click(function(){
        window.open(this.href);
        return false;
    });
	
	$(".popup").popupWindow({ 
		height:340, 
		width:510, 
		centerScreen:1 
	});


});
