// <script language="Javascript">

var myName="DLH";
var siteName="dlhnursery";   // lower-cased 20030324 so it matches up in writeReferrer
//var frameWinName="DLHNMain";

var pName="DLHNhome";			// name of main parent window, to be used by search

if ( parent.basePath==null ) {
	parent.basePath = "./"
}

var imagePath= parent.basePath + "images/buttons/";
var picPath  = parent.basePath + "images/pictures/"
var leftColWidth="120";
//var topRowHeight="5%"; // was 50 pixels ...
//var botRowHeight="5%"; // was 56 pixels ...

var home="home";

var spwUrl='search_popup.html';
var spwName=myName+"_search_popup";
var spwFeatures='width=500,height=200,status=no,menubar=no,scrollbars=no,resizable=no,location=no';
var spw=null;
var spwText="";

//------------------------------------------------------------
function bookmarkPage (bTitle) {
	if(document.all)
		window.external.AddFavorite(top.location.href,document.title);
}

//---------------------------------------------------------------------------------------
function popUpSearch() {

   // load the window and set 'creator' variables in it
   pop_me_up(spwUrl,spwName,spwFeatures);
}

//---------------------------------------------------------------------------------------
function anotherSearch(lastSrchVal) {

    // recreate the search window, then prefill it with what they searched on last time
    spw=pop_me_up(spwUrl,spwName,spwFeatures);
    if ( spw != null ) {
    	spwText=lastSrchVal;
        setTimeout('fillSearchForm()',500);  // allow time for the page/form to load
   	}
}

//------------------------------------------------------------
function fillSearchForm() {
	spw.document.srchform.srchval.value = spwText;
	spw.document.srchform.srchval.focus();
}

//------------------------------------------------------------
function start_of_body() {

	// set the name of this window so the search popup can find it
	// must do it here NOT below, or the search popup's name gets changed too!
	parent.name=pName;

	write_start_of_body(window);
}

function write_start_of_body(bwin) {

	// 20030313 removed height=100% ... it makes printed pages look really funky.
	bwin.document.writeln ('<table bgcolor="black" width="100%" marginwidth="2" marginheight="1" border="1">');
	bwin.document.writeln ('<tr><td width="'+leftColWidth+'" bgcolor="honeydew" background="images/background.jpg" valign="center" align="center">');
	writeSearchPopupButton(bwin);
	bwin.document.writeln ('</td><td bgcolor="honeydew" background="images/background.jpg" valign="top" align="center">');
	writeLogo(bwin);
	bwin.document.writeln ('</td>\n</tr>');

	bwin.document.writeln ('<tr><td class="menubuttons" width="'+leftColWidth+'" bgcolor="honeydew" background="images/background.jpg" valign="top">');
	// menu buttons, medium purple
    writeContents(bwin);
	bwin.document.writeln ('</td><td class="pagebody" bgcolor="honeydew" align="center" valign="top">');

	// end of part 1
	// specific code for each page body goes here
}

//------------------------------------------------------------
// call at the very end of the file

function end_of_body(pageUrl) {
	write_end_of_body(window,pageUrl);
}

function write_end_of_body(bwin,pageUrl) {

	// start of part 2
	bwin.document.writeln ('</td></tr>');
//	bwin.document.writeln ('<tr height="'+botRowHeight+'">');
	bwin.document.writeln ('<tr><td class="credits" width="'+leftColWidth+'" align="center" valign="middle" bgcolor="honeydew" background="images/background.jpg" >');
 	writeCredits(bwin);
 	bwin.document.writeln ('</td><td class="footer" align="center" valign="bottom" bgcolor="honeydew" background="images/background.jpg" >');
	if ( pageUrl != "" ) {   // only print this for static pages
		writeFooter(pageUrl); // location.href is too long :)
	}
    bwin.document.writeln ('</td></tr>\n</table>');
	// end of part 2
}

