<!--

function common()
{

}

function showPageTop()
{
  if( window.opener==undefined )
  {
    if( window.top.location != window.document.location )
    {
      window.top.location = window.document.location;
    }
  }
  else
  {
    if( window.opener.top.location != window.document.location )
    {
      window.opener.top.location = window.document.location;
      window.close();
    }
  }

}

function keyinNumber()
{
  if( window.event.keyCode<48 || window.event.keyCode>57 )
    window.event.keyCode=0;
}

function submitToCgi()
{
    var f=document.createElement("form");
    f.setAttribute("method","post");
    f.setAttribute("action",arguments[0]);
    f.setAttribute("target",arguments[1]);
    var i,n;
    n=(arguments.length-1)/2;
    for(i=0;i<n;i++)
    {
      var h=document.createElement("input");
      h.setAttribute("type","hidden");
      h.setAttribute("name",arguments[2*i+2]);
      h.setAttribute("value",arguments[2*i+3]);
      f.appendChild(h);
    }
    document.getElementsByTagName("body")[0].appendChild(f);
    f.submit();
}

function setSelectedOption( xSelectObj, xSelectedOptionValue )
{
  var i,n;
  n = xSelectObj.length;
  for( i=0; i<n; i++)
  {
    if( xSelectObj.options[i].value==xSelectedOptionValue )
    {
      xSelectObj.options[i].selected=true;
      break;
    }    
  }
}

function colorTable( xTableObj, xsClassRow0, xsClassRow1, xsClassRow2 )
{
  var r=xTableObj.getElementsByTagName("tr");
  var n=r.length;
  for( var i=0; i<n; i++)
  {
    if( i==0 ) r[i].className=xsClassRow0;
    else if( i%2==1 ) r[i].className=xsClassRow1;
    else r[i].className=xsClassRow2;
  }
}

function tableContent( xTableObj, xRow, xCol, xValue )
{
  xTableObj.getElementsByTagName("tr")[xRow].getElementsByTagName("td")[xCol].innerHTML+=xValue;
}

function getMonthDays( xiYear, xiMonth )
{
  var i=0;
  if( xiYear % 4 == 0 ) i++;
  if( xiYear % 100 == 0 ) i--;
  if( xiYear % 400 == 0 ) i++;
  switch(xiMonth)
  {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
    case "1":
    case "3":
    case "5":
    case "7":
    case "8":
    case "10":
    case "12":
    case "01":
    case "03":
    case "05":
    case "07":
    case "08":
      return 31;
      break;
    case 4:
    case 6:
    case 9:
    case 11:
    case "4":
    case "6":
    case "9":
    case "11":
    case "04":
    case "06":
    case "09":
      return 30;
      break;
    case 2:
    case "2":
    case "02":
      return 28+i;
      break;
    default:
      return 0;
      break;      	
  }	
}

function getMonthFirstDay( xiYear, xiMonth )
{
  var d=new Date( xiYear, xiMonth-1, 1); // month domain is : 0-11
  return d.getDay();
}

function mailto( xsEmailAddress )
{
  location="mailto:"+xsEmailAddress;
}

//-->