var currentHomePic = 2;
var preloadFlag = 0;

// ***************************
function toi_doItWithStyle()
// ***************************
{
  toi_preLoadImages();
  document.write( '<STYLE TYPE="text/css">');
  document.write( '	BODY');
  document.write( '	{ ');
  document.write( ' font-family: verdana, arial, helvetica; font-size: 10pt;');
  document.write( '	scrollbar-base-color: 0076A3; ');
  document.write( '	scrollbar-arrow-color: 63AFCC;');
  document.write( '	scrollbar-DarkShadow-Color: 025778;');
  document.write( '	scrollbar-Highlight-Color: 9FCCDD; ');
  document.write( '	}');
  document.write( '.bigbluetext {text-decoration: none; color:#2C60BE; font-size: 11pt; line-height: 13pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.bigbluetext:hover {text-decoration: underline; color:#2C60BE}');
  document.write( '.medbluetext {text-decoration: none; color:#2C60BE; font-size: 10pt; line-height: 11pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.medbluetext:hover {text-decoration: underline; color:#000000}');
  document.write( '.hugeblacktext {text-decoration: none; color:#000000; font-size: 15pt; line-height: 16pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.hugeblacktext:hover {text-decoration: underline; color:#000000}');
  document.write( '.bigblacktext {text-decoration: none; color:#000000; font-size: 12pt; line-height: 13pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.bigblacktext:hover {text-decoration: underline; color:#000000}');
  document.write( '.medblacktext {text-decoration: none; color:#000000; font-size: 10pt; line-height: 11pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.medblacktext:hover {text-decoration: underline; color:#000000}');
  document.write( '.lilblacktext {text-decoration: none; color:#000000; font-size: 8pt; line-height: 9pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.lilblacktext:hover {text-decoration: underline; color:#000000}');
  document.write( '.tinyblacktext {text-decoration: none; color:#000000; font-size: 7pt; line-height: 8pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.tinyblacktext:hover {text-decoration: underline; color:#000000}');
  document.write( '.links {text-decoration: none; color:#000000; font-size: 7pt; line-height: 11pt; font-family: verdana,arial,helvetica}');
  document.write( 'a.links:hover {text-decoration: bold; color:#0076A3}');
  document.write( '</STYLE>');

}
// ****************************
function toi_textLinkTable()
// ****************************
{
  document.write(' <table width=617 border="0" cellpadding="0" cellspacing="0">');
  document.write('   <tr>');
  document.write('     <td valign="top" align="center" class="tinyblacktext">');
  document.write('       <a href="epc_home.htm" class="tinyblacktext">Home</a>&nbsp;|&nbsp;');
  document.write('       <a href="epc_about.htm" class="tinyblacktext">About Us</a>&nbsp;|&nbsp;');
  document.write('       <a href="epc_estimates.htm" class="tinyblacktext" >Free Estimates</a>&nbsp;|&nbsp;');
  document.write('       <a href="epc_references.htm" class="tinyblacktext">References</a>');
  document.write('       <BR><a href="epc_commercial.htm" class="tinyblacktext">Commercial Service</a>&nbsp;|&nbsp;');
  document.write('       <a href="epc_residential.htm" class="tinyblacktext">Residential Service</a>');
  document.write('     </TD>');
  document.write('   </TR>');
  document.write(' </TABLE> ');
}

// **************************************
function toi_copyAndDesign()
// copy right notice and design credit.
// **************************************
{
		document.write('<table width=617 border="0" cellpadding="0" cellspacing="0">');
			document.write('<tr>');
				document.write('<td valign="top" align="center" class="tinyblacktext"><br>Copyright &copy; 2004&nbsp;Eastern Paint Contractors, Inc.');
						document.write('All Rights Reserved. <br>');
				document.write('</td>');
			document.write('</tr>');
		document.write('</table>');
}

// **************************
function toi_changeImages()
// **************************
{
  //preloadFlag =1;
	if (document.images && (preloadFlag > 0))
	{
		for (var i=0; i<toi_changeImages.arguments.length; i+=2)
		{
			document[toi_changeImages.arguments[i]].src = toi_changeImages.arguments[i+1];
		}
	}
}


// *********************************
function toi_pageFooter()
// *********************************
{
  document.write(' <TABLE WIDTH=742 BORDER=0 CELLPADDING=0 CELLSPACING=0>');
  document.write(' <TR>');
  document.write(' <TD rowspan=3 valign=top><img src="images/epc_bottomframeleft.jpg"></TD>');
  document.write(' <TD height=3 valign=top><img src="images/epc_bottomframetopbar.jpg" border=0 width=550 height=3></TD>');
  document.write(' <TD rowspan=3 valign=top><img src="images/epc_bottomframeright.jpg"></TD>');
  document.write(' </TR>');
  document.write(' <TR>');
  document.write(' <TD width=550>');
  toi_textLinkTable();
  toi_copyAndDesign();
  document.write(' </TD>');
  document.write(' </TR>');
  document.write(' <TR>');
  document.write(' <TD width=550 height=6 valign=bottom><img src="images/epc_bottomframe2bar.jpg" width=550 height=6></TD>');
  document.write(' </TR>');
  document.write(' </TABLE>');
}

