// Version Info: $Id: rmoug.js 1.5 2005/02/02 11:19:47 isdir Exp $

// GLOBALS ---------------------------------------------------------------------
// Moving this page to UAT  RJB 10/9/03
// Changed by John King 9/5/2009 
//    - Reorganized headers; commented Login
//    - Changed copyright date to 2009 from 2003
var browser_name = navigator.appName;

var days = new Array(8);
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";

var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";

// DATE functions --------------------------------------------------------------
function format_date_string(dateObj)
{
   var lday = days[dateObj.getDay() + 1];
   var lmonth = months[dateObj.getMonth() + 1];
   var ldate = dateObj.getDate();
   var lyear = dateObj.getFullYear();
   var lhours = dateObj.getHours();
   var lminutes = dateObj.getMinutes();
   var dateStr = new String(lday + ", " + lmonth + " " + ldate + ", " + lyear + "  " + lhours + ":" + lminutes);
   return dateStr;
}
function print_curr_date()
{
    currDate = new Date();
    document.write("<div class='date'>");
    document.write(format_date_string(currDate));
    document.write("</div>");
}
function print_last_mod()
{
    lmDate = new Date(document.lastModified);
    document.write("<div class='date'>");
    document.write("Last Modified: " + format_date_string(lmDate));
    document.write("</div>");
}
function print_csv_date()
{
   var today = new Date();
   var currday = days[today.getDay() + 1];
   var currmonth = months[today.getMonth() + 1].substr(0, 3);
   var currdate = today.getDate();
   var curryear = today.getYear();

   if (browser_name == "Microsoft Internet Explorer")
      {if (curryear < 99) curryear = 1900 + curryear}
   else
      curryear = 1900 + curryear;

   document.write(currdate + "-" + currmonth.toLowerCase() + "-" + curryear);
}



// Modular functions to prevent duplications -----------------------------------
// Updated webmaster email to new rmoug.org email.  rjb 7/13/03
function webmaster()
{
   document.write('<a class="mailto" href="mailto:WebMaster@rmoug.org">RMOUG Webmaster</a>');
}



function uppage()
{
   document.write('<a class="toppage" href="#pageTop">Top of Page</a>');
}

function downpage()
{
   document.write('<a class="bottompage" href="#pageBottom">Bottom of Page</a>');
}

function header()
{
    document.write('<span id="pageTop" />');
    document.write('<table id="tblStdHeader" width="100%" border="0" cellspacing="0" cellpadding="2" summary="standard header with navigation links">');
    document.write('  <col id="colHeadLeft" width="30%" align="right" />');
    document.write('  <col id="colHeadRight" width="70%" align="left" />');

    document.write('  <tr class="menuBar">');
    document.write('	<td align="middle" valign="middle" rowspan="2">');
    document.write('	  <a href="index.html">');
    document.write('      <img src="images/bluelogo.jpg" alt="RMOUG Home Page" width="250" height="78" />');
    document.write('      </a>');
    document.write('	</td>');

    document.write('    <td align="left" valign="left">');
  
    document.write('      <a href="calendar.htm" class="menuItem">Events</a>');
    document.write('      <a href="member.htm" class="menuItem">Membership</a>');
    document.write('      <a href="training.htm" class="menuItem">Training</a>');
	document.write('      <a href="newslett.htm" class="menuItem">Newsletter</a>');
	document.write('      <a href="Scholarship.htm" class="menuItem">Scholarship</a>');
	document.write('      <a href="links.htm" class="menuItem">Resources</a>');
 	document.write('      <a href="about.htm" class="menuItem">About Us</a>');
	document.write('      <a href="board.htm" class="menuItem">RMOUG Board</a>');
	document.write('      <a href="http://www.nosey-parkers.com/pls/ask/ask_process_survey.main?p=X78" class="menuItemRight">Volunteer?</a>');
//    document.write('      <a href="http://localhost:8500/msrmoug/login.cfm" class="menuItemRight">Login</a>');
//    document.write('      <a href="../msdev.rmoug.org/msLogin.dwt" class="menuItemRight">Login</a>');
    document.write('    </td>');
    document.write('  </tr>');

    document.write('  <tr class="menuBar">');
    document.write('    <td align="middle" valign="middle">');
    document.write('      <a href="index.html" class="groupName">Rocky Mountain Oracle Users Group</a>');
    document.write('    </td>');
    document.write('  </tr>');
    document.write('</table>');
    document.write('<hr>');
    document.write('<div class="lefttxt"><script type="text/javascript">downpage();</script></div>');
}


