<!--

rxEmail = /^\w[-.\w]*\@[-a-b0-9]+(?:\.[-a-b0-9]+)*\.(?:com|edu|biz|org|gov|int|info|mil|net|name|museum|coop|aero|[a-z][a-z])\b/;

// Convert to lower case before testing.

//  rxEmail.test(email.toLowerCase());

//  time zone globals

   var fileScript = true;  //  show script read
   var openBase = 16;      //  base time for open
   var closeBase = 28;     //  base time for close
   var sfGMToffset = 8;    //  8 San Francisco offset from GMT
   var now = new Date();
   var offset = now.getTimezoneOffset()/60;
   var openTime = openBase - offset ;
   var closeTime = closeBase - offset ;
   var sh = openTime;
   var ch = closeTime;
   var time1 = "";
   var time2 = "";

    if ( openTime < 0 ) { openTime = openTime + 24; }
    if ( closeTime < 0 ) { closeTime = close + 24; }
    if ( openTime >= 24 ) { openTime = openTime - 24; }
    if ( closeTime >= 24 ) { closeTime = closeTime - 24; }
    if (sh > 12) { sh = sh - 12; }
      time1 = sh; // do type casting on start hour
    if (openTime < 12) { time1 = time1 + ":00 AM "; }
    if (openTime >= 12) { time1 = time1 + ":00 PM "; }
    if (openTime == 0) { time1 = " Midnight "; }
    if (openTime == 12) { time1 = " Noon "; }
    if (ch > 12) { ch = ch - 12; }
      time2 = ch; // do type casting on close hour
    if (closeTime < 12) { time2 = time2 + ":00 AM "; }
    if (closeTime >= 12) { time2 = time2 + ":00 PM "; }
    if (closeTime == 0) { time2 = " Midnight "; }
    if (closeTime == 12) { time2 = " Noon "; }

function showLocal() {
  if (canShine) { 
 if (offset != sfGMToffset) { // if user's offset not pacific time
   document.writeln(", which is from " + time1);
   document.writeln("to " + time2);
   document.write("your local time,");
       } // endif (offset != sfGMToffset)
     else {
   document.writeln(", which is also your local time, ");
       } // end else
  } // endif canShine
} // end function


// dynamic HTML code
//  dynamic HTML globals
//  test for advanced browsers
    var canShine = false;
    var canDynamic = false;

    var ns4 = false;
    var ns6 = false;
    var ie4 = false;
    var ie5 = false;
      if (document.layers) { ns4 = true; }
      if (document.all) { ie4 = true; }
      if (document.getElementById && !document.all) { ns6 = true; }
      if (document.getElementById && document.all) { ie5 = true; }
//      if (document.getElementById && document.body.style) { ns6 = true; }

// Test for specific Netscape and MSIE browsers
// Probably should change this to simply if (document.images)
   if ( ( (navigator.appName == "Netscape") || (navigator.appName.substring(0, 9) == "Microsoft") )  &&
                 (parseFloat(navigator.appVersion) >= 4) )
            { canShine = true; }

// Test for Dynamic HTML browsers
   if ((ns4) || (ie5) || (ns6)) { canDynamic = true; }


 function shine(fname, iname)  {
     if (canShine == true)  { document.images[iname].src=fname; } 
        }

 function unshine(fname, iname)  {
     if (canShine == true)  { document.images[iname].src=fname; }
        }


//  EMail address link support code

reason = "";
myAddress = "rick@rainbo.net";

function nameLink() {
    document.writeln("<a href=\"mailto:" + myAddress + "\">" + myAddress + "</a>");
   }  // end nameLinke

function mailLink() {
    document.writeln("<a href=\"mailto:" + myAddress + "\">\n");
    document.writeln("<img src=\"http://www.inpacifica.com/images/anibox5.gif\" width=\"80\" height=\"32\" " +
                     "alt=\"mailbox icon\" title=\"EMail to in Pacifica.com\" align=\"left\" border=\"0\" />\n");
    document.writeln("Comments or Questions?<br />\n" +
                     myAddress + "  Richard L. Trethewey</a>");
  } // end mailLink


 function zoomLink(thumb, tWidth, tHeight, bigPict, bigWidth, bigHeight) {
  zRef = "<a href=\"javascript:popZoom('" + bigPict + "', " +
    bigWidth + ", " + bigHeight + ")\">";
   document.write(zRef + "<img src=\"" + thumb + "\" " +
        "width=\"" + tWidth + "\" height=\"" + tHeight + "\" " +
        "ALT=\"Click Here to see a larger image\" title=\"Click Here to see a larger image\"><br>\n");
    document.write("<img src=\"../pics/zoom1.gif\" width=\"80\" height=\"19\" border=\"0\" /></a>\n");
   }

    aw = 600;
    if ((ns4) || (ns6)) { aw = window.innerWidth; }
