/*
  This is a general purpose library for the web pages of the Ottawa Pacers Speed Skating Club
*/
// Production - Set the base path variable so absolute addresses are used instead of relative ones
var basePath = 'http://www.ottawapacers.ca/';

// Development - Set to the PC's path
//basePath = 'C:/Documents and Settings/Bryan/My Documents/My Webs/Ottawa Pacers/';

//
// Display the hyperlink in a new window
//
function NewWindow(pickwintype,displayitem,winsize) 
{
  switch(pickwintype)
  {
    case "image" :
      ImageWin=window.open(displayitem,"ImageWin","toolbar=yes,directories=no,status=no,scrollbars=no,menubar=yes,"+winsize);
      break;
    case "url" :
      UrlWin=window.open(displayitem,"UrlWin");
      break;
    case "message" :
      MsgWin=window.open(displayitem,"MsgWin","toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,"+winsize);
      break;
    default :
      window.alert("Unknown window type request in function NewWindow");
  }
}

//
// Display the Speed Calculator
//
function SpeedCalc()
{
  var speedCalcPath = basePath + 'Other/Speed Calculator.html';
  {
    Speed_Calc=window.open(speedCalcPath,"Speed_Calc","width=650,height=450");
  }
}
//
// Display the Age Class Calculator
//
function AgeCalc()
{
  var ageCalcPath = basePath + 'Other/Age Class Calculator.html';
  {
    Age_Calc=window.open(ageCalcPath,"Age_Calc","width=650,height=450");
  }
}

//
// Assemble e-mail addresses
//
function eScramble(board_mem)
{
  var a,b,c,d,e,f,f1,g,h,i,j,k,l,m,n,o,s,x,y,z,cc,dd,zz
  a='op_president'
  b='op_vicepres'
  c='op_secretary'
  d='op_treasurer'
  e='op_tech_director'
  f='op_meets'
  f1='op_fundraising'
  g='op_masters'
  h='op_equipment'
  i='op_webmaster'
  j='op_information'
  k='op_registration'
  l='ndmac'
  m='gmail'
  n='ottawapacers'
  o='op_oval_ops'
  p='op_recruitment'
  s='sympatico'
  
  x='mai'
  y='@'
  z ='lto:'
  cc='.ca'
  dd='.com'


  switch(board_mem)
  {
    case "President":
      zz=a+y+n+cc;
      break;
    case "Vice President":
      zz=b+y+n+cc;
      break;
    case "Secretary":
      zz=c+y+n+cc;
      break;
    case "Treasurer":
      zz=d+y+n+cc;
      break;
    case "Technical":
      zz=e+y+n+cc;
      break;
    case "Meets":
      zz=f+y+n+cc;
      break;
    case "Masters":
      zz=g+y+n+cc;
      break;
    case "Equipment":
      zz=h+y+n+cc;
      break;
    case "Webmaster":
      zz=i+y+n+cc;
      break;
    case "Information":
      zz=j+y+n+cc;
      break;
    case "Registration":
      zz=k+y+n+cc;
      break;
    case "Fundraising":
      zz=f1+y+n+cc;
      break;
    case "Oval_Ops":
      zz=o+y+n+cc;
      break;
    case "Recruitment":
      zz=p+y+n+cc;
      break;
    case "Dryland":
      zz='Gerry.harrington'+y+l+cc;
      break;
    case "Dryland_Reg":
      zz='Ryan.Ogston'+y+m+dd;
      break;
   }
   
    window.location = x+z+zz;
}
      