
/************************************************************************************
   Browsercheck and Platform Check
************************************************************************************/
var browserVer = parseInt(navigator.appVersion);
var browserType = navigator.userAgent;
var browserString = navigator.platform.toUpperCase();
var nsString = browserType.indexOf("Mozilla");
var ns6plus = ((browserVer>=5) && (nsString != -1)) ? 1:0;
//alert(browserType + " " + browserVer);
var macString = browserString.indexOf("MAC");
var isMac = (macString != -1) ? 1:0;


var NS4 = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
var browser=((NS4 || ie || ns6plus) && browserVer>=4)  
/************************************************************************************/

/******************************************
   Global Variables
******************************************/
var companyName = "Collum Roofing, Inc";
var companyPO = "P. O. Box 27327";
var companyCity = "Tempe";
var companyState = "AZ";
var companyZip = "85285";
var companyPhone = "(602) 437-1184";
var companyLogo = "../assets/images/CollumLogo002.gif";
var companyEmail = '<img src="../assets/images/email_info.jpg" width=150 height=15 align="middle" border=0>';
var companyWebsite = "http://www.collumroofing.com/";
var companyWebsiteTxt = "www.collumroofing.com";
var reqFlds = new Array();
var navButtons = new Array();
//var $a_stcds = new Array();

/************************************************************************************/

/*****************************************
   Functions
*******************************************/

function setStatus(txt) {
  window.status = txt;
}

function getYear() 
{
	var nowDate = new Date();
	var year = nowDate.getFullYear();
	
	return year;
}	

function wrtFooter() 
{
  document.write('<table width="100%"><tr>');
  document.write('<td width=14><img src="images/spacer.gif" width="14" height="1" border="0" alt="" /></td>');
  document.write('<td width="100%">');
  document.write('<hr style="width:100%" noshade size="1" />');
  document.write('<div align="center"');
  document.write('<span class="footerTxt">');
  document.write('<table width="100%"><tr>');
  document.write('<td align=left><span class="footerTxt">');
  document.write(companyName);
  document.write('</span></TD>');
  document.write('<td align=left><span class="footerTxt">');
  document.write(companyPO);
  document.write('</span></TD>');
  document.write('<td align=left><span class="footerTxt">');
  document.write(companyCity + ', ' + companyState + ' ' + companyZip);
  document.write('</span></TD></TR><TR>');
  document.write('<td align=left><span class="footerTxt">');
  document.write('Phone: ' + companyPhone);
  document.write('</span></TD>');
  document.write('<td align=left><span class="footerTxt">');
  document.write('Email: ' + companyEmail);
  document.write('</span></TD>');
  document.write('<td align=left><span class="footerTxt">');
  document.write('Website <a href="' + companyWebsite + '">' + companyWebsiteTxt + '</a>');
  document.write('</span></TD></TR></table>');
  document.write('</span><hr style="width:100%" noshade size="1" />');
  document.write('<span class="footerTxt">');
  document.write("&copy;" + getYear() + " " + companyName + ".</span></div>");
  document.write('</td></tr></table>');

	return;
}	

function wrtHeader(pageTitle, navButton) 
{
  /**** Create Funky Blue Box at top of page ***/
  document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT=25>');
  document.write('<TR ALIGN=LEFT>');
	/**** Insert Company LOGO ***/
  document.write('<TD WIDTH=145 STYLE="background-color: rgb(70,130,180);">');
  document.write('<P><IMG HEIGHT=78 WIDTH=145 SRC="' + companyLogo + '" VSPACE=0 HSPACE=0 ALIGN="MIDDLE" BORDER=0></P>');
  document.write('</TD>');
	/**** Insert Page Title ***/
	document.write('<TD VALIGN=MIDDLE STYLE="background-color: rgb(70,130,180);">');
  document.write('<span class=\"pgtitles\">&nbsp;&nbsp;' + pageTitle + ' - ' + navButton + '</span>');
	document.write('</TD>');
	/**** Insert Company Name ***/
	document.write('<TD VALIGN=TOP STYLE="text-align: center; background-color: rgb(70,130,180);">');
  document.write('<H1 STYLE="text-align: right;">');
  document.write('<SPAN STYLE="font-family: ' + "'Arial Black'" + ', '+ "'Helvetica Bold'" + ', Charcoal, Sans-serif, sans-serif; font-size: large; font-weight: normal;">' + companyName + '</SPAN>');
  document.write('<IMG WIDTH=20 HEIGHT=25 SRC="../assets/images/spacer.gif" VSPACE=0 HSPACE=0 ALIGN="TOP" BORDER=0 ALT=""></H1>');
  document.write('</TD></TR></TABLE>');

	/**** Insert Top Menu Bar ***/
	createNavBoxTop(navButton);
	
	return;
}	

