// 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";

//var headFrame=myName+"caption";
//var footFrame=myName+"footer";
var picWin=null;
var picDir="photos/shared/";  // plus the actual file location

frameWinName  = "_top";						 // added 20020807

//---------------------------------------------------------------------------------------
// Usage: writeFooter ("StargazerPhotos","sitemap.html");
function writePageFooter (myUrl) {

	emailAddr  = "webmaster@"  + siteName + ".com";
	fullDomain = "http://www." + siteName + ".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.writeln ('View our <a href="./privacy.html">privacy policy</a>.');
    document.write ('Questions or comments? Email us at ');
	writeEmailLink (siteName, myUrl, emailAddr);

	document.write ('\n<br>All text &amp; images ');
	writeCopy ("©", siteName);
    document.write (' 1998-2007 <a href="mailto:' + hostWebmaster + '">' + hostWebPerson + '</a>/');
    writeLink (siteName, fullDomain+"/home.html","");  
    document.write (' except as noted. ');
    writeCopy ("All rights reserved.", siteName);
    document.writeln ('');

	writePageAndDate (fullUrl,frameWinName);
}

//---------------------------------------------------------------------------------------
// Usage: writePicHeader ("StargazerPhotos","sitemap.html");

function writePopupHeader (caption,tagline) {

	// propagate this document's title to the parent window
	parent.document.title=document.title;

	// write page headers
	picWin=openFrame("",myName+"pic_popup","");
	if ( picWin!=null ) {

		// set up page using popupPic stylesheet
		writeFramePageHeader(picWin,siteName + ": " + caption,"popupPic");

		writePage(headWin,'<tr>\n<td class=caption title='+tagline+'>\n'+captions);
//		writePage(headWin,'<div class=caption>\n'+caption+'</div>\n);
//		writePage(headWin,'<br>\n<div class=tagline>\n'+tagline+'</div>\n);
		writePage(headWin,'</td>\n</tr>\n');

		writeFramePageTrailer(PicWin);
	}
	return picWin;
}

//---------------------------------------------------------------------------------------
// Usage: writePopupFooter (<pointer to already-created window>,"photo.jpg");

function writePopupFooter (footWin,myUrl) {

	// write page headers
	if ( footWin!=null ) {

		writeFramePageHeader(footWin,siteName + " page footer","footer");
		myDomain = siteName;

		emailAddr  = "webmaster@"  + myDomain + ".com";
		fullDomain = "http://www." + myDomain + ".com";
		fullUrl = fullDomain + "/" + myUrl;

		// note: myUrl could be ""
		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);

		writePage(footWin, '<tr>\n<td class=footer>\n<!font size="1">All text &amp; images ');
		writeCopy ("©", myDomain);
	   writePage(footWin, '1998-2003 <a href="mailto:' + hostWebmaster + '">' + hostWebPerson + '</a>/');

	   writeLink (myDomain, fullDomain+"/home.html","_top");  
	   writePage(footWin, ' except as noted. ');
	   writeCopy ("All rights reserved.", myDomain);
	   writePage(footWin,'&nbsp;<!/font>\n');
   
//	   writePage(footWin, '<br><!font size="1">Please send questions or comments on this ');
//		writeLink (portal,hostUrl,"_blank");
//	   writePage(footWin, ' website to ');
//		writeEmailLink (myDomain, myUrl, emailAddr);
//	   writePage(footWin, '<!/font>\n<br>');
//
//		writePageAndDate (fullUrl,frameWinName);
		writePage(footWin, '</td>\n</tr>\n');

		writeFrameTrailer(footWin);

		footWin.document.close();
	}
}

var newWin=null;

//---------------------------------------------------------------------------------------
// note - this only works when you are not currently IN frame 'frameName'
function openFrame(content,frameName,options) {

//alert ("opening frame window "+frameName+" for content=" + content);
	newWin=window.open(content,frameName,options);

 	if ( newWin != null ) {
		if ( newWin.opener == null ) {
		  newWin.opener = window; // for Netscape 2.0 compatibility
		}
 		newWin.focus(); 
 		
	} else {
		alert ("Cannot create window for "+ frameName);
	}
 	
 	return newWin;
}

function closeFrame() {

 	newWin.document.close;
 	newWin=null;
}


//---------------------------------------------------------------------------------------
function writeFramePageTrailer(w) {
//alert ("writing frame trailer to w=" + newWin);
	writePage(w,"\n</table>\n</center>\n");
	writePage(w,"</body>\n</html>\n");
	w.document.close();
}

//---------------------------------------------------------------------------------------
function writeFramePageHeader(w,t,s) {
//alert ("writing frame header to w=" + w);
	writePage (w,'<html>\n<head>\n');
	writePage (w,'<title>'+t+'</title>\n');
	writePage (w,'<script language="Javascript" src="scripts/'+myName+'/home.js"></script>\n');
//	writePage (w,'<script language="Javascript" src="scripts/writeFrameDocs.js"></script>\n');
	writePage (w,'<LINK href="'+s+'.css" type=text/css rel=stylesheet>\n');
	writePage (w,'</head>\n<body>\n<center><table border=0 cellspacing=4 width=100% align=center>\n');
}

//---------------------------------------------------------------------------------------
function writePage (w,what) {
//	alert ("Writing to window "+w+": " + what);
	w.document.write (what);
}

// SCRIPT language=Javascript

