//<SCRIPT LANGUAGE="JavaScript" SRC="JsrCode.js">
// all code is proprietary to JSR Systems--Copyright 2000-2001, All Rights Reserved
// level of code: 2001-02-02 fix "/n" error in putAllLI function.  
// *---------------------------------------------------------------* //
var net4X = false; // can further refine net4X level later
var netScape = false;
if (navigator.appName == "Netscape")
{
    netScape = true;
    if (navigator.appVersion < "5") 
        net4X = true;
}

    srcOK=true;    // this will be set IFF src works
var   bOut="#00FFDF"; // linkButton  MouseOut color 00ffff pale blue
var  bOver="#FFAF75"; // linkButton MouseOver color
      bOut="#e0e0ff";
     bOver="#ffe0ff";
       bTD="#eecc80"; // td bgcolor=
       
// 2001-02-10 set HTTPS for fixLink code...
var HTTPS = false;
if (document.URL.substring(0,8) == "https://") HTTPS = true;
       
var lastSlash =                document.URL.lastIndexOf('/');
if (lastSlash < 7) lastSlash = document.URL.lastIndexOf('\\');
//alert ("lastSlash="+lastSlash+" "+document.URL);
pageName  = document.URL.substring(1+lastSlash);
lastSlash =                    document.referrer.lastIndexOf('/');
if (lastSlash < 7) lastSlash = document.referrer.lastIndexOf('\\');
parentName= document.referrer.substring(1+lastSlash);
if (parentName == "") parentName = "index.html";
if (  pageName == "")   pageName = "index.html";
//alert("Parent/Page Name: "+parentName+"/"+pageName+"-"+lastSlash);

function putLast()
{ 
var days = new Array(" ",
"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array(" ",
"January","February","March","April","May","June",
"July","August","September","October","November","December");
var dateObj = new Date(document.lastModified);
var wday    = days[dateObj.getDay() + 1];
if (navigator.appName == "Microsoft Internet Explorer" &&
    navigator.appVersion < "4.0 (compatible; MSIE 5.01; Windows 98)")
    var wday = days[dateObj.getDay()];
var lmonth  = months[dateObj.getMonth() + 1];
var date    = dateObj.getDate();
var fyear   = dateObj.getYear();
if (fyear > 99 && fyear < 2000) fyear += 1900;
if (fyear               < 2000) fyear += 2000; // fix two digit year
document.write('<I><SPAN CLASS="xsmall">Last Updated: ' + 
                wday + ", " + lmonth + " " + date + ", " + fyear +
               //"<BR>Debug="+dateObj+"<BR>/dow="+dateObj.getDay()+
               //"/m#="+dateObj.getMonth()+ "/yr="+dateObj.getYear()+"."+
               "</SPAN></I><BR>");
}

function isEmailValid(formName,elemName)
{
var emailOk  = true
var temp     = document.forms[formName].elements[elemName]
var atSym    = temp.value.indexOf('@')
var period   = temp.value.lastIndexOf('.')
var space    = temp.value.indexOf(' ')
var length   = temp.value.length - 1

if ((atSym < 1) ||
    (period <= atSym+1) ||
    (period == length ) ||
    (space  != -1))
   {  
      emailOk= false;
      alert('PLEASE ENTER A VALID E-MAIL ADDRESS!');
      temp.focus();
   }
return emailOk;
}

function isDateValid(formName,elemName)
{
var dateOk  = true;
var temp    = document.forms[formName].elements[elemName];
var tempVal = temp.value;

//alert('DATE='+tempVal+' len='+tempVal.length+ ' (4)='+tempVal.substring(4,5));
if ((tempVal.length          <  10) ||
    (tempVal.substring(4,5) != '-') ||
    (tempVal.substring(7,8) != '-')
   )
   {  
      dateOk= false;
      temp.focus(); 
      alert('PLEASE ENTER A VALID '+temp.name+' (yyyy-mm-dd)!');
   }
return dateOk;
}


function putTitle()
{ document.write('<SPAN CLASS="large"><B>'+ document.title + 
                 "</B></SPAN><BR>");
}

