// =====================================================
// The following function builds a text string for the page header
//
//  It is the callers responsibility to actually write it.
//
// Parms passed
//	dspHome = "n" or "" or "y"
//		n = do not display a link to the Rubicon Home page
//	left1Ref = is a fully qualified link name to display
//	left1Desc = is the text description to display for the link
//	rTitle = is the title to display in the right cell
//	DLU = Date Last Updated
//
//	You can fill in as many, or none of the parms
//
// =====================================================

function fDspPageHeader(pTitle, pDspLinks) 
	{

	// Very first thing. 
	//  Verify that the test site is active, if not and we are in
	//  the test site - close the window.
	if ( WeAreInTest == "test" && TestSiteStatus == "off" )
		{
		alert("Use of the Test Site is Currently Disabled");
		window.close();
		}

	dspLinks = pDspLinks;	// Set global for display menu links

	t = '<a name=top></a>' ;
	t += '<div id=divHDR>' ;	// set the header division

	// Define the table used for the page header
	t += '<table class=tblpghdr cols=3 >' ;
	t += '<tr>' ;	// start a row

	// Define the Left cell
	t += '<td class=pghdrL >' ;
	
	// alert("topLeftImage=" + topLeftImage)
	if( dspLinks!='No' )
		{ t += '<a href="' + topLeftPage + '"> <img src=' + topLeftImage + '> </a>' ; }
		  else  
		{ t += '<img src=' + topLeftImage + '>' ; }

	// END of LEFT cell
	t += "</td>" ;

	// Define the Middle Cell
	t += '<td class=pghdrC >' ;
	t += "<span class=hl1C>" + orgHL1 + "</span>" ;
	t += "<br /><span class=hl2C>" + orgHL2 + "</span>" ;
	t += "<br /><span class=hl3C>" + orgHL3 + "</span>" ;
	t += "<br /><span class=hl4C>" + orgHL4 + "</span>" ;
	t += "<br /><span class=hl5C>" + orgHL5 + "</span>" ;

	// END of MIDDLE cell
	t += '</td>' ;

	// Define the Right Cell
	t += '<td class=pghdrR>' ;
	if ( WeAreInTest == "test" ) 
		{ t += "<font color=#ff0000><b>TEST SYSTEM</b></font><br />" ; }
		
	// Get todays date to display
	t += "<span class=hl2R>" + fDspDate(tdyDate) + '</span><br />' ;

/*
	if ( WeAreInIndex == "index_m.htm" )
		{
		// now - display accuweather for maumee
//		t += "<div style='float: right; width: 120px; height: 60px; background-image: url( http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/gold_120x60_bg.jpg ); background-repeat: no-repeat; background-color: #C39E6E;' >" ;
//		t += "<div id=awMain>" ;
//		t += "<div style='height: 48px;' >" ;
//		t += "<div id=awSub1>" ;
		t += '<span>' ;
		t += "<script src=http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=whteYell&logo=0&zipcode=43537&lang=eng&size=7&theme=gold&metric=0&target=_blank>" ;
		t += "</script>" ;
		t += '</span>' ;
//		t += "</div>" ;
//		t += "<div style='text-align: center; font-family: arial, helvetica, verdana, sans-serif; font-size: 10px; line-height: 12px; color: #FFFFFF;' >" ;
//		t += "<div id=awSub2>" ;
//		t += "<a style='color: #FFFFFF; font-size: xx-small;' href=http://www.accuweather.com/us/OH/MAUMEE/43537/city-weather-forecast.asp?partner=netweather&traveler=0 target=_blank >Weather Forecast</a>" ;
//		t += "</div>" ;
//		t += "</div>" ;
		}
*/

	// END of RIGHT cell
	t += '</td>' ;

	// Finish Table
	t += '</tr></table>' ;
	
	// Define the table used for the menu and the horizontal border
	t += '<table width=100% cols=1 border=0 cellpadding=0 cellspacing=0>' ;

	// Display the Menu Items
	if ( dspLinks != 'No' )
		{ t += fBldMenu() ; }

	// Display the horizontal bar
	t += '<tr><td align="center">' ;
	t += fGetHBar() ;

	if ( dspHolidayGreeting == "yes" && tdyDate.getMonth()+1 == 12 ) 
		{ t += '<br>' + txtHolidayGreeting + '<br>' + fGetHBar() ; }


	// Finish Table
	t += '</td></tr></table>' ;

	// end the header division
	t += '</div>' ;

	// Return Text String
	
	return t ;
	}



