// email functions
function mail2(staff,text){
// text is description to be displayed on web page in place of email address. If left blank,
// email address will be displayed.
var p1;
var p2;
var p3='@'+'ws';
p3=p3+'spc';
p3=p3+'.o'+'rg';


switch(staff)
{
case 'patti':
  p1='psu';
  p2='tch';
  break;    
case 'amy':
  p1='ale';
  p2='wis';
  break;    
case 'wsspc':
  p1='wss';
  p2='pc';
  break;    
default:
  p1='in';
  p2='fo';
}
if(text=='')text=p1+p2+p3;
document.write('<a href="mailto:' + p1+p2+p3+'">'+text+'</a>');
}

// login and password functions
// get password cookie
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

// set password cookie
function setCookie(c_name,value)
{
var exdate=new Date();
document.cookie=c_name+ "=" +escape(value); 
}

// check password cookie
function checkCookie()
{
username=getCookie('username');
if (username!=null && username!="")
  {
  }
else
  {
  alert('Members only page. Login required.');
  location.href='members_only.shtml';
  }
}


// Check user name and password
function login(uname,pword){
if(uname == '2012Board' && pword == 'call6sing'){
	setCookie('username',uname);
	location.href='member_downloads.shtml';
}
else
{alert('Invalid User name and password.');
}
}
