/* Concatenated Script File Generated At Tue Nov 17 14:03:01 CET 2009 */



/* --------- START translations.js --------- */

// Define the lookup tables - There must be one for every language
trans = new Array();
trans["en"] = new Array();
trans["zh"] = new Array();
trans["fr"] = new Array();
trans["es"] = new Array();
trans["pt"] = new Array();
trans["de"] = new Array();
trans["ru"] = new Array();
trans["it"] = new Array();

// Define languages that use NCR encoding
trans["zh"]["ncr.encoded"]=1;

// Define the translations
trans["en"]["SPECIFY_TEAM_NAME"] = "Team name must be specified";
trans["zh"]["SPECIFY_TEAM_NAME"] = "&#25152;&#26377;&#29699;&#21592;&#24517;&#39035;&#36873;&#25321;";

trans["en"]["SELECT_ALL_PLAYERS"] = "All Players must be selected";
trans["en"]["SELECT_CATEGORY"] = "All Players must be selected - You need to select another {1}";
trans["zh"]["SELECT_ALL_PLAYERS"] = "&#29699;&#38431;&#21517;&#31216;&#24517;&#39035;&#25351;&#23450;";

trans["en"]["TOO_MANY_PLAYERS_IN_SIDE"] = "Sorry, you cannot pick any more players from ";
trans["zh"]["TOO_MANY_PLAYERS_IN_SIDE"] = "&#24456;&#25265;&#27465;, &#24744;&#19981;&#33021;&#20877;&#36873;&#25321;&#26356;&#22810;&#29699;&#21592;&#20110; ";

trans["en"]["ALREADY_SELECTED"] = "Oops! You have already selected ";
trans["zh"]["ALREADY_SELECTED"] = "&#22114;! &#24744;&#24050;&#32463;&#36873;&#25321;&#20102;&#36825;&#20010; ";

trans["en"]["NOT_ENOUGH_MONEY"] = "Sorry, you do not have enough money left for ";
trans["zh"]["NOT_ENOUGH_MONEY"] = "&#24456;&#25265;&#27465;, &#24744;&#27809;&#26377;&#36275;&#22815;&#37329;&#39069;&#21097;&#19979;&#21435; ";

trans["en"]["NO_MORE_TRANSFERS"] = "Sorry, you do not have any transfers left";
trans["zh"]["NO_MORE_TRANSFERS"] = "&#24456;&#25265;&#27465;, &#24744;&#27809;&#26377;&#20313;&#19979;&#30340;&#36716;&#20250;&#21517;&#39069;";

trans["en"]["UNLIMITED"] = "unlimited";
trans["zh"]["UNLIMITED"] = "&#26080;&#38480;";

trans["en"]["TOO_MANY_TEAMS"] = "Sorry, you now have the maximum number of teams.";
trans["zh"]["TOO_MANY_TEAMS"] = "&#24456;&#25265;&#27465;, &#24744;&#29616;&#22312;&#24050;&#26377;&#21040;&#36798;&#19978;&#38480;&#30340;&#29699;&#38431;";

trans["en"]["CONFIRM_TRANSFERS"] = "Continue with {1} transfers? Active on {2} if confirmed by the first scheduled start of play on that day";
trans["zh"]["CONFIRM_TRANSFERS"] = "&#32487;&#32493;&#36827;&#34892; {1} &#36716;&#20250;?";

trans["en"]["CONFIRM_NO_TRANSFERS"] = "Continue with {1} transfers?";

trans["en"]["CONFIRM_TRANSFER_CAPTAIN_CHANGES"] = "You have made changes:\n\n{1} Transfers\n{2} Captain Change\n\nThese changes will become active on {3}\nClick OK to proceed with these changes";

trans["en"]["CONFIRM_CAPTAIN_CHANGES"] = "Continue with {1} captain change? Active on {2}";

trans["en"]["SELECT_A_CAPTAIN"] = "Please nominate a Captain";

trans["en"]["SELECT_CAPTAINS"] = "Please nominate your Star Players";

trans["en"]["SPECIFY_SMS_ALERTS"] = "Please confirm whether you want SMS alerts for this team";

trans["en"]["NO_TEAMS"] = "Click on the \"ADD NEW TEAM\" button to confirm your selection before proceeding.";
trans["zh"]["NO_TEAMS"] = "&#24744;&#24517;&#39035;&#20808;&#22686;&#28155;&#29699;&#38431;";

trans["en"]["CONFIRM_TEAM"] = "Are you sure that you would like to continue with {1} team?";
trans["zh"]["CONFIRM_TEAM"] = "&#24744;&#26159;&#21542;&#30830;&#23450;&#36873;&#25321;{1}&#29699;&#38431;";

trans["en"]["CONFIRM_TEAMS"] = "Are you sure that you would like to continue with {1} teams?";
trans["zh"]["CONFIRM_TEAMS"] = "&#24744;&#26159;&#21542;&#30830;&#23450;&#36873;&#25321;{1}&#29699;&#38431;";

trans["en"]["DUPLICATE_RACE_SELECTED"] = "You can not select the same race twice";

trans["en"]["SELECT_COURSE_RACE_TIP"] = "Please select a course, race, and horse for each tip";

trans["en"]["SELECT_ALL_TIPS"] = "Please select all tips";

// Define the abbreviations
trans["abbreviation"] = new Array();
trans["abbreviation"]["Manchester United"] = "MNU";
trans["abbreviation"]["Manchester City"] = "MCY";
trans["abbreviation"]["West Ham United"] = "WHU";
trans["abbreviation"]["West Bromwich Albion"] = "WBA";
trans["abbreviation"]["Bristol Rovers"] = "BRV";
trans["abbreviation"]["Chesterfield"] = "CFD";
trans["abbreviation"]["Sheffield Utd"] = "SHU";
trans["abbreviation"]["Sheffield Wed"] = "SWD";
                
// Flash Game Translations                  
trans["fr"]["m"] = "m"; // million        
trans["fr"]["SAVE"] = "french";          
trans["fr"]["FIELD"] = "french";          
trans["fr"]["NOTEBOOK"] = "french";
trans["fr"]["SAVING"] = "french";
trans["fr"]["SAVE TEAM"] = "french";
trans["fr"]["SAVED TEAMS"] = "french";
trans["fr"]["FORMATIONS"] = "french";
trans["fr"]["BUDGET"] = "french";
trans["fr"]["TOTAL BUDGET"] = "french";
trans["fr"]["USED"] = "french";
trans["fr"]["AVAILABLE"] = "french";
trans["fr"]["SCORES"] = "french";
trans["fr"]["TOTAL POINTS"] = "french";
trans["fr"]["OVERALL POSITION"] = "french";
trans["fr"]["ROUND POINTS"] = "french";
trans["fr"]["ROUND POSITION"] = "french";
trans["fr"]["MINI LEAGUE POSITION"] = "french";
trans["fr"]["SEARCH"] = "french";
trans["fr"]["Striker"] = "french";
trans["fr"]["strikers"] = "french";
trans["fr"]["Midfielder"] = "french";
trans["fr"]["midfielders"] = "french";
trans["fr"]["Defender"] = "french";
trans["fr"]["defenders"] = "french";
trans["fr"]["Goalkeeper"] = "french";
trans["fr"]["goalkeepers"] = "french";
trans["fr"]["TRANSFERS"] = "french";
trans["fr"]["EDITING TEAM"] = "french";
trans["fr"]["VIEWING TEAM"] = "french";
trans["fr"]["PICK YOUR PLAYERS"] = "french";
trans["fr"]["NO PLAYERS COULD BE FOUND"] = "french";
trans["fr"]["YOU HAVE NO TRANSFERS LEFT"] = "french";
trans["fr"]["OK"] = "french";
trans["fr"]["CANCEL"] = "french";
trans["fr"]["FORMATIONS"] = "french";
trans["fr"]["SELECT"] = "french";
trans["fr"]["TEAM NAME"] = "french";
trans["fr"]["LOAD"] = "french";
trans["fr"]["SELECT A TEAM"] = "french";
trans["fr"]["Edit Team"] = "french";
trans["fr"]["Current Team"] = "french";
trans["fr"]["player"] = "french";
trans["fr"]["points"] = "french";
trans["fr"]["team"] = "french";
trans["fr"]["value"] = "french";
trans["fr"]["Start Match"] = "french";
trans["fr"]["Substitute"] = "french";
trans["fr"]["Goal"] = "french";
trans["fr"]["Key Goal Contribution"] = "french";
trans["fr"]["Clean Sheet"] = "french";
trans["fr"]["Conceded Goal"] = "french";
trans["fr"]["Yellow Card"] = "french";
trans["fr"]["Red Card"] = "french";
trans["fr"]["{1} IS ALREADY IN YOUR TEAM"] = "french";
trans["fr"]["YOU CANNOT PICK ANY MORE PLAYERS FROM {1}"] = "french";
trans["fr"]["YOU CANNOT AFFORD {1}"] = "french";
trans["fr"]["YOU HAVE ENOUGH {1}"] = "french";
trans["fr"]["YOU NEED A {1}"] = "french";

// Date Translations 
trans["it"]["Jan"] = "Gen";
trans["es"]["Jan"] = "Ene";
trans["ru"]["Jan"] = "&#1103;&#1085;&#1074;";

trans["fr"]["Feb"] = "F&eacute;v";
trans["pt"]["Feb"] = "Fev";
trans["ru"]["Feb"] = "&#1092;&#1077;&#1074;";

trans["de"]["Mar"] = "M&auml;r";
trans["ru"]["Mar"] = "&#1084;&#1072;&#1088;";

trans["fr"]["Apr"] = "Avr";
trans["es"]["Apr"] = "Abr";
trans["pt"]["Apr"] = "Abr";
trans["ru"]["Apr"] = "&#1072;&#1087;&#1088;";

trans["fr"]["May"] = "Mai";
trans["de"]["May"] = "Mai";
trans["it"]["May"] = "Mag";
trans["pt"]["May"] = "Maio";
trans["ru"]["may"] = "&#1084;&#1072;&#1081;";

trans["fr"]["Jun"] = "Jui";
trans["it"]["Jun"] = "Giu";
trans["ru"]["Jun"] = "&#1080;&#1102;&#1085;";

trans["fr"]["Jul"] = "Jui";
trans["it"]["Jul"] = "Lug";
trans["ru"]["Jul"] = "&#1080;&#1102;&#1083;";

trans["fr"]["Aug"] = "Ao&ucirc;";
trans["it"]["Aug"] = "Ago";
trans["es"]["Aug"] = "Ago";
trans["pt"]["Aug"] = "Ago";
trans["ru"]["Aug"] = "&#1072;&#1074;&#1075;";

trans["it"]["Sep"] = "Set";
trans["pt"]["Sep"] = "Set";
trans["ru"]["Sep"] = "&#1089;&#1077;&#1085;";

trans["de"]["Oct"] = "Okt";
trans["it"]["Oct"] = "Ott";
trans["pt"]["Oct"] = "Out";
trans["ru"]["Oct"] = "&#1086;&#1082;&#1090;";

trans["ru"]["Nov"] = "&#1085;&#1086;&#1103;";

trans["fr"]["Dec"] = "D&eacute;c";
trans["de"]["Dec"] = "Dez";
trans["it"]["Dec"] = "Dic";
trans["es"]["Dec"] = "Dic";
trans["pt"]["Dec"] = "Dez";
trans["ru"]["Dec"] = "&#1076;&#1077;&#1082;";

// This function will allow translating of a message
function translate(message) {
 
  var translated = undefined;

  // If the language isn't set then set it to english
  if (window.languageCode == undefined) {
   
    window.languageCode = "en";
  }

  var languageLookup = trans[window.languageCode];

  // If is a language lookup for this language then try to use it  
  if (languageLookup != undefined) {
    
    translated = languageLookup[message];
  }

  // If we haven't translated yet then translate into english
  if (languageCode != "en" &&
      translated == undefined) {

    languageLookup = trans["en"];
    translated = languageLookup[message];
  }

  // If we still haven't successfully translated then return the original message
  if (translated == undefined) {

    // console.log(message);
    translated = message;
  }

  // If this language is NCR encoded then decode it
  if (languageLookup["ncr.encoded"] == 1) {

    translated = decodeNCR(translated);
  }

  return translated;
}


// This function will replace {1} in the message with the specified variable
function translate1(message, variable) {
  
  var translated = translate(message);
  return translated.replace("{1}", variable);
}


// This function will replace {1} and {2} in the message with the specified variables
function translate2(message, variable1, variable2) {
  
  var translated = translate1(message, variable1);
  return translated.replace("{2}", variable2);
}

// This function will replace {1} and {2} and {3} in the message with the specified variables
function translate3(message, variable1, variable2, variable3) {
  
  var translated = translate2(message, variable1, variable2);
  return translated.replace("{3}", variable3);
}

function abbreviate(message, length) {

  var abbreviation = undefined;
  
  var languageLookup = trans["abbreviation"];
  if (languageLookup != undefined) {
    
    abbreviation = languageLookup[message];
  }

  // If we didn't find an abbreviation then use the original message
  if (abbreviation == undefined) {

    // console.log(message);
    abbreviation = message;
  }
  
  // Truncate the abbreviation
  if (abbreviation.length > length) {
    
    abbreviation = abbreviation.substring(0, length);
  }

  return abbreviation;
}

// This function will decode NCR encoded text 
function decodeNCR(encodedText) {

  return convertCP2Char(convertDecNCR2CP(encodedText));
}


// This function converts from a code point to a character
function convertCP2Char ( textString ) {

  var outputString = '';
  textString = textString.replace(/^\s+/, '');
  if (textString.length == 0) { return ""; }
    textString = textString.replace(/\s+/g, ' ');
  var listArray = textString.split(' ');
  for ( var i = 0; i < listArray.length; i++ ) {
    var n = parseInt(listArray[i], 16);
    if (n <= 0xFFFF) {
      outputString += String.fromCharCode(n);
    } else if (n <= 0x10FFFF) {
      n -= 0x10000
      outputString += String.fromCharCode(0xD800 | (n >> 10)) + String.fromCharCode(0xDC00 | (n & 0x3FF));
    } else {
      outputString += '!erreur ' + dec2hex(n) +'!';
    }
  }
  return( outputString );
}

// This function converts from a character to a code point
function convertChar2CP ( textString ) {

  var outputString = "";
  var haut = 0;
  var n = 0;
  for (var i = 0; i < textString.length; i++) {
    var b = textString.charCodeAt(i);  // alert('b:'+dec2hex(b));
    if (b < 0 || b > 0xFFFF) {
      outputString += '!erreur ' + dec2hex(b) + '!';
    }
    if (haut != 0) {
      if (0xDC00 <= b && b <= 0xDFFF) {
        outputString += dec2hex(0x10000 + ((haut - 0xD800) << 10) + (b - 0xDC00)) + ' ';
        haut = 0;
        continue;
      } else {
        outputString += '!erreur ' + dec2hex(haut) + '!';
        haut = 0;
      }
    }
    if (0xD800 <= b && b <= 0xDBFF) {
      haut = b;
    } else {
      outputString += dec2hex(b) + ' ';
    }
  }
  return( outputString.replace(/ $/, '') );
}

// This function converts from NCR to a code point
function convertDecNCR2CP ( textString ) {

  outputString = '';
  inNCR = false;
  tempString = '';
  for (var i=0; i<textString.length; i++) {   
    if (textString.charAt(i) == '&') { // &
      inNCR = true;
      if (tempString != '') { outputString += convertChar2CP( tempString )+' '; }
      tempString = ''; 
      }
    else if ( inNCR && textString.charAt(i) == ';' ) { // ;
      inNCR = false;
      outputString += dec2hex(parseInt(tempString.substring(1, tempString.length), 10))+' ';
      tempString = '';
      }
    else {
      tempString += textString.charAt(i);
      }
    }
  outputString = outputString.substring(0, outputString.length-1);
  if (tempString != '') { outputString += ' '+convertChar2CP( tempString ); }
  return( outputString );
}

// This function converts from decimal to hex
function dec2hex ( textString ) {

   return (textString+0).toString(16).toUpperCase();
}


/* --------- END /usr/local/tomcat5/webapps/CleverTV/js/translations.js --------- */



/* --------- START clevertv.js --------- */

var formName = "reg";
var budgetPrefix = "$"; //unescape("%A3");
var budgetSuffix = "m";

var xTerminatorOption_l = "<option value=0>------------------------------------------</option>";
var dispPlayerValues_l = [];

var bValidate=false;
var bRecalculate_l = true;
var selectNumber;

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length < MaxLen);
}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}


function setHiddenField(form, name, value) {

  var hiddenField = form.elements[name];

  if (!isValidObject(hiddenField)) {

    var hiddenField = document.createElement("input");
    hiddenField.type = "hidden";
    hiddenField.name = name;
    form.appendChild(hiddenField);
  }

  hiddenField.value = value;     
}

function isValidObject(objToTest) {

  if (null == objToTest) {
     
    return false;
  }

  if ("undefined" == typeof(objToTest) ) {

    return false;
  }

  return true;
}

function select(form, element, value)
{ 
  if ("money" == element)
  {
    if (value.charAt(value.length - 1) == 'm')
    {
      value = value.substring(1, (value.length - 1));
    }
    else
    {
      value = value;
    }
  }

  var index=0;

  var type=document.forms[form].elements[element].type;

  if ("text" == type)
  {
    document.forms[form].elements[element].value=value;
  }
  else if ("check" == type)
  {
    document.forms[form].elements[element].checked = ("on" == value);
  }
  else if ("radio" == type)
  {
    radios = document.forms[form].elements[element];
    for (loop=0; loop < radios.length && (0 == index); loop++)
    {
      if (value == radios[loop].value)
      {
        index = loop;
      }
    }
    radios[index].checked=true;
  }
  else if ("select-one" == type)
  {
    if (0 != value)
    {
      bRecalculate_l = false;
      options = document.forms[form].elements[element].options;
      for (loop=0; loop < options.length && (0 == index); loop++)
      {
        if (value == options[loop].value)
        {
          index = loop;
        }
      }
      options[index].selected=true;
      bRecalculate_l = true;
    }
  }

  return;
}

function getMatchingIndex(aiSearchArray_p, iSearch_p)
{
  iReturn_l = -1;

  for (z=0; (z<aiSearchArray_p.length) && (iReturn_l < 0); z++)
  {
    if (iSearch_p == aiSearchArray_p[z])
    {
      iReturn_l = z;
    }
  }

  return iReturn_l;
}

function deleteRows(otable, firstRow) {
 
  var deletecount=otable.getElementsByTagName('tr').length - firstRow; 
  for (var i=0; i<deletecount; i++) {
  
    otable.deleteRow(firstRow); 
  }
}

var bReset_l=false;
function resetForm()
{
  var elements = oRegForm.elements;
  for (var i=0; i<elements.length; i++)
  {
    if ("select-one" == elements[i].type)
    {
      elements[i].selectedIndex = 0;
      bValidate = false;
      bReset_l=true;
    }
  }
  
  oRegForm.elements["money"].value = "&pound;" + dispMoney +"m";
}

function validateForm()
{

  if (bReset_l)
  {
     bSuccess_l = false;  
     bReset_l=false;
  }
  else if (bValidate == false)
  {
    // Check no fields have values of 0
    var oOptions_l = oRegForm.elements;
    var bSuccess_l = true;
    for (var i=0; i<oOptions_l.length && bSuccess_l; i++)
    {
      
      if (oOptions_l[i].name == "smsAlerts" &&
          oOptions_l[i].value == "")
      {
        alert (translate("SPECIFY_SMS_ALERTS"));
        bSuccess_l = false;
      }
      else if (oOptions_l[i].name == "teamName" &&
               oOptions_l[i].value == "")
      {
        alert (translate("SPECIFY_TEAM_NAME"));
        bSuccess_l = false;
      }
      else if (oOptions_l[i].type == "select-one" &&
               oOptions_l[i].name.indexOf("player") == 0 &&
               oOptions_l[i][oOptions_l[i].selectedIndex].value <= 0)
      {
        alert (translate("SELECT_ALL_PLAYERS"));
        bSuccess_l = false;
      }
    }
  }

  return bSuccess_l;
}

function countTransfers() {

  var oOptions_l = oRegForm.elements;
  var transferCount = 0;
  for (var i=0; i<oOptions_l.length; i++) {
  
    if (oOptions_l[i].name.charAt(0) == 'p' &&
        oOptions_l[i].type == "select-one") {
        
      var iPlayerID_l = oOptions_l[i][oOptions_l[i].selectedIndex].value;
      if (null != iPlayerID_l &&
          0 != iPlayerID_l) {
          
        var originalPlayer = 0;
        for (var originalIndex=0; originalIndex < aiSelectedTeams_l[0].length; originalIndex++) {
          
          if (iPlayerID_l == aiSelectedTeams_l[0][originalIndex]) {
              
            originalPlayer = 1;
          } 
        }
        
        if (originalPlayer == 0) {
          
          transferCount++;
        }
      }
    }  
  }  
  return transferCount;
}

function roundNumber(rnum) {
  var rlength = 2; // The number of decimal places to round to
  if (rnum > 8191 && rnum < 10485) {
    rnum = rnum-5000;
    var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
    newnumber = newnumber+5000;
  } else {
    var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
  }
  
  return newnumber;
}

