<?xml version='1.0' encoding='UTF-8'?>
<Module>
<ModulePrefs title="__MSG_title__"
             description="__MSG_description__"
             thumbnail="http://www.gstatic.com/ig/modules/global_football/global_football_thm.cache.png"
             screenshot="http://www.gstatic.com/ig/modules/global_football/__MSG_locale__.png"
             author="Google"
             author_affiliation ="Google, Inc."
             author_email="googlemodules+global_football+201209071@google.com"
             scrolling="false">
  <Locale messages="http://www.gstatic.com/ig/modules/global_football/en_ALL.xml"/>
  <Locale lang="ar" messages="http://www.gstatic.com/ig/modules/global_football/ar_ALL.xml" language_direction="rtl"/>
  <Locale lang="bg" messages="http://www.gstatic.com/ig/modules/global_football/bg_ALL.xml"/>
  <Locale lang="ca" messages="http://www.gstatic.com/ig/modules/global_football/ca_ALL.xml"/>
  <Locale lang="cs" messages="http://www.gstatic.com/ig/modules/global_football/cs_ALL.xml"/>
  <Locale lang="da" messages="http://www.gstatic.com/ig/modules/global_football/da_ALL.xml"/>
  <Locale lang="de" messages="http://www.gstatic.com/ig/modules/global_football/de_ALL.xml"/>
  <Locale lang="de-AT" messages="http://www.gstatic.com/ig/modules/global_football/de_AT_ALL.xml"/>
  <Locale lang="de-CH" messages="http://www.gstatic.com/ig/modules/global_football/de_CH_ALL.xml"/>
  <Locale lang="el" messages="http://www.gstatic.com/ig/modules/global_football/el_ALL.xml"/>
  <Locale lang="en" messages="http://www.gstatic.com/ig/modules/global_football/en_ALL.xml"/>
  <Locale lang="en-GB" messages="http://www.gstatic.com/ig/modules/global_football/en_GB_ALL.xml"/>
  <Locale lang="en-IE" messages="http://www.gstatic.com/ig/modules/global_football/en_IE_ALL.xml"/>
  <Locale lang="en-IN" messages="http://www.gstatic.com/ig/modules/global_football/en_IN_ALL.xml"/>
  <Locale lang="en-SG" messages="http://www.gstatic.com/ig/modules/global_football/en_SG_ALL.xml"/>
  <Locale lang="en-ZA" messages="http://www.gstatic.com/ig/modules/global_football/en_ZA_ALL.xml"/>
  <Locale lang="es-419" messages="http://www.gstatic.com/ig/modules/global_football/es_419_ALL.xml"/>
  <Locale lang="es" messages="http://www.gstatic.com/ig/modules/global_football/es_ALL.xml"/>
  <Locale lang="es-AR" messages="http://www.gstatic.com/ig/modules/global_football/es_AR_ALL.xml"/>
  <Locale lang="es-BO" messages="http://www.gstatic.com/ig/modules/global_football/es_BO_ALL.xml"/>
  <Locale lang="es-CL" messages="http://www.gstatic.com/ig/modules/global_football/es_CL_ALL.xml"/>
  <Locale lang="es-CO" messages="http://www.gstatic.com/ig/modules/global_football/es_CO_ALL.xml"/>
  <Locale lang="es-CR" messages="http://www.gstatic.com/ig/modules/global_football/es_CR_ALL.xml"/>
  <Locale lang="es-DO" messages="http://www.gstatic.com/ig/modules/global_football/es_DO_ALL.xml"/>
  <Locale lang="es-EC" messages="http://www.gstatic.com/ig/modules/global_football/es_EC_ALL.xml"/>
  <Locale lang="es-GT" messages="http://www.gstatic.com/ig/modules/global_football/es_GT_ALL.xml"/>
  <Locale lang="es-HN" messages="http://www.gstatic.com/ig/modules/global_football/es_HN_ALL.xml"/>
  <Locale lang="es-MX" messages="http://www.gstatic.com/ig/modules/global_football/es_MX_ALL.xml"/>
  <Locale lang="es-NI" messages="http://www.gstatic.com/ig/modules/global_football/es_NI_ALL.xml"/>
  <Locale lang="es-PA" messages="http://www.gstatic.com/ig/modules/global_football/es_PA_ALL.xml"/>
  <Locale lang="es-PE" messages="http://www.gstatic.com/ig/modules/global_football/es_PE_ALL.xml"/>
  <Locale lang="es-PR" messages="http://www.gstatic.com/ig/modules/global_football/es_PR_ALL.xml"/>
  <Locale lang="es-PY" messages="http://www.gstatic.com/ig/modules/global_football/es_PY_ALL.xml"/>
  <Locale lang="es-SV" messages="http://www.gstatic.com/ig/modules/global_football/es_SV_ALL.xml"/>
  <Locale lang="es-US" messages="http://www.gstatic.com/ig/modules/global_football/es_US_ALL.xml"/>
  <Locale lang="es-UY" messages="http://www.gstatic.com/ig/modules/global_football/es_UY_ALL.xml"/>
  <Locale lang="es-VE" messages="http://www.gstatic.com/ig/modules/global_football/es_VE_ALL.xml"/>
  <Locale lang="et" messages="http://www.gstatic.com/ig/modules/global_football/et_ALL.xml"/>
  <Locale lang="fi" messages="http://www.gstatic.com/ig/modules/global_football/fi_ALL.xml"/>
  <Locale lang="fil" messages="http://www.gstatic.com/ig/modules/global_football/fil_ALL.xml"/>
  <Locale lang="fr" messages="http://www.gstatic.com/ig/modules/global_football/fr_ALL.xml"/>
  <Locale lang="gws" messages="http://www.gstatic.com/ig/modules/global_football/gsw_ALL.xml"/>
  <Locale lang="he" messages="http://www.gstatic.com/ig/modules/global_football/he_ALL.xml" language_direction="rtl"/>
  <Locale lang="hi" messages="http://www.gstatic.com/ig/modules/global_football/hi_ALL.xml"/>
  <Locale lang="hr" messages="http://www.gstatic.com/ig/modules/global_football/hr_ALL.xml"/>
  <Locale lang="hu" messages="http://www.gstatic.com/ig/modules/global_football/hu_ALL.xml"/>
  <Locale lang="hy" messages="http://www.gstatic.com/ig/modules/global_football/hy_ALL.xml"/>
  <Locale lang="id" messages="http://www.gstatic.com/ig/modules/global_football/id_ALL.xml"/>
  <Locale lang="in" messages="http://www.gstatic.com/ig/modules/global_football/in_ALL.xml"/>
  <Locale lang="is" messages="http://www.gstatic.com/ig/modules/global_football/is_ALL.xml"/>
  <Locale lang="it" messages="http://www.gstatic.com/ig/modules/global_football/it_ALL.xml"/>
  <Locale lang="iw" messages="http://www.gstatic.com/ig/modules/global_football/iw_ALL.xml" language_direction="rtl"/>
  <Locale lang="ja" messages="http://www.gstatic.com/ig/modules/global_football/ja_ALL.xml"/>
  <Locale lang="ko" messages="http://www.gstatic.com/ig/modules/global_football/ko_ALL.xml"/>
  <Locale lang="ln" messages="http://www.gstatic.com/ig/modules/global_football/ln_ALL.xml"/>
  <Locale lang="lt" messages="http://www.gstatic.com/ig/modules/global_football/lt_ALL.xml"/>
  <Locale lang="lv" messages="http://www.gstatic.com/ig/modules/global_football/lv_ALL.xml"/>
  <Locale lang="mo" messages="http://www.gstatic.com/ig/modules/global_football/mo_ALL.xml"/>
  <Locale lang="ms" messages="http://www.gstatic.com/ig/modules/global_football/ms_ALL.xml"/>
  <Locale lang="nl" messages="http://www.gstatic.com/ig/modules/global_football/nl_ALL.xml"/>
  <Locale lang="no" messages="http://www.gstatic.com/ig/modules/global_football/no_ALL.xml"/>
  <Locale lang="pl" messages="http://www.gstatic.com/ig/modules/global_football/pl_ALL.xml"/>
  <Locale lang="pt" messages="http://www.gstatic.com/ig/modules/global_football/pt_ALL.xml"/>
  <Locale lang="pt-BR" messages="http://www.gstatic.com/ig/modules/global_football/pt_BR_ALL.xml"/>
  <Locale lang="pt-PT" messages="http://www.gstatic.com/ig/modules/global_football/pt_PT_ALL.xml"/>
  <Locale lang="ro" messages="http://www.gstatic.com/ig/modules/global_football/ro_ALL.xml"/>
  <Locale lang="ru" messages="http://www.gstatic.com/ig/modules/global_football/ru_ALL.xml"/>
  <Locale lang="sk" messages="http://www.gstatic.com/ig/modules/global_football/sk_ALL.xml"/>
  <Locale lang="sl" messages="http://www.gstatic.com/ig/modules/global_football/sl_ALL.xml"/>
  <Locale lang="sr" messages="http://www.gstatic.com/ig/modules/global_football/sr_ALL.xml"/>
  <Locale lang="sv" messages="http://www.gstatic.com/ig/modules/global_football/sv_ALL.xml"/>
  <Locale lang="th" messages="http://www.gstatic.com/ig/modules/global_football/th_ALL.xml"/>
  <Locale lang="tl" messages="http://www.gstatic.com/ig/modules/global_football/tl_ALL.xml"/>
  <Locale lang="tr" messages="http://www.gstatic.com/ig/modules/global_football/tr_ALL.xml"/>
  <Locale lang="uk" messages="http://www.gstatic.com/ig/modules/global_football/uk_ALL.xml"/>
  <Locale lang="vi" messages="http://www.gstatic.com/ig/modules/global_football/vi_ALL.xml"/>
  <Locale lang="zh" messages="http://www.gstatic.com/ig/modules/global_football/zh_ALL.xml"/>
  <Locale lang="zh-CN" messages="http://www.gstatic.com/ig/modules/global_football/zh_CN_ALL.xml"/>
  <Locale lang="zh-HK" messages="http://www.gstatic.com/ig/modules/global_football/zh_HK_ALL.xml"/>
  <Locale lang="zh-TW" messages="http://www.gstatic.com/ig/modules/global_football/zh_TW_ALL.xml"/>
  <Require feature="tabs"/>
  <Require feature="setprefs"/>
  <Require feature="views"/>
  <Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="favorites" datatype="hidden" default_value=""/>