//======================================================================================================
// Function for displaying RMOUG header to a web page without the bottom page function.  This should
// be used in conjunction with the footer without the top of page function.  rjb 12/12/03
//======================================================================================================
function header_no_bottom()
{
    document.write('<table id="tblStdHeader" width="100%" border="0" cellspacing="0" cellpadding="2" summary="standard header with navigation links">');
    document.write('  <col id="colHeadLeft" width="30%" align="right" />');
    document.write('  <col id="colHeadRight" width="70%" align="left" />');

    document.write('  <tr class="menuBar">');
    document.write('	<td align="middle" valign="middle" rowspan="2">');
    document.write('	  <a href="index.html">');
    document.write('      <img src="images/bluelogo.jpg" alt="RMOUG Home Page" width="250" height="78" />');
    document.write('      </a>');
    document.write('	</td>');

    document.write('    <td align="left" valign="left">');
    document.write('      <a href="board.htm" class="menuItem">RMOUG Board</a>');
	document.write('      <a href="http://www.nosey-parkers.com/pls/ask/ask_process_survey.main?p=X78">Volunteer?</a>');
    document.write('      <a href="member.htm" class="menuItem">Membership</a>');
    document.write('      <a href="calendar.htm" class="menuItem">Events</a>');
    document.write('      <a href="training.htm" class="menuItem">Training</a>');
    document.write('      <a href="newslett.htm" class="menuItem">Newsletter</a>');
    document.write('      <a href="links.htm" class="menuItem">Resources</a>');
    document.write('      <a href="about.htm" class="menuItem">About Us</a>');
    document.write('      <a href="siteinfo.htm" class="menuItemRight">Site Info</a>');
    document.write('    </td>');
    document.write('  </tr>');

    document.write('  <tr class="menuBar">');
    document.write('    <td align="middle" valign="middle">');
    document.write('      <a href="index.html" class="groupName">Rocky Mountain Oracle Users Group</a>');
    document.write('    </td>');
    document.write('  </tr>');
    document.write('</table>');
    document.write('<hr>');
}