//------------------------------------------------------------
function writeLogo(bwin) {
   bwin.document.writeln ('<a class="logo" href="http://www.dlhnursery.com/home.html" title="Go to the DLH Nursery home page">DLH Nursery, LLC</a>');
   bwin.document.writeln ('<br><div class="tagline"><font face="Verdana,Arial,Helvetica">');
   bwin.document.writeln ('Perennial Garden Improvement Specialists</font></div>');
}

//------------------------------------------------------------
function writeSearchPopupButton(bwin) {

	linkUrl="javascript:popUpSearch()";
	butName="Search";
    titleText="Search our site by keyword, e.g. type of service or flower.";
	bwin.document.writeln ('<a class="menubutton" href="'+linkUrl+'" target="_top"><IMG');
	bwin.document.writeln (' width="93" height="36" src="images/buttons/'+butName+'.gif" vspace="0" hspace="0" border="0" name="butImg'+butName+'"' +' title="'+titleText+'" alt="'+butName+'"></a>');
}

//------------------------------------------------------------
function writeContents(bwin) {

	// create a table with all of the button info

	// 20030313 removed height=100% ... it looks funny with long pages ...
	bwin.document.writeln ('<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" valign="top">');
		
	writeContentsButton (bwin,"home.html",     "Z","Home",       "Home page with links to slide shows of our garden");
	writeContentsButton (bwin,"whats_new.html","5","What's New", "List of what is new or changed in our gardens or on this site");
	writeContentsButton (bwin,"services.html", "9","Services",   "Overview of the landscaping and garden design services we offer");
	writeContentsButton (bwin,"gardens.html",  "2","Gardens",    "Links to detailed pages which categorize the plants and flowers we grow");
	writeContentsButton (bwin,"resources.html","I","Information","A summary of pages which provide horticultural advice and other helpful information");
	writeContentsButton (bwin,"aboutUs.html",  "3","About Us",   "Who we (DLH Nursery) are, and what we do.");
	writeContentsButton (bwin,"links.html",    "4","Links",      "Links to pages we enjoy, and hope you will too!");
	writeContentsButton (bwin,"contactUs.html","A","Contact Us", "How to contact us via email or snail mail.");
	writeContentsButton (bwin,"sitemap.html",  "1","Site Map",   "Index to all of the pages on this site. If you are looking for something specific, try the SEARCH button at the top of the page.");
			
	bwin.document.writeln ('</table>');
}

//------------------------------------------------------------
function writeContentsButton (bwin,linkUrl,butName,altText,titleText) {

	bwin.document.writeln ('<tr><td class="menubutton" width="100%" nowrap><a');
	bwin.document.writeln (' class="menubutton" href="'+linkUrl+'" target="_top" onmouseover="mIn(\''+butName+'\');" onmouseout="mOut(\''+butName+'\');" ><IMG');
	bwin.document.writeln (' width="125" height="36" src="images/buttons/m_'+butName+'.gif" vspace="0" hspace="0" border="0" name="butImg'+butName+'"' +' title="'+titleText+'" alt="'+altText+'"></a></td>');
	bwin.document.writeln ('</tr>');
}

//------------------------------------------------------------
function writeCredits(bwin) {
   
	bwin.document.writeln ('<div class="corner">');
	bwin.document.writeln ('A <a class="corner" href="http://jkww.rockdalenet.com/default.htm" target="_blank" title="Visit the JKWW site (opens in a new window)">JKWW</a> Site');
	bwin.document.writeln ('<br><a class="corner" href="credits.html" title="See the list of people we credit with helping on the development of this site">Credits</a>');
	bwin.document.writeln ('</div>');
}

//------------------------------------------------------------
function writeFooter(pageUrl) {  // for static pages only, in current window

	document.writeln ('<div class="footer">\n<font color="black" size="-1">');
	writePageFooter(pageUrl); // location.href is too long :)
	writeReferrer(siteName);
	document.writeln ('</font></div>');
}

