// site wide crossway js
      $(document).ready(function() {
        $('.pagination a, .pagination span').corner("3px");
        $(".searchbx").clearDefault();        
        $('.browse-hd a:not(.open)').addClass('collapsed').parent().next().hide(); 
        $('.browse-hd a').click(function(){
          $(this).toggleClass('collapsed');
          $(this).parent().next().slideToggle("fast");
          return false;
        });
        $('#subjects>li>a').addClass('collapsed').next().hide(); 
        $('#subjects>li>a').click(function(){
          $(this).toggleClass('collapsed');
          $(this).next().slideToggle("fast");
          return false;          
        });
        $('a[rel="popup"]').click(function(){
          window.open($(this).attr('href'),'pop','width=600,height=500,scrollbars=1'); return false;
        });

        // Cookie for the alert div
        alert = true;
        if (alert) {
            now = new Date(); 
            starts = new Date("Feb 07 2012 08:00:00 -06:00"); expires = new Date("Feb 08 2012 08:00:00 -06:00");
            if (starts < now && now < expires){
               if(document.cookie.indexOf('alerts0206=off') == -1) {
                   $message = $('#alert-message').html('<a href="#">[x] close</a> <p>Due to maintenance, the site will be unavailable Wednesday, February 8th, between the hours of 7 AM and 8 AM.</p>');
                   $message.show().find('a').live('click', function(){
                       document.cookie = "alerts0206=off; expires='Wed, 08 Feb 2012 09:00:00 CST'; path=/;";
                       $(this).parent('div').slideUp('fast');
                       return false;
                   });
                }

/*
                if(document.cookie.indexOf('alerts1215=off') == -1) {
                    document.cookie = "alerts1215=on; expires='Wed, 28 Dec 2011 00:00:00 CST'; path=/;";
                }
                if(document.cookie.indexOf('alerts1215=on') != -1) {            
                    holiday = new Date("Dec 21 2011 13:00:00 -06:00"); 
                    nextday = new Date("Dec 20 2011 13:00:00 -06:00"); 
                    twoday = new Date("Dec 19 2011 13:00:00 -06:00"); 
                    if(now < holiday){
                        if(now < twoday){
                            shipby = "3rd";
                        } else if(now < nextday){
                            shipby = "2nd";                           
                        } else {
                            shipby = "Next";
                        }
                        $message = $('#alert-message').html('In order to guarantee that you will receive your order by Christmas, you must choose UPS '+shipby+' Day Air as your shipping option.');
                    } else {
                        $message = $('#alert-message').html('We will be closed for the Christmas Holiday from December 22nd through December 27th. All orders received from now until Dec. 27th  will be processed after we are back in the office.');
                    }
                    $message.show().find('a').live('click', function(){
                        document.cookie = "alerts1215=off; expires='Wed, 28 Dec 2011 00:00:00 CST'; path=/;";
                        $(this).parent('div').slideUp('fast');
                        return false;
                    });
                }
*/
            }
        } // end of alert

        $('.tip-link').click(function() {
          $(this).next('.tip').toggle('fast');
          return false;
        });
        $('.close-tip').click(function() {
          $(this).parent().hide('fast');
          return false;
        });
        $(".video-link, .modal").prettyPhoto();
      });