function validateSelect(thisselect)
{
  var oOptions_l = oRegForm.elements;
  var iPlayerID_l = thisselect.options[thisselect.selectedIndex].value;
  var iPlayerIndex_l = getMatchingIndex(aiPlayerIDs_l, iPlayerID_l);
  var xPlayerName_l = axPlayerNames_l[iPlayerIndex_l];
  var aiSidesSelected_l = [];
  var aiSelectedPlayers_l = [];
  var iRemainingTransfers = 0;
  
  // If this is a transfer form then calculate transfers remaining
  if (eval(document.reg["remainingTransfers"])) {
    
    iRemainingTransfers = aiSelectedRemainingTransfers_l[0] - countTransfers();
  }

  // Determine selected team
  var iCost_l = dispMoney;
  var bSuccess_l = true;
  for (var i=0; i<oOptions_l.length && bSuccess_l && bRecalculate_l; i++)
  {
    if (oOptions_l[i].name.charAt(0) == 'p' &&
        oOptions_l[i].type == "select-one")
    {
      var iPlayerID_l = oOptions_l[i][oOptions_l[i].selectedIndex].value;
      var iIndex_l = getMatchingIndex(aiPlayerIDs_l, iPlayerID_l);

      if (null != iPlayerID_l &&
          0 != iPlayerID_l)
      {
        
        iCost_l -= aiPlayerValues_l[iIndex_l];
        iCost_l = roundNumber(iCost_l, 2);
        var iSideIndex_l = getMatchingIndex(aiSideIDs_l, aiPlayerSides_l[iIndex_l]);
        var iSideID_l = aiSideIDs_l[iSideIndex_l];
        var iSideCount_l = aiSidesSelected_l[iSideID_l];
        if (null == iSideCount_l)
        {
          iSideCount_l = 1;
        }
        aiSidesSelected_l[iSideID_l] = iSideCount_l + 1;

        if (iSideCount_l > maximumPlayersPerSide)
        {
          alert(translate("TOO_MANY_PLAYERS_IN_SIDE") + axSideNames_l[iSideIndex_l]);
          bSuccess_l = false;
        }
        else if (-1 != getMatchingIndex(aiSelectedPlayers_l, iPlayerID_l))
        {
          alert(translate("ALREADY_SELECTED") + xPlayerName_l);
          bSuccess_l = false;
        }
        else if (iCost_l < 0)
        {
          alert(translate("NOT_ENOUGH_MONEY") + xPlayerName_l);
          bSuccess_l = false;
        }
        else if (iRemainingTransfers < 0)
        {
          alert(translate("NO_MORE_TRANSFERS"));
          bSuccess_l = false;
        }
        else
        {
          aiSelectedPlayers_l[aiSelectedPlayers_l.length] = iPlayerID_l;
        }        
      }
    }
  }
  var dispCost_l = iCost_l;
  oRegForm.elements["money"].value = "&pound;" + dispCost_l +"m";
  
  if (eval(document.reg["remainingTransfers"])) {
  
    if (iRemainingTransfers > 250) {
    
      oRegForm.elements["remainingTransfers"].value = translate("UNLIMITED");
    } else {
    
      oRegForm.elements["remainingTransfers"].value = iRemainingTransfers;
    }
  }
    
  if (false == bSuccess_l)
  {

    if (iRemainingTransfers < 0) {
    
      // Find original player for this select
      var index = thisselect.name.substring("player".length) - 1;
      var originalId = aiSelectedTeams_l[0][index];
      //select.selectedIndex = 0;
      //alert(index + ":" + select.name + ":" + originalId);
      select("reg", thisselect.name, originalId);
    } else {
    
      thisselect.selectedIndex = 0;
    }
    validateSelect(thisselect);
  }

  return iReturn_l;
}

function addCategoryOptions(selectname, catidx)
{
  var select = oRegForm.elements[selectname];
  select.length = 1;
  var sideid = 0;
  var sidenameid = 0;
  var catid = aiCatIDs_l[catidx - 1];

  for (i=0; i<(aiPlayerIDs_l.length - 1); i++)
  {
    if (catid == aiPlayerCats_l[i])
    {
      if (sideid != aiPlayerSides_l[i] &&
          showSides == "Y") 
      {
          
        newindex = select.options.length;
        sideid = aiPlayerSides_l[i];
        
        for (j=0; j<(aiSideIDs_l.length - 1); j++)
        {
          if (aiSideIDs_l[j] == sideid)
          {
            sidenameid=j;
          }
        }
        
        select.options[newindex] = new Option("", 0, true, false);      
        newindex++;
        select.options[newindex] = new Option(axSideNames_l[sidenameid], 0, true, false);   
        newindex++;
      }
      newindex = select.options.length;
            
      if (dispMoney > 0) {            
      
        select.options[newindex] = new Option(" " + axPlayerNames_l[i] + " " + dispPlayerValues_l[i], aiPlayerIDs_l[i], true, false);
      } else {
      
        select.options[newindex] = new Option(" " + axPlayerNames_l[i], aiPlayerIDs_l[i], true, false);
      }
    }
  }

  select.options[0].selected = true;

}

function selectRandomPlayer(aiPlayerCategory, aiCurrentSelection)
{
  var iSelectedPlayerIndex = Math.floor((aiPlayerCategory.length) * Math.random());

  if (getMatchingIndex(aiCurrentSelection, aiPlayerCategory[iSelectedPlayerIndex]) != -1)
  {
    iSelectedPlayerIndex = -1;
  }
  return iSelectedPlayerIndex;
}

function randomTeam()
{
  oRegForm = document.forms[formName];
  //TODO: values for random should be dynamic
  var iMaxBudget = dispMoney ; 
  var iTotalCost = 0;    
  var iMaxPerSide = maximumPlayersPerSide; 
  var iPlayerCount=0;    
  var aiSelectedPlayers = [];
  var aiSelectedPlayersCat = [];
  var iSelectedPlayerIndex = 0;
  var aiSidesSelected = [];
  var aiSelectedPlayerCosts = [];
  var iSideIndex = 0;
  var iPlayerIndex = 0;
  var iSideID = 0;
  var iSideCount = 0;
  var aiNoOfPlayersInCat = [];
  a2iPlayers = new Array(aiCatIDs_l.length-1);
  a2iPlayerCosts = new Array(aiCatIDs_l.length-1);
  var iNoOfPlayersInCat=0;

  for (var i=0; i < (aiCatIDs_l.length-1); i++)
  {
    a2iPlayers[i] = new Array();
    a2iPlayerCosts[i] = new Array();
    aiNoOfPlayersInCat[i]=0;
  }

  for (var i=0; i < (aiCatIDs_l.length-1); i++)
  {
    for (var j=0; j < (aiPlayerCats_l.length-1); j++)
    {
      if (aiCatIDs_l[i] == aiPlayerCats_l[j])
      {
        a2iPlayers[i][aiNoOfPlayersInCat[i]]=aiPlayerIDs_l[j];
        a2iPlayerCosts[i][aiNoOfPlayersInCat[i]]=aiPlayerValues_l[j];
        aiNoOfPlayersInCat[i]++;
      }
    }
  }

  for (var i=0; i < (aiCatIDs_l.length-1); i++)
  {
    iNoOfPlayersInCat=0;
    while (iNoOfPlayersInCat < aiCatMax_l[i])
    {
      iSelectedPlayerIndex = selectRandomPlayer(a2iPlayers[i], aiSelectedPlayers);

      if (iSelectedPlayerIndex != -1)
      {
        aiSelectedPlayers[iPlayerCount] = a2iPlayers[i][iSelectedPlayerIndex];
        aiSelectedPlayersCat[iPlayerCount] = i;
        iPlayerIndex = getMatchingIndex(aiPlayerIDs_l, aiSelectedPlayers[iPlayerCount]);

        aiSelectedPlayerCosts[iPlayerCount] = aiPlayerValues_l[iPlayerIndex];
        iSideIndex = getMatchingIndex(aiSideIDs_l, aiPlayerSides_l[iPlayerIndex]);
        iSideID = aiSideIDs_l[iSideIndex];
        iSideCount = aiSidesSelected[iSideID];
        if ((aiSidesSelected[iSideID] == null) || (aiSidesSelected[iSideID] <= (iMaxPerSide - 1)))
        {
          if (iSideCount == null)
          {
            aiSidesSelected[iSideID] = 1;
          }
          else
          {
            aiSidesSelected[iSideID] = iSideCount + 1;
          }
          iPlayerCount++;
          iNoOfPlayersInCat++;
        }
      }

    }
  }

  
  for (var i=0; i < (aiSelectedPlayerCosts.length); i++)
  {
    iTotalCost += aiSelectedPlayerCosts[i];
  }

  var iPlayer=0;
  aiCost = [];
  var iMostExpensiveIndex = 0;
  var iReplacedPlayerID = 0;
  var iCount=0;
  var iCat=0;

  while (iTotalCost > iMaxBudget)
  {
    iCount = 0;
    aiCost=[];

    if (iPlayer > (aiSelectedPlayerCosts.length-1))
    {
      iPlayer=0;
    }
    aiCostOfCatPlayers = [];
    aiMostExpPlayersCosts = [];

    // find the most expensive player in the selected group
    for (var i = 0; i < (aiSelectedPlayerCosts.length); i++)
    {
      aiMostExpPlayersCosts[i] = aiSelectedPlayerCosts[i];
    }
    aiMostExpPlayersCosts.sort();
    aiMostExpPlayersCosts.reverse();  // most expensive player -> least expensive player
    iMostExpensiveIndex = getMatchingIndex(aiSelectedPlayerCosts, aiMostExpPlayersCosts[iPlayer]);
    iReplacedPlayerID = aiSelectedPlayers[iMostExpensiveIndex];
    iCat = aiSelectedPlayersCat[iMostExpensiveIndex];

    // find the cost of the second most expensive player in this category
    for (var i = 0; i < (aiNoOfPlayersInCat[iCat]); i++)
    {
      aiCostOfCatPlayers[i] = a2iPlayerCosts[iCat][i];
    }
    aiCostOfCatPlayers.reverse();  // most expensive player -> least expensive player
    for (var idx=1; ((idx < (aiCostOfCatPlayers.length-1)) && (aiCostOfCatPlayers[idx] >= aiSelectedPlayerCosts[iMostExpensiveIndex])); idx++);

    // set up array with players of this cost
    for (var i=0, iCount=0; i < (aiCostOfCatPlayers.length); i++)
    {
      if (a2iPlayerCosts[iCat][i] == aiCostOfCatPlayers[idx])
      {
        aiCost[iCount]=a2iPlayers[aiSelectedPlayersCat[iMostExpensiveIndex]][i];
        iCount++;
      }
    }

    var bContinue = true;
    var iLoopCount=0;
    if (iCount != 0)
    {
      while ((bContinue == true) && (iLoopCount < 20))
      {
        iSelectedPlayerIndex = selectRandomPlayer(aiCost, aiSelectedPlayers);
        if (iSelectedPlayerIndex != -1)
        {
          //the side index for the replaced player
          var iOldPlayerIndex = getMatchingIndex(aiPlayerIDs_l,iReplacedPlayerID);
          var iOldSideIndex = getMatchingIndex(aiSideIDs_l, aiPlayerSides_l[iOldPlayerIndex]);
          var iOldSideID = aiSideIDs_l[iOldSideIndex];
          var iOldSideCount = aiSidesSelected[iOldSideID];

          aiSelectedPlayers[iMostExpensiveIndex] = aiCost[iSelectedPlayerIndex];

          //the side index for the new player
          iPlayerIndex = getMatchingIndex(aiPlayerIDs_l, aiCost[iSelectedPlayerIndex]);
          iSideIndex = getMatchingIndex(aiSideIDs_l, aiPlayerSides_l[iPlayerIndex]);
          iSideID = aiSideIDs_l[iSideIndex];
          iSideCount = aiSidesSelected[iSideID];

          if ((iSideCount == null) || (iSideID == iOldSideID) || (iSideCount <= (iMaxPerSide - 1)))
          {
            if (iSideID != iOldSideID)
            {
              // inc new
              if (iSideCount == null)
              {
                aiSidesSelected[iSideID] = 1;
              }
              else
              {
                aiSidesSelected[iSideID] = iSideCount + 1;
              }

              // dec old
              if (iOldSideCount == 1)
              {
                aiSidesSelected[iOldSideID] = null;
              }
              else
              {
                aiSidesSelected[iOldSideID] = iOldSideCount - 1;
              }

            }
            aiSelectedPlayerCosts[iMostExpensiveIndex] = aiPlayerValues_l[iPlayerIndex];
            bContinue = false;
          }

          else if ((iSideID != iOldSideID) && (iSideCount > (iMaxPerSide - 1)))
          {
            aiSelectedPlayers[iMostExpensiveIndex] = iReplacedPlayerID;

          }
        }

        iLoopCount++;
      }
    }
    iPlayer ++;
  
    for (var i=0, iTotalCost=0; i < (aiSelectedPlayerCosts.length); i++)
    {
      iTotalCost += aiSelectedPlayerCosts[i];
    }
  }
  
  // display the selected team
  for (var i=1; i<=iMaxPlayers; i++)
  {
    var optionName = "player" + i;
    var select = oRegForm.elements[optionName];
    
    // Now loop through the random squad to see if any have a player in this list
    var position=-1;
    for (var j=0; j<iMaxPlayers && position < 0; j++) {
    
      position = positionOfItem(select, aiSelectedPlayers[j]);
      if (position >= 0) {
      
        // console.log(optionName + ":" + position + ":" + oRegForm.elements[optionName].length + ":" + aiSelectedPlayers[j]);
        select.options.selectedIndex = position;
        aiSelectedPlayers[j] = "alreadyselected";
        
      }
    }
  }  
  
  oRegForm.elements["money"].value = "&pound;" + dispMoney - iTotalCost +"m";;
}

function positionOfItem(select, item) {

  var options = select.options;
  for (idx=0; idx<options.length && options[idx].value != item; idx++) {} 
  
  if (idx >= options.length) {
  
    return -1;
  } else {
    
    return idx;
  }
}

function copyTeam(iTeamIndex)
{
  
  // display the selected team
  if (eval(document.reg["smsAlerts"])) {select("reg", "smsAlerts", aiSelectedSmsAlerts_l[iTeamIndex - 1]);}
  if (eval(document.reg["unlimitedTransfers"])) {select("reg", "unlimitedTransfers", aiSelectedUnlimitedTransfers_l[iTeamIndex - 1]);}
  
  // loop through selected player rebind any the team.
  var playerList = aiSelectedTeams_l[iTeamIndex - 1].slice(0);
  for (var i=1; i<=iMaxPlayers; i++)
  {
    var optionName = "player" + i;
    var dropDown = oRegForm.elements[optionName];
    
    // Now loop through the squad to see if any have a player in this list
    var position=-1;
    for (var j=0; j<iMaxPlayers && position < 0; j++) {
    
      position = positionOfItem(dropDown, playerList[j]);
      if (position >= 0) {
      
        select("reg", optionName, playerList[j]);
        playerList[j] = "alreadyselected";        
      }
    }
  }    
  validateSelect(oRegForm.elements["player1"]);
  
  if (eval(document.reg["addTeam"])) {oRegForm.elements["addTeam"].value = "Add Team";}  
  if(eval(document.getElementById("addTeamImageButton"))) {document.getElementById("addTeamImageButton").src=addImage;}
  
  oRegForm.elements["editTeamIndex"].value = -1;    
}

function editTeam(iTeamIndex)
{

  copyTeam(iTeamIndex);
  
  // Set the player name and index 
  oRegForm.elements["teamName"].value = aiSelectedTeamNames_l[iTeamIndex - 1];
  if (eval(document.reg["addTeam"])) {oRegForm.elements["addTeam"].value = "Update Team";}
  if(eval(document.getElementById("addTeamImageButton"))) {document.getElementById("addTeamImageButton").src=updateImage;}
  oRegForm.elements["editTeamIndex"].value = iTeamIndex - 1;
}

function addThisTeam() {

  if (oRegForm.elements["editTeamIndex"].value < 0 &&
      (aiSelectedTeams_l.length >= oRegForm.elements["maxTeams"].value ||
       aiSelectedTeams_l.length >= iActualMaxTeams_l)) {
    
    alert(translate("TOO_MANY_TEAMS"));
    return false;
  } else {
  
    return validateForm();
  }
}

function confirmTransfers() {

  if (false == validateForm()) {
    
    return false;
  } else {
    
    return confirm(translate2("CONFIRM_TRANSFERS", countTransfers(), activationDate));
  }
}

function countTeams() {

  if (aiSelectedTeams_l.length == 0) {
    
    alert(translate("NO_TEAMS"));
    return false;
  } else if (aiSelectedTeams_l.length == 1) {
  
    return confirm(translate1("CONFIRM_TEAM", aiSelectedTeams_l.length));
  } else {
  
    return confirm(translate1("CONFIRM_TEAMS", aiSelectedTeams_l.length));
  }
}


function resetTeam() {

  var oOptions_l = oRegForm.elements;
  for (var i=0; i<oOptions_l.length; i++)
  {
    if (oOptions_l[i].name.charAt(0) == 'p' &&
        oOptions_l[i].type == "select-one")
    {
      oOptions_l[i].selectedIndex = 0;
    }
  }
  validateSelect(oRegForm.elements["player1"]);
}

function drawSelect(selectCategory, selectTitle, xi)
{
  
  selectNumber++;
  var catIndex = getMatchingIndex(axCatNames_l, selectCategory);
  var optionName = "player" + selectNumber;
  var xi = (xi == null) ? "Y" : xi;
  var xiName = "xi" + selectNumber;

  document.write("<!-- " + selectTitle + " -->");
  document.write("<select name='"+optionName+"' onChange='validateSelect(this);' class=\"teamsml\"><option value=0>"+selectTitle+"</option></select>");
  document.write("<input type=hidden name='"+xiName+"' value='"+xi+"' />");
  oRegForm = document.forms[formName];
  addCategoryOptions(optionName, getMatchingIndex(axCatNames_l, selectCategory) + 1);
  
  aiCatMax_l[catIndex] ++;
}

function drawMoney()
{
  document.write("<input type=\"text\" name=\"money\" value=\"" + budgetPrefix + dispMoney + budgetSuffix + "\" size=\"6\" maxlength=\"6\" class=\"normal\" disabled=\"disabled\" id=\"teambudget\" />");
}

function drawRating()
{
  document.write("<input type=\"text\" name=\"money\" value=\"" + dispMoney +"\" size=\"3\" maxlength=\"3\" class=\"normal\" disabled>");
}

function drawMoneySimple()
{
  document.write(dispMoney);
}

function drawRemainingTransfers()
{
  document.write("<input type=\"text\" name=\"remainingTransfers\" value=\"" + dispRemainingTransfers + "\" size=\"7\" maxlength=\"7\" class=\"normal\" disabled>");
}

function initialise() 
{

  for (var i=0; i<aiPlayerValues_l.length; i++)
  {
    dispPlayerValues_l[i] = aiPlayerValues_l[i];
  }
  
  selectNumber = 0;
  
  for (i=0; i<aiCatMax_l.length; i++) {
  
    aiCatMax_l[i] = 0;
  }
}

function repopulate() {

  // If there was a last post bound then loop through and re-populate the players - This
  // will happen in the case where there was an error with the selection (e.g no team name)
  for (var index=0; index < aiPostPlayers_l.length; index++)
  {
    select("reg", "player" + (index + 1), aiPostPlayers_l[index]);
  }
  validateSelect(oRegForm.elements["player1"]);
}

function compareText (option1, option2) {
  return option1.text < option2.text ? -1 :
    option1.text > option2.text ? 1 : 0;
}

function compareValue (option1, option2) {
  return option1.value < option2.value ? -1 :
    option1.value > option2.value ? 1 : 0;
}

function compareTextAsFloat (option1, option2) {
  var value1 = parseFloat(option1.text);
  var value2 = parseFloat(option2.text);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}

function compareValueAsFloat (option1, option2) {
  var value1 = parseFloat(option1.value);
  var value2 = parseFloat(option2.value);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}

function sortSelect (select, compareFunction) {
  if (!compareFunction)
    compareFunction = compareText;
  var options = new Array (select.options.length);
  for (var i = 0; i < options.length; i++)
    options[i] =
      new Option (
        select.options[i].text,
        select.options[i].value,
        select.options[i].defaultSelected,
        select.options[i].selected
      );
  options.sort(compareFunction);
  select.options.length = 0;
  for (var i = 0; i < options.length; i++)
    select.options[i] = options[i];
}

// Ticker startup
function startTicker()
{
  // Define run time values
  theCurrentStory     = -1;
  theCurrentLength    = 0;
  // Locate base objects
  if (document.getElementById) {  
        theAnchorObject     = document.getElementById("tickerAnchor");
      runTheTicker();     
     }
  else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}<\/style>");
            return true;
  }
}
// Ticker main run loop
function runTheTicker()
{
  var myTimeout; 
  // Are there any stories?
  if (!theSummaries.length) return;
  // Go for the next story data block
  if(theCurrentLength == 0)
  {
    theCurrentStory++;
    theCurrentStory      = theCurrentStory % theSummaries.length;
    theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');    
    theTargetLink        = theSiteLinks[theCurrentStory];
    theAnchorObject.href = theTargetLink;
    thePrefix        = "<span class=\"tickls\">" + theLeadString + "<\/span>";
  }
  // Stuff the current ticker text into the anchor
  theAnchorObject.innerHTML = thePrefix + 
  theStorySummary.substring(0,theCurrentLength) + whatWidget();
  // Modify the length for the substring and define the timer
  if(theCurrentLength != theStorySummary.length)
  {
    theCurrentLength++;
    myTimeout = theCharacterTimeout;
  }
  else
  {
    theCurrentLength = 0;
    myTimeout = theStoryTimeout;
  }
  // Call up the next cycle of the ticker
  setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
  if(theCurrentLength == theStorySummary.length) return theWidgetNone;
  if((theCurrentLength % 2) == 1) return theWidgetOne;
  return theWidgetTwo;
}
// globals
var theCharacterTimeout = 50;
var theStoryTimeout     = 5000;
var theWidgetOne        = "_";
var theWidgetTwo        = "-";
var theWidgetNone       = "";
var theLeadString       = "";
var theSummaries    = new Array();
var theSiteLinks    = new Array();