function footer()
{
    document.write('<br /><div align="left">');
    
    document.write('<div class="lefttxt"><script type="text/javascript">uppage();</script></div>');

    document.write('<hr id="pageBottom">');
    document.write('<table id="tblStdFooter" width="100%" border="0" cellspacing="0" cellpadding="0" summary="standard footer">');

    document.write('  <col id="colFootLeft" width="20%" align="left" />');
    document.write('  <col id="colFootMid" width="60%" align="center" />');
    document.write('  <col id="colFootRight" width="20%" align="right" />');

    document.write('	<tr class="borderBar">');

//==========================================================================================================================================    
//    THIS CODE IS BEING USED FOR latisys ALTHOUGH ORIGINALLY FOR SECURITYSPACE SEAL    
//    document.write('<div class="centertxt">');
//    document.write('  <!-- Begin SecuritySpace Seal HTML Code -->');
//    document.write('  <a href="http://www.securityspace.com/smysecure/sealverify.html?host=www.rmoug.org&seq=795269">');
//    document.write('		  	<img src="images/securityspacesealimg.gif" alt="SecuritySpace Audited Web Site" height="64" width="98" />');
//    document.write('  </a>');
//    document.write('  <!-- End SecuritySpace Seal HTML Code --></div>');
//===========================================================================================================================================
//document.write('<div class="centertxt">');
//document.write('<!-- Begin latisys HTML Code -->');
//document.write('<a href="http://www.latisys.com/">');
//document.write(' </td>');
//document.write('<img src="latisys.jpg" alt="latisys" height="100" width="300" /><br />managed //hosting | colocation solutions | managed services</a><br />');
//document.write('<!-- End latisys HTML Code --></div>');
//document.write('  <!-- End latisys HTML Code --></div>');

    document.write('	  <td align="left"><a href="legal.htm" class="footNav"><strong>Legal Disclaimer</strong></a></td>');
    document.write('	  <td align="center" class="copyright">Copyright &copy; 2009 RMOUG');
    document.write('	  </td>');
    document.write('	  <td align="right" valign="middle" rowspan="2">');
    document.write('	  	<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.rmoug.org/rmoug.css">');
    document.write('		  	<img src="images/vcss.png" alt="Valid CSS!" height="31" width="88" />');
    document.write('	  	</a>');
    document.write('	  	<a href="http://validator.w3.org/check/referer">');
    document.write('		  	<img src="images/valid-xhtml10.png" alt="Valid XHTML 1.0!" height="31" width="88" />');
    document.write('	  	</a>');
    document.write('		</td>');
    document.write('  </tr>');

    
    
    document.write('	<tr class="borderBar">');
    document.write('	  <td align="left"><a href="contact.htm" class="footNav"><strong>Contact Us!</strong></a></td>');
    document.write('	  <td align="center"><script type="text/javascript">print_last_mod();</script></td>');
    document.write('	  </td>');
    document.write('  </tr>');
    document.write('</table>');
    document.write('<div class="centertxt"><script type="text/javascript">webmaster();</script></div>');
}



//===================================================================================================
// Function for displaying RMOUG footer to a web page without the top of page function.  Please note
// this uses the XHTML 1.1 validation icon so validate to 1.1 before using this.  This should
// be used in conjunction with the header without the page bottom function.   rjb 12/12/03
//===================================================================================================
function footer_no_up()
{
    document.write('<br /><div align="left">');

    document.write('<hr>');

    document.write('<table id="tblStdFooter" width="100%" border="0" cellspacing="0" cellpadding="0" summary="standard footer">');

    document.write('  <col id="colFootLeft" width="20%" align="left" />');
    document.write('  <col id="colFootMid" width="60%" align="center" />');
    document.write('  <col id="colFootRight" width="20%" align="right" />');

    document.write('	<tr class="borderBar">');
    document.write('	  <td align="left"><a href="legal.htm" class="footNav"><strong>Legal Disclaimer</strong></a></td>');
    document.write('	  <td align="center" class="copyright">Copyright &copy; 2009 RMOUG');
    document.write('	  </td>');
    document.write('	  <td align="right" valign="middle" rowspan="2">');
    document.write('	  	<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.rmoug.org/rmoug.css">');
    document.write('		  	<img src="images/vcss.png" alt="Valid CSS!" height="31" width="88" />');
    document.write('	  	</a>');
    document.write('	  	<a href="http://validator.w3.org/check/referer">');
    document.write('		  	<img src="images/valid-xhtml11.png" alt="Valid XHTML 1.1!" height="31" width="88" />');
    document.write('	  	</a>');
    document.write('		</td>');
    document.write('  </tr>');

    document.write('	<tr class="borderBar">');
    document.write('	  <td align="left"><a href="contact.htm" class="footNav"><strong>Contact Us!</strong></a></td>');
    document.write('	  <td align="center"><script type="text/javascript">print_last_mod();</script></td>');
    document.write('	  </td>');
    document.write('  </tr>');
    document.write('</table>');
    document.write('<div class="centertxt"><script type="text/javascript">webmaster();</script></div>');
}



