// Web Javascript Utilities for 

//

//   EMail Links - EMailLink(Display,URL)

//   Off-Site Web Links - WebLink(Display,URL,Qualifier)

//   Date Stamping - DateStampWebLinks()

//   EmailMe - EmailMe(EmailAddyIndex)
//   flag_upd - flag_upd(month,day,year)
//   flag_new - flag_new(month,day,year)
//   highlite - highlite(month,day,year)
//   updated - updated(month,day,year)
//   lbw_nag - lbw_nag(level)
//

// Copyright  2008 by Stan Pope.  All rights reserved.

//
//  <script language="JavaScript" src="util.js"></script>
//  <SCRIPT LANGUAGE="JavaScript">
//
  <!--
//  // --> </script>
//
//-------------------------------------------------------------------------------------

//  Site Variable
//
   var HostLocation = "http://www.stanpope.net"
//-------------------------------------------------------------------------------------

document.writeln('<link rel="icon" type="image/ico" href="'+HostLocation+'/favicon.ico">');

//-------------------------------------------------------------------------------------

var WebLinksDateStamp = "1/13/2007";



function DateStampWebLinks()

{

//  alert('<BR><BR>Web Links updated/verified: '+WebLinksDateStamp);

  document.writeln('<BR><BR>Web Links updated/verified: '+WebLinksDateStamp);

}


//-------------------------------------------------------------------------------------


// Referenced Web Site URL's:


var CoryYoungSite = "http://members.cox.net/pinehead/";

//var CoryYoungSite = "http://www.geocities.com/Yosemite/Rapids/7146/";

var StearnsSite = "http://www.wtrfrd.com/pack339/";

// The wtrfrd site contains files: 339stern.htm, downloads.htm, 339pine.htm, 
//var StearnsSite = "http://members.aol.com/houraweek/pack339/";

var WotamaloSite = "http://wotamalo.wdboyce.org/";

var DamewoodSite = "http://www.golden-knots.com/";

var GoldenKnots = "http://www.golden-knots.com/";

//var StanPopeAOLSite = "http://members.aol.com/stanpope/";

//var StanPope2AOLSite = "http://members.aol.com/stanpope2/";

var StanPopeSite = "http://www.stanpope.net/";



var DickBlickSite = "http://dickblick.com/";
var StanPopeMediaPlay = "mms://205.178.152.128/38788/"

function WebLink(Display,URL,Qualifier)

{

// alert('<A HREF="'+URL+'"');

 document.write('<A HREF="'+URL+'"');

//	<A HREF="http://members.aol.com/houraweek/pack339/339pine2.html">"Running a Better Pinewood Derby"</A>

 if (Qualifier != "") 
 
 {

//   alert(' '+Qualifier);

   document.write(' '+Qualifier);

 }

// alert('>'+Display+'</A>');

 document.writeln('>'+Display+'</A>');

 return;
}



//-------------------------------------------------------------------------------------


// Referenced email addys:


var BillDunnEMail = "bill@wtrfrd.com";

// var BillDunnEMail = "houraweek@aol.com";

var CoryYoungEMail = "cory_young@yahoo.com";
var StanPope = "stan@stanpope.net";
var GaryTalkenEMail = "gary.r.talken@boeing.com";
var DavidFenglerEMail = "d.fengler@worldnet.att.net";
var AndyHolzerEMail = "ah8tk@hotmail.com";

var ClarkTraceyEMail = "clark.tracey@juno.com";
var BobBargaEMail = "Bsbarga@wmconnect.com";
var LesDonohoEMail = "lesorkim@charter.net";
var BrianEMail = "Irban@aol.com";
var MichaelEMail = "cnbmoehl@erols.com";



function EMailLink(Display,URL)

{

// alert('<A HREF="mailto:'+URL+'">'+Display+'</A>');

 document.writeln('<A HREF="mailto:'+URL+'">'+Display+'</A>');

//	<A HREF="mailto:houraweek@aol.com">Bill Dunn's</A>

 return;
}


//-------------------------------------------------------------------------------------

//   EmailMe - EmailMe(EmailAddyIndex)
function EmailMe(EmailAddyIndex)
{
 var addy1a = "stan";
 var addy2a = "pinewood";
 var addy1b = "stanpope.net";
 var addydef = "def"+"@"+addy1b;
 var addy;
 
 if (EmailAddyIndex == 1) 
 {
   addy = addy1a+"@"+addy1b;
 } 
 else
 {
   if (EmailAddyIndex == 2) 
   {
     addy = addy2a+"@"+addy1b;
   }
   else
   {
     addy = addydef;
   }
 }
// alert(addy);
var path=location.pathname
//alert("path="+path);
 document.writeln('<HR> <A HREF="index.html">Go Back Home!</A><BR><BR><A HREF="mailto:'+addy+'?SUBJECT=Web Page '+path+'"><IMG SRC="mailbox.jpg" ALT="E-Mail Stan" ALIGN="BOTTOM" WIDTH="32" HEIGHT="32"> <I>Feedback / Email Stan!</I></A>');
 document.writeln('<P>Comments, both positive and negative, are always welcome and, unless they are rude or crude or look like a spam mailing, will almost always be answered.<BR>')
// document.writeln('<P>If you notice a bad link or a missing graphic, please use the //email link above to tell me about it.  I have recently (October 2008) completed a mass //move of the site to its new home, and I would like to get the site as clean as //possible.<BR>');
 return;
}
//-------------------------------------------------------------------------------------

