/***********************************************
* fredom-cruisers.org
* javascript functions
***********************************************/

function webheader() {
  document.write("");
  document.write("");
  document.write("");
}


// Trim function for strings
// =========================
function trimstr(str) {
  return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');	str = str.replace(/^\s+/, '');
}


// Convert string to Uppercase
// ===========================
function makeUppercase(source) {
  source.value = source.value.toUpperCase();
}


// Javascript email formatter
// ==========================
function jsmail() {
  var args = jsmail.arguments;
  var one = args[0]
  if (one.indexOf('@') > 0 ) {
    //alert(one);
    document.write ("<a href='"+"mail"+"to:"+one+"'>"+one+"</a>");
    //document.write(one);
    //return one;
  }
  else {
    document.write ("<a href='"+"mail"+"to:"+args[0]+"@"+args[1]+'.'+args[2]+"'>"+args[0]+"@"+args[1]+'.'+args[2]+"</a>");
  }
}

// Javascript email formatter
// ==========================
function jsmailspe() {
  var args = jsmailspe.arguments;
  var one = args[0]
  if (one.indexOf('@') > 0 ) {
    //alert(one);
    document.write ("<a class='speemail' href='"+"mail"+"to:"+one+"'>"+one+"</a>");
    //document.write(one);
    //return one;
  }
  else {
    document.write ("<a class='speemail' href='"+"mail"+"to:"+args[0]+"@"+args[1]+'.'+args[2]+"'>"+args[0]+"@"+args[1]+'.'+args[2]+"</a>");
  }
}

// web header
//function webheader0() {

//}


function wip() {alert('I\'m workin\' on it...');}

function fut() {alert('Future page');}

