function doPopup(context, url, wnd)
{
  if (url.length > 0)
  {
    window.open(context + url, wnd,"width=600,height=400,scrollbars=1,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0")
    return;
  } 
}

function doPrint()
{
  window.print();
}

function doEmail(context, handle, wnd)
{
  var url = "/teamsingapore/en/tools/email.html?url=" + handle;
  doPopup(context, url, wnd);
}

function doGotoURL(context, url)
{
  if (url.length > 0)
  {
    document.location= context + url;
    return;
  } 
}

function doIFrameResize(id)
{
  var a = navigator.userAgent;
  var isSF = (a.indexOf("Safari") > 0) ? true : false;
  var isIE = (a.indexOf("MSIE") > 0) ? true : false;
  
  var time;
  var delay = 200;

  var docHeight = (isIE) ? document.body.scrollHeight + 4 : document.body.offsetHeight;
  var docHeight = (isSF) ? docHeight + 20 : docHeight;

  //alert("docHeight:" + docHeight);

  if (docHeight == null || docHeight <= 10)
  {
    var func = "doIFrameResize('"+ id +"')";
    time = setTimeout(func, delay);    
  } 
  else 
  {  
    if (time)
      clearTimeout(time);
    
    try
    {
      if (isIE)
        window.parent.document.getElementById(id).style.height = docHeight;
      else 
        window.parent.document.getElementById(id).height = docHeight;
    } catch(e)
    {
     //alert(e);  
    }
  }
}


function go()
{
   box = document.getElementById("sportscategory").category;
   destination = box.options[box.selectedIndex].value;
   if (destination) 
     location.href = destination;
}