// =====================================================
// The following function displays the page footer
// =====================================================

function fDspPageFooter() 
	{

	t = '<div id=divFTR>' ;
	t += fGetHBar() ;

	t += '<center><a href="#top">Go To Top</a></center>' ;

	// Define the footer table
	t += '<table class=tblpgftr cols=3 ><tr>' ;

	//  set the left side column
	t += '<td class=pgftrL >' ;

	if ( dspLinks != 'No' )
		{ t += '<a href="' + botLeftPage + '"> <img src=' + botLeftGraphic + '> </a>' ; }
		  else  
		{ t += '<img src=' + botLeftGraphic + '>' ; }
	t += '</td>' ;


	//  set the center column
	t += '<td class=pgftrC ><center>' + botCenterGraphic + '</center></td>'

	//  set the right side column
	t +='<td class=pgftrR ><right>' ;
	if ( dspLinks != 'No' )
		{
		t += '<img src=' + botRightGraphic1 + ' ' ;
		if ( doRedSkelton == "yes" )
			{
			t += ' onClick="fOpenWinSelfMin(' ;
			t += "'rskeltonpledge.htm');" ;
			}
		t += '">' ;
		}
	      else  
		{ t+='<img src=' + botRightGraphic1 + '>'  ; }

	t += botRightGraphic2 + '</right></td>' ;

	//  end footer table
	t += '</tr></table>' ;


	if ( dspLinks!='No' )
		{
		t += '<center><INPUT TYPE="button" VALUE="Disclaimer" onClick="' ;
		t += "fOpenWinSelfMin('" + disclaimerPage + "');" ;
		t += '"></center>' ;
		}

	t += '</div>' ;	// end the footer division
	return t ;
	}



// =================================================
// opens the fully qualified web page requested
// =================================================

function fOpenWinSelf(pWin) 
	{
	var windowFile = pWin
	myWindow = window.open(windowFile,'_self',"menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,width=825,height=400,left=0,top=0")
	myWindow.focus()
	return;
	}

// =================================================
// opens the fully qualified web page requested
// =================================================

function fOpenWinSelfMin(pWin) 
	{
	var windowFile = pWin
	myWindow = window.open(windowFile,'_blank',"menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no,width=825,height=480,left=0,top=0")
	myWindow.focus()
	return;
	}



// =================================================
// opens the fully qualified web page requested
// =================================================

function fLoadPage(pWin) 
	{
	var windowFile = pWin
	myWindow = window.open(windowFile,'_self',"menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,left=0,top=0")
	myWindow.focus()
	return;
	}


// =================================================
// opens the fully qualified web page requested
// =================================================

function fLoadPageNew(pWin) 
	{
	var windowFile = pWin
	myWindow = window.open(windowFile,'_blank',"width=900,height=480,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,left=0,top=0")
	myWindow.focus()
	return;
	}



// =====================================================
// The following function returns the Date being passed
//  as ddddddd mmmmmmmmm dd, yyyyy
//    example for 8/25/2007
//    it would return - Saturday, August 25, 2007
// =====================================================

function fDspDate(pDate) 
	{
	return pDate.toDateString() ;
	}


// =====================================================
// The following function builds a text string for the Horizontal Bar used
// =====================================================

function fGetHBar()
	{
	return '<center><img src=' + hBar + ' /></center>' ;
	}
	
// =====================================================
// The following functions are used by the MS DDM Menu Processing
// =====================================================
function expand(s)
	{
	var td = s;
	var d = td.getElementsByTagName("div").item(0);

	td.className = "menuHover";
	d.className = "menuHover";
	}

function collapse(s)
	{
	var td = s;
	var d = td.getElementsByTagName("div").item(0);

	td.className = "menuNormal";
	d.className = "menuNormal";
	}


