(function($){ $(document).ready(function(){ /*-----------------------------------------------------------------------------------*/ /* Notification Bar /*-----------------------------------------------------------------------------------*/ $("#notifications-exit").click(function() { $("#notifications-open").slideDown('fast'); $("#notifications").slideUp('fast'); $.cookie('notificationCookie', 'hidden', { expires: 1, path: '/' }); return false; }); $("#notifications-open").click(function() { $("#notifications-open").hide(); $("#notifications").slideDown('fast'); $.cookie('notificationCookie', 'visible', { expires: 1, path: '/' }); return false; }); var notificationVisibility = $.cookie('notificationCookie'); if(notificationVisibility == 'hidden' || notificationVisibility == null) { $("#notifications").hide(); }; if(notificationVisibility == 'visible') { $("#notifications-open").hide(); $("#notifications").show(); }; /*-----------------------------------------------------------------------------------*/ /* Searching Bar /*-----------------------------------------------------------------------------------*/ $("#searching-exit").click(function() { $("#searching-open").slideDown('fast'); $("#searching").slideUp('fast'); $.cookie('searchingCookie', 'hidden', { expires: 1, path: '/' }); return false; }); $("#searching-open").click(function() { $("#searching-open").hide(); $("#searching").slideDown('fast'); $.cookie('searchingCookie', 'visible', { expires: 1, path: '/' }); return false; }); var searchingVisibility = $.cookie('searchingCookie'); if(searchingVisibility == 'hidden') { $("#searching").hide(); }; if(searchingVisibility == 'visible' || searchingVisibility == null) { $("#searching-open").hide(); $("#searching").show(); }; /*-------------------------------------------------------------------------------*/ /* Quickmenu Scrolling /*-----------------------------------------------------------------------------------*/ $().ready(function() { var $scrollingDiv = $("#quickMenu"); $(window).scroll(function(){ $scrollingDiv .stop() .animate({"marginTop": ($(window).scrollTop() + 0) + "px"}, "normal" ); }); }); /*-----------------------------------------------------------------------------------*/ /* Category Drop-Down /*-----------------------------------------------------------------------------------*/ $("#cat-drop").hover(function(e){ if ($("#cat-drop ul").is(":hidden")) { $("#cat-drop .all").removeClass('inactive').addClass('active'); $("#cat-drop ul").slideDown(500); } else { $("#cat-drop ul").slideUp(500, function() { $("#cat-drop .all").removeClass('active').addClass('inactive'); }); } return false; }); //Table Odd/Even styles $("table:not(.simple) tr:nth-child(odd)").addClass("odd"); // Table Odd/Even $("table:not(.simple) tr:nth-child(even)").addClass("even"); // Table Odd/Even //jQuery UI Datepicker $( ".datepicker" ).datepicker(); // iOS checkbox $('.ioscheckbox').iphoneStyle({ checkedLabel: 'On', uncheckedLabel: 'Off' }); //tipsy $('.tooltip').tipsy({fade: true, gravity: 's'}); /* nav bars */ $('nav.site-desktop-menu > ul > li').hover(function() { $(this).find('> ul').stop(true, true).slideDown(200); }, function() { $(this).find('> ul').stop(true, true).slideUp(200); }); $('nav.site-desktop-menu > ul li a').hover(function() { $(this).parent().addClass('hovered'); }, function() { $(this).parent().removeClass('hovered'); }); ////////////////////////////////////////////////////////////////////////////////////////////////////////////// }); })(window.jQuery); /* * Tipsy */ (function($) { $.fn.tipsy = function(options) { options = $.extend({}, $.fn.tipsy.defaults, options); return this.each(function() { var opts = $.fn.tipsy.elementOptions(this, options); $(this).hover(function() { $.data(this, 'cancel.tipsy', true); var tip = $.data(this, 'active.tipsy'); if (!tip) { tip = $('