function putTitleShadow()
{ document.write('<H1><DIV ALIGN="center"        CLASS="text" STYLE="{color: white; font-style: italic}">'+ document.title + 
                 '</DIV><DIV ALIGN="center" CLASS="highlight" STYLE="{color:  gray; font-style: italic}">'+ document.title +
				 '</DIV></H1>');
}

function imgover(imgname)
{  imgname.src = arrowgif;
}
function imgout(imgname)
{  imgname.src = blankgif;
}

var linkToMod = "";
function fixLink(linkTo)
{
  if      (linkTo.substring(0,7) == "http://")
          return linkTo;
  else if (HTTPS)                              // document.URL.substring(0,8) == "https://"
          return "http://"+homeURL+"/"+linkTo; // homeURL must be set in index.js file.
  else if (thisDir == "*")
          return linkTo;                       // above lines added/modified 2001-02-10  
  else if (thisDir == linkTo.substring(0,thisDir.length))
          return linkTo.substring(thisDir.length);
  else    return "../"+linkTo;
}

function linkLine(fontSize,linkTo,linkOver,linkText,linkAfter)
{
  iPicNum++;
  linkToMod = fixLink(linkTo);
  //alert (linkTo+"-->"+linkToMod);
  document.writeln('<SPAN CLASS="'+fontSize+'"><NOBR>');
  document.writeln('<IMG NAME="picLine'+iPicNum+'"'+
                 ' SRC="'+blankgif+'" WIDTH=10 HEIGHT=10 BORDER=0>'+
                 '<A HREF="'+linkToMod+'" ');
  document.write('onMouseOver="imgover(picLine'+iPicNum+')');
  if (linkOver != '')
  {
     var statusText = "'"+linkOver+"'";
     document.write(';window.status='+statusText+';return true;');
  }
  document.write('"');
  document.write(' onMouseOut="imgout(picLine'+iPicNum+')');
  if (linkOver != '')
     document.write(';window.status='+blanks);
  document.write('">');
  document.write(linkText+'</A>');
  if (linkAfter != '') document.write("<I>"+linkAfter+"</I>");
  document.write('</NOBR>&nbsp;&nbsp;');
  document.writeln('</SPAN>');
}

function linkButton(fontSize,linkTo,linkOver,linkText,linkAfter)
{
  iPicNum++;
  linkToMod = fixLink(linkTo);
  document.write('<TABLE BORDER="4" CELLSPACING="4" CELLPADDING="2" WIDTH="100%">');
  document.write('<TR><TD ALIGN="CENTER" BGCOLOR="');

  if (parentName == linkTo || pageName == linkTo)
     document.write('white');
  else
     document.write(bOut);
  document.write('" ID="tdButton'+iPicNum+'" TITLE="'+linkOver+'">');
  document.writeln('<B><SPAN CLASS="'+fontSize+'">');
  //alert("Page Name:"+pageName+"/"+linkTo);
  if (linkTo == pageName)
  {
     //alert("Page Name:"+pageName);
     if (!net4X) document.writeln('  <SPAN STYLE="color:  black">'); 
     else        document.writeln('  <FONT COLOR="black">');
     document.writeln('  '+linkText);
     if (!net4X) document.writeln('  </SPAN>'); 
     else        document.writeln('  </FONT>');
  }
  else
  {  document.write(
                 '  <IMG NAME="picButton'+iPicNum+
                 '" SRC="'+blankgif+'" WIDTH=10 HEIGHT=10 BORDER=0>'+
                 '<A HREF="'+linkToMod+'" ');
     var statusText = "'"+linkOver+"'";
     var bApos="'"+bOver+"'";
     document.write('onMouseOver="imgover(picButton'+iPicNum+')'+
                    ';window.status='+statusText+
                    ';if (srcOK && !net4X) tdButton'+iPicNum+'.bgColor='+bApos+
                    ';return true;'+
                    '"'
                   );
     if (parentName == linkTo || pageName == linkTo)
        bApos="'white'";
     else               
        bApos="'"+bOut+"'";
     document.write('onMouseOut="imgout(picButton'+iPicNum+')'+
                    ';window.status='+blanks+
                    ';if (srcOK && !net4X) tdButton'+iPicNum+'.bgColor='+bApos+
                    ';">');
     document.writeln(linkText+'</A>');
     if (linkAfter != '') document.writeln("<I>"+linkAfter+"</I>");
  } 
  document.writeln('  </SPAN></B></TD></TR></TABLE>');


}

