Five Assists And Goal For Lionel Messi, Hat-Trick For Luis Suarez As Inter Miami Hit Six | Football News
→ Оригинал (без защиты от корпорастов) | Изображения из статьи: [1]
';
var noMatchHtmlUpcoming = ' No Upcoming Matches ';
var noMatchHtmlRecent = ' No Recent Matches ';
SportsThirdPrty_Array.functionArray.push(function () {
//var fgmatches = 'Html.Raw(fgmatchjson)';
//var fg_matches = null;
//try { fg_matches = JSON.parse(fgmatches); } catch (e) { }
(function scroewidgetIsReady() {
$('#scorewidgt_tbs li').click(function () {
if (sport == 1) {
isfirstload = true;
}
$('#scorewidgt_tbs li a').removeClass("rnk_nav-act");
$(this).find('a').addClass("rnk_nav-act");
var active_cont = $(this).find('a').attr("data-type");
$('.scr_nav-cnt').hide();
$('#' + active_cont).show();
});
if (sport==1) {
$('#scr_subtabs li').click(function() {
$('#scr_subtabs li a').removeClass("rnk_sub-act");
$(this).find('a').addClass("rnk_sub-act");
var active_cnt = $(this).find('a').attr("data-type");
$('.scr_nav-cnt').hide();
$('#' + active_cnt).show();
});
}
})();
(function loadscorewidget() {
loadwidget(activeurl);
_rrCode.push(function () { setInterval(function () { loadwidget(activeurl); }, 30000); });
})();
$('.rnk_nav-tab_cr').click(function() {
$('.scr_nav-cnt').html("").hide();
$('#scr_subtabs li a').removeClass("rnk_sub-act");
$('#tb_live_sub').addClass("rnk_sub-act");
$('#scr_live').show();
var active_cont = $(this).find('a').attr("data-type");
var url = '';
//if (active_cont == 'scr_custommatch') {
// url = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=1&league=0&timezone=0530&language='+lang+'&tournament='+customtab_tourid;
//}
//else
if (active_cont == 'scr_indiamatch') {
//url = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=1&league=0&timezone=0530&language=' + lang + '&tournament=1824';
url = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=1&league=0&timezone=0530&language=' + lang +'&teamcode=4&widget=Rhslivescorewidget';
}
else {
url = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=1&league=0&timezone=0530&language=' + lang +'&gamestate=4&widget=Rhslivescorewidget';
}
loadwidget(url);
});
function sortMatches(data, type, seriespage) {
var matches = [];
var matchShortData = [];
switch (type) {
case 'inprogress':
{
matches = $.grep(data, function (n, i) {
return n.event_state == 'L';
});
/* matches = matches.sort(function (a, b) {
var ap = parseInt(a.priority, 1);
var bp = parseInt(b.priority, 1);
return ap - bp;
});*/
var dumData = matches;
function sortJSON(dumData, key) {
return dumData.sort(function (a, b) {
var x = parseInt(a[key]);
var y = parseInt(b[key]);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
}
var dum2 = sortJSON(dumData, 'event_priority');
var priorityOneMatch = $.grep(dum2, function (n, i) {
if ((n.participants[0].id) == 4 || (n.participants[1].id) == 4) {
return n;
}
});
// console.log(priorityOneMatch)
var nonpriorityOneMatch = $.grep(dum2, function (n, i) {
if ((n.participants[0].id) != 4 && (n.participants[1].id) != 4) {
return n;
}
});
matches = [];
matches = $.merge($.merge([], priorityOneMatch), nonpriorityOneMatch);
//matches.reverse();
if (seriespage) {
if (matches.length > 0) {
showMatches(matches, type);
for (i = 0; i < matches.length; i++) {
var match_id = matches[i].game_id;
AddfantasyLivefunction(match_id);
}
}
else sortMatches(data, 'recent');
}
return matches;
break;
}
case 'upcoming':
{
matches = $.grep(data, function (n, i) {
return n.event_state == "U";
});
matches = matches.sort(function (a, b) {
var adate = new Date(a.start_date);
var bdate = new Date(b.start_date);
return adate - bdate;
});
return matches;
break;
}
case 'recent':
{
matches = $.grep(data, function (n, i) {
return n.event_state == "R";
});
matches = matches.sort(function (a, b) {
var adate = new Date(a.start_date);
var bdate = new Date(b.start_date);
return bdate - adate;
});
// matches.reverse();
return matches;
break;
}
}
};
function getWinPercentagetop(gameid) {
var html = "";
var url = 'https://edata.ndtv.com/cricket/iccCricketwebfeedNew.json?callback=iccworldcup';
$.ajax({
type: 'GET',
url: url,
async: false,
jsonpCallback: "callback",
jsonpCallback: 'iccworldcup',
contentType: "application/json",
dataType: 'jsonp',
timeout: 20000,
success: function (data) {
$.each(data, function (i, item) {
if (item.status == 1) {
if (item.matchtype.toLowerCase() == "test") {
html = ' % chance to win ';
html += ' ' + item.teama_short + ' ' + item.teamaWinPer + '% ';
html += ' ';
html += ' Draw ' + item.drawWinPer + '% ';
html += ' ';
html += ' ' + item.teamb_short + ' ' + item.teambWinPer + '% ';
}
else {
if (parseInt(item.teamaWinPer) > parseInt(item.teambWinPer)) {
html = ' ' + item.teama_short + ' ' + item.teamaWinPer + '% % chance to win ' + item.teamb_short + ' ' + item.teambWinPer + '% ';
}
else {
html = ' ' + item.teamb_short + ' ' + item.teambWinPer + '% % chance to win ' + item.teama_short + ' ' + item.teamaWinPer + '% ';
}
}
$("#" + item.matchfile + '_winbx').show().html(html);
}
else {
$("#" + item.matchfile + '_winbx').hide().html("");
}
});
return html;
},
error: function (jqXHR, textStatus, errorThrown) {
//alert(errorThrown);
}
});
}
function formatAMPM(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
minutes = minutes < 10 ? '0' + minutes : minutes;
var strTime = hours + ':' + minutes + ' ' + ampm;
return strTime;
}
function loadwidget(url) {
var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
const dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri","Sat"];
var noLive = false;
var noUpcoming = false;
var dataurlenglish = '';
if (url == undefined || url=='' || url=="") {
if (tourid == 0) {
dataurlenglish = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=' + sport + '&league=0&timezone=0530&language=' + lang + '&gamestate=4&widget=Rhslivescorewidget';
}
else {
dataurlenglish = 'https://sports.ndtv.com/multisportsapi/?methodtype=3&client=2656770267&sport=' + sport + '&league=0&timezone=0530&language=' + lang + '&tournament=' + tourid +'&widget=Rhslivescorewidget';
}
}
else {
dataurlenglish = url;
}
Sports_Jsonp.loadJSON({
url: dataurlenglish,
cache: true,
type: 'jsonp'
}, function (dataenglish) {
var active = false;
if (dataenglish != undefined) {
if (!dataenglish.matches) {
if (!dataenglish.error) {
cb();
return false;
}
}
matchscores = dataenglish.matches;
var inprogress = sortMatches(matchscores, 'inprogress',false)
var upcoming = sortMatches(matchscores, 'upcoming',false)
var recent = sortMatches(matchscores, 'recent', false)
if (inprogress.length > 0) {
var html = "";
$.each(inprogress, function (i, item) {
if (i < 3) {
var dt = new Date(item.start_date);
var link = '';
try {
link = generateUrl(item.sport.toLowerCase(), item, lang,'inprogress');
} catch (e) { }
if (item.sport.toLowerCase() == "cricket") {
var team1score = item.participants[0].value.split('&');
var team2score = item.participants[1].value.split('&');
var scorehtml1 = ''; var scorehtml2 = '';
var activeclstm1 = '';
var activeclstm2 = '';
var playstatus = '';
var crr = "";
var scroedata;
var crr_score = "";
var crr_overs = "";
try {
if (item.participants[0].now == 'true') {
activeclstm1 = 'scr_tm-scr-act';
scroedata = item.participants[0].value.split(' ');
crr_score = scroedata[0].split('/')[0];
crr_overs = scroedata[1].replace("(", "").replace(")", "");
}
} catch (e) {
}
try {
if (item.participants[1].now == 'true') {
activeclstm2 = 'scr_tm-scr-act';
scroedata = item.participants[1].value.split(' ');
crr_score = scroedata[0].split('/')[0];
crr_overs = scroedata[1].replace("(", "").replace(")", "");
}
} catch (e) {
}
if (item.result_code != "A") {
if (item.event_format.toLowerCase().trim() == "test") {
if (team1score.length > 1) {
try {
if (item.participants[0].now == 'true') {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1] + '';
}
else {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1].replace(/ *\([^)]*\) */g, "") + '';
}
}
else {
if (team1score[0] == "") {
scorehtml1 = 'Yet To Bat';
}
else {
try {
if (item.participants[0].now == 'true') {
scorehtml1 = '' + team1score[0] + '';
}
else {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml1 = '' + team1score[0] + '';
}
}
}
if (team2score.length > 1) {
try {
if (item.participants[1].now == 'true') {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1] + '';
}
else {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1].replace(/ *\([^)]*\) */g, "") + '';
}
}
else {
if (team2score[0] == "") {
scorehtml2 = 'Yet To Bat';
}
else {
try {
if (item.participants[1].now == 'true') {
scorehtml2 = '' + team2score[0] + '';
}
else {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml2 = '' + team2score[0] + '';
}
}
}
}
else {
if (team1score.length > 1) {
scorehtml1 = '' + team1score[0] + ' ' + team1score[1] + '';
}
else {
if (team1score[0] == "") {
scorehtml1 = 'Yet To Bat';
}
else {
scorehtml1 = '' + team1score[0] + '';
}
}
if (team2score.length > 1) {
scorehtml2 = '' + team2score[0] + ' ' + team2score[1] + '';
}
else {
if (team2score[0] == "") {
scorehtml2 = 'Yet To Bat';
}
else {
scorehtml2 = '' + team2score[0] + '';
}
}
}
}
try {
if (item.event_format.toLowerCase().trim() == 'test') {
if (item.event_is_daynight == "false") {
if (item.event_session == 1 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Morning Session";
} else if (item.event_session == 2 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Post Lunch Session"
} else if (item.event_session == 3 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Post Tea Session"
}
else {
playstatus = item.event_status;
}
} else {
if (item.event_session == 1 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Opening Session";
} else if (item.event_session == 2 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Post Tea Session"
} else if (item.event_session == 3 && item.event_state == 'L' && item.event_status_id.toLowerCase() == '117') {
playstatus = "Post Dinner Session"
}
else {
playstatus = item.event_status;
}
}
playstatus = "Day " + item.event_day + " " + playstatus;
}
else {
playstatus = item.event_status;
}
} catch (e) { playstatus = '' }
var venue = item.venue_name.split(',');
var team1n = item.participants[0].short_name;
var team2n = item.participants[1].short_name;
if (isDesktop.toLowerCase().trim() == 'true') {
team1n = item.participants[0].name;
team2n = item.participants[1].name;
}
crr = parseFloat(crr_score) / parseFloat(crr_overs);
crr = crr.toFixed(2);
html += ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ';
html += ' ' + playstatus + ' ';
var isIOS = !window.MSStream && /iPad|iPhone|iPod/.test(navigator.userAgent);
if (1) {
if (!isIOS) {
html += ' ';
}
}
html +=' '+ team1n + ' ' + scorehtml1 + ' \ '+ team2n + ' ' + scorehtml2 + ' '+ item.event_sub_status + ' CRR: ' + crr + ' ';
try {
var win = getWinPercentagetop(item.game_id);
} catch (e) {
}
}
else if (item.sport.toLowerCase() == "football") {
var activetm1 = '';
var activetm2 = '';
try {
if (item.participants[0].now == 'true') {
activetm1 = 'ftb-wid_gl-act';
}
} catch (e) {
}
try {
if (item.participants[1].now == 'true') {
activetm2 = 'ftb-wid_gl-act';
}
} catch (e) {
}
var venue = item.venue_name.split(',');
var team1n = item.participants[0].short_name;
var team2n = item.participants[1].short_name;
if (isDesktop.toLowerCase().trim() == 'true') {
team1n = item.participants[0].name;
team2n = item.participants[1].name;
}
html += ' ' + item.series_name + ' ' + item.event_name + ', at' + venue[venue.length - 1] + ' '+ team1n + ' ' + item.participants[0].value + ' ' + team2n + ' ' + item.participants[1].value + ' '+ item.event_sub_status + ' ';
}
}
})
$("#scr_live").html(html);
}
else {
noLive = true;
$("#scr_live").html(noMatchHtmlProgress);
}
if (upcoming.length > 0) {
var html = "";
$.each(upcoming, function (i, item) {
if (i < 3) {
var link = '';
try {
link = generateUrl(item.sport.toLowerCase(), item, lang,'upcoming');
} catch (e) { }
var dt = new Date(item.start_date);
var finaldate = dayNames[dt.getDay()] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' - ' + formatAMPM(dt) + ' IST';
var venue = item.venue_name.split(',');
var team1n = item.participants[0].short_name;
var team2n = item.participants[1].short_name;
if (isDesktop.toLowerCase().trim() == 'true') {
team1n = item.participants[0].name;
team2n = item.participants[1].name;
}
if (item.sport.toLowerCase() == "cricket") {
html += ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ';
var isIOS = !window.MSStream && /iPad|iPhone|iPod/.test(navigator.userAgent) /*(/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && !window.MSStream*/;
if (1) {
if (navigator.appVersion.toLowerCase().indexOf("mac") != -1 && !isChrome) {
var sportsLInk = 'https://sports.ndtv.com' + link + '?pfrom=sports-calendar';
html += ' ';
}
else {
html += ' ';
}
}
html += ' ' + team1n + ' ' + team2n + ' '+ finaldate + ' ';
try {
var win = getWinPercentagetop(item.game_id);
} catch (e) {
}
}
else if (item.sport.toLowerCase() == "football") {
html += ' ' + item.series_name + ' ' + item.event_name + ', at' + venue[venue.length - 1] + ' '+ team1n + ' '+ team2n + ' ';
}
}
})
$("#scr_upcoming").html(html);
}
else {
noUpcoming = true;
$("#scr_upcoming").html(noMatchHtmlUpcoming);
}
if (recent.length > 0) {
var html = "";
$.each(recent, function (i, item) {
if (i < 3) {
var link = '';
try {
link = generateUrl(item.sport.toLowerCase(), item, lang,'recent');
} catch (e) { }
var dt = new Date(item.start_date);
var finaldate = dayNames[dt.getDay()] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' - ' + formatAMPM(dt) + ' IST';
var venue = item.venue_name.split(',');
var team1n = item.participants[0].short_name;
var team2n = item.participants[1].short_name;
if (isDesktop.toLowerCase().trim() == 'true') {
team1n = item.participants[0].name;
team2n = item.participants[1].name;
}
if (item.sport.toLowerCase() == "cricket") {
if (item.result_code != "A" && item.result_code != "C") {
var team1score = item.participants[0].value.split('&');
var team2score = item.participants[1].value.split('&');
}
var scorehtml1 = ''; var scorehtml2 = '';
var activeclstm1 = '';
var activeclstm2 = '';
try {
if (item.participants[0].now == 'true') {
activeclstm1 = 'scr_tm-scr-act';
}
} catch (e) {
}
try {
if (item.participants[1].now == 'true') {
activeclstm2 = 'scr_tm-scr-act';
}
} catch (e) {
}
if (item.result_code != "A" && item.result_code != "C") {
if (item.event_format.toLowerCase().trim() == "test") {
if (team1score.length > 1) {
try {
if (item.participants[0].now == 'true') {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1] + '';
}
else {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team1score[1].replace(/ *\([^)]*\) */g, "") + '';
}
}
else {
if (team1score[0] == "") {
scorehtml1 = 'Yet To Bat';
}
else {
try {
if (item.participants[0].now == 'true') {
scorehtml1 = '' + team1score[0] + '';
}
else {
scorehtml1 = '' + team1score[0].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml1 = '' + team1score[0] + '';
}
}
}
if (team2score.length > 1) {
try {
if (item.participants[1].now == 'true') {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1] + '';
}
else {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '& ' + team2score[1].replace(/ *\([^)]*\) */g, "") + '';
}
}
else {
if (team2score[0] == "") {
scorehtml2 = 'Yet To Bat';
}
else {
try {
if (item.participants[1].now == 'true') {
scorehtml2 = '' + team2score[0] + '';
}
else {
scorehtml2 = '' + team2score[0].replace(/ *\([^)]*\) */g, "") + '';
}
} catch (e) {
scorehtml2 = '' + team2score[0] + '';
}
}
}
}
else {
if (team1score.length > 1) {
scorehtml1 = '' + team1score[0] + ' ' + team1score[1] + '';
}
else {
if (team1score[0] == "") {
scorehtml1 = 'Yet To Bat';
}
else {
scorehtml1 = '' + team1score[0] + '';
}
}
if (team2score.length > 1) {
scorehtml2 = '' + team2score[0] + ' ' + team2score[1] + '';
}
else {
if (team2score[0] == "") {
scorehtml2 = 'Yet To Bat';
}
else {
scorehtml2 = '' + team2score[0] + '';
}
}
}
}
html += ' ' + item.event_name + ', ' + item.series_name + ' at ' + venue[venue.length - 1] + ', ' + monthNames[dt.getMonth()] + ' ' + dt.getDate() + ', ' + dt.getFullYear() + ' ' + team1n + ' '+ scorehtml1 + ' '+ team2n + ' ' + scorehtml2 + ' '+ item.event_sub_status + ' ';
}
else if (item.sport.toLowerCase() == "football") {
html += ' ' + item.series_name + ' ' + item.event_name + ', at' + venue[venue.length - 1] + ' '+ team1n + ' ' + item.participants[0].value + ' ' + team2n + ' ' + item.participants[1].value +' FT ';
}
}
})
$("#scr_recent").html(html);
}
else {
$("#scr_recent").html(noMatchHtmlRecent);
}
try {
activetab = $("#scorewidgt_tbs li a.rnk_nav-act")[0].id;
} catch(e){ }
try {
if (sport==1) {
activesubtab = $("#scr_subtabs li a.rnk_sub-act")[0].id;
}
} catch(e){ }
activeurl = dataurlenglish;
activecontainer = $(".scr_nav-cnt:visible")[0].id;
if (isfirstload) {
if (noLive) {
if (sport == 1 && tourid == 0) {
//activetab = 'tb_upcoming';
if (noUpcoming) {
activesubtab = 'tb_recent_sub';
activecontainer = 'scr_recent';
}
else {
activesubtab = 'tb_upcoming_sub';
activecontainer = 'scr_upcoming';
}
activeurl = dataurlenglish;
//activecontainer = 'scr_upcoming';
}
else {
if (noUpcoming) {
activetab = 'tb_recent';
activecontainer = 'scr_recent';
} else {
activetab = 'tb_upcoming';
activecontainer = 'scr_upcoming';
}
activesubtab = '';
activeurl = dataurlenglish;
//activecontainer = 'scr_upcoming';
}
}
}
if (sport == 1 && tourid==0) {
$('#scorewidgt_tbs li a').removeClass("rnk_nav-act");
$('#scr_subtabs li a').removeClass("rnk_sub-act");
$('#' + activetab).addClass("rnk_nav-act");
$('#' + activesubtab).addClass("rnk_sub-act");
$('.scr_nav-cnt').hide();
$('#' + activecontainer).show();
}
else {
$('#scorewidgt_tbs li a').removeClass("rnk_nav-act");
$('#' + activetab).addClass("rnk_nav-act");
$('.scr_nav-cnt').hide();
$('#' + activecontainer).show();
}
isfirstload = false;
if (navigator.appVersion.toLowerCase().indexOf("mac") != -1 && !isChrome) {
$(".clock").show();
}
else {
$(".bell").show();
}
}
});
}
function generateUrl(sport, match, lang, type) {
var link = '';
if (lang == 'en') {
if (sport == 'cricket') {
var ScoreEventname = match.event_name.toLowerCase().split(" - ").join("-").replace(" ", "-");
var Scorevenuename = match.venue_name.split(",");
var countvenue = (Scorevenuename.length - 1);
Scorevenuename = Scorevenuename[countvenue].toLowerCase().split(" ").join("-");
if (type == 'upcoming') {
link = '/cricket/fantasy-tips/' + match.participants[0].name.toLowerCase().replace(" ", "-").replace(" ", "-").replace(/\./g, "") + "-vs-" + match.participants[1].name.toLowerCase().replace(" ", "-").replace(" ", "-").replace(/\./g, "") + "-" + ScoreEventname.replace(" ", "-") + Scorevenuename + "-" + match.game_id;
}
else if (type == 'recent') {
//link = '/cricket/live-scorecard/' + match.participants[0].name.toLowerCase().replace(" ", "-").replace(" ", "-").replace(/\./g, "") + "-vs-" + match.participants[1].name.toLowerCase().replace(" ", "-").replace(" ", "-").replace(/\./g, "") + "-" + ScoreEventname.replace(" ", "-") + Scorevenuename + "-" + match.game_id;
link = "/cricket/" + match.participants[0].short_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "") + "-vs-" + match.participants[1].short_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "") + "-scorecard-live-cricket-score-" + match.series_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "").replace(/\,/g, "").replace(/\s/g, '-').replace("/", "-") + "-" + match.event_name.toLowerCase().replace(" - ", "-").replace(/\s/g, '-').replace(/\./g, "").trimEnd('-') + "-" + match.game_id;
}
else if (type == 'inprogress') {
link = "/cricket/" + match.participants[0].short_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "") + "-vs-" + match.participants[1].short_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "") + "-scorecard-live-cricket-score-" + match.series_name.toLowerCase().replace(" ", "-").replace(" - ", "-").replace(/\./g, "").replace(/\,/g, "").replace(/\s/g, '-').replace("/", "-") + "-" + match.event_name.toLowerCase().replace(" - ", "-").replace(/\s/g, '-').replace(/\./g, "").trimEnd('-') + "-" + match.game_id;
}
}
else {
link = 'https://sports.ndtv.com/football/live-scores/' + match.participants[0].name.toLowerCase().split(' ').join('-').split('-&-').join('-').split('.').join('-') + "-vs-" + match.participants[1].name.toLowerCase().split(' ').join('-').split('-&-').join('-').split('.').join('-') + "-" + match.game_id;
}
}
else {
if (sport == 'cricket') {
if (type == 'upcoming') {
link = '/cricket/scorecard?matchid=' + match.game_id + '&template=fantasytips';
}
else if (type == 'recent') {
link = '/cricket/scorecard?matchid=' + match.game_id + '&template=scorecard';
}
else if (type == 'inprogress') {
link = '/cricket/scorecard?matchid=' + match.game_id + '&template=overview';
}
if (lang == "hi") {
link = 'https://ndtv.in/sports' + link;
}
else if (lang == "bn") {
link = '/bengali' + link;
}
else if (lang == "ta") {
link = '/tamil' + link;
}
}
else {
link = '';
}
}
return link;
}
});