// JavaScript Document

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function createHeaderTopLeft() {

var headerTopLeftHtml = '';

headerTopLeftHtml += '<div id="topNav">'+
    '<a href="index.html"><img src="images/bn-home.gif" alt="Home" name="home" width="72" height="35" border="0" id="home" onmouseover=MM_swapImage("home","","images/bn-home-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
      '<a href="2-about.html"><img src="images/bn-about.gif" alt="About Us" name="about" width="79" height="35" border="0" id="about" onmouseover=MM_swapImage("about","","images/bn-about-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
		'<a href="3-capabilities.html"><img src="images/bn-capabilities.gif" alt="Capabilities" name="capabilities" width="118" height="35" border="0" id="capabilities" onmouseover=MM_swapImage("capabilities","","images/bn-capabilities-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
        '<a href="4-products.html"><img src="images/bn-products.gif" alt="" name="products" width="105" height="35" border="0" id="products" onmouseover=MM_swapImage("products","","images/bn-products-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
		'<a href="5-tools.html"><img src="images/bn-tools.gif" alt="Tools" name="tools" width="77" height="35" border="0" id="tools" onmouseover=MM_swapImage("tools","","images/bn-tools-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
        '<a href="6-contact.html"><img src="images/bn-contact.gif" alt="Contact" name="contact" width="117" height="35" border="0" id="contact" onmouseover=MM_swapImage("contact","","images/bn-contact-o.gif",1) onmouseout="MM_swapImgRestore()" /></a>'+
        '</div>'+
        '<div id="logo"><img src="images/logo.gif" width="218" height="80" alt="Chapin & Bangs" /></div>';

document.getElementById('headerTopLeft').innerHTML = headerTopLeftHtml;
}


function createHeaderTopRight() {

var headerTopRightHtml = '';

headerTopRightHtml += '<div id="phone"><p>1-800-972-9615</p></div>'+
    '<div id="icons">'+
      '<span class="tagline">Steel Service Center</span> '+
		'<img src="images/icon-divider.gif" width="14" height="36" alt=""  align="absmiddle" style="padding-bottom:5px;padding-left:3px;"  />'+
        '<a href="index.html"><img src="images/icon-home.gif" alt="" width="33" height="36" border="0"  align="absmiddle" style="padding-bottom:5px;" /></a>'+
		'<a href="6-contact.html"><img src="images/icon-email.gif" alt="" width="35" height="36" border="0" align="absmiddle" style="padding-bottom:5px;" /></a>'+
        '</div>';

document.getElementById('headerTopRight').innerHTML = headerTopRightHtml;
}




function createCurveTop() {

var curveTopHtml = '';

curveTopHtml += '<img src="images/curved-top.gif" width="900" height="25" alt="" />';

document.getElementById('topCurve').innerHTML = curveTopHtml;
}




function createCurveBottom() {

var curveBottomHtml = '';

curveBottomHtml += '<img src="images/curve-bottom.gif" width="900" height="25" alt="" />';

document.getElementById('bottomCurve').innerHTML = curveBottomHtml;
}




function createFooterRight() {
	// getting this year
	var thisYear = new Date;
	
	var footerHtml = '';
	
	footerHtml += '<p><a href="#" class="footerMainNav">Chapin & Bangs</a></p>'+
	'<p class="footerContact"><em>165 River Street, Bridgeport, CT 06604<br>Chapin & Bangs &copy; Copyright ' + thisYear.getFullYear() + '</em></p>'; 
	

										
	document.getElementById('footerRight').innerHTML = footerHtml;
}

