sc_tourn = new Object;
   sc_tourn.build_count=138559;
   sc_tourn.scores_avail="Y";
   sc_tourn.full_name="English Girls Under 13 Amateur Championship 2010";
   sc_tourn.short_name="English Girls U13 Amateur";
   sc_tourn.code="EGU3";
   sc_tourn.scores_type="G";
   sc_tourn.course_dates="Market Rasen & District GC<BR>27th - 29th July 2010";
   sc_tourn.round_head="Final Scoreboard";
   sc_tourn.rounds_played=3;
   sc_tourn.full_scoreboard_url="http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~params=PG0SSC999~season=2010";
   sc_tourn.tic_url="http://info.englishladiesgolf.org/tic/tmtic.cgi?season=2010";
   sc_tourn.tour_name="ENGLISH WOMEN'S GOLF ASSOCIATION";
   sc_tourn.tour_website="http://www.englishwomensgolf.org";
   sc_tourn.tour_logo="";
   sc_tourn.logo_pos="";
   sc_tourn.event_sponsor_name="";
   sc_tourn.event_sponsor_website="";
   sc_tourn.sponsor_indicator_logo="";
   sc_tourn.represents_heading="Represents";
   sc_tourn.software_provider_name="Tour Management Software from OCS Sport";
   sc_tourn.software_provider_website="http://www.ocs-sport.com";
   sc_tourn.webmaster_email="elgaadmin@ocs-sport.com";
   sc_tourn.live_scoring="N";
   sc_tourn.group_ties=false;
   sc_tourn.scroll_height=132;
   sc_tourn.max_width=true;
   sc_tourn.autosize=false;
   sc_tourn.name_wrap=false;
   sc_tourn.matchplay_format="N";
   sc_tourn.matchplay_team_format="N";
   sc_tourn.std_columns=1;
   sc_tourn.array_delimiter="/~";
   sc_tourn.cgi_base="http://info.englishladiesgolf.org/tic/";
   sc_tourn.data_entries=0;
   sc_tourn.error_found=false;
   sc_tourn.referring_page="";
   sc_tourn.referring_match="http://www.englishladiesgolf.org";
   sc_tourn.licencee_ref="ELG0040307";
   sc_tourn.licencee="English Ladies Golf Association";
   sc_tourn.licence_error=false;
   sc_tourn.report_options=new Array;
       sc_tourn.report_options[0]="Tournament Entries/~http://info.englishladiesgolf.org/tic/tmentry.cgi?tourn=EGU3~season=2010~alphaorder~exemptorder~/~";
       sc_tourn.report_options[1]="Round 1 Draw/~http://info.englishladiesgolf.org/tic/tmdraw.cgi?tourn=EGU3~season=2010~round=1~/~";
       sc_tourn.report_options[2]="Round 1 Scores Only/~http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~season=2010~params=P*1SRC~/~";
       sc_tourn.report_options[3]="Round 2 Draw/~http://info.englishladiesgolf.org/tic/tmdraw.cgi?tourn=EGU3~season=2010~round=2~/~";
       sc_tourn.report_options[4]="Round 2 Scores Only/~http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~season=2010~params=P*2SRC~/~";
       sc_tourn.report_options[5]="Round 2 Scoreboard/~http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~season=2010~params=P*2ESC~/~";
       sc_tourn.report_options[6]="Round 3 Draw/~http://info.englishladiesgolf.org/tic/tmdraw.cgi?tourn=EGU3~season=2010~round=3~/~";
       sc_tourn.report_options[7]="Round 3 Scores Only/~http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~season=2010~params=P*3SRC~/~";
       sc_tourn.report_options[8]="Round 3 Scoreboard/~http://info.englishladiesgolf.org/tic/tmscores.cgi?tourn=EGU3~season=2010~params=P*3ESC~/~";
       sc_tourn.report_options[9]="Final Result (Gross)/~http://info.englishladiesgolf.org/tic/tmresult.cgi?tourn=EGU3~season=2010~result=GF~/~";
       sc_tourn.report_options[10]="Scoring Statistics/~http://info.englishladiesgolf.org/tic/tmstats.cgi?tourn=EGU3~season=2010~/~";
       sc_tourn.report_options[11]="Course Statistics/~http://info.englishladiesgolf.org/tic/tmcrsts.cgi?tourn=EGU3~season=2010~/~";
   sc_tourn.report_options_default=9;
   sc_tourn.css_table="font-family:verdana,tahoma,arial,sans-serif;color:black;background-color:#F8AC68;";
   sc_tourn.css_head="font-family:verdana,tahoma,arial,sans-serif;font-size:9pt;color:blue;";
   sc_tourn.css_main="font-family:verdana,tahoma,arial,sans-serif;font-size:9pt;color:black;background-color:beige;";
   sc_tourn.css_title="font-family:verdana,tahoma,arial,sans-serif;font-size:11pt;color:darkblue;";
   sc_tourn.css_line="font-family:verdana,tahoma,arial,sans-serif;font-size:7.5pt;padding-left:1px;padding-right:1px;";
   sc_tourn.css_linea="font-family:verdana,tahoma,arial,sans-serif;color:black;background-color:#FBD4B1;";
   sc_tourn.css_lineb="font-family:verdana,tahoma,arial,sans-serif;color:black;background-color:#F8AC68;";
   sc_tourn.css_select="font-family:verdana,tahoma,arial,sans-serif;font-size:7.5pt;color:black;background-color:#FBD4B1;";