//============================================================================================
// Functions to redirect to a new web page, these are always posted for use.  rjb 11/29/03
//============================================================================================
function WWWmemForm()
{
    subInf = window.open("https://dev.rmoug.org/memapplog/mem_appl.htm")
}
function URLmemForm()
{
    subInf = window.open("https://64.119.186.212/memapplog/mem_appl.htm")
}
function UATmemForm()
{
    subInf = window.open("../uat.rmoug.org/memapplog/mem_appl.htm")
}
function DEVmemForm()
{
    subInf = window.open("https://dev.rmoug.org/memapplog/mem_appl.htm")
}
function WWWmemFormout()
{
    subInf = window.open("mem_appl.htm")
}
function URLmemFormout()
{
    subInf = window.open("http://64.119.186.212/mem_appl.htm")
}
function UATmemFormout()
{
    subInf = window.open("../uat.rmoug.org/mem_appl.htm")
}
function DEVmemFormout()
{
    subInf = window.open("../dev.rmoug.org/mem_appl.htm")
}
function WWWlstsrvrinstr()
{
    subInf = window.open("list_instr.htm")
}
function URLlstsrvrinstr()
{
    subInf = window.open("http://64.119,186.212/list_instr.htm")
}
function UATlstsrvrinstr()
{
    subInf = window.open("../uat.rmoug.org/list_instr.htm")
}
function DEVlstsrvrinstr()
{
    subInf = window.open("../dev.rmoug.org/list_instr.htm")
}

//============================================================================================
// Functions to redirect to a new web page, these are posted for TD events.  rjb 11/29/03
// Commented out the first WWW function and added a new one pointing to the registration
// page that YCC put together for 2004 TD conference.  Also added in the fax
// registration secured page redirection.   rjb 12/19/03
//============================================================================================

// Added the survey link to validate the index.html page.  RJB 2/26/06
function WWWtdsurveyForm()
{
     subInf = window.open("http://www.prairiesystemsgroup.com/pls/caat/caat_process_survey.main?conference_id=8&survey_id=3")
}
function WWWtdabsForm()
{
    subInf = window.open("http://www.prairiesystemsgroup.com/pls/caat/caat_menu.rmoug_abstracts")
}
function FAXtdForm()
{
      subInf = window.open("https://www.rmoug.org/td_reg_fax.htm")
}
function WWWtdForm()
{
    subInf = window.open("https://www.teamycc.com/ssl/rmoug2005/registration.asp")
}
function URLtdabsForm()
{
    subInf = window.open("https://128.121.78.61/td2004_abs_subm.htm")
}
function UATtdabsForm()
{
    subInf = window.open("../uat.rmoug.org/td2004_abs_subm.htm")
}
function DEVtdabsForm()
{
    subInf = window.open("../dev.rmoug.org/td2004_abs_subm.htm")
}
function WWWtdAbsOvrForm()
{
    subInf = window.open("td2004_abs_over.htm")
}
function URLtdAbsOvrForm()
{
    subInf = window.open("http://128.121.78.61/td2004_abs_over.htm")
}
function UATtdAbsOvrForm()
{
    subInf = window.open("../uat.rmoug.org/td2004_abs_over.htm")
}
function DEVtdAbsOvrForm()
{
    subInf = window.open("../dev.rmoug.org/td2004_abs_over.htm")
}
function WWWtdPhoto()
{
    subInf = window.open("webalbum/index.htm")
}
function URLtdPhoto()
{
    subInf = window.open("http://128.121.78.61/webalbum/index.htm")
}
function UATtdPhoto()
{
    subInf = window.open("../uat.rmoug.org/webalbum/index.htm")
}
function DEVtdPhoto()
{
    subInf = window.open("../dev.rmoug.org/webalbum/index.htm")
}

