var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();

var minRate = 5.0;
var maxRate = 11.0;
var minTerm = 10;
var maxTerm = 30;
var defaultRate = 6.5;
var defaultTax = 1.09;
var defaultIns = 0.45;
var defaultTerm = 25;

var preloadFlag = 0;


// ******************************
function toi_doItWithStyle()
// ******************************
{
  document.write( '<STYLE TYPE="text/css">');
  document.write( '.bodytext  { color: #323232; font-size: 8pt; line-height: 11pt; font-family: verdana, arial, helventica; text-decoration: none }');
  document.write( 'a.bodytext:hover  { color: blue; text-decoration: underline }');
  document.write( '.bluetext {text-decoration: none; color:#08409B; font-size: 8pt; line-height: 11pt; font-family: verdana,arial,helventica}');
  document.write( 'a.bluetext:hover {text-decoration: underline; color:#820A09}');
  document.write( '.bluetext10 {text-decoration: none; color:#08409B; font-size: 10pt; line-height: 11pt; font-family: verdana,arial,helventica}');
  document.write( 'a.bluetext10:hover {text-decoration: underline; color:#820A09}');
  document.write( '.white { color: white; font-style: normal; font-weight: 600; font-size: 8pt; line-height: 11pt; font-family: Verdana }');
  document.write( '.redtext {text-decoration: none; color:#963232; font-size: 8pt; line-height: 11pt; font-family: verdana,arial,helventica}');
  document.write( 'a.redtext:hover {text-decoration: underline; color:#14631B}');
  document.write( '.white { color: white; font-style: normal; font-weight: 600; font-size: 8pt; line-height: 11pt; font-family: Verdana }');
  document.write( '.greentext {text-decoration: none; color:#666633; font-size: 8pt; line-height: 11pt; font-family: verdana,arial,helventica}');
  document.write( 'a.greentext:hover {text-decoration: underline; color:#820A09}');
  document.write( '.white { color: white; font-style: normal; font-weight: 600; font-size: 8pt; line-height: 11pt; font-family: Verdana }');
  document.write( '</STYLE>');
}

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

