// openNewWindow(winURL,winTitle,winOptions)
//
// This functionw will open a new browser window.
// If called with only the winURL parameter, a standard
// browser window will be opened.

// Input parameters:
//   winURL - path to page/image to display (Required)
//   winTitle - Title of new window
//   winOptions - the options used to open new window
//
//      Window.Open  Options
//   Option      Values  Description 
// --------------------------------------------------
//  location     yes|no  Does the location bar show? 
//  menubar      yes|no  Does the menubar show? 
//  scrollbars   yes|no  Do scrollbars show? 
//  status       yes|no  Does the status bar show? 
//  titlebar     yes|no  Does the titlebar show? 
//  toolbar      yes|no  Does the toolbar show? 
//  resizable    yes|no  Can you resize the window? 
//  height       pixels  height of window 
//  width        pixels  width of window 
//  directories  yes|no  Does the personal toolbar show? 
// 

function openNewWindow(winURL,winTitle,winOptions) {
  if (openNewWindow.arguments.length == 1) {
    winTitle='';
	winOptions='';
  }
	
  newWindow=window.open(winURL,winTitle,winOptions)     
  newWindow.focus()
}

// showemail(userKey,emailSubject)
//
// This function will output an anchor tag (link) to
// open the local email client with the TO: and SUBJECT:
// filled in. This method allows you ot 'hide' email addresses
// from email harvesters.
//
// Input parameters:
//    userKey   - a string to ID the email account
//    emailSubject - a string that will be used as the SUBJECT of the email
// tobrewer@bibank.com

function showEmail(userKey,emailSubject) {
  
  var emailAccount= new Array()
  emailAccount["frank"]="fspires";
  emailAccount["jeff"]="6garrett";
  emailAccount["sandy"]="sandykayrun";
  emailAccount["ladonna"]="lgamble";
  emailAccount["trac"]="trac";
  emailAccount["education"]="education";
  emailAccount["danny"]="irun";
  emailAccount["gary"]="glhouse02";
  emailAccount["jerry"]="jwcondrey";
  emailAccount["jim"]="jtbeavers";
  emailAccount["joe"]="joequillen";
  emailAccount["john"]="jaikin2";
  emailAccount["josh"]="trac";
  emailAccount["joy"]="jharbin";
  emailAccount["keith"]="keith";
  emailAccount["kim"]="pokey5782";
  emailAccount["linda"]="lindabrewer209";
  emailAccount["todd"]="agameco";
  emailAccount["tony"]="tobrewer";
  emailAccount["mike"]="trac_email";
  emailAccount["leigh"]="notwright";
  emailAccount["ryan"]="ryan";
  emailAccount["christine"]="Cellis3509";
  emailAccount["jill"]="jill.stein";
  emailAccount["shoalsrunner"]="shoalsrunner";
  emailAccount["sarah"]="damps";
  emailAccount["trac"]="trac";
  emailAccount["calendar"]="shoalsrunner";
  emailAccount["jaikin"]="johnaikin";
  emailAccount["anna"]="anna.fennell";
  emailAccount["scs"]="boxinalusa";
  emailAccount["wauburn"]="wauburn";
  
  var emailHost= new Array()
  emailHost["frank"]="spiresandassociates";
  emailHost["jeff"]="comcast";
  emailHost["sandy"]="yahoo";
  emailHost["ladonna"]="spiresandassociates";	
  emailHost["trac"]="hiwaay";
  emailHost["education"]="YTBC";  
  emailHost["danny"]="bellsouth";
  emailHost["gary"]="comcast";
  emailHost["jerry"]="comcast";
  emailHost["jim"]="hughes";
  emailHost["joe"]="bellsouth";
  emailHost["john"]="senatorscoach";
  emailHost["josh"]="hiwaay";
  emailHost["joy"]="mscs.k12.al";
  emailHost["keith"]="blackwarrior50k";
  emailHost["kim"]="yahoo";
  emailHost["linda"]="comcast";
  emailHost["todd"]="aol";
  emailHost["tony"]="bibank";
  emailHost["mike"]="comcast";
  emailHost["leigh"]="comcast";
  emailHost["ryan"]="firstplaceathletics";
  emailHost["christine"]="aol";
  emailHost["jill"]="sca";
  emailHost["shoalsrunner"]="bellsouth";
  emailHost["sarah"]="abroms";
  emailHost["trac"]="hiwaay";
  emailHost["calendar"]="bellsouth";
  emailHost["jaikin"]="att";
  emailHost["anna"]="us.army";
  emailHost["scs"]="yahoo";
  emailHost["wauburn"]="bellsouth";
  
  var emailTLD= new Array()
  emailTLD["frank"]="com";
  emailTLD["jeff"]="net";
  emailTLD["sandy"]="com";
  emailTLD["ladonna"]="com";
  emailTLD["trac"]="net";
  emailTLD["education"]="org";
  emailTLD["danny"]="net";
  emailTLD["gary"]="net";
  emailTLD["jerry"]="net";
  emailTLD["jim"]="net";
  emailTLD["joe"]="net";
  emailTLD["john"]="com";
  emailTLD["josh"]="net";
  emailTLD["joy"]="us";
  emailTLD["keith"]="com";
  emailTLD["kim"]="com";
  emailTLD["linda"]="net";
  emailTLD["todd"]="com";
  emailTLD["tony"]="com";
  emailTLD["mike"]="net";
  emailTLD["leigh"]="net";
  emailTLD["ryan"]="com";
  emailTLD["christine"]="com";
  emailTLD["jill"]="com";
  emailTLD["shoalsrunner"]="net";
  emailTLD["sarah"]="com";
  emailTLD["trac"]="net";
  emailTLD["calendar"]="net";
  emailTLD["jaikin"]="net";
  emailTLD["anna"]="mil";
  emailTLD["scs"]="com";
  emailTLD["wauburn"]="net";
  
  
  if (userKey == "shoalsrunner")
    document.write("<a class=\"shoalsrunner-emaillink\" href=\"mailto:" + emailAccount[userKey] + "@" + emailHost[userKey] + "." + emailTLD[userKey] + "?Subject=TRAC%20Site:%20" + emailSubject + "\">SIGN UP TODAY!</a>");    
  else
    document.write("<a href=\"mailto:" + emailAccount[userKey] + "@" + emailHost[userKey] + "." + emailTLD[userKey] + "?Subject=TRAC%20Site:%20" + emailSubject + "\">email</a>");  
  
}
