//global

$(document).ready(function() {
   
$("#sf-nav > li:last").css("border-right", "1px solid #002954")

$("#sf-nav > li:first").css("border-left", "1px none #002954")

$(".clear-both + h1").css("margin-top", "1em")

$("p + h2, p + h3, ul + h2").css("margin-top", "1em")


$(".external").append( " ", "<img src='Styles/g/icons/external.png' border='0'  title='' alt='' class='' />");






 $("#show-enewsletter").click(function () {
      $("#reveal-enewsletter").slideToggle();
return false;
    });







 $("#show-search").click(function () {
      $("#reveal-search").slideToggle();
return false;
    });




 $("#show-donation").click(function () {
      $("#reveal-donation").slideToggle();
return false;
    });



// this will hide and expand any container that follows something with class unhide

 $('.unhide').next().addClass('hide');    
  $('.unhide').click(function() {
   $(this).next().toggle('slow');  
   return false;
  }); 
       













$('#main-column>.story-wrap>ul>li>a[href$=".pdf"]').append( " ", "<img src='http://www.penobscotmarinemuseum.org/Styles/g/icons/Acrobat_icon.jpg' border='0'  title='' alt='' class='' />");

$('#main-column>.story-wrap>p>a[href$=".pdf"]').append( " ", "<img src='http://www.penobscotmarinemuseum.org/Styles/g/icons/Acrobat_icon.jpg' border='0'  title='' alt='' class='' />");

$('#main-column>.story-wrap>ul>li>ul>li>ul>li>a[href$=".pdf"]').append( " ", "<img src='http://www.penobscotmarinemuseum.org/Styles/g/icons/Acrobat_icon.jpg' border='0'  title='' alt='' class='' />");

$('.col3-set>.story-wrap>p>a[href$=".pdf"]').append( " ", "<img src='http://www.penobscotmarinemuseum.org/Styles/g/icons/Acrobat_icon.jpg' border='0'  title='' alt='' class='' />");





// use this to obfuscate email

$('a.email').each(function(){
			e = this.rel.replace('/','@');
                         theText = "Email"
			this.href = 'mailto:' + e;
		});
});




// this is for our suckerfish menu
  
function mainmenu(){
$(" #sf-nav ul ").css({display: "none"}); // Opera Fix
$(" #sf-nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 $(document).ready(function(){
	mainmenu();
});






// this is for our rollover function
 $(document).ready(function(){
var button = $('.rollover').find('img');
  $('.rollover').find('p').hide();

  $(button).mouseover(function(){
    	$(this).parent().next('p').show();
 }).mouseout(function(){
     $(this).parent().next('p').hide();
                	});

});