function TDWebAlbum05()
{
   subInf = window.open("http://"+ window.location.host+"/webalbum05/index.html")
   /* subInf = window.confirm("http://"+ window.location.host+"/webalbum05/index.html") */
   
}

function TDYear()
{
    document.write(' 2005 ');
}
function TDPriorYear()
{
    document.write(' 2004 ');
}
function TDDays()
{
    document.write(' 9-10 ');
}
function isNotInteger(inputstr)
{
/* This procedure returns true if the input is not an integer */
   for (var i = 0; i < inputstr.length; i++)
   {
      var onechar = inputstr.substr(i, 1);
      if (onechar < "0" || onechar > "9")
      {
         return true;
      }
   }
   return false;
}

function checkvalue()
{
/* This procedure does the validation for the credit cards */

   var form = document.forms[0]
   var CredLen = form.CreditCard.value
   var expDate = form.ExpDate.value;

   for (var i=0; i < form.PaymentMethod.length; i++)
   {
      if (form.PaymentMethod[i].checked)
      {
         card_type = form.PaymentMethod[i].value;
         break;
      }
   }
   if ((card_type == "PO") && (document.forms[0].PONumber.value == ""))
   {
      alert("Purchase order number is required if PO payment is chosen");
      return(true);
   }
   i = 0
   if ((card_type == "Visa") || (card_type == "Mastercard"))
   {
      if ((expDate == ""))
      {
         alert("The expiration month and year are required for credit cards");
         return true;
      }
      if (isNotInteger(document.forms[0].CreditCard.value))
      {
         alert("Credit Card must be all numbers");
         return true;
      }
      if ((CredLen.substr(i,1) != "4") && (card_type == "Visa"))
      {
         alert("Visa Cards must begin with a 4 ");
         return true;
      }
      if ((CredLen.substr(i,1) != "5") && (card_type == "Mastercard"))
      {
         alert("Mastercard must begin with a 5 ");
         return true;
      }
      if (CredLen.length < 16)
      {
         alert("Credit card number needs to be 16 long without any dashes ");
         return true;
      }
      if (document.forms[0].Cardholder.value == "")
      {
         alert("The cardholder name is required for credit card payment")
         return true;
      }
      if (expDate.length != "5")
      {
         alert("Expiration Date needs to be in the form MM/YY");
         return true;
      }
      if (expDate.substr(0,1) < "0" || expDate.substr(0,1) >"9" ||
          expDate.substr(1,1) < "0" || expDate.substr(1,1) > "9" ||
          expDate.substr(3,1) < "0" || expDate.substr(3,1) > "9" ||
          expDate.substr(4,1) < "0" || expDate.substr(4,1) > "9")
      {
         alert("Expiration date needs to be valid");
         return true;
      }
      if (expDate.substr(0,1) < "0" || expDate.substr(0,1) > "1")
      {
         alert("Expiration Date needs to be a valid month");
         return true;
      }
      if (expDate.substr(3,1) > "1")
      {
         alert("Expiration Date needs to be a valid year");
         return true;
      }
      form.CreditInf.value = "XXXXXXXXXXX" + CredLen.substr(12,16);
   }
   document.forms[0].submit()
}

function publisher()
{
    document.write('Publisher: <a class="mailto" href="mailto:epsdigital@qwest.net">Laura Epstein</a>, EPS Digital&nbsp;<BR />');
    document.write('9801 S. Wallace Ct., Littleton, CO 80126&nbsp; <BR />');
    document.write('Voice: (303) 683-8322&nbsp; <br />');
    document.write('Fax: (303) 683-8323&nbsp;');
}

function adcoord()
{
    document.write('Advertising Coordinator: <a class="mailto" href="mailto:NewsletterDir@rmoug.org">Jeff Meyer</a>');
}

function editor()
{
    document.write('Editor: <a class="mailto" href="mailto:NewsletterDir@rmoug.org">Jeff Meyer</a>');
}