function createFooterLeft() {

var footerHtml = '';

footerHtml += '<table border="0" cellspacing="0" cellpadding="0">'+
    '<tr>'+
      '<td id="footerLinksOne" valign="top">'+
		'<p><a href="index.html" class="footerMainNav">Home</a></p>'+
        '<p><a href="2-about.html" class="footerMainNav">About</a></p>'+
		'<p><a href="6-contact.html" class="footerMainNav">Contact Us</a></p>'+
        '<p class="footerContact">1-800-972-9615<br />'+
        'Tel: 203-333-4183<br />'+
        'Fax: 203-334-8538<br />'+
		'<a href="mailto:sales@cbsteel.com" class="footerContactLink">sales@cbsteel.com</a></p>'+
      '</td>'+
      '<td id="footerLinksTwo" valign="top">'+
      '<p><a href="3-capabilities.html" class="footerMainNav">Capabilities</a></p>'+
       '<p><a href="3a-watercutting.html" class="footerSubNav">Waterjet Cutting</a><br />'+
       '<p><a href="3b-lasercutting.html" class="footerSubNav">Laser Cutting</a><br />'+
       '<a href="3c-plasmacutting.html" class="footerSubNav">Plasma Cutting</a><br />'+
       '<a href="3d-additionalcutting.html" class="footerSubNav">Flame Cutting, <br />Sawing & Sheering</a><br />'+
       '<a href="3e-delivery.html" class="footerSubNav">Delivery</a><br />'+
       '<a href="3f-service.html" class="footerSubNav">Just-In-Time Service & Special Stocking Programs</a></p>'+
      '</td>'+
      '<td id="footerLinksThree" valign="top">'+
      '<p><a href="4-products.html" class="footerMainNav">Products</a></p>'+
       '<p><a href="4a-structuralsteel.html" class="footerSubNav">Structural Steel</a><br />'+
       '<a href="4b-plate.html" class="footerSubNav">Plate – Carbon & Alloy</a><br />'+
       '<a href="4c-sheetproducts.html" class="footerSubNav">Sheet Products</a><br />'+
       '<a href="4d-expandedmetal.html" class="footerSubNav">Expanded Metal & Grating</a><br />'+
       '<a href="4e-tubing.html" class="footerSubNav">Tubing</a><br />'+
       '<a href="4f-carbonsteel.html" class="footerSubNav">Carbon Steel Bars</a><br />'+
       '<a href="4g-alloysteel.html" class="footerSubNav">Alloy Steel Bars</a><br />'+
       '<a href="4h-stainless.html" class="footerSubNav">Stainless Products</a><br />'+
		'<a href="4i-data.html" class="footerSubNav">Data</a></p>'+
      '</td>'+
	  '<td id="footerLinksFour" valign="top">'+
      '<p><a href="5-tools.html" class="footerMainNav">Tools</a></p>'+
       '<p><a href="pdf/Credit-Application.pdf" class="footerSubNav">Credit Application (pdf)</a><br />'+
       '<a href="pdf/Connecticut.pdf" class="footerSubNav">CT Tax Form (pdf)</a><br />'+
       '<a href="pdf/Massachusetts.pdf" class="footerSubNav">MA Tax Form (pdf)</a><br />'+
       '<a href="pdf/New-York.pdf" class="footerSubNav">NY Tax Form (pdf)</a><br />'+
       '<a href="pdf/Rhode-Island.pdf" class="footerSubNav">RI Tax Form (pdf)</a><br />'+
       '<a href="pdf/Catalog.pdf" class="footerSubNav">Full Catalog (pdf)</a></p>'+
      '</td>'+

    '</tr>'+
  '</table>';

document.getElementById('footerLeft').innerHTML = footerHtml;
}


function activateHomeButton() {
	document.home.src = "images/bn-home-o.gif";	
}

function activateAboutButton() {
	document.about.src = "images/bn-about-o.gif";	
}
function activateCapabilitiesButton() {
	document.capabilities.src = "images/bn-capabilities-o.gif";	
}
function activateProductsButton() {
	document.products.src = "images/bn-products-o.gif";	
}
function activateToolsButton() {
	document.tools.src = "images/bn-tools-o.gif";	
}
function activateContactButton() {
	document.contact.src = "images/bn-contact-o.gif";	
}
