var affUrl = ''; includeCSS(); isJQueryIncluded(); function includeCSS(){ var headID = document.getElementsByTagName("head")[0]; var cssNode = document.createElement('link'); cssNode.type = 'text/css'; cssNode.rel = 'stylesheet'; cssNode.href = 'https://www.nsawins.com/nsawins-odds/odds.css'; cssNode.media = 'screen'; headID.appendChild(cssNode); } function isJQueryIncluded(){ if (typeof jQuery == 'undefined') { includeJQuery(); } else { iniciaCustom(); } } function includeJQuery(){ var headID = document.getElementsByTagName("head")[0]; var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.onload = iniciaCustom; newScript.src = 'https://code.jquery.com/jquery-1.6.2.min.js'; headID.appendChild(newScript); } function iniciaCustom(){ if(jQuery('#myDinamicOddsMenu').html() != null ){ jQuery(document).ready(function($) { //alert("jQuery version: " + jQuery().jquery); datakon = ''; jQuery.getJSON("https://sbglines.sbgglobal.com/jsonservicebykaiser.php?jsoncallback=?&action=get_all_leagues_by_xml_order", function(data){ textmenu = ''; jQuery('#myDinamicOddsMenu').html(textmenu); var selectedLeagueFromMenu = ""; jQuery('.mymenulink').click(function(){ selectedLeagueFromMenu = jQuery(this).html().replace("'","\\'"); jQuery('#myDinamicOddsMenu ul li a').removeClass("leagueSelected"); jQuery(this).addClass("leagueSelected"); jQuery.getJSON("https://sbglines.sbgglobal.com/jsonservicebykaiser.php?jsoncallback=?&action=get_odds&condition=" + selectedLeagueFromMenu, function(data){ datakon = data; formattedOdds = kaiserodds(data, selectedLeagueFromMenu); jQuery('#myDinamicOddsContent').html(formattedOdds); /**IE7 Height Fix**/ //alert(jQuery(".left-corner")[0].clientHeight + "--" + jQuery("#myDinamicOddsMenu")[0].clientHeight); if(jQuery.browser.msie && jQuery.browser.version == 7){ jQuery("#footerwrapper").css("position","absolute"); /*if (jQuery("#myDinamicOddsMenu")[0].clientHeight > jQuery(".left-corner`")[0].clientHeight) { jQuery("#sidebar-right").css('height',jQuery("#myDinamicOddsMenu")[0].clientHeight+'px'); }else{ jQuery("#sidebar-right").css('height',jQuery(".left-corner")[0].clientHeight+'px'); }*/ } //jQuery("#container").css('height',jQuery("#container")[0].clientHeight+'px'); }); }); //Load first odds selectedLeagueFromMenu = jQuery('#myDinamicOddsMenu a:eq(0)').html().replace("'","\\'"); jQuery('#myDinamicOddsMenu ul li a:eq(0)').addClass("leagueSelected"); jQuery.getJSON("https://sbglines.sbgglobal.com/jsonservicebykaiser.php?jsoncallback=?&action=get_odds&condition=" + selectedLeagueFromMenu, function(data){ formattedOdds = kaiserodds(data, selectedLeagueFromMenu); jQuery('.left-corner h2').hide(); jQuery('#myDinamicOddsContent').html(formattedOdds); if(jQuery.browser.msie && jQuery.browser.version == 7){ jQuery("#footerwrapper").css("position","absolute"); } }); }); }); }//<<< if(jQuery('#myDinamicOddsMenu').html() != null ) else { //Si no hay un menu para mostrar contenido usara una seleccion individual que sera tomada del la clase del div del contenido de las lineas. var singleLeague = "nfl"; singleLeague = jQuery('#myDinamicOddsContent br:eq(0)').attr('class'); jQuery.getJSON("https://sbglines.sbgglobal.com/jsonservicebykaiser.php?jsoncallback=?&action=get_odds&condition=" + singleLeague, function(data){ if (data == ""){ //jQuery('#myDinamicOddsContent').html('' ); jQuery('#myDinamicOddsContent').html('There are not '+singleLeague+' lines at this moment, please visit SBGGLOBAL.com' ); } else { formattedOdds = kaiserodds(data, singleLeague); jQuery('#myDinamicOddsContent').html(formattedOdds); if(jQuery.browser.msie && jQuery.browser.version == 7){ jQuery("#footerwrapper").css("position","absolute"); } } }); } } function kaiserodds(data, selectedLeague){ oddsInfo = ''; currentgame = 'false'; currentdate = 'false'; oddscolor = false; //oddsInfo += '.'; oddsInfo += ''; oddsInfo += ''; oddsInfo += ''; for (x in data){ if (data[x].gameId != currentgame){ //add a new game set info oddscolor = false; oddsInfo += ''; if (data[x].date != currentdate) { oddsInfo += ''; oddsInfo += ''; /* oddsInfo += ''; */ oddsInfo += ''; currentdate = data[x].date; } oddsInfo += ''; statusColor = (data[x].status.toLowerCase() == 'open') ? "greenstatus" : "redstatus"; oddsInfo += ''; currentgame = data[x].gameId; } oddsInfo += ''; oddsInfo += ''; oddsInfo += ''; oddsInfo += ''; oddsInfo += ''; try{ incremento = parseInt(x) + 1; if (data[incremento].gameId != currentgame){ oddsInfo += '';//gamewrapper } }catch(e){/* oddsInfo += ''; ///gamewrapper*/} } oddsInfo += '';//id="oddswrapper oddsInfo += ''; oddsInfo += ''; $("fieldset > div.tabs").each(function(index){ $(this).height(800); }); return(oddsInfo); }
' + selectedLeague + ' OddsSP/RLTotalML
' + data[x].date + '' + data[x].status + '
'+data[x].title+'
'+data[x].time+'
' + data[x].seqNumber + ' ' + ''+data[x].teamName+'' + ''; if(data[x].psPoints == 'NA' && data[x].psOdds == '0'){ oddsInfo += '-'; }else{ if(data[x].psPoints == 'NA'){ oddsInfo += ''; }else{ oddsInfo += data[x].psPoints; } if(data[x].psOdds == '0'){ oddsInfo += ' '; }else{ oddsInfo += data[x].psOdds; } } oddsInfo += ''; if(data[x].totalPoints == 'NA' && data[x].totalOdds == '0'){ oddsInfo += '-'; }else{ if(data[x].totalPoints == 'NA'){ oddsInfo += ''; }else{ oddsInfo += data[x].totalPoints; } if(data[x].totalOdds == '0'){ oddsInfo += ' '; }else{ oddsInfo += data[x].totalOdds; } } oddsInfo += ''; if(data[x].mlOdds == 'NA'){ oddsInfo += '-'; }else{ oddsInfo += data[x].mlOdds; } oddsInfo += '
' + selectedLeague + ' OddsSP/RLTotalML