//  Variables for flag_upd, flag_new, highlite, updated functions:
//
var dnow = new Date();
var dnowm=dnow.getTime();
var days7=1000*60*60*24*7;
var days31=1000*60*60*24*31;
var years3=3*365*1000*60*60*24
//
//-------------------------------------------------------------------------------------

//   flag  if recently added, recently updated, or not at least reviewed during past 3 years.

function flag(fcn,month,day,year)
{
// fcn: "N" New, "U" Updated, "R" Reviewed
// month,day,year when activity occurred.
// Today - activity date is 
//  less than 31 days
//    fcn="N": output the "New" graphic.
//    fcn="U": output the "Updated" graphic.
//  more than 3 years
//    fcn=any: output the "Old" graphic.
 var chg = new Date(year,month-1,day);
 var chgm=chg.getTime();
 if (chgm+days31 > dnowm)
   {
   if (fcn == "N")
      document.write('<img src="new2.gif" border=0 hspace=3 width=31 height=20 alt="New ' +month+'/'+day+'/'+year+'">');
   else if (fcn == "U")
     document.write('<img src="update.gif" border=0 hspace=3 width=47 height=22 alt="UPDATED ' +month+'/'+day+'/'+year+'">');
   }
 if (chgm+years3 < dnowm)
   {
   if (fcn == "N")
    document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="Added  '+month+'/'+day+'/'+year+'">');
   else if (fcn == "U")
    document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="Last updated ' +month+'/'+day+'/'+year+'">');
   else if (fcn == "R")
    document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="Last reviewed ' +month+'/'+day+'/'+year+'">');
   }
 return;
}
//
//-------------------------------------------------------------------------------------

//   flag_upd

function flag_upd(month,day,year)
{
// month,day,year when change made.
// for the next 31 days, output the "UPDATED" graphic
// after that, output nothing.
 var chg = new Date(year,month-1,day);
 var chgm=chg.getTime();
 if (chgm+days31 > dnowm)
   document.write('<img src="update.gif" border=0 hspace=3 width=47 height=22 alt="UPDATED '+month+'/'+day+'/'+year+'">');
 if (chgm+years3 < dnowm)
   document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="OLD '+month+'/'+day+'/'+year+'">');
 return;
}
//-------------------------------------------------------------------------------------

//   flag_new
//
function flag_new(month,day,year)
{
// month,day,year when change made.
// for the next 7 days, output the "new" graphic
// after that, for the next 24 days, output the "recent" graphic
// after that, output nothing.
 var chg = new Date(year,month-1,day);
 var chgm=chg.getTime();
 if (chgm+days31 > dnowm)
  if (chgm+days7 > dnowm)
   document.write('<img src="new1.gif" border=0 hspace=3 width=31 height=20 alt="NEW '+month+'/'+day+'/'+year+'">');
  else
   document.write('<img src="new2.gif" border=0 hspace=3 width=31 height=20 alt="RECENT '+month+'/'+day+'/'+year+'">');
 if (chgm+years3 < dnowm)
   document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="OLD '+month+'/'+day+'/'+year+'">');
 return;
}
//-------------------------------------------------------------------------------------

//   highlite
//
function highlite(month,day,year)
{
// month,day,year when change made.
// for the next 7 days, output the "new" graphic
// after that, for the next 24 days, output the "recent" graphic
// after that, output nothing.
 var chg = new Date(year,month-1,day);
 var chgm=chg.getTime();
 if (chgm+days31 > dnowm)
  if (chgm+days7 > dnowm)
   document.write('<img src="new1.gif" border=0 hspace=3 width=31 height=20 alt="NEW '+month+'/'+day+'/'+year+'">');
  else
   document.write('<img src="new2.gif" border=0 hspace=3 width=31 height=20 alt="RECENT '+month+'/'+day+'/'+year+'">');
 if (chgm+years3 < dnowm)
   document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="OLD '+month+'/'+day+'/'+year+'">');
 return;
}

//-------------------------------------------------------------------------------------

//   updated
//
function updated(month,day,year)
{
// month,day,year when change made.
// for the next 31 days, output the "update" graphic
// after that, output nothing.
 var chg = new Date(year,month-1,day);
 var chgm=chg.getTime();
 if (chgm+days31 > dnowm)
   document.write('<img src="update.gif" border=0 hspace=3 width=47 height=22 alt="Updated '+month+'/'+day+'/'+year+'">');
 if (chgm+years3 < dnowm)
   document.write('<img src="old.gif" border=0 hspace=3 width=16 height=20 alt="OLD '+month+'/'+day+'/'+year+'">');
 return;
}
//-------------------------------------------------------------------------------------

//   lbw_nag
//
function lbw_nag(level)
{
 document.writeln('<P ALIGN="CENTER">A <A HREF="lbw_apl.htm">one-time donation</A> to W.D. Boyce Council Friends of Scouting campaign is requested for using this book.<HR>');
// document.writeln('<P ALIGN="CENTER"><A HREF="lbw_apl.htm">A Scout is Trustworthy. -- Have you sent your check to W.D. Boyce Council, BSA, 614 N.E. Madison, Peoria, IL 61603?</A><HR>');
 return;
}
//-------------------------------------------------------------------------------------