sc_data = new Array (
   "1/~/~237/~+18/~237/~HEW134/~Alice Hewson/~ENG/~N/~Berkhamsted Golf Club/~83/~80/~74/~83 80 74/~/~",
   "2/~/~240/~+21/~240/~MAD137/~Sophie Madden/~ENG/~N/~West Essex Golf Club/~77/~81/~82/~77 81 82/~/~",
   "3/~/~240/~+21/~240/~FUL002/~Samantha Fuller/~ENG/~N/~Roehampton Club/~77/~81/~82/~77 81 82/~/~",
   "4/~/~245/~+26/~245/~CAR981/~Fay Carpenter/~ENG/~N/~Knighton Heath Golf Club/~81/~82/~82/~81 82 82/~/~",
   "5/~/~246/~+27/~246/~DAN001/~Amelia Daniel/~ENG/~N/~Royal North Devon Golf Club/~79/~82/~85/~79 82 85/~/~",
   "6/~/~247/~+28/~247/~913002/~Annabel Bailey/~ENG/~N/~Notts Ladies Golf Club/~83/~83/~81/~83 83 81/~/~",
   "7/~/~248/~+29/~248/~913001/~Emma Allen/~ENG/~N/~Meon Valley Golf Club/~84/~78/~86/~84 78 86/~/~",
   "8/~/~248/~+29/~248/~913012/~Emily Lyle/~ENG/~N/~Rufford Park Golf Centre/~84/~76/~88/~84 76 88/~/~",
   "9/~/~250/~+31/~250/~OFS127/~Ella Ofstedahl/~ENG/~N/~Mill Green Golf Club/~83/~81/~86/~83 81 86/~/~",
   "10/~/~252/~+33/~252/~913016/~Elizabeth Prior/~ENG/~N/~Foxhills Golf Club/~88/~83/~81/~88 83 81/~/~",
   "11/~/~252/~+33/~252/~913010/~Eloise Healey/~ENG/~N/~Lee Park Golf Club/~85/~86/~81/~85 86 81/~/~",
   "12/~/~255/~+36/~255/~913008/~Natasha Fear/~ENG/~N/~La Sella Golf Club/~88/~88/~79/~88 88 79/~/~",
   "13/~/~256/~+37/~256/~AND001/~Rian Moores/~ENG/~N/~Sandiway Golf Club/~89/~77/~90/~89 77 90/~/~",
   "14/~/~257/~+38/~257/~913014/~Victoria Mallett/~ENG/~N/~Sutton Coldfield Ladies GC/~83/~89/~85/~83 89 85/~/~",
   "15/~/~267/~+48/~267/~LAW671/~Mollie Lawrence/~ENG/~N/~Faversham Golf Club/~93/~82/~92/~93 82 92/~/~",
   "16/~/~267/~+48/~267/~WEL171/~Anna Wells/~ENG/~N/~Chigwell Golf Club/~87/~84/~96/~87 84 96/~/~",
   "17/~/~270/~+51/~270/~HUL002/~Sian Hulse/~ENG/~N/~Mill Green Golf Club/~88/~86/~96/~88 86 96/~/~",
   "18/~/~RTD/~-/~RTD/~HIG003/~Emma Higgins/~ENG/~N/~Highcliffe Castle Golf Club/~81/~94/~RTD/~81 94 RTD/~/~",
   "EOD/~");
   --sc_data.length;
   sc_tourn.data_entries=sc_data.length;

