// these are multiply-used below
	portal        = "JKWW";
	hostDomain    = "jkww.rockdalenet.com";
	hostHome      = "default.htm";          // for use by main site
	hostUrl       = "../" + hostHome;       // for use by sub-sites
	hostWebmaster = "jkww@rockdalenet.com";
	hostWebPerson = "Karen Smiley Harbour";
	frameWinName  = "_top";						 // added 20020807


//---------------------------------------------------------------------------------------
// Usage: writeReferrer("dlhnursery.com");

function writeReferrer (homeStr) {

	if (document.referrer) {
		if ( document.referrer.indexOf(homeStr) < 0 ) {
			// referring page is NOT one from our 'home' site; show the referral
			document.write('<font size="1"><br><i>Thanks for visiting us from '+document.referrer+'</i></font>');
		}
	}
}

//---------------------------------------------------------------------------------------
function writeModDate () {

   document.write ('<font size="1"><i>&nbsp;Last updated:&nbsp;</i>');
	document.write (document.lastModified);
   document.write ('</font>');

}

//---------------------------------------------------------------------------------------
function writeCopy (linkText,myDomain) {

	document.write ('<a href="');
	if ( myDomain.substring(0,3) == "jkww" ) {         // home site, Shared directory is below this one
		document.write ('Shared/copyright.html');
	} else {											// subsite, Shared directory is parallel
		document.write ('./copyright.html');			// 20030225 revised KJS for standalone DLH Nursery
	}
	document.write ('" target="'+frameWinName+'">' + linkText);
	document.write ('</a>');
}

//---------------------------------------------------------------------------------------
function writeLink (linkText,linkLoc,targetFrame) {

	// does document.write (linkText.link(linkLoc)) work on mailto's? no way to do a target tho
	document.write ('<a href="' + linkLoc);
	if ( targetFrame != "" ) {
		document.write ('" target="' + targetFrame);
	}
	document.write ('">' + linkText + '</a>');
}

//---------------------------------------------------------------------------------------
function writeEmailLink (myDomain, myUrl, emailAddr) {  // emailaddr = xyz@name.com, myDomain=name.com

   linkLoc = 'mailto:' + emailAddr + '?subject=' + myDomain + '%20page%20' + myUrl;
   document.write ('<a href="' + linkLoc + '">' + emailAddr + '</a>');

}

//---------------------------------------------------------------------------------------
function writeMailtoLink (myDomain, emailAddr, mySubject) { // emailaddr = xyz, myDomain=name

	fullAddr = emailAddr + '@' + myDomain + '.com';
   linkLoc = 'mailto:' + fullAddr + '?subject=' + myDomain + '.com%20' + mySubject;
   document.write ('<a href="' + linkLoc + '">' + emailAddr + '</a>');

}

//---------------------------------------------------------------------------------------
function writePageAndDate (fullUrl,targetFrame) {

//	fullUrl=location.href;
   document.write ('<font size="1"><br><i>Page:&nbsp;&nbsp;</i>');
   writeLink (fullUrl, fullUrl, targetFrame);
   document.writeln ('</font>');

   writeModDate();
}

//---------------------------------------------------------------------------------------
// Usage: writeFooter ("StargazerPhotos","sitemap.html");
function writeFooter (myDomain,myUrl) {

	emailAddr  = "webmaster@"  + myDomain + ".com";

	fullDomain = "http://www." + myDomain + ".com";
	fullUrl = fullDomain + "/" + myUrl;
	
	hostUrl="../";  // assume we are starting from a subsite and need to go at least 1 level
	for ( i=0; i< myUrl.length; i++ ) {
		if ( myUrl.charAt(i) == "/" )  hostUrl += "../";
	}
	hostUrl += hostHome;
//	alert ("hostUrl=" + hostUrl + " for " + fullUrl);

	// 20030225 changed order of these first two lines
	document.write ('<font size="1">View our <a href="./privacy.html" target="'+frameWinName+'">privacy policy</a>. </font>');
   document.write ('<font size="1">Questions or comments? Email us at ');
//   document.write ('<br><font size="1">Please send questions or comments');
//   document.write (' on this ');
//	writeLink (portal,hostUrl,"_blank");
//   document.write (' website to');
	writeEmailLink (myDomain, myUrl, emailAddr);
   document.write ('</font><!br>');

	document.write ('<br><font size="1">All text &amp; images ');
	writeCopy ("©", myDomain);
   document.write (' 1998-2004 <a href="mailto:' + hostWebmaster + '">' + hostWebPerson + '</a>/');

	// if they click this link, we want it to open in the main frame
   writeLink (myDomain, fullDomain+"/main.html",frameWinName);  
   document.write (' except as noted. ');
   writeCopy ("All rights reserved.", myDomain);
   document.writeln ('&nbsp;</font>');

	writePageAndDate (fullUrl,frameWinName);
}

//---------------------------------------------------------------------------------------
function hostFooter(myUrl) {

	fullDomain = "http://" + hostDomain;
	fullUrl = fullDomain + "/" + myUrl;

	document.write ('<font size="1">All text &amp; images ');
	writeCopy ("©", hostDomain);
   document.write ('1998-2004 <a href="mailto:' + hostWebmaster + '">' + hostWebPerson + '</a>/');
   writeLink (portal,"../"+hostHome,"");
   document.write (' except as noted. ');
   writeCopy ("All rights reserved.", hostDomain);
   document.writeln ('&nbsp;</font>');
   
   document.write ('<br><font size="1">Please send questions or comments on this ');
	document.write (portal.link(fullDomain));
   document.write (' website to ');
	writeEmailLink (hostDomain, myUrl, hostWebmaster);
   document.write ('</font><!br>');

	writePageAndDate (fullUrl,"_blank");
}


