var browser = navigator.appName;
var popUpWindow = null
var popUpWindowCount = 0
var popUpWindowName = "popUpWindow"
var preloadFlag;

// ****************************
function rdu_pageTitle()
// ****************************
{
  document.write(' <table width=780 border=0 cellpadding=0 cellspacing=0>');
  document.write(' 	<tr><td colspan=5><img src="images/rdu-main01.gif" border=0 width=780 height=14 alt=""></td></tr>');
  document.write('   <tr>');
  document.write('     <td><img src="images/rdu-main02.gif" border=0 width=384 height=92 alt=""></td>');
  document.write('     <td width=75 background="images/rdu-main03a.gif" align="center" valign="top">');
  document.write('       <img src="images/spacer.gif" border=0 width=75 height=20><br><a class="f11white" href="default.html" accesskey=1>HOME</a>');
  //document.write('       <img src="images/spacer.gif" border=0 width=75 height=20><br><a class="f11white" href="default.html" accesskey=1>ORGANIZATION</a>');
  document.write('     </td>');
  document.write('     <td width=75 background="images/rdu-main03b.gif" align="center" valign="top"><img src="images/spacer.gif" border=0 width=75 height=20><br><a class="f11white" href="contact/" accesskey=2>CONTACT</a></td>');
  document.write('     <td width=120 background="images/rdu-main04.gif" valign=top>');
  document.write('       <table width="119" cellspacing="0" cellpadding="0" border="0">');
  document.write(' 		    <form name="search" method="get" accept-charset="iso-8859-1" action="http://search.dot.state.nc.us/query.html">');
  document.write(' 	      <tr>');
  document.write(' 		      <td width="7"><img src="images/spacer.gif" width="1" height="1" alt="spacer"></td>');
  document.write(' 	  		  <td align="left" valign="top">&nbsp;<br><a class="f11white"  href="javascript:submitForm(\'search\')" accesskey=3>SEARCH!</a></td>');
  document.write(' 		    </tr>');
  document.write(' 		    <tr><td colspan="2"><img src="images/spacer.gif" width="1" height="1" alt="spacer"></td></tr>');
  document.write(' 	      <tr>');
  document.write(' 		      <td width="7"><img src="images/spacer.gif" width="1" height="1" alt="spacer"></td>');
  document.write(' 			    <td align="left" valign="top">');
  document.write(' 			      <input type="text" name="qt" class="searchSite" size="10" value="" maxlength="100" onfocus="sword()"> <!-- this is the field they type in -->');
  document.write(' 		        <!--IF you change the value of the limiting field below make sure you only change the "www.ncdot.org"-->');
  document.write(' 				    <input type="hidden" name="qp" value="+url:www.doh.dot.state.nc.us/preconstruct/highway/roadway"> <!--this is the limiting field -->');
  document.write(' 		        <input type="hidden" name="st" value="1">   <!-- show hits starting with this number -->');
  document.write(' 		        <input type="hidden" name="nh" value="25">  <!-- Number of hits to return -->');
  document.write(' 		        <!--required hidden fields dont mess with -->');
  document.write(' 		        <input type="hidden" name="col" value="dot">');
  document.write(' 		        <input type="hidden" name="pw" value="100%">');
  document.write(' 			    </td>');
  document.write(' 		    </tr>');
  document.write(' 		    </form>');
  document.write('       </table>');
  document.write('     </td>');
  document.write('     <td width="126" height="92" valign="top" background="images/rdu-main05a.gif">');
  document.write('       &nbsp;<br>');
  document.write(' 		  <a class="f11white" href="http://www.ncdot.org" accesskey=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NC DOT</a><br>');
  document.write(' 	    <a class="f11white" href="http://www.doh.dot.state.nc.us/" accesskey=6>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NC DOH</a><br>');
  document.write(' 		  <a class="f11white" href="http://www.ncgov.com/" accesskey=7>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NC GOV</a>');
  document.write(' 	  </td>');
  document.write('   </tr>');
  document.write('   <tr>');
  document.write('     <td colspan=5 background="images/rdu-main06.gif" width=780 height=22 align=right>');
  document.write('       <a class="f11" href="rdu-mission.htm"><b>MISSION</b></a><font class="f11">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</font>');
  document.write('       <a class="f11" href="rdu-organization.htm"><b>ORGANIZATION</b></a><font class="f11">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</font>');
  document.write('       <a class="f11" href="#" alt="Consultant Coordination Group"><b>PEF COORD</b></a><font class="f11">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</font>');
  document.write('       <a class="f11" href="#"><b>VISUALIZATION</b></a><font class="f11">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</font>');
  document.write('       <a class="f11" href="#"><b>TECH SUPPORT</b></a><font class="f11">&nbsp;&nbsp;</font>');
  document.write('     </td>');
  document.write('   </tr>');
  document.write(' </table>');
}