function storecheck(questionId) {
  
  // The answer is stored in a hidden field
  var infoForm = document.getElementById("selectinfo");
  if (infoForm) {

    var answerElement = infoForm["answer(" + questionId + ")"];
    var answer = "";
  
    var oOptions_l = infoForm.elements;
    for (var i=0; i<oOptions_l.length; i++) {
  
      if ((oOptions_l[i].name == "check-" + questionId) &&
           oOptions_l[i].checked) {
   
       if (answer != "") {
      
          answer += "|";
       }
       answer += oOptions_l[i].value;
      }
    } 
  
    answerElement.value = answer;
  }
}

function check(questionId) {
  
  
  // The answer is stored in a hidden field
  var infoForm = document.getElementById("selectinfo");
  if (infoForm) {

    var answerElement = infoForm["answer(" + questionId + ")"];
    var answers = answerElement.value.split("|");
    var oOptions_l = infoForm.elements;
  
    for (var i=0; i<answers.length; i++) {
  
      for (var j=0; j<oOptions_l.length; j++) {
    
        if ((oOptions_l[j].name == "check-" + questionId) &&
             oOptions_l[j].value == answers[i]) {
     
         oOptions_l[j].checked = true;
        }
      }   
    }
  }
}

function populateCourses(formName, tipId, fixtureName) {
  
  if (fixtureName != "") {

    var tokenizer = new StringTokenizer (fixtureName, "|");
    while (tokenizer.hasMoreTokens()) {
    
      var courseName = tokenizer.nextToken();
      document.forms[formName].elements["course" + tipId].options[tokenizer.tokensReturned] = new Option(courseName.replace("_"," "), courseName, true, false);
    } 
  }
}

function findElement(form, elementName) {
  
  for (var i=0; i < form.elements.length; i++) {
    
    if (form.elements[i].name == elementName) {
    
      return form.elements[i];
    }
  }
  
  return null;
}

function trim(str) {

  return str.replace(/^\s*|\s*$/g,"");
}

// this function sets a cookie
function setCookie(name, value, expires)  {
  // set time, it's in milliseconds
  var today = new Date();
  today.setTime( today.getTime() );

  if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; }
  var expires_date = new Date( today.getTime() + (expires) );

  document.cookie = name + "=" +escape( value ) +
  ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" );
}

// this function gets a cookie, if it exists
function getCookie( name ) {
  
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ((!start) && (name != document.cookie.substring(0, name.length))) {
  
    return null;
  }
  if (start == -1 ) return null;
  var end = document.cookie.indexOf(";", len);
  if (end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring(len, end));
}

// this deletes the cookie 
function deleteCookie(name) {

  if ( getCookie( name ) ) document.cookie = name + "=" +
  ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// This function will remember a login if the 'rememberLogin' checbox
// of the specified form is checked
function rememberThisLogin(thisform) {

  if (eval(thisform["rememberLogin"])) {
  
    if (thisform.elements["rememberLogin"].checked) {
    
      setCookie("email", thisform.elements["email"].value, 180);
      setCookie("password", thisform.elements["password"].value, 180);
    } else {
    
      deleteCookie("email");
      deleteCookie("password");
    }
  }
}

function getElementsByClassName(oElm, strTagName, strClassName){

  var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
  var arrReturnElements = new Array();
  strClassName = strClassName.replace(/\-/g, "\\-");
  var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
  var oElement;
  for(var i=0; i<arrElements.length; i++){
      oElement = arrElements[i];
      if(oRegExp.test(oElement.className)){
          arrReturnElements.push(oElement);
      }
  }
  return (arrReturnElements)
}

function removeChildrenRecursively(node) {

  if (!node) return;
  while (node.hasChildNodes()) {
  
    removeChildrenRecursively(node.firstChild);
    node.removeChild(node.firstChild);
  }
}


// This function will populate the login box
function populateLogin(formName) {

  // populate the login for any form with a rememberLogin checkbox
  for (var i=0; i<document.forms.length; i++) {
    
    loginForm = document.forms[i];
    if (eval(loginForm.elements["rememberLogin"])) {
          
      if (getCookie("password") != null) {

        loginForm.elements["email"].value = getCookie("email");
        loginForm.elements["password"].value = getCookie("password");
        loginForm.elements["rememberLogin"].checked = true;
      }   
    }
  }
}

<!-- Original:  Tomleung (lok_2000_tom@hotmail.com) This tag should not be removed-->
<!--Server time ticking clock v2.0 Updated by js-x.com-->
function MakeArrayday(size)
{
  this.length = size;
  for(var i = 1; i <= size; i++)
    this[i] = "";
  return this;
}
function MakeArraymonth(size)
{
  this.length = size;
  for(var i = 1; i <= size; i++)
    this[i] = "";
  return this;
}

var hours;
var minutes;
var seconds;
var timer=null;
var diff=0;

function sClock(serverdate, serveroffset)
{

 
  var currenttimems = new Date().getTime();
  var localoffset = new Date().getTimezoneOffset() * 60000;
  diff = currenttimems - localoffset - serverdate + serveroffset;
  setDateBits(); 
}

function setDateBits() {

  var currenttimems = new Date().getTime();
  var servertimems = currenttimems + diff;
  var serverdate = new Date(servertimems);
  hours=serverdate.getHours();
  minutes=serverdate.getMinutes();
  seconds=serverdate.getSeconds();
  if(timer){clearInterval(timer);timer=null;}
  timer=setInterval("work();",1000);
}

function twoDigit(_v)
{
  if(_v<10)_v="0"+_v;
  return _v;
}

function work()
{
  setDateBits(); 
  if (!document.layers && !document.all && !document.getElementById) return;
  var shours = hours;
  var sminutes = minutes;
  var sseconds = seconds;
  if (shours >= 24)
  {
    shours=0;
  }
  if (!shours) shours = 12;
  sminutes=twoDigit(sminutes);
  sseconds=twoDigit(sseconds);
  shours  =twoDigit(shours  );
  movingtime = ""+ shours + ":" + sminutes +":"+sseconds;
  if (document.getElementById)
    document.getElementById("clock").innerHTML=movingtime;
  else if (document.layers)
  {
    document.layers.clock.document.open();
    document.layers.clock.document.write(movingtime);
    document.layers.clock.document.close();
  }
  else if (document.all)
    clock.innerHTML = movingtime;
}
    


/* --------- END /usr/local/tomcat5/webapps/CleverTV/js/clevertv.js --------- */



/* --------- START sorttable.js --------- */

/*
  SortTable
  version 2
  7th April 2007
  Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
  
  Instructions:
  Download this file
  Add <script src="sorttable.js"></script> to your HTML
  Add class="sortable" to any table you'd like to make sortable
  Click on the headers to sort
  
  Thanks to many, many people for contributions and suggestions.
  Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
  This basically means: do what you want with it.
*/

 
var stIsIE = /*@cc_on!@*/false;

var currentSortedColumn = null;
var currentReversed = false;

sorttable = {
  init: function() {
    // quit if this function has already been called
    if (arguments.callee.done) return;
    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;
    // kill the timer
    if (_timer) clearInterval(_timer);
    
    if (!document.createElement || !document.getElementsByTagName) return;
    
    sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
    
    forEach(document.getElementsByTagName('table'), function(table) {
      if (table.className.search(/\bsortable\b/) != -1) {
        sorttable.makeSortable(table);
      }
    });
    
  },
  
  makeSortable: function(table) {
    if (table.getElementsByTagName('thead').length == 0) {
      // table doesn't have a tHead. Since it should have, create one and
      // put the first table row in it.
      the = document.createElement('thead');
      the.appendChild(table.rows[0]);
      table.insertBefore(the,table.firstChild);
    }
    // Safari doesn't support table.tHead, sigh
    if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
    
    if (table.tHead.rows.length != 1) return; // can't cope with two header rows
    
    // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
    // "total" rows, for example). This is B&R, since what you're supposed
    // to do is put them in a tfoot. So, if there are sortbottom rows,
    // for backwards compatibility, move them to tfoot (creating it if needed).
    sortbottomrows = [];
    for (var i=0; i<table.rows.length; i++) {
      if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
        sortbottomrows[sortbottomrows.length] = table.rows[i];
      }
    }
    if (sortbottomrows) {
      if (table.tFoot == null) {
        // table doesn't have a tfoot. Create one.
        tfo = document.createElement('tfoot');
        table.appendChild(tfo);
      }
      for (var i=0; i<sortbottomrows.length; i++) {
        tfo.appendChild(sortbottomrows[i]);
      }
      delete sortbottomrows;
    }
    
    // work through each column and calculate its type
    headrow = table.tHead.rows[0].cells;
    for (var i=0; i<headrow.length; i++) {
      // manually override the type with a sorttable_type attribute
      if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
        mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
        if (mtch) { override = mtch[1]; }
        if (mtch && typeof sorttable["sort_"+override] == 'function') {
          headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
        } else {
          headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
        }
        // make it clickable to sort
        headrow[i].sorttable_columnindex = i;
        headrow[i].sorttable_tbody = table.tBodies[0];
        dean_addEvent(headrow[i],"click", function(e) {

          if (this.className.search(/\bsorttable_sorted\b/) != -1) {
            // if we're already sorted by this column, just 
            // reverse the table, which is quicker
            sorttable.reverse(this.sorttable_tbody);
            this.className = this.className.replace('sorttable_sorted',
                                                    'sorttable_sorted_reverse');
            this.removeChild(document.getElementById('sorttable_sortfwdind'));
            sortrevind = document.createElement('span');
            sortrevind.id = "sorttable_sortrevind";
            sortrevind.innerHTML = stIsIE ? '&nbsp&#8593;' : '&nbsp;&#x25B4;';
            this.appendChild(sortrevind);
            return;
          }
          if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
            // if we're already sorted by this column in reverse, just 
            // re-reverse the table, which is quicker
            sorttable.reverse(this.sorttable_tbody);
            this.className = this.className.replace('sorttable_sorted_reverse',
                                                    'sorttable_sorted');
            this.removeChild(document.getElementById('sorttable_sortrevind'));
            sortfwdind = document.createElement('span');
            sortfwdind.id = "sorttable_sortfwdind";
            sortfwdind.innerHTML = stIsIE ? '&nbsp&#8595;' : '&nbsp;&#x25BE;';
            this.appendChild(sortfwdind);
            return;
          }

          sorttable.sort(this);
        });
      }
    }
  },
  
  guessType: function(table, column) {
    // guess the type of a column based on its first non-blank row
    sortfn = sorttable.sort_alpha;
    for (var i=0; i<table.tBodies[0].rows.length; i++) {
      text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
      if (text != '') {
        if (text.match(/^-?[�$�]?[\d,.]+%?$/)) {
          return sorttable.sort_numeric;
        }
        // check for a date: dd/mm/yyyy or dd/mm/yy 
        // can have / or . or - as separator
        // can be mm/dd as well
        possdate = text.match(sorttable.DATE_RE)
        if (possdate) {
          // looks like a date
          first = parseInt(possdate[1]);
          second = parseInt(possdate[2]);
          if (first > 12) {
            // definitely dd/mm
            return sorttable.sort_ddmm;
          } else if (second > 12) {
            return sorttable.sort_mmdd;
          } else {
            // looks like a date, but we can't tell which, so assume
            // that it's dd/mm (English imperialism!) and keep looking
            sortfn = sorttable.sort_ddmm;
          }
        }
      }
    }
    return sortfn;
  },
  
  getInnerText: function(node) {
    // gets the text we want to use for sorting for a cell.
    // strips leading and trailing whitespace.
    // this is *not* a generic getInnerText function; it's special to sorttable.
    // for example, you can override the cell text with a customkey attribute.
    // it also gets .value for <input> fields.
    
    hasInputs = (typeof node.getElementsByTagName == 'function') &&
                 node.getElementsByTagName('input').length;
    
    
    if (node.getAttribute("sorttable_customkey") != null) {

      return node.getAttribute("sorttable_customkey");
    }
    else if (typeof node.textContent != 'undefined' && !hasInputs) {
      return node.textContent.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.innerText != 'undefined' && !hasInputs) {
      return node.innerText.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.text != 'undefined' && !hasInputs) {
      return node.text.replace(/^\s+|\s+$/g, '');
    }
    else {
      switch (node.nodeType) {
        case 3:
          if (node.nodeName.toLowerCase() == 'input') {
            return node.value.replace(/^\s+|\s+$/g, '');
          }
        case 4:
          return node.nodeValue.replace(/^\s+|\s+$/g, '');
          break;
        case 1:
        case 11:
          var innerText = '';
          for (var i = 0; i < node.childNodes.length; i++) {
            innerText += sorttable.getInnerText(node.childNodes[i]);
          }
          return innerText.replace(/^\s+|\s+$/g, '');
          break;
        default:
          return '';
      }
    }
  },

  resort: function() {

    if (null != currentSortedColumn)  {

      var shouldReverse = currentReversed;
      sorttable.sort(currentSortedColumn);
      if (shouldReverse) {
                           
        sorttable.reverse(currentSortedColumn.sorttable_tbody);
      }
    }
  },

  sort: function(thistablebit) {

    currentSortedColumn = thistablebit;
    currentReversed = false;
          
    // remove sorttable_sorted classes
    theadrow = thistablebit.parentNode;
    forEach(theadrow.childNodes, function(cell) {
      if (cell.nodeType == 1) { // an element
        cell.className = cell.className.replace('sorttable_sorted_reverse','');
        cell.className = cell.className.replace('sorttable_sorted','');
      }
    });
    sortfwdind = document.getElementById('sorttable_sortfwdind');
    if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
    sortrevind = document.getElementById('sorttable_sortrevind');
    if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }

    thistablebit.className += ' sorttable_sorted';
    sortfwdind = document.createElement('span');
    sortfwdind.id = "sorttable_sortfwdind";
    sortfwdind.innerHTML = stIsIE ? '&nbsp&#8595;' : '&nbsp;&#x25BE;';
    thistablebit.appendChild(sortfwdind);

    // build an array to sort. This is a Schwartzian transform thing,
    // i.e., we "decorate" each row with the actual sort key,
    // sort based on the sort keys, and then put the rows back in order
    // which is a lot faster because you only do getInnerText once per row
    row_array = [];
    col = thistablebit.sorttable_columnindex;
    rows = thistablebit.sorttable_tbody.rows;
    for (var j=0; j<rows.length; j++) {
      row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
    }
    /* If you want a stable sort, uncomment the following line */
    //sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
    /* and comment out this one */
    row_array.sort(thistablebit.sorttable_sortfunction);

    tb = thistablebit.sorttable_tbody;
    for (var j=0; j<row_array.length; j++) {
      tb.appendChild(row_array[j][1]);
    }

    delete row_array;
  },
  
  reverse: function(tbody) {

    currentReversed = !currentReversed;
    // reverse the rows in a tbody
    newrows = [];
    for (var i=0; i<tbody.rows.length; i++) {
      newrows[newrows.length] = tbody.rows[i];
    }
    for (var i=newrows.length-1; i>=0; i--) {
       tbody.appendChild(newrows[i]);
    }
    delete newrows;
  },
  
  /* sort functions
     each sort function takes two parameters, a and b
     you are comparing a[0] and b[0] */
  sort_numeric: function(a,b) {

    aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
    if (isNaN(aa)) aa = 0;
    bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); 
    if (isNaN(bb)) bb = 0;
    return bb-aa;
  },
  sort_alpha: function(a,b) {
    if (a[0]==b[0]) return 0;
    if (a[0]<b[0]) return -1;
    return 1;
  },
  sort_ddmm: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt2 = y+m+d;
    if (dt1==dt2) return 0;
    if (dt1<dt2) return -1;
    return 1;
  },
  sort_mmdd: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) m = '0'+m;
    if (d.length == 1) d = '0'+d;
    dt2 = y+m+d;
    if (dt1==dt2) return 0;
    if (dt1<dt2) return -1;
    return 1;
  },
  
  shaker_sort: function(list, comp_func) {
    // A stable sort function to allow multi-level sorting of data
    // see: http://en.wikipedia.org/wiki/Cocktail_sort
    // thanks to Joseph Nahmias
    var b = 0;
    var t = list.length - 1;
    var swap = true;

    while(swap) {
        swap = false;
        for(var i = b; i < t; ++i) {
            if ( comp_func(list[i], list[i+1]) > 0 ) {
                var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
                swap = true;
            }
        } // for
        t--;

        if (!swap) break;

        for(var i = t; i > b; --i) {
            if ( comp_func(list[i], list[i-1]) < 0 ) {
                var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
                swap = true;
            }
        } // for
        b++;

    } // while(swap)
  }  
}

/* ******************************************************************
   Supporting functions: bundled here to avoid depending on a library
   ****************************************************************** */

// Dean Edwards/Matthias Miller/John Resig

/* for Mozilla/Opera9 */
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", sorttable.init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
    document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
    var script = document.getElementById("__ie_onload");
    script.onreadystatechange = function() {
        if (this.readyState == "complete") {
            sorttable.init(); // call the onload handler
        }
    };
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            sorttable.init(); // call the onload handler
        }
    }, 10);
}

/* for other browsers */
window.onload = sorttable.init;

// written by Dean Edwards, 2005
// with input from Tino Zijdel, Matthias Miller, Diego Perini

// http://dean.edwards.name/weblog/2005/10/add-event/

function dean_addEvent(element, type, handler) {
  if (element.addEventListener) {
    element.addEventListener(type, handler, false);
  } else {
    // assign each event handler a unique ID
    if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
    // create a hash table of event types for the element
    if (!element.events) element.events = {};
    // create a hash table of event handlers for each element/event pair
    var handlers = element.events[type];
    if (!handlers) {
      handlers = element.events[type] = {};
      // store the existing event handler (if there is one)
      if (element["on" + type]) {
        handlers[0] = element["on" + type];
      }
    }
    // store the event handler in the hash table
    handlers[handler.$$guid] = handler;
    // assign a global event handler to do all the work
    element["on" + type] = handleEvent;
  }
};
// a counter used to create unique IDs
dean_addEvent.guid = 1;

function removeEvent(element, type, handler) {
  if (element.removeEventListener) {
    element.removeEventListener(type, handler, false);
  } else {
    // delete the event handler from the hash table
    if (element.events && element.events[type]) {
      delete element.events[type][handler.$$guid];
    }
  }
};

function handleEvent(event) {
  var returnValue = true;
  // grab the event object (IE uses a global event object)
  event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
  // get a reference to the hash table of event handlers
  var handlers = this.events[event.type];
  // execute each event handler
  for (var i in handlers) {
    this.$$handleEvent = handlers[i];
    if (this.$$handleEvent(event) === false) {
      returnValue = false;
    }
  }
  return returnValue;
};

function fixEvent(event) {
  // add W3C standard event methods
  event.preventDefault = fixEvent.preventDefault;
  event.stopPropagation = fixEvent.stopPropagation;
  return event;
};
fixEvent.preventDefault = function() {
  this.returnValue = false;
};
fixEvent.stopPropagation = function() {
  this.cancelBubble = true;
}

// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*
  forEach, version 1.0
  Copyright 2006, Dean Edwards
  License: http://www.opensource.org/licenses/mit-license.php
*/

// array-like enumeration
if (!Array.forEach) { // mozilla already supports this
  Array.forEach = function(array, block, context) {
    for (var i = 0; i < array.length; i++) {
      block.call(context, array[i], i, array);
    }
  };
}

// generic enumeration
Function.prototype.forEach = function(object, block, context) {
  for (var key in object) {
    if (typeof this.prototype[key] == "undefined") {
      block.call(context, object[key], key, object);
    }
  }
};

// character enumeration
String.forEach = function(string, block, context) {
  Array.forEach(string.split(""), function(chr, index) {
    block.call(context, chr, index, string);
  });
};

// globally resolve forEach enumeration
var forEach = function(object, block, context) {
  if (object) {
    var resolve = Object; // default
    if (object instanceof Function) {
      // functions have a "length" property
      resolve = Function;
    } else if (object.forEach instanceof Function) {
      // the object implements a custom forEach method so use that
      object.forEach(block, context);
      return;
    } else if (typeof object == "string") {
      // the object is a string
      resolve = String;
    } else if (typeof object.length == "number") {
      // the object is array-like
      resolve = Array;
    }
    resolve.forEach(object, block, context);
  }
};



/* --------- END /usr/local/tomcat5/webapps/CleverTV/js/sorttable.js --------- */



/* --------- START stringTokenizer.js --------- */

/*
   Client side JavaScript object for tokenization of a string.
   Best used for something as simple as a comma separated record of values.

   Sample usage:

   <script type="text/javascript" language="javascript" src="../lib/stringTokenizer.js"></script>
   <script type="text/javascript" language="javascript">

    var separator = ",";
    var names = "one,two,three";

    var tokenizer = new StringTokenizer (names, separator);

    while (tokenizer.hasMoreTokens())
    {
      document.write("<p>Name " + tokenizer.nextToken() + "</p>");
    }  // end while

   </script>

Edited 27/09/2004 11:26AM
   Added a trim function and fixed a few "this"
   references that were not there and should have
   been.
Edited 14/02/2005 9:33PM
   Thanks to Cliff Hale for this!
   getTokens() is dropping the last token in the string if the
   last token is only 1 char in length (e.g.,  "1,2,3" would result
   in it returning "1,2")  To remedy this, I made the following change:   ....
   // Go through material, token at a time.
    while (this.material.length - start >= 1)

   Also changed the while in getTokens to skip over repeating instances
   of the separator.

*/



