$(document).ready(function () { $("html").removeClass("no-js").addClass("js"); // Scripts for nav-subNavHeader $('.nav-subNavHeader ul li a').click( function () { $('.nav-subNavHeader ul li').attr('class', ''); $(this).parent().attr('class', 'actual'); return false; } ); // Nav $('.mod-nav a.sub').click(function () { var menuSub$ = $(".mod-nav .subMenuBox"); if (menuSub$.is(':hidden')) { menuSub$.show(); $(this).addClass("active"); } else { menuSub$.hide(); $(this).removeClass("active"); } }); $('body').click(function () { $(".mod-nav .subMenuBox").hide(); $(".mod-nav li a").removeClass("active"); }); $('.mod-nav .subMenu').click(function (event) { //mv: re-adding, updating selector to be more specific event.stopPropagation(); }); $(document).keypress(function (e) { if (e.keyCode == 27) { $(".mod-nav .subMenuBox").hide(); $(".mod-nav li a").removeClass("active"); } }); // Nav end $(".mod-signUp .cp-title span:first-child,.mod-genericAdvertStatic .cp-title span:first-child").addClass("first"); $(".mod-signUp .cp-title span:last-child,.mod-genericAdvertStatic .cp-title span:last-child,.ie7 .theme-SGP .mod-footerSponsors li:last-child").addClass("last"); //search drop down $(".nav-dropdown ol li ul").addClass("hidden"); $('.nav-dropdown-head').click(function () { var menuSub$ = $(this).parent().find("ul"); if (menuSub$.is(':hidden')) { menuSub$.show(); $(this).addClass("active"); } else { menuSub$.hide(); $(this).removeClass("active"); } }); $(document).keypress(function (e) { if (e.keyCode == 27) { $(".nav-dropdown ol li .active").removeClass("active"); $(".nav-dropdown ol li ul").removeClass("hidden").css("display", "none"); } }); $('body').click(function () { $(".nav-dropdown ol li .active").removeClass("active"); $(".nav-dropdown ol li ul").removeClass("hidden").css("display", "none"); }); $('.nav-dropdown-head').click(function (event) { event.stopPropagation(); }); //search drop down end // Selector buttons - RAG $(".team-selector li .btn").click(function (e) { e.preventDefault(); this.blur(); $(".team-selector li .btn").addClass("on").not(this).removeClass("on"); }); $(".team-selector-sus li .btn").click(function (e) { e.preventDefault(); this.blur(); $(".team-selector-sus li .btn").addClass("on").not(this).removeClass("on"); }); $(".player li .btn").click(function (e) { e.preventDefault(); this.blur(); $(".player li .btn").addClass("on").not(this).removeClass("on"); }); $(".team li .btn").click(function (e) { e.preventDefault(); this.blur(); $(".team li .btn").addClass("on").not(this).removeClass("on"); }); // Custom checkboxes $(".othernews-list li:nth-child(1),.othernews-list li:nth-child(2)").addClass("topItem"); $("#calendar-list li:nth-child(3)").addClass("lastItem"); //Custom checkboxes plugin /*-------------------------------------------------------------------- * Article: http://www.filamentgroup.com/lab/accessible_custom_designed_checkbox_radio_button_inputs_styled_css_jquery/ --------------------------------------------------------------------*/ jQuery.fn.customInput = function () { $(this).each(function (i) { if ($(this).is('[type=checkbox],[type=radio]')) { var input = $(this); var label = $('label[for=' + input.attr('id') + ']'); var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio'; $('
').insertBefore(input).append(input, label); var allInputs = $('input[name=' + input.attr('name') + ']'); label.hover( function () { $(this).addClass('hover'); if (inputType == 'checkbox' && input.is(':checked')) { $(this).addClass('checkedHover'); } }, function () { $(this).removeClass('hover checkedHover'); } ); input.bind('updateState', function () { if (input.is(':checked')) { if (input.is(':radio')) { allInputs.each(function () { $('label[for=' + $(this).attr('id') + ']').removeClass('checked'); }); } ; label.addClass('checked'); } else { label.removeClass('checked checkedHover checkedFocus'); } }) .trigger('updateState') .click(function () { $(this).trigger('updateState'); }) .focus(function () { label.addClass('focus'); if (inputType == 'checkbox' && input.is(':checked')) { $(this).addClass('checkedFocus'); } }) .blur(function () { label.removeClass('focus checkedFocus'); }); } }); }; //End //Tooltip $(".tooltip").on('click', function () { if ($(this).siblings().children().hasClass('tooltip-outer-active')) { $(".tooltip-outer").removeClass('tooltip-outer-active'); } else { $(".tooltip-outer").removeClass('tooltip-outer-active'); $(this).siblings().children().toggleClass('tooltip-outer-active'); } return false; }); $('.tooltip').each(function () { $(this).replaceWith("" + $(this).attr('title') + "" + "
" + $(this).attr('title') + "
"); }); // History page The Final area results toggle $('.cp-showHideBtn a').on("click", function () { console.log('line 181'); if ($(this).attr('class') == 'closed') { $('.hiddenCells').hide(); $('.hiddenCells').slideDown('slow'); $(this).attr('class', 'opened'); $(".mod-searchBarHistory-details").height("auto"); } else { $('.hiddenCells').slideUp('slow'); $(this).attr('class', 'closed'); $(".mod-searchBarHistory-details").height("183px"); } return false; }); $('.mod-footerSponsors li').last().addClass("last"); $('.theme-wf .mod-quickLinks-section').last().addClass("last"); $(".theme-wf #news-list-show li a").on({ mouseenter: function () { $(this).addClass("news-list-show-hover"); }, mouseleave: function () { $(this).removeClass("news-list-show-hover"); } }); $(".mod-quickLinks-section").hover( function () { $(this).addClass("mod-quickLinks-sectionHover"); $(".ie .mod-quickLinks-sectionHover h1").animate({ left: '10px' }, { queue: false, duration: 200 }); $(".ie .mod-quickLinks-sectionHover h2").animate({ left: '10px' }, { queue: false, duration: 300 }); $(".ie .mod-quickLinks-sectionHover p").animate({ left: '10px' }, { queue: false, duration: 400 }); }, function () { $(this).removeClass("mod-quickLinks-sectionHover"); $(".ie .mod-quickLinks-section h1").animate({ left: '0px' }, { queue: false, duration: 200 }); $(".ie .mod-quickLinks-section h2").animate({ left: '0px' }, { queue: false, duration: 300 }); $(".ie .mod-quickLinks-section p").animate({ left: '0px' }, { queue: false, duration: 400 }); } ); /* text truncation */ $.fn.truncateText = function (options) { var defaultVals = { maxLength: 500 }; return this.each(function () { truncateCopyText($(this), $.extend({}, defaultVals, options)); }); } function truncateCopyText($item, defaultVals) { if (defaultVals == null) { defaultVals = { maxLength: 1000 }; } return $item.each(function () { if ($(this).text().length > defaultVals.maxLength) { var cutText = $(this).text().substring(0, defaultVals.maxLength); $(this).text(cutText + "..."); } }); } $('.mod-hero #hero-slider ul.mod-sliderLinks li a strong').truncateText({ maxLength: 28 }); $('.mod-hero #hero-slider ul.mod-sliderLinks li a span').truncateText({ maxLength: 95 }); $('.mod-hero #hero-slider .slider-body ul li.panel .itemLink ul li a').truncateText({ maxLength: 240 }); //KEYBOARD FOR HERO //When key esc, tab, arrow, shift or spacebar is presses /* var keyPressed = ''; $(document).keydown(function (e) { code = e.keyCode ? e.keyCode : e.which; switch (code) { //case 9: keyPressed = 'tab'; //break; case 13: keyPressed = 'enter'; break; case 27: keyPressed = 'escape'; break; case 32: keyPressed = 'spacebar'; break; case 37: keyPressed = 'arrow left'; break; case 38: keyPressed = 'arrow up'; break; case 39: keyPressed = 'arrow right'; break; case 40: keyPressed = 'arrow down'; break; } if (keyPressed != '') { alert('You pressed ' + keyPressed + '!\n\nIf user clicks esc, tab, spacebar, shift or one of arrow keys, the keyboard-legend should be displayed. It should base on cookie, so it will appear for the first time only.'); keyPressed = ''; return false; } }); */ if ($('.mod-FaCup-results')) { expandedCells(); } // Hover effect for Club Wall video $(".mod-cw-videoContainer .playbtn").hover( function () { $(this).addClass("playbtn-hover"); }, function () { $(this).removeClass("playbtn-hover"); } ); // Nav TheFACup $(".mod-nav-theFaCup .sub,.mod-nav-theFaCup .sub ul").hide(); $('.t6 a').click(function () { var menuSub$ = $(".mod-nav-theFaCup .sub,.mod-nav-theFaCup .sub ul,.sub-ie7-shadow,.sub-ie8-shadow"); if (menuSub$.is(':hidden')) { menuSub$.show(); $(this).addClass("active-FaCup"); } else { menuSub$.hide(); $(this).removeClass("active-FaCup"); } }); $('body,.mod-nav-theFaCup .sub ul li a').click(function () { $(".mod-nav-theFaCup .sub,.sub-ie7-shadow,.sub-ie8-shadow").hide(); $(".mod-nav-theFaCup li.t6 a").removeClass("active-FaCup"); }); $('.mod-nav-theFaCup').click(function (event) { event.stopPropagation(); }); // FaCup Navigation, adds wrapper for IE7,IE8 subnavigation, for getting drop shadow affect. if (typeof $.browser != 'undefined') { if ($.browser.msie && parseInt($.browser.version) == 8) { $('.mod-nav-theFaCup .sub').wrap('
'); } else if ($.browser.msie && parseInt($.browser.version) == 7) { $('.mod-nav-theFaCup .sub').wrap('
'); } } $(document).keypress(function (e) { if (e.keyCode == 27) { $(".mod-nav-theFaCup .sub").hide(); $(".mod-nav-theFaCup li a").removeClass("active-FaCup"); } }); $(".mod-quickLinks-hgroup section:last-child").addClass("lastSection"); $('span.nav-right').each(function () { var buttonWidth = $(this).width(); $(this).parent().siblings().width(buttonWidth + 15); }); if (typeof $.browser != 'undefined') { if ($.browser.msie && parseInt($.browser.version) == 7) { var buttonWidth = $(".ie7 .nav-right").outerWidth(); var buttonHeight = $(".ie7 .nav-right").outerHeight(); $('.ie7 .nav-right').wrap('').after(''); $(".ie7 .ieshadow").width(buttonWidth); $(".ie7 .ieshadow").height(buttonHeight); } else if ($.browser.msie && parseInt($.browser.version) == 8) { var buttonWidth = $(".ie8 .nav-right").outerWidth(); var buttonHeight = $(".ie8 .nav-right").outerHeight(); $('.ie8 .nav-right').wrap('').after(''); $(".ie8 .ieshadow").width(buttonWidth); $(".ie8 .ieshadow").height(buttonHeight); } } $('.mod-nav-theFaCup .t6 .sub').each(function () { var buttonWidth = $(this).width(); //Getting button width sublevel container when adds width value to .t6 list item $(".mod-nav-theFaCup .t6").width(buttonWidth); }); $('.mod-nav-theFaCup ul li').last().addClass('lastItem'); $('.mod-nav-theFaCup ul ul li:last').addClass('lastItem'); // Nav TheFACup end // Nav My Football $('.ie7 .mod-nav-main .sub,.ie7 .twinBlock').wrapInner(''); $('.ie7 .mod-nav-main .sub .sub-ie7-container ul,.ie7 .twinBlockOuter .sub-ie7-container').after(''); $('.ie8 .mod-nav-main .sub,.ie8 .twinBlock').wrapInner(''); $('.ie8 .mod-nav-main .sub .sub-ie8-container ul,.ie8 .twinBlockOuter .sub-ie8-container').after(''); $('.ie7 .mod-nav-main .dropdown .sub,.ie8 .mod-nav-main .dropdown .sub').each(function () { var subWidth = $(this).outerWidth() + 1; var subHeight = $(this).outerHeight() + 1; $(this).children().children(":nth-child(2n)").width(subWidth).height(subHeight); }); $(".ie7 .twinBlock .article,.ie8 .twinBlock .article,.ie9 .twinBlock .article").hover( function () { $(this).find("hgroup").stop().animate({ bottom: '0px' }, "fast"); }, function () { $(this).find("hgroup").stop().animate({ bottom: '-33px' }, "fast"); } ); $('.mod-nav-main li:last-child').addClass('last-dropdown'); $('.mod-nav-main ul li:last').addClass('lastItem'); // Nav Rules and Governance $('.theme-gov ul.gov-analysis-list li:nth-child(4n)').addClass('lastInRow lastItem'); $('.mod-fwg-canvas li:nth-child(4n)').addClass('lastInRow lastItem'); $(".mod-roa-title a").click(function () { $(this).parent().parent().toggleClass("mod-roa-holder-expanded"); //$(this).parent().siblings().show(); }); $(".theme-gov .mod-singleBoxTitleLink").mouseover(function () { $(this).addClass("mod-singleBoxTitleLink-hover"); }); $(".theme-gov .mod-singleBoxTitleLink").mouseout(function () { $(this).removeClass("mod-singleBoxTitleLink-hover"); }); $(".theme-gov .mod-singleBoxTitleLink").click(function () { window.location = $(this).find("a").attr("href"); return false; }); // ad box links $(".ad-box .fomb").mouseover(function () { $(this).closest('.ad-box').addClass("mod-singleBoxTitleLink-hover"); }); $(".ad-box .fomb").mouseout(function () { $(this).closest('.ad-box').removeClass("mod-singleBoxTitleLink-hover"); }); $(".ad-box .fomb").click(function () { window.location = $(this).find("a").attr("href"); return false; }); //ENGLAND // Nav England Microsite $(".mod-nav-england .sub,.mod-nav-england .sub ul").hide(); $('.mod-nav-england .t1 a').click(function () { var menuSub$ = $(".mod-nav-england .sub,.mod-nav-england .sub ul,.sub-ie7-shadow,.sub-ie8-shadow"); if (menuSub$.is(':hidden')) { menuSub$.show(); $(this).addClass("active-england"); } else { menuSub$.hide(); $(this).removeClass("active-england"); } }); $('body, .mod-nav-england .sub ul li a').click(function () { $(".mod-nav-england .sub,.sub-ie7-shadow, .sub-ie8-shadow").hide(); $(".mod-nav-england li.t1 a").removeClass("active-england"); }); $('.mod-nav-england').click(function (event) { event.stopPropagation(); }); //ENGLAND END $('.mod-FaCup-history .mod-gTableRound .gTable-data').each(function (i, el) { //el.id = ("gTable0") + i; //This might be used if require to show last two round results // FACup-History.aspx //console.log("added auto increment value to gTable ID +1") }); $('.mod-FaCup-history .mod-gTableRound .gTable-data').hide(); function gTableToggle(el) { if ($(el).closest('.mod-gTableRound').find('.gTable-data').css('display') == 'none') { $(el).parent().parent().parent().addClass("gTableActive"); $(el).closest('.mod-gTableRound').children('.gTable-data').delay('300').slideDown('300'); $('.gTable-data').not(el).hide(); $('.mod-gTableRound h4 a, .mod-gTableRound h5 a').removeClass('toggleShowHide'); $(el).find("h5 a, h4 a").addClass('toggleShowHide'); console.log("toggle clicked first time") } else { $('.mod-gTableRound h4 a,.mod-gTableRound h5 a').removeClass('toggleShowHide'); $(el).parent().parent().parent().removeClass("gTableActive"); $(el).closest('.mod-gTableRound').children('.gTable-data').delay('300').slideUp('300'); console.log("toggle clicked second time") } } $(".mod-FaCup-history .gTable-title").bind('click', function () { gTableToggle(this); return false; } ); /* $(".mod-FaCup-history .gTable-title").toggle( function () { $(this).parent().parent().parent().addClass("gTableActive"); $(this).closest('.mod-gTableRound').children('.gTable-data').delay('300').slideDown('300'); $('.gTable-data').not(this).hide(); $('.mod-gTableRound h4 a, .mod-gTableRound h5 a').removeClass('toggleShowHide'); $(this).find("h5 a, h4 a").addClass('toggleShowHide'); console.log("toggle clicked first time") }, function () { $('.mod-gTableRound h4 a').removeClass('toggleShowHide'); $(this).parent().parent().parent().removeClass("gTableActive"); $(this).closest('.mod-gTableRound').children('.gTable-data').delay('300').slideUp('300'); console.log("toggle clicked first time") }); */ // Seach button and dropdown dynamic width // Button's IE7 and IE8 // FaCup Navigation, adds wrapper for IE7,IE8 subnavigation, for getting drop shadow affect. if (typeof $.browser != 'undefined') { if ($.browser.msie && parseInt($.browser.version) == 8) { $('.ie8 .btn').not(".ie8 .theme-gov .btn, .ie8 .nonRegistered a.btn").wrap(''); $('.ie8 .btn').not(".ie8 .theme-gov .btn, .ie8 .nonRegistered a.btn").before(''); } else if ($.browser.msie && parseInt($.browser.version) == 7) { $('.ie7 .btn').not(".ie7 .theme-gov .btn, .ie7 .nonRegistered a.btn").wrap(''); $('.ie7 .btn').not(".ie7 .theme-gov .btn, .ie7 .nonRegistered a.btn").before(''); $('.ie7 .btn').each(function () { var buttonWidth = $(this).outerWidth(); //Getting button width $(this).not(".ie7 .theme-gov .btn").parent().width(buttonWidth + 3); //alert(buttonWidth); }); } } $(".mod-sitesLink li:nth-child(2)").addClass("lastItem"); //SORTING DROPDOWN EFFECT $('.nav-dropdown ul li a').click( function () { $('.nav-dropdown ul li a').removeAttr('class'); $(this).attr('class', 'active'); $('.nav-dropdown-head span').text($(this).text()); } ); //IE 7 fix for news thumbs to be clickable $('.ie7 .mod-newsList.searchResults a').on('click', function () { window.location = $(this).attr('href'); }); $('.ie7 .mod-newsList.searchResults a').on('hover', function () { $(this).css('cursor', 'pointer'); }); //TWITTER REMOVING LAST ITEM BORDER //$(".twtr-tweets .twtr-tweet:last-child").addClass("twtr-tweet-last"); if (typeof $.browser != 'undefined') { if ($.browser.msie && $.browser.version == 7) { $('.mod-footerBottomContainer dl').css('width', (parseInt($('.mod-footerSponsors').css('width')) + 45) + 'px'); } } //In the sporlight $('ul.mod-inTheSpotlight li:nth-child(4n)').addClass('lastItem'); $("ul.mod-inTheSpotlight li a").hover( function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); } ); //Article style table that are cordcoded $(".mod-article table tr:odd").addClass("odd"); $("#suspensions-list-hide li:odd").addClass("odd"); $("#suspensions-list-hide li:even").addClass("even"); //WF - tabs $(".mod-resultsTabs a").click(function (e) { e.preventDefault(); $(this).addClass("current").siblings().removeClass("current"); }); $(".form-error").mouseover(function () { $(this).fadeOut("slow"); }); $('.input-text').focus(function () { $(this).siblings(".form-error").fadeOut("slow"); }); $(".mod-partners").hover( function () { $(this).addClass("mod-partners-hover"); $(".mod-partners-hover .jcarousel-prev,.mod-partners-hover .jcarousel-prev span,.mod-partners-hover .jcarousel-next,.mod-partners-hover .jcarousel-next span").css({ opacity: 0.0 }).stop().animate({ opacity: 1.0 }, "slow"); }, function () { $(this).removeClass("mod-partners-hover"); $(".mod-partners .jcarousel-prev,.mod-partners .jcarousel-prev span,.mod-partners .jcarousel-next,.mod-partners .jcarousel-next span").css({ opacity: 1.0, visibility: "visible" }).stop().animate({ opacity: 0.0 }, "slow"); }); $('.mod-partners *').focus(function () { $(".mod-partners").addClass("mod-partners-hover"); }); $(".mod-singleColumnRotator").hover( function () { $(this).addClass("mod-singleColumnRotator-hover"); $(".mod-singleColumnRotator-hover .jcarousel-prev,.mod-singleColumnRotator-hover .jcarousel-prev span,.mod-singleColumnRotator-hover .jcarousel-next, .mod-singleColumnRotator-hover .jcarousel-next span").css({ opacity: 0.0 }).stop().animate({ opacity: 1.0 }, "slow"); }, function () { $(this).removeClass("mod-singleColumnRotator-hover"); $(".mod-singleColumnRotator .jcarousel-prev,.mod-singleColumnRotator .jcarousel-prev span,.mod-singleColumnRotator .jcarousel-next,.mod-singleColumnRotator .jcarousel-next span").css({ opacity: 1.0, visibility: "visible" }).stop().animate({ opacity: 0.0 }, "slow"); }); $(".toggle-content").hide(); $(".toggle-header").on('click', function () { var faqContent = $(this).siblings(".toggle-content"); //console.log(faqContent); if (faqContent.is(':hidden')) { faqContent.show(); $(this).addClass("toggle-header-show"); } else { faqContent.hide(); $(this).removeClass("toggle-header-show"); } }); //SGP $("body.theme-SGP").parent().addClass("SGP"); $(".mod-fwg-canvas").hover( function () { $(this).addClass("mod-fwg-canvas-hover"); $(".mod-fwg-canvas .jcarousel-prev,.mod-fwg-canvas .jcarousel-next").css("opacity", "1"); }, function () { $(this).removeClass("mod-fwg-canvas-hover"); $(".mod-fwg-canvas .jcarousel-prev,.mod-fwg-canvas .jcarousel-next").css("opacity", "0"); }); //mod-coachingPatchway $('.theme-MF .mod-coachingPatchway ul li.dropdown > a').hover(function () { $(this).toggleClass('active'); }); $('ul.nav li .sub ul li').hover(function () { $(this).parents('.dropdown').find('a').toggleClass('active'); }); $('ul.nav li.t4 div.sub ul li ul.sub2 li').hover(function () { $(this).parents('.dropdown').find('a').toggleClass('active'); }); $('.ie7 .mod-coachingPatchway ul.diagram li.box, .ie8 .mod-coachingPatchway ul.diagram li.box').each(function () { var tempTop = $(this).css('top'); var tempLeft = $(this).css('left'); $(this).hover( function () { var tempTop2 = tempTop.substr(0, (tempTop.length - 2)); tempTop2 = tempTop2 - 19; $(this).css('top', tempTop2 + 'px'); var tempLeft2 = tempLeft.substr(0, (tempLeft.length - 2)); tempLeft2 = tempLeft2 - 9; $(this).css('left', tempLeft2 + 'px'); }, function () { $(this).css('top', tempTop); $(this).css('left', tempLeft); }); }); $('.theme-MF .mod-coachingPatchway .nav > li > a').hover(function (e){ e.preventDefault(); $('.theme-MF .mod-coachingPatchway .nav > li > a').each(function (e) { if ($(this).hasClass('hover')) { $(this).removeClass('hover'); } }); $(this).addClass('hover'); }, function () { $(this).removeClass('hover'); }); $('.theme-MF .mod-coachingPatchway .nav > li a').click(function (e) { e.preventDefault(); var tempClass = $(this).attr('class'); var tempStr = tempClass.split(' '); for (var i in tempStr) { var tempMatch = tempStr[i].match(/diagram-/); if (tempMatch != null) { $('.theme-MF .mod-coachingPatchway .nav > li > a').each(function () { if ($(this).hasClass('active-tab')) { $(this).removeClass('active-tab'); } }); $('.mod-coachingPatchway .inner-container').each(function () { if (!$(this).hasClass(tempStr[i])) { $(this).css('display', 'none'); } }); $('.mod-coachingPatchway .inner-container.' + tempStr[i]).css('display', 'block'); } } $(this).addClass('active-tab'); }); if (typeof $.browser != 'undefined') { if ($.browser.msie && $.browser.version == 7) { $(".theme-MF .mod-coachingPatchway .diagram .box a > span").wrap(""); $(".theme-MF .mod-coachingPatchway .diagram .box a").wrapInner("
"); } } }); // RESULTS TABLE - EXPANDED CELLS function expandedCells() { $('.mod-FaCup-results .gTable tr td.last a').click( function() { $('.mod-searchBarHistory-detailsBg .cp-showHideBtn a').attr('class', 'closed') var cell = ''; var new_position = ''; var tr = $(this).parent().parent(); var tbody = $(tr).parent(); if ($(tr).attr('class') != 'marked') { var trClass = $(tr).attr('class'); $(tbody).attr('class', trClass); } else { var trClass = $(tbody).attr('class'); } console.log('line 730'); if ($(this).attr('class') == 'closed') { $('.hiddenCells').hide(); $('.mod-FaCup-results .gTable tr.marked').attr('class', trClass); $(tr).attr('class', 'marked'); $('.mod-FaCup-results .gTable tr td.last a').attr('class', 'closed'); $(this).closest('section').find('.hiddenCells').slideDown('slow'); $(this).attr('class', 'opened'); $(this).closest('tr').find('td.cSix a.tooltip').css('background-position', '-34px 0'); new_position = $(this).offset(); } else { $(tr).attr('class', trClass); $(this).parent().parent().parent().parent().parent().find('.hiddenCells').slideUp('slow'); $(this).attr('class', 'closed'); new_position = $(this).offset(); $(this).closest('tr').find('td.cSix a.tooltip').removeAttr('style'); } //window.scrollTo(new_position.left, new_position.top - 50); return false; }); }