// *********************************************************
function rdu_pageBody_withMenu( pageTitle, extraSideMenu )
// *********************************************************
{
  document.write('<table width=780 border=0 cellpadding=0 cellspacing=0> ');
  document.write('  <tr>');
  if (browser == "Netscape" )
  { document.write('<td bgcolor="#FFFFFF">'); }
  else
  { document.write('    <td background="images/rdu-bodyback.gif">'); }
  document.write('      <table width=780 border=0 cellpadding=0 cellspacing=0>');
  document.write('        <tr>');
  document.write('          <td width=151><img src="images/rdu-sitemaptitlebar.gif" border=0 width=151 height=25 alt=""></td>');
  document.write('          <td background="images/rdu-bodytitlebar.gif" width=629><img src="images/spacer.gif" border=0 width=629 height=1><br><a class="indent"><b>' +pageTitle+ '</b></a></td>');
  document.write('        </tr>');
  document.write('        <tr>');
  document.write('          <td valign=top>');
  document.write('            <table border=0 cellpadding=0 cellspacing=0>');
  document.write('              <tr>');
  document.write('                <td height="20" class="color1"><img src="images/spacer.gif" border=0 width=3 height=20></td>');
  document.write('                <td height="20" class="color9"><img src="images/spacer.gif" border=0 width=1 height=20></td>');
  document.write('                <td class="color1" align=center>');
  document.write('                	<a class="noUnderscore" href="rdu-supportindex.htm">INDEX</a>');
  document.write('  						    <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('						      <a class="noUnderscore" href="rdu-updateindex.htm">UPDATES</a>');
  document.write('    						  <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('    						  <a class="noUnderscore" href="rdu-supportforms.htm">SUPPORT FORMS</a>');
  document.write('    						  <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('    						  <a class="noUnderscore" href="rdu-templates.htm">TEMPLATES</a>');
  document.write('    						  <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('     						  <a class="noUnderscore" href="#">POLICY MEMOS</a>');
  document.write('    						  <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('     						  <a class="noUnderscore" href="rdu-staffmeetings.htm">STAFF MEETINGS</a>');
  document.write('    						  <br><img src="images/greybar.gif" width="140" height="7" alt="spacer"><br>');
  document.write('     						  <a class="noUnderscore" href="http://www.doh.dot.state.nc.us/guidelines" target=_blank>ENG. GUIDELINES</a>');
  document.write('                </td>');
  document.write('                <td class="color9" height="20"><img src="images/spacer.gif" border=0 width=1 height=20></td>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('                <td height="1" class="color1"><img src="images/spacer.gif" border=0 width=3 height=1></td>');
  document.write('                <td height="1" class="color9"><img src="images/spacer.gif" border=0 width=1 height=1></td>');
  document.write('                <td height="1" class="color9"><img src="images/spacer.gif" border=0 width=142 height=1></td>');
  document.write('                <td class="color9" height="1"><img src="images/spacer.gif" border=0 width=1 height=1></td>');
  document.write('              </tr>');
  document.write('              <tr><td colspan=4> <br>&nbsp; </td></tr>');
  document.write('            </table>');
  if( rdu_pageBody_withMenu.arguments.length > 1 )
  {
    eval(extraSideMenu);
  }
  document.write('          </td>');
  document.write('          <td  valign=top>');
  document.write('            <table border=0 cellpadding=0 cellspacing=0>');
  document.write('              <tr>');
  document.write('                <td>');
}

// *********************************************
function rdu_pageBody_withNOMenu( pageTitle )
// *********************************************
{
  document.write('<table width=780 border=0 cellpadding=0 cellspacing=0> ');
  document.write('  <tr>');
  if (browser == "Netscape" )
  { document.write('<td bgcolor="#FFFFFF">'); }
  else
  { document.write('    <td background="images/rdu-bodyback.gif">'); }
  document.write('      <table width=780 border=0 cellpadding=0 cellspacing=0>');
  document.write('        <tr>  <!-- title bars -->');
  document.write('          <td background="images/rdu-widebodytitlebar.gif" width=780><a class="indent"><b>' +pageTitle+ '</b></a></td>');
  document.write('        </tr>');
  document.write('        <tr>');
  document.write('          <td>');
  document.write('            <table border=0 cellpadding=0 cellspacing=0>');
  document.write('              <tr>');
  document.write('                <td>&nbsp;');
}

// *************************
function rdu_pageFooter()
// *************************
{
  document.write('</td></tr></table></td></tr></table>');
  document.write('      <table width=780 border=0 cellpadding=0 cellspacing=0>');
  document.write('        <tr>');
  document.write('          <td><img src="images/spacer.gif" border=0 width=20 height=1></td>');
  document.write('          <td>');
  document.write('            Century Center<br>');
  document.write('            Building A<br>');
  document.write('            1000 Birch Ridge Drive<br>');
  document.write('            Raleigh, NC 27610<br>');
  document.write('          </td>');
  document.write('          <td><image src="images/spacer.gif" border=0 width=260 height=1></td>');
  document.write('          <td><image src="images/LOGO_DOT.GIF" border=0 width=37 height=37></td><td>The North Carolina<BR><a href="http://www.ncdot.org">Department of Transportation</a></td>');
  document.write('        </tr>');
  document.write('      </table>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
}

//****************************
function rdu_textLinkTable()
//****************************
{
  document.write('      <table width=780 border=0 cellpadding=0 cellspacing=0>');
  document.write('        <tr>');
  document.write('        </tr>');
  document.write('      </table>');

}
// *********************************************************
function getCookieVar( forString )
// This function gets the value associated with "forString"
// from the cookie. Return value is numeric
// *********************************************************
{
  var testString = "";
  testString = getCookieStr(forString);
  if( testString == "" )
    return -1;
  else
    return testString.valueOf();
}

// *********************************************************
function getCookieStr( forString )
// This function gets the value associated with "forString"
// from the cookie. Return value is alpa string.
// *********************************************************
{
  var index;
  var namestart;
  var nameend;
  // if this function fails to get a valid string retString
  // will be returned with NULL value.
  var retString = "";
  if(document.cookie)  // is there a cookie?
  {
    // if the cookie exists, get the character position of
    // the first occurance of "forString" in the cookie and
    // assign it to the index variable. -1 is the result
    // when the string is not found within the cookie.
    index = document.cookie.indexOf(forString);
    if (index != -1)
    {
      namestart = (document.cookie.indexOf("=", index) + 1);
      if( namestart == -1 )
        retString = "";
      else
      {
        nameend = document.cookie.indexOf(";", index);
        if (nameend == -1)
        {
          nameend = document.cookie.length;
          retString = document.cookie.substring(namestart, nameend);
        }
        else if ( nameend > namestart )
        {
          retString = document.cookie.substring(namestart, nameend);
        }
      }
    }
  }
  return unescape(retString);
}

// ******************************************
function putCookieVar( forString, sVal )
// ******************************************
{
  document.cookie = forString+ "=" +sVal
}


// ******************************************************************
function rdu_openPopUpWindow(daURL, daWidth, daHeight, daFeatures)
// ******************************************************************
{
  var attrString="toolbar=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes";

  popUpWindowName = "popUpWindow" + popUpWindowCount++;
  rdu_closePopUpWindow();
  if (rdu_openPopUpWindow.arguments.length >= 4)
     daFeatures = "," + attrString;
   else
     daFeatures = "";
   popUpWindow = window.open(daURL, popUpWindowName, "width=" + daWidth + ",height=" + daHeight + daFeatures);
}

// ******************************************************************
function rdu_closePopUpWindow()
// ******************************************************************
{
  if( navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >=4)
    if(popUpWindow != null)
      if(!popUpWindow.closed)
        popUpWindow.close()
}