/*
   Constructor.
   Split up a material string based upong the separator.

   Param    -  material, the String to be split up.
   Param    -  separator, the String to look for within material. Should be
               something like "," or ".", not a regular expression.

*/
function StringTokenizer (material, separator)
{
   // Attributes.
   this.material = material;
   this.separator = separator;

   // Operations.
   this.getTokens = getTokens;
   this.nextToken = nextToken;
   this.countTokens = countTokens;
   this.hasMoreTokens = hasMoreTokens;
   this.tokensReturned = tokensReturned;

   // Initialisation code.
   this.tokens = this.getTokens();
   this.tokensReturned = 0;

}  // end constructor




/*
   Go through material, putting each token into a new array.

   Return      - the array with all the tokens in it.
*/
function getTokens()
{
   // Create array of tokens.
   var tokens = new Array();
   var nextToken;

   // If no separators found, single token is the material string itself.
  if (this.material.indexOf (this.separator) < 0)
  {
    tokens [0] = this.material;
    return tokens;
  }  // end if

   // Establish initial start and end positions of the first token.
   start = 0;
   end = this.material.indexOf (this.separator, start);

   // Counter for how many tokens were found.
   var counter = 0;

   // Go through material, token at a time.
   var trimmed;
  while (this.material.length - start >= 1)
  {
    nextToken = this.material.substring (start, end);
    start = end + 1;
    if (this.material.indexOf (this.separator, start + 1) < 0)
    {
      end = this.material.length;
    }  // end if
    else
    {
      end = this.material.indexOf (this.separator, start + 1);
    }  // end else

      trimmed = trim (nextToken);

      // Remove any extra separators at start.
      while (trimmed.substring(0, this.separator.length) == this.separator) {
         trimmed = trimmed.substring (this.separator.length);
      }
      trimmed = trim(trimmed);
      if (trimmed == "") {
         continue;
      }
      tokens [counter] = trimmed;
    counter ++;
  }   // end if

   // Return the initialised array.
   return tokens;


}  // end getTokens function


/*
   Return a count of the number of tokens in the material.

   Return      - int number of tokens in material.
*/
function countTokens()
{
  return this.tokens.length;
}  // end countTokens function



/*
   Get next token in material.

   Return      - next token in material.
*/
function nextToken()
{

   if (this.tokensReturned >= this.tokens.length)
   {
      return null;
   }  // end if
   else
   {
      var returnToken = this.tokens [this.tokensReturned];
      this.tokensReturned ++;
      return returnToken;
   }  // end else

}  // end nextToken function



/*
   Tests if there are more tokens available from this tokenizer's string. If
   this method returns true, then a subsequent call to nextToken
   will successfully return a token.

   Return      true if more tokens, false otherwise.
*/
function hasMoreTokens()
{
   if (this.tokensReturned < this.tokens.length)
   {
      return true;
   }  // end if
   else
   {
      return false;
   }  // end else
}  // end hasMoreTokens function

function tokensReturned()
{
   return this.tokensReturned;
}  // end tokensReturned function


function trim (strToTrim) {
   return(strToTrim.replace(/^\s+|\s+$/g, ''));
}  // end trim function



/* --------- END /usr/local/tomcat5/webapps/CleverTV/js/stringTokenizer.js --------- */



/* --------- START jquery-1.3.2.min.js --------- */

/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();

/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/jquery-1.3.2.min.js --------- */



/* --------- START jquery.fancybox-1.0.0.js --------- */

/*
 * FancyBox - simple jQuery plugin for fancy image zooming
 * Examples and documentation at: http://fancy.klade.lv/
 * Version: 1.0.0 (29/04/2008)
 * Copyright (c) 2008 Janis Skarnelis
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 * Requires: jQuery v1.2.1 or later
*/
(function($) {
	var opts = {}, 
		imgPreloader = new Image, imgTypes = ['png', 'jpg', 'jpeg', 'gif'], 
		loadingTimer, loadingFrame = 1;

   $.fn.fancybox = function(settings) {
		opts.settings = $.extend({}, $.fn.fancybox.defaults, settings);

		$.fn.fancybox.init();

		return this.each(function() {
			var $this = $(this);
			var o = $.metadata ? $.extend({}, opts.settings, $this.metadata()) : opts.settings;

			$this.unbind('click').click(function() {
				$.fn.fancybox.start(this, o); return false;
			});
		});
	};

	$.fn.fancybox.start = function(el, o) {
		if (opts.animating) return false;

		if (o.overlayShow) {
			$("#fancy_wrap").prepend('<div id="fancy_overlay"></div>');
			$("#fancy_overlay").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': o.overlayOpacity});

			if ($.browser.msie) {
				$("#fancy_wrap").prepend('<iframe id="fancy_bigIframe" scrolling="no" frameborder="0"></iframe>');
				$("#fancy_bigIframe").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0});
			}

			$("#fancy_overlay").click($.fn.fancybox.close);
		}

		opts.itemArray	= [];
		opts.itemNum	= 0;

		if (jQuery.isFunction(o.itemLoadCallback)) {
		   o.itemLoadCallback.apply(this, [opts]);

			var c	= $(el).children("img:first").length ? $(el).children("img:first") : $(el);
			var tmp	= {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}

		   for (var i = 0; i < opts.itemArray.length; i++) {
				opts.itemArray[i].o = $.extend({}, o, opts.itemArray[i].o);
				
				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
					opts.itemArray[i].orig = tmp;
				}
		   }

		} else {
			if (!el.rel || el.rel == '') {
				var item = {url: el.href, title: el.title, o: o};

				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
					var c = $(el).children("img:first").length ? $(el).children("img:first") : $(el);
					item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
				}

				opts.itemArray.push(item);

			} else {
				var arr	= $("a[@rel=" + el.rel + "]").get();

				for (var i = 0; i < arr.length; i++) {
					var tmp		= $.metadata ? $.extend({}, o, $(arr[i]).metadata()) : o;
   					var item	= {url: arr[i].href, title: arr[i].title, o: tmp};

   					if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
						var c = $(arr[i]).children("img:first").length ? $(arr[i]).children("img:first") : $(el);

						item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
					}

					if (arr[i].href == el.href) opts.itemNum = i;

					opts.itemArray.push(item);
				}
			}
		}

		$.fn.fancybox.changeItem(opts.itemNum);
	};

	$.fn.fancybox.changeItem = function(n) {
		$.fn.fancybox.showLoading();

		opts.itemNum = n;

		$("#fancy_nav").empty();
		$("#fancy_outer").stop();
		$("#fancy_title").hide();
		$(document).unbind("keydown");

		imgRegExp = imgTypes.join('|');
    	imgRegExp = new RegExp('\.' + imgRegExp + '$', 'i');

		var url = opts.itemArray[n].url;

		if (url.match(/#/)) {
			var target = window.location.href.split('#')[0]; target = url.replace(target,'');

	        $.fn.fancybox.showItem('<div id="fancy_div">' + $(target).html() + '</div>');

	        $("#fancy_loading").hide();

		} else if (url.match(imgRegExp)) {
			$(imgPreloader).unbind('load').bind('load', function() {
				$("#fancy_loading").hide();

				opts.itemArray[n].o.frameWidth	= imgPreloader.width;
				opts.itemArray[n].o.frameHeight	= imgPreloader.height;

				$.fn.fancybox.showItem('<img id="fancy_img" src="' + imgPreloader.src + '" />');

			}).attr('src', url + '?rand=' + Math.floor(Math.random() * 999999999) );

		} else {
			$.fn.fancybox.showItem('<iframe id="fancy_frame" onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + url + '"></iframe>');
		}
	};

	$.fn.fancybox.showIframe = function() {
		$("#fancy_loading").hide();
		$("#fancy_frame").show();
	};

	$.fn.fancybox.showItem = function(val) {
		$.fn.fancybox.preloadNeighborImages();

		var viewportPos	= $.fn.fancybox.getViewport();
		var itemSize	= $.fn.fancybox.getMaxSize(viewportPos[0] - 50, viewportPos[1] - 100, opts.itemArray[opts.itemNum].o.frameWidth, opts.itemArray[opts.itemNum].o.frameHeight);

		var itemLeft	= viewportPos[2] + Math.round((viewportPos[0] - itemSize[0]) / 2) - 20;
		var itemTop		= viewportPos[3] + Math.round((viewportPos[1] - itemSize[1]) / 2) - 40;

		var itemOpts = {
			'left':		itemLeft, 
			'top':		itemTop, 
			'width':	itemSize[0] + 'px', 
			'height':	itemSize[1] + 'px'	
		}

		if (opts.active) {
			$('#fancy_content').fadeOut("normal", function() {
				$("#fancy_content").empty();
				
				$("#fancy_outer").animate(itemOpts, "normal", function() {
					$("#fancy_content").append($(val)).fadeIn("normal");
					$.fn.fancybox.updateDetails();
				});
			});

		} else {
			opts.active = true;

			$("#fancy_content").empty();

			if ($("#fancy_content").is(":animated")) {
				console.info('animated!');
			}

			if (opts.itemArray[opts.itemNum].o.zoomSpeedIn > 0) {
				opts.animating		= true;
				itemOpts.opacity	= "show";

				$("#fancy_outer").css({
					'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
					'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
					'height':	opts.itemArray[opts.itemNum].orig.height,
					'width':	opts.itemArray[opts.itemNum].orig.width
				});

				$("#fancy_content").append($(val)).show();

				$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedIn, function() {
					opts.animating = false;
					$.fn.fancybox.updateDetails();
				});

			} else {
				$("#fancy_content").append($(val)).show();
				$("#fancy_outer").css(itemOpts).show();
				$.fn.fancybox.updateDetails();
			}
		 }
	};

	$.fn.fancybox.updateDetails = function() {
		$("#fancy_bg,#fancy_close").show();

		if (opts.itemArray[opts.itemNum].title !== undefined && opts.itemArray[opts.itemNum].title !== '') {
			$('#fancy_title div').html(opts.itemArray[opts.itemNum].title);
			$('#fancy_title').show();
		}

		if (opts.itemArray[opts.itemNum].o.hideOnContentClick) {
			$("#fancy_content").click($.fn.fancybox.close);
		} else {
			$("#fancy_content").unbind('click');
		}

		if (opts.itemNum != 0) {
			$("#fancy_nav").append('<a id="fancy_left" href="javascript:;"></a>');

			$('#fancy_left').click(function() {
				$.fn.fancybox.changeItem(opts.itemNum - 1); return false;
			});
		}

		if (opts.itemNum != (opts.itemArray.length - 1)) {
			$("#fancy_nav").append('<a id="fancy_right" href="javascript:;"></a>');
			
			$('#fancy_right').click(function(){
				$.fn.fancybox.changeItem(opts.itemNum + 1); return false;
			});
		}

		$(document).keydown(function(event) {
			if (event.keyCode == 27) {
            	$.fn.fancybox.close();

			} else if(event.keyCode == 37 && opts.itemNum != 0) {
            	$.fn.fancybox.changeItem(opts.itemNum - 1);

			} else if(event.keyCode == 39 && opts.itemNum != (opts.itemArray.length - 1)) {
            	$.fn.fancybox.changeItem(opts.itemNum + 1);
			}
		});
	};

	$.fn.fancybox.preloadNeighborImages = function() {
		if ((opts.itemArray.length - 1) > opts.itemNum) {
			preloadNextImage = new Image();
			preloadNextImage.src = opts.itemArray[opts.itemNum + 1].url;
		}

		if (opts.itemNum > 0) {
			preloadPrevImage = new Image();
			preloadPrevImage.src = opts.itemArray[opts.itemNum - 1].url;
		}
	};

	$.fn.fancybox.close = function() {
		if (opts.animating) return false;

		$(imgPreloader).unbind('load');
		$(document).unbind("keydown");

		$("#fancy_loading,#fancy_title,#fancy_close,#fancy_bg").hide();

		$("#fancy_nav").empty();

		opts.active	= false;

		if (opts.itemArray[opts.itemNum].o.zoomSpeedOut > 0) {
			var itemOpts = {
				'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
				'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
				'height':	opts.itemArray[opts.itemNum].orig.height,
				'width':	opts.itemArray[opts.itemNum].orig.width,
				'opacity':	'hide'
			};

			opts.animating = true;

			$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedOut, function() {
				$("#fancy_content").hide().empty();
				$("#fancy_overlay,#fancy_bigIframe").remove();
				opts.animating = false;
			});

		} else {
			$("#fancy_outer").hide();
			$("#fancy_content").hide().empty();
			$("#fancy_overlay,#fancy_bigIframe").fadeOut("fast").remove();
		}
	};

	$.fn.fancybox.showLoading = function() {
		clearInterval(loadingTimer);

		var pos = $.fn.fancybox.getViewport();

		$("#fancy_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show();
		$("#fancy_loading").bind('click', $.fn.fancybox.close);
		
		loadingTimer = setInterval($.fn.fancybox.animateLoading, 66);
	};

	$.fn.fancybox.animateLoading = function(el, o) {
		if (!$("#fancy_loading").is(':visible')){
			clearInterval(loadingTimer);
			return;
		}

		$("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px');

		loadingFrame = (loadingFrame + 1) % 12;
	};

	$.fn.fancybox.init = function() {
		if (!$('#fancy_wrap').length) {
			$('<div id="fancy_wrap"><div id="fancy_loading"><div></div></div><div id="fancy_outer"><div id="fancy_inner"><div id="fancy_nav"></div><div id="fancy_close"></div><div id="fancy_content"></div><div id="fancy_title"></div></div></div></div>').appendTo("body");
			$('<div id="fancy_bg"><div class="fancy_bg fancy_bg_n"></div><div class="fancy_bg fancy_bg_ne"></div><div class="fancy_bg fancy_bg_e"></div><div class="fancy_bg fancy_bg_se"></div><div class="fancy_bg fancy_bg_s"></div><div class="fancy_bg fancy_bg_sw"></div><div class="fancy_bg fancy_bg_w"></div><div class="fancy_bg fancy_bg_nw"></div></div>').prependTo("#fancy_inner");
			
			$('<table cellspacing="0" cellpadding="0" border="0"><tr><td id="fancy_title_left"></td><td id="fancy_title_main"><div></div></td><td id="fancy_title_right"></td></tr></table>').appendTo('#fancy_title');
		}

		if ($.browser.msie) {
			$("#fancy_inner").prepend('<iframe id="fancy_freeIframe" scrolling="no" frameborder="0"></iframe>');
		}

		if (jQuery.fn.pngFix) $(document).pngFix();

    	$("#fancy_close").click($.fn.fancybox.close);
	};

	$.fn.fancybox.getPosition = function(el) {
		var pos = el.offset();

		pos.top	+= $.fn.fancybox.num(el, 'paddingTop');
		pos.top	+= $.fn.fancybox.num(el, 'borderTopWidth');

 		pos.left += $.fn.fancybox.num(el, 'paddingLeft');
		pos.left += $.fn.fancybox.num(el, 'borderLeftWidth');

		return pos;
	};

	$.fn.fancybox.num = function (el, prop) {
		return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
	};

	$.fn.fancybox.getPageScroll = function() {
		var xScroll, yScroll;

		if (self.pageYOffset) {
			yScroll = self.pageYOffset;
			xScroll = self.pageXOffset;
		} else if (document.documentElement && document.documentElement.scrollTop) {
			yScroll = document.documentElement.scrollTop;
			xScroll = document.documentElement.scrollLeft;
		} else if (document.body) {
			yScroll = document.body.scrollTop;
			xScroll = document.body.scrollLeft;	
		}

		return [xScroll, yScroll]; 
	};

	$.fn.fancybox.getViewport = function() {
		var scroll = $.fn.fancybox.getPageScroll();

		return [$(window).width(), $(window).height(), scroll[0], scroll[1]];
	};

	$.fn.fancybox.getMaxSize = function(maxWidth, maxHeight, imageWidth, imageHeight) {
		var r = Math.min(Math.min(maxWidth, imageWidth) / imageWidth, Math.min(maxHeight, imageHeight) / imageHeight);

		return [Math.round(r * imageWidth), Math.round(r * imageHeight)];
	};

	$.fn.fancybox.defaults = {
		hideOnContentClick:	false,
		zoomSpeedIn:		500,
		zoomSpeedOut:		500,
		frameWidth:			600,
		frameHeight:		400,
		overlayShow:		false,
		overlayOpacity:		0.8,
		itemLoadCallback:	null
	};
	
		
})(jQuery);

/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/jquery.fancybox-1.0.0.js --------- */



/* --------- START tools.tooltip-1.0.2.js --------- */

/**
 * tools.tooltip 1.0.2 - Tooltips done right.
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/tooltip.html
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 *
 * Launch  : November 2008
 * Date: 2009-06-12 11:02:45 +0000 (Fri, 12 Jun 2009)
 * Revision: 1911 
 */
(function($) { 

	// static constructs
	$.tools = $.tools || {version: {}};
	
	$.tools.version.tooltip = '1.0.2';
	
	
	var effects = { 
		toggle: [
			function() { this.getTip().show(); },  
			function() { this.getTip().hide(); }
		],
		
		fade: [
			function() { this.getTip().fadeIn(this.getConf().fadeInSpeed); },  
			function() { this.getTip().fadeOut(this.getConf().fadeOutSpeed); } 
		]		
	};   
	
		
	$.tools.addTipEffect = function(name, loadFn, hideFn) {
		effects[name] = [loadFn, hideFn];	
	};
	
	
	/* this is how you add custom effects */
	
	/*
		default effect: "slideup", custom configuration variables: 
			- slideOffset
			- slideInSpeed
			- slideOutSpeed
	*/
	$.tools.addTipEffect("slideup", 
		
		function() { 
			var conf = this.getConf();
			var o = conf.slideOffset || 10;
			this.getTip().css({opacity:0}).animate({
				top: '-=' + o, 
				opacity:conf.opacity				
			}, conf.slideInSpeed || 200).show();                                            
		}, 
		
		function() {
			var conf = this.getConf();
			var o = conf.slideOffset || 10;
			this.getTip().animate({top: '-=' + o, opacity:0}, conf.slideOutSpeed || 200, function() { 
					$(this).hide().animate({top: '+=' + (o * 2)}, 0);
			});
		}
	);

	function Tooltip(trigger, conf) {
		
		var self = this;
		
		// find the tip
		var tip = trigger.next(); 
		
		if (conf.tip) {
			
			// single tip. ie: #tip
			if (conf.tip.indexOf("#") != -1) {
				tip = $(conf.tip);	
			
			} else {
				
				// find sibling
				tip = trigger.nextAll(conf.tip).eq(0);	
				
				// find sibling from the parent element
				if (!tip.length) {
					tip = trigger.parent().nextAll(conf.tip).eq(0);
				}
			} 
		} 
		
		// generic binding function
		function bind(name, fn) {
			$(self).bind(name, function(e, args)  {
				if (fn && fn.call(this) === false && args) {
					args.proceed = false;	
				}	
			});	
			
			return self;
		}
		
		// bind all callbacks from configuration
		$.each(conf, function(name, fn) {                   
			if ($.isFunction(fn)) { bind(name, fn); }
		}); 

		
		// mouse interaction 
		var isInput = trigger.is("input, textarea"); 
		trigger.bind(isInput ? "focus" : "mouseover", function(e) { 	 
			e.target = this;	
			self.show(e);  
			tip.hover(function() { self.show(); }, function() { self.hide(); }); 
		});
		
		trigger.bind(isInput ? "blur" : "mouseout", function() {
			self.hide(); 
		});

		tip.css("opacity", conf.opacity);		
		
		var timer = 0;
		
		$.extend(self, {
				
			show: function(e) {
				
				if (e) { trigger = $(e.target); }
				
				clearTimeout(timer);
				if (tip.is(":animated") || tip.is(":visible")) { return self; } 
				
				// onBeforeShow
				var p = {proceed: true};
				$(self).trigger("onBeforeShow", p);				
				if (!p.proceed) { return self; }

				
				
				/* calculate tip position */  
				 
				// vertical axis
				var top = trigger.position().top - tip.outerHeight();				
				var height = tip.outerHeight() + trigger.outerHeight();				
				var pos = conf.position[0];				
				if (pos == 'center') { top += height / 2; }
				if (pos == 'bottom') { top += height; }
				
				
				// horizontal axis
				var width = trigger.outerWidth() + tip.outerWidth();
				var left = trigger.position().left + trigger.outerWidth();									
				pos = conf.position[1];
				
				
				if (pos == 'center') { left -= width / 2; }
				if (pos == 'left')   { left -= width; }	
				
				// offset
				top += conf.offset[0];
				left += conf.offset[1];
				
				// set position
				tip.css({position:'absolute', top: top, left: left});

				
				effects[conf.effect][0].call(self);
				$(self).trigger("onShow");
				return self;
			},
			
			hide: function() {  
				clearTimeout(timer); 
				
				timer = setTimeout(function() {
					if (!tip.is(":visible")) { return self; }
					
					// onBeforeHide
					var p = {proceed: true};
					$(self).trigger("onBeforeHide", p);				
					if (!p.proceed) { return self; }

					
					effects[conf.effect][1].call(self); 
					$(self).trigger("onHide");
					
				}, conf.delay || 1);								 

				return self;
			},
			
			isShown: function() {
				return tip.is(":visible, :animated");	
			},
				
			getConf: function() {
				return conf;	
			},
				
			getTip: function() {
				return tip;	
			},
			
			getTrigger: function() {
				return trigger;	
			},
			
			// callback functions
			onBeforeShow: function(fn) {
				return bind("onBeforeShow", fn); 		
			},
			
			onShow: function(fn) {
				return bind("onShow", fn); 		
			},
			
			onBeforeHide: function(fn) {
				return bind("onBeforeHide", fn); 		
			},
			 
			onHide: function(fn) {
				return bind("onHide", fn); 		
			} 		

		});
		
	}
		
	
	// jQuery plugin implementation
	$.prototype.tooltip = function(conf) {
		
		// return existing instance
		var el = this.eq(typeof conf == 'number' ? conf : 0).data("tooltip");
		if (el) { return el; }
		
		// setup options
		var opts = { 

			/* 			
			- slideOffset
			- slideInSpeed
			- slideOutSpeed 
			*/	
			
			tip: null,
			effect: 'slideup',
			delay: 30,
			opacity: 1, 
			
			// 'top', 'bottom', 'right', 'left', 'center'
			position: ['top', 'center'], 
			offset: [0, 0], 
			api: false 
		};
		
		if ($.isFunction(conf)) {
			conf = {onBeforeShow: conf};
		}
		
		$.extend(opts, conf);
		
		// install tabs for each items in jQuery
		this.each(function() {
			el = new Tooltip($(this), opts);
			$(this).data("tooltip", el);	 
		});
		

		return opts.api ? el: this;		
		
	};
		
}) (jQuery);

		



