sb_tourn = new Object;
   sb_tourn.build_count=2329688;
   sb_tourn.scores_avail="N";
   sb_tourn.full_name="UNIQA Ladies Golf Open presented by Raiffeisen";
   sb_tourn.short_name="UNIQA Ladies Golf Open";
   sb_tourn.code="TM51";
   sb_tourn.scores_type="G";
   sb_tourn.course_dates="Fohrenwald-Wiener Neustadt<BR>3rd - 5th September 2010";
   sb_tourn.round_head="";
   sb_tourn.rounds_played=0;
   sb_tourn.full_scoreboard_url="";
   sb_tourn.tic_url="http://www.ladieseuropeantour.info/tic/tmtic.cgi?season=2010";
   sb_tourn.tour_name="Ladies European Tour";
   sb_tourn.tour_website="http://www.ladieseuropeantour.com";
   sb_tourn.tour_logo="http://www.ladieseuropeantour.info/misc/tourlogo_ssf.gif";
   sb_tourn.logo_pos="L";
   sb_tourn.event_sponsor_name="";
   sb_tourn.event_sponsor_website="";
   sb_tourn.sponsor_indicator_logo="";
   sb_tourn.represents_heading="Represents";
   sb_tourn.software_provider_name="Tour Management Software from OCS Sport";
   sb_tourn.software_provider_website="http://www.ocs-sport.com";
   sb_tourn.webmaster_email="mail@ladieseuropeantour.com";
   sb_tourn.live_scoring="N";
   sb_tourn.group_ties=true;
   sb_tourn.scroll_height=100;
   sb_tourn.max_width=false;
   sb_tourn.autosize=false;
   sb_tourn.name_wrap=true;
   sb_tourn.matchplay_format="N";
   sb_tourn.matchplay_team_format="N";
   sb_tourn.std_columns=1;
   sb_tourn.array_delimiter="/~";
   sb_tourn.cgi_base="http://www.ladieseuropeantour.info/tic/";
   sb_tourn.data_entries=0;
   sb_tourn.error_found=false;
   sb_tourn.referring_page="";
   sb_tourn.referring_match="http://www.dblso.de";
   sb_tourn.licencee_ref="LET1205111";
   sb_tourn.licencee="xx";
   sb_tourn.licence_error=false;
   sb_tourn.report_options=new Array;
       sb_tourn.report_options[0]="Tournament Entries/~http://www.ladieseuropeantour.info/tic/tmentry.cgi?tourn=TM51~season=2010~alphaorder~exemptorder~/~";
       sb_tourn.report_options[1]="Round 1 Draw/~http://www.ladieseuropeantour.info/tic/tmdraw.cgi?tourn=TM51~season=2010~round=1~/~";
       sb_tourn.report_options[2]="Round 2 Draw/~http://www.ladieseuropeantour.info/tic/tmdraw.cgi?tourn=TM51~season=2010~round=2~/~";
   sb_tourn.report_options_default=1;
   sb_tourn.css_table="color:black;background-color:#9BB629;";
   sb_tourn.css_head="font-family:verdana,tahoma,arial,sans-serif;font-size:10pt;color:#403777;";
   sb_tourn.css_main="font-family:verdana,tahoma,arial,sans-serif;font-size:10pt;color:black;background-color:#9BB629;";
   sb_tourn.css_title="font-family:verdana,tahoma,arial,sans-serif;font-size:12pt;color:white;background-color:#758C17;margin:4px;";
   sb_tourn.css_line="font-family:verdana,tahoma,arial,sans-serif;font-size:8pt;padding-left:1px;padding-right:1px;";
   sb_tourn.css_linea="font-family:verdana,tahoma,arial,sans-serif;color:black;background-color:white;";
   sb_tourn.css_lineb="font-family:verdana,tahoma,arial,sans-serif;color:black;background-color:#F5F9E1;";
   sb_tourn.css_select="font-family:verdana,tahoma,arial,sans-serif;font-size:8pt;color:black;background-color:#F5F9E1;";

sb_data = new Array (
   "EOD/~");
   --sb_data.length;
   sb_tourn.data_entries=sb_data.length;

function sb_get_data_object(index)
{
   var tm_eo = new Object;
   var tm_ta = sb_data[index].split('/~');
   return(tm_eo);
}
   sb_tourn.incl_score=false;
   sb_tourn.incl_vspar=false;
   sb_tourn.incl_holes=false;
   sb_tourn.std_columns=2;