function wrtStatusMsg(iMsg) 
{
	 // Write status message
	 if (iMsg) {
     document.write('<tr><td align="CENTER"><br>\n<table frame=border width="33%">\n<tr><td>');
     document.write(iMsg + '</td></tr>\n</table>\n<br></td></tr>');
	 } else {
     document.write('<tr><td align="CENTER"><br>\n<table width="33%">\n<tr><td>&nbsp;</td></tr>\n</table>\n<br></td></tr>');
	 }
	
	return;
}	

function initNavButtons() 
{
  navButtons["Overview"] = "../html/Home.html";
  navButtons["About Us"] = "../html/about.html";
  navButtons["References"] = "../html/references.html";
  navButtons["Photos"] = "../html/photo_gallery.html";
  navButtons["Service"] = "../html/service.html";
  navButtons["Contact Us"] = "../html/contact_us.html";
  navButtons["Legal"] = "../html/legal.html";
}
/*
function initStateCodes()
{
  $a_stcds["AK"] = "Alaska";
  $a_stcds["AL"] = "Alabama";
  $a_stcds["AR"] = "Arkansas";
  $a_stcds["AZ"] = "Arizona";
  $a_stcds["CA"] = "California";
  $a_stcds["CO"] = "Colorado";
  $a_stcds["CT"] = "Connecticut";
  $a_stcds["DC"] = "District of Columbia";
  $a_stcds["DE"] = "Delaware";
  $a_stcds["FL"] = "Florida";
  $a_stcds["GA"] = "Georgia";
  $a_stcds["HI"] = "Hawaii";
  $a_stcds["IA"] = "Iowa";
  $a_stcds["ID"] = "Idaho";
  $a_stcds["IL"] = "Illinois";
  $a_stcds["IN"] = "Indiana";
  $a_stcds["KS"] = "Kansas";
  $a_stcds["KY"] = "Kentucky";
  $a_stcds["LA"] = "Louisiana";
  $a_stcds["MA"] = "Massachusetts";
  $a_stcds["MD"] = "Maryland";
  $a_stcds["ME"] = "Maine";
  $a_stcds["MI"] = "Michigan";
  $a_stcds["MN"] = "Minnesota";
  $a_stcds["MO"] = "Missouri";
  $a_stcds["MS"] = "Mississippi";
  $a_stcds["MT"] = "Montana";
  $a_stcds["ND"] = "North Dakota";
  $a_stcds["NE"] = "Nebraska";
  $a_stcds["NH"] = "New Hampshire";
  $a_stcds["NJ"] = "New Jersey";
  $a_stcds["NM"] = "New Mexico";
  $a_stcds["NV"] = "Nevada";
  $a_stcds["NY"] = "New York";
  $a_stcds["OH"] = "Ohio";
  $a_stcds["OK"] = "Oklahoma";
  $a_stcds["OR"] = "Oregon";
  $a_stcds["PA"] = "Pennsylvania";
  $a_stcds["RI"] = "Rhode Island";
  $a_stcds["SC"] = "South Carolina";
  $a_stcds["SD"] = "South Dakota";
  $a_stcds["TN"] = "Tennessee";
  $a_stcds["TX"] = "Texas";
  $a_stcds["UT"] = "Utah";
  $a_stcds["VA"] = "Virginia";
  $a_stcds["VT"] = "Vermont";
  $a_stcds["WA"] = "Washington";
  $a_stcds["WI"] = "Wisconsin";
  $a_stcds["WV"] = "West Virginia";
  $a_stcds["WY"] = "Wyoming";
}
*/
function createNavButtonTop(navText, navURL, btnBG, navHilite) 
{
	
  document.write('<TD WIDTH=100 STYLE="background-color: rgb(176,196,222);">');
  document.write('<A HREF="' + navURL + '" class="' + navHilite + '" style="cursor:hand; text-decoration:none;">');
  document.write('<span class="navTxt"><B>' + navText + '</B></SPAN></A>');
  document.write('</TD>');

	return;
}	

