$(document).ready(function() { var $home_clients_link_hover = $('#contentdiv span.homepartnerslinkhover'); var $home_clients_link_out   = $('#contentdiv span.homepartnerslinkout'); var duration = 300; if ($.browser.msie) { $home_clients_link_hover.hide(); $("#contentdiv a.homepartnerslink").hover( function() { $home_clients_link_hover.show(); }, function() { $home_clients_link_hover.hide(); } ); } else { $home_clients_link_hover.css({'display' : 'block', 'opacity' : 0 }); $("#contentdiv a.homepartnerslink").hover( function () { if ( $home_clients_link_hover.data('currently') == 'showing' || $home_clients_link_out.data('currently') == 'showing') { return; } $home_clients_link_hover.data('currently', 'showing'); $home_clients_link_out.data('currently', 'showing'); $home_clients_link_out .stop() .fadeTo(duration, 0.4, function() { $home_clients_link_out.data('currently', ''); }); $home_clients_link_hover .stop() .fadeTo(duration, 1, function() { $home_clients_link_hover.data('currently', ''); }) ; }, function () { if ( $home_clients_link_out.data('currently') != 'showing' ) { $home_clients_link_out.stop(); } if ( $home_clients_link_hover.data('currently') != 'showing' ) { $home_clients_link_hover.stop(); } $home_clients_link_out.fadeTo(duration, 1); $home_clients_link_hover.fadeTo(duration, 0); } ); } $('.haspopup').each(function () { var distance = -10; var time = 250; var hideDelay = 100; var hideDelayTimer = null; var beingShown = false; var shown = false; var trigger = $('.trigger', this); var popup = $('.popup', this).css('opacity', 0); $([trigger.get(0), popup.get(0)]).mouseover(function () { if (hideDelayTimer) clearTimeout(hideDelayTimer); if (beingShown || shown) { return; } else { beingShown = true; popup.css({ position: 'absolute', display: 'block'  }) .animate({ top: '-=' + distance + 'px', opacity: 1 }, time, 'swing', function() { beingShown = false; shown = true; }); } }).mouseout(function () { if (hideDelayTimer) clearTimeout(hideDelayTimer); hideDelayTimer = setTimeout(function () { hideDelayTimer = null; popup.animate({ top: '+=' + distance + 'px', opacity: 0 }, time, 'swing', function () { shown = false; popup.css({'display' : 'none', 'top' : 215 }); }); }, hideDelay); }); }); }); 