var sb_ticlinestyle="";
var sb_ticsubwin="";
var sb_cellspacing=false;

// Scoreboard Table Generation

function sb_open_tic_window()
{
  if ((typeof sb_ticsubwin != "object") || (sb_ticsubwin.closed))
      sb_ticsubwin = window.open("", "TICLINKWIN",
                 "location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=400,", true)
  else
      sb_ticsubwin.focus();
}

function sb_call_sb_report()
{
  var selopt = document.getElementById("sb_options").selectedIndex;
  var option_data = sb_tourn.report_options[selopt].split(sb_tourn.array_delimiter);
  var cgiurl = option_data[1];
  sb_open_tic_window();
  sb_ticsubwin.location = cgiurl;
}

function sb_tour_website()
{
  sb_open_tic_window();
  sb_ticsubwin.location = sb_tourn.tour_website;
}

function sb_tour_tic()
{
  sb_open_tic_window();
  sb_ticsubwin.location = sb_tourn.tic_url;
}

function sb_full_scoreboard()
{
  sb_open_tic_window();
  sb_ticsubwin.location = sb_tourn.full_scoreboard_url;
}

function sb_get_sb_position_strokeplay(index)
{
  var p = sb_get_data_object(index);
  var nbsp = ((sb_cellspacing) ? "" : "&nbsp;");
  if (sb_tourn.group_ties)
  {
     var newpos = false;
     if (p.pos != sb_lastpos)
     {
        newpos = true;
        var tiecount = 0;
        var i=index;
        var p2 = p;
        while ((i<sb_tourn.data_entries) && (p2.pos == p.pos))
        {
           ++tiecount; ++i;
           if (i<sb_tourn.data_entries)
              var p2 = sb_get_data_object(i);
        }
        sb_lastpos = p.pos;
     }
  }
  else
  {
     var newpos = true;
     var tiecount = 1;
  }
  if (p.pos == "CUT")
     return("");
  if (newpos)
     sb_ticlinestyle = ((sb_ticlinestyle=="a")?"b":"a");
  var nwrap = ((sb_tourn.name_wrap) ? "" : " nowrap");
  var sline = "";
  sline += "<TR style='" + sb_tourn["css_line" + sb_ticlinestyle] + "'>";
  if (newpos)
  {
     sline += "<TD style='" + sb_tourn["css_line"] + "text-align:left;' rowspan=" + tiecount + " nowrap>" + p.pos + p.tied + nbsp + "</TD>";
     if (sb_tourn.scores_type == "P")
         p.score += "<SMALL>pts</SMALL>";
     if (sb_tourn.incl_score)
         sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;' rowspan=" + tiecount + " nowrap>" + ((p.score == "") ? "&nbsp;" : p.score) + "</TD>";
     if (sb_tourn.scores_type == "P")
         p.vspar = "";
     if (sb_tourn.incl_vspar)
         sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;' rowspan=" + tiecount + " nowrap>" + ((p.vspar == "") ? "&nbsp;" : p.vspar) + "</TD>";
  }
  if (p.sponsored == "N")
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:left;" + ((sb_tourn.max_width) ? "width:90%;" : "") + "'" + nwrap + ">" + nbsp + p.name + "</TD>";
  if (p.sponsored == "Y")
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:left;" + ((sb_tourn.max_width) ? "width:90%;" : "") + "'" + nwrap + ">" + nbsp + p.name + "&nbsp;<IMG src='" + sb_tourn.sponsor_indicator_logo + "' border='0'></TD>";
  if ((p.holes  == "") || (p.holes == "0"))  p.holes  = "&nbsp;";
  if  (p.holes  == "18")                     p.holes  = "F";
  if (sb_tourn.incl_holes)
     sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;' nowrap>" + p.holes + "</TD>";
  sline += "</TR>";
  return(sline);
}

