// javascript for arrowmont


// initialize jquery functions.
jQuery(document).ready(function($){

 // initialize drop-down menus.
 $('.dropdown').hover(
  function() {
   //$(this).find('ul').slideDown(100);
   $(this).find('ul').show();
  },
  function() {
   //$('.dropdown ul').slideUp(100);
   $('.dropdown ul').hide();
   //$('.dropdown ul').css("z-index", "50");
   $('.dropdown ul').css("z-index", "20");
   $('.menu-top').css("z-index", "30");
  });


 // initalize galleries
 if ($('.slides')) {
  $('.slides li').each(function(i){$(this).attr('id', 'slide' + ++i);});
  $('.thumbs li').each(function(i){$(this).attr('id', 'thumb' + ++i);});
  $('#thumb1').addClass('thumb-lit');
  $('#slide1').show();
  
  $('.thumbs li').mouseenter(function() {
   slideid = '#'+this.id.replace('thumb', 'slide');
   $('.thumb-lit').removeClass('thumb-lit');
   $(this).addClass('thumb-lit');
   $('.slides li:visible').hide();
   $(slideid).show();
  })
 }
 

 // if ie, replace spaces in captions with &nbsp; to avoid unnecessary line breaks.
 if ($.browser.msie) {
  $('.slides li p').each(function(){ $(this).html($(this).html().replace(/ /g,'&nbsp;')); }); //g means replace all, not just first.
 }


 // add 'pdf-link' class to PDF links
 $("a[href$='.pdf']").addClass('pdf-link');

});



// generates e-mail link, hides address from spammers; linktext is optional
// <script type="text/javascript">mailto('user','domain.com');</script>
function mailto(user,domain,linktext){
 address = user + '@' + domain;
 if (linktext == undefined) linktext = address;
 document.write('<a href="mailto:' + address + '">' + linktext + '</a>');
}