function sc_get_data_object(index)
{
   var tm_eo = new Object;
   var tm_ta = sc_data[index].split('/~');
   if (tm_ta.length > 0)
      tm_eo.pos=tm_ta[0];
   if (tm_ta.length > 1)
      tm_eo.tied=tm_ta[1];
   if (tm_ta.length > 2)
      tm_eo.score=tm_ta[2];
   if (tm_ta.length > 3)
      tm_eo.vspar=tm_ta[3];
   if (tm_ta.length > 4)
      tm_eo.d_score=tm_ta[4];
   if (tm_ta.length > 5)
      tm_eo.member_no=tm_ta[5];
   if (tm_ta.length > 6)
      tm_eo.name=tm_ta[6];
   if (tm_ta.length > 7)
      tm_eo.nationality=tm_ta[7];
   if (tm_ta.length > 8)
      tm_eo.sponsored=tm_ta[8];
   if (tm_ta.length > 9)
      tm_eo.represents=tm_ta[9];
   if (tm_ta.length > 10)
      tm_eo.score_R1=tm_ta[10];
   if (tm_ta.length > 11)
      tm_eo.score_R2=tm_ta[11];
   if (tm_ta.length > 12)
      tm_eo.score_R3=tm_ta[12];
   if (tm_ta.length > 13)
      tm_eo.rounds=tm_ta[13];
   if (tm_ta.length > 14)
      tm_eo.holes=tm_ta[14];
   return(tm_eo);
}
   sc_tourn.incl_score=true;
   sc_tourn.incl_vspar=true;
   sc_tourn.incl_holes=false;
   sc_tourn.std_columns=4;
var sc_ticlinestyle="";
var sc_ticsubwin="";
var sc_cellspacing=false;

// Scoreboard Table Generation

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

function sc_call_sb_report()
{
  var selopt = document.getElementById("sc_options").selectedIndex;
  var option_data = sc_tourn.report_options[selopt].split(sc_tourn.array_delimiter);
  var cgiurl = option_data[1];
  sc_open_tic_window();
  sc_ticsubwin.location = cgiurl;
}

function sc_tour_website()
{
  sc_open_tic_window();
  sc_ticsubwin.location = sc_tourn.tour_website;
}

function sc_tour_tic()
{
  sc_open_tic_window();
  sc_ticsubwin.location = sc_tourn.tic_url;
}

function sc_full_scoreboard()
{
  sc_open_tic_window();
  sc_ticsubwin.location = sc_tourn.full_scoreboard_url;
}

