﻿$(document).ready(function(){
$('.expandableDiv').hide();//HIDE all expendableDIV
$('#productOverview').show(); // Show overview on page load

/***********************************
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 as well as Energy Star; click <a href=\"http://www.harveybp.com/Pro/feature.aspx\">here</a> for more information</div>');
//    boolIncentive = true;
//   }
//
//});


/*****************************
ROUND CORNERS FOR THE TABS
*****************************/
$(".navTop").corner("round tr tl 8px");
$(".navBot").corner("round br bl 8px");

/******************************
HOVER FUNCTIONS FOR TABS
******************************/
$(".navTop,.navBot").hover(function(){
//alert("here");
    $(this).children().css({backgroundColor:"#639aba",color:"#ffffff"});
    $(this).css({backgroundColor:"#639aba",color:"#ffffff"});
    //alert("there");
},function(){
    if ($(this).hasClass("selectedNav"))
    {
        $(this).children().css({backgroundColor:"#639aba",color:"#ffffff"});
        $(this).css({backgroundColor:"#639aba",color:"#ffffff"});
    }
    else
    {
        $(this).children().css({backgroundColor:"#dddddd",color:"#757575"});
        $(this).css({backgroundColor:"#dddddd",color:"#757575"});
    }
});
/****************************************
CLICK FUNCTION FOR TABS
****************************************/

$(".navTop,.navBot").click(function(){
    $(".navTop,.navBot").removeClass("selectedNav");
    $(this).addClass("selectedNav");
    $(".navTop,.navBot").css({backgroundColor:"#dddddd",color:"#757575"});
    $(".navTop,.navBot").children().css({backgroundColor:"#dddddd",color:"#757575"});


    $('.productInfo').hide();
    strNavID = $(this).children("a").attr("id");
   // alert(strID);
     var infoDiv = "product"+$("#"+strNavID).attr('href').substring(1);
     //alert(infoDiv);
     $('#'+infoDiv).show();
});


/*****************************************
EXPENDABLE LINK FUNCTIONS
*****************************************/
  $('.expandableLink').click(function(){

    var strID = $(this).attr('id')+"Div";
//alert(strID);
    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 = dotnet+tmpID;
          $('#'+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;});







});