// **************************
function toi_changeImages()
// **************************
{
	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_putTheDate()
// ***********************
{
  if (year < 2000)
    year = year + 1900;
document.write(lmonth+ " " +date+ ", " +year);
}

// **********************************************************************
function toi_openSubWindow( daLink, daWidth, daHeight, wantScrollBars )
// **********************************************************************
{
  if( wantScrollBars > 0 )
    var scrollbars = "yes"
  else
    var scrollbars = "no"

  window.open(daLink,'remote','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=' +scrollbars+ ',width=' +daWidth+ ',height=' +daHeight);
}

// *************************
function toi_preloadImages()
// *************************
{
  if (document.images)
  {
		homes_over = toi_newImage("images/homes-over.gif");
		apartments_over = toi_newImage("images/apartments-over.gif");
		vacation_over = toi_newImage("images/vacation-over.gif");
		commercial_over = toi_newImage("images/commercial-over.gif");
    a01 = toi_newImage("images/arrow1.gif");
    a02 = toi_newImage("images/arrow2.gif");
    a03 = toi_newImage("images/arrow3.gif");
    a04 = toi_newImage("images/arrow4.gif");
    a05 = toi_newImage("images/arrow5.gif");
    a06 = toi_newImage("images/arrow6.gif");
    a07 = toi_newImage("images/arrow7.gif");
    a08 = toi_newImage("images/arrow8.gif");
    a09 = toi_newImage("images/arrow9.gif");
    a10 = toi_newImage("images/arrow10.gif");
    a11 = toi_newImage("images/arrow11.gif");
    a12 = toi_newImage("images/arrow12.gif");
    a13 = toi_newImage("images/arrow13.gif");
    a14 = toi_newImage("images/arrow14.gif");
    a15 = toi_newImage("images/arrow15.gif");
    a16 = toi_newImage("images/arrow16.gif");
    a17 = toi_newImage("images/arrow17.gif");
    a18 = toi_newImage("images/arrow18.gif");
    a19 = toi_newImage("images/arrow19.gif");
    a20 = toi_newImage("images/arrow20.gif");
		preloadFlag = 1;
	}
}

// *********************************************************
function toi_getCookieVar( forString )
// This function gets the value associated with "forString"
// from the cookie. Return value is numeric
// *********************************************************
{
  var testString = "";
  testString = toi_getCookieStr(forString);
  if( testString == "" )
    return -1;
  else
    return testString.valueOf();
}

// *********************************************************
function toi_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 toi_putCookieVar( forString, sVal )
// ******************************************
{
  document.cookie = forString+ "=" +sVal
}

// *****************************
function toi_format(val, post)
// *****************************
{
  var decpoint;
  var begin;
  var end;
  var valstr;
	var temp_char;

  valstr = "" + val;
  decpoint = valstr.indexOf(".")
  if (decpoint != -1)
  {
    begin = valstr.substring(0,decpoint);
    end = valstr.substring(decpoint+1,valstr.length);
  }
  else
  {
    begin = valstr;
    end = "";
  }
	if (end.length < post)
	{
	  while (end.length < post)
	  {
      end += "0";
    }
  }
	end = end.substring(0,post);
  return (begin+"."+end);
}

// ***************************************
function subPageMenu( titleImageName )
// **************************************
{
  var SQ="'";
  document.write(' <TABLE WIDTH=570 BORDER=0 CELLPADDING=0 CELLSPACING=0>');
  document.write(' 	<TR>');
  document.write(' 		<TD COLSPAN=5><IMG SRC="images/' +titleImageName+ '" WIDTH=570 HEIGHT=50 ALT=""></TD>');
  document.write(' 	</TR>');
  document.write(' 	<TR>');
  document.write(' 		<TD VALIGN=TOP><IMG SRC="images/slice2.gif" WIDTH=109 HEIGHT=27 ALT=""></TD>');
  document.write(' 		<TD>');
  document.write(' 			<A HREF="homes.html"');
  document.write(' 			  onclick="if(this.blur)this.blur();"');
  document.write(' 				ONMOUSEOVER="toi_changeImages('+SQ+'homes'+SQ+', '+SQ+'images/homes-over.gif'+SQ+'); return true;"');
  document.write(' 				ONMOUSEOUT="toi_changeImages('+SQ+'homes'+SQ+', '+SQ+'images/homes.gif'+SQ+'); return true;">');
  document.write(' 				<IMG NAME="homes" SRC="images/homes.gif" WIDTH=81 HEIGHT=27 BORDER=0 ALT=""></A>');
  document.write(' 		</TD>');
  document.write(' 		<TD>');
  document.write(' 			<A HREF="apartments.html"');
  document.write(' 			  onclick="if(this.blur)this.blur();"');
  document.write(' 				ONMOUSEOVER="toi_changeImages('+SQ+'apartments'+SQ+', '+SQ+'images/apartments-over.gif'+SQ+'); return true;"');
  document.write(' 				ONMOUSEOUT="toi_changeImages('+SQ+'apartments'+SQ+', '+SQ+'images/apartments.gif'+SQ+'); return true;">');
  document.write(' 				<IMG NAME="apartments" SRC="images/apartments.gif" WIDTH=110 HEIGHT=27 BORDER=0 ALT=""></A>');
  document.write(' 		</TD>');
  document.write(' 		<TD>');
  document.write(' 			<A HREF="vacation.html"');
  document.write(' 			  onclick="if(this.blur)this.blur();"');
  document.write(' 				ONMOUSEOVER="toi_changeImages('+SQ+'vacation'+SQ+', '+SQ+'images/vacation-over.gif'+SQ+'); return true;"');
  document.write(' 				ONMOUSEOUT="toi_changeImages('+SQ+'vacation'+SQ+', '+SQ+'images/vacation.gif'+SQ+'); return true;">');
  document.write(' 				<IMG NAME="vacation" SRC="images/vacation.gif" WIDTH=89 HEIGHT=27 BORDER=0 ALT=""></A>');
  document.write(' 		</TD>');
  document.write(' 		<TD>');
  document.write(' 			<A HREF="commercial2.html"');
  document.write(' 			  onclick="if(this.blur)this.blur();"');
  document.write(' 				ONMOUSEOVER="toi_changeImages('+SQ+'commercial'+SQ+', '+SQ+'images/commercial-over.gif'+SQ+'); return true;"');
  document.write(' 				ONMOUSEOUT="toi_changeImages('+SQ+'commercial'+SQ+', '+SQ+'images/commercial.gif'+SQ+'); return true;">');
  document.write(' 				<IMG NAME="commercial" SRC="images/commercial.gif" WIDTH=181 HEIGHT=27 BORDER=0 ALT=""></A>');
  document.write(' 		</TD>');
  document.write(' 	</TR>');
  document.write(' </TABLE>');
}

// ****************************
function pageFooter()
// ****************************
{
  document.write(' <table border="0" cellpadding="0" cellspacing="0" width="570">');
  document.write(' 	<tr>');
  document.write(' 		<td align="center" class="greentext"><br>');
  document.write(' 			<a href="index.html" class="bluetext">Front Page</a> | <a href="homes.html" class="bluetext">Homes</a> | <a href="apartments.html" class="bluetext">Townhomes</a> | <a href="vacation.html" class="bluetext">Vacation</a> | <a href="commercial2.html" class="bluetext">Commercial</a> | <a href="RENTAL APPLICATION.doc" class="bluetext" target=_blank>Rental Application</a> <Br> <a href="propmng.html" class="bluetext">General Procedures for Owners</a>');
  document.write(' 	  </td>');
  document.write(' 	</tr>');
  document.write(' 	<tr>');
  document.write(' 		<td align="center" class="bodytext"><br>Contact Stacey Kimmey at (919) 661-6268, Fax: (919) 772-3437<br>');
  document.write(' 			<br>');
  document.write(' 			Copyright &copy; Ball Rentals, LLC<br>');
  document.write(' 			All Rights Reserved.<br>  <br>');
  document.write(' 	  </td>');
  document.write(' 	</tr>');
  document.write(' </table>');
}
// ****************************
function pageFooter2()
// ****************************
{
  document.write(' <table border="0" cellpadding="0" cellspacing="0" width="570">');
  document.write(' 	<tr>');
  document.write(' 		<td align="center" class="greentext"><br>');
  document.write(' 			<a href="index.html" class="bluetext">Front Page</a> | <a href="homes.html" class="bluetext">Homes</a> | <a href="apartments.html" class="bluetext">Townhomes</a> | <a href="vacation.html" class="bluetext">Vacation</a> | <a href="commercial2.html" class="bluetext">Commercial</a> | <a href="RENTAL APPLICATION.doc" class="bluetext" target=_blank>Rental Application</a>');
  document.write(' 	  </td>');
  document.write(' 	</tr>');
  document.write(' 	<tr>');
  document.write(' 		<td align="center" class="bodytext"><br>Contact (919) 661-6268, Fax: (919) 772-3437<br>');
  document.write(' 			<br>');
  document.write(' 			Copyright &copy; Ball Rentals, LLC<br>');
  document.write(' 			All Rights Reserved.<br>  <br>');
  document.write(' 	  </td>');
  document.write(' 	</tr>');
  document.write(' </table>');
}