// View Email Notes
function ShowEmailNotes(t) {
  var popupWin = window.open("", 'ShowEList','fullscreen=0,channelmode=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=580,height=500');

  popupWin.document.write("<html><head>\n");
  switch (t)
  {
  case 1 :
    popupWin.document.write("<title>Notes - Email your Chapter</title>\n");
    popupWin.document.write("<style type='text/css'>body {background-color:#ffc; font-family: Arial, Helvetica, sans-serif; font-size:10pt; color:#000}</style>\n")
    popupWin.document.write("</head><body>\n");
    popupWin.document.write("<p style='text-align:center; font-size:14pt; font-weight:800; color:#009; text-decoration:underline'>Email your Chapter - Important Notes</p>\n");
    popupWin.document.write("<p>This program allows you to send an email to all the members of your chapter directly from the website. ");
    popupWin.document.write("This eliminates the hassles of having to copy and paste email addresses, and messing with your own email software on your computer. ");
    popupWin.document.write("(<span style='font-style:italic;color:#009'>If you'd like, you can still send an email message using this method. Close this popup window and click ");
    popupWin.document.write("the link for '<span style='font-weight:800'>View List</span>'. ");
    popupWin.document.write("You can copy and paste this list into your email program and send a message from there.</span>)</p>\n");
    popupWin.document.write("<p>A few simple assumptions...\n");
    popupWin.document.write("<ul style='margin-top:0'><li>The member must have an email address in the 'Email 1' field of the database.</li>\n");
    popupWin.document.write("<li>It needs to be a valid email.</li></ul></p>\n");
    popupWin.document.write("<p>If a member of your chapter has an email address in the Email 1 field but it is a bad email, this program most likely will send the message, ");
    popupWin.document.write("but you will get a failure email back to you.</p>\n");
    popupWin.document.write("<p>Lastly... Your email address is not from the same domain as our national website. When the program tries to send your email, it will be viewed as ");
    popupWin.document.write("spam and will not send. To eliminate this problem, the email will actually be sent from 'webmaster@freedom-cruisers.org' with your email address in ");
    popupWin.document.write("the 'reply-to' field. Therefore, if someone replies to your message the email will be sent back to you (not the webmaster).</p>\n");
    popupWin.document.write("<p>Although this may sound somewhat complicated, it's actually really easy to use.</p>\n");
    break;
  case 2 :
    popupWin.document.write("<title>Notes - All Chapter Presidents</title>\n");
    popupWin.document.write("<style type='text/css'>body {background-color:#ffc; font-family: Arial, Helvetica, sans-serif; font-size:10pt; color:#000}</style>\n")
    popupWin.document.write("</head><body>\n");
    popupWin.document.write("<p style='text-align:center; font-size:14pt; font-weight:800; color:#009; text-decoration:underline'>Email All Chapter Presidents - Important Notes</p>\n");
    popupWin.document.write("<p>This program allows you to send an email to all chapter presidents directly from the website. ");
    popupWin.document.write("This eliminates the hassles of having to copy and paste email addresses, and messing with your own email software on your computer. ");
    popupWin.document.write("(<span style='font-style:italic;color:#009'>If you'd like, you can still send an email message using this method. Close this popup window and click ");
    popupWin.document.write("the link for '<span style='font-weight:800'>View List</span>'. ");
    popupWin.document.write("You can copy and paste this list into your email program and send a message from there.</span>)</p>\n");
    popupWin.document.write("<p><span='text-decoratio:underline'>Note:</span> Your email address is not from the same domain as our national website. When the program tries to send your email, it will be viewed as ");
    popupWin.document.write("spam and will not send. To eliminate this problem, the email will actually be sent from 'webmaster@freedom-cruisers.org' with your email address in ");
    popupWin.document.write("the 'reply-to' field. Therefore, if someone replies to your message the email will be sent back to you (not the webmaster).</p>\n");
    break;
  case 3 :
    popupWin.document.write("<title>Notes - State Presidents</title>\n");
    popupWin.document.write("<style type='text/css'>body {background-color:#ffc; font-family: Arial, Helvetica, sans-serif; font-size:10pt; color:#000}</style>\n")
    popupWin.document.write("</head><body>\n");
    popupWin.document.write("<p style='text-align:center; font-size:14pt; font-weight:800; color:#009; text-decoration:underline'>Email State Directors - Important Notes</p>\n");
    popupWin.document.write("<p>This program allows you to send an email to State Directorys directly from the website. ");
    popupWin.document.write("This eliminates the hassles of having to copy and paste email addresses, and messing with your own email software on your computer. ");
    popupWin.document.write("(<span style='font-style:italic;color:#009'>If you'd like, you can still send an email message using this method. Close this popup window and click ");
    popupWin.document.write("the link for '<span style='font-weight:800'>View List</span>'. ");
    popupWin.document.write("You can copy and paste this list into your email program and send a message from there.</span>)</p>\n");
    popupWin.document.write("<p><span='text-decoratio:underline'>Note:</span> Your email address is not from the same domain as our national website. When the program tries to send your email, it will be viewed as ");
    popupWin.document.write("spam and will not send. To eliminate this problem, the email will actually be sent from 'webmaster@freedom-cruisers.org' with your email address in ");
    popupWin.document.write("the 'reply-to' field. Therefore, if someone replies to your message the email will be sent back to you (not the webmaster).</p>\n");
    break;
  case 4 :
    popupWin.document.write("<title>Notes - Chapter Presidents &amp; State Presidents</title>\n");
    popupWin.document.write("<style type='text/css'>body {background-color:#ffc; font-family: Arial, Helvetica, sans-serif; font-size:10pt; color:#000}</style>\n")
    popupWin.document.write("</head><body>\n");
    popupWin.document.write("<p style='text-align:center; font-size:14pt; font-weight:800; color:#009; text-decoration:underline'>Email Presidents &amp; State Directors - Important Notes</p>\n");
    popupWin.document.write("<p>This program allows you to send an email to State Directorys directly from the website. ");
    popupWin.document.write("This eliminates the hassles of having to copy and paste email addresses, and messing with your own email software on your computer. ");
    popupWin.document.write("(<span style='font-style:italic;color:#009'>If you'd like, you can still send an email message using this method. Close this popup window and click ");
    popupWin.document.write("the link for '<span style='font-weight:800'>View List</span>'. ");
    popupWin.document.write("You can copy and paste this list into your email program and send a message from there.</span>)</p>\n");
    popupWin.document.write("<p><span='text-decoratio:underline'>Note:</span> Your email address is not from the same domain as our national website. When the program tries to send your email, it will be viewed as ");
    popupWin.document.write("spam and will not send. To eliminate this problem, the email will actually be sent from 'webmaster@freedom-cruisers.org' with your email address in ");
    popupWin.document.write("the 'reply-to' field. Therefore, if someone replies to your message the email will be sent back to you (not the webmaster).</p>\n");
  }

  popupWin.document.write("<p style='text-align:center'><a href='javascript:self.close();'>Close</a></p>\n");
  popupWin.document.write("</body></html>\n");
  popupWin.document.close();
  
  if (window.focus) {popupWin.focus()}
} 