function sc_get_sb_position_strokeplay(index)
{
  var p = sc_get_data_object(index);
  var nbsp = ((sc_cellspacing) ? "" : "&nbsp;");
  if (sc_tourn.group_ties)
  {
     var newpos = false;
     if (p.pos != sc_lastpos)
     {
        newpos = true;
        var tiecount = 0;
        var i=index;
        var p2 = p;
        while ((i<sc_tourn.data_entries) && (p2.pos == p.pos))
        {
           ++tiecount; ++i;
           if (i<sc_tourn.data_entries)
              var p2 = sc_get_data_object(i);
        }
        sc_lastpos = p.pos;
     }
  }
  else
  {
     var newpos = true;
     var tiecount = 1;
  }
  if (p.pos == "CUT")
     return("");
  if (newpos)
     sc_ticlinestyle = ((sc_ticlinestyle=="a")?"b":"a");
  var nwrap = ((sc_tourn.name_wrap) ? "" : " nowrap");
  var sline = "";
  sline += "<TR style='" + sc_tourn["css_line" + sc_ticlinestyle] + "'>";
  if (newpos)
  {
     sline += "<TD style='" + sc_tourn["css_line"] + "text-align:left;' rowspan=" + tiecount + " nowrap>" + p.pos + p.tied + nbsp + "</TD>";
     if (sc_tourn.scores_type == "P")
         p.score += "<SMALL>pts</SMALL>";
     if (sc_tourn.incl_score)
         sline += "<TD style='" + sc_tourn["css_line"] + "text-align:center;' rowspan=" + tiecount + " nowrap>" + ((p.score == "") ? "&nbsp;" : p.score) + "</TD>";
     if (sc_tourn.scores_type == "P")
         p.vspar = "";
     if (sc_tourn.incl_vspar)
         sline += "<TD style='" + sc_tourn["css_line"] + "text-align:center;' rowspan=" + tiecount + " nowrap>" + ((p.vspar == "") ? "&nbsp;" : p.vspar) + "</TD>";
  }
  sline += "<TD style='" + sc_tourn["css_line"] + "text-align:left;" + ((sc_tourn.max_width) ? "width:90%;" : "") + "'" + nwrap + ">" + nbsp + p.name + "</TD>";
  if ((p.holes  == "") || (p.holes == "0"))  p.holes  = "&nbsp;";
  if  (p.holes  == "18")                     p.holes  = "F";
  if (sc_tourn.incl_holes)
     sline += "<TD style='" + sc_tourn["css_line"] + "text-align:center;' nowrap>" + p.holes + "</TD>";
  sline += "</TR>";
  return(sline);
}

