﻿$(document).ready(function(){
  $('.productInfo').hide();
  $('#productOverview').show(); // Show overview on page load
  $('#overviewLink').addClass('selected');
  $('.expandableDiv').hide();

/***********************************
FINDS ALL instances of class
fedIncentive in table class performance
*************************************/
var boolIncentive = false;
$('.performance tr').each(function(){
//alert("there");
    if($(this).hasClass('fedIncentive') && boolIncentive == false){
  // alert("here");
  var dotnet = fGetDotNetPrefix('smallText'); 
      $('#'+dotnet+'msgThermal').after('<div class=\"fedIncentiveText cssPaddingTop10\">&dagger;&nbsp;Federal Incentive Package: windows will meet tax credit requirements of .30 U-Factor & .30 SHGc Value; click <a href=\"http://www.harveybp.com/stimulus_overview.aspx\">here</a> for more information</div>');
    boolIncentive = true;
   }

});





  $('#productDescriptionNav ul li a').click(function(){
    var infoDiv = "product"+$(this).attr('href').substring(1);
    $('.productInfo').hide();
    $('#'+infoDiv).show();
    $('#productDescriptionNav ul li a').removeClass('selected');
    $(this).addClass('selected');
    $(this).blur();
    return false;
  });
 


  $('.productInfo ul li a').click(function(){
    var strID = $(this).attr('id');
if(strID !=undefined){
strID = strID+"Div";
    if ($(this).hasClass('selected')) {
      $(this).removeClass('selected').blur();
      $('#'+strID).hide();
    }else{
      $('.expandableLink').each(function(){    ///  This really doesn't need the 'each' selector yet, but it will once the collapsable divs are added
        if ($(this).hasClass('selected')) {
          var tmpID = $(this).attr('id')+"Div";
          $('#'+tmpID).hide();
          $('#'+strID).show();
          $(this).removeClass('selected');
        }else{$('#'+strID).show();}
      });
      $(this).addClass('selected').blur();
    }
    return false;
   } 
  });

  $('#glossaryLink img').hover(function(){
    $(this).attr('src',$(this).attr('src').replace('.gif','On.gif'));
  },function(){
    $(this).attr('src',$(this).attr('src').replace('On.gif','.gif'));
  }).click(function(){glossaryPop('glossary_pop.html'); return false;});

});