function createNavBoxTop(navButton) 
{
	var navHiClass = "navHilightOff";
	var navBgClass = "btnBGOff";
	
  document.write('<TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=0>');
  document.write('<TR VALIGN=TOP ALIGN=LEFT><TD>');
  document.write('<TABLE ID="NavigationBar1" FRAME=BORDER CELLSPACING=0 CELLPADDING=0>');
  document.write('<TR VALIGN=TOP ALIGN=LEFT>');
  document.write('<TD VALIGN=TOP WIDTH=18 STYLE="background-color: rgb(176,196,222);">&nbsp;</TD>');

	for (buttonName in navButtons) {
    if (buttonName == navButton) 
		{
		  navHiClass = "navHilightOn";
		  navBgClass = "btnBGOn";
		} else 
		{
		  navHiClass = "navHilightOff";
		  navBgClass = "btnBGOff";
		}
    createNavButtonTop(buttonName, navButtons[buttonName], navBgClass, navHiClass);
	}

	document.write('</TR></TABLE></TD></TR>');
	document.write('</TABLE>');
	
	return;
}	

function bld_select_box ( $boxid, $boxnm, $selkey ) {

   stCodes = {"AK" : "Alaska", "AL" : "Alabama", "AR" : "Arkansas", "AZ" : "Arizona", "CA" : "California", "CO" : "Colorado", "CT" : "Connecticut", "DC" : "District of Columbia", "DE" : "Delaware", "FL" : "Florida", "GA" : "Georgia", "HI" : "Hawaii", "IA" : "Iowa", "ID" : "Idaho", "IL" : "Illinois", "IN" : "Indiana", "KS" : "Kansas", "KY" : "Kentucky", "LA" : "Louisiana", "MA" : "Massachusetts", "MD" : "Maryland", "ME" : "Maine", "MI" : "Michigan", "MN" : "Minnesota", "MO" : "Missouri", "MS" : "Mississippi", "MT" : "Montana", "ND" : "North Dakota", "NE" : "Nebraska", "NH" : "New Hampshire", "NJ" : "New Jersey", "NM" : "New Mexico", "NV" : "Nevada", "NY" : "New York", "OH" : "Ohio", "OK" : "Oklahoma", "OR" : "Oregon", "PA" : "Pennsylvania", "RI" : "Rhode Island", "SC" : "South Carolina", "SD" : "South Dakota", "TN" : "Tennessee", "TX" : "Texas", "UT" : "Utah", "VA" : "Virginia", "VT" : "Vermont", "WA" : "Washington", "WI" : "Wisconsin", "WV" : "West Virginia", "WY" : "Wyoming"};
   document.write('<SELECT ID="' + $boxid + '" NAME="' + $boxnm + '">');
	 $selctd = "";
	 for($key in stCodes) {
			if ($key == $selkey) $selctd = " SELECTED";
      document.write('<OPTION VALUE="' + $key + '"' + $selctd + '>' + $key + ' - ' + stCodes[$key] + '</OPTION>');
			$selctd = "";
   }
   document.write('</SELECT>');
	 return;
}

initNavButtons();
//initStateCodes();