function sc_get_sb_position_matchplay(index)
{
  var p = sc_get_data_object(index);
  var noscores = ((p.holes == "0") && (p.status_1 != "W") && (p.status_2 != "W"));
  sc_ticlinestyle = ((sc_ticlinestyle=="a")?"b":"a");
  var nwrap = ((sc_tourn.name_wrap) ? "" : " nowrap");
  var sline = "";
  sline += "<TR style='" + sc_tourn["css_line" + sc_ticlinestyle] + "'>";
  sline += "<TD style='" + sc_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='" + sc_tourn["css_line"] + "text-align:center;" + fweight + "'" + ((noscores) ? " rowspan=2" : "") + " nowrap>" + p.full_score_1 + "</TD>";
  sline += "<TD style='" + sc_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='" + sc_tourn["css_line"] + "text-align:center;' rowspan=2 nowrap>&nbsp;" + p.holes + "&nbsp;</TD>";
  sline += "</TR>";
  sline += "<TR style='" + sc_tourn["css_line" + sc_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='" + sc_tourn["css_line"] + "text-align:center;" + fweight + "' nowrap>" + p.full_score_2 + "</TD>";
  sline += "<TD style='" + sc_tourn["css_line"] + "text-align:left;"   + fweight + "'" + nwrap + ">" + p.name_2   + "</TD>";
  sline += "</TR>";
  return(sline);
}

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

function sc_get_scoreboard()
{
  sc_ticlinestyle = "";
  sc_lastpos = "";
  sc_cellspacing=sc_tourn.group_ties;
  var cspan = sc_tourn.std_columns;
  var dhtml = "";
  if (sc_tourn.autosize)
     dhtml += "<DIV style='width:100px;'>" +
              "<TABLE border=0 cellspacing=" + ((sc_cellspacing) ? "1" : "0") + " cellpadding=0 style='" + sc_tourn["css_table"] + "'>" +
              "<TR><TD colspan=" + cspan + ">"
  else
     dhtml += "<DIV style='" + sc_tourn["css_table"] + "margin:auto;text-align:center;'>";
  dhtml += "<TABLE border=0 cellspacing=0 cellpadding=0 style='margin:auto;" + ((sc_tourn.autosize) ? "width:100%;" : "") + "'>" +
           "<TR>";
  if (sc_tourn.logo_pos == "T")
     dhtml += sc_add_logo() + "</TR><TR>"
  else
  if (sc_tourn.logo_pos == "L")
     dhtml += sc_add_logo();
  dhtml += "<TD style='text-align:center;margin:auto;'>";
  dhtml += "<DIV style='" + sc_tourn["css_title"] + "text-align:center;font-weight:bold;padding:1px;'>" +
           sc_tourn.short_name + "</DIV>";
  var cds = sc_tourn.course_dates.split("<BR>");
  var cdj = ((cds.length == 2) ? "<NOBR>" + cds[0] + "</NOBR> <NOBR>" + cds[1] + "</NOBR>" : cds[0]);
  if (sc_tourn.autosize)
     cdj = "<NOBR>" + sc_tourn.course_dates + "</NOBR>";
  dhtml += "<DIV style='" + sc_tourn["css_head"] + "text-align:center;padding:1px;'>" + cdj + "</DIV>";
  dhtml += "</TD>";
  if (sc_tourn.logo_pos == "R")
     dhtml += sc_add_logo();
  dhtml += "</TR></TABLE>";
  dhtml += "<DIV style='" + sc_tourn["css_main"] + "text-align:center;font-weight:bold;padding:1px;clear:both;'>" +
           sc_tourn.round_head + "</DIV>";
  dhtml += "<DIV style='" + sc_tourn["css_main"] + ((sc_tourn.scroll_height != 0) ? "height:" + sc_tourn.scroll_height + "px;overflow:auto;" : "") + "'>";
  if (sc_tourn.autosize)
      dhtml += "</DIV></TD></TR>"
  else
      dhtml += "<TABLE border=0 cellspacing=" + ((sc_cellspacing) ? "1" : "0") + " cellpadding=1 style='margin:auto;text-align:center;'>";
  if (sc_tourn.data_entries != 0)
  {
      for (var i=0; i<sc_tourn.data_entries; i++)
      {
         if (sc_tourn.scores_type == "M")
             dhtml += sc_get_sb_position_matchplay(i)
         else
             dhtml += sc_get_sb_position_strokeplay(i);
      }
  }
  if (sc_tourn.licence_error)
     dhtml += "<TR><TD style='" + sc_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 (sc_tourn.data_entries == 0)
     dhtml += "<TR><TD style='" + sc_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 (sc_tourn.autosize)
      dhtml += "<TR><TD colspan=" + cspan + ">"
  else
      dhtml += "</TABLE></DIV>";
  dhtml += "<DIV style='" + sc_tourn["css_main"] + "text-align:center;font-weight:normal;padding:2px;'>";
  if (typeof sc_tourn.report_options != "undefined")
  {
     dhtml += "<DIV style='text-align:center;'><NOBR>" +
              "<SELECT id=sc_options style='" + sc_tourn["css_select"] + "'>";
     for (var i=0; i<sc_tourn.report_options.length; i++)
     {
         var option_data = sc_tourn.report_options[i].split(sc_tourn.array_delimiter);
         dhtml += "<OPTION" + ((i == sc_tourn.report_options_default) ? " selected" : "") + ">";
         dhtml += option_data[0] + "</OPTION>";
     }
     dhtml += "</SELECT>";
     dhtml += "&nbsp;&nbsp;" +
              "<BUTTON style='" + sc_tourn["css_select"] + "' onclick='sc_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:sc_tour_tic();' " +
              "style='" + sc_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 (sc_tourn.full_scoreboard_url != "")
         dhtml += "<DIV><A href='javascript:sc_full_scoreboard();' " +
                  "style='" + sc_tourn["css_main"] + "text-decoration:none;padding:1px;' " +
                  "title='" + ((sc_tourn.live_scoring == "Y") ? "Open the live scoring monitor" : "View the full detailed scoreboard") + "'>" +
                  ((sc_tourn.live_scoring == "Y") ? "Live&nbsp;Scoring" : "Full&nbsp;Scoreboard") + "&#187;</A></DIV>";
     if (sc_tourn.logo_pos != "")
         dhtml += "<DIV><A href='javascript:sc_tour_tic();' " +
                  "style='" + sc_tourn["css_main"] + "text-decoration:none;padding:1px;' " +
                  "title='Visit the " + sc_tourn.tour_name + " Information Centre for a full service of scores and statistics'>" +
                  "Information&nbsp;Centre&#187;</A></DIV>";
  }
  dhtml += "</DIV>";
  if (sc_tourn.autosize)
     dhtml += "</TD></TR></TABLE>"
  dhtml += "</DIV>";
  return(dhtml);
}