//---------------------------------------------------------------------------------------
function pop_me_up(pURL,pwName,features) { 

   // load the window and set 'creator' variables in it
 	new_window = window.open(pURL, pwName, features);

 	if ( new_window != null ) {
		if ( new_window.opener == null ) {
		  new_window.opener = window; // for Netscape 2.0 compatibility
        alert ("no opener property - setting to " + new_window.opener);
		}
	 	new_window.creatorName = myName;
//alert ('After loading\nOpener: ' + new_window.opener + ' Name: ' + new_window.creatorName + '\n');
 		new_window.focus(); 
 		
	} else {
		alert ("Cannot create popup window");
	}
	return new_window;
} 

//---------------------------------------------------------------------------------------
function pop_up_info(infoURL, caption) { 

   // load the window and set 'creator' variables in it
 	new_window = window.open(infoURL, myName+"info_popup", "width=800,height=700,status=no,menubar=no,scrollbars=yes,resizable=yes,location=no");

 	if ( new_window != null ) {
		if ( new_window.opener == null ) {
		  new_window.opener = window; // for Netscape 2.0 compatibility
        alert ("no opener property - setting to " + new_window.opener);
		}
	 	new_window.creatorName = myName;
//alert ('After loading\nOpener: ' + new_window.opener + ' Name: ' + new_window.creatorName + '\n');
 		new_window.focus(); 
 		
	} else {
		alert ("Cannot create info popup window");
	}
} 

//---------------------------------------------------------------------------------------
function pop_up_pic(picURL, caption) { 

   // load the window and set 'creator' variables in it
 	new_window = window.open(picDir+picURL, myName+"pic_popup", "width=800,height=800,status=no,menubar=no,scrollbars=no,resizable=yes,location=no");

 	if ( new_window != null ) {
		if ( new_window.opener == null ) {
		  new_window.opener = window; // for Netscape 2.0 compatibility
        alert ("no opener property - setting to " + new_window.opener);
		}
	 	new_window.creatorName = myName;
//alert ('After loading\nOpener: ' + new_window.opener + ' Name: ' + new_window.creatorName + '\n');
 		new_window.focus(); 
 		
	} else {
		alert ("Cannot create picture popup window");
	}
} 

//---------------------------------------------------------------------------------------
// KJS 20030209
// Module will create popup window, write headers, insert the picture, write footers, and close off the window.

function pop_up_titled_pic (picURL, caption) {

	// propagate the current document's title to the parent window
	picTitle = document.title + " - " + caption;
	

   // load the window and set 'creator' variables in it
	options = "width=800,height=700,status=no,menubar=no,scrollbars=no,resizable=no,location=no";
	new_window = openFrame(picDir+picURL, myName+"pic_popup", options);
 	if ( new_window != null ) {

 		new_window.focus(); 

   } else {
		alert ("Cannot create picture popup window");
	}
} 	

//---------------------------------------------------------------------------------
function eaddr_full (addr, mySubject) {
	// purpose of this, instead of a href="mailto:", is to hide the email addresses from
	// web crawlers and hopefully reduce the amount of spam we attract
//	writeMailtoLink (siteName, addr, mySubject);
//alert ('eaddr_full ('+addr+','+mySubject+')');

	thisAddr = addr + "@" + siteName + '.com';
	document.write('<a href="mailto:'+thisAddr+"?subject="+mySubject+'">'+thisAddr+'</a>');
}

//---------------------------------------------------------------------------------------
function eaddr (addr, mySubject) {
	// purpose of this, instead of a href="mailto:", is to hide the email addresses from
	// web crawlers and hopefully reduce the amount of spam we attract
//	writeMailtoLink (siteName, addr, mySubject);

	thisAddr = addr + "@" + siteName + '.com';
	document.write('<a href="mailto:'+thisAddr+"?subject="+mySubject+'">'+addr+'</a>');
}

//---------------------------------------------------------------------------------------
// 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('<br><i>Thanks for visiting us from '+document.referrer+'</i>');
		}
	}
}

//---------------------------------------------------------------------------------------
function writeModDate () {

   document.writeln (' <i>&nbsp;Last updated:&nbsp;</i>' + document.lastModified);
}

//---------------------------------------------------------------------------------------
function writeCopy (linkText) {

	document.write ('<a href="./copyright.html">'+linkText+'</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 ('<br><i>Page:&nbsp;&nbsp;</i>');
   writeLink (fullUrl, fullUrl, targetFrame);
   document.writeln ('');

   writeModDate();
}

//---------------------------------------------------------------------------------------
function hostFooter(myUrl) {

	fullDomain = "http://" + hostDomain;
	fullUrl = fullDomain + "/" + myUrl;

	document.write ('All text &amp; images ');
	writeCopy ("©", hostDomain);
   document.write ('1998-2003 <a href="mailto:' + hostWebmaster + '">' + hostWebPerson + '</a>/');
   writeLink (portal,"../"+hostHome,"");
   document.write (' except as noted. ');
   writeCopy ("All rights reserved.", hostDomain);
   document.writeln ('&nbsp;');
   
   document.write ('<br>Please send questions or comments on this ');
	document.write (portal.link(fullDomain));
   document.write (' website to ');
	writeEmailLink (hostDomain, myUrl, hostWebmaster);
   document.writeln ('<!br>');

	writePageAndDate (fullUrl,"_blank");
}


