//javascript functions
// function to format a date string to english or european format
// types are EU ,GB , US
function formatdate (pdate , typ)
{
 var outdate;
 
  
  month$ = new String(pdate.getMonth()+1);
  if (month$.length < 2)
          month$ = "0"+month$;
  day$ = new String(pdate.getDate());
  if (day$.length < 2) 
         day$ = "0"+day$;
  year$ = new String(pdate.getFullYear());
  if (year$.length < 4)
          year$ = "20"+year$;
  if (typ == "EU") 
  {outdate = day$+"-"+month$+"-"+year$;}
  else if (typ == "GB")
  {outdate = month$+"-"+day$+"-"+year$;}
  else
  {outdate = year$+"-"+month$+"-"+day$;}
    
 return outdate;
}