function sb_get_sb_position_matchplay(index)
{
  var p = sb_get_data_object(index);
  var noscores = ((p.holes == "0") && (p.status_1 != "W") && (p.status_2 != "W"));
  sb_ticlinestyle = ((sb_ticlinestyle=="a")?"b":"a");
  var nwrap = ((sb_tourn.name_wrap) ? "" : " nowrap");
  var sline = "";
  sline += "<TR style='" + sb_tourn["css_line" + sb_ticlinestyle] + "'>";
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;' rowspan=2 nowrap>&nbsp;" + p.match + "&nbsp;</TD>";
  if (p.status_1 == "L")  p.full_score_1 = "&nbsp;";
  if (p.status_1 == "D")  p.full_score_1 = "&nbsp;";
  if (noscores)
      p.full_score_1 = "[" + p.time + "]";
  if (p.status_1 == "H")
      noscores = true;
  var fweight = ((p.status_1 == "W") ? "font-weight:bold;" : "font-weight:normal;");
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;" + fweight + "'" + ((noscores) ? " rowspan=2" : "") + " nowrap>" + p.full_score_1 + "</TD>";
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:left;"   + fweight + "'" + nwrap + ">" + p.name_1   + "</TD>";
  if ((p.status_1 == "W") || (p.status_2 == "W"))
      p.holes = "F";
  if (p.holes == "0")
      p.holes = "";
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;' rowspan=2 nowrap>&nbsp;" + p.holes + "&nbsp;</TD>";
  sline += "</TR>";
  sline += "<TR style='" + sb_tourn["css_line" + sb_ticlinestyle] + "'>";
  if (p.status_2 == "L")  p.full_score_2 = "&nbsp;";
  if (p.status_2 == "D")  p.full_score_2 = "&nbsp;";
  var fweight = ((p.status_2 == "W") ? "font-weight:bold;" : "font-weight:normal;");
  if (!noscores)
      sline += "<TD style='" + sb_tourn["css_line"] + "text-align:center;" + fweight + "' nowrap>" + p.full_score_2 + "</TD>";
  sline += "<TD style='" + sb_tourn["css_line"] + "text-align:left;"   + fweight + "'" + nwrap + ">" + p.name_2   + "</TD>";
  sline += "</TR>";
  return(sline);
}

function sb_add_logo()
{
  var dhtml = "";
  if (sb_tourn.tour_logo == "")
       return(dhtml);
  dhtml += "<TD style='text-align:center;margin:auto;vertical-align:middle;'>" +
           "<IMG src='" + sb_tourn.tour_logo + "' style='cursor:pointer;text-align:center;' border=0 " +
           "title='" + sb_tourn.tour_name + " web site' " +
           "onclick='sb_tour_website();'>" +
           "</TD>";
  return(dhtml);
}