//    if (ie4) { aw = document.body.clientWidth; }
    if (ie4) { aw = screen.availWidth; }

 function popZoom(pictURL, pWidth, pHeight) {
  var sWidth = 640;
   if ((ns4) || (ie4) || (ns6)) { sWidth = screen.availWidth; }
  var x1 = pWidth+30;
  var y1 = pHeight+30;
  var pZoomStr = "height=" + y1 + ",width=" + x1 + ",left=" + ((sWidth-x1)/2) +
      ",top=60,scrollbars=0,menubar=0";
    pZoom = window.open("","", pZoomStr);
    pZoom.document.open();
    pZoom.document.writeln("<html><head><title>Rainbo: Zoom View of " + pictURL + "></title></head><body bgcolor=\"skyblue\"" +
      " onBlur='self.close();'>");
    pZoom.document.writeln("<img src=\"" + pictURL + "\" width=\"" +
     pWidth + "\" height=\"" + pHeight + "\">");
    pZoom.document.writeln("</body></html>");
    pZoom.document.close();

 } // end popZoom

 function popHelp() {
  var sHeight = 400;
//   if (ns4) { sHeight = window.innerHeight; }
   if ((ns4) || (ie4) || (ns6)) { sHeight = screen.availHeight; }
  var pZoomStr = "height=" + (sHeight-50) + ",width=450,left=40,top=60,scrollbars=1,menubar=1";
    pZoom = window.open("http://www.rainbo.net/help.htm","", pZoomStr);

 } // end popHelp

// cookies library

var db = (ie4) ? 1 : 0;                  // test for MSIE (was document.body)
var hasCookies = false;                  // global cookies flag

function canCookie(temp) {
    setCookie("test", "1");
    temp = getCookie("test");
    if (temp != null) {
        hasCookies = true;
        deleteCookie("test");
       }  else { 
    hasCookies = false; } // endIf
   return hasCookies;
 } // end canCookie


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name) {
  var exp = new Date();
  exp.setTime(exp.getTime() - 1);  // this cookie is history!
  var cval = getCookie(name);
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
 } // end deleteCookie

 function getDomain() {
  var dName = unescape(document.location);
  var len = dName.length;
  var start = dName.indexOf("/");  // find the first forward slash
   for (i = start; i <= len; i++) {
      if (dName.substring(i, i+1) != "/") { break; }
     }
  if (i == len) { return null }
  dName = dName.substring(i, dName.lastIndexOf("/"));
  dot = dName.lastIndexOf(".");
  if (dot == -1) { return null; }
  dType = dName.substring(dot, dName.length);
  if ((dType != ".com") && (dType != ".net")) { return null }
 return dName;
 } // end getDomain


 function getDocName() { 
  var loc = "";
   loc = unescape(document.location); // our current location
   lloc = loc.length;  // string length
   slashIndex = 0;  // index of slash
  for (i=lloc; i>0; i--) {
    c = loc.substring(i-1,i);
     if ((c == "/") || (c == "\\")) { 
            slashIndex = i; 
            break;
          } // endIf
     }  // end for
   return loc.substring(slashIndex, lloc);
   }  // end getDocName

// scroll position save support

var scroll = (window.scrollTo) ? 1 : 0;  // window scrolling available flag

function saveScroll(thePage) {
  if (!scroll) return;
  var db = false;
  if (ie4) { db = true; } 
  var now = new Date();
  pageName = "";
  if (thePage == null) 
  {  pageName = getDocName(); }
    else
  {  pageName = thePage; 
     i = pageName.indexOf("/", 0);
     k = pageName.length;
     pageName = pageName.substring(i, k); }
  var i = pageName.indexOf(".", 0);
  pageName = pageName.substring(0, i);
  now.setTime(now.getTime() + 1 * 24 * 60 * 60 * 1000);  // expires in 1 day
  var x = (db) ? document.body.scrollLeft : window.pageXOffset;
  var y = (db) ? document.body.scrollTop : window.pageYOffset;
  setCookie(pageName + "xy", x + "_" + y, now);
}