// ***********************************************
function changeHomeImage( pic2Change, makeBW )
// ***********************************************
{
  var iImageName = "ipic" + pic2Change;
  var pFileName = "images/epc_homepic" + pic2Change;
  var mStat = "_cl";
  if( makeBW > 0 )
  { mStat = "_bw"; }
    toi_changeImages(iImageName, pFileName + mStat + ".gif");

}
// **********************************
function homeImages()
// **********************************
{
  changeHomeImage( currentHomePic, 1 );
  currentHomePic = Number(currentHomePic) + 1
  if( Number(currentHomePic) > 5 )
    currentHomePic = 1;
  changeHomeImage( currentHomePic, 0 );
}

// ************************************************
function toi_pageHeader()
// ************************************************
{
  document.write(' <TR>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=53 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=53 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=59 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=24 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=92 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=52 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=76 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=64 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=57 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=19 HEIGHT=1 ALT=""></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=68 HEIGHT=1 ALT=""></TD>');
  document.write(' </TR>');
  document.write(' <TR>');
  document.write(' <TD>&nbsp;</TD>');
  document.write(' <TD COLSPAN=7><IMG SRC="images/epc_02.gif" WIDTH=420 HEIGHT=98 ALT=""></TD>');
  document.write(' <TD COLSPAN=3>&nbsp;</TD>');
  document.write(' </TR>');
  document.write(' <TR>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=53 HEIGHT=30 ALT=""></TD>');
  document.write(' <TD><a href="epc_home.htm" onClick="if(this.blur)this.blur();" onMouseOver="toi_changeImages(\'ihome\', \'images/epc_05mo.gif\');" onMouseOut="toi_changeImages(\'ihome\', \'images/epc_05.gif\');"><IMG name="ihome" SRC="images/epc_05.gif" border=0 WIDTH=53 HEIGHT=19 ALT=""></A></TD>');
  document.write(' <TD COLSPAN=2><a href="epc_about.htm" onClick="if(this.blur)this.blur();" onMouseOver="toi_changeImages(\'iabout\', \'images/epc_06mo.gif\');" onMouseOut="toi_changeImages(\'iabout\', \'images/epc_06.gif\');"><IMG name="iabout" SRC="images/epc_06.gif" border=0 WIDTH=83 HEIGHT=19 ALT=""></A></TD>');
  document.write(' <TD COLSPAN=2><a href="epc_commercial.htm" onClick="if(this.blur)this.blur();" onMouseOver="toi_changeImages(\'icommercial\', \'images/epc_07mo.gif\');" onMouseOut="toi_changeImages(\'icommercial\', \'images/epc_07.gif\');"><IMG name="icommercial" SRC="images/epc_07.gif" border=0 WIDTH=144 HEIGHT=19 ALT=""></A></TD>');
  document.write(' <TD COLSPAN=2><a href="epc_residential.htm" onClick="if(this.blur)this.blur();" onMouseOver="toi_changeImages(\'iresidential\', \'images/epc_08mo.gif\');" onMouseOut="toi_changeImages(\'iresidential\', \'images/epc_08.gif\');"><IMG name="iresidential" SRC="images/epc_08.gif" border=0 WIDTH=140 HEIGHT=19 ALT=""></A></TD>');
  document.write(' <TD COLSPAN=2><a href="epc_contact.htm" onClick="if(this.blur)this.blur();" onMouseOver="toi_changeImages(\'icontact\', \'images/epc_09mo.gif\');" onMouseOut="toi_changeImages(\'icontact\', \'images/epc_09.gif\');"><IMG name="icontact" SRC="images/epc_09.gif" border=0 WIDTH=76 HEIGHT=19 ALT=""></A></TD>');
  document.write(' <TD><IMG SRC="images/spacer.gif" WIDTH=68 HEIGHT=30 ALT=""></TD>');
  document.write(' </TR>');
}

// **********************
function toi_newImage(arg)
// ***********************
{
	if (document.images)
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

// *************************
function toi_preLoadImages()
// *************************
{
  if (document.images)
  {
		ph1 = toi_newImage("images/epc_05mo.gif");
		ph2 = toi_newImage("images/epc_06mo.gif");
		ph3 = toi_newImage("images/epc_07mo.gif");
		ph4 = toi_newImage("images/epc_08mo.gif");
		ph5 = toi_newImage("images/epc_09mo.gif");
		ph6 = toi_newImage("images/epc_homesidelinkest.gif");
		ph7 = toi_newImage("images/epc_homesidelinkref.gif");

		preloadFlag = 1;
	}
}