<UserPref name="nonfavorites" datatype="hidden" default_value=""/>
<UserPref name="show_my_teams" datatype="hidden" default_value="true"/>
<UserPref name="selected_league" datatype="hidden" default_value=""/>
<Content type="html" view="home, preview,canvas">
<![CDATA[
<div id="gadget-master-div">
  <div id="tabs-container">
  </div>
  <div id="content-div" style="display:none;"></div>
  <div style="position: absolute; width: 100%;">
    <div class="league-tooltip" id="tooltip"
        style="opacity: 0; visibility: hidden;">
      <p id="tooltip-text"></p>
    </div>
  </div>
  <div id="gadget-footer"></div>
</div>
<style type="text/css">
.menulist{color:#333;display:block;font-size:13px!important;font-weight:normal;line-height:25px!important;padding:0 4px 0 12px;text-align:left;white-space:nowrap}.menulist.hover{background-color:#f1f1f1}.scrollBarBox{-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-webkit-box-sizing:border-box;background:#fff;border:1px solid #bbb;box-shadow:0 2px 4px rgba(0,0,0,.2);display:none;height:auto;left:1px;margin:0 0 0 -1px;position:absolute;top:28px;z-index:88}.scrollBarInner{display:block;height:auto;margin:0;overflow-x:auto;overflow-y:auto;padding:0}::-webkit-scrollbar{background:transparent;height:15px;overflow:visible;width:15px}::-webkit-scrollbar-thumb:vertical{background-color:rgba(0,0,0,.2);border-bottom:6px solid #fff;border-left:4px solid #fff;border-right:4px solid #fff;border-top:6px solid #fff;height:20px}::-webkit-scrollbar-thumb:horizontal{background-color:rgba(0,0,0,.2);border-bottom:4px solid #fff;border-left:6px solid #fff;border-right:6px solid #fff;border-top:4px solid #fff;width:20px}::-webkit-scrollbar-thumb:vertical:hover,::-webkit-scrollbar-thumb:horizontal:hover{background-color:rgba(0,0,0,.4)}::-webkit-scrollbar-button{display:block;height:15px;opacity:0;width:15px}::-webkit-scrollbar-button:vertical,::-webkit-scrollbar-button:horizontal{background:url('//www.gstatic.com/ig/modules/gadgetfactory/v2/icons_sprite.cache.png')}::-webkit-scrollbar-button:vertical:start:decrement{background-position:-92px -1px}::-webkit-scrollbar-button:vertical:end:increment{background-position:-56px -1px}::-webkit-scrollbar-button:vertical:start:decrement:hover{background-position:-74px -1px}::-webkit-scrollbar-button:vertical:end:increment:hover{background-position:-38px -1px}::-webkit-scrollbar-button:horizontal:start:decrement{background-position:-55px -18px}::-webkit-scrollbar-button:horizontal:end:increment{background-position:-91px -18px}::-webkit-scrollbar-button:horizontal:start:decrement:hover{background-position:-37px -18px}::-webkit-scrollbar-button:horizontal:end:increment:hover{background-position:-73px -18px}::-webkit-scrollbar-button:start:increment,::-webkit-scrollbar-button:end:decrement{display:none}.kd-dropdown-cntnr{display:inline-block;outline:none;position:relative;vertical-align:top}.kd-dropdown-cntnr.ie{z-index:1}.kd-dropdown{-moz-border-radius:2px;-webkit-border-radius:2px;-moz-user-select:none;-webkit-user-select:none;filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f5f5f5',EndColorStr='#f1f1f1');background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-moz-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-ms-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-o-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:linear-gradient(top,#f5f5f5,#f1f1f1);border:1px solid #ccc;border-radius:2px;color:#444;cursor:default;display:inline-block;height:27px;outline:none;text-align:left;text-decoration:none;vertical-align:top;width:auto}.kd-dropdown.hover{-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f8f8f8',EndColorStr='#f1f1f1');background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-moz-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-ms-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-o-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #c6c6c6;box-shadow:0 1px 1px rgba(0,0,0,.1);color:#222}.kd-dropdown.selected{-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(StartColorStr='#eeeeee',EndColorStr='#e0e0e0');background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#eee,#e0e0e0);background-image:-moz-linear-gradient(top,#eee,#e0e0e0);background-image:-ms-linear-gradient(top,#eee,#e0e0e0);background-image:-o-linear-gradient(top,#eee,#e0e0e0);background-image:linear-gradient(top,#eee,#e0e0e0);border:1px solid #ccc;box-shadow:inset 0 1px 2px rgba(0,0,0,.1);color:#333;outline:none}.kd-dropdown .dropdown-img{background-image:url('//www.gstatic.com/ig/modules/gadgetfactory/v2/icons_sprite.cache.png');background-position:-24px 0;background-repeat:no-repeat;display:inline-block;float:right;height:12px;margin:5px 8px 0 0;opacity:.667;width:8px}.kd-dropdown.selected .dropdown-img,.kd-dropdown.hover .dropdown-img{opacity:.9}.dropdown-txt{display:inline-block;font-size:11px!important;font-weight:bold;line-height:18px;overflow:hidden;padding:4px 10px 0 5px;width:auto;white-space:nowrap}input.kd-button{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;font:11px arial!important;font-weight:bold!important;height:27px;margin:1px 0 0 5px;min-width:54px;outline:none;padding-bottom:0;text-align:center;vertical-align:top;width:auto}.button-focus{-moz-box-shadow:inset 0 0 0 1px #fff;-ms-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}.normal{background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,.1);color:#444!important}.hover-normal{-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f8f8f8',EndColorStr='#f1f1f1');background-color:#f8f8f8;background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-moz-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-ms-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-o-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #c6c6c6;box-shadow:0 1px 1px rgba(0,0,0,.1);color:#222!important}.focus-normal{border:1px solid #4d90fe}.blue{background-color:#4d90f0;border:1px solid #3079ed;color:#fff!important}.hover-blue{filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#357ae8');background-color:#357ae8;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#357ae8));background-image:-webkit-linear-gradient(top,#4d90fe,#357ae8);background-image:-moz-linear-gradient(top,#4d90fe,#357ae8);background-image:-ms-linear-gradient(top,#4d90fe,#357ae8);background-image:-o-linear-gradient(top,#4d90fe,#357ae8);background-image:linear-gradient(top,#4d90fe,#357ae8);border:1px solid #2f5bb7}.red{background-color:#d14836;border:1px solid transparent;color:#fff!important;text-transform:uppercase}.hover-red{-moz-box-shadow:0 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.2);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#dd4b39',EndColorStr='#c53727');background-color:#c53727;background-image:-webkit-gradient(linear,left top,left bottom,from(#dd4b39),to(#c53727));background-image:-webkit-linear-gradient(top,#dd4b39,#c53727);background-image:-moz-linear-gradient(top,#dd4b39,#c53727);background-image:-ms-linear-gradient(top,#dd4b39,#c53727);background-image:-o-linear-gradient(top,#dd4b39,#c53727);background-image:linear-gradient(top,#dd4b39,#c53727);border:1px solid #b0281a;border-bottom:1px solid #af301f;box-shadow:0 1px 1px rgba(0,0,0,.2)}body,p,span,td{color:#333;font-family:arial,sans-serif;font-size:13px;line-height:18px}a,a:link{color:#15c;text-decoration:none}a:visited{color:#61c;text-decoration:none}a:hover{color:#15c;text-decoration:underline}a:active{color:#d14836;text-decoration:underline}table{border-spacing:0;color:#555;font-size:13px}img{border:0 none}#gadget-master-div{border:0;height:auto;margin:0;overflow:hidden;padding:0;width:100%}#content-div{color:#525252;font-family:arial,helvetica,sans-serif;font-size:12px}.tablib_table{border-collapse:separate;border-spacing:0;empty-cells:show;font-size:12px;text-align:center;width:100%}.tablib_selected,.tablib_unselected{border-color:#aaa;font-weight:bold;text-align:center;width:90px}.tablib_unselected{background:#ededed;color:#ccc}.tablib_selected{color:#000}.tablib_unselected a:hover{text-decoration:underline}.tablib_emptyTab{border-bottom:1px solid #676767;font-size:16px;padding:0 1px;width:5px}.tablib_emptyTab_custom{border-bottom:1px solid #aaa;padding:0 1px;text-align:__BIDI_START_EDGE__}.tablib_spacerTab{border-bottom:1px solid #676767;padding:0 1px;width:1px}.tablib_navContainer{vertical-align:middle;width:10px}.tablib_navContainer a:link,.tablib_navContainer a:visited,.tablib_navContainer a:hover{color:#36a;text-decoration:none}.tablib_selected span,.tablib_unselected span{margin-__BIDI_END_EDGE__:5px}.tablib_selected a,.tablib_unselected a{display:inline;margin-__BIDI_START_EDGE__:5px;text-decoration:none;white-space:nowrap}.tablib_selected a{color:#000}.tablib_unselected a{color:#525252}.tablib_selected img,.tablib_unselected img{border:0 none}.sub-tabs,#gadget-footer{color:#555;font-size:11px;line-height:25px;width:100%}.sub-tabs{padding:2px 0 4px 0}#gadget-footer{height:19px;line-height:25px;border-bottom:0;border-top:1px solid #dfdfdf;font-size:12px}.sub-tabs span{padding-__BIDI_START_EDGE__:5px}.gadget-footer-links{float:left;margin-__BIDI_START_EDGE__:0;height:20px}.gadget-footer-options{color:#555;float:right;height:20px;margin-__BIDI_END_EDGE__:0;text-align:__BIDI_END_EDGE__}.canvas-section-title{font-size:14px;font-weight:normal;height:25px;margin-bottom:5px}.canvas-section-title a{font-size:13px}.canvas-td-containers{padding:10px;vertical-align:top}.standing-table,.standing-table-news,.venue-table{height:209px;margin:0 0 8px 0;overflow-x:none;overflow-y:auto;width:100%}.venue-table-canvas{float:left;height:528px;overflow-x:none;overflow-y:auto;width:100%}.standing-table td,.teams-standing-table td,.standing-table-canvas td{border-bottom:1px solid #ebebeb;vertical-align:top}.standing-table-news td,.standing-table-canvas-news td,.standing-table-canvas-teams td{background-position:left bottom;background-repeat:repeat-x;height:19px;line-height:14px;vertical-align:top}.standing-table-canvas-news,.standing-table-canvas-teams{margin-top:5px}.standing-table-header{background-color:#f5f5f5;color:#555;height:25px;padding-__BIDI_END_EDGE__:6px}.standing-table-header td,.standing-table-header span{color:#555}.standing-table-team-cell,.standing-table-team-cell-fix{padding-__BIDI_START_EDGE__:7px}.schedule-table-result-cell a{color:#525252;cursor:default;text-decoration:none}.standing-table-team-cell span,.schedule-table-team-cell span,.standing-table-team-cell-fix span{color:#222;cursor:default;font-weight:bold;text-decoration:none}.schedule-day-table td{border-bottom:1px solid #ebebeb;height:25px;line-height:18px}.schedule-table-head{background-color:#f5f5f5;color:#555;font-size:11px;padding:0 4px 0 0}.leagues-list{height:200px;margin:8px 0;overflow-y:auto}.leagues-row td{border-bottom:1px solid #ebebeb;height:20px;line-height:20px;vertical-align:middle}.leagues-title{margin:8px 0}.leagues-title h1{color:#333;font-size:14px;font-weight:normal;margin:0}.leagues-title p{color:#555;margin:2px 0 8px}.btn-left,.btn-right,.remove-btn{background-image:url('//www.gstatic.com/ig/modules/global_football/v2/sprite_fifa.cache.png');display:block!important;height:12px;overflow:hidden;width:12px}.btn-plus{background-image:url('//www.gstatic.com/ig/modules/gadgetfactory/sprite_fifa.cache.png');background-position:0 0;display:block!important;height:12px;overflow:hidden;width:12px}.btn-plus:hover{background-position:0 -12px}.btn-plus span,.btn-left span,.btn-right span{display:none;visibility:hidden}.btn-left:hover{background-position:0 -91px}.btn-left{background-position:0 -75px}.btn-right:hover{background-position:-15px -91px}.btn-right{background-position:-15px -75px}.remove-btn{background-position:0 -107px;height:7px;margin-top:1px;opacity:1}.solid-line-bottom{border-bottom:1px solid #e5e5e5}.solid-line-left{border-left:1px solid #e5e5e5}.match-table-head,.match-table-date{background-color:#f5f5f5;color:#555;height:25px;margin:0 17px;padding:0 17px;text-align:__BIDI_END_EDGE__}.match-table-home-team,.match-table-home-score,.match-table-away-team,.match-table-away-score{background-color:#f6f6f6;font-size:17px;font-weight:bold;height:40px;line-height:40px}.match-table-away-team,.match-table-home-team{text-align:__BIDI_START_EDGE__}.match-table-home-score,.match-table-away-score{color:#999;text-align:center}.padding-right{padding-__BIDI_END_EDGE__:10px}.padding-table{padding-top:20px}.padding-left{padding-__BIDI_START_EDGE__:10px}#schedule-container{height:190px;margin:0 0 7px 0;overflow-y:auto;width:100%}#schedule-dayselector-canvas{border:1px solid #ccc;height:25px;padding:0 5px}.fav-icon{cursor:default;display:block;height:16px;overflow:hidden;position:relative;width:13px}.fav-icon-off{cursor:pointer;left:-1px;position:absolute;top:-29px}.fav-icon-on{cursor:pointer;left:-16px;position:absolute;top:-29px}#tab-btn-add{margin-__BIDI_START_EDGE__:4px}.text{font-size:13px}#tooltip{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;background-position:top left;background-repeat:no-repeat;box-sizing:border-box;color:#fff;display:block;height:27px;left:0;margin-__BIDI_START_EDGE__:10px;outline:1px solid rgba(255,255,255,.5);position:absolute;top:-22px;visibility:hidden;width:auto;z-index:10}.team-tooltip{background-image:url('//www.gstatic.com/ig/modules/global_football/v2/tooltip_teams_blue.cache.png')}.league-tooltip{background-image:url('//www.gstatic.com/ig/modules/global_football/v2/tooltip_leagues_blue.cache.png')}#tooltip-text{color:#fff;display:inline;font-size:11px;font-weight:bold;line-height:18px;padding:0 5px}.standing-table-group-cell{font-size:12px;font-weight:bold;padding-bottom:3px}.teams-league-name{color:#222;cursor:default;font-weight:bold;margin-__BIDI_START_EDGE__:7px;text-decoration:none}.query-table td{background-image:none;height:18px;line-height:25px}.query-table select{direction:ltr}#leagues-teams{height:255px;margin:5px 0 8px;overflow-y:auto;width:100%}.teams-league-head{line-height:27px;margin-bottom:2px}#team-selector-panel{border-bottom:1px solid #ccc;padding-bottom:5px}.teams_league{padding-bottom:10px}.suspended_match{color:#c00}.loading{height:222px;text-align:center}.border{border-bottom:1px solid #e5e5e5}.more{float:__BIDI_END_EDGE__}.highlight{background:#f5f5f5}.un-highlight{cursor:pointer;background-color:#fff}.matchResult table{border:1px solid #f1f1f1}.matchResult .odd-row{background:#f7f7f7}gadgets/modules/gadgetfactory/kennedy_dropdown.css gadgets/modules/gadgetfactory/kennedy_button.css gadgets/modules/global_football/v2/global_football.css.menulist{color:#333;display:block;font-size:13px !important;font-weight:normal;line-height:25px !important;padding:0 4px 0 12px;text-align:left;white-space:nowrap}.menulist.hover{background-color:#f1f1f1}.scrollBarBox{-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-webkit-box-sizing:border-box;background:#fff;border:1px solid #bbb;box-shadow:0 2px 4px rgba(0,0,0,.2);display:none;height:auto;left:1px;margin:0 0 0 -1px;position:absolute;top:28px;z-index:88}.scrollBarInner{display:block;height:auto;margin:0;overflow-x:auto;overflow-y:auto;padding:0}::-webkit-scrollbar{background:transparent;height:15px;overflow:visible;width:15px}::-webkit-scrollbar-thumb:vertical{background-color:rgba(0,0,0,.2);border-bottom:6px solid #fff;border-left:4px solid #fff;border-right:4px solid #fff;border-top:6px solid #fff;height:20px}::-webkit-scrollbar-thumb:horizontal{background-color:rgba(0,0,0,.2);border-bottom:4px solid #fff;border-left:6px solid #fff;border-right:6px solid #fff;border-top:4px solid #fff;width:20px}::-webkit-scrollbar-thumb:vertical:hover,::-webkit-scrollbar-thumb:horizontal:hover{background-color:rgba(0,0,0,.4)}::-webkit-scrollbar-button{display:block;height:15px;opacity:0;width:15px}::-webkit-scrollbar-button:vertical,::-webkit-scrollbar-button:horizontal{background:url('//www.gstatic.com/ig/modules/gadgetfactory/v2/icons_sprite.cache.png')}::-webkit-scrollbar-button:vertical:start:decrement{background-position:-92px -1px}::-webkit-scrollbar-button:vertical:end:increment{background-position:-56px -1px}::-webkit-scrollbar-button:vertical:start:decrement:hover{background-position:-74px -1px}::-webkit-scrollbar-button:vertical:end:increment:hover{background-position:-38px -1px}::-webkit-scrollbar-button:horizontal:start:decrement{background-position:-55px -18px}::-webkit-scrollbar-button:horizontal:end:increment{background-position:-91px -18px}::-webkit-scrollbar-button:horizontal:start:decrement:hover{background-position:-37px -18px}::-webkit-scrollbar-button:horizontal:end:increment:hover{background-position:-73px -18px}::-webkit-scrollbar-button:start:increment,::-webkit-scrollbar-button:end:decrement{display:none}.kd-dropdown-cntnr{display:inline-block;outline:none;position:relative;vertical-align:top}.kd-dropdown-cntnr.ie{z-index:1}.kd-dropdown{-moz-border-radius:2px;-webkit-border-radius:2px;-moz-user-select:none;-webkit-user-select:none;filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f5f5f5',EndColorStr='#f1f1f1');background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-moz-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-ms-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:-o-linear-gradient(top,#f5f5f5,#f1f1f1);background-image:linear-gradient(top,#f5f5f5,#f1f1f1);border:1px solid #ccc;border-radius:2px;color:#444;cursor:default;display:inline-block;height:27px;outline:none;text-align:left;text-decoration:none;vertical-align:top;width:auto}.kd-dropdown.hover{-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f8f8f8',EndColorStr='#f1f1f1');background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-moz-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-ms-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-o-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #c6c6c6;box-shadow:0 1px 1px rgba(0,0,0,.1);color:#222}.kd-dropdown.selected{-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(StartColorStr='#eeeeee',EndColorStr='#e0e0e0');background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#eee,#e0e0e0);background-image:-moz-linear-gradient(top,#eee,#e0e0e0);background-image:-ms-linear-gradient(top,#eee,#e0e0e0);background-image:-o-linear-gradient(top,#eee,#e0e0e0);background-image:linear-gradient(top,#eee,#e0e0e0);border:1px solid #ccc;box-shadow:inset 0 1px 2px rgba(0,0,0,.1);color:#333;outline:none}.kd-dropdown .dropdown-img{background-image:url('//www.gstatic.com/ig/modules/gadgetfactory/v2/icons_sprite.cache.png');background-position:-24px 0;background-repeat:no-repeat;display:inline-block;float:right;height:12px;margin:5px 8px 0 0;opacity:.667;width:8px}.kd-dropdown.selected .dropdown-img,.kd-dropdown.hover .dropdown-img{opacity:.9}.dropdown-txt{display:inline-block;font-size:11px !important;font-weight:bold;line-height:18px;overflow:hidden;padding:4px 10px 0 5px;width:auto;white-space:nowrap}input.kd-button{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;font:11px arial !important;font-weight:bold !important;height:27px;margin:1px 0 0 5px;min-width:54px;outline:none;padding-bottom:0;text-align:center;vertical-align:top;width:auto}.button-focus{-moz-box-shadow:inset 0 0 0 1px #fff;-ms-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}.normal{background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,.1);color:#444 !important}.hover-normal{-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#f8f8f8',EndColorStr='#f1f1f1');background-color:#f8f8f8;background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-moz-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-ms-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:-o-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #c6c6c6;box-shadow:0 1px 1px rgba(0,0,0,.1);color:#222 !important}.focus-normal{border:1px solid #4d90fe}.blue{background-color:#4d90f0;border:1px solid #3079ed;color:#fff !important}.hover-blue{filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#357ae8');background-color:#357ae8;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#357ae8));background-image:-webkit-linear-gradient(top,#4d90fe,#357ae8);background-image:-moz-linear-gradient(top,#4d90fe,#357ae8);background-image:-ms-linear-gradient(top,#4d90fe,#357ae8);background-image:-o-linear-gradient(top,#4d90fe,#357ae8);background-image:linear-gradient(top,#4d90fe,#357ae8);border:1px solid #2f5bb7}.red{background-color:#d14836;border:1px solid transparent;color:#fff !important;text-transform:uppercase}.hover-red{-moz-box-shadow:0 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.2);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#dd4b39',EndColorStr='#c53727');background-color:#c53727;background-image:-webkit-gradient(linear,left top,left bottom,from(#dd4b39),to(#c53727));background-image:-webkit-linear-gradient(top,#dd4b39,#c53727);background-image:-moz-linear-gradient(top,#dd4b39,#c53727);background-image:-ms-linear-gradient(top,#dd4b39,#c53727);background-image:-o-linear-gradient(top,#dd4b39,#c53727);background-image:linear-gradient(top,#dd4b39,#c53727);border:1px solid #b0281a;border-bottom:1px solid #af301f;box-shadow:0 1px 1px rgba(0,0,0,.2)}body,p,span,td{color:#333;font-family:arial,sans-serif;font-size:13px;line-height:18px}a,a:link{color:#15c;text-decoration:none}a:visited{color:#61c;text-decoration:none}a:hover{color:#15c;text-decoration:underline}a:active{color:#d14836;text-decoration:underline}table{border-spacing:0;color:#555;font-size:13px}img{border:0 none}#gadget-master-div{border:0;height:auto;margin:0;overflow:hidden;padding:0;width:100%}#content-div{color:#525252;font-family:arial,helvetica,sans-serif;font-size:12px}.tablib_table{border-collapse:separate;border-spacing:0;empty-cells:show;font-size:12px;text-align:center;width:100%}.tablib_selected,.tablib_unselected{border-color:#aaa;font-weight:bold;text-align:center;width:90px}.tablib_unselected{background:#ededed;color:#ccc}.tablib_selected{color:#000}.tablib_unselected a:hover{text-decoration:underline}.tablib_emptyTab{border-bottom:1px solid #676767;font-size:16px;padding:0 1px;width:5px}.tablib_emptyTab_custom{border-bottom:1px solid #aaa;padding:0 1px;text-align:__BIDI_START_EDGE__}.tablib_spacerTab{border-bottom:1px solid #676767;padding:0 1px;width:1px}.tablib_navContainer{vertical-align:middle;width:10px}.tablib_navContainer a:link,.tablib_navContainer a:visited,.tablib_navContainer a:hover{color:#36a;text-decoration:none}.tablib_selected span,.tablib_unselected span{margin-__BIDI_END_EDGE__:5px}.tablib_selected a,.tablib_unselected a{display:inline;margin-__BIDI_START_EDGE__:5px;text-decoration:none;white-space:nowrap}.tablib_selected a{color:#000}.tablib_unselected a{color:#525252}.tablib_selected img,.tablib_unselected img{border:0 none}.sub-tabs,#gadget-footer{color:#555;font-size:11px;line-height:25px;width:100%}.sub-tabs{padding:2px 0 4px 0}#gadget-footer{height:19px;line-height:25px;border-bottom:0;border-top:1px solid #dfdfdf;font-size:12px}.sub-tabs span{padding-__BIDI_START_EDGE__:5px}.gadget-footer-links{float:left;margin-__BIDI_START_EDGE__:0;height:20px}.gadget-footer-options{color:#555;float:right;height:20px;margin-__BIDI_END_EDGE__:0;text-align:__BIDI_END_EDGE__}.canvas-section-title{font-size:14px;font-weight:normal;height:25px;margin-bottom:5px}.canvas-section-title a{font-size:13px}.canvas-td-containers{padding:10px;vertical-align:top}.standing-table,.standing-table-news,.venue-table{height:209px;margin:0 0 8px 0;overflow-x:none;overflow-y:auto;width:100%}.venue-table-canvas{float:left;height:528px;overflow-x:none;overflow-y:auto;width:100%}.standing-table td,.teams-standing-table td,.standing-table-canvas td{border-bottom:1px solid #ebebeb;vertical-align:top}.standing-table-news td,.standing-table-canvas-news td,.standing-table-canvas-teams td{background-position:left bottom;background-repeat:repeat-x;height:19px;line-height:14px;vertical-align:top}.standing-table-canvas-news,.standing-table-canvas-teams{margin-top:5px}.standing-table-header{background-color:#f5f5f5;color:#555;height:25px;padding-__BIDI_END_EDGE__:6px}.standing-table-header td,.standing-table-header span{color:#555}.standing-table-team-cell,.standing-table-team-cell-fix{padding-__BIDI_START_EDGE__:7px}.schedule-table-result-cell a{color:#525252;cursor:default;text-decoration:none}.standing-table-team-cell span,.schedule-table-team-cell span,.standing-table-team-cell-fix span{color:#222;cursor:default;font-weight:bold;text-decoration:none}.schedule-day-table td{border-bottom:1px solid #ebebeb;height:25px;line-height:18px}.schedule-table-head{background-color:#f5f5f5;color:#555;font-size:11px;padding:0 4px 0 0}.leagues-list{height:200px;margin:8px 0;overflow-y:auto}.leagues-row td{border-bottom:1px solid #ebebeb;height:20px;line-height:20px;vertical-align:middle}.leagues-title{margin:8px 0}.leagues-title h1{color:#333;font-size:14px;font-weight:normal;margin:0}.leagues-title p{color:#555;margin:2px 0 8px}.btn-left,.btn-right,.remove-btn{background-image:url(//www.gstatic.com/ig/modules/global_football/v2/sprite_fifa.cache.png);display:block !important;height:12px;overflow:hidden;width:12px}.btn-plus{background-image:url(//www.gstatic.com/ig/modules/gadgetfactory/sprite_fifa.cache.png);background-position:0 0;display:block !important;height:12px;overflow:hidden;width:12px}.btn-plus:hover{background-position:0 -12px}.btn-plus span,.btn-left span,.btn-right span{display:none;visibility:hidden}.btn-left:hover{background-position:0 -91px}.btn-left{background-position:0 -75px}.btn-right:hover{background-position:-15px -91px}.btn-right{background-position:-15px -75px}.remove-btn{background-position:0 -107px;height:7px;margin-top:1px;opacity:1}.solid-line-bottom{border-bottom:1px solid #e5e5e5}.solid-line-left{border-left:1px solid #e5e5e5}.match-table-head,.match-table-date{background-color:#f5f5f5;color:#555;height:25px;margin:0 17px;padding:0 17px;text-align:__BIDI_END_EDGE__}.match-table-home-team,.match-table-home-score,.match-table-away-team,.match-table-away-score{background-color:#f6f6f6;font-size:17px;font-weight:bold;height:40px;line-height:40px}.match-table-away-team,.match-table-home-team{text-align:__BIDI_START_EDGE__}.match-table-home-score,.match-table-away-score{color:#999;text-align:center}.padding-right{padding-__BIDI_END_EDGE__:10px}.padding-table{padding-top:20px}.padding-left{padding-__BIDI_START_EDGE__:10px}#schedule-container{height:190px;margin:0 0 7px 0;overflow-y:auto;width:100%}#schedule-dayselector-canvas{border:1px solid #ccc;height:25px;padding:0 5px}.fav-icon{cursor:default;display:block;height:16px;overflow:hidden;position:relative;width:13px}.fav-icon-off{cursor:pointer;left:-1px;position:absolute;top:-29px}.fav-icon-on{cursor:pointer;left:-16px;position:absolute;top:-29px}#tab-btn-add{margin-__BIDI_START_EDGE__:4px}.text{font-size:13px}#tooltip{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;background-position:top left;background-repeat:no-repeat;box-sizing:border-box;color:#fff;display:block;height:27px;left:0;margin-__BIDI_START_EDGE__:10px;outline:1px solid rgba(255,255,255,.5);position:absolute;top:-22px;visibility:hidden;width:auto;z-index:10}.team-tooltip{background-image:url(//www.gstatic.com/ig/modules/global_football/v2/tooltip_teams_blue.cache.png)}.league-tooltip{background-image:url(//www.gstatic.com/ig/modules/global_football/v2/tooltip_leagues_blue.cache.png)}#tooltip-text{color:#fff;display:inline;font-size:11px;font-weight:bold;line-height:18px;padding:0 5px}.standing-table-group-cell{font-size:12px;font-weight:bold;padding-bottom:3px}.teams-league-name{color:#222;cursor:default;font-weight:bold;margin-__BIDI_START_EDGE__:7px;text-decoration:none}.query-table td{background-image:none;height:18px;line-height:25px}.query-table select{direction:ltr}#leagues-teams{height:255px;margin:5px 0 8px;overflow-y:auto;width:100%}.teams-league-head{line-height:27px;margin-bottom:2px}#team-selector-panel{border-bottom:1px solid #ccc;padding-bottom:5px}.teams_league{padding-bottom:10px}.suspended_match{color:#c00}.loading{height:222px;text-align:center}.border{border-bottom:1px solid #e5e5e5}.more{float:__BIDI_END_EDGE__}.highlight{background:#f5f5f5}.un-highlight{cursor:pointer;background-color:#fff}.matchResult table{border:1px solid #f1f1f1}.matchResult .odd-row{background:#f7f7f7}
</style>
<script>
/**
 * Substitution variables whose values depends on the direction of the gadget.
 */
var bidiStart = '__BIDI_START_EDGE__';
var bidiEnd = '__BIDI_END_EDGE__';
</script>
<script type="text/javascript">
var soccerTabs=new _IG_Tabs(null,0,_gel("tabs-container")),leaguesType={FAVORITES:"favorites",NON_FAVORITES:"nonfavorites"},timeOutIdToolTip=-1,isTabSelected=!0;function bind(fn,obj,var_args){var args=arguments;return function(){for(var callArgs=[],i=0;i<arguments.length;i++)callArgs.push(arguments[i]);for(i=2;i<args.length;i++)callArgs.push(args[i]);return fn.apply(obj,callArgs)}}function toYYYYMM(date){var month=date.getMonth()+1;return date.getFullYear()+(10>month?"0"+month:month.toString())}
function isHomeView(){var view=gadgets&&gadgets.views&&gadgets.views.getCurrentView();return view?"canvas"!=view.getName().toLowerCase():!0}function writeHtml(htmlId,content){_gel(htmlId)&&(_gel(htmlId).innerHTML=content)}function getTime(eventDate){var hrs=eventDate.getHours();10>hrs&&(hrs="0"+hrs);var mins=eventDate.getMinutes();10>mins&&(mins="0"+mins);var locale=userPrefs.getLang(),separator="id"==locale||"no"==locale?".":":";return hrs+separator+mins}
function getDateObj(fullDateString){var date=new Date(fullDateString.substr(0,4),fullDateString.substr(4,2)-1,fullDateString.substr(6,2),fullDateString.substr(8,2),fullDateString.substr(10,2),fullDateString.substr(12,2)),offset=60*Number(fullDateString.substr(15,2))+Number(fullDateString.substr(17,2)),offset=Number(fullDateString.substr(14,1)+offset/60);date.setHours(date.getHours()-offset-date.getTimezoneOffset()/60);return date}
function parseIntFromAttr(element,attr){var style=window.getComputedStyle(element,""),value=style.getPropertyValue(attr);value.match(/^([0-9]+)/);var ret=parseInt(RegExp.$1,10);return isNaN(ret)?0:ret}
function getHeightForWebkit(element){var result=0;"undefined"!==typeof element.offsetTop&&"undefined"!==typeof element.offsetHeight&&(result=element.offsetTop+element.offsetHeight+parseIntFromAttr(element,"margin-bottom")+parseIntFromAttr(element,"margin-top"));return result=result+parseIntFromAttr(document.body,"border-bottom")+parseIntFromAttr(document.body,"margin-bottom")+parseIntFromAttr(document.body,"padding-bottom")}
function gadgetAdjustHeight(){var masterDiv=_gel("gadget-master-div");null!=masterDiv&&0<=navigator.userAgent.indexOf("AppleWebKit")?_IG_AdjustIFrameHeight(getHeightForWebkit(masterDiv)):_IG_AdjustIFrameHeight()}Array.prototype.findIndex=function(element){for(var i=0;i<this.length;i++)if(this[i].toString().toLowerCase()===element.toLowerCase())return i;return-1};
function addListener(fn,obj,var_args){var args=arguments;return function(){for(var callArgs=[],i=2;i<args.length;i++)callArgs.push(args[i]);return fn.apply(obj,callArgs)}}function UserPrefs(){this.igPrefs_=new _IG_Prefs;this.savedPrefs_={};this.isShowMyTeams=this.igPrefs_.getBool(UserPrefs.SHOW_MY_TEAMS_PREF);this.selectedLeague=this.igPrefs_.getString(UserPrefs.SELECTED_LEAGUE_PREF);this.setUserPrefsValue()}UserPrefs.FAVORITES_PREF="favorites";UserPrefs.NON_FAVORITES_PREF="nonfavorites";
UserPrefs.SELECTED_LEAGUE_PREF="selected_league";UserPrefs.SHOW_MY_TEAMS_PREF="show_my_teams";UserPrefs.prototype.setUserPrefsValue=function(){this.setValues(UserPrefs.FAVORITES_PREF);this.setValues(UserPrefs.NON_FAVORITES_PREF)};
UserPrefs.prototype.setValues=function(type){var teams=[],leagues=[],favorites=this.igPrefs_.getString(type).split("$$"),savedLeagues=favorites[0].split(",");if(savedLeagues.length&&""!=savedLeagues[0]){for(var leagues=savedLeagues,savedTeams=favorites[1].split("|"),i=0;i<savedTeams.length;i++){var temp=savedTeams[i].split(",");temp.length&&""==temp[0]&&(temp=[]);teams.push(temp)}leagues.length!=teams.length&&(leagues=[],teams=[],this.igPrefs_.set(type,""))}this.savedPrefs_[type]={leagues:leagues,
teams:teams}};UserPrefs.prototype.getLeagues=function(type){return this.savedPrefs_[type].leagues};UserPrefs.prototype.getTeams=function(type){return this.savedPrefs_[type].teams};UserPrefs.prototype.addLeague=function(leagueId,favTeams,type){this.savedPrefs_[type].leagues.push(leagueId);this.savedPrefs_[type].teams.push(favTeams);this.saveUserPrefs(type)};
UserPrefs.prototype.removeLeague=function(leagueIndex,type){this.savedPrefs_[type].leagues.splice(leagueIndex,1);this.savedPrefs_[type].teams.splice(leagueIndex,1);this.saveUserPrefs(type)};UserPrefs.prototype.addTeamToLeague=function(leagueIndex,teamId,type){this.savedPrefs_[type].teams[leagueIndex].push(teamId);this.saveUserPrefs(type)};UserPrefs.prototype.removeTeamFromLeague=function(leagueIndex,teamIndex,type){this.savedPrefs_[type].teams[leagueIndex].splice(teamIndex,1);this.saveUserPrefs(type)};
UserPrefs.prototype.setSelectedSubTab=function(bool){this.isShowMyTeams=bool;this.igPrefs_.set(UserPrefs.SHOW_MY_TEAMS_PREF,bool)};UserPrefs.prototype.getSelectedLeague=function(){return this.selectedLeague||this.getFavoriteLeagues()[0]};UserPrefs.prototype.setSelectedLeague=function(leagueId){this.selectedLeague=leagueId;this.igPrefs_.set(UserPrefs.SELECTED_LEAGUE_PREF,leagueId)};UserPrefs.prototype.getMsg=function(message){return this.igPrefs_.getMsg(message)};UserPrefs.prototype.getLang=function(){return this.igPrefs_.getLang()};
UserPrefs.prototype.saveUserPrefs=function(type){var prefs=[this.savedPrefs_[type].leagues.join(","),this.savedPrefs_[type].teams.join("|")];this.igPrefs_.set(type,prefs.join("$$"))};var userPrefs=new UserPrefs;function Parser(){}
Parser.prototype.parseEventsData=function(response){for(var events=[],jsonObj=eval("("+response+")"),length=jsonObj.events?jsonObj.events.length:0,i=0;i<length;i++){var event=jsonObj.events[i];if(event["participant-scores"][0]&&event["participant-scores"][1]&&event.id&&event["participant-scores"][0].id&&event["participant-scores"][1].id&&event.week){var obj={};obj.status=event.status?event.status.state||"":"";obj.stadium=event.stadium?event.stadium.name||"":"";obj.date=event.date?getDateObj(event.date):
0;obj.week=event.week;obj.team1Id=event["participant-scores"][0].id||"-";obj.team2Id=event["participant-scores"][1].id||0;obj.team1Score=event["participant-scores"][0].sc||"";obj.team2Score=event["participant-scores"][1].sc||"";events.push(obj)}}return events};
Parser.prototype.parseStandingsData=function(jsonObj,league){league.standings=[];for(var groupFlag=!1,length=jsonObj.participants?jsonObj.participants.length:0,teamsMap={},i=0;i<length;i++){var obj={teamId:"",name:"",points:0,played:0,won:0,tie:0,lost:0,goalsFor:0,goalsAgainst:0,goalsDiff:0,place:"",alias:"",lastScore0:"",lastScore1:"",lastScore2:"",lastScore3:"",lastScore4:""},item=jsonObj.participants[i];obj.teamId=item.id||"-";obj.name=item["short-name"]||"-";item.standings&&0<item.standings.length&&
(obj.won=item.standings[0].w||0,obj.goalsFor=item.standings[0]["goals-for"]||0,obj.tie=item.standings[0].t||0,obj.points=item.standings[0].points||"0",obj.goalsAgainst=item.standings[0]["goals-against"]||0,obj.lost=item.standings[0].l||0,item.standings[0].lrs&&(obj.lastScore0=item.standings[0].lrs[0]||"",obj.lastScore1=item.standings[0].lrs[1]||"",obj.lastScore2=item.standings[0].lrs[2]||"",obj.lastScore3=item.standings[0].lrs[3]||"",obj.lastScore4=item.standings[0].lrs[4]||"",obj.place=item.standings[0].place||
""));obj.alias=item.alias||"";obj.group=item.div||"";obj.group&&!groupFlag&&(groupFlag=!0);obj.played=obj.won+obj.lost+obj.tie;obj.goalsDiff=obj.goalsFor-obj.goalsAgainst;league.standings.push(obj);teamsMap[obj.teamId]=obj.name}league.standings.sort(compareValue);league.teamsMap=teamsMap;league.groupFlag=groupFlag};
var parser=new Parser,LOADING_TPL='<div class="loading"><div style="padding-top:100px;"><font class="text"><img src="//www.google.com/ig/images/spinner.gif"/>&nbsp;&nbsp;'+userPrefs.getMsg("loading")+"</font></div></div>";function getDateInLocaleFormat(format,date){var day=date.getDate(),dd=10>day?"0"+day:day;return format.replace("%dd%",dd).replace("%d%",day).replace("%mmmm%",League.monthNames[date.getMonth()]).replace("%m%",date.getMonth()+1).replace("%yyyy%",date.getFullYear())}
function League(leagueId,flag,nation){this.leagueId=leagueId;this.leagueName=userPrefs.getMsg(leagueId);this.flag="//www.gstatic.com/ig/modules/global_football/"+flag;this.nation=userPrefs.getMsg(nation);this.resetValues()}
League.prototype.resetValues=function(){this.season=(new Date).getFullYear();this.tabId="";this.index=0;this.groupFlag=!1;this.standings=[];this.events=[];this.teamsMap={};this.currentDate=this.currentWeek=-1;this.isScheduleShown=!1;this.checkNextMonth=this.checkPrevMonth=this.subTabSummary=!0;this.fetchedPreEvents=this.fetchedPostEvents=!1;this.numNextQueries=this.numPrevQueries=0;this.nextQueryDate=this.prevQueryDate=""};
League.monthNames=[userPrefs.getMsg("jan"),userPrefs.getMsg("feb"),userPrefs.getMsg("mar"),userPrefs.getMsg("apr"),userPrefs.getMsg("may"),userPrefs.getMsg("jun"),userPrefs.getMsg("jul"),userPrefs.getMsg("aug"),userPrefs.getMsg("sep"),userPrefs.getMsg("oct"),userPrefs.getMsg("nov"),userPrefs.getMsg("dec")];League.MAX_QUERIES=4;League.EventsType={PRE:0,POST:1,ALL:2};League.SubTabSelected={STANDINGS:"standings",SCHEDULE:"schedule"};
League.prototype.writeLayout=function(){var tabId=this.tabId,html=['<div id="sub-tabs-',tabId,'" class="sub-tabs">'];userPrefs.isShowMyTeams?html.push(this.selectSubTab(League.SubTabSelected.STANDINGS)):html.push(this.selectSubTab(League.SubTabSelected.SCHEDULE));html.push('</div><div id="page-content-',tabId,'">',LOADING_TPL,"</div>");writeHtml(tabId,html.join(""));gadgetAdjustHeight()};
League.prototype.getTabData=function(){if(isHomeView()){var html=['<span class="gadget-footer-links">',userPrefs.getMsg("leagues")," - ",'<a href="javascript:createTeamsSection()">',userPrefs.getMsg("teams"),"</a>",'</span><span class="gadget-footer-options">','<nobr><a href="javascript:selectLeagues()">',userPrefs.getMsg("add_leagues"),"</a></nobr></span>"];_gel("gadget-footer").innerHTML=html.join("");gadgetAdjustHeight()}this.fetchTeamStandings()};
League.prototype.fetchTeamStandings=function(){var timeOutId=setTimeout(bind(this.handleErrorInStandings,this,!0),7E3),url="http://sports.apis.google.com/sportsapi?leagueId="+this.leagueId+"&qtype=standings&season="+this.season;_IG_FetchContent(url,bind(this.callBackStandings,this,timeOutId),{refreshInterval:60})};
League.prototype.callBackStandings=function(response,timeOutId){try{clearTimeout(timeOutId);var jsonObj=eval("("+response+")"),length=jsonObj.participants?jsonObj.participants.length:0,curDate=new Date;length?(parser.parseStandingsData(jsonObj,this),this.prevQueryDate=this.nextQueryDate=toYYYYMM(curDate),userPrefs.isShowMyTeams?this.showStandings():this.getEvents(-1,-1)):(this.season--,1>=curDate.getFullYear()-this.season?this.fetchTeamStandings():this.showStandings())}catch(err){this.handleErrorInStandings(!1)}};
League.prototype.handleErrorInStandings=function(tryAgain){var html=['<div style="text-align:center;padding-top:10px;">','<font class="text">'];tryAgain?html.push(userPrefs.getMsg("time_out"),"&nbsp;&nbsp;<a ",'href="javascript:selectStandingsTab()">',userPrefs.getMsg("try_now"),"</a></font></div>"):html.push(userPrefs.getMsg("no_data"),"</font></div>");writeHtml("page-content-"+this.tabId,html.join(""));gadgetAdjustHeight()};
League.prototype.showStandings=function(){this.resetValuesOnChangeSubTab();this.isScheduleShown=!1;this.subTabSummary=!0;var tabId=this.tabId;if(this.standings.length)writeHtml("sub-tabs-"+tabId,this.selectSubTab(League.SubTabSelected.STANDINGS)),isHomeView()?this.showStandingsInHome():this.showStandingsInCanvas();else{var html='<div id="sub-tabs-'+tabId+'" class="sub-tabs"><div style="text-align:center;"><font class="text">'+userPrefs.getMsg("no_data")+"&nbsp;&nbsp;</font></div></div>";writeHtml(tabId,
html);gadgetAdjustHeight()}};League.prototype.selectSubTab=function(subTabSelected){var html;return html=subTabSelected==League.SubTabSelected.STANDINGS?"<span>"+userPrefs.getMsg("standings")+'&nbsp;-&nbsp;<a href="javascript:getEvents(-1, -1)">'+userPrefs.getMsg("schedule")+"</a></span>":'<span><a href="javascript:selectStandingsTab()">'+userPrefs.getMsg("standings")+"</a>&nbsp;-&nbsp;"+userPrefs.getMsg("schedule")+"</span>"};
League.prototype.showStandingsInHome=function(){var tabId=this.tabId,html=[];this.groupFlag?html.push('<div class="standing-table">',this.createGroups(),"</div>"):html.push('<div class="standing-table"><table width="100%">',this.getStandingsContent(this.standings,1),"</table></div>");writeHtml("page-content-"+tabId,html.join(""));gadgetAdjustHeight()};
League.prototype.showStandingsInCanvas=function(){var tabId=this.tabId,teamDetails=this.standings,html=['<table width="100%" border="0"><tr>','<td class="canvas-td-containers" colspan="2">'];this.groupFlag?html.push('<div class="standing-table-canvas">',this.createGroups(),"</div>"):(html.push('<h2 class="canvas-section-title">',userPrefs.getMsg("league_standings"),"</h2>",'<div class="standing-table-canvas"><table width="100%">'),html.push(this.getStandingsContent(teamDetails,1),"</table>"));html.push('</td></tr><tr><td class="canvas-td-containers" width="50%">',
'<h2 class="canvas-section-title" id="heading-latest-matches-',tabId,'">',userPrefs.getMsg("match_day"),"&nbsp;-&nbsp;",'<a href="javascript:getEvents(-1, -1)">',userPrefs.getMsg("view_schedule"),"</a></li></h2>",'<div class="standing-table-canvas" id="latest-matches-',tabId,'">',LOADING_TPL,"</div></td>",'<td class="canvas-td-containers" width="50%">','<h2 class="canvas-section-title" ','id="heading-upcoming-matches-',tabId,'">',userPrefs.getMsg("match_day"),"&nbsp;-&nbsp;",'<a href="javascript:getEvents(-1, -1)">',
userPrefs.getMsg("view_schedule"),"</a></li></h2>",'<div id="upcoming-matches-',tabId,'">',LOADING_TPL,"</div>","</td></tr></table>");writeHtml("page-content-"+tabId,html.join(""));this.fetchEvents(toYYYYMM(new Date),League.EventsType.ALL)};
League.prototype.createGroups=function(){for(var teamDetails=this.standings,groupsMap={},otherTeams=[],groups=[],html=[],i=0;i<teamDetails.length;i++)teamDetails[i].group?groupsMap[teamDetails[i].group]?groupsMap[teamDetails[i].group].push(teamDetails[i]):(groupsMap[teamDetails[i].group]=[teamDetails[i]],groups.push(teamDetails[i].group)):otherTeams.push(teamDetails[i]);groups.sort();for(var heading,colspan=isHomeView()?8:18,i=0;i<groups.length;i++)heading=isHomeView()?groups[i]:userPrefs.getMsg("group_standings").replace("%GROUP%",
groups[i]),html.push('<table width="100%" style="margin-bottom:5px;"><tr>','<td class="standing-table-group-cell" colspan="',colspan,'">',heading,"</td></tr>",this.getStandingsContent(groupsMap[groups[i]],i),"</table>");otherTeams.length&&(heading=isHomeView()?userPrefs.getMsg("other_teams"):userPrefs.getMsg("other_teams_standings"),html.push('<table width="100%" style="margin-bottom:5px;"><tr>','<td class="standing-table-group-cell" colspan="',colspan,'">',heading,"</td></tr>",this.getStandingsContent(otherTeams,
i),"</table>"));return html.join("")};
League.prototype.createStandingsHeading=function(){var canvasHeadings="",width="20px";isHomeView()||(width="30px",canvasHeadings='<td width="5%">&nbsp;</td><td width="120px" align="center" colspan="4">'+userPrefs.getMsg("performance")+'</td><td width="5%">&nbsp;</td><td width="30px" align="center"><span title="'+userPrefs.getMsg("goals_for")+'">'+userPrefs.getMsg("goals_for_label")+'</span></td><td width="30px" align="center"><span title="'+userPrefs.getMsg("goal_against")+'">'+userPrefs.getMsg("goal_against_label")+
'</span></td><td width="30px" align="center"><span title="'+userPrefs.getMsg("goal_difference")+'">'+userPrefs.getMsg("goal_difference_label")+'</span></td><td width="15%">&nbsp;</td>');var html=['<tr class="standing-table-header">','<td width="',width,'" align="',bidiEnd,'"><span title="',userPrefs.getMsg("position"),'">',userPrefs.getMsg("pos"),'</span></td><td align="',bidiStart,'" ','class="standing-table-team-cell">',userPrefs.getMsg("teamName"),"</td>",'<td align="center"> </td>','<td width="',
width,'" align="center"><b><span title="',userPrefs.getMsg("points"),'">',userPrefs.getMsg("points_label"),"</span></b></td>",'<td width="',width,'" align="center">','<span title="',userPrefs.getMsg("played"),'">',userPrefs.getMsg("played_label"),"</span></td>",'<td width="',width,'" align="center">','<span title="',userPrefs.getMsg("wins"),'">',userPrefs.getMsg("wins_label"),"</span></td>",'<td width="',width,'" align="center"><span title="',userPrefs.getMsg("evens"),'">',userPrefs.getMsg("evens_label"),
'</span></td><td width="',width,'" align="center">','<span title="',userPrefs.getMsg("losses"),'">',userPrefs.getMsg("loss_label"),"</span></td>",canvasHeadings,"</tr>"];return html.join("")};
League.prototype.getStandingsContent=function(teams,groupIndex){var elementIndex=-1,favTeams=userPrefs.getTeams(leaguesType.FAVORITES)[this.index],tabId=this.tabId,teamDetails=this.standings,width=isHomeView()?"20px":"30px",html=[];html.push(this.createStandingsHeading());for(var title,i=0;i<teams.length;i++){var index=1E3*groupIndex+i,arrIndex=this.groupFlag?this.returnTeamIndex(teams[i].teamId):i,elementIndex=favTeams.findIndex(teams[i].teamId);html.push('<tr><td width="',width,'" align="center">',
teams[i].place,'.</td><td align="',bidiStart,'" ','class="standing-table-team-cell">',"<span>",teams[i].name,"</span></td>",'<td width="',width,'" align="center">','<a href="javascript:void(0)" class="fav-icon">','<img src="',"//www.gstatic.com/ig/modules/global_football/v2/",'sprite_fifa.cache.png"');-1==elementIndex?(title=userPrefs.getMsg("add_fav").replace("%REPLACE_TEXT%",teams[i].name),html.push('title="',_hesc(title),'" ','alt="',userPrefs.getMsg("add_team"),'" class=','"fav-icon-off" ','id="img-team-',
tabId,"-",index,'" onclick="addFavoriteTeam(',arrIndex,",",index,');"/>')):(title=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",teams[i].name),html.push('title="',_hesc(title),'" ','alt="',userPrefs.getMsg("remove_team"),'" ','class="fav-icon-on" ','id="img-team-',tabId,"-",index,'" onclick=','"removeFavoriteTeam(',arrIndex,",",index,');"/>'));html.push("</a></td>",'<td width="',width,'" align="center"><b>',teams[i].points,"</b></td>",'<td width="',width,'" align="center">',teams[i].played,
"</td>",'<td width="',width,'" align="center">',teams[i].won,"</td>",'<td width="',width,'" align="center">',teams[i].tie,"</td>",'<td width="',width,'" align="center">',teams[i].lost,"</td>");isHomeView()||html.push("<td>&nbsp;</td>",'<td width="30px" align="center"><span title="',teamDetails[i].lastScore0,'">',this.getMatchResult(teamDetails[i].lastScore0),'</span></td><td width="30px" align="center"><span title="',teamDetails[i].lastScore1,'">',this.getMatchResult(teamDetails[i].lastScore1),"</span></td>",
'<td width="30px" align="center"><span title="',teamDetails[i].lastScore2,'">',this.getMatchResult(teamDetails[i].lastScore2),"</span></td>",'<td width="30px" align="center"><span title="',teamDetails[i].lastScore3,'">',this.getMatchResult(teamDetails[i].lastScore3),"</span></td>","<td>&nbsp;</td>",'<td width="30px" align="center">',teams[i].goalsFor,"</td>",'<td width="30px" align="center">',teams[i].goalsAgainst,"</td>",'<td width="30px" align="center">',teams[i].goalsDiff,"</td><td>&nbsp;</td>");
html.push("</tr>")}return html.join("")};
League.prototype.showEvents=function(type){for(var tabId=this.tabId,otherEvents={postponed:userPrefs.getMsg("postponed"),suspended:userPrefs.getMsg("suspended")},eventDetails=this.events,latestEvents=[],i=0;i<eventDetails.length;i++){var isOldEvent=new Date>eventDetails[i].date;(isOldEvent&&type==League.EventsType.POST||!isOldEvent&&type==League.EventsType.PRE)&&latestEvents.push(eventDetails[i])}var isPost=type==League.EventsType.POST,container=isPost?_gel("latest-matches-"+tabId):_gel("upcoming-matches-"+
tabId);if(!latestEvents.length&&container)container.innerHTML='<table width="100%" class="schedule-day-table"><tr><td align="'+bidiEnd+'" colspan="5" class="schedule-table-head"></td></tr><tr><td align="center" class="schedule-table-team-cell" colspan="5">'+userPrefs.getMsg("no_data")+"</td></tr></table>";else{var curWeek=null,teamsMap=this.teamsMap,tempEvents=[];isPost&&latestEvents.reverse();for(var k=0;k<latestEvents.length;k++){if(curWeek){if(curWeek!=latestEvents[k].week)break}else curWeek=latestEvents[k].week;
tempEvents.push(latestEvents[k])}var headingMatches=isPost?_gel("heading-latest-matches-"+tabId):_gel("heading-upcoming-matches-"+tabId);headingMatches&&(headingMatches.innerHTML=userPrefs.getMsg("match_day")+"&nbsp;"+curWeek+'&nbsp;-&nbsp;<a href="javascript:getEvents('+latestEvents[0].week+","+latestEvents[0].date.valueOf()+')">'+userPrefs.getMsg("view_schedule")+"</a></li>");for(var latestEvents=isPost?tempEvents.reverse():tempEvents,html=[],prevDate,i=0;i<latestEvents.length;i++){var curDate=
latestEvents[i].date;if(0==i||prevDate.toDateString()!=curDate.toDateString())prevDate=curDate,html.push(0!=i?"</table>":"",'<table width="100%" class="schedule-day-table"><tr>','<td align="',bidiEnd,'" colspan="5" ','class="schedule-table-head" ','style="padding:0 4px 0 0;">',getDateInLocaleFormat(userPrefs.getMsg("date_format"),curDate),"</td></tr>");html.push('<tr><td class="schedule-table-team-cell" width="45%">',"<span>",teamsMap[latestEvents[i].team1Id],"</span></td>",'<td width="45px" align="center" ',
'class="schedule-table-result-cell">');"suspended"==latestEvents[i].status||"postponed"==latestEvents[i].status?html.push('<span class="',"suspended"==latestEvents[i].status?"suspended_match":"",'">',otherEvents[latestEvents[i].status],"</span>"):html.push("<span>",latestEvents[i].team1Score," - ",latestEvents[i].team2Score,"</span>");html.push('</td><td class="schedule-table-team-cell">',"<span>",teamsMap[latestEvents[i].team2Id],"</span></td>",'<td width="30px" align="',bidiStart,'">',getTime(curDate),
"</td></tr>")}html.push("</table>");container.innerHTML=html.join("")}gadgetAdjustHeight()};League.prototype.resetValuesOnChangeSubTab=function(){this.checkNextMonth=this.checkPrevMonth=!0;this.numNextQueries=this.numPrevQueries=0};League.prototype.returnTeamIndex=function(team){for(var teamDetails=this.standings,i=0;i<teamDetails.length;i++)if(teamDetails[i].teamId==team)return i;return-1};
League.prototype.fetchEvents=function(qDate,schedule){var timeOutId=setTimeout(bind(this.handleErrorInEvents,this,schedule,!0),7E3),url="http://sports.apis.google.com/sportsapi?date="+qDate+"&leagueId="+this.leagueId+"&qtype=schedule";_IG_FetchContent(url,bind(this.callBackEvents,this,qDate,schedule,timeOutId),{refreshInterval:60})};
League.prototype.callBackEvents=function(response,qDate,schedule,timeOutId){try{clearTimeout(timeOutId);for(var events=parser.parseEventsData(response),k=0;k<events.length;k++)this.events.push(events[k]);this.subTabSummary?this.getDefaultSchedule(qDate,schedule):this.getRequiredEvents(qDate,schedule,events)}catch(err){this.handleErrorInEvents(schedule,!1)}};
League.prototype.handleErrorInEvents=function(schedule,tryAgain){var tabId=this.tabId,html=['<div id="schedule-dayselector-canvas"><table width="100%" height="100%">','<tr><td width="13px"></td><td align="center"><font class="text">'];tryAgain?html.push(userPrefs.getMsg("time_out"),'&nbsp;&nbsp;<a href="javascript:','getEvents(-1, -1)">',userPrefs.getMsg("try_now"),"</a>"):html.push(userPrefs.getMsg("no_data"));html.push('</font></td><td width="13px"></td></tr></table></div>');!isHomeView()&&this.subTabSummary&&
!this.isScheduleShown?(html=['<table width="100%" class="schedule-day-table"><tr>','<td align="',bidiEnd,'" colspan="5" class="schedule-table-head">','</td></tr><tr><td align="center" class="schedule-table-team-cell" ','colspan="5">',userPrefs.getMsg("no_data"),"</td></tr></table>"],schedule!=League.EventsType.PRE&&writeHtml("latest-matches-"+tabId,html.join("")),schedule!=League.EventsType.POST&&writeHtml("upcoming-matches-"+tabId,html.join(""))):writeHtml("page-content-"+tabId,html.join(""));this.subTabSummary=
!0;gadgetAdjustHeight()};
League.prototype.getDefaultSchedule=function(qDate,schedule){this.events.sort(sortByDate);for(var postEvents=[],preEvents=[],i=0,curDate=new Date;i<this.events.length;i++)curDate>this.events[i].date?postEvents.push(this.events[i]):preEvents.push(this.events[i]);schedule!=League.EventsType.PRE&&(postEvents.length?this.checkPrevMonth&&checkFirstWeek(postEvents[postEvents.length-1].date)&&getPreviousMonth(qDate).substr(0,4)>=this.season?(this.checkPrevMonth=!1,this.prevQueryDate=getPreviousMonth(qDate),
this.fetchEvents(this.prevQueryDate,League.EventsType.POST)):(this.fetchedPostEvents=!0,this.checkEvents(schedule,League.EventsType.POST)):(this.numPrevQueries++,this.numPrevQueries<League.MAX_QUERIES&&getPreviousMonth(qDate).substr(0,4)>=this.season?(this.prevQueryDate=getPreviousMonth(qDate),this.fetchEvents(this.prevQueryDate,League.EventsType.POST)):(this.fetchedPostEvents=!0,this.checkEvents(schedule,League.EventsType.POST))));schedule!=League.EventsType.POST&&(preEvents.length?this.checkNextMonth&&
checkLastWeek(preEvents[0].date)?(this.checkNextMonth=!1,this.nextQueryDate=getNextMonth(qDate),this.fetchEvents(this.nextQueryDate,League.EventsType.PRE)):(this.fetchedPreEvents=!0,this.checkEvents(schedule,League.EventsType.PRE)):(this.numNextQueries++,this.numNextQueries<League.MAX_QUERIES?(this.nextQueryDate=getNextMonth(qDate),this.fetchEvents(this.nextQueryDate,League.EventsType.PRE)):(this.fetchedPreEvents=!0,this.checkEvents(schedule,League.EventsType.PRE))))};
League.prototype.checkEvents=function(schedule,checkEvent){this.isScheduleShown?this.fetchedPostEvents&&this.fetchedPreEvents&&(this.resetValuesOnChangeSubTab(),this.subTabSummary=!1,this.getCurrentWeek()):isHomeView()||(schedule!=League.EventsType.POST&&checkEvent==League.EventsType.PRE&&this.showEvents(League.EventsType.PRE),schedule!=League.EventsType.PRE&&checkEvent==League.EventsType.POST&&this.showEvents(League.EventsType.POST))};
League.prototype.getRequiredEvents=function(qDate,schedule,events){schedule==League.EventsType.POST?events.length?this.getPreviousWeekEvents():(this.numPrevQueries++,this.numPrevQueries<League.MAX_QUERIES?this.checkPrevMonth&&this.prevQueryDate.substr(0,4)>=this.season?(this.prevQueryDate=getPreviousMonth(qDate),this.fetchEvents(this.prevQueryDate,League.EventsType.POST)):this.getPreviousWeekEvents():(this.currentWeek--,this.showPostEventsMessage())):schedule==League.EventsType.PRE&&(events.length?
this.getNextWeekEvents():(this.numNextQueries++,this.numNextQueries<League.MAX_QUERIES?this.checkNextMonth?(this.nextQueryDate=getNextMonth(qDate),this.fetchEvents(this.nextQueryDate,League.EventsType.PRE)):this.getNextWeekEvents():(this.currentWeek++,this.showPreEventsMessage())))};
League.prototype.getEvents=function(curWeek,curDate){var tabId=this.tabId;writeHtml("sub-tabs-"+tabId,this.selectSubTab(League.SubTabSelected.SCHEDULE));writeHtml("page-content-"+tabId,LOADING_TPL);userPrefs.setSelectedSubTab(!1);this.resetValuesOnChangeSubTab();this.currentWeek=curWeek;this.currentDate=new Date(curDate);this.events=[];this.fetchedPreEvents=this.fetchedPostEvents=!1;this.isScheduleShown=!0;this.fetchEvents(toYYYYMM(new Date),League.EventsType.ALL)};
League.prototype.getCurrentWeek=function(){if(-1==this.currentWeek){for(var postEvent,preEvent,date=new Date,i=0,length=this.events.length;i<length;i++)if(date>this.events[i].date)postEvent=this.events[i];else{preEvent=this.events[i];break}postEvent?(this.currentWeek=postEvent.week,this.currentDate=postEvent.date):preEvent&&(this.currentWeek=preEvent.week,this.currentDate=preEvent.date)}this.showSchedule()};
League.prototype.getCurrentEvents=function(){for(var currentEvents=[],index,k=0,length=this.events.length;k<length;k++){var event=this.events[k];if(this.currentDate.valueOf()==event.date.valueOf()&&event.week==this.currentWeek){index=k;break}}for(k=index;0<=k;k--){event=this.events[k];if(event.week!=this.currentWeek)break;currentEvents.push(event)}k=index+1;for(length=this.events.length;k<length;k++){event=this.events[k];if(event.week!=this.currentWeek)break;currentEvents.push(event)}return currentEvents};
League.prototype.showSchedule=function(){this.resetValuesOnChangeSubTab();if(!this.events.length||-1==this.currentWeek){var html='<div id="schedule-dayselector-canvas"><table width="100%" height="100%"><tr><td width="13px"></td><td align="center">'+userPrefs.getMsg("no_schedule")+'</td><td width="13px"></td></tr></table></div>';writeHtml("page-content-"+this.tabId,html)}isHomeView()?this.showScheduleInHome():this.showScheduleInCanvas()};
League.prototype.showScheduleInHome=function(){var tabId=this.tabId,otherEventsLabel={postponed:userPrefs.getMsg("postpo"),suspended:userPrefs.getMsg("susp")},otherEvents={postponed:userPrefs.getMsg("postponed"),suspended:userPrefs.getMsg("suspended")},currentWeek=this.currentWeek,html=['<div id="schedule-dayselector-canvas">','<table width="100%" height="100%"><tr>','<td width="13px"><a title="',userPrefs.getMsg("prv_day"),'" class="btn-'+bidiStart+'" href="javascript:','getPreviousWeekEvents()" ',
'id="prev-events-',tabId,'">',"<span>",userPrefs.getMsg("prv_day"),"</span></a></td>",'<td align="center">',userPrefs.getMsg("match_day")," - ",currentWeek,"</td>",'<td width="13px"><a title="',userPrefs.getMsg("nxt_day"),'"class="btn-'+bidiEnd+'" href="javascript:','getNextWeekEvents()" id="next-events-',tabId,'">',"<span>",userPrefs.getMsg("nxt_day"),"</span></a></td>",'</tr></table></div><div id="schedule-container">'],prevDate,currentEvents=this.getCurrentEvents();currentEvents.sort(sortByDate);
for(var teamsMap=this.teamsMap,k=0;k<currentEvents.length;k++)if(currentWeek==currentEvents[k].week){var curDate=currentEvents[k].date;if(0==k||prevDate.toDateString()!=curDate.toDateString())prevDate=curDate,html.push(0!=k?"</table>":"",'</table><table width="100%" class="schedule-day-table">','<tr><td align="',bidiEnd,'" colspan="5" ','class="schedule-table-head">',getDateInLocaleFormat(userPrefs.getMsg("date_format"),prevDate),"</td></tr>");html.push('<tr><td class="schedule-table-team-cell" width="40%" ',
'valign="top" style="padding:0 1px;"><span>',teamsMap[currentEvents[k].team1Id],"</span></td>",'<td width="40px" align="center" ','class="schedule-table-result-cell" valign="top" ','style="padding:0 1px;"><nobr>');"postponed"==currentEvents[k].status||"suspended"==currentEvents[k].status?html.push('<span title="',otherEvents[currentEvents[k].status],'" class="',"suspended"==currentEvents[k].status?"suspended_match":"",'">',otherEventsLabel[currentEvents[k].status],"</span>"):html.push("<span>",currentEvents[k].team1Score,
" - ",currentEvents[k].team2Score,"</span>");html.push('</nobr></td><td class="schedule-table-team-cell" width="40%" ','valign="top" style="padding:0 1px;"><span>',teamsMap[currentEvents[k].team2Id],"</span></td>",'<td width="30px" align="',bidiStart,'" valign="top">',getTime(curDate),"</td></tr>")}html.push("<table></div>");writeHtml("page-content-"+tabId,html.join(""));gadgetAdjustHeight()};
League.prototype.showScheduleInCanvas=function(){var html=[],tabId=this.tabId,currentWeek=this.currentWeek;html.push('<table width="100%"><tr>','<td class="canvas-td-containers"><h2 class="canvas-section-title">',userPrefs.getMsg("league_schedule"),'</h2><div id="schedule-dayselector-canvas">','<table width="100%" height="100%"><tr><td width="13px" valign="middle">','<a title="',userPrefs.getMsg("prv_day"),'" class="btn-'+bidiStart+'" ','href="javascript:getPreviousWeekEvents()" ','id="prev-events-',
tabId,'"><span>',userPrefs.getMsg("prv_day"),'</span></a></td><td align="center" valign="middle">','<div id="match-day-',tabId,'">',userPrefs.getMsg("match_day"),"&nbsp;",currentWeek,'</div></td><td width="13px" valign="middle">','<a title="',userPrefs.getMsg("nxt_day"),'" class="btn-'+bidiEnd+'" href="javascript:getNextWeekEvents()" ','id="next-events-',tabId,'">',"<span>",userPrefs.getMsg("nxt_day"),"</span></a></td></tr>",'</table></div><div id="canvas-fixture-table-',tabId,'">','<table width="100%">');
var currentEvents=this.getCurrentEvents();currentEvents.sort(sortByDate);for(var i=0;i<currentEvents.length;i++){var altCell=i%2;html.push(!altCell?"<tr>":"",'<td width="50%" valign="top" class="padding-table padding-',altCell?"left":"right",'"><div>',this.createMatchSchedule(currentEvents[i],this.teamsMap),"</div></td>",altCell?"</tr>":"")}html.push("</table></div></td>");if(!this.groupFlag){html.push('<td class="canvas-td-containers" width="150px">','<h2 class="canvas-section-title" >',userPrefs.getMsg("league_standings"),
"</h2>",'<div class="standing-table-canvas"><table width="100%">','<tr class="standing-table-header">','<td width="20px" align="center" valign="top">','<span title="',userPrefs.getMsg("position"),'">',userPrefs.getMsg("pos"),"</span></td>",'<td align="',bidiStart,'" class="standing-table-team-cell-fix"',' valign="top">',userPrefs.getMsg("team_name"),"</td>",'<td width="20px" align="center" valign="top"><b>','<span title="',userPrefs.getMsg("points"),'">',userPrefs.getMsg("points_label"),"</span></b></td></tr>");
for(var teamDetails=this.standings,i=0,length=teamDetails.length;i<length;i++)html.push('<tr><td width="20px" align="',bidiEnd,'" valign="top">',teamDetails[i].place,'.</td><td align="',bidiStart,'" ','class="standing-table-team-cell-fix" valign="top"><span>',teamDetails[i].name,"</span></td>",'<td width="20px" align="center" valign="top"><b>',teamDetails[i].points,"</b></td></tr>");html.push("</table></div></td>")}html.push("</tr></table>");writeHtml("page-content-"+tabId,html.join(""));gadgetAdjustHeight()};
League.prototype.showPostEventsMessage=function(){for(var eventDetails=this.events,tabId=this.tabId,i=0;i<League.MAX_QUERIES;i++)this.prevQueryDate=getNextMonth(this.prevQueryDate);eventDetails.length&&(this.currentDate=new Date(eventDetails[0].date),this.currentDate.setDate(this.currentDate.getDate()-1));if(isHomeView()){var html='<div id="schedule-dayselector-canvas"><table width="100%" height="100%"><tr><td width="13px"></td><td align="center">'+userPrefs.getMsg("no_schedule")+'</td><td width="13px"><a title="'+
userPrefs.getMsg("nxt_day")+'" class="btn-'+bidiEnd+'" href="javascript:getNextWeekEvents()" id="next-events-'+tabId+'"><span>'+userPrefs.getMsg("nxt_day")+"</span></a></td></tr></table></div>";writeHtml("page-content-"+tabId,html)}else _gel("prev-events-"+tabId)&&(_gel("prev-events-"+tabId).style.display="none",_gel("match-day-"+tabId).innerHTML=userPrefs.getMsg("no_schedule"),_gel("canvas-fixture-table-"+tabId).innerHTML="");gadgetAdjustHeight()};
League.prototype.showPreEventsMessage=function(){for(var tabId=this.tabId,i=0;i<League.MAX_QUERIES;i++)this.nextQueryDate=getPreviousMonth(this.nextQueryDate);var eventDetails=this.events;eventDetails.length&&(this.currentDate=new Date(eventDetails[eventDetails.length-1].date),this.currentDate.setDate(this.currentDate.getDate()+1));if(isHomeView()){var html='<div id="schedule-dayselector-canvas"><table width="100%" height="100%"><tr><td width="13px"><a title="'+userPrefs.getMsg("prv_day")+'" class="btn-'+
bidiStart+'" href="javascript:getPreviousWeekEvents()" id="prev-events-'+tabId+'"><span>'+userPrefs.getMsg("prv_day")+'</span></a></td><td align="center">'+userPrefs.getMsg("no_schedule")+'</td><td width="13px"></td></tr></table></div>';writeHtml("page-content-"+tabId,html)}else _gel("next-events-"+tabId)&&(_gel("next-events-"+tabId).style.display="none",_gel("match-day-"+tabId).innerHTML=userPrefs.getMsg("no_schedule"),_gel("canvas-fixture-table-"+tabId).innerHTML="");gadgetAdjustHeight()};
League.prototype.getPreviousWeekEvents=function(){var prevWeek=null,prevWeekEvents=[],bWeek=!0,tempDate,events=this.events;events.sort(sortByDate);for(var i=events.length-1;0<=i;i--){if(prevWeek&&prevWeek!=events[i].week){bWeek=!1;break}events[i].week!=this.currentWeek&&events[i].date<this.currentDate&&(prevWeek=events[i].week,tempDate=events[i].date,prevWeekEvents.push(events[i]))}if(prevWeekEvents.length)if(this.checkPrevMonth&&checkFirstWeek(prevWeekEvents[0].date)&&bWeek){this.checkPrevMonth=
!1;var tempQueryDate=toYYYYMM(prevWeekEvents[0].date);this.prevQueryDate=getPreviousMonth(tempQueryDate);this.prevQueryDate.substr(0,4)>=this.season?this.fetchEvents(this.prevQueryDate,League.EventsType.POST):this.showSchedule()}else this.currentWeek=prevWeek,this.currentDate=tempDate,this.showSchedule();else this.prevQueryDate=getPreviousMonth(this.prevQueryDate),this.prevQueryDate.substr(0,4)>=this.season?this.fetchEvents(this.prevQueryDate,League.EventsType.POST):(this.currentWeek--,this.showPostEventsMessage())};
League.prototype.getNextWeekEvents=function(){var nWeek=!0,tempDate,events=this.events;events.sort(sortByDate);for(var nextWeek=null,nextWeekEvents=[],i=0;i<events.length;i++){if(nextWeek&&nextWeek!=events[i].week){nWeek=!1;break}events[i].week!=this.currentWeek&&events[i].date>this.currentDate&&(nextWeek=events[i].week,tempDate=events[i].date,nextWeekEvents.push(events[i]))}if(nextWeekEvents.length)if(this.checkNextMonth&&checkLastWeek(nextWeekEvents[0].date)&&nWeek){var tempQueryDate=toYYYYMM(nextWeekEvents[0].date);
this.checkNextMonth=!1;this.nextQueryDate=getNextMonth(tempQueryDate);this.fetchEvents(this.nextQueryDate,League.EventsType.PRE)}else this.currentWeek=nextWeek,this.currentDate=tempDate,this.showSchedule();else this.nextQueryDate=getNextMonth(this.nextQueryDate),this.fetchEvents(this.nextQueryDate,League.EventsType.PRE)};
League.prototype.selectStandingsTab=function(){var tabId=this.tabId;writeHtml("sub-tabs-"+tabId,this.selectSubTab(League.SubTabSelected.STANDINGS));writeHtml("page-content-"+tabId,LOADING_TPL);userPrefs.setSelectedSubTab(!0);this.resetValuesOnChangeSubTab();this.events=[];this.fetchTeamStandings()};
League.prototype.createMatchSchedule=function(item,teamsMap){var otherEvents={postponed:userPrefs.getMsg("postponed"),suspended:userPrefs.getMsg("suspended")},stadiumName=item.stadium;stadiumName&&(stadiumName="&nbsp;-&nbsp;"+stadiumName);var html=['<table width="100%"><tr>','<td class="match-table-head solid-line-bottom" colspan="2">'];if("suspended"==item.status||"postponed"==item.status)html.push('<span class="',"suspended"==item.status?"suspended_match":"",'">',otherEvents[item.status]," - </span>");
html.push("<b>",getDateInLocaleFormat(userPrefs.getMsg("date_format"),item.date),"</b> ",stadiumName,'</td></tr><tr><td class="solid-line-bottom" colspan="2">','<table width="100%"><tr>','<td width="10%" class="match-table-home-score" valign="top">',"suspended"==item.status||"postponed"==item.status?"-":item.team1Score,"</td>",'<td width="40%" class="match-table-home-team " ','valign="top">',teamsMap[item.team1Id],"</td>",'<td width="10%" class="match-table-away-score solid-line-left" ','valign="top">',
"suspended"==item.status||"postponed"==item.status?"-":item.team2Score,"</td>",'<td width="40%" class="match-table-away-team" valign="top">',teamsMap[item.team2Id],"</td></tr></table></td></tr></table>");return html.join("")};League.prototype.getMatchResult=function(str){return"loss"==str.toLowerCase()?userPrefs.getMsg("loss_label"):"win"==str.toLowerCase()?userPrefs.getMsg("wins_label"):"draw"==str.toLowerCase()?userPrefs.getMsg("evens_label"):"-"};
function AllLeagues(){this.leaguesFetched=0;this.leagueMap_={arge:new League("arge","argentina.cache.gif","argentina"),aut:new League("aut","austria.cache.gif","austria"),belg:new League("belg","belgium.cache.gif","belgium"),braz:new League("braz","braziL.cache.gif","brazil"),bulg:new League("bulg","bulgaria.cache.gif","bulgaria"),chlg:new League("chlg","europe.cache.gif","europe"),spacup:new League("spacup","spain.cache.gif","spain"),itacup:new League("itacup","italy.cache.gif","italy"),czec:new League("czec",
"czech_republic.cache.gif","czech_republic"),holl:new League("holl","netherlands.cache.gif","netherlands"),hollknvb:new League("hollknvb","netherlands.cache.gif","netherlands"),engch:new League("engch","england.cache.gif","england"),engfa:new League("engfa","england.cache.gif","england"),englgcup:new League("englgcup","england.cache.gif","england"),engd1:new League("engd1","england.cache.gif","england"),engd2:new League("engd2","england.cache.gif","england"),epl:new League("epl","england.cache.gif",
"england"),francup:new League("francup","france.cache.gif","france"),fra:new League("fra","france.cache.gif","france"),bund:new League("bund","germany.cache.gif","germany"),bund2:new League("bund2","germany.cache.gif","germany"),gerdfb:new League("gerdfb","germany.cache.gif","germany"),aust:new League("aust","australia.cache.gif","australia"),jlg:new League("jlg","japan.cache.gif","japan"),mls:new League("mls","usa.cache.gif","united_states"),fmf:new League("fmf","mexico.cache.gif","mexico"),port:new League("port",
"portugal.cache.gif","portugal"),russ:new League("russ","russia.cache.gif","russia"),scofa:new League("scofa","scotland.cache.gif","scotland"),scolg:new League("scolg","scotland.cache.gif","scotland"),scopl:new League("scopl","scotland.cache.gif","scotland"),ita:new League("ita","italy.cache.gif","italy"),spa:new League("spa","spain.cache.gif","spain"),turk:new League("turk","turkey.cache.gif","turkey"),uefacup:new League("uefacup","europe.cache.gif","europe")};this.sortedNationsList=sortByObjectKeys(this.nationLeaguesMap);
this.sortedLeaguesList=sortByObjectKeys(this.leagueMap_)}
AllLeagues.prototype.nationLeaguesMap={argentina:["arge"],australia:["aust"],austria:["aut"],belgium:["belg"],brazil:["braz"],bulgaria:["bulg"],czech_republic:["czec"],england:"engch engfa englgcup engd1 engd2 epl".split(" "),europe:["chlg","uefacup"],france:["francup","fra"],germany:["bund","bund2","gerdfb"],italy:["itacup","ita"],japan:["jlg"],mexico:["fmf"],netherlands:["holl","hollknvb"],portugal:["port"],russia:["russ"],scotland:["scofa","scolg","scopl"],spain:["spa","spacup"],turkey:["turk"],
united_states:["mls"]};AllLeagues.FetchType={TEAMS:0,OPTIONS:1};AllLeagues.prototype.getLeague=function(leagueId){return this.leagueMap_[leagueId]||null};
AllLeagues.prototype.selectLeagues=function(){for(var favleagues=userPrefs.getLeagues(leaguesType.FAVORITES),elementIndex=-1,html=['<div class="leagues-title"><h1>',userPrefs.getMsg("league_editor"),"</h1><p>",userPrefs.getMsg("league_header"),"</p></div>",'<div class="leagues-list"><table width="100%" id="league_handler">'],count=0,title,i=0,length=this.sortedLeaguesList.length;i<length;i++){var leagueId=this.sortedLeaguesList[i],league=this.getLeague(leagueId),elementIndex=favleagues.findIndex(leagueId);
html.push('<tr class="leagues-row">','<td width="23px" valign="top"><img title="',league.nation,'" ','alt="',league.nation,'" src="',league.flag,'"></img>',"</td><td>",league.leagueName,'</td><td width="19px"><a href="javascript:void(0)" class="fav-icon" ','><img src="',"//www.gstatic.com/ig/modules/global_football/v2/",'sprite_fifa.cache.png"');-1==elementIndex?(title=userPrefs.getMsg("add_fav").replace("%REPLACE_TEXT%",league.leagueName),html.push('title="',_hesc(title),'" class="fav-icon-off" ',
'id="img-league-',count,'" ',"onclick=\"addFavoriteLeague('",leagueId,"',",count,');"/></a></td></tr>')):(title=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",league.leagueName),html.push('title="',_hesc(title),'" class="fav-icon-on" ','id="img-league-',count,'" ',"onclick=\"removeFavoriteLeague('",leagueId,"',",count,');"/></a></td></tr>'));count++}html.push("</table></div>");_gel("content-div").style.display="block";_gel("content-div").innerHTML=html.join("");html=['<span class="gadget-footer-links">',
'<a href="javascript:showTabs()">',userPrefs.getMsg("leagues"),'</a> - <a href="javascript:showTeams()">',userPrefs.getMsg("teams"),"</a>",'</span><span class="gadget-footer-options"><nobr>',userPrefs.getMsg("add_leagues"),"</nobr></span>"];_gel("gadget-footer").innerHTML=html.join("");gadgetAdjustHeight()};
AllLeagues.prototype.createTeamsSection=function(){_gel("gadget-footer").innerHTML="";var nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),favleagues=userPrefs.getLeagues(leaguesType.FAVORITES);if(!favleagues.length&&!nonFavLeagues.length)_gel("tooltip").className="team-tooltip",showTooltip("","atleast"),this.selectLeagues();else{this.leaguesFetched=0;var html=['<div id="team-selector-panel" style="display:none;"></div>','<div id="leagues-teams">',LOADING_TPL,"</div>"];_gel("content-div").style.display=
"block";_gel("content-div").innerHTML=html.join("");for(var league,i=0;i<favleagues.length;i++)league=this.getLeague(favleagues[i]),league.resetValues(),this.fetchTeams(league,AllLeagues.FetchType.TEAMS);for(i=0;i<nonFavLeagues.length;i++)league=this.getLeague(nonFavLeagues[i]),league.resetValues(),this.fetchTeams(league,AllLeagues.FetchType.TEAMS)}};
AllLeagues.prototype.fetchTeams=function(league,type){var timeOutId=setTimeout(bind(this.handleError,this,type),7E3),url="http://sports.apis.google.com/sportsapi?leagueId="+league.leagueId+"&qtype=standings&season="+league.season;_IG_FetchContent(url,bind(this.callBackTeams,this,league,type,timeOutId),{refreshInterval:60})};
AllLeagues.prototype.callBackTeams=function(response,league,type,timeOutId){try{clearTimeout(timeOutId);var jsonObj=eval("("+response+")"),length=jsonObj.participants?jsonObj.participants.length:0,curDate=new Date;parser.parseStandingsData(jsonObj,league);length?type==AllLeagues.FetchType.TEAMS?(this.leaguesFetched++,this.leaguesFetched==userPrefs.getLeagues(leaguesType.FAVORITES).length+userPrefs.getLeagues(leaguesType.NON_FAVORITES).length&&this.showAllFavTeams()):type==AllLeagues.FetchType.OPTIONS&&
this.changeTeamOption(league):(league.season--,1>=curDate.getFullYear()-league.season?this.fetchTeams(league,type):league.handleError(type))}catch(err){this.handleError(type)}};
AllLeagues.prototype.handleError=function(type){type==AllLeagues.FetchType.TEAMS?_gel("content-div").innerHTML='<div class="loading"><div style="padding-top:100px;"><font class="text">&nbsp;&nbsp;<a href="javascript:createTeamsSection()">'+userPrefs.getMsg("try_now")+"</a></font></div></div></div>":type==AllLeagues.FetchType.OPTIONS&&_gel("select-leagues")&&(_gel("select-leagues").disabled=!1);gadgetAdjustHeight()};
AllLeagues.prototype.changeTeamOption=function(league){var selectbox=_gel("select-team");selectbox.type&&"select-kd"==selectbox.type?selectbox.clearOptions():selectbox.options.length=0;var teamDetails=league.standings,teams=[],favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),leagueIndex=favLeagues.findIndex(league.leagueId);if(-1!=leagueIndex)teams=userPrefs.getTeams(leaguesType.FAVORITES)[leagueIndex];else{var nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),leagueIndex=nonFavLeagues.findIndex(league.leagueId);
-1!=leagueIndex&&(teams=userPrefs.getTeams(leaguesType.NON_FAVORITES)[leagueIndex])}for(var i=0;i<teamDetails.length;i++)if(-1==leagueIndex||-1==teams.findIndex(teamDetails[i].teamId))if(selectbox.type&&"select-kd"==selectbox.type){var opt=new dropDownControl.Option(teamDetails[i].name,teamDetails[i].teamId);selectbox.add(opt);opt.style.textAlign=bidiStart}else selectbox.options.add(new Option(teamDetails[i].name,teamDetails[i].teamId));_gel("select-league").disabled=!1;_gel("select-team").disabled=
!1};
AllLeagues.prototype.showAllFavTeams=function(){var favleagues=userPrefs.getLeagues(leaguesType.FAVORITES),nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES);if(!favleagues.length&&!nonFavLeagues.length)showTooltip("","atleast"),this.selectLeagues();else{for(var favTeams=userPrefs.getTeams(leaguesType.FAVORITES),nonFavTeams=userPrefs.getTeams(leaguesType.NON_FAVORITES),hasFavTeams=!1,i=0;i<favleagues.length;i++)if(favTeams[i].length){hasFavTeams=!0;break}if(!hasFavTeams)for(i=0;i<nonFavLeagues.length;i++)if(nonFavTeams[i].length){hasFavTeams=!0;
break}var allTeamsDiv=_gel("leagues-teams"),html=[];hasFavTeams?(html.push(this.getLeaguesHtml(leaguesType.FAVORITES)),html.push(this.getLeaguesHtml(leaguesType.NON_FAVORITES)),allTeamsDiv.innerHTML=html.join(""),allTeamsDiv.style.display="block",html=['<span class="gadget-footer-links">','<a href="javascript:createLeaguesTab()">',userPrefs.getMsg("leagues"),"</a> - ",userPrefs.getMsg("teams"),'</span><span class="gadget-footer-options">','<nobr><a href="javascript:addTeamPanel()">',userPrefs.getMsg("add_team_link"),
"</a></nobr></span>"],_gel("gadget-footer").innerHTML=html.join(""),gadgetAdjustHeight()):(this.addTeamPanel(),allTeamsDiv.innerHTML="")}};
AllLeagues.prototype.getLeaguesHtml=function(key){for(var teams=userPrefs.getTeams(key),leagues=userPrefs.getLeagues(key),cssClass=key==leaguesType.FAVORITES?"fav-icon-on":"fav-icon-off",html=[],title,i=0,length=leagues.length;i<length;i++){var league=this.getLeague(leagues[i]);if(teams[i].length){html.push('<div class="teams_league"><div class="teams-league-head">','<table width="100%"><tr>','<td width="20px" align="',bidiStart,'" valign="top">','<a class="fav-icon" href="javascript:void(0)">','<img src="',
"//www.gstatic.com/ig/modules/global_football/v2/",'sprite_fifa.cache.png" ','class="',cssClass,'" id="img-team-',leagues[i],'" style="margin:0;" onclick="');key==leaguesType.FAVORITES?(title=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",league.leagueName),html.push("removeFromFavLeagues(",i,')" title="',_hesc(title),'" ','alt="',userPrefs.getMsg("remove_league"),'"/>')):(title=userPrefs.getMsg("add_fav").replace("%REPLACE_TEXT%",league.leagueName),html.push("addToFavLeagues(",i,')" title="',
_hesc(title),'" ','alt="',userPrefs.getMsg("add_league"),'"/>'));html.push("</a></td>",'<td align="',bidiStart,'" valign="top">','<span class="teams-league-name">',league.leagueName,"</span></td></tr></table></div>",'<table width="100%" class="teams-standing-table">',league.createStandingsHeading());for(var teamDetails=league.standings,j=0;j<teamDetails.length;j++){var item=teamDetails;teams[i].length&&-1!=teams[i].findIndex(item[j].teamId)&&(html.push("<tr>",'<td width="20px" align="',bidiEnd,'">',
item[j].place,'</td><td align="',bidiStart,'" ','class="standing-table-team-cell">',"<span>",item[j].name,"</span></td>",'<td width="20px" align="center">','<a class="fav-icon" href="javascript:void(0)">','<img src="',"//www.gstatic.com/ig/modules/global_football/v2/",'sprite_fifa.cache.png"',' alt="',userPrefs.getMsg("remove_team"),'" class="fav-icon-on" onclick="'),html.push(key==leaguesType.FAVORITES?"removeTeamFromFavLeague(":"removeTeamFromNonFavLeague("),title=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",
item[j].name),html.push(i,", ",item[j].teamId,');" ','title="',_hesc(title),'"/>',"</a></td>",'<td width="20px" align="center">',item[j].points,"</td>",'<td width="20px" align="center">',item[j].played,"</td>",'<td width="20px" align="center">',item[j].won,"</td>",'<td width="20px" align="center">',item[j].tie,"</td>",'<td width="20px" align="center">',item[j].lost,"</td>","</tr>"))}html.push("</table></div>")}}return html.join("")};
AllLeagues.prototype.addTeamPanel=function(){var favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES);if(!favLeagues.length&&!nonFavLeagues.length)this.selectLeagues();else{var leagueIndex,leagueId,teams;favLeagues.length?(leagueId=favLeagues[0],leagueIndex=favLeagues.findIndex(leagueId),teams=userPrefs.getTeams(leaguesType.FAVORITES)[leagueIndex]):(leagueId=nonFavLeagues[0],leagueIndex=nonFavLeagues.findIndex(leagueId),teams=userPrefs.getTeams(leaguesType.NON_FAVORITES)[leagueIndex]);
for(var html=['<table width="100%" class="query-table" cellpadding="4"><tr>','<td width="50%">',userPrefs.getMsg("select_nation"),"</td>",'<td width="50%"><select name="country" style="width:100%" ','onchange="changeLeagues();" id="select-nation">'],league=this.getLeague(leagueId),i=0,length=this.sortedNationsList.length;i<length;i++){var nation=this.sortedNationsList[i];userPrefs.getMsg(nation)==league.nation?html.push('<option selected="selected" value="',nation,'">',userPrefs.getMsg(nation),"</option>"):
html.push('<option value="',nation,'">',userPrefs.getMsg(nation),"</option>")}html.push("</select></td></tr><tr>",'<td width="50%">',userPrefs.getMsg("select_league"),"</td>",'<td width="50%"><select name="leagues" id="select-league" ','style="width:100%" onchange="changeSelectOption();">');i=0;for(length=this.sortedLeaguesList.length;i<length;i++){var leagueItem=this.sortedLeaguesList[i];league.nation==this.leagueMap_[leagueItem].nation&&(league.leagueId==leagueItem?html.push('<option selected="selected" value="',
leagueItem,'">',this.leagueMap_[leagueItem].leagueName,"</option>"):html.push('<option value="',leagueItem,'">',this.leagueMap_[leagueItem].leagueName,"</option>"))}html.push('</select></td></tr><tr><td width="50%">',userPrefs.getMsg("select_team"),'</td><td width="50%">','<select name="team" id="select-team" style="width:100%">');for(var item=league.standings,i=0,length=item.length;i<length;i++)-1==teams.findIndex(item[i].teamId)&&html.push('<option value="',item[i].teamId,'">',item[i].name,"</option>");
html.push("</select></td></tr><tr>",'<td width="50%"> </td>','<td width="50%" style="text-align:right"><input type="button" ','class="blue" value="',userPrefs.getMsg("add_team_link"),'" ','style="width:80px" onclick="addTeamToLeagues();"/></td>',"</tr></table>");_gel("team-selector-panel").innerHTML=html.join("");_gel("team-selector-panel").style.display="block";buttonControl.modify();var modifiedControls=dropDownControl.replace({width:_gel("select-nation").offsetWidth,maxvisibleoptions:7});controlsModifier.Event.addListener(_gel("select-nation"),
"onblur",changeLeagues);controlsModifier.Event.addListener(_gel("select-league"),"onchange",changeSelectOption);for(var i=0,control;control=modifiedControls[i];i++){control.textHldr.style.textAlign=bidiStart;for(var options=modifiedControls[i].options,j=0,option;option=options[j++];)option.style.textAlign=bidiStart}html=['<span class="gadget-footer-links">','<a href="javascript:createLeaguesTab()">',userPrefs.getMsg("leagues"),'</a> - <a href="javascript:createTeamsSection()">',userPrefs.getMsg("teams"),
"</a></span>",'<span class="gadget-footer-options"><nobr>',userPrefs.getMsg("add_team_link"),"</nobr></span>"];_gel("gadget-footer").innerHTML=html.join("");gadgetAdjustHeight()}};var allLeagues=new AllLeagues;
function callbackGenerator(key){return function(tabId){if(isTabSelected){_gel("content-div").style.display="none";var favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES);userPrefs.setSelectedLeague(favLeagues[key]);var leagueId=favLeagues[key],league=allLeagues.getLeague(leagueId);league.resetValues();league.tabId=tabId;league.index=key;league.writeLayout();league.getTabData()}}}function getCurrentLeague(){var leagueId=userPrefs.getSelectedLeague();return allLeagues.getLeague(leagueId)}
function getPreviousWeekEvents(){var league=getCurrentLeague();league.getPreviousWeekEvents()}function getNextWeekEvents(){var league=getCurrentLeague();league.getNextWeekEvents()}function selectStandingsTab(){var league=getCurrentLeague();league.selectStandingsTab()}
function addFavoriteTeam(index,htmlIndex){var league=getCurrentLeague(),curLeagueIndex=league.index,tabId=league.tabId,teamDetails=league.standings;userPrefs.addTeamToLeague(curLeagueIndex,teamDetails[index].teamId,leaguesType.FAVORITES);var imageIcon=_gel("img-team-"+tabId+"-"+htmlIndex);if(imageIcon){imageIcon.className="fav-icon-on";var altTitle=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",teamDetails[index].name);imageIcon.title=altTitle;imageIcon.alt=altTitle;imageIcon.onclick=function(){removeFavoriteTeam(index,
htmlIndex)}}isHomeView()&&(_gel("tooltip").className="team-tooltip",showTooltip(teamDetails[index].name,"added"))}
function createLeaguesTab(){var favleagues=userPrefs.getLeagues(leaguesType.FAVORITES);if(favleagues.length){removeAllTabs();var tabTable=soccerTabs.getHeaderContainer(),lastCell=tabTable.firstChild.firstChild.lastChild;lastCell.className="tablib_emptyTab_custom";var html=['<a title="',userPrefs.getMsg("plus_tip"),'" ','href="javascript:'],params=gadgets&&gadgets.views&&gadgets.views.getParams();if(!params||params&&!params.showOnlyVenues)isHomeView()?html.push("selectLeagues()"):html.push("setView('home')"),
html.push('" class="btn-plus" ','id="tab-btn-add">',"<span>",userPrefs.getMsg("plus_tip"),"</span></a>"),lastCell.innerHTML=html.join("");soccerTabs.displayTabs(!0);for(var selectLeague=favleagues[0],selectIndex=0,i$$0=0;i$$0<favleagues.length;i$$0++)if(favleagues[i$$0]==userPrefs.selectedLeague){selectLeague=favleagues[i$$0];selectIndex=i$$0;break}userPrefs.setSelectedLeague(selectLeague);for(i$$0=0;i$$0<favleagues.length;i$$0++){var league=allLeagues.getLeague(favleagues[i$$0]),leagueName=favleagues[i$$0].toUpperCase(),
html=['<table style="margin: 0 4px;" title="',leagueName,'"><tr><td width="100%" align="',bidiStart,'" ','valign="top"><span><span href="javascript:void(0)">',leagueName,"</span></span></td>"];league.isLive||html.push('<td valign="middle" align="',bidiEnd,'">','<a href="javascript:void(0)" title="',userPrefs.getMsg("remove_this_league"),'"><span title="',userPrefs.getMsg("remove_this_league"),'" ','id="remove-tab-',i$$0,'" class="remove-btn"/></a></td></tr></table>');soccerTabs.addTab(html.join(""),
{callback:callbackGenerator(i$$0)});if(!league.isLive){var imgElement=_gel("remove-tab-"+i$$0);imgElement.src="//www.gstatic.com/ig/modules/global_football/v2/sprite_fifa.cache.png";imgElement.onclick=function(i){return function(event){removeSelectedTab(i)}}(i$$0)}}soccerTabs.setSelectedTab(selectIndex)}else isHomeView()?(_gel("tooltip").className="league-tooltip",showTooltip("","atleast"),userPrefs.setSelectedLeague(""),selectLeagues()):setView("home")}
function showTabs(){userPrefs.getLeagues(leaguesType.FAVORITES).length?createLeaguesTab():(_gel("tooltip").className="league-tooltip",showTooltip("","atleast"))}
function addFavoriteLeague(leagueId,index){var nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),leagueIndex=nonFavLeagues.findIndex(leagueId),league=allLeagues.getLeague(leagueId);if(-1!=leagueIndex){var nonFavTeams=userPrefs.getTeams(leaguesType.NON_FAVORITES);userPrefs.addLeague(leagueId,nonFavTeams[leagueIndex],leaguesType.FAVORITES);userPrefs.removeLeague(leagueIndex,leaguesType.NON_FAVORITES)}else userPrefs.addLeague(leagueId,[],leaguesType.FAVORITES);var imageIcon=_gel("img-league-"+
index);imageIcon.className="fav-icon-on";imageIcon.title=userPrefs.getMsg("remove_fav").replace("%REPLACE_TEXT%",league.leagueName);imageIcon.onclick=function(){removeFavoriteLeague(leagueId,index)};_gel("tooltip").className="league-tooltip";showTooltip(league.leagueName,"added")}
function removeFavoriteLeague(leagueId,index){_gel("tooltip").className="league-tooltip";var league=allLeagues.getLeague(leagueId);showTooltip(league.leagueName,"removed");var favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),leagueIndex=favLeagues.findIndex(leagueId);userPrefs.removeLeague(leagueIndex,leaguesType.FAVORITES);var imageIcon=_gel("img-league-"+index);imageIcon.className="fav-icon-off";var titleText=userPrefs.getMsg("add_fav").replace("%REPLACE_TEXT%",league.leagueName);imageIcon.title=
titleText;imageIcon.alt=titleText;imageIcon.onclick=function(){addFavoriteLeague(leagueId,index)}}
function removeFavoriteTeam(index,htmlIndex){var league=getCurrentLeague(),curLeagueIndex=league.index,favTeams=userPrefs.getTeams(leaguesType.FAVORITES)[curLeagueIndex],tabId=league.tabId,teamDetails=league.standings,teamIndex=favTeams.findIndex(teamDetails[index].teamId);userPrefs.removeTeamFromLeague(curLeagueIndex,teamIndex,leaguesType.FAVORITES);var imageIcon=_gel("img-team-"+tabId+"-"+htmlIndex);if(imageIcon){var titleText=userPrefs.getMsg("add_fav").replace("%REPLACE_TEXT%",teamDetails[index].name);
imageIcon.className="fav-icon-off";imageIcon.onclick=function(){addFavoriteTeam(index,htmlIndex)};imageIcon.alt=titleText;imageIcon.title=titleText}isHomeView()&&(_gel("tooltip").className="team-tooltip",showTooltip(teamDetails[index].name,"removed"))}function sortByDate(obj1,obj2){return obj1.date>obj2.date?1:obj1.date<obj2.date?-1:0}function sortByObjectKeys(obj){var keys=[],key;for(key in obj)keys.push(key);return keys.sort(sortByLocaleNames)}
function sortByLocaleNames(localeStr1,localeStr2){return userPrefs.getMsg(localeStr1)>userPrefs.getMsg(localeStr2)?1:userPrefs.getMsg(localeStr1)<userPrefs.getMsg(localeStr2)?-1:0}function checkFirstWeek(myDate){return 7>myDate.getDate()}function checkLastWeek(myDate){var nextWeek=new Date(myDate.getTime()+6048E5);return nextWeek.getMonth()==myDate.getMonth()}
function getPreviousMonth(curDate){var yr=curDate.substr(0,4),month=curDate.substr(4,2);"01"==month?(month="12",yr-=1):(month-=1,10>month&&(month="0"+month));return yr+month}function getNextMonth(curDate){var yr=curDate.substr(0,4),month=curDate.substr(4,2);"12"==month?(month="01",yr=parseFloat(yr)+1):(month=parseFloat(month)+1,10>month&&(month="0"+month));return yr+month}function getEvents(curWeek,curDate){var league=getCurrentLeague();league.getEvents(curWeek,curDate)}
function compareValue(obj1,obj2){var place1=obj1.place||999,place2=obj2.place||999;return place1>place2?1:place1<place2?-1:0}function removeSelectedTab(index){userPrefs.removeLeague(index,leaguesType.FAVORITES);isTabSelected=!1;soccerTabs.setSelectedTab(index);createLeaguesTab()}
function removeFromFavLeagues(leagueIndex){_gel("team-selector-panel").style.display="none";_gel("leagues-teams").innerHTML="";_gel("tooltip").className="league-tooltip";var favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),favTeams=userPrefs.getTeams(leaguesType.FAVORITES),league=allLeagues.getLeague(favLeagues[leagueIndex]);showTooltip(league.leagueName,"removed");userPrefs.addLeague(favLeagues[leagueIndex],favTeams[leagueIndex],leaguesType.NON_FAVORITES);userPrefs.removeLeague(leagueIndex,
leaguesType.FAVORITES);allLeagues.showAllFavTeams()}
function addToFavLeagues(leagueIndex){_gel("team-selector-panel").style.display="none";_gel("leagues-teams").innerHTML="";var nonFavleagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),nonFavTeams=userPrefs.getTeams(leaguesType.NON_FAVORITES);userPrefs.addLeague(nonFavleagues[leagueIndex],nonFavTeams[leagueIndex],leaguesType.FAVORITES);_gel("tooltip").className="league-tooltip";var favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),league=allLeagues.getLeague(favLeagues[favLeagues.length-1]);
showTooltip(league.leagueName,"added");userPrefs.removeLeague(leagueIndex,leaguesType.NON_FAVORITES);allLeagues.showAllFavTeams()}function changeSelectOption(){var leagueList=_gel("select-league"),teamList=_gel("select-team");leagueList.disabled=!0;teamList.disabled=!0;teamList.type&&"select-kd"==teamList.type?teamList.clearOptions():teamList.options.length=0;var league=allLeagues.getLeague(leagueList.value);league.resetValues();allLeagues.fetchTeams(league,AllLeagues.FetchType.OPTIONS)}
function changeLeagues(){var nationElement=_gel("select-nation"),nation=nationElement.value,selectbox=_gel("select-league");selectbox.type&&"select-kd"==selectbox.type?selectbox.clearOptions():selectbox.options.length=0;for(var leagues=allLeagues.nationLeaguesMap[nation].sort(sortByLocaleNames),i=0;i<leagues.length;i++){var league=allLeagues.getLeague(leagues[i]);if(nationElement.type&&"select-kd"==nationElement.type){var opt=new dropDownControl.Option(league.leagueName,leagues[i]);selectbox.add(opt);
opt.style.textAlign=bidiStart}else selectbox.options.add(new Option(league.leagueName,leagues[i]))}changeSelectOption()}
function removeTeamFromFavLeague(leagueIndex,teamId){_gel("team-selector-panel").style.display="none";_gel("leagues-teams").innerHTML="";var favTeams=userPrefs.getTeams(leaguesType.FAVORITES),teamIndex=favTeams[leagueIndex].findIndex(teamId.toString());_gel("tooltip").className="team-tooltip";var favoriteLeague=userPrefs.getLeagues(leaguesType.FAVORITES),teams=allLeagues.getLeague(favoriteLeague[leagueIndex]).teamsMap;showTooltip(teams[teamId],"removed");userPrefs.removeTeamFromLeague(leagueIndex,
teamIndex,leaguesType.FAVORITES);allLeagues.showAllFavTeams()}
function removeTeamFromNonFavLeague(leagueIndex,teamId){_gel("team-selector-panel").style.display="none";_gel("leagues-teams").innerHTML="";var nonFavTeams=userPrefs.getTeams(leaguesType.NON_FAVORITES),teamIndex=nonFavTeams[leagueIndex].findIndex(teamId.toString());_gel("tooltip").className="team-tooltip";var nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),leagueId=nonFavLeagues[leagueIndex],league=allLeagues.getLeague(leagueId),item=league.standings;showTooltip(item[teamIndex].name,
"removed");1>=userPrefs.getTeams(leaguesType.NON_FAVORITES)[leagueIndex].length?userPrefs.removeLeague(leagueIndex,leaguesType.NON_FAVORITES):userPrefs.removeTeamFromLeague(leagueIndex,teamIndex,leaguesType.NON_FAVORITES);allLeagues.showAllFavTeams()}function addTeamPanel(){allLeagues.addTeamPanel()}function createTeamsSection(){soccerTabs.displayTabs(!1);allLeagues.createTeamsSection()}
function showTeams(){!userPrefs.getLeagues(leaguesType.FAVORITES).length&&!userPrefs.getLeagues(leaguesType.NON_FAVORITES).length?(_gel("tooltip").className="team-tooltip",showTooltip("","atleast")):createTeamsSection()}
function addTeamToLeagues(){var leagueId=_gel("select-league").value,teamId=_gel("select-team").value,favLeagues=userPrefs.getLeagues(leaguesType.FAVORITES),leagueIndex=favLeagues.findIndex(leagueId),league=allLeagues.getLeague(leagueId),teamsMap=league.teamsMap;_gel("team-selector-panel").style.display="none";_gel("leagues-teams").innerHTML="";if(teamId&&leagueId){if(-1!=leagueIndex)userPrefs.addTeamToLeague(leagueIndex,teamId,leaguesType.FAVORITES);else{var nonFavLeagues=userPrefs.getLeagues(leaguesType.NON_FAVORITES),
leagueIndex=nonFavLeagues.findIndex(leagueId);-1!=leagueIndex?userPrefs.addTeamToLeague(leagueIndex,teamId,leaguesType.NON_FAVORITES):userPrefs.addLeague(leagueId,[teamId],leaguesType.NON_FAVORITES)}_gel("tooltip").className="team-tooltip";showTooltip(teamsMap[teamId],"added")}allLeagues.showAllFavTeams()}function setView(viewName){gadgets.views.requestNavigateTo(new gadgets.views.View(viewName),{showLeagues:!0})}
function showTooltip(text,message){_gel("tooltip-text").innerHTML=userPrefs.getMsg(message).replace("%REPLACE_TEXT%",text+"&nbsp;");_gel("tooltip").style.visibility="visible";setOpacity(100);-1!=timeOutIdToolTip&&clearTimeout(timeOutIdToolTip);timeOutIdToolTip=setTimeout(function(){fadeToolTip(100)},2E3)}function fadeToolTip(opacity){opacity?(setOpacity(opacity),timeOutIdToolTip=setTimeout(function(){fadeToolTip(opacity-10)},30)):_gel("tooltip").style.visibility="hidden"}
function setOpacity(opacity){var object=_gel("tooltip").style;object.opacity=opacity/100;object.MozOpacity=opacity/100;object.KhtmlOpacity=opacity/100;object.filter="alpha(opacity="+opacity+")"}function removeAllTabs(){var selectedTab=soccerTabs.getSelectedTab(),curLeagueIndex=selectedTab?selectedTab.getIndex():0;for(isTabSelected=!1;soccerTabs.getTabs()[curLeagueIndex+1];)soccerTabs.removeTab(curLeagueIndex+1);for(;soccerTabs.getTabs()[0];)soccerTabs.removeTab(0);isTabSelected=!0}
function selectLeagues(){soccerTabs.displayTabs(!1);allLeagues.selectLeagues()}function getProtocol(){var containerProtocol="http:",parentUrl=gadgets.util.getUrlParameters().parent;parentUrl&&parentUrl.match(/https:/gi)&&(containerProtocol="https:");return containerProtocol}
function init(){var referrerUrl=getProtocol()+"//www.google",isPreviewView=gadgets&&gadgets.views&&gadgets.views.getCurrentView()&&gadgets.views.getCurrentView().getName()&&"preview"==gadgets.views.getCurrentView().getName().toLowerCase(),containerSyndication=gadgets.util.getUrlParameters().synd,isSyndication=containerSyndication.match(/ig.*/);if(isPreviewView||0==document.referrer.indexOf(referrerUrl)&&isSyndication){if(isHomeView()){var favleagues=userPrefs.getLeagues(leaguesType.FAVORITES),params=
gadgets&&gadgets.views&&gadgets.views.getParams();if(params&&params.showLeagues){favleagues.length||(_gel("tooltip").className="league-tooltip",showTooltip("","atleast"));selectLeagues();return}}createLeaguesTab()}}_IG_RegisterOnloadHandler(init);var controlsModifier={commonParameters:{userAgent:{codeName:navigator.appCodeName,name:navigator.appName,version:navigator.appVersion}},util:{isIE:function(){return"MICROSOFT INTERNET EXPLORER"==controlsModifier.commonParameters.userAgent.name.toUpperCase()},isIEBelow9:function(){return controlsModifier.util.isIE()&&-1==controlsModifier.commonParameters.userAgent.version.toUpperCase().indexOf("MSIE 9.0")},parseArguments:function(JSCompiler_OptimizeArgumentsArray_p0){var args=JSCompiler_OptimizeArgumentsArray_p0,
elements=null,parameters=null;1==args.length?args[0].type&&"selectparameter"!=args[0].type?elements=args[0]instanceof Array?args[0]:[args[0]]:parameters=args[0]:2==args.length&&(elements=args[0]instanceof Array?args[0]:[args[0]],parameters=args[1]);return[elements,parameters]}},Event:{addListener:function(element,type,handler){"undefined"==typeof element.listeners[type]&&(element.listeners[type]=[]);element.listeners[type].push(handler)},removeListener:function(element,type,handler){if(element.listeners[type]instanceof
Array)for(var listeners=element.listeners[type],i=0,len=listeners.length;i<len;i++)if(listeners[i]===handler){listeners.splice(i,1);break}},fire:function(element,event){"string"==typeof event&&(event={type:event});event.target||(event.target=element);if(!event.type)throw Error("Event missing 'type' property.");if(element.listeners[event.type]instanceof Array)for(var handlers=element.listeners[event.type],i=0,len=handlers.length;i<len;i++)handlers[i].call(element,event)},addDomListener:function(element,
type,handler){try{element.addEventListener(type,handler,!1)}catch(err){element.attachEvent("on"+type,handler)}},cancelDefault:function(event){try{event.preventDefault()}catch(err){event.returnValue=!1}},preventBubble:function(event){try{event.stopPropagation()}catch(err){event.cancelBubble=!0}}}};var buttonControl={modify:function(opt_elements){for(var inputControls=opt_elements||document.getElementsByTagName("input"),opt_elements=opt_elements instanceof Array?opt_elements:[opt_elements],buttons=[],count=0,i=0,buttonLen=inputControls.length;i<buttonLen;i++)if("button"==inputControls[i].type||"submit"==inputControls[i].type)inputControls[i].color=inputControls[i].className,-1==inputControls[i].color.indexOf("kd-button")&&(buttons.push(inputControls[i]),inputControls[i].focused=!1,inputControls[i].className=
"red"==inputControls[i].color?"kd-button red":"blue"==inputControls[i].color?"kd-button blue":"kd-button normal",inputControls[i].onmouseover=buttonControl.buttonEvents.mouseover,inputControls[i].onmouseout=buttonControl.buttonEvents.mouseout,inputControls[i].onfocus=buttonControl.buttonEvents.focus,inputControls[i].onblur=buttonControl.buttonEvents.blur);return buttons},buttonEvents:{mouseover:function(){this.focused||(this.className="red"==this.color?"kd-button red hover-red":"blue"==this.color?
"kd-button blue hover-blue":"kd-button normal hover-normal")},mouseout:function(){this.focused||(this.className="red"==this.color?"kd-button red":"blue"==this.color?"kd-button blue":"kd-button normal")},focus:function(){this.focused=!0;this.className="red"==this.color?"kd-button red button-focus":"blue"==this.color?"kd-button blue button-focus":"kd-button normal button-focus focus-normal"},blur:function(){this.focused=!1;this.className="red"==this.color?"kd-button red":"blue"==this.color?"kd-button blue":
"kd-button normal"}}};var dropDownControl={horizontalScrollbarOffset:0,commonParameters:{selectedMenu:null,OPTION_PADDING_OFFSET:16,SCROLLBAR_OFFSET:15},util:{getInitParams:function(parameters){if(!parameters)return dropDownControl.selectParameters;for(var isCustom=!1,param,i=0,temp;temp=parameters[i++];)if(param=temp,!param.type||!param.type.match(/select-one|select-multiple/)){isCustom=!0;break}var config={minwidth:param.minwidth||dropDownControl.selectParameters.minwidth,maxvisibleoptions:param.maxvisibleoptions||dropDownControl.selectParameters.maxvisibleoptions,
type:param.type};isCustom?(config.width=param.width||dropDownControl.selectParameters.width,config.tabindex=param.tabindex||dropDownControl.selectParameters.tabindex):(config.width=param.offsetWidth,config.tabindex=param.getAttribute("tabindex")||dropDownControl.selectParameters.tabindex);return config},setMenuPositionForIEBelow9:function(menuSelected){dropDownControl.commonParameters.selectedMenu.className=controlsModifier.util.isIEBelow9()&&menuSelected?"kd-dropdown-cntnr ie":"kd-dropdown-cntnr"}},
selectParameters:{minwidth:"100",width:"100",maxvisibleoptions:5,tabindex:"0",type:"selectparameter"},Select:function(opt_domSelectElement,opt_selParams){var opt_selParams=dropDownControl.util.getInitParams(arguments),dropDownContainer=document.createElement("span");dropDownContainer.className="kd-dropdown-cntnr";dropDownContainer.setAttribute("tabIndex",opt_selParams.tabindex);dropDownContainer.listeners={};dropDownContainer.type="select-kd";dropDownContainer.length=0;dropDownContainer.id=opt_domSelectElement?
opt_domSelectElement.id:"";dropDownContainer.minwidth=parseInt(opt_selParams.minwidth,10);dropDownContainer.visibleOptions=opt_selParams.maxvisibleoptions;dropDownContainer.size=0;dropDownContainer.searchStr="";dropDownContainer.timeoutId=0;dropDownContainer.selectedIndex=0;dropDownContainer.value=null;dropDownContainer.previousSelectedIndex=-1;dropDownContainer.previousHoveredIndex=0;dropDownContainer.mouseMoving=!1;dropDownContainer.textHldr=createTxtCntnr();dropDownContainer.menu=createMenuCntnr();
dropDownContainer.optionsHldr=dropDownContainer.menu.firstChild;dropDownContainer.options=[];dropDownContainer.style.width=opt_selParams.width+"px";dropDownContainer.textHldr.style.width=opt_selParams.width-35+"px";var dropDown=document.createElement("span");dropDown.className="kd-dropdown";dropDown.focused=!1;dropDown.appendChild(createImgCntnr());dropDown.appendChild(dropDownContainer.textHldr);dropDown.appendChild(dropDownContainer.menu);dropDown.style.width=opt_selParams.width+"px";dropDownContainer.appendChild(dropDown);
dropDownContainer.toggleMouseMove_=function(move){this.mouseMoving!=move&&(this.mouseMoving=move)};dropDownContainer.toggleMenuDisplay_=function(display){this.menu.style.display=display?"block":"none"};dropDownContainer.checkChange_=function(){this.selectedIndex!=this.previousSelectedIndex&&(controlsModifier.Event.fire(this,"onchange"),this.previousSelectedIndex=this.selectedIndex)};dropDownContainer.setSelected=function(option){this.previousSelectedIndex=this.selectedIndex;this.options[this.previousSelectedIndex].className=
"menulist";this.options[this.previousSelectedIndex].selected=!1;this.options[this.previousHoveredIndex].className="menulist";this.textHldr.innerHTML=option.text;this.previousHoveredIndex=this.selectedIndex=option.index;this.value=option.value;option.className="menulist hover";option.selected=!0;this.scrollMenu_()};dropDownContainer.add=function(option){option.parent=this;option.index=this.length;this.optionsHldr.appendChild(option);this.options[this.length++]=option;if(0==option.index||option.selected)this.setSelected(option),
this.previousSelectedIndex=option.index};dropDownContainer.clearOptions=function(){this.size=this.length=0;this.options.length=0;this.optionsHldr.innerHTML="";this.previousHoveredIndex=this.selectedIndex=0;this.menu.firstChild.style.height="auto"};dropDownContainer.clearTimeout=function(){this.timeoutId=0;this.searchStr=""};dropDownContainer.bind=function(func,scope){return function(){return func.apply(scope)}};dropDownContainer.setMenuDimensions_=function(){if(!(this.size==this.visibleOptions||this.size==
this.options.length)){this.menu.firstChild.style.width="auto";this.toggleMenuDisplay_(!0);var height=0,totalOffset=this.size=0;controlsModifier.util.isIEBelow9()||(totalOffset=dropDownControl.commonParameters.OPTION_PADDING_OFFSET);this.visibleOptions<this.options.length&&(totalOffset+=dropDownControl.commonParameters.SCROLLBAR_OFFSET);for(var optionWidth=Math.max(this.menu.firstChild.offsetWidth,this.offsetWidth)-totalOffset,i=0,option;option=this.options[i++];)this.size<this.visibleOptions&&(height+=
option.offsetHeight,this.size++),option.style.width=optionWidth+"px";dropDownControl.horizontalScrollbarOffset=optionWidth>this.offsetWidth?dropDownControl.commonParameters.SCROLLBAR_OFFSET:0;this.menu.firstChild.style.height=height+dropDownControl.horizontalScrollbarOffset+"px";this.menu.firstChild.style.width=this.offsetWidth+2+"px"}};dropDownContainer.resetWidth=function(width,maxWidth){width<this.minwidth?this.resetWidth_(maxWidth):this.resetWidth_(width)};dropDownContainer.resetWidth_=function(width){this.style.width=
width+"px";this.firstChild.style.width=width+"px";this.textHldr.style.width=width-35+"px";this.menu.firstChild.style.width=width+"px";if(this.options.length&&this.options[0].offsetWidth<this.menu.offsetWidth)for(var i=0,option;option=this.options[i++];option.style.width=width+"px");};dropDownContainer.scrollMenu_=function(){var upperHeight=this.menu.firstChild.offsetHeight+this.menu.firstChild.scrollTop;upperHeight-this.options[this.selectedIndex].offsetTop>this.menu.firstChild.offsetHeight?this.menu.firstChild.scrollTop=
this.options[this.selectedIndex].offsetTop:this.options[this.selectedIndex].offsetTop-this.menu.firstChild.scrollTop>=this.menu.firstChild.offsetHeight-dropDownControl.horizontalScrollbarOffset&&(this.menu.firstChild.scrollTop=this.options[this.selectedIndex].offsetTop-this.menu.firstChild.offsetHeight+this.options[this.selectedIndex].offsetHeight)};dropDownContainer.onfocus=dropDownControl.custDropDownEvents.focus;dropDownContainer.onblur=dropDownControl.custDropDownEvents.blur;dropDownContainer.onkeydown=
dropDownControl.custDropDownEvents.keydown;dropDown.onclick=dropDownControl.custDropDownEvents.ddButtonEvents.click;dropDown.onmouseover=dropDownControl.custDropDownEvents.ddButtonEvents.mouseover;dropDown.onmouseout=dropDownControl.custDropDownEvents.ddButtonEvents.mouseout;controlsModifier.util.isIE()&&(document.onclick=dropDownControl.globalEvents.click);return dropDownContainer},Option:function(text,value,opt_selected){var menuElement=document.createElement("span");menuElement.className="menulist";
menuElement.listeners={};menuElement.value=value;menuElement.text=text;menuElement.innerHTML=text;menuElement.selected=opt_selected?opt_selected:!1;menuElement.onmouseover=dropDownControl.custDropDownEvents.ddOptionEvents.mouseover;menuElement.onmousemove=dropDownControl.custDropDownEvents.ddOptionEvents.mousemove;menuElement.onclick=dropDownControl.custDropDownEvents.ddOptionEvents.click;return menuElement},replace:function(opt_elements,opt_parameters){for(var funcArguments=controlsModifier.util.parseArguments(arguments),
opt_elements=funcArguments[0],opt_parameters=funcArguments[1],selectControls=opt_elements||document.getElementsByTagName("select"),customDropDowns=[],i=0,selLen=selectControls.length;i<selLen;i++){customDropDowns[i]=new dropDownControl.Select(selectControls[i],opt_parameters);var menuOptions=selectControls[i].getElementsByTagName("option");selectControls[i].parentNode.insertBefore(customDropDowns[i],selectControls[i]);selectControls[i].style.display="none";selectControls[i].id+="-removed";for(var j=
0,optLen=menuOptions.length;j<optLen;j++){var option=new dropDownControl.Option(menuOptions[j].text,menuOptions[j].value,menuOptions[j].selected);customDropDowns[i].add(option)}}return customDropDowns},custDropDownEvents:{focus:function(){controlsModifier.util.isIE()&&dropDownControl.commonParameters.selectedMenu&&dropDownControl.custDropDownEvents.blur.call(dropDownControl.commonParameters.selectedMenu);dropDownControl.commonParameters.selectedMenu=this;dropDownControl.util.setMenuPositionForIEBelow9(!0);
this.firstChild.focused=!0;this.firstChild.className="kd-dropdown selected";this.options[this.previousHoveredIndex].className="menulist";this.options[this.selectedIndex].className="menulist hover";this.previousHoveredIndex=this.selectedIndex;controlsModifier.Event.fire(this,"onfocus")},blur:function(){dropDownControl.util.setMenuPositionForIEBelow9(!1);dropDownControl.commonParameters.selectedMenu=null;this.firstChild.focused=!1;this.firstChild.className="kd-dropdown";this.toggleMenuDisplay_(!1);
this.checkChange_();controlsModifier.Event.fire(this,"onblur")},keydown:function(event){this.toggleMouseMove_(!1);var event=event?event:window.event,key=event.keyCode?event.keyCode:event.which;if(key==dropDownControl.KeyCode.UP)0!=this.previousHoveredIndex&&this.setSelected(this.options[this.previousHoveredIndex-1]),controlsModifier.Event.cancelDefault(event);else if(key==dropDownControl.KeyCode.DOWN)this.previousHoveredIndex!=this.length-1&&this.setSelected(this.options[this.previousHoveredIndex+
1]),controlsModifier.Event.cancelDefault(event);else if(key==dropDownControl.KeyCode.LEFT)this.menu.firstChild.scrollLeft-=15,controlsModifier.Event.cancelDefault(event);else if(key==dropDownControl.KeyCode.RIGHT)this.menu.firstChild.scrollLeft+=15,controlsModifier.Event.cancelDefault(event);else if(key==dropDownControl.KeyCode.ESC)this.toggleMenuDisplay_(!1);else if(key==dropDownControl.KeyCode.TAB)controlsModifier.util.isIE()&&dropDownControl.custDropDownEvents.blur.call(dropDownControl.commonParameters.selectedMenu);
else if(key==dropDownControl.KeyCode.ENTER)this.toggleMenuDisplay_(!1),this.checkChange_();else if(key==dropDownControl.KeyCode.SPACE)this.setMenuDimensions_(),this.toggleMenuDisplay_(!0),this.setSelected(this.options[this.previousHoveredIndex]),controlsModifier.Event.cancelDefault(event);else if(key>=dropDownControl.KeyCode.A&&key<=dropDownControl.KeyCode.Z||key>=dropDownControl.KeyCode.ZERO&&key<=dropDownControl.KeyCode.NINE){this.searchStr+=String.fromCharCode(key);this.timeoutId&&window.clearTimeout(this.timeoutId);
this.timeoutId=window.setTimeout(this.bind(this.clearTimeout,this),500);for(var i=this.selectedIndex+1,count=this.length-1;count;i++,count--)if(i==this.length&&(i=0),this.options[i].innerHTML.substr(0,this.searchStr.length).toUpperCase()==this.searchStr){this.setSelected(this.options[i]);break}}},ddButtonEvents:{mouseover:function(){this.focused||(this.className="kd-dropdown hover")},mouseout:function(){this.focused||(this.className="kd-dropdown")},click:function(event){event=event||window.event;
"none"==this.parentNode.menu.style.display||""==this.parentNode.menu.style.display?(this.parentNode.setMenuDimensions_(),controlsModifier.util.isIE()&&dropDownControl.custDropDownEvents.focus.call(this.parentNode),this.parentNode.toggleMenuDisplay_(!0),this.parentNode.scrollMenu_()):this.parentNode.toggleMenuDisplay_(!1);controlsModifier.Event.fire(this.parentNode,"onclick");controlsModifier.Event.preventBubble(event)}},ddOptionEvents:{mouseover:function(){this.parent.mouseMoving&&(this.parent.options[this.parent.previousHoveredIndex].className=
"menulist",this.className="menulist hover",this.parent.previousHoveredIndex=this.index)},mousemove:function(){this.parent.toggleMouseMove_(!0)},click:function(event){event=event||window.event;this.parent.toggleMenuDisplay_(!1);this.parent.setSelected(this);this.parent.checkChange_();controlsModifier.Event.fire(this,"onclick");controlsModifier.Event.preventBubble(event)}}},globalEvents:{click:function(){dropDownControl.commonParameters.selectedMenu&&dropDownControl.custDropDownEvents.blur.call(dropDownControl.commonParameters.selectedMenu)}},
KeyCode:{TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,ZERO:48,NINE:57,A:65,Z:90}};function createImgCntnr(){var imgCntrl=document.createElement("span");imgCntrl.className="dropdown-img";return imgCntrl}function createTxtCntnr(){var txtCntrl=document.createElement("span");txtCntrl.className="dropdown-txt";return txtCntrl}
function createMenuCntnr(){var scrlBrBx=document.createElement("div");scrlBrBx.className="scrollBarBox";var scrlInner=document.createElement("div");scrlInner.className="scrollBarInner";scrlBrBx.appendChild(scrlInner);return scrlBrBx};

</script>
]]></Content>
</Module>