function putAllLines(linkArray) 
{
  var numLinks = linkArray.length / 3;
  var fontSize = 'xsmallB';  if (netScape) fontSize='smallB';
  for (var i = 0; i < numLinks; i++)
  {
    if (i == 6) document.write('<BR>');
    linkLine(fontSize,linkArray[i*3],'',linkArray[(i*3)+2],'');
  }
}

function putAllButtons(linkArray) 
{
  var numLinks = linkArray.length / 3;
  var fontSize = 'xsmallB';  if (netScape) fontSize='smallB';
  for (var i = 0; i < numLinks; i++)
    linkButton(fontSize,linkArray[i*3],linkArray[(i*3)+1],linkArray[(i*3)+2],'');
}

function putAllLI(linkArray) 
{
  var numLinks = linkArray.length / 3;
  document.write('<UL>');
  for (var i = 0; i < numLinks; i++) 
  {
    document.write('<LI>');
    linkLine('small',linkArray[i*3],linkArray[(i*3)+1],linkArray[(i*3)+2],'');
    document.writeln(' ');
  }
  document.write('</UL>');
}

function beginButton(xxxLink)
{
  //alert("beginButton invoked");
  document.write('<TABLE BORDER=0  WIDTH="100%"><TR>'+
  '<!-- begin intial "15%" table...begin15()-->'+
  '<TD ALIGN="CENTER" WIDTH="10%" VALIGN="TOP" BGCOLOR="'+bTD+'">');
   //document.write('<A HREF="index.html"><IMG SRC="images/RsoA@140.gif" WIDTH="140" HEIGHT="97" BORDER="0" ALT="RSoA.org logo"></A>');
   putAllButtons(xxxLink);
  document.write('</TD><TD>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </TD><TD VALIGN="TOP">');
                  //break first "column" intial "15%" table...begin15()
                  //2000-12-09 (add extra "column" for left margin between buttons and text)
}
function middleButton(xxxLink)  // same as rightButton, middleButton is deprecated!!!! 
{
  //alert("middleButton invoked"); // invoke just before endButton
  document.write('</TD><TD>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
  document.write('</TD><TD ALIGN="CENTER" WIDTH="10%" VALIGN="TOP" BGCOLOR="'+bTD+'">');
   putAllButtons(xxxLink);
  // will be terminated by endButton() logic
}
function rightButton(xxxLink) // same as middleButton, middleButton is deprecated!!!!
{
  //alert("rightButton invoked"); // invoke just before endButton
  document.write('</TD><TD>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
  document.write('</TD><TD ALIGN="CENTER" WIDTH="10%" VALIGN="TOP" BGCOLOR="'+bTD+'">');
   putAllButtons(xxxLink);
  // will be terminated by endButton() logic
}
function rightButton2(xxxLink, yyyLink) //2000-12-09 put new level at top!!!
{
  document.write('</TD><TD>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
  document.write('</TD><TD ALIGN="CENTER" WIDTH="10%" VALIGN="TOP" BGCOLOR="'+bTD+'">');
   putAllButtons(yyyLink);
   document.write('<HR HEIGHT="10">');
   putAllButtons(xxxLink);
  // will be terminated by endButton() logic
}
function rightButton3(xxxLink, yyyLink, zzzLink) //2000-12-09 put new level at top!!!
{
  document.write('</TD><TD>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
  document.write('</TD><TD ALIGN="CENTER" WIDTH="10%" VALIGN="TOP" BGCOLOR="'+bTD+'">');
   putAllButtons(zzzLink);
   document.write('<HR HEIGHT="10">');
   putAllButtons(yyyLink);
   document.write('<HR HEIGHT="10">');
   putAllButtons(xxxLink);
  // will be terminated by endButton() logic
}



function endButton()
{
   document.write('</TD></TR></TABLE><!--end intial "15%" table...end15()-->');
} 

// End of Included Script --></SCRIPT>