/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/tools.tooltip-1.0.2.js --------- */



/* --------- START jquery.countdown.js --------- */

/* http://keith-wood.name/countdown.html
   Countdown for jQuery v1.5.3.
   Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
   Please attribute the author if you use it. */

/* Display a countdown timer.
   Attach it with options like:
   $('div selector').countdown(
       {until: new Date(2009, 1 - 1, 1, 0, 0, 0), onExpiry: happyNewYear}); */

(function($) { // Hide scope, no $ conflict

/* Countdown manager. */
function Countdown() {
	this.regional = []; // Available regional settings, indexed by language code
	this.regional[''] = { // Default regional settings
		// The display texts for the counters
		labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
		// The display texts for the counters if only one
		labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
		compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters
		timeSeparator: ':', // Separator for time periods
		isRTL: false // True for right-to-left languages, false for left-to-right
	};
	this._defaults = {
		until: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
			// or numeric for seconds offset, or string for unit offset(s):
			// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
		since: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count up from
			// or numeric for seconds offset, or string for unit offset(s):
			// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
		timezone: null, // The timezone (hours or minutes from GMT) for the target times,
			// or null for client local
		format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
			// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
		layout: '', // Build your own layout for the countdown
		compact: false, // True to display in a compact format, false for an expanded one
		description: '', // The description displayed for the countdown
		expiryUrl: '', // A URL to load upon expiry, replacing the current page
		expiryText: '', // Text to display upon expiry, replacing the countdown
		alwaysExpire: false, // True to trigger onExpiry even if never counted down
		onExpiry: null, // Callback when the countdown expires -
			// receives no parameters and 'this' is the containing division
		onTick: null // Callback when the countdown is updated -
			// receives int[7] being the breakdown by period (based on format)
			// and 'this' is the containing division
	};
	$.extend(this._defaults, this.regional['']);
}

var PROP_NAME = 'countdown';

var Y = 0; // Years
var O = 1; // Months
var W = 2; // Weeks
var D = 3; // Days
var H = 4; // Hours
var M = 5; // Minutes
var S = 6; // Seconds

$.extend(Countdown.prototype, {
	/* Class name added to elements to indicate already configured with countdown. */
	markerClassName: 'hasCountdown',
	
	/* Shared timer for all countdowns. */
	_timer: setInterval(function() { $.countdown._updateTargets(); }, 980),
	/* List of currently active countdown targets. */
	_timerTargets: [],
	
	/* Override the default settings for all instances of the countdown widget.
	   @param  options  (object) the new settings to use as defaults */
	setDefaults: function(options) {
		this._resetExtraLabels(this._defaults, options);
		extendRemove(this._defaults, options || {});
	},

	/* Convert a date/time to UTC.
	   @param  tz     (number) the hour or minute offset from GMT, e.g. +9, -360
	   @param  year   (Date) the date/time in that timezone or
	                  (number) the year in that timezone
	   @param  month  (number, optional) the month (0 - 11) (omit if year is a Date)
	   @param  day    (number, optional) the day (omit if year is a Date)
	   @param  hours  (number, optional) the hour (omit if year is a Date)
	   @param  mins   (number, optional) the minute (omit if year is a Date)
	   @param  secs   (number, optional) the second (omit if year is a Date)
	   @param  ms     (number, optional) the millisecond (omit if year is a Date)
	   @return  (Date) the equivalent UTC date/time */
	UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
		if (typeof year == 'object' && year.constructor == Date) {
			ms = year.getMilliseconds();
			secs = year.getSeconds();
			mins = year.getMinutes();
			hours = year.getHours();
			day = year.getDate();
			month = year.getMonth();
			year = year.getFullYear();
		}
		var d = new Date();
		d.setUTCFullYear(year);
		d.setUTCDate(1);
		d.setUTCMonth(month || 0);
		d.setUTCDate(day || 1);
		d.setUTCHours(hours || 0);
		d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
		d.setUTCSeconds(secs || 0);
		d.setUTCMilliseconds(ms || 0);
		return d;
	},

	/* Attach the countdown widget to a div.
	   @param  target   (element) the containing division
	   @param  options  (object) the initial settings for the countdown */
	_attachCountdown: function(target, options) {
		var $target = $(target);
		if ($target.hasClass(this.markerClassName)) {
			return;
		}
		$target.addClass(this.markerClassName);
		var inst = {options: $.extend({}, options),
			_periods: [0, 0, 0, 0, 0, 0, 0]};
		$.data(target, PROP_NAME, inst);
		this._changeCountdown(target);
	},

	/* Add a target to the list of active ones.
	   @param  target  (element) the countdown target */
	_addTarget: function(target) {
		if (!this._hasTarget(target)) {
			this._timerTargets.push(target);
		}
	},

	/* See if a target is in the list of active ones.
	   @param  target  (element) the countdown target
	   @return  (boolean) true if present, false if not */
	_hasTarget: function(target) {
		return ($.inArray(target, this._timerTargets) > -1);
	},

	/* Remove a target from the list of active ones.
	   @param  target  (element) the countdown target */
	_removeTarget: function(target) {
		this._timerTargets = $.map(this._timerTargets,
			function(value) { return (value == target ? null : value); }); // delete entry
	},

	/* Update each active timer target. */
	_updateTargets: function() {
		for (var i = 0; i < this._timerTargets.length; i++) {
			this._updateCountdown(this._timerTargets[i]);
		}
	},

	/* Redisplay the countdown with an updated display.
	   @param  target  (jQuery) the containing division
	   @param  inst    (object) the current settings for this instance */
	_updateCountdown: function(target, inst) {
		var $target = $(target);
		inst = inst || $.data(target, PROP_NAME);
		if (!inst) {
			return;
		}
		$target.html(this._generateHTML(inst));
		$target[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl');
		var onTick = this._get(inst, 'onTick');
		if (onTick) {
			onTick.apply(target, [inst._hold != 'lap' ? inst._periods :
				this._calculatePeriods(inst, inst._show, new Date())]);
		}
		var expired = inst._hold != 'pause' &&
			(inst._since ? inst._now.getTime() <= inst._since.getTime() :
			inst._now.getTime() >= inst._until.getTime());
		if (expired && !inst._expiring) {
			inst._expiring = true;
			if (this._hasTarget(target) || this._get(inst, 'alwaysExpire')) {
				this._removeTarget(target);
				var onExpiry = this._get(inst, 'onExpiry');
				if (onExpiry) {
					onExpiry.apply(target, []);
				}
				var expiryText = this._get(inst, 'expiryText');
				if (expiryText) {
					var layout = this._get(inst, 'layout');
					inst.options.layout = expiryText;
					this._updateCountdown(target, inst);
					inst.options.layout = layout;
				}
				var expiryUrl = this._get(inst, 'expiryUrl');
				if (expiryUrl) {
					window.location = expiryUrl;
				}
			}
			inst._expiring = false;
		}
		else if (inst._hold == 'pause') {
			this._removeTarget(target);
		}
		$.data(target, PROP_NAME, inst);
	},

	/* Reconfigure the settings for a countdown div.
	   @param  target   (element) the containing division
	   @param  options  (object) the new settings for the countdown or
	                    (string) an individual property name
	   @param  value    (any) the individual property value
	                    (omit if options is an object) */
	_changeCountdown: function(target, options, value) {
		options = options || {};
		if (typeof options == 'string') {
			var name = options;
			options = {};
			options[name] = value;
		}
		var inst = $.data(target, PROP_NAME);
		if (inst) {
			this._resetExtraLabels(inst.options, options);
			extendRemove(inst.options, options);
			this._adjustSettings(inst);
			$.data(target, PROP_NAME, inst);
			var now = new Date();
			if ((inst._since && inst._since < now) ||
					(inst._until && inst._until > now)) {
				this._addTarget(target);
			}
			this._updateCountdown(target, inst);
		}
	},

	/* Reset any extra labelsn and compactLabelsn entries if changing labels.
	   @param  base     (object) the options to be updated
	   @param  options  (object) the new option values */
	_resetExtraLabels: function(base, options) {
		var changingLabels = false;
		for (var n in options) {
			if (n.match(/[Ll]abels/)) {
				changingLabels = true;
				break;
			}
		}
		if (changingLabels) {
			for (var n in base) { // Remove custom numbered labels
				if (n.match(/[Ll]abels[0-9]/)) {
					base[n] = null;
				}
			}
		}
	},

	/* Remove the countdown widget from a div.
	   @param  target  (element) the containing division */
	_destroyCountdown: function(target) {
		var $target = $(target);
		if (!$target.hasClass(this.markerClassName)) {
			return;
		}
		this._removeTarget(target);
		$target.removeClass(this.markerClassName).empty();
		$.removeData(target, PROP_NAME);
	},

	/* Pause a countdown widget at the current time.
	   Stop it running but remember and display the current time.
	   @param  target  (element) the containing division */
	_pauseCountdown: function(target) {
		this._hold(target, 'pause');
	},

	/* Pause a countdown widget at the current time.
	   Stop the display but keep the countdown running.
	   @param  target  (element) the containing division */
	_lapCountdown: function(target) {
		this._hold(target, 'lap');
	},

	/* Resume a paused countdown widget.
	   @param  target  (element) the containing division */
	_resumeCountdown: function(target) {
		this._hold(target, null);
	},

	/* Pause or resume a countdown widget.
	   @param  target  (element) the containing division
	   @param  hold    (string) the new hold setting */
	_hold: function(target, hold) {
		var inst = $.data(target, PROP_NAME);
		if (inst) {
			if (inst._hold == 'pause' && !hold) {
				inst._periods = inst._savePeriods;
				var sign = (inst._since ? '-' : '+');
				inst[inst._since ? '_since' : '_until'] =
					this._determineTime(sign + inst._periods[0] + 'y' +
						sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
						sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' + 
						sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
				this._addTarget(target);
			}
			inst._hold = hold;
			inst._savePeriods = (hold == 'pause' ? inst._periods : null);
			$.data(target, PROP_NAME, inst);
			this._updateCountdown(target, inst);
		}
	},

	/* Return the current time periods.
	   @param  target  (element) the containing division
	   @return  (number[7]) the current periods for the countdown */
	_getTimesCountdown: function(target) {
		var inst = $.data(target, PROP_NAME);
		return (!inst ? null : (!inst._hold ? inst._periods :
			this._calculatePeriods(inst, inst._show, new Date())));
	},

	/* Get a setting value, defaulting if necessary.
	   @param  inst  (object) the current settings for this instance
	   @param  name  (string) the name of the required setting
	   @return  (any) the setting's value or a default if not overridden */
	_get: function(inst, name) {
		return (inst.options[name] != null ?
			inst.options[name] : $.countdown._defaults[name]);
	},
	
	/* Calculate interal settings for an instance.
	   @param  inst  (object) the current settings for this instance */
	_adjustSettings: function(inst) {
		var now = new Date();
		var timezone = this._get(inst, 'timezone');
		timezone = (timezone == null ? -new Date().getTimezoneOffset() : timezone);
		inst._since = this._get(inst, 'since');
		if (inst._since) {
			inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
		}
		inst._until = this.UTCDate(timezone, this._determineTime(this._get(inst, 'until'), now));
		inst._show = this._determineShow(inst);
	},

	/* A time may be specified as an exact value or a relative one.
	   @param  setting      (string or number or Date) - the date/time value
	                        as a relative or absolute value
	   @param  defaultTime  (Date) the date/time to use if no other is supplied
	   @return  (Date) the corresponding date/time */
	_determineTime: function(setting, defaultTime) {
		var offsetNumeric = function(offset) { // e.g. +300, -2
			var time = new Date();
			time.setTime(time.getTime() + offset * 1000);
			return time;
		};
		var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
			offset = offset.toLowerCase();
			var time = new Date();
			var year = time.getFullYear();
			var month = time.getMonth();
			var day = time.getDate();
			var hour = time.getHours();
			var minute = time.getMinutes();
			var second = time.getSeconds();
			var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
			var matches = pattern.exec(offset);
			while (matches) {
				switch (matches[2] || 's') {
					case 's': second += parseInt(matches[1], 10); break;
					case 'm': minute += parseInt(matches[1], 10); break;
					case 'h': hour += parseInt(matches[1], 10); break;
					case 'd': day += parseInt(matches[1], 10); break;
					case 'w': day += parseInt(matches[1], 10) * 7; break;
					case 'o':
						month += parseInt(matches[1], 10); 
						day = Math.min(day, $.countdown._getDaysInMonth(year, month));
						break;
					case 'y':
						year += parseInt(matches[1], 10);
						day = Math.min(day, $.countdown._getDaysInMonth(year, month));
						break;
				}
				matches = pattern.exec(offset);
			}
			return new Date(year, month, day, hour, minute, second, 0);
		};
		var time = (setting == null ? defaultTime :
			(typeof setting == 'string' ? offsetString(setting) :
			(typeof setting == 'number' ? offsetNumeric(setting) : setting)));
		if (time) time.setMilliseconds(0);
		return time;
	},

	/* Determine the number of days in a month.
	   @param  year   (number) the year
	   @param  month  (number) the month
	   @return  (number) the days in that month */
	_getDaysInMonth: function(year, month) {
		return 32 - new Date(year, month, 32).getDate();
	},

	/* Generate the HTML to display the countdown widget.
	   @param  inst  (object) the current settings for this instance
	   @return  (string) the new HTML for the countdown display */
	_generateHTML: function(inst) {
		// Determine what to show
		inst._periods = periods = (inst._hold ? inst._periods :
			this._calculatePeriods(inst, inst._show, new Date()));
		// Show all 'asNeeded' after first non-zero value
		var shownNonZero = false;
		var showCount = 0;
		for (var period = 0; period < inst._show.length; period++) {
			shownNonZero |= (inst._show[period] == '?' && periods[period] > 0);
			inst._show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]);
			showCount += (inst._show[period] ? 1 : 0);
		}
		var compact = this._get(inst, 'compact');
		var layout = this._get(inst, 'layout');
		var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels'));
		var timeSeparator = this._get(inst, 'timeSeparator');
		var description = this._get(inst, 'description') || '';
		var showCompact = function(period) {
			var labelsNum = $.countdown._get(inst, 'compactLabels' + periods[period]);
			return (inst._show[period] ? periods[period] +
				(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
		};
		var showFull = function(period) {
			var labelsNum = $.countdown._get(inst, 'labels' + periods[period]);
			return (inst._show[period] ?
				'<span class="countdown_section"><span class="countdown_amount">' +
				periods[period] + '</span><br/>' +
				(labelsNum ? labelsNum[period] : labels[period]) + '</span>' : '');
		};
		return (layout ? this._buildLayout(inst, layout, compact) :
			((compact ? // Compact version
			'<span class="countdown_row countdown_amount' +
			(inst._hold ? ' countdown_holding' : '') + '">' + 
			showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) + 
			(inst._show[H] ? this._minDigits(periods[H], 2) : '') +
			(inst._show[M] ? (inst._show[H] ? timeSeparator : '') +
			this._minDigits(periods[M], 2) : '') +
			(inst._show[S] ? (inst._show[H] || inst._show[M] ? timeSeparator : '') +
			this._minDigits(periods[S], 2) : '') :
			// Full version
			'<span class="countdown_row countdown_show' + showCount +
			(inst._hold ? ' countdown_holding' : '') + '">' +
			showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
			showFull(H) + showFull(M) + showFull(S)) + '</span>' +
			(description ? '<span class="countdown_row countdown_descr">' + description + '</span>' : '')));
	},

	/* Construct a custom layout.
	   @param  inst     (object) the current settings for this instance
	   @param  layout   (string) the customised layout
	   @param  compact  (boolean) true if using compact labels
	   @return  (string) the custom HTML */
	_buildLayout: function(inst, layout, compact) {
		var labels = this._get(inst, (compact ? 'compactLabels' : 'labels'));
		var labelFor = function(index) {
			return ($.countdown._get(inst,
				(compact ? 'compactLabels' : 'labels') + inst._periods[index]) ||
				labels)[index];
		};
		var digit = function(value, position) {
			return Math.floor(value / position) % 10;
		};
		var subs = {desc: this._get(inst, 'description'), sep: this._get(inst, 'timeSeparator'),
			yl: labelFor(Y), yn: inst._periods[Y], ynn: this._minDigits(inst._periods[Y], 2),
			ynnn: this._minDigits(inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
			y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
			ol: labelFor(O), on: inst._periods[O], onn: this._minDigits(inst._periods[O], 2),
			onnn: this._minDigits(inst._periods[O], 3), o1: digit(inst._periods[O], 1),
			o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
			wl: labelFor(W), wn: inst._periods[W], wnn: this._minDigits(inst._periods[W], 2),
			wnnn: this._minDigits(inst._periods[W], 3), w1: digit(inst._periods[W], 1),
			w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
			dl: labelFor(D), dn: inst._periods[D], dnn: this._minDigits(inst._periods[D], 2),
			dnnn: this._minDigits(inst._periods[D], 3), d1: digit(inst._periods[D], 1),
			d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
			hl: labelFor(H), hn: inst._periods[H], hnn: this._minDigits(inst._periods[H], 2),
			hnnn: this._minDigits(inst._periods[H], 3), h1: digit(inst._periods[H], 1),
			h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
			ml: labelFor(M), mn: inst._periods[M], mnn: this._minDigits(inst._periods[M], 2),
			mnnn: this._minDigits(inst._periods[M], 3), m1: digit(inst._periods[M], 1),
			m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
			sl: labelFor(S), sn: inst._periods[S], snn: this._minDigits(inst._periods[S], 2),
			snnn: this._minDigits(inst._periods[S], 3), s1: digit(inst._periods[S], 1),
			s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100)};
		var html = layout;
		// Replace period containers: {p<}...{p>}
		for (var i = 0; i < 7; i++) {
			var period = 'yowdhms'.charAt(i);
			var re = new RegExp('\\{' + period + '<\\}(.*)\\{' + period + '>\\}', 'g');
			html = html.replace(re, (inst._show[i] ? '$1' : ''));
		}
		// Replace period values: {pn}
		$.each(subs, function(n, v) {
			var re = new RegExp('\\{' + n + '\\}', 'g');
			html = html.replace(re, v);
		});
		return html;
	},

	/* Ensure a numeric value has at least n digits for display.
	   @param  value  (number) the value to display
	   @param  len    (number) the minimum length
	   @return  (string) the display text */
	_minDigits: function(value, len) {
		value = '0000000000' + value;
		return value.substr(value.length - len);
	},

	/* Translate the format into flags for each period.
	   @param  inst  (object) the current settings for this instance
	   @return  (string[7]) flags indicating which periods are requested (?) or
	            required (!) by year, month, week, day, hour, minute, second */
	_determineShow: function(inst) {
		var format = this._get(inst, 'format');
		var show = [];
		show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
		show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
		show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
		show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
		show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
		show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
		show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
		return show;
	},
	
	/* Calculate the requested periods between now and the target time.
	   @param  inst  (object) the current settings for this instance
	   @param  show  (string[7]) flags indicating which periods are requested/required
	   @param  now   (Date) the current date and time
	   @return  (number[7]) the current time periods (always positive)
	            by year, month, week, day, hour, minute, second */
	_calculatePeriods: function(inst, show, now) {
		// Find endpoints
		inst._now = now;
		inst._now.setMilliseconds(0);
		var until = new Date(inst._now.getTime());
		if (inst._since && now.getTime() < inst._since.getTime()) {
			inst._now = now = until;
		}
		else if (inst._since) {
			now = inst._since;
		}
		else {
			until.setTime(inst._until.getTime());
			if (now.getTime() > inst._until.getTime()) {
				inst._now = now = until;
			}
		}
		// Calculate differences by period
		var periods = [0, 0, 0, 0, 0, 0, 0];
		if (show[Y] || show[O]) {
			// Treat end of months as the same
			var lastNow = $.countdown._getDaysInMonth(now.getFullYear(), now.getMonth());
			var lastUntil = $.countdown._getDaysInMonth(until.getFullYear(), until.getMonth());
			var sameDay = (until.getDate() == now.getDate() ||
				(until.getDate() >= Math.min(lastNow, lastUntil) &&
				now.getDate() >= Math.min(lastNow, lastUntil)));
			var getSecs = function(date) {
				return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
			};
			var months = Math.max(0,
				(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
				((until.getDate() < now.getDate() && !sameDay) ||
				(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
			periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
			periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
			// Adjust for months difference and end of month if necessary
			var adjustDate = function(date, offset, last) {
				var wasLastDay = (date.getDate() == last);
				var lastDay = $.countdown._getDaysInMonth(date.getFullYear() + offset * periods[Y],
					date.getMonth() + offset * periods[O]);
				if (date.getDate() > lastDay) {
					date.setDate(lastDay);
				}
				date.setFullYear(date.getFullYear() + offset * periods[Y]);
				date.setMonth(date.getMonth() + offset * periods[O]);
				if (wasLastDay) {
					date.setDate(lastDay);
				}
				return date;
			};
			if (inst._since) {
				until = adjustDate(until, -1, lastUntil);
			}
			else {
				now = adjustDate(new Date(now.getTime()), +1, lastNow);
			}
		}
		var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
		var extractPeriod = function(period, numSecs) {
			periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
			diff -= periods[period] * numSecs;
		};
		extractPeriod(W, 604800);
		extractPeriod(D, 86400);
		extractPeriod(H, 3600);
		extractPeriod(M, 60);
		extractPeriod(S, 1);
		return periods;
	}
});

/* jQuery extend now ignores nulls!
   @param  target  (object) the object to update
   @param  props   (object) the new settings
   @return  (object) the updated object */
function extendRemove(target, props) {
	$.extend(target, props);
	for (var name in props) {
		if (props[name] == null) {
			target[name] = null;
		}
	}
	return target;
}

/* Process the countdown functionality for a jQuery selection.
   @param  command  (string) the command to run (optional, default 'attach')
   @param  options  (object) the new settings to use for these countdown instances
   @return  (jQuery) for chaining further calls */
$.fn.countdown = function(options) {
	var otherArgs = Array.prototype.slice.call(arguments, 1);
	if (options == 'getTimes') {
		return $.countdown['_' + options + 'Countdown'].
			apply($.countdown, [this[0]].concat(otherArgs));
	}
	return this.each(function() {
		if (typeof options == 'string') {
			$.countdown['_' + options + 'Countdown'].apply($.countdown, [this].concat(otherArgs));
		}
		else {
			$.countdown._attachCountdown(this, options);
		}
	});
};

/* Initialise the countdown functionality. */
$.countdown = new Countdown(); // singleton instance

})(jQuery);


/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/jquery.countdown.js --------- */



/* --------- START playerrater.js --------- */

function checkPlayerImagesPresent(){
	$('.playerImg138x138').each(function()	{
		var t=$(this);
		var newImg = new Image();
		newImg.src = t.attr("src");
		var height = parseInt(newImg.height);
		if(height < 2){
			t.attr("src","http://en.uclratings.uefa.com/CleverTV/clients/uefa/uefa-player-rater-2009-10/images/shirt_138x138.jpg");
		}
	});
	$('.playerImg220x220').each(function()	{
		var t=$(this);
		var newImg = new Image();
		newImg.src = t.attr("src");
		var height = parseInt(newImg.height);
		if(height < 2){
			t.attr("src","http://en.uclratings.uefa.com/CleverTV/clients/uefa/uefa-player-rater-2009-10/images/shirt_220x220.jpg");
		}
	});
	$('.playerImg25x30').each(function()	{
		var t=$(this);
		var newImg = new Image();
		newImg.src = t.attr("src");
		var height = parseInt(newImg.height);
		if(height < 2){
			t.attr("src","http://en.uclratings.uefa.com/CleverTV/clients/uefa/uefa-player-rater-2009-10/images/shirt_25x30.jpg");
		}
	});	
	$('.playerImg').each(function()	{
		var t=$(this);
		var newImg = new Image();
		newImg.src = t.attr("src");
		var height = parseInt(newImg.height);
		if(height < 2){
			t.attr("src","http://en.uclratings.uefa.com/CleverTV/clients/uefa/uefa-player-rater-2009-10/images/shirt_220x220.jpg");
		}
	});	
}

/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/playerrater.js --------- */



/* --------- START jquery.jqplot.min.js --------- */

(function(e){var b;e.jqplot=function(r,o,l){var n,k;if(o==null){throw"No data specified"}if(o.constructor==Array&&o.length==0||o[0].constructor!=Array){throw"Improper Data Array"}if(l==null){if(o instanceof Array){n=o;k=null}else{if(o.constructor==Object){n=null;k=o}}}else{n=o;k=l}var q=new h();q.init(r,n,k);q.draw();return q};e.jqplot.debug=1;e.jqplot.preInitHooks=[];e.jqplot.postInitHooks=[];e.jqplot.preParseOptionsHooks=[];e.jqplot.postParseOptionsHooks=[];e.jqplot.preDrawHooks=[];e.jqplot.postDrawHooks=[];e.jqplot.preDrawSeriesHooks=[];e.jqplot.postDrawSeriesHooks=[];e.jqplot.preDrawLegendHooks=[];e.jqplot.addLegendRowHooks=[];e.jqplot.preSeriesInitHooks=[];e.jqplot.postSeriesInitHooks=[];e.jqplot.preParseSeriesOptionsHooks=[];e.jqplot.postParseSeriesOptionsHooks=[];e.jqplot.eventListenerHooks=[];e.jqplot.preDrawSeriesShadowHooks=[];e.jqplot.postDrawSeriesShadowHooks=[];e.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};e.jqplot.ElemContainer.prototype.getWidth=function(){return this._elem.outerWidth(true)};e.jqplot.ElemContainer.prototype.getHeight=function(){return this._elem.outerHeight(true)};e.jqplot.ElemContainer.prototype.getPosition=function(){return this._elem.position()};e.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};e.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};e.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};e.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function g(k){e.jqplot.ElemContainer.call(this);this.name=k;this._series=[];this.show=false;this.tickRenderer=e.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=e.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=e.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};this._offsets={min:null,max:null};this._ticks=[];this._label=null}g.prototype=new e.jqplot.ElemContainer();g.prototype.constructor=g;g.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}if(this.min!=null||this.max!=null){this.autoscale=false}this.renderer.init.call(this,this.rendererOptions)};g.prototype.draw=function(k){return this.renderer.draw.call(this,k)};g.prototype.set=function(){this.renderer.set.call(this)};g.prototype.pack=function(l,k){if(this.show){this.renderer.pack.call(this,l,k)}};function a(){e.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.xoffset=12;this.yoffset=12;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=e.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.escapeHtml=false;this._series=[]}a.prototype=new e.jqplot.ElemContainer();a.prototype.constructor=a;a.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};a.prototype.draw=function(l){for(var k=0;k<e.jqplot.preDrawLegendHooks.length;k++){e.jqplot.preDrawLegendHooks[k].call(this,l)}return this.renderer.draw.call(this,l)};a.prototype.pack=function(k){this.renderer.pack.call(this,k)};e.jqplot.TableLegendRenderer=function(){};function f(k){e.jqplot.ElemContainer.call(this);this.text=k;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=e.jqplot.DivTitleRenderer;this.rendererOptions={}}f.prototype=new e.jqplot.ElemContainer();f.prototype.constructor=f;f.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};f.prototype.draw=function(k){return this.renderer.draw.call(this,k)};f.prototype.pack=function(){this.renderer.pack.call(this)};function j(){e.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=e.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.color;this.lineWidth=2.5;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=e.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this._stack=false;this.neighborThreshold=4;this._stackData=[];this._plotData=[];this._prevPlotData=[];this._prevGridData=[];this._stackAxis="y";this._primaryAxis="_xaxis";this.plugins={}}j.prototype=new e.jqplot.ElemContainer();j.prototype.constructor=j;j.prototype.init=function(l,r){this.index=l;this.gridBorderWidth=r;var q=this.data;for(var n=0;n<q.length;n++){if(!this.breakOnNull){if(q[n]==null||q[n][0]==null||q[n][1]==null){q.splice(n,1);continue}}else{if(q[n]==null||q[n][0]==null||q[n][1]==null){var o}}}if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var k=e.jqplot.normalize2rgb(this.fillColor);var k=e.jqplot.getColorComponents(k);this.fillColor="rgba("+k[0]+","+k[1]+","+k[2]+","+this.fillAlpha+")"}this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.markerRenderer.init(this.markerOptions)};j.prototype.draw=function(r,o){var l=(o==b)?{}:o;for(var k=0;k<e.jqplot.preDrawSeriesHooks.length;k++){e.jqplot.preDrawSeriesHooks[k].call(this,r,l)}if(this.show){this.renderer.setGridData.call(this);if(!l.preventJqPlotSeriesDrawTrigger){e(r.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}var q=[];if(l.data){q=l.data}else{if(!this._stack){q=this.data}else{q=this._plotData}}var n=l.gridData||this.renderer.makeGridData.call(this,q);this.renderer.draw.call(this,r,n,l)}for(var k=0;k<e.jqplot.postDrawSeriesHooks.length;k++){e.jqplot.postDrawSeriesHooks[k].call(this,r,l)}};j.prototype.drawShadow=function(r,o){var l=(o==b)?{}:o;for(var k=0;k<e.jqplot.preDrawSeriesShadowHooks.length;k++){e.jqplot.preDrawSeriesShadowHooks[k].call(this,r,l)}if(this.shadow){this.renderer.setGridData.call(this);var q=[];if(l.data){q=l.data}else{if(!this._stack){q=this.data}else{q=this._plotData}}var n=l.gridData||this.renderer.makeGridData.call(this,q);this.renderer.drawShadow.call(this,r,n,l)}for(var k=0;k<e.jqplot.postDrawSeriesShadowHooks.length;k++){e.jqplot.postDrawSeriesShadowHooks[k].call(this,r,l)}};function d(){e.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.5;this.shadowWidth=3;this.shadowDepth=3;this.shadowAlpha="0.07";this._left;this._top;this._right;this._bottom;this._width;this._height;this._axes=[];this.renderer=e.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}d.prototype=new e.jqplot.ElemContainer();d.prototype.constructor=d;d.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};d.prototype.createElement=function(k){this._offsets=k;return this.renderer.createElement.call(this)};d.prototype.draw=function(){this.renderer.draw.call(this)};e.jqplot.GenericCanvas=function(){e.jqplot.ElemContainer.call(this);this._ctx};e.jqplot.GenericCanvas.prototype=new e.jqplot.ElemContainer();e.jqplot.GenericCanvas.prototype.constructor=e.jqplot.GenericCanvas;e.jqplot.GenericCanvas.prototype.createElement=function(q,n,l){this._offsets=q;var k="jqplot";if(n!=b){k=n}var o=document.createElement("canvas");if(l!=b){this._plotDimensions=l}o.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;o.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=e(o);this._elem.addClass(k);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});if(e.browser.msie){window.G_vmlCanvasManager.init_(document)}if(e.browser.msie){o=window.G_vmlCanvasManager.initElement(o)}return this._elem};e.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};function h(){this.data=[];this.targetId=null;this.target=null;this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{}},seriesDefaults:{},gridPadding:{top:10,right:10,bottom:10,left:10},series:[]};this.series=[];this.axes={xaxis:new g("xaxis"),yaxis:new g("yaxis"),x2axis:new g("x2axis"),y2axis:new g("y2axis"),y3axis:new g("y3axis"),y4axis:new g("y4axis"),y5axis:new g("y5axis"),y6axis:new g("y6axis"),y7axis:new g("y7axis"),y8axis:new g("y8axis"),y9axis:new g("y9axis")};this.grid=new d();this.legend=new a();this.baseCanvas=new e.jqplot.GenericCanvas();this.seriesCanvas=new e.jqplot.GenericCanvas();this.eventCanvas=new e.jqplot.GenericCanvas();this._width=null;this._height=null;this._plotDimensions={height:null,width:null};this._gridPadding={top:10,right:10,bottom:10,left:10};this.equalXTicks=true;this.equalYTicks=true;this.seriesColors=["#910707","#FF9900","#108310","#303233","#14528B","#f6e84a","#f6e84a","#4b5de4","#d8b83f","#ff5800","#0085cc"];this.sortData=true;var o=0;this.textColor;this.fontFamily;this.fontSize;this.title=new f();this.options={};this.stackSeries=false;this._stackData=[];this._plotData=[];this.plugins={};this.colorGenerator=ColorGenerator;this.init=function(w,v,t){for(var u=0;u<e.jqplot.preInitHooks.length;u++){e.jqplot.preInitHooks[u].call(this,w,v,t)}this.targetId=w;this.target=e("#"+w);if(!this.target.get(0)){throw"No plot target specified"}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){this._height=350;this.target.css("height","300px")}else{this._height=this.target.height()}if(!this.target.width()){this._width=450;this.target.css("width","455px")}else{this._width=this.target.width()}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.seriesCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Canvas dimensions <=0"}this.data=v;this.parseOptions(t);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();for(var u=0;u<this.series.length;u++){for(var r=0;r<e.jqplot.preSeriesInitHooks.length;r++){e.jqplot.preSeriesInitHooks[r].call(this.series[u],w,v,this.options.seriesDefaults,this.options.series[u])}this.populatePlotData(this.series[u],u);this.series[u]._plotDimensions=this._plotDimensions;this.series[u].init(u,this.grid.borderWidth);for(var r=0;r<e.jqplot.postSeriesInitHooks.length;r++){e.jqplot.postSeriesInitHooks[r].call(this.series[u],w,v,this.options.seriesDefaults,this.options.series[u])}}for(var q in this.axes){this.axes[q]._plotDimensions=this._plotDimensions;this.axes[q].init()}if(this.sortData){k(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var u=0;u<e.jqplot.postInitHooks.length;u++){e.jqplot.postInitHooks[u].call(this,w,v,t)}};function k(r){var t;for(var q=0;q<r.length;q++){t=r[q].data;if(r[q]._stackAxis=="x"){t.sort(function(v,u){var w=v[1]-u[1];if(w){return w}return 0})}else{t.sort(function(v,u){var w=v[0]-u[0];if(w){return w}return 0})}}}this.populatePlotData=function(u,v){this._plotData=[];this._stackData=[];u._stackData=[];u._plotData=[];if(this.stackSeries){u._stack=true;var w=u._stackAxis=="x"?0:1;var x=w?0:1;var y=e.extend(true,[],u.data);var z=e.extend(true,[],u.data);for(var t=0;t<v;t++){var q=this.series[t].data;for(var r=0;r<q.length;r++){y[r][0]+=q[r][0];y[r][1]+=q[r][1];z[r][w]+=q[r][w]}}this._plotData.push(z);this._stackData.push(y);u._stackData=y;u._plotData=z}else{this._stackData.push(u.data);this.series[v]._stackData=u.data;this._plotData.push(u.data);u._plotData=u.data}if(v>0){u._prevPlotData=this.series[v-1]._plotData}};this.getNextSeriesColor=(function(r){var q=0;var u=r.seriesColors;return function(){if(q<u.length){return u[q++]}else{q=0;return u[q++]}}})(this);this.parseOptions=function(u){for(var v=0;v<e.jqplot.preParseOptionsHooks.length;v++){e.jqplot.preParseOptionsHooks[v].call(this,u)}this.options=e.extend(true,{},this.defaults,u);this.stackSeries=this.options.stackSeries;if(this.options.seriesColors){this.seriesColors=this.options.seriesColors}var x=new this.colorGenerator(this.seriesColors);this._gridPadding=this.options.gridPadding;this.sortData=(this.options.sortData!=null)?this.options.sortData:this.sortData;for(var y in this.axes){var w=this.axes[y];e.extend(true,w,this.options.axesDefaults,this.options.axes[y]);w._plotWidth=this._width;w._plotHeight=this._height}if(this.data.length==0){this.data=[];for(var v=0;v<this.options.series.length;v++){this.data.push(this.options.series.data)}}var t=function(B){var z=[];var A;if(!(B[0] instanceof Array)){for(var A=0;A<B.length;A++){z.push([A+1,B[A]])}}else{e.extend(true,z,B)}return z};for(var v=0;v<this.data.length;v++){var q=new j();for(var r=0;r<e.jqplot.preParseSeriesOptionsHooks.length;r++){e.jqplot.preParseSeriesOptionsHooks[r].call(q,this.options.seriesDefaults,this.options.series[v])}e.extend(true,q,this.options.seriesDefaults,this.options.series[v]);q.data=t(this.data[v]);switch(q.xaxis){case"xaxis":q._xaxis=this.axes.xaxis;break;case"x2axis":q._xaxis=this.axes.x2axis;break;default:break}q._yaxis=this.axes[q.yaxis];q._xaxis._series.push(q);q._yaxis._series.push(q);if(q.show){q._xaxis.show=true;q._yaxis.show=true}if(!q.color&&q.show!=false){q.color=x.next()}if(!q.label){q.label="Series "+(v+1).toString()}this.series.push(q);for(var r=0;r<e.jqplot.postParseSeriesOptionsHooks.length;r++){e.jqplot.postParseSeriesOptionsHooks[r].call(this.series[v],this.options.seriesDefaults,this.options.series[v])}}e.extend(true,this.grid,this.options.grid);for(var y in this.axes){var w=this.axes[y];if(w.borderWidth==null){w.borderWidth=this.grid.borderWidth}if(w.borderColor==null){if(y!="xaxis"&&y!="x2axis"&&w.useSeriesColor===true&&w.show){w.borderColor=w._series[0].color}else{w.borderColor=this.grid.borderColor}}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){e.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;e.extend(true,this.legend,this.options.legend);for(var v=0;v<e.jqplot.postParseOptionsHooks.length;v++){e.jqplot.postParseOptionsHooks[v].call(this,u)}};this.redraw=function(){this.target.trigger("jqplotPreRedraw");this.target.empty();for(var r in this.axes){this.axes[r]._ticks=[]}for(var q=0;q<this.series.length;q++){this.populatePlotData(this.series[q],q)}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){this.target.trigger("jqplotPreDraw");for(var x=0;x<e.jqplot.preDrawHooks.length;x++){e.jqplot.preDrawHooks[x].call(this)}this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas"));var w=this.baseCanvas.setContext();this.target.append(this.title.draw());this.title.pack({top:0,left:0});for(var t in this.axes){this.target.append(this.axes[t].draw(w));this.axes[t].set()}if(this.axes.yaxis.show){this._gridPadding.left=this.axes.yaxis.getWidth()}var u=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var r=[0,0,0,0];var z=0;for(var v=8;v>0;v--){var q=this.axes[u[v-1]];if(q.show){r[v-1]=z;z+=q.getWidth()}}if(z>this._gridPadding.right){this._gridPadding.right=z}if(this.title.show&&this.axes.x2axis.show){this._gridPadding.top=this.title.getHeight()+this.axes.x2axis.getHeight()}else{if(this.title.show){this._gridPadding.top=this.title.getHeight()}else{if(this.axes.x2axis.show){this._gridPadding.top=this.axes.x2axis.getHeight()}}}if(this.axes.xaxis.show){this._gridPadding.bottom=this.axes.xaxis.getHeight()}this.axes.xaxis.pack({position:"absolute",bottom:0,left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});this.axes.yaxis.pack({position:"absolute",top:0,left:0,height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.axes.x2axis.pack({position:"absolute",top:this.title.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(var x=8;x>0;x--){this.axes[u[x-1]].pack({position:"absolute",top:0,right:r[x-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}this.target.append(this.grid.createElement(this._gridPadding));this.grid.draw();this.target.append(this.seriesCanvas.createElement(this._gridPadding,"jqplot-series-canvas"));var B=this.seriesCanvas.setContext();this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas"));var A=this.eventCanvas.setContext();A.fillStyle="rgba(0,0,0,0)";A.fillRect(0,0,A.canvas.width,A.canvas.height);this.bindCustomEvents();if(this.legend.preDraw){this.target.append(this.legend.draw());this.legend.pack(this._gridPadding);if(this.legend._elem){this.drawSeries(B,{legendInfo:{location:this.legend.location,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}})}else{this.drawSeries(B)}}else{this.drawSeries(B);this.target.append(this.legend.draw());this.legend.pack(this._gridPadding)}for(var x=0;x<e.jqplot.eventListenerHooks.length;x++){var y=e.jqplot.eventListenerHooks[x];this.eventCanvas._elem.bind(y[0],{plot:this},y[1])}for(var x=0;x<e.jqplot.postDrawHooks.length;x++){e.jqplot.postDrawHooks[x].call(this)}this.target.trigger("jqplotPostDraw",[this])};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave)};function l(z){var y=z.data.plot;var u=y.eventCanvas._elem.offset();var x={x:z.pageX-u.left,y:z.pageY-u.top};var v={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null};var w=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var q=y.axes;for(var r=11;r>0;r--){var t=w[r-1];if(q[t].show){v[t]=q[t].series_p2u(x[t.charAt(0)])}}return({offsets:u,gridPos:x,dataPos:v})}function n(A,E,D){var B=null;var F,w,u,C,v,t;var z;for(var w=0;w<A.series.length;w++){F=A.series[w];t=F.renderer;if(F.show){z=Math.abs(F.markerRenderer.size/2+F.neighborThreshold);for(var v=0;v<F.gridData.length;v++){p=F.gridData[v];if(t.constructor==e.jqplot.OHLCRenderer){if(t.candleStick){var q=F._yaxis.series_u2p;if(E>=p[0]-t.bodyWidth/2&&E<=p[0]+t.bodyWidth/2&&D>=q(F.data[v][2])&&D<=q(F.data[v][3])){B={seriesIndex:w,pointIndex:v,gridData:p,data:F.data[v]}}}else{if(!t.hlc){var q=F._yaxis.series_u2p;if(E>=p[0]-t.tickLength&&E<=p[0]+t.tickLength&&D>=q(F.data[v][2])&&D<=q(F.data[v][3])){B={seriesIndex:w,pointIndex:v,gridData:p,data:F.data[v]}}}else{var q=F._yaxis.series_u2p;if(E>=p[0]-t.tickLength&&E<=p[0]+t.tickLength&&D>=q(F.data[v][1])&&D<=q(F.data[v][2])){B={seriesIndex:w,pointIndex:v,gridData:p,data:F.data[v]}}}}}else{C=Math.sqrt((E-p[0])*(E-p[0])+(D-p[1])*(D-p[1]));if(C<=z&&(C<=u||u==null)){u=C;B={seriesIndex:w,pointIndex:v,gridData:p,data:F.data[v]}}}}}}return B}this.onClick=function(r){var q=l(r);var u=r.data.plot;var t=n(u,q.gridPos.x,q.gridPos.y);r.data.plot.eventCanvas._elem.trigger("jqplotClick",[q.gridPos,q.dataPos,t,u])};this.onDblClick=function(r){var q=l(r);var u=r.data.plot;var t=n(u,q.gridPos.x,q.gridPos.y);r.data.plot.eventCanvas._elem.trigger("jqplotDblClick",[q.gridPos,q.dataPos,t,u])};this.onMouseDown=function(r){var q=l(r);var u=r.data.plot;var t=n(u,q.gridPos.x,q.gridPos.y);r.data.plot.eventCanvas._elem.trigger("jqplotMouseDown",[q.gridPos,q.dataPos,t,u])};this.onMouseUp=function(r){var q=l(r);r.data.plot.eventCanvas._elem.trigger("jqplotMouseUp",[q.gridPos,q.dataPos,null,r.data.plot])};this.onMouseMove=function(r){var q=l(r);var u=r.data.plot;var t=n(u,q.gridPos.x,q.gridPos.y);r.data.plot.eventCanvas._elem.trigger("jqplotMouseMove",[q.gridPos,q.dataPos,t,u])};this.onMouseEnter=function(r){var q=l(r);var t=r.data.plot;r.data.plot.eventCanvas._elem.trigger("jqplotMouseEnter",[q.gridPos,q.dataPos,null,t])};this.onMouseLeave=function(r){var q=l(r);var t=r.data.plot;r.data.plot.eventCanvas._elem.trigger("jqplotMouseLeave",[q.gridPos,q.dataPos,null,t])};this.drawSeries=function(t,q){t.clearRect(0,0,t.canvas.width,t.canvas.height);for(var r=0;r<this.series.length;r++){this.series[r].drawShadow(t,q)}for(var r=0;r<this.series.length;r++){this.series[r].draw(t,q)}}}ColorGenerator=function(l){var k=0;this.next=function(){if(k<l.length){return l[k++]}else{k=0;return l[k++]}};this.previous=function(){if(k>0){return l[k--]}else{k=l.length-1;return l[k]}};this.setColors=function(n){l=n};this.reset=function(){k=0}};e.jqplot.hex2rgb=function(n,k){n=n.replace("#","");if(n.length==3){n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]}var l;l="rgba("+parseInt(n.slice(0,2),16)+", "+parseInt(n.slice(2,4),16)+", "+parseInt(n.slice(4,6),16);if(k){l+=", "+k}l+=")";return l};e.jqplot.rgb2hex=function(q){var n=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var k=q.match(n);var o="#";for(i=1;i<4;i++){var l;if(k[i].search(/%/)!=-1){l=parseInt(255*k[i]/100,10).toString(16);if(l.length==1){l="0"+l}}else{l=parseInt(k[i],10).toString(16);if(l.length==1){l="0"+l}}o+=l}return o};e.jqplot.normalize2rgb=function(l,k){if(l.search(/^ *rgba?\(/)!=-1){return l}else{if(l.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return e.jqplot.hex2rgb(l,k)}else{throw"invalid color spec"}}};e.jqplot.getColorComponents=function(q){var o=e.jqplot.normalize2rgb(q);var n=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var k=o.match(n);var l=[];for(i=1;i<4;i++){if(k[i].search(/%/)!=-1){l[i-1]=parseInt(255*k[i]/100,10)}else{l[i-1]=parseInt(k[i],10)}}l[3]=parseFloat(k[4])?parseFloat(k[4]):1;return l};e.jqplot.log=function(){if(window.console&&e.jqplot.debug){if(arguments.length==1){console.log(arguments[0])}else{console.log(arguments)}}};var c=e.jqplot.log;e.jqplot.AxisLabelRenderer=function(k){e.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this._elem;this.escapeHTML=false;e.extend(true,this,k)};e.jqplot.AxisLabelRenderer.prototype=new e.jqplot.ElemContainer();e.jqplot.AxisLabelRenderer.prototype.constructor=e.jqplot.AxisLabelRenderer;e.jqplot.AxisLabelRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.AxisLabelRenderer.prototype.draw=function(){this._elem=e('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}return this._elem};e.jqplot.AxisLabelRenderer.prototype.pack=function(){};e.jqplot.AxisTickRenderer=function(k){e.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label="";this.value=null;this._styles={};this.formatter=e.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily;this.fontSize;this.textColor;this._elem;e.extend(true,this,k)};e.jqplot.AxisTickRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.AxisTickRenderer.prototype=new e.jqplot.ElemContainer();e.jqplot.AxisTickRenderer.prototype.constructor=e.jqplot.AxisTickRenderer;e.jqplot.AxisTickRenderer.prototype.setTick=function(k,n,l){this.value=k;this.axis=n;if(l){this.isMinorTick=true}return this};e.jqplot.AxisTickRenderer.prototype.draw=function(){if(!this.label){this.label=this.formatter(this.formatString,this.value)}style='style="position:absolute;';if(Number(this.label)){style+="white-space:nowrap;"}style+='"';this._elem=e("<div "+style+' class="jqplot-'+this.axis+'-tick">'+this.label+"</div>");for(var k in this._styles){this._elem.css(k,this._styles[k])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};e.jqplot.DefaultTickFormatter=function(k,l){if(typeof l=="number"){if(!k){k="%.1f"}return e.jqplot.sprintf(k,l)}else{return String(l)}};e.jqplot.AxisTickRenderer.prototype.pack=function(){};e.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new e.jqplot.ShadowRenderer()};e.jqplot.CanvasGridRenderer.prototype.init=function(l){this._ctx;e.extend(true,this,l);var k={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false};this.renderer.shadowRenderer.init(k)};e.jqplot.CanvasGridRenderer.prototype.createElement=function(){var n=document.createElement("canvas");var k=this._plotDimensions.width;var l=this._plotDimensions.height;n.width=k;n.height=l;this._elem=e(n);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});if(e.browser.msie){window.G_vmlCanvasManager.init_(document)}if(e.browser.msie){n=window.G_vmlCanvasManager.initElement(n)}this._top=this._offsets.top;this._bottom=l-this._offsets.bottom;this._left=this._offsets.left;this._right=k-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;return this._elem};e.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var E=this._ctx;var x=this._axes;E.save();E.fillStyle=this.background;E.fillRect(this._left,this._top,this._width,this._height);if(this.drawGridlines){E.save();E.lineJoin="miter";E.lineCap="butt";E.lineWidth=this.gridLineWidth;E.strokeStyle=this.gridLineColor;var z,w;var k=["xaxis","yaxis","x2axis","y2axis"];for(var r=4;r>0;r--){var l=k[r-1];var o=x[l];var A=o._ticks;if(o.show){for(var q=A.length;q>0;q--){var D=A[q-1];if(D.show){var y=Math.round(o.u2p(D.value))+0.5;switch(l){case"xaxis":if(D.showGridline){v(y,this._top,y,this._bottom)}if(D.showMark&&D.mark){s=D.markSize;m=D.mark;var y=Math.round(o.u2p(D.value))+0.5;switch(m){case"outside":z=this._bottom;w=this._bottom+s;break;case"inside":z=this._bottom-s;w=this._bottom;break;case"cross":z=this._bottom-s;w=this._bottom+s;break;default:z=this._bottom;w=this._bottom+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(E,[[y,z],[y,w]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}v(y,z,y,w)}break;case"yaxis":if(D.showGridline){v(this._right,y,this._left,y)}if(D.showMark&&D.mark){s=D.markSize;m=D.mark;var y=Math.round(o.u2p(D.value))+0.5;switch(m){case"outside":z=this._left-s;w=this._left;break;case"inside":z=this._left;w=this._left+s;break;case"cross":z=this._left-s;w=this._left+s;break;default:z=this._left-s;w=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(E,[[z,y],[w,y]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}v(z,y,w,y,{strokeStyle:o.borderColor})}break;case"x2axis":if(D.showGridline){v(y,this._bottom,y,this._top)}if(D.showMark&&D.mark){s=D.markSize;m=D.mark;var y=Math.round(o.u2p(D.value))+0.5;switch(m){case"outside":z=this._top-s;w=this._top;break;case"inside":z=this._top;w=this._top+s;break;case"cross":z=this._top-s;w=this._top+s;break;default:z=this._top-s;w=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(E,[[y,z],[y,w]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}v(y,z,y,w)}break;case"y2axis":if(D.showGridline){v(this._left,y,this._right,y)}if(D.showMark&&D.mark){s=D.markSize;m=D.mark;var y=Math.round(o.u2p(D.value))+0.5;switch(m){case"outside":z=this._right;w=this._right+s;break;case"inside":z=this._right-s;w=this._right;break;case"cross":z=this._right-s;w=this._right+s;break;default:z=this._right;w=this._right+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(E,[[z,y],[w,y]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}v(z,y,w,y,{strokeStyle:o.borderColor})}break;default:break}}}}}k=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];for(var r=7;r>0;r--){var o=x[k[r-1]];var A=o._ticks;if(o.show){var C=A[o.numberTicks-1];var u=A[0];var n=o.getLeft();var B=[[n,C.getTop()+C.getHeight()/2],[n,u.getTop()+u.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(E,B,{lineCap:"butt",fill:false,closePath:false})}v(B[0][0],B[0][1],B[1][0],B[1][1],{lineCap:"butt",strokeStyle:o.borderColor,lineWidth:o.borderWidth});for(var q=A.length;q>0;q--){var D=A[q-1];s=D.markSize;m=D.mark;var y=Math.round(o.u2p(D.value))+0.5;if(D.show&&D.showGridline){switch(m){case"outside":z=n;w=n+s;break;case"inside":z=n-s;w=n;break;case"cross":z=n-s;w=n+s;break;default:z=n;w=n+s;break}B=[[z,y],[w,y]];if(this.shadow){this.renderer.shadowRenderer.draw(E,B,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}v(z,y,w,y,{strokeStyle:o.borderColor})}}}}E.restore()}function v(I,H,F,t,G){E.save();G=G||{};e.extend(true,E,G);E.beginPath();E.moveTo(I,H);E.lineTo(F,t);E.stroke();E.restore()}if(this.shadow){var B=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(E,B)}v(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:x.x2axis.borderColor,lineWidth:x.x2axis.borderWidth});v(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:x.y2axis.borderColor,lineWidth:x.y2axis.borderWidth});v(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:x.xaxis.borderColor,lineWidth:x.xaxis.borderWidth});v(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:x.yaxis.borderColor,lineWidth:x.yaxis.borderWidth});E.restore()};e.jqplot.DivTitleRenderer=function(){};e.jqplot.DivTitleRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.DivTitleRenderer.prototype.draw=function(){var l=this.renderer;if(!this.text){this.show=false;this._elem=e('<div style="height:0px;width:0px;"></div>')}else{if(this.text){var k="position:absolute;top:0px;left:0px;";k+=(this._plotWidth)?"width:"+this._plotWidth+"px;":"";k+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";k+=(this.fontSize)?"font-size:"+this.fontSize+";":"";k+=(this.textAlign)?"text-align:"+this.textAlign+";":"text-align:center;";k+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=e('<div class="jqplot-title" style="'+k+'">'+this.text+"</div>")}}return this._elem};e.jqplot.DivTitleRenderer.prototype.pack=function(){};e.jqplot.LineRenderer=function(){this.shapeRenderer=new e.jqplot.ShapeRenderer();this.shadowRenderer=new e.jqplot.ShadowRenderer()};e.jqplot.LineRenderer.prototype.init=function(l){e.extend(true,this.renderer,l);var o={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shapeRenderer.init(o);if(this.lineWidth>2.5){var n=this.shadowOffset*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{var n=this.shadowOffset*Math.atan((this.lineWidth/2.5))/0.785398163}var k={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,angle:this.shadowAngle,offset:n,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shadowRenderer.init(k)};e.jqplot.LineRenderer.prototype.setGridData=function(){var l=this._xaxis.series_u2p;var q=this._yaxis.series_u2p;var n=this._plotData;var o=this._prevPlotData;this.gridData=[];this._prevGridData=[];for(var k=0;k<this.data.length;k++){if(n[k]!=null){this.gridData.push([l.call(this._xaxis,n[k][0]),q.call(this._yaxis,n[k][1])])}if(o[k]!=null){this._prevGridData.push([l.call(this._xaxis,o[k][0]),q.call(this._yaxis,o[k][1])])}}};e.jqplot.LineRenderer.prototype.makeGridData=function(o){var n=this._xaxis.series_u2p;var q=this._yaxis.series_u2p;var l=[];var r=[];for(var k=0;k<o.length;k++){if(o[k]!=null){l.push([n.call(this._xaxis,o[k][0]),q.call(this._yaxis,o[k][1])])}}return l};e.jqplot.LineRenderer.prototype.draw=function(y,v,z){var q;var l=(z!=b)?z:{};var w=(l.shadow!=b)?l.shadow:this.shadow;var t=(l.showLine!=b)?l.showLine:this.showLine;var x=(l.fill!=b)?l.fill:this.fill;var k=(l.fillAndStroke!=b)?l.fillAndStroke:this.fillAndStroke;y.save();if(v.length){if(t){if(x){if(k){var r=v.slice(0)}if(this.index==0||!this._stack){var u=this._yaxis.series_u2p(this._yaxis.min)-this.gridBorderWidth/2;v.unshift([v[0][0],u]);len=v.length;v.push([v[len-1][0],u])}else{var o=this._prevGridData;for(var q=o.length;q>0;q--){v.push(o[q-1])}}}if(w){this.renderer.shadowRenderer.draw(y,v,l)}this.renderer.shapeRenderer.draw(y,v,l);if(k){var n=e.extend(true,{},l,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(y,r,n);if(this.markerRenderer.show){for(q=0;q<r.length;q++){this.markerRenderer.draw(r[q][0],r[q][1],y,l.markerOptions)}}}}if(this.markerRenderer.show&&!x){for(q=0;q<v.length;q++){this.markerRenderer.draw(v[q][0],v[q][1],y,l.markerOptions)}}}y.restore()};e.jqplot.LineRenderer.prototype.drawShadow=function(k,n,l){};e.jqplot.LinearAxisRenderer=function(){};e.jqplot.LinearAxisRenderer.prototype.init=function(n){e.extend(true,this,n);var k=this._dataBounds;for(var o=0;o<this._series.length;o++){var q=this._series[o];var r=q._plotData;for(var l=0;l<r.length;l++){if(this.name=="xaxis"||this.name=="x2axis"){if(r[l][0]<k.min||k.min==null){k.min=r[l][0]}if(r[l][0]>k.max||k.max==null){k.max=r[l][0]}}else{if(r[l][1]<k.min||k.min==null){k.min=r[l][1]}if(r[l][1]>k.max||k.max==null){k.max=r[l][1]}}}}};e.jqplot.LinearAxisRenderer.prototype.draw=function(k){if(this.show){this.renderer.createTicks.call(this);var u=0;var l;this._elem=e('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var r=this._label.draw(k);r.appendTo(this._elem)}if(this.showTicks){var q=this._ticks;for(var o=0;o<q.length;o++){var n=q[o];if(n.showLabel&&(!n.isMinorTick||this.showMinorTicks)){var r=n.draw(k);r.appendTo(this._elem)}}}}return this._elem};e.jqplot.LinearAxisRenderer.prototype.set=function(){var v=0;var n;var l=0;var u=0;var k=(this._label==null)?false:this._label.show;if(this.show&&this.showTicks){var r=this._ticks;for(var q=0;q<r.length;q++){var o=r[q];if(o.showLabel&&(!o.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){n=o._elem.outerHeight(true)}else{n=o._elem.outerWidth(true)}if(n>v){v=n}}}if(k){l=this._label._elem.outerWidth(true);u=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){v=v+u;this._elem.css({height:v+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){v=v+u;this._elem.css({height:v+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){v=v+l;this._elem.css({width:v+"px",left:"0px",top:"0px"});if(k&&this._label.constructor==e.jqplot.AxisLabelRenderer){this._label._elem.css("width",l+"px")}}else{v=v+l;this._elem.css({width:v+"px",right:"0px",top:"0px"});if(k&&this._label.constructor==e.jqplot.AxisLabelRenderer){this._label._elem.css("width",l+"px")}}}}}};e.jqplot.LinearAxisRenderer.prototype.createTicks=function(){var I=this._ticks;var F=this.ticks;var J=this.name;var H=this._dataBounds;var B,G;var z,C;var n,l;var k,D;if(F.length){for(D=0;D<F.length;D++){var q=F[D];var u=new this.tickRenderer(this.tickOptions);if(q.constructor==Array){u.value=q[0];u.label=q[1];if(!this.showTicks){u.showLabel=false;u.showMark=false}else{if(!this.showTickMarks){u.showMark=false}}u.setTick(q[0],this.name);this._ticks.push(u)}else{u.value=q;if(!this.showTicks){u.showLabel=false;u.showMark=false}else{if(!this.showTickMarks){u.showMark=false}}u.setTick(q,this.name);this._ticks.push(u)}}this.numberTicks=F.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(J=="xaxis"||J=="x2axis"){B=this._plotDimensions.width}else{B=this._plotDimensions.height}if(!this.autoscale&&this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}z=((this.min!=null)?this.min:H.min);C=((this.max!=null)?this.max:H.max);if(z==C){var r=0.05;if(z>0){r=Math.max(Math.log(z)/Math.LN10,0.05)}z-=r;C+=r}var w=C-z;var y,A;var E;if(this.autoscale&&this.min==null&&this.max==null){var v,o,x;if(this.numberTicks==null){if(B>100){this.numberTicks=parseInt(3+(B-100)/75,10)}else{this.numberTicks=2}}if(this.tickInterval==null){o=w/(this.numberTicks-1);if(o<1){E=Math.pow(10,Math.abs(Math.floor(Math.log(o)/Math.LN10)))}else{E=1}this.tickInterval=Math.ceil(o*E*this.pad)/E}v=this.tickInterval*(this.numberTicks-1);x=(v-w)/2;if(this.min==null){this.min=Math.floor(E*(z-x))/E}if(this.max==null){this.max=this.min+v}}else{y=(this.min!=null)?this.min:z-w*(this.padMin-1);A=(this.max!=null)?this.max:C+w*(this.padMax-1);this.min=y;this.max=A;w=this.max-this.min;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(B>100){this.numberTicks=parseInt(3+(B-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=w/(this.numberTicks-1)}}for(var D=0;D<this.numberTicks;D++){k=this.min+D*this.tickInterval;var u=new this.tickRenderer(this.tickOptions);if(!this.showTicks){u.showLabel=false;u.showMark=false}else{if(!this.showTickMarks){u.showMark=false}}u.setTick(k,this.name);this._ticks.push(u)}}};e.jqplot.LinearAxisRenderer.prototype.pack=function(y,q){var B=this._ticks;var z=this.max;var u=this.min;var o=q.max;var F=q.min;var v=(this._label==null)?false:this._label.show;for(var k in y){this._elem.css(k,y[k])}this._offsets=q;var n=o-F;var E=z-u;this.p2u=function(t){return(t-F)*E/n+u};this.u2p=function(t){return(t-u)*n/E+F};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(t){return(t-u)*n/E};this.series_p2u=function(t){return t*E/n+u}}else{this.series_u2p=function(t){return(t-z)*n/E};this.series_p2u=function(t){return t*E/n+z}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(i=0;i<B.length;i++){var D=B[i];if(D.show&&D.showLabel){var r;if(D.constructor==e.jqplot.CanvasAxisTickRenderer&&D.angle){var C=(this.name=="xaxis")?1:-1;switch(D.labelPosition){case"auto":if(C*D.angle<0){r=-D.getWidth()+D._textRenderer.height*Math.sin(-D._textRenderer.angle)/2}else{r=-D._textRenderer.height*Math.sin(D._textRenderer.angle)/2}break;case"end":r=-D.getWidth()+D._textRenderer.height*Math.sin(-D._textRenderer.angle)/2;break;case"start":r=-D._textRenderer.height*Math.sin(D._textRenderer.angle)/2;break;case"middle":r=-D.getWidth()/2+D._textRenderer.height*Math.sin(-D._textRenderer.angle)/2;break;default:r=-D.getWidth()/2+D._textRenderer.height*Math.sin(-D._textRenderer.angle)/2;break}}else{r=-D.getWidth()/2}var l=this.u2p(D.value)+r+"px";D._elem.css("left",l);D.pack()}}if(v){var A=this._label._elem.outerWidth(true);this._label._elem.css("left",F+n/2-A/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(i=0;i<B.length;i++){var D=B[i];if(D.show&&D.showLabel){var r;if(D.constructor==e.jqplot.CanvasAxisTickRenderer&&D.angle){var C=(this.name=="yaxis")?1:-1;switch(D.labelPosition){case"auto":case"end":if(C*D.angle<0){r=-D._textRenderer.height*Math.cos(-D._textRenderer.angle)/2}else{r=-D.getHeight()+D._textRenderer.height*Math.cos(D._textRenderer.angle)/2}break;case"start":if(D.angle>0){r=-D._textRenderer.height*Math.cos(-D._textRenderer.angle)/2}else{r=-D.getHeight()+D._textRenderer.height*Math.cos(D._textRenderer.angle)/2}break;case"middle":r=-D.getHeight()/2;break;default:r=-D.getHeight()/2;break}}else{r=-D.getHeight()/2}var l=this.u2p(D.value)+r+"px";D._elem.css("top",l);D.pack()}}if(v){var x=this._label._elem.outerHeight(true);this._label._elem.css("top",o-n/2-x/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}};e.jqplot.MarkerRenderer=function(k){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new e.jqplot.ShadowRenderer();this.shapeRenderer=new e.jqplot.ShapeRenderer();e.extend(true,this,k)};e.jqplot.MarkerRenderer.prototype.init=function(k){e.extend(true,this,k);var n={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){n.fill=true}if(this.style.indexOf("ircle")!=-1){n.isarc=true;n.closePath=false}this.shadowRenderer.init(n);var l={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){l.fill=true}if(this.style.indexOf("ircle")!=-1){l.isarc=true;l.closePath=false}this.shapeRenderer.init(l)};e.jqplot.MarkerRenderer.prototype.drawDiamond=function(n,l,r,q,u){var k=1.2;var v=this.size/2/k;var t=this.size/2*k;var o=[[n-v,l],[n,l+t],[n+v,l],[n,l-t]];if(this.shadow){this.shadowRenderer.draw(r,o)}this.shapeRenderer.draw(r,o,u);r.restore()};e.jqplot.MarkerRenderer.prototype.drawSquare=function(n,l,r,q,u){var k=1;var v=this.size/2/k;var t=this.size/2*k;var o=[[n-v,l-t],[n-v,l+t],[n+v,l+t],[n+v,l-t]];if(this.shadow){this.shadowRenderer.draw(r,o)}this.shapeRenderer.draw(r,o,u);r.restore()};e.jqplot.MarkerRenderer.prototype.drawCircle=function(l,u,o,t,q){var k=this.size/2;var n=2*Math.PI;var r=[l,u,k,0,n,true];if(this.shadow){this.shadowRenderer.draw(o,r)}this.shapeRenderer.draw(o,r,q);o.restore()};e.jqplot.MarkerRenderer.prototype.draw=function(k,o,l,n){n=n||{};switch(this.style){case"diamond":this.drawDiamond(k,o,l,false,n);break;case"filledDiamond":this.drawDiamond(k,o,l,true,n);break;case"circle":this.drawCircle(k,o,l,false,n);break;case"filledCircle":this.drawCircle(k,o,l,true,n);break;case"square":this.drawSquare(k,o,l,false,n);break;case"filledSquare":this.drawSquare(k,o,l,true,n);break;default:this.drawDiamond(k,o,l,false,n);break}};e.jqplot.ShadowRenderer=function(k){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.isarc=false;e.extend(true,this,k)};e.jqplot.ShadowRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.ShadowRenderer.prototype.draw=function(w,u,x){w.save();var k=(x!=null)?x:{};var v=(k.fill!=null)?k.fill:this.fill;var t=(k.closePath!=null)?k.closePath:this.closePath;var o=(k.offset!=null)?k.offset:this.offset;var l=(k.alpha!=null)?k.alpha:this.alpha;var r=(k.depth!=null)?k.depth:this.depth;w.lineWidth=(k.lineWidth!=null)?k.lineWidth:this.lineWidth;w.lineJoin=(k.lineJoin!=null)?k.lineJoin:this.lineJoin;w.lineCap=(k.lineCap!=null)?k.lineCap:this.lineCap;w.strokeStyle="rgba(0,0,0,"+l+")";w.fillStyle="rgba(0,0,0,"+l+")";for(var n=0;n<r;n++){w.translate(Math.cos(this.angle*Math.PI/180)*o,Math.sin(this.angle*Math.PI/180)*o);w.beginPath();if(this.isarc){w.arc(u[0],u[1],u[2],u[3],u[4],true)}else{w.moveTo(u[0][0],u[0][1]);for(var q=1;q<u.length;q++){w.lineTo(u[q][0],u[q][1])}}if(t){w.closePath()}if(v){w.fill()}else{w.stroke()}}w.restore()};e.jqplot.ShapeRenderer=function(k){this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";e.extend(true,this,k)};e.jqplot.ShapeRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.ShapeRenderer.prototype.draw=function(v,t,x){v.save();var k=(x!=null)?x:{};var u=(k.fill!=null)?k.fill:this.fill;var q=(k.closePath!=null)?k.closePath:this.closePath;var r=(k.fillRect!=null)?k.fillRect:this.fillRect;var n=(k.strokeRect!=null)?k.strokeRect:this.strokeRect;var l=(k.clearRect!=null)?k.clearRect:this.clearRect;var w=(k.isarc!=null)?k.isarc:this.isarc;v.lineWidth=k.lineWidth||this.lineWidth;v.lineJoin=k.lineJoing||this.lineJoin;v.lineCap=k.lineCap||this.lineCap;v.strokeStyle=(k.strokeStyle||k.color)||this.strokeStyle;v.fillStyle=k.fillStyle||this.fillStyle;v.beginPath();if(w){v.arc(t[0],t[1],t[2],t[3],t[4],true);if(q){v.closePath()}if(u){v.fill()}else{v.stroke()}}else{if(r){v.fillRect(t[0],t[1],t[2],t[3])}else{if(n){v.strokeRect(t[0],t[1],t[2],t[3])}else{if(l){v.clearRect(t[0],t[1],t[2],t[3])}else{v.moveTo(t[0][0],t[0][1]);for(var o=1;o<t.length;o++){v.lineTo(t[o][0],t[o][1])}if(q){v.closePath()}if(u){v.fill()}else{v.stroke()}}}}}v.restore()};e.jqplot.TableLegendRenderer.prototype.init=function(k){e.extend(true,this,k)};e.jqplot.TableLegendRenderer.prototype.draw=function(){var t=this;if(this.show){var q=this._series;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=e('<table class="jqplot-legend" style="'+w+'"></table>');var k=false;for(var r=0;r<q.length;r++){s=q[r];if(s.show){var o=s.label.toString();if(o){var l=s.color;if(s._stack&&!s.fill){l=""}v.call(this,o,l,k);k=true}for(var n=0;n<e.jqplot.addLegendRowHooks.length;n++){var u=e.jqplot.addLegendRowHooks[n].call(this,s);if(u){v.call(this,u.label,u.color,k);k=true}}}}}function v(z,y,C){var x=(C)?this.rowSpacing:"0";var B=e('<tr class="jqplot-legend"></tr>').appendTo(this._elem);e('<td class="jqplot-legend" style="vertical-align:middle;text-align:center;padding-top:'+x+';"><div style="border:1px solid #cccccc;padding:0.2em;"><div style="width:1.2em;height:0.7em;background-color:'+y+';"></div></div></td>').appendTo(B);var A=e('<td class="jqplot-legend" style="vertical-align:middle;padding-top:'+x+';"></td>');A.appendTo(B);if(this.escapeHtml){A.text(z)}else{A.html(z)}}return this._elem};e.jqplot.TableLegendRenderer.prototype.pack=function(o){if(this.show){var n={_top:o.top,_left:o.left,_right:o.right,_bottom:this._plotDimensions.height-o.bottom};switch(this.location){case"nw":var l=n._left+this.xoffset;var k=n._top+this.yoffset;this._elem.css("left",l);this._elem.css("top",k);break;case"n":var l=(o.left+(this._plotDimensions.width-o.right))/2-this.getWidth()/2;var k=n._top+this.yoffset;this._elem.css("left",l);this._elem.css("top",k);break;case"ne":var l=o.right+this.xoffset;var k=n._top+this.yoffset;this._elem.css({right:l,top:k});break;case"e":var l=o.right+this.xoffset;var k=(o.top+(this._plotDimensions.height-o.bottom))/2-this.getHeight()/2;this._elem.css({right:l,top:k});break;case"se":var l=o.right+this.xoffset;var k=o.bottom+this.yoffset;this._elem.css({right:l,bottom:k});break;case"s":var l=(o.left+(this._plotDimensions.width-o.right))/2-this.getWidth()/2;var k=o.bottom+this.yoffset;this._elem.css({left:l,bottom:k});break;case"sw":var l=n._left+this.xoffset;var k=o.bottom+this.yoffset;this._elem.css({left:l,bottom:k});break;case"w":var l=n._left+this.xoffset;var k=(o.top+(this._plotDimensions.height-o.bottom))/2-this.getHeight()/2;this._elem.css({left:l,top:k});break;default:var l=n._right-this.xoffset;var k=n._bottom+this.yoffset;this._elem.css({right:l,bottom:k});break}}};e.jqplot.sprintf=function(){function r(y,u,v,x){var w=(y.length>=u)?"":Array(1+u-y.length>>>0).join(v);return x?y+w:w+y}function n(x,w,z,u,v){var y=u-x.length;if(y>0){if(z||!v){x=r(x,u," ",z)}else{x=x.slice(0,w.length)+r("",y,"0",true)+x.slice(w.length)}}return x}function t(A,z,y,B,v,u,x){var w=A>>>0;y=y&&w&&{"2":"0b","8":"0","16":"0x"}[z]||"";A=y+r(w.toString(z),u||0,"0",false);return n(A,y,B,v,x)}function k(x,y,v,u,w){if(u!=null){x=x.slice(0,u)}return n(x,"",y,v,w)}var l=arguments,o=0,q=l[o++];return q.replace(e.jqplot.sprintf.regex,function(M,z,A,D,O,K,y){if(M=="%%"){return"%"}var E=false,B="",C=false,L=false;for(var J=0;A&&J<A.length;J++){switch(A.charAt(J)){case" ":B=" ";break;case"+":B="+";break;case"-":E=true;break;case"0":C=true;break;case"#":L=true;break}}if(!D){D=0}else{if(D=="*"){D=+l[o++]}else{if(D.charAt(0)=="*"){D=+l[D.slice(1,-1)]}else{D=+D}}}if(D<0){D=-D;E=true}if(!isFinite(D)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!K){K="fFeE".indexOf(y)>-1?6:(y=="d")?0:void (0)}else{if(K=="*"){K=+l[o++]}else{if(K.charAt(0)=="*"){K=+l[K.slice(1,-1)]}else{K=+K}}}var G=z?l[z.slice(0,-1)]:l[o++];switch(y){case"s":return k(String(G),E,D,K,C);case"c":return k(String.fromCharCode(+G),E,D,K,C);case"b":return t(G,2,L,E,D,K,C);case"o":return t(G,8,L,E,D,K,C);case"x":return t(G,16,L,E,D,K,C);case"X":return t(G,16,L,E,D,K,C).toUpperCase();case"u":return t(G,10,L,E,D,K,C);case"i":case"d":var w=parseInt(+G);var I=w<0?"-":B;G=I+r(String(Math.abs(w)),K,"0",false);return n(G,I,E,D,C);case"e":case"E":case"f":case"F":case"g":case"G":var w=+G;var I=w<0?"-":B;var x=["toExponential","toFixed","toPrecision"]["efg".indexOf(y.toLowerCase())];var N=["toString","toUpperCase"]["eEfFgG".indexOf(y)%2];G=I+Math.abs(w)[x](K);return n(G,I,E,D,C)[N]();case"p":case"P":var w=+G;var I=w<0?"-":B;var F=String(Number(Math.abs(w)).toExponential()).split(/e|E/);var v=(F[0].indexOf(".")!=-1)?F[0].length-1:F[0].length;var H=(F[1]<0)?-F[1]-1:0;if(Math.abs(w)<1){if(v+H<=K){G=I+Math.abs(w).toPrecision(v)}else{if(v<=K-1){G=I+Math.abs(w).toExponential(v-1)}else{G=I+Math.abs(w).toExponential(K-1)}}}else{var u=(v<=K)?v:K;G=I+Math.abs(w).toPrecision(u)}var N=["toString","toUpperCase"]["pP".indexOf(y)%2];return n(G,I,E,D,C)[N]();default:return M}})};e.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegpEGP])/g})(jQuery);

/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/jquery.jqplot.min.js --------- */



/* --------- START jqplot.pieRenderer.js --------- */

/**
 * Copyright (c) 2009 Chris Leonello
 * This software is licensed under the GPL version 2.0 and MIT licenses.
 */
(function($) {
    /**
     * Class: $.jqplot.PieRenderer
     * Plugin renderer to draw a pie chart.
     * Pie charts will draw only the first series.  Other series are ignored.
     * x values, if present, will be used as slice labels.
     * y values give slice size.
     */
    $.jqplot.PieRenderer = function(){
        $.jqplot.LineRenderer.call(this);
    };
    
    $.jqplot.PieRenderer.prototype = new $.jqplot.LineRenderer();
    $.jqplot.PieRenderer.prototype.constructor = $.jqplot.PieRenderer;
    
    // called with scope of a series
    $.jqplot.PieRenderer.prototype.init = function(options) {
	    // Group: Properties
	    //
	    // prop: diameter
	    // diameter of the pie, auto computed by default
        this.diameter = null;
        // prop: padding
        // padding between the pie and plot edges, legend, etc.
        this.padding = 20;
        // prop: sliceMargin
        // pixels spacing between pie slices.
        this.sliceMargin = 0;
        // prop: fill
        // true or false, wether to fil the slices.
        this.fill = true;
        // prop: shadowOffset
        // offset of the shadow from the slice and offset of 
        // each succesive stroke of the shadow from the last.
        this.shadowOffset = 2;
        // prop: shadowAlpha
        // transparency of the shadow (0 = transparent, 1 = opaque)
        this.shadowAlpha = 0.07;
        // prop: shadowDepth
        // number of strokes to apply to the shadow, 
        // each stroke offset shadowOffset from the last.
        this.shadowDepth = 5;
        this.tickRenderer = $.jqplot.PieTickRenderer;
        $.extend(true, this, options);
        if (this.diameter != null) {
            this.diameter = this.diameter - this.sliceMargin;
        }
    };
    
    $.jqplot.PieRenderer.prototype.setGridData = function() {
        // this is a no-op
    };
    
    $.jqplot.PieRenderer.prototype.makeGridData = function(data) {
        var stack = [];
        var td = [];
        for (var i=0; i<data.length; i++){
            stack.push(data[i][1]);
            td.push([data[i][0]]);
            if (i>0) {
                stack[i] += stack[i-1];
            }
        }
        var fact = Math.PI*2/stack[stack.length - 1];
        
        for (var i=0; i<stack.length; i++) {
            td[i][1] = stack[i] * fact;
        }
        return td;
    };
    
    $.jqplot.PieRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
        var r = this.diameter / 2;
        var fill = this.fill;
        var lineWidth = this.lineWidth;
        ctx.save();

        ctx.translate(this.sliceMargin*Math.cos((ang1+ang2)/2), this.sliceMargin*Math.sin((ang1+ang2)/2));
        if (isShadow) {
            for (var i=0; i<this.shadowDepth; i++) {
                ctx.save();
                ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
                doDraw();
            }
        }
        
        else {
            doDraw();
        }
        
        function doDraw () {
            ctx.beginPath();  
            ctx.moveTo(0, 0);
            ctx.fillStyle = color;
            ctx.strokeStyle = color;
            ctx.lineWidth = lineWidth;
            ctx.arc(0, 0, r, ang1, ang2, false);
            ctx.closePath();
            if (fill) {
                ctx.fill();
            }
            else {
                ctx.stroke();
            }
        }
        
        if (isShadow) {
            for (var i=0; i<this.shadowDepth; i++) {
                ctx.restore();
            }
        }
        
        ctx.restore();        
    };
    
    // called with scope of series
    $.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options) {
        var i;
        var opts = (options != undefined) ? options : {};
        // offset and direction of offset due to legend placement
        var offx = 0;
        var offy = 0;
        var trans = 1;
        var colorGenerator = new this.colorGenerator(this.seriesColors);
        if (options.legendInfo) {
            var li = options.legendInfo;
            switch (li.location) {
                case 'nw':
                    offx = li.width + li.xoffset;
                    break;
                case 'w':
                    offx = li.width + li.xoffset;
                    break;
                case 'sw':
                    offx = li.width + li.xoffset;
                    break;
                case 'ne':
                    offx = li.width + li.xoffset;
                    trans = -1;
                    break;
                case 'e':
                    offx = li.width + li.xoffset;
                    trans = -1;
                    break;
                case 'se':
                    offx = li.width + li.xoffset;
                    trans = -1;
                    break;
                case 'n':
                    offy = li.height + li.yoffset;
                    break;
                case 's':
                    offy = li.height + li.yoffset;
                    trans = -1;
                    break;
                default:
                    break;
            }
        }
        
        var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
        var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
        var fill = (opts.fill != undefined) ? opts.fill : this.fill;
        var cw = ctx.canvas.width;
        var ch = ctx.canvas.height;
        var w = cw - offx - 2 * this.padding;
        var h = ch - offy - 2 * this.padding;
        var d = Math.min(w,h);
        this.diameter = this.diameter  || d - this.sliceMargin;
        // this.diameter -= this.sliceMargin;
        var r = this.diameter/2;
        ctx.save();
    
        ctx.translate((cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy);
        
        if (this.shadow) {
            var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
            for (var i=0; i<gd.length; i++) {
                var ang1 = (i == 0) ? 0 : gd[i-1][1];
                this.renderer.drawSlice.call (this, ctx, ang1, gd[i][1], shadowColor, true);
            }
            
        }
        for (var i=0; i<gd.length; i++) {
            var ang1 = (i == 0) ? 0 : gd[i-1][1];
            this.renderer.drawSlice.call (this, ctx, ang1, gd[i][1], colorGenerator.next());
        }
        // shadows
        // markers
        
        ctx.restore();        
    };
    
    $.jqplot.PieAxisRenderer = function() {
        $.jqplot.LinearAxisRenderer.call(this);
    };
    
    $.jqplot.PieAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
    $.jqplot.PieAxisRenderer.prototype.constructor = $.jqplot.PieAxisRenderer;
        
    
    // There are no traditional axes on a pie chart.  We just need to provide
    // dummy objects with properties so the plot will render.
    // called with scope of axis object.
    $.jqplot.PieAxisRenderer.prototype.init = function(options){
        //
        this.tickRenderer = $.jqplot.PieTickRenderer;
        $.extend(true, this, options);
        // I don't think I'm going to need _dataBounds here.
        // have to go Axis scaling in a way to fit chart onto plot area
        // and provide u2p and p2u functionality for mouse cursor, etc.
        // for convienence set _dataBounds to 0 and 100 and
        // set min/max to 0 and 100.
        this._dataBounds = {min:0, max:100};
        this.min = 0;
        this.max = 100;
        this.showTicks = false;
        this.ticks = [];
        this.showMark = false;
        this.show = false; 
    };
    
    
    $.jqplot.PieTickRenderer = function() {
        $.jqplot.AxisTickRenderer.call(this);
    };
    
    $.jqplot.PieTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
    $.jqplot.PieTickRenderer.prototype.constructor = $.jqplot.PieTickRenderer;
    
    $.jqplot.PieLegendRenderer = function() {
        $.jqplot.TableLegendRenderer.call(this);
    };
    
    $.jqplot.PieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
    $.jqplot.PieLegendRenderer.prototype.constructor = $.jqplot.PieLegendRenderer;
    
    // called with context of legend
    $.jqplot.PieLegendRenderer.prototype.draw = function() {
        var legend = this;
        if (this.show) {
            var series = this._series;
            // make a table.  one line label per row.
            var ss = 'position:absolute;';
            ss += (this.background) ? 'background:'+this.background+';' : '';
            ss += (this.border) ? 'border:'+this.border+';' : '';
            ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
            ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
            ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
            this._elem = $('<table class="jqplot-legend" style="'+ss+'"></table>');
        
            var pad = false;
            var s = series[0];
            var colorGenerator = new s.colorGenerator(s.seriesColors);
            if (s.show) {
                var pd = s.data;
                for (var i=0; i<pd.length; i++){
                    var lt = pd[i][0].toString();
                    if (lt) {
                        addrow.call(this, lt, colorGenerator.next(), pad);
                        pad = true;
                    }  
                }
            }
        }
        
        function addrow(label, color, pad) {
            var rs = (pad) ? this.rowSpacing : '0';
            var tr = $('<tr class="jqplot-legend"></tr>').appendTo(this._elem);
            $('<td class="jqplot-legend" style="vertical-align:middle;text-align:center;padding-top:'+rs+';">'+
                '<div style="border:1px solid #cccccc;padding:0.2em;">'+
                '<div style="width:1.2em;height:0.7em;background-color:'+color+';"></div>'+
                '</div></td>').appendTo(tr);
            var elem = $('<td class="jqplot-legend" style="vertical-align:middle;padding-top:'+rs+';"></td>');
            elem.appendTo(tr);
            if (this.escapeHtml) {
                elem.text(label);
            }
            else {
                elem.html(label);
            }
        }
        return this._elem;
    };
    
    // setup default renderers for axes and legend so user doesn't have to
    // called with scope of plot
    function preInit(target, data, options) {
        options = options || {};
        options.axesDefaults = options.axesDefaults || {};
        options.legend = options.legend || {};
        options.seriesDefaults = options.seriesDefaults || {};
        // only set these if there is a pie series
        var setopts = false;
        if (options.seriesDefaults.renderer == $.jqplot.PieRenderer) {
            setopts = true;
        }
        else if (options.series) {
            for (var i=0; i < options.series.length; i++) {
                if (options.series[i].renderer == $.jqplot.PieRenderer) {
                    setopts = true;
                }
            }
        }
        
        if (setopts) {
            options.axesDefaults.renderer = $.jqplot.PieAxisRenderer;
            options.legend.renderer = $.jqplot.PieLegendRenderer;
            options.legend.preDraw = true;
            // options.seriesDefaults.colorGenerator = this.colorGenerator;
            // options.seriesDefaults.seriesColors = this.seriesColors;
        }
    }
    
    // called with scope of plot
    function postParseOptions(options) {
        for (var i=0; i<this.series.length; i++) {
            this.series[i].seriesColors = this.seriesColors;
            this.series[i].colorGenerator = this.colorGenerator;
        }
    }
    
    $.jqplot.preInitHooks.push(preInit);
    $.jqplot.postParseOptionsHooks.push(postParseOptions);
    
    $.jqplot.PieTickRenderer = function() {
        $.jqplot.AxisTickRenderer.call(this);
    };
    
    $.jqplot.PieTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
    $.jqplot.PieTickRenderer.prototype.constructor = $.jqplot.PieTickRenderer;
    
})(jQuery);
    
    

/* --------- END /usr/local/tomcat5/webapps/CleverTV/clients/uefa/js/jqplot.pieRenderer.js --------- */