function sb_get_scoreboard()
{
  sb_ticlinestyle = "";
  sb_lastpos = "";
  sb_cellspacing=sb_tourn.group_ties;
  var cspan = sb_tourn.std_columns;
  var dhtml = "";
  if (sb_tourn.autosize)
     dhtml += "<DIV style='width:100px;'>" +
              "<TABLE border=0 cellspacing=" + ((sb_cellspacing) ? "1" : "0") + " cellpadding=0 style='" + sb_tourn["css_table"] + "'>" +
              "<TR><TD colspan=" + cspan + ">"
  else
     dhtml += "<DIV style='" + sb_tourn["css_table"] + "margin:auto;text-align:center;'>";
  dhtml += "<TABLE border=0 cellspacing=0 cellpadding=0 style='margin:auto;" + ((sb_tourn.autosize) ? "width:100%;" : "") + "'>" +
           "<TR>";
  if (sb_tourn.logo_pos == "T")
     dhtml += sb_add_logo() + "</TR><TR>"
  else
  if (sb_tourn.logo_pos == "L")
     dhtml += sb_add_logo();
  dhtml += "<TD style='text-align:center;margin:auto;'>";
  dhtml += "<DIV style='" + sb_tourn["css_title"] + "text-align:center;font-weight:bold;padding:1px;'>" +
           sb_tourn.short_name + "</DIV>";
  var cds = sb_tourn.course_dates.split("<BR>");
  var cdj = ((cds.length == 2) ? "<NOBR>" + cds[0] + "</NOBR> <NOBR>" + cds[1] + "</NOBR>" : cds[0]);
  if (sb_tourn.autosize)
     cdj = "<NOBR>" + sb_tourn.course_dates + "</NOBR>";
  dhtml += "<DIV style='" + sb_tourn["css_head"] + "text-align:center;padding:1px;'>" + cdj + "</DIV>";
  dhtml += "</TD>";
  if (sb_tourn.logo_pos == "R")
     dhtml += sb_add_logo();
  dhtml += "</TR></TABLE>";
  dhtml += "<DIV style='" + sb_tourn["css_main"] + "text-align:center;font-weight:bold;padding:1px;clear:both;'>" +
           sb_tourn.round_head + "</DIV>";
  dhtml += "<DIV style='" + sb_tourn["css_main"] + ((sb_tourn.scroll_height != 0) ? "height:" + sb_tourn.scroll_height + "px;overflow:auto;" : "") + "'>";
  if (sb_tourn.autosize)
      dhtml += "</DIV></TD></TR>"
  else
      dhtml += "<TABLE border=0 cellspacing=" + ((sb_cellspacing) ? "1" : "0") + " cellpadding=1 style='margin:auto;text-align:center;'>";
  if (sb_tourn.data_entries != 0)
  {
      for (var i=0; i<sb_tourn.data_entries; i++)
      {
         if (sb_tourn.scores_type == "M")
             dhtml += sb_get_sb_position_matchplay(i)
         else
             dhtml += sb_get_sb_position_strokeplay(i);
      }
  }
  if (sb_tourn.licence_error)
     dhtml += "<TR><TD style='" + sb_tourn["css_head"] + "text-align:center;' colspan=" + cspan + " nowrap>" +
              "<DIV style='font-size:120%;font-weight:bold;margin:5px;padding-top:20px;padding-bottom:20px;'>" +
              "UNLICENSED<BR>SERVICE" +
              "</DIV></TD></TR>"
  else
  if (sb_tourn.data_entries == 0)
     dhtml += "<TR><TD style='" + sb_tourn["css_head"] + "text-align:center;' colspan=" + cspan + " nowrap>" +
              "<DIV style='margin:5px;padding-top:20px;padding-bottom:20px;'>" +
              "No Scoreboard<BR>Currently<BR>Available" +
              "</DIV></TD></TR>";
  if (sb_tourn.autosize)
      dhtml += "<TR><TD colspan=" + cspan + ">"
  else
      dhtml += "</TABLE></DIV>";
  dhtml += "<DIV style='" + sb_tourn["css_main"] + "text-align:center;font-weight:normal;padding:2px;'>";
  if (typeof sb_tourn.report_options != "undefined")
  {
     dhtml += "<DIV style='text-align:center;'><NOBR>" +
              "<SELECT id=sb_options style='" + sb_tourn["css_select"] + "'>";
     for (var i=0; i<sb_tourn.report_options.length; i++)
     {
         var option_data = sb_tourn.report_options[i].split(sb_tourn.array_delimiter);
         dhtml += "<OPTION" + ((i == sb_tourn.report_options_default) ? " selected" : "") + ">";
         dhtml += option_data[0] + "</OPTION>";
     }
     dhtml += "</SELECT>";
     dhtml += "&nbsp;&nbsp;" +
              "<BUTTON style='" + sb_tourn["css_select"] + "' onclick='sb_call_sb_report();' " +
              "title='Open selected report in a new window'>Go&#187;</BUTTON>";
     dhtml += "</NOBR></DIV>";
     dhtml += "<DIV style='font-size:80%; padding:2px; text-align:center;'>" +
              "<A href='javascript:sb_tour_tic();' " +
              "style='" + sb_tourn["css_main"] + "text-decoration:none;padding:1px;' " +
              "title='The information centre provides a full service of tournament scores " +
              "and statistics, orders of merit and player records'>Information&nbsp;Centre&#187;</A>" +
              "</DIV>";
  }
  else
  {
     if (sb_tourn.full_scoreboard_url != "")
         dhtml += "<DIV><A href='javascript:sb_full_scoreboard();' " +
                  "style='" + sb_tourn["css_main"] + "text-decoration:none;padding:1px;' " +
                  "title='" + ((sb_tourn.live_scoring == "Y") ? "Open the live scoring monitor" : "View the full detailed scoreboard") + "'>" +
                  ((sb_tourn.live_scoring == "Y") ? "Live&nbsp;Scoring" : "Full&nbsp;Scoreboard") + "&#187;</A></DIV>";
     if (sb_tourn.logo_pos != "")
         dhtml += "<DIV><A href='javascript:sb_tour_tic();' " +
                  "style='" + sb_tourn["css_main"] + "text-decoration:none;padding:1px;' " +
                  "title='Visit the " + sb_tourn.tour_name + " Information Centre for a full service of scores and statistics'>" +
                  "Information&nbsp;Centre&#187;</A></DIV>";
  }
  dhtml += "</DIV>";
  if (sb_tourn.autosize)
     dhtml += "</TD></TR></TABLE>"
  dhtml += "</DIV>";
  return(dhtml);
}
