(function($){
    $('ul.sf-menu').superfish({
            autoArrows:  false,                           // disable generation of arrow mark-up
            dropShadows: false                            // disable drop shadows
        }); 
})(jQuery);

(function($){
    var maxHeight = 0;
$("#container").each(function(){
   if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});
$("#sidebar").height(maxHeight + 200);
})(jQuery);

(function($){
    var pageTitle = $('TITLE').html();
    $('#page-title').html(pageTitle);
})(jQuery);

(function($){
    $('#hide-form').click(function() {
        $('div.form-open').slideUp('slow').removeClass('form-open'),
                $('#checkout-login').slideDown('slow').addClass('cl-open');
        return false;
    });
})(jQuery);


(function($){
    $('#showform').click(function() {
        $('#checkout-intro').slideUp('slow').removeClass('form-open'),
                $('#form-hidden').slideDown('slow').addClass('cl-open');
        return false;
    });
})(jQuery);

(function($){
	$("ul.event-tabs").tabs("div.event-panes > div", {effect:'fade'});
	
})(jQuery);

/*(function($){
	//if ($('#cat-hidden:contains("Institute")').length > 0) {
		//$("#institue-event-form").removeClass("hide");
	//}
	if ($('#cat-hidden:contains("Director")').length > 0) {
		$("#directors-enrichment-form").removeClass("hide");
	}
})(jQuery);*/

(function($){
	if ($('#webappsearchresults7385').length > 0) {

		$("#chapter-results-heading").removeClass("hide");
	}
	
})(jQuery);

(function($){
	$("li.pmt-choice").click(function() {
	$("li.selected-li").removeClass("selected-li")
		 $(this).addClass("selected-li");
	});
	
})(jQuery);

(function($){
	
		$("#cc-select").click(function() {
		
			$("div.pmt-hidden").slideDown("slow").removeClass("pmt-hidden");
				});
	
		$("#bill-me-select").click(function() {
		$("#pmt-hide").slideUp("fast").addClass("pmt-hidden");
		
});
            		$("#gift-voucher-select").click(function() {
		$("#pmt-hide").slideUp("fast").addClass("pmt-hidden");
		
});
	
})(jQuery);

(function($){
	$("div#total-box input#Amount").focus(function() {
		$(this).blur();
	});
	
})(jQuery);
/*
(function($){
	$('body').html($('body').html().replace('No bookings found.','No events found.'));
	
})(jQuery);
*/


(function($){
	$('div.shop-catalogue h4').each(function() {
		var theTrigger = $(this);
		
		if($(theTrigger).attr('title').length == 0) {
			return null;
		}
		else {
			$(this).addClass('tt');
		};
  
  });
	
	
})(jQuery);
(function($){
	$(".tt").simpletooltip();
})(jQuery);

(function($){
	
		if ($('#page-title').text() == "Handbell Subscription" ) {
            $("#handbell-box").show(); 
        } else {
            $("#handbell-box").hide();  
        }
    
	
})(jQuery);

(function($){
	$("a.external").attr("target", "_blank");
})(jQuery);
/*(function($){
	$("#CAT_Custom_167608").htmlarea();
})(jQuery);*/
(function($){
	$("ul.zoneSubscriptions li:last").hide();
})(jQuery);

(function($){
	$("#ma-modal").click(function() {
		
		$("#overlay").slideDown("fast").addClass("overlaid"),
		$(".modal-wrap").slideDown("slow"),
		$("#modal-ajax").load("/member-modal.html");
		return false;
	});
	
	$("#close-me").click(function() {
		$(".modal-wrap").fadeOut("fast"),
		$("#overlay").fadeOut("fast").removeClass("overlaid");
		
	});
})(jQuery);
(function($){
    $("ul.chapter-members li").each(function () {
  if ($(this).attr('rel') == "")
    $(this).hide();
  else
    $(this).show();
});
})(jQuery);


