$(document).ready(function() { var currentPage = window.location.pathname.substring(window.location.pathname.indexOf('/') + 1).split('/'); var subCurrentPage = currentPage [ 1 ]; currentPage = currentPage [ 0 ]; $('#nav ul li').removeClass('navSelected').addClass('navButton'); $('#' + currentPage).addClass('navSelected'); if($('#' + currentPage + 'SubnavDrop').length) { $('#' + currentPage + 'SubnavDrop').show(); } if($('#' + currentPage).length) { var parentItem = currentPage;/*$('#' + currentPage + '-link').parent().parent().attr('id').replace('-li','');*/ $('#' + parentItem).addClass('navSelected'); } else { var parentItem = ''; } $('#nav ul li').css({'cursor':'pointer'}).click(function() { if($(this).hasClass('menuOver') == false) { window.location.href = $(this).find('a:first').attr('href'); } }); $('.menuOver').mouseover(function() { var c = $(this).attr('id'); $('#'+c+'-li').show(); }); $('.menuOver').mouseout(function() { var c = $(this).attr('id').replace('-li',''); if(c == parentItem) { var n = 'navSelected'; } else { var n = 'navButton'; } $('#' + c).removeClass('navHover').addClass(n); $('#' + c + '-li').hide(); }); $('#rollDownMenu div').mouseover(function() { var c = $(this).attr('id').replace('-li',''); if(c == parentItem) { var n = 'navSelected'; } else { var n = 'navHover'; } $('#' + c).removeClass('navButton').removeClass('navSelected').addClass('navHover'); $(this).show(); }); $('#rollDownMenu div').mouseout(function() { var c = $(this).attr('id').replace('-li',''); if(c == parentItem) { var n = 'navSelected'; } else { var n = 'navButton'; } $(this).hide(); $('#' + c).removeClass('navButton').removeClass('navHover').addClass(n); }); if($('#' + currentPage + '_' + subCurrentPage).length) { $('#' + currentPage + '_' + subCurrentPage).addClass('selected'); } $('.targetPopup').click(function() { window.open($(this).attr('title'), '', "scrollbars=yes,resizable=yes,menubar=yes,status=yes,toolbar=yes,personalbar=yes,location=yes,hotkeys=yes,width=860,height=535"); }); $('.targetLink').click(function() { this.target='_blank'; }); if (!($('.midCooldeal').length)) { $('#cooldealTitle').hide(); } });