', { text: 'Год' })) .append($(' | ', { text: 'Место проведения' })) .append($(' | ', { text: 'Занятое место', 'class': 'centered' })) .append($(' | ', { text: 'Дисциплина' })) ) ) .append( $(' | |||||
---|---|---|---|---|---|---|---|---|
', { text: m.Year })) .append($(' | ', { text: m.Place ? m.Place : '' })) .append( $(' | ', { 'class': 'centered' }) .append($('', { 'class': 'medal ' + this.MedalType[m.Type], html: (m.Type + 1) })) ) .append($(' | ', { text: m.Discipline })) ) ) ); $('.popup-content.atlet-content #boxmedals').append(div); nontopborder = true; } else $('#tablemedalsid_' + m.EventId + ' tbody').append( $(' | |||||
', { text: m.Year })) .append($(' | ', { text: m.Place ? m.Place : '' })) .append( $(' | ', { 'class': 'centered' }) .append($('', { 'class': 'medal ' + this.MedalType[m.Type], html: (m.Type + 1) })) ) .append($(' |
', { text: m.Discipline })) ) eventid = m.EventId; } $('.popup-content.atlet-content .medals .gold').text(gold); $('.popup-content.atlet-content .medals .silver').text(silver); $('.popup-content.atlet-content .medals .bronze').text(bronze); $('.popup-content.atlet-content .medals .total').text(p.MedalsForAjaxList.length); if (p.MedalsForAjaxList.length == 0) { $('.atlet-popup .popup-content.atlet-content .medals').hide(); $('.popup-content.atlet-content #boxmedals').hide(); } else { $('.atlet-popup .popup-content.atlet-content .medals').show(); $('.popup-content.atlet-content #boxmedals').show(); } if (p.PIY > 0 && p.PIYP > 0) { $('.atlet-popup .popup-content.atlet-content .links.rating.popularity').show(); if (p.PIWP > 0 && p.PIW > 0) $('.atlet-popup .popup-content.atlet-content .links.rating.popularity a#popularity-index-w span.v').html((p.PIWP > 0 ? p.PIWP : ' —') + ' место (' + (p.PIW > 0 ? p.PIW : ' —') + ' ' + this.GetWordForViews(p.PIW) + ')'); else $('.atlet-popup .popup-content.atlet-content .links.rating.popularity a#popularity-index-w span.v').html('отсутствует'); if (p.PIMP > 0 && p.PIM > 0) $('.atlet-popup .popup-content.atlet-content .links.rating.popularity a#popularity-index-m span.v').html((p.PIMP > 0 ? p.PIMP : ' —') + ' место (' + (p.PIM > 0 ? p.PIM : ' —') + ' ' + this.GetWordForViews(p.PIM) + ')'); else $('.atlet-popup .popup-content.atlet-content .links.rating.popularity a#popularity-index-m span.v').html('отсутствует'); $('.atlet-popup .popup-content.atlet-content .links.rating.popularity a#popularity-index-y span.v').html((p.PIYP > 0 ? p.PIYP : ' —') + ' место (' + (p.PIY > 0 ? p.PIY : ' —') + ' ' + this.GetWordForViews(p.PIY) + ')'); } else $('.atlet-popup .popup-content.atlet-content .links.rating.popularity').hide(); if (p.CIY > 0 && p.CIYP > 0) { $('.atlet-popup .popup-content.atlet-content .links.rating.citation').show(); if (p.CIWP > 0 && p.CIW > 0) $('.atlet-popup .popup-content.atlet-content .links.rating.citation a#citation-index-w span.v').html((p.CIWP > 0 ? p.CIWP : ' —') + ' место (' + (p.CIW > 0 ? p.CIW : ' —') + ' ' + this.GetWordForReferences(p.CIW) + ')'); else $('.atlet-popup .popup-content.atlet-content .links.rating.citation a#citation-index-w span.v').html('отсутствует'); if (p.CIMP > 0 && p.CIM > 0) $('.atlet-popup .popup-content.atlet-content .links.rating.citation a#citation-index-m span.v').html((p.CIMP > 0 ? p.CIMP : ' —') + ' место (' + (p.CIM > 0 ? p.CIM : ' —') + ' ' + this.GetWordForReferences(p.CIM) + ')'); else $('.atlet-popup .popup-content.atlet-content .links.rating.citation a#citation-index-m span.v').html('отсутствует'); $('.atlet-popup .popup-content.atlet-content .links.rating.citation a#citation-index-y span.v').html((p.CIYP > 0 ? p.CIYP : ' —') + ' место (' + (p.CIY > 0 ? p.CIY : ' —') + ' ' + this.GetWordForReferences(p.CIY) + ')'); } else $('.atlet-popup .popup-content.atlet-content .links.rating.citation').hide(); if (p.PStId > 0 && p.NumberOfNews > 0) { $('.atlet-popup .popup-content.atlet-content .links.news').show(); $('.atlet-popup .popup-content.atlet-content .links.news a').attr('href', '/person?fio=' + p.LName + ' ' + p.FName + '&Id=' + p.Id + '&type=NewsOfPerson#news-view'); $('.atlet-popup .popup-content.atlet-content .links.news a').html(p.FName + ' ' + p.LName.toUpperCase() + ' в Новостях: '); } else if (p.NumberOfNews > 0) { $('.atlet-popup .popup-content.atlet-content .links.news').show(); $('.atlet-popup .popup-content.atlet-content .links.news a').attr('href', '/person?fio=' + p.LName + ' ' + p.FName + '#news-view'); $('.atlet-popup .popup-content.atlet-content .links.news a').html(p.FName + ' ' + p.LName.toUpperCase() + ' в Новостях: '); } else { $('.atlet-popup .popup-content.atlet-content .links.news').hide(); $('.atlet-popup .popup-content.atlet-content .links.news a').attr('href', '/person?fio=' + p.LName + ' ' + p.FName + '#news-view'); $('.atlet-popup .popup-content.atlet-content .links.news a').html(p.FName + ' ' + p.LName.toUpperCase() + ' в Новостях: '); } $('#boxprotocols').html(''); var ogid = 0; if (p.ProtocolsForAjaxList.length > 0) for (var i = 0; i < p.ProtocolsForAjaxList.length; i++) { var pro = p.ProtocolsForAjaxList[i]; if (ogid != pro.OlympicGameId) { var protocolname = pro.Name ? pro.Name : ''; if (pro.Year == 2012) protocolname = 'Результаты выступлений на Играх XXX Олимпиады в Лондоне'; else if (pro.Year == 2016) protocolname = 'Результаты выступлений на Играх XXXI Олимпиады в Рио-Де-Жанейро'; $('#boxprotocols').append($(' ', { text: protocolname })); } var titleclear = pro.Title && $.trim(pro.Title) != '' ? $.trim(pro.Title) : ''; if (titleclear != '' && titleclear.length > 0) { if (titleclear.substr(titleclear.length - 1, 1) == '-') { titleclear = $.trim(titleclear.substr(0, titleclear.length - 1)); if (titleclear.substr(titleclear.length - 1, 1) == '-') titleclear = $.trim(titleclear.substr(0, titleclear.length - 1)); } } var stageclear = pro.Stage && $.trim(pro.Stage) != '' ? $.trim(pro.Stage) : ''; if (stageclear != '' && stageclear.substr(0, 1) == '-') stageclear = stageclear.substr(1, stageclear.length - 1).replace('(', ' ').replace(')', ' '); if (pro.EtapComments && pro.EtapComments.length > 0) { var EtapComments = pro.EtapComments; if (pro.Year == 2010) EtapComments = EtapComments.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); else if (pro.Year == 2012) { EtapComments = EtapComments.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); EtapComments = EtapComments.replace(new RegExp("/img/logo/", 'g'), "http://london2012.infosport.ru/img/logo/"); } else if (pro.Year == 2014) EtapComments = EtapComments.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/sochi2014/"); else if (pro.Year == 2016) EtapComments = EtapComments.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/rio2016/"); stageclear = stageclear + ' (' + EtapComments + ')'; } $('#boxprotocols').append( $('', { 'class': 'special-table-heading' }) .append($('', { 'class': 'sex', text: titleclear })) .append($('', { 'class': 'type', html: stageclear })) .append($('', { href: '#', 'class': 'protocol', text: 'протокол', 'data-schedulerid': pro.SchedulerId })) ); var protocol = pro.Protocol; if (protocol != null) { if (pro.Year == 2010) protocol = protocol.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); else if (pro.Year == 2012) { protocol = protocol.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); protocol = protocol.replace(new RegExp("/img/logo/", 'g'), "http://london2012.infosport.ru/img/logo/"); protocol = protocol.replace(new RegExp("http://www.london2012.com/imgml/icons/ct/", 'g'), "/content/uploads/olympflags/london2012/sport/"); } else if (pro.Year == 2014) protocol = protocol.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/sochi2014/"); else if (pro.Year == 2016) protocol = protocol.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/rio2016/"); } var jqprotocol = $(protocol); jqprotocol.addClass('year-' + pro.Year); $('#boxprotocols').append(jqprotocol); ogid = pro.OlympicGameId; } $('#boxprotocols table.year-2010 tr td a,#boxprotocols table.year-2012 tr td a,#boxprotocols table.year-2014 tr td a').each(function (e) { if (typeof ($(this).attr("href")) == 'undefined' || ($(this).attr("href") != "" && $(this).attr("href").indexOf("infosport.ru") == -1)) { $(this).after($(this).html()); $(this).remove(); } }); $('#boxprotocols table.year-2016 a').each(function (e) { if (typeof ($(this).attr("href")) == 'undefined' || ($(this).attr("href") == "/person/" + p.Id)) { $(this).after($(this).html()); $(this).remove(); } }); if (p.SocietiesForAjaxList.length) $('.popup-content.atlet-content #boxsocieties').show(); else $('.popup-content.atlet-content #boxsocieties').hide(); $('#boxsocieties tbody').html(''); if (p.SocietiesForAjaxList.length > 0) for (var i = 0; i < p.SocietiesForAjaxList.length; i++) { var soc = p.SocietiesForAjaxList[i]; $('#boxsocieties tbody').append( $('') .append($('', { 'class': 'sex', text: STitle })) .append($('', { 'class': 'type', html: EtapText })) ); var protocol = S.ProtocolHtml; //.replace(new RegExp("/content/uploads/olympflags/", 'g'), "http://sochi2014.infosport.ru/content/uploads/olympflags/"); if (S.Year == 2010) protocol = protocol.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/vancouver2010/"); else if (S.Year == 2012) { protocol = protocol.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); protocol = protocol.replace(new RegExp("http://www.london2012.com/imgml/icons/ct/", 'g'), "/content/uploads/olympflags/london2012/sport/"); } else if (S.Year == 2014) protocol = protocol.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/sochi2014/"); else if (S.Year == 2016) protocol = protocol.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/rio2016/"); $('.atlet-popup.level2 .scroll-wrap #boxprotocols').append(protocol); $('.atlet-popup.level2 .scroll-wrap #boxprotocols table').addClass('year-' + S.Year); if (S.Year == 2016) { $('.atlet-popup.level2 #boxprotocols table tr td a').each(function (e) { if (typeof ($(this).attr("href")) == 'undefined' || ($(this).attr("href") == "/person/" + ISPerson.ShowId)) { $(this).after($(this).html()); $(this).remove(); } }); } else $('.atlet-popup.level2 #boxprotocols table tr td a').each(function (e) { if (typeof ($(this).attr("href")) == 'undefined' || ($(this).attr("href") != "" && $(this).attr("href").indexOf("infosport.ru") == -1)) { $(this).after($(this).html()); $(this).remove(); } }); $('.atlet-popup.level2').css({ top: $(window).scrollTop(), width: ($("#container").width() < 1000) ? $("#container").width() : 1000 }); $('.atlet-popup.level2 a.close').unbind('click'); $('.atlet-popup.level2 a.close').click(function () { $('.atlet-popup.level2').remove(); $('.atlet-popup-bg.level2').remove(); return false; }); } } }); } return false; }); }, TextClickOnLink: function (el) { var thisclass = this; var href = el.attr('href'); var id = 0; if (href.toLowerCase().indexOf('allbdpro/doc.asp?') > -1) id = parseInt(href.substring(21)); else if (href.toLowerCase().indexOf('/person/') > -1) id = parseInt(href.substring(8)); if (id > 0) { if (thisclass.PersonsLastById[id] != undefined) { //thisclass.SetAtletPopupToggle(this.PersonsLast[thisclass.PersonsLastById[id]]); thisclass.AtletPopupToggle({ data: function (str) { return '' + id; } }); $(".atlet-popup").css('z-index', '3003'); $(".atlet-popup-bg").css('z-index', '2008'); } else { $.ajax({ url: "/ajax/personsforsearch?v=" + ISCommon.GetV(), data: { PersonsIdsString: '[' + id + ']' }, success: function (d) { if (d.PersonsSearch.length) { var plastById = {}; for (var i = 0; i < d.PersonsSearch.length; i++) plastById[d.PersonsSearch[i].Id] = i; var p = d.PersonsSearch[plastById[parseInt(id)]]; thisclass.PersonsLastById[p.Id] = thisclass.PersonsLast.length; thisclass.PersonsLast.push(p); if (thisclass.PersonsLastById[p.Id] != undefined) { $(".atlet-popup").css({ top: $(window).scrollTop() }); $(".atlet-popup-bg").css({ top: $(window).scrollTop() }); thisclass.AtletPopupToggle({ data: function (str) { return '' + p.Id; } }); $(".atlet-popup").css('z-index', '3003'); $(".atlet-popup-bg").css('z-index', '2008'); } } } }); } return false; } return true; }, PersonsLastInit: function () { var thisclass = this; $(".atlet-view-history .simple-block").hover(function () { $(this).find('img.black-white').stop().animate({ "opacity": "0" }, "slow"); }, function () { $(this).find('img.black-white').stop().animate({ "opacity": "1" }, "slow"); }); $(".atlet-view-history a.simple-block").click(function () { thisclass.AtletPopupToggle($(this)); return false; }); }, PersonsLastAdd: function (p) { var thisclass = this; var cookie = p.Id; var pnew = []; this.PersonsLastById = {}; pnew.push(p); this.PersonsLastById[p.Id] = 0; $('.atlet-view-history').show(); $('.atlet-history-list .simple-block[data-personid=' + p.Id + ']').remove(); for (i = 0; i < this.PersonsLast.length; i++) if (p.Id != this.PersonsLast[i].Id && pnew.length < 9) { this.PersonsLastById[this.PersonsLast[i].Id] = pnew.length; pnew.push(this.PersonsLast[i]); cookie += '-' + this.PersonsLast[i].Id; } this.PersonsLast = pnew; var a = thisclass.GetASimpleBlockByP(p, 'history'); $('.atlet-history-list').prepend(a); $('.atlet-history-list .simple-block').eq(9).remove(); $.cookie('PersonsLastView', cookie, { path: '/person', expires: 366 }); this.PersonsLastInit(); }, PersonsLastGet: function () { var thisclass = this; var data = $.cookie('PersonsLastView'); if (data != null && data != "" && data.indexOf('-') > -1) { $('.atlet-view-history').show(); var strIds = data.split("-"); $.ajax({ url: "/ajax/personsforsearch?v=" + ISCommon.GetV(), data: { PersonsIdsString: JSON.stringify(strIds) }, success: function (d) { thisclass.PersonsLast = []; var plastById = {}; for (var i = 0; i < d.PersonsSearch.length; i++) plastById[d.PersonsSearch[i].Id] = i; $('.atlet-history-list').html(''); for (var i = 0; i < strIds.length; i++) if (strIds[i] != "" && plastById[parseInt(strIds[i])] != undefined) { var p = d.PersonsSearch[plastById[parseInt(strIds[i])]]; thisclass.PersonsLastById[p.Id] = thisclass.PersonsLast.length; thisclass.PersonsLast.push(p); var a = thisclass.GetASimpleBlockByP(p, 'history'); $('.atlet-history-list').append(a); } $('.atlet-history-list').append($('', { 'class': 'clear' })); thisclass.PersonsLastInit(); } }); } else $('.atlet-view-history').hide(); }, BindBigBlocks: function () { var thisclass = this; $(".atlet-results .results-list .simple-block img").css('height', 'auto'); $(".wrap-block").each(function () { thisclass.BindBigBlocksItem($(this)); }); var Take = 0; var last = $('.content .page-content .atlet-results .results-list .simple-block:last'); var map = { 10: 8, 150: 7, 290: 6, 430: 5, 570: 4, 710: 3, 850: 2, 990: 1, 1130: 0 }; if (last.length && parseInt(last.css('left').replace('px')) < 1130) { Take = map[parseInt(last.css('left').replace('px'))]; if (last.hasClass('huge-block')) Take = Take - 4; else if (last.hasClass('big-block')) Take = Take - 2; } $('.atlet-results #button-open').show(); return false; /* if (Take > 0 && thisclass.Type == 'person') $.ajax({ url: "/ajax/personsforsearchform?v=" + ISCommon.GetV(), data: { Take: Take, SearchSkip: thisclass.PersonsSearchViewCount, ProfessionId: $('.atlet-filter #ProfessionId').val(), LocationsRegionId: $('.atlet-filter #LocationsRegionId').val(), PlaceOfBirthRegionId: $('.atlet-filter #PlaceOfBirthRegionId').val(), WinterSportId: $('.atlet-filter #WinterSportId').val(), SummerSportId: $('.atlet-filter #SummerSportId').val(), SportId: $('.atlet-filter #SportId').val(), FIO: $('.atlet-filter #FIO').val(), YearFrom: $('.atlet-filter #YearFrom').val(), YearTo: $('.atlet-filter #YearTo').val(), ChampionId: $('.atlet-filter #ChampionId').val(), RankId: $('.atlet-filter #RankId').val() }, success: function (d) { thisclass.PersonsSearchCount = d.PersonsSearchCount; thisclass.PersonsSearchFirst = d.PersonsForAjaxList; thisclass.PersonsSearchViewCount = thisclass.PersonsSearchViewCount + d.PersonsForAjaxList.length; thisclass.BindBigBlocksFirst(); } }); */ }, BindBigBlocksFirst: function () { var thisclass = this; if (ISCatalogs.Sport.length > 0) { for (var i = 0; i < thisclass.PersonsSearchFirst.length; i++) { var a = thisclass.GetASimpleBlockByP(thisclass.PersonsSearchFirst[i]); $('div.results-list div.resultbottom').before(a); $('.atlet-results .results-list').masonry().masonry('appended', a);//.masonry(); } thisclass.ResultsListInit(); if (thisclass.PersonsSearchCount == thisclass.PersonsIds.length + thisclass.PersonsSearchFirst.length) $('.atlet-results #button-open').hide(); } else setTimeout(function () { thisclass.BindBigBlocksFirst(); }, 100); }, BindBigBlocksItem: function (el) { if (!el.parent().hasClass('huge-block')) { var startLft = el.position().left, startLftOffset = el.parent().position().left + 10, width = el.outerWidth(true); el.unbind('mouseover').unbind('mouseout'); el.on('mouseover', function () { $(this).parent().css({ 'z-index': 1001 }); $('.content-wrap .page-content').css({ 'overflow': 'visible' }); //$(this).addClass('active'); if ($("#container").width() <= startLftOffset + width) $(this).addClass('showleft'); var ch = 0; while ($(this).find('.full').outerHeight() > 365 && ch < 10) { //$(this).find('.sport-link').text($(this).find('.full').outerHeight()); $(this).find('.full p:last').remove(); $(this).find('.full p:last').append('..'); ch++; } }); el.on('mouseout', function () { var startLft = $(this).data('startLft'), startLftOffset = $(this).data('startLftOffset'), width = $(this).data('startLftwidth'); $(this).parent().css({ 'z-index': 1000 }); $('.content-wrap .page-content').css({ 'overflow': 'hidden' }); $(this).removeClass('active'); /* if ($("#container").width() <= startLftOffset + width) $(this).css('left', (startLft)); */ }); /* var parent = el.parent(); if (parseInt(parent.css('top').replace('px')) > 10) parent.addClass('inwardly'); */ } }, GetASimpleBlockByP: function (p, t) { var thisclass = this; var photoblack = p.Photo ? '/InfoSport.aspx?s=' + p.Photo : (p.PicFile != null && p.PicFile != '' ? '/InfoSport.aspx?photo=' + p.PicFile : '/content/images/person_no_photo.jpg'); var photocolor = p.Photo ? '/content/uploads/personalities/small/' + p.Photo : (p.PicFile != null && p.PicFile != '' ? 'http://old.infosport.ru/images/photo/' + p.PicFile : '/content/images/person_no_photo.jpg'); var imgclass = ""; if (p.Photo == null || p.Photo.length == 0) { if (p.PicFile != null && p.PicFile != '') imgclass = "oldinfosport"; else if (p.IsPhotoNotFound) { imgclass = "photo-not-found"; photoblack = '/content/images/photo_not_found.jpg'; photocolor = photoblack; } else imgclass = "no-photo"; } if (t != 'history') { var sportspan = $('', { 'class': 'sport-link' }) if (p.SportIds.length > 0) { sportspan.append($('', { src: '/content/uploads/sport/' + ISCatalogs.SportGet(p.SportIds[0]).Logo })).append(ISCatalogs.SportGet(p.SportIds[0]).Name); if (ISCatalogs.SportGet(p.SportIds[0]).Name.length > 20) sportspan.attr('style', 'line-height:21px;'); } } var templateByType = { 0: 'BlackAndWhite', 1: 'Color', 2: 'BigChangeSize', 3: 'BigWithBlue' }; var a = $(' ', { 'class': 'simple-block', href: '/person/' + p.Id, 'data-personid': p.Id, 'data-template': templateByType[p.TemplateType] }); if (0 == p.TemplateType && (p.Photo || p.PicFile)) a.append($('', { src: photoblack, 'class': 'black-white ' + imgclass })); a.append($('', { src: photocolor, 'class': 'color ' + imgclass })) .append($('', { 'class': 'block-fio' }).append($('', { html: p.FName + '
|
', { text: soc.District })) .append($(' | ', { text: soc.Region })) .append($(' | ', { text: soc.City })) .append($(' | ', { text: soc.Society })) .append($(' |
', { text: soc.Club })) ) } var ch = 0; $('.popup-content.atlet-content .half-left .wrapper tr,.popup-content.atlet-content .half-right .wrapper tr').removeClass('even').removeClass('odd'); $('.popup-content.atlet-content .half-left .wrapper tr').each(function () { if ($(this).css('display') != 'none') { ch++; if (ch % 2 == 1) $(this).addClass('even'); else $(this).addClass('odd'); } }); ch = 0; $('.popup-content.atlet-content .half-right .wrapper tr').each(function () { if ($(this).css('display') != 'none') { ch++; if (ch % 2 == 1) $(this).addClass('even'); else $(this).addClass('odd'); } }); thisclass.SetAtletPopupToggleBind(); thisclass.AtletPopupToggleShow(p); }, SetAtletPopupToggleBind: function () { var thisclass = this; $('.popup-content.atlet-content .half-right.text-description a').unbind('click'); $('.popup-content.atlet-content .half-right.text-description a').click(function () { return thisclass.TextClickOnLink($(this)) }); $('.popup-content.atlet-content #boxprotocols .protocol').unbind('click'); $('.popup-content.atlet-content #boxprotocols .protocol').click(function () { if ($(this).data('schedulerid') > 0) { $.ajax({ url: "/ajax/scheduler?v=" + ISCommon.GetV(), data: { Id: $(this).data('schedulerid') }, async: false, success: function (d) { if (d.Result == "yes") { var S = d.Scheduler; $('body').append($('
', { 'class': 'atlet-popup-bg level2' })); $('.atlet-popup-bg.level2').show().css({ top: 0, height: $(document).outerHeight(), width: $(document).outerWidth() }); $('.atlet-popup').clone().addClass('level2').appendTo("body"); $('.atlet-popup.level2 .heading .heading-title').remove(); $('.atlet-popup.level2 .heading .print').remove(); $('.atlet-popup.level2 .scroll-wrap').html(''); $('.atlet-popup.level2 .scroll-wrap').append($('
', { 'class': 'tables' }).append($('
', { 'class': 'columns-2', id: 'boxprotocols' }))); $('.atlet-popup.level2 .scroll-wrap #boxprotocols').append($('
', { text: S.Title ? S.Title : "" })); var STitle = ''; if (S.Sport != '') STitle += S.Sport + ': '; var sexsplit = ''; if (S.Sex != null && S.Sex != '' && $.trim(S.Sex) != '-') { STitle += S.Sex; sexsplit = ' - '; } if (S.Discipline != '' && $.trim(S.Discipline) != '-') STitle += sexsplit + S.Discipline; var EtapText = ''; if (S.Etap != null && $.trim(S.Etap) != '' && $.trim(S.Etap) != '-') EtapText = $.trim(S.Etap); if (S.EtapComments && $.trim(S.EtapComments) != '') { var EtapComments = S.EtapComments; if (S.Year == 2010) EtapComments = EtapComments.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); else if (S.Year == 2012) { EtapComments = EtapComments.replace(new RegExp("/img/olympflags/", 'g'), "/content/uploads/olympflags/london2012/"); EtapComments = EtapComments.replace(new RegExp("/img/logo/", 'g'), "http://london2012.infosport.ru/img/logo/"); } else if (S.Year == 2014) EtapComments = EtapComments.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/sochi2014/"); else if (S.Year == 2016) EtapComments = EtapComments.replace(new RegExp("/content/uploads/olympflags/", 'g'), "/content/uploads/olympflags/rio2016/"); EtapText += EtapText != '' ? ' (' + $.trim(EtapComments) + ')' : $.trim(EtapComments); } $('.atlet-popup.level2 .scroll-wrap #boxprotocols').append( $('', { 'class': 'special-table-heading' }) .append($(' |