function loadScroll(thePage) {
  var pageName = "";
  if (!scroll) return;
  if (thePage == null) 
  {  pageName = getDocName(); }
    else
  {  pageName = thePage; 
     i = pageName.indexOf("/", 0);
     k = pageName.length;
     pageName = pageName.substring(i, k);  }
  i = pageName.indexOf(".", 0);
  pageName = pageName.substring(0, i);
  var xy = getCookie(pageName + "xy");
  if (!xy) { return; }
  var ar = xy.split("_");
  if (ar.length == 2) scrollTo(parseInt(ar[0]), parseInt(ar[1]));
}

  var reason = "Invalid or Misspelled EMail Address";

 function checkEMail(userEMail)  {
   var sendMail = false;
   var hasUserName = false;
   var hasAtSign = false;
   var hasDomain = false;
   var l = userEMail.length;
   var atIndex = 0;
   userEMail = userEMail.toLowerCase();

if ( l >= 5)  { //1
  atIndex = userEMail.indexOf("@",0);

 if (atIndex == -1) {  reason = "No \"@\" character in EMail Address";  }
        else { hasAtSign = true; }
 if (hasAtSign) {
   if (atIndex == 0) { reason = "No User Name Before \"@\" character"; }
        else { hasUserName = true; }
 }

 if (hasUserName) {
   domain = userEMail.substring(atIndex+1,l);  // isolate domain name
   dotIndex = domain.indexOf(".",0);
     if ((dotIndex == -1) || (dotIndex == 0) || (dotIndex == (domain.length-1)))  { 
        reason = "Missing or Improper Domain Name After \"@\" character"; }
            else
     { hasDomain = true; }
   }  // if (hasUserName)
  }  // if ( l>= 5)

    if (hasDomain) { sendMail = true; }

    if (userEMail.indexOf(" ",0) != -1) {
       sendMail = false;
       reason = "Blank Space Entered in EMail Address"; }

    if (sendMail) { reason = "OK"; }

   return sendMail;

  }  // end checkEMail


//
// anti image leeching code
//

var cMessage="The images and information on these pages are the copyright\n\n" +
 "property Of Rainbo Animation Art and other Copyright holders"; 

// document.onmousedown=grabClick; 

function grabClick(e) { 
   if (ie4) { 
     if (event.button == 2) { 
        alert(cMessage); 
    return false; 
      } 
  } 
    if (ns4 || ns6) {
      if (e.which == 3) { 
     alert(cMessage); 
   return false; 
    } 
   } 
 } 
    if (ns4 || ns6) { 
   document.captureEvents(Event.MOUSEDOWN); 
  } 


//
//  common links generators
//

 function thumbLink (bigPict, smallPict, theWidth, theHeight) {
   document.write("<a href=\"" + bigPict + "\" target=\"_blank\">");
   document.writeln("<img src=\"" + smallPict + "\" width=\"" + theWidth +
    "\" height=\"" + theHeight + "\" alt=\"Click here to see a Larger View\" title=\"Click here to see a Larger View\" align=\"left\" /></a>");
 } // end thumbLink


 function leBanner(pageNo) {
 document.writeln("<!-- BEGIN LINKEXCHANGE CODE -->");
 document.writeln("<center><iframe src=\"http://leader.linkexchange.com/" + pageNo +"/X856322/showiframe?\" width=\"468\" height=\"60\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" scrolling=\"no\">");
 document.writeln("<a href=\"http://leader.linkexchange.com/" + pageNo +"/X856322/clickle\" target=\"_top\"><img width=\"468\" height=\"60\" border=\"0\" ismap alt=\"\" src=\"http://leader.linkexchange.com/" + pageNo +"/X856322/showle?\" /></a></iframe><br><a href=\"http://leader.linkexchange.com/" + pageNo +"/X856322/clicklogo\" target=\"_top\"><img src=\"http://leader.linkexchange.com/" + pageNo +"/X856322/showlogo?\" width=\"468\" height=\"16\" border=\"0\" ismap=\"ismap\" alt=\"\" /></a><br></center>");
 document.writeln("<!-- END LINKEXCHANGE CODE -->");
 } // end leBanner

//
// navBox support code
navBTop = 0;
navBLeft = 0;
navBWidth = 0;
navBHeight = 0;
interval_id = 0;
sBarWidth = 18;

 function initNavBox() {

       if (document.body) {
         sLeft = document.body.scrollLeft;
         sTop = document.body.scrollTop;
       } else if (document.layers) {
         sLeft = window.pageXOffset;
         sTop = window.pageYOffset;
        }

   if (document.getElementById) {
     wWidth = window.document.body.clientWidth;
     wHeight = window.document.body.clientHeight;
     theElement = document.getElementById("navBox");
     navBWidth = parseInt(theElement.style.width);
     navBHeight = parseInt(theElement.style.height);
    navBLeft = wWidth - navBWidth;
    navBTop = wHeight - navBWidth;
     theElement.style.left = navBLeft;
     theElement.style.top = navBTop;
    } 

   if (document.layers) { // nav4 support
     wWidth = window.innerWidth - sBarWidth;
     wHeight = window.innerHeight;
     theElement = document.layers["navBox"];
     navBWidth = this.theElement.clip.width;
     navBHeight = this.theElement.clip.height;
    navBLeft = wWidth - navBWidth;
    navBTop = wHeight - navBHeight;
     theElement.left = navBLeft;
     theElement.top = navBTop;
// alert("navBLeft = " + navBLeft + "\n\nnavBTop = " + navBTop + "\n\n");
    }  // end if ns4

     interval_id = window.setInterval("updateNavBox()", 500);

  } // end initNavBox


 function updateNavBox() {

       if (document.body) {
     wWidth = window.document.body.clientWidth;
     wHeight = window.document.body.clientHeight;
         sLeft = document.body.scrollLeft;
         sTop = document.body.scrollTop;
       } else if (document.layers) {
     wWidth = window.innerWidth - sBarWidth;
     wHeight = window.innerHeight;
         sLeft = window.pageXOffset;
         sTop = window.pageYOffset;
        }

  if (document.getElementById) {
     theElement = document.getElementById("navBox");
    newBLeft = wWidth + sLeft - navBWidth;
    newBTop = wHeight + sTop - navBHeight;
      if ((newBLeft != navBLeft) || (newBTop != navBTop)) {
     navBLeft = newBLeft;
     navBTop = newBTop;
     theElement.style.left = navBLeft;
     theElement.style.top = navBTop;
    } // endif newBLeft || newBTop
  } else if (document.layers) {
      theElement = document.layers["navBox"];
      // theElement = document.navBox;
      // theElement = document.layers[0];
//     navBWidth = this.theElement.clip.width;
//     navBHeight = this.theElement.clip.height;
    newBLeft = wWidth + sLeft - navBWidth;
    newBTop = wHeight + sTop - navBHeight;
      if ((newBLeft != navBLeft) || (newBTop != navBTop)) {
     navBLeft = newBLeft;
     navBTop = newBTop;
     theElement.left = navBLeft;
     theElement.top = navBTop;
// alert("navBLeft = " + navBLeft + "\n\nnavBTop = " + navBTop + "\n\n");
    } // endif newBLeft || newBTop
   } // endif (document.layers) 

  } // end updateNavBox

 function killNavBox() {
//     if (document.getElementById) {
    window.clearInterval(interval_id);
//     } // endif
  } // end killNavBox

// end navBox support code


//
// DHTML support code - including animation
//

// var bName = navigator.appName;
// var bVer = parseFloat(navigator.appVersion);
// var NS4 = (bName == "Netscape" && bVer >= 4);
// var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);

function display(id, str) {
  if (canDynamic) { // if browser supports style sheets
    if (document.layers) { // if Navigator 4.0+
      with (document[id].document) {
        open(); // open document
        write(str); // write to document
        close(); // close document
      } // end with
    } else if (document.getElementById) { // Internet Explorer 5.x or ns6+
      document.getElementById(id).innerHTML = str; // "assign" to element
    } // end else
  } // end if(ns4 || ie4)
} // end display

function swapClass(text, spName, urlName, oldName, clName, over) {
  if (bVer < 4) { // old browser
    return; // terminate the function
  }  

  // create a new string for the link
  // change the link's class to clName (it was oldName before)
  var str = "<a class='" + clName + "' href='" + urlName + "'";
  if (over) {
    // replace onMouseOver with onMouseOut
    // replace true with false
    str += " onMouseOut=\"swapClass(\'" + text + "\', \'" + spName +
           "\', \'" + urlName + "\', \'" + clName +
           "\', \'" + oldName + "\', false)\">";
  } else {
    // replace onMouseOut with onMouseOver
    // replace false with true
    str += " onMouseOver=\"swapClass(\'" + text + "\', \'" + spName +
           "\', \'" + urlName + "\', \'" + clName +
           "\', \'" + oldName + "\', true)\">";
  }
  str += text + "</a>";
  display(spName, str); // update the code
}



