var g_bJSConvert = false;
var g_sJSConvert = '';

	function prt (pv_sString) {

		if (g_bJSConvert) {
			g_sJSConvert += pv_sString + '\r';
		}
		
		document.write (pv_sString);
	}
	
	
	function stringMan(pv_sString)	{
	
	var sStr = pv_sString;
	
	prt(sStr);
		
	}
	
   function loadHeader(pv_sDate, pv_sIndex, pv_sRevised, pv_sReviewed)	{ //This script loads the header of the procedure pages. It receives the date, index, revised, and reviewed date as parameters that are displayed in the header.

		if (pv_sDate == '')	{
			pv_sDate = '&nbsp;'
		}
		else if (pv_sDate == null)	{
			pv_sDate = '&nbsp;'
		}		
		else	{
			pv_sDate = 'Date: ' + pv_sDate 
		}
		
		if (pv_sIndex == '')	{
			pv_sIndex = '&nbsp;'
		}
		else if (pv_sIndex == null)	{
			pv_sIndex = '&nbsp;'
		}
		else	{
			pv_sIndex = 'Index: ' + pv_sIndex
		}

		if (pv_sRevised == '')	{
			pv_sRevised = '&nbsp;'
		}	
		else if (pv_sRevised == null)	{
			pv_sRevised = '&nbsp;'
		}
		else	{
			pv_sRevised = 'Revised: ' + pv_sRevised
		}
		
		if (pv_sReviewed == '')	{
			pv_sReviewed = '&nbsp;'
		}
		else if (pv_sReviewed == null)	{
			pv_sReviewed = '&nbsp;'
		}
		else	{
			pv_sReviewed = 'Reviewed: ' + pv_sReviewed
		}
		
		prt	(	'<h3 class="header">Washington County Consolidated Communications Agency</h3>')
		
		prt (	'<span class="datecontainer">');  displayDate();  prt('</span>'); +
		
		prt (	'<table border="0" class="default" width="100%" cellpadding="0" cellspacing="0"><tr>' + 
				
				'<td style="text-align: left;" class="default"><strong>' + pv_sDate + '</strong><td>' + 
				
				'<td style="text-align: right;" class="default"><strong>' + pv_sIndex + '</strong></td></tr></table>' +

				'<h1>Operations Directive</h1>' + 
				
				'<table class="default" border="0" width="100%" cellpadding="0" cellspacing="0"><tr>' + 
				
				'<td style="text-align: left;" class="default"><strong>' + pv_sReviewed + '</strong><td>' + 
				
				'<td style="text-align: right;" class="default"><strong>' + pv_sRevised + '</strong></td></tr></table>');
	
   }
	
	function loadToCHeader(pv_sContents)	{ //This script loads the header of the table of contents pages. It receives the contents of the page and displays them in the header.

		if (pv_sContents == null) {
				pv_sContents = '&nbsp'
		}
		prt	(	'<h3 class="header">Washington County Consolidated Communications Agency</h3>')
		prt	(	'<span class="datecontainer">');  displayDate();  prt('</span>'); +
		
		prt 	(	'<h1>Operations Directive</h1>' +
				
					'<h3>Table of Contents<br/>' + pv_sContents + '</h3>');
	
   }
	
	function loadNavBar(pv_sCurrentPageLetter, pv_iCurrentPageNbr)	{
	
		/*This function loads a navigation menu into the page that dynamically
		changes depending on the variables sent to the function. Pass the current pages' index letter and number
		replacing the '-' with a coma. Example: loadFooter(A,1); This is an example for page A-1.htm.
		Written by Shawn VanGundy on 04-08-04.*/

		var sPrevious;
		var sNext;
		
		if (pv_sCurrentPageLetter == 'A' && pv_iCurrentPageNbr == 8)	{
			sPrevious = pv_sCurrentPageLetter + '-' + (pv_iCurrentPageNbr - 1) + '.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\Policies/\B/\B-1.htm';
		}
		else if (pv_sCurrentPageLetter == 'B' && pv_iCurrentPageNbr == 4)	{
			sPrevious = pv_sCurrentPageLetter + '-' + (pv_iCurrentPageNbr - 1) + '.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\Policies/\C/\C-1.htm';
		}		
		else if (pv_sCurrentPageLetter == null)	{
			sPrevious = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
		}
		else if (pv_sCurrentPageLetter == '')	{
			sPrevious = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
		}
		else if (pv_iCurrentPageNbr == null)	{
			sPrevious = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
		}
		else if (pv_iCurrentPageNbr == '')	{
			sPrevious = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
			sNext = 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm';
		}
		else if (pv_iCurrentPageNbr == 1)	{
			sNext = pv_sCurrentPageLetter + '-' + (pv_iCurrentPageNbr + 1) + '.htm';
			sPrevious = subtractLetter(pv_sCurrentPageLetter, pv_iCurrentPageNbr);
		}
		else {
		sPrevious = pv_sCurrentPageLetter + '-' + (pv_iCurrentPageNbr - 1) + '.htm';
		
		sNext = pv_sCurrentPageLetter + '-' + (pv_iCurrentPageNbr + 1) + '.htm';
		}

		prt (	
   				'<table class="nav" border="0" summary="footer menu" width="90%" cellpadding="0" cellspacing="0" align="center">'+
               	'<tr>'+
               		'<td width="33%" style="text-align: left;" class="default"><a href="' + sPrevious + '">&laquo; Previous</a></td>'+
               		'<td width="33%" style="text-align: center;" class="default"><a href="C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm">Index</a></td>'+
               		'<td width="33%" style="text-align: right;" class="default"><a href="' + sNext + '">Next &raquo;</a></td>'+
               	'</tr>'+
               '</table>');
	}
	
	function subtractLetter(pv_sCurrentPageLetter, pv_iCurrentPageNbr)	{
	
		var l = pv_sCurrentPageLetter
		var n = pv_iCurrentPageNbr
	
		if (l == 'A')	{
			l = 'W';
			n = 2;
		}
		else if (l == 'B')	{
			l = 'A';
			n = 8;
		}
		else if (l == 'C')	{
			l = 'B';
			n = 4;
		}
		else if (l == 'D')	{
			l = 'C';
			n = 16;
		}
		else if (l == 'E')	{
			l = 'D';
			n = 5;
		}
		else if (l == 'F')	{
			l = 'E';
			n = 11;
		}
		else if (l == 'G')	{
			l = 'F';
			n = 6;
		}
		else if (l == 'H')	{
			l = 'G';
			n = 1;
		}
		else if (l == 'I')	{
			l = 'H';
			n = 3;
		}
		else if (l == 'L')	{
			l = 'I';
			n = 3;
		}
		else if (l == 'M')	{
			l = 'L';
			n = 3;
		}
		else if (l == 'N')	{
			l = 'M';
			n = 5;
		}
		else if (l == 'P')	{
			l = 'N';
			n = 4;
		}
		else if (l == 'R')	{
			l = 'P';
			n = 12;
		}
		else if (l == 'S')	{
			l = 'R';
			n = 7;
		}
		else if (l == 'T')	{
			l = 'S';
			n = 7;
		}
		else if (l == 'W')	{
			l = 'T';
			n = 13;
		}
		
		return 'C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\Policies\/' + l + '\/' + l + '-' + n + '.htm';
		
	}

		
	function loadFooter()	{

		prt ('<hr style="color: #cc0000; margin-top: 30px; border: 5px solid #cc0000; width: 800px; height: 10px;" /><div id="footer">'+
         		'Copyright &copy; 2005, WCCCA'+
            '</div>')
	}

	
	   function loadTabs(pv_sCurrentTab) {
   		
			/* This function builds a horizontal tab menu that leaves the current page link cold, 
				while leaving all other links hot.
				It was written by Shawn VanGundy on 04-08-04.*/
				
         var sStr;
         var iStartPos = 0;
         var iEndPos;
   		var sMenu;
   
         sStr =
					'<a name="top"></a>' +
   				'<div class="tabcontainer">' +
   					'<span><A HREF="http://192.168.29.15/" class="tab">Main Menu</A></span>' +
   					'<span><A HREF="C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\OpsToCv2.htm" class="tab">Full List</A></span>' +
   				'</div>'; //Loads the menu into a string variable
   
         if (pv_sCurrentTab == null) { //Then all hot
            sMenu = sStr;
   			prt(sMenu);
   		}
         else	{
            iEndPos = sStr.indexOf(pv_sCurrentTab + '<');  //find the start of the item name
            iStartPos = sStr.lastIndexOf('<A', iEndPos);  //find the start of the "<a href" tag that comes before it
   			
            sMenu = sStr.substring(0, iStartPos);  //extract everything left of "<a href"
   
            sMenu = sMenu + '<span class="tabselected">' + pv_sCurrentTab + '</span>';  //Append the menu text
   			
            sMenu = sMenu + sStr.substring(iEndPos + pv_sCurrentTab.length + 4);  //Extract the remainder of the string after the closing anchor tag
   			prt(sMenu);
         }
   }
	
	function loadAlphaTabs(pv_sCurrentTab) {
   		
			/* This function builds a horizontal tab menu that leaves the current page link cold, 
				while leaving all other links hot.
				It was written by Shawn VanGundy on 04-08-04.*/
				
         var sStr;
         var iStartPos = 0;
         var iEndPos;
   		var sMenu;
   
         sStr =	'<div style="position: absolute; top: 215px; z-index: 2;"><a name="ToC">&nbsp;</a></div>' +
						'<div class="alphatabcontainer">' +
      					'<span><A HREF="NavAB.htm#ToC" class="alphatab">A B</A></span>' +
      					'<span><A HREF="NavCD.htm#ToC" class="alphatab">C D</A></span>' +
      					'<span><A HREF="NavEF.htm#ToC" class="alphatab">E F</A></span>' +
      					'<span><A href="NavGHI.htm#ToC" class="alphatab">G H I</A></span>' +
   						'<span><A HREF="NavJKL.htm#ToC" class="alphatab">J K L</A></span>' +
      					'<span><A HREF="NavMNO.htm#ToC" class="alphatab">M N O</A></span>' +
   						'<span><A HREF="NavPQR.htm#ToC" class="alphatab">P Q R</A></span>' +
   						'<span><A HREF="NavST.htm#ToC" class="alphatab">S T</A></span>' +
   						'<span><A HREF="NavUVW.htm#ToC" class="alphatab">U V W</A></span>' +
   						'<span><A HREF="NavXYZ.htm#ToC" class="alphatab">X Y Z</A></span>' +
   					'</div>'; //Loads the menu into a string variable
   
         if (pv_sCurrentTab == null) { //Then all hot
            sMenu = sStr;
   			prt(sMenu);
   		}
			else if (pv_sCurrentTab == "") { //Then all hot
            sMenu = sStr;
   			prt(sMenu);
   		}
         else	{
            iEndPos = sStr.indexOf(pv_sCurrentTab + '<');  //find the start of the item name
            iStartPos = sStr.lastIndexOf('<A', iEndPos);  //find the start of the "<a href" tag that comes before it
   			
            sMenu = sStr.substring(0, iStartPos);  //extract everything left of "<a href"
   
            sMenu = sMenu + '<span class="alphatabselected">' + pv_sCurrentTab + '</span>';  //Append the menu text
   			
            sMenu = sMenu + sStr.substring(iEndPos + pv_sCurrentTab.length + 4);  //Extract the remainder of the string after the closing anchor tag
   			prt(sMenu);
         }
   }
	
	function displayDate()	{
		
		DaysofWeek = new Array()
		DaysofWeek[0]="Sunday"
		DaysofWeek[1]="Monday"
		DaysofWeek[2]="Tuesday"
		DaysofWeek[3]="Wednesday"
		DaysofWeek[4]="Thursday"
		DaysofWeek[5]="Friday"
		DaysofWeek[6]="Saturday"
		
		Months = new Array()
		Months[0]="January"
		Months[1]="February"
		Months[2]="March"
		Months[3]="April"
		Months[4]="May"
		Months[5]="June"
		Months[6]="July"
		Months[7]="August"
		Months[8]="September"
		Months[9]="October"
		Months[10]="November"
		Months[11]="December"
		
		RightNow = new Date()
		
		var day = DaysofWeek[RightNow.getDay()]
		var date = RightNow.getDate()
		var Month = Months[RightNow.getMonth()]
		var Year = RightNow.getFullYear()
		
		/*	This if/else statement loads "st", "nd", "rd", and "th" into the ender
			variable according to the appropriate days of the month	*/
		
		if (date == 1 || date == 21 || date == 31)	{
			ender = "<sup>st</sup>" //superscript
		}
		
		else
		if (date == 2 || date == 22)	{
			ender = "<sup>nd</sup>"
		}
		
		else
		if (date == 3 || date == 23)	{
			ender = "<sup>rd</sup>"
		}
		
		else	{
			ender = "<sup>th</sup>"
		}
		
		prt("Today is " +day+ " " +Month+ " " +date+ ender+ ", " +Year);
		
	}
	
	
	function loadLogo() {
		prt(	'<div class="logo">' +
					'<table summary="WCCCA Logo" cellpadding="0px" cellspacing="0" border="0" width="250px" height="100px" class="logotable">' +
   					'<a href="C:/\Documents and Settings/\svangundy/\My Documents/\Intranet/\OperationsDirectives/\index.htm"><tr>' +
   						'<td style="color: #ffffff; font-family: calisto MT, garamond; background-color: #cc0000; font-size: 40pt; font-weight: bold; text-align: center; padding: 0px;"><span style="position: relative; bottom: 16px; left: 38px; font-size: 34pt; font-family: garamond; font-weight: bold;">-</span><span style="position: relative; bottom: 16px; left: 22px; font-size: 18pt; font-family: garamond; font-weight: bold;">|</span>9<span style="position: relative; bottom: 5px; left: 3px;">-</span>1<span style="position: relative; bottom: 5px;">-</span>1&nbsp;&nbsp;</td>' +
   					'</tr>' +
   					'<tr>' +
   						'<td style="color: #000000; font-family: calisto MT, garamond; background-color: #ffffff; font-size: 30pt; font-weight: normal; text-align: center; padding: 0px;">WCCCA</td>' +
   					'</tr>' +
   					'<tr>' +
   						'<td style="color: #000000; font-family: garamond; background-color: #ffffff; font-size: 12pt; font-weight: normal; text-align: center; border-top-width: 1px; border-top-color: #cc0000; border-top-style: solid; padding: 0px;">POLICE&nbsp;&nbsp;  &nbsp;&nbsp;FIRE&nbsp;&nbsp;  &nbsp;&nbsp;MEDICAL</td>' +
   					'</tr>' +
   				'</table></a>' +
   			'<span  style="color: #cc0000; font-size: 30pt; position: relative; bottom: 46px; left: 85px; padding-top: 0px; z-index: 1;">.</span>' +
   			'<span style="color: #cc0000; font-size: 30pt; position: relative; bottom: 46px; left: 127px; padding: 0px z-index: 1;">.</span>' +
				'</div>');

	}
	
	function loadSecurityIndex(pv_color)	{
		
		prt('<table cellpadding="0" cellspacing="0" class="security">' +
				'<tr>' +
					'<td class="' + pv_color + '">' + pv_color + '</td>' +
				'</tr>' +
			'</table>');
	}
	
	
function RollOver(TheObject, bRollOver) {

	var style = TheObject.style

	if (bRollOver) {
			//style.borderLeft= '3px solid #464646';
			//style.borderRight= '0px solid #464646';
			//style.borderBottom= '1px solid #464646';
			//style.borderTop= '1px solid #464646';
			style.backgroundColor= '#cc0000';
			//style.border= '1px solid #000000';
	}
	else {
			//style.borderLeft= '2px solid #464646';
			//style.borderRight= '2px solid #464646';
			//style.borderBottom= '1px solid #464646';
			//style.borderTop= '1px solid silver';
			style.backgroundColor= '#ffffff';
			//style.border= '0px solid #000000';
	}
}
