$(document).ready(function() {

	$('#ironridge_distributor_form, #ironridge_quote_form, #ironridge_contact_form').ketchup();

$('.cfg_help img[title]').tooltip( {
		
		offset:  	[-5, 0]	
		
	});


/* Home page Promo Panels */


$("#product_promos A, .promo_arrow_right A, .promo_arrow_left A").click(function(){
   $("#product_promos DIV").removeClass('promo_nav_on');
	
});


$("#promo_roof_nav A, #enclosure_arrow_right A, #ballast_arrow_left A").click(function(){
	$("#promo_roof_nav").addClass('promo_nav_on');
	$("#promo_array").hide();
	$("#promo_roof").fadeIn();
	$("#promo_pole").hide();
	$("#promo_ground").hide();
	$("#promo_enclosure").hide();
        $("#promo_ballast").hide();
	
   });


$("#promo_ballast_nav A, #roof_arrow_right A, #array_arrow_left A").click(function(){
	$("#promo_ballast_nav").addClass('promo_nav_on');
	$("#promo_array").hide();
        $("#promo_roof").hide();
	$("#promo_ballast").fadeIn();
	$("#promo_pole").hide();
	$("#promo_ground").hide();
	$("#promo_enclosure").hide();
	
   });



$("#promo_array_nav A, #ballast_arrow_right A, #pole_arrow_left A").click(function(){
	$("#promo_array_nav").addClass('promo_nav_on');
	$("#promo_array").fadeIn();
	$("#promo_roof").hide();
	$("#promo_pole").hide();
	$("#promo_ground").hide();
	$("#promo_enclosure").hide();
        $("#promo_ballast").hide();
	
   });

$("#promo_pole_nav A, #array_arrow_right A, #ground_arrow_left A").click(function(){
	$("#promo_pole_nav").addClass('promo_nav_on');
	$("#promo_array").hide();
	$("#promo_roof").hide();
	$("#promo_pole").fadeIn();
	$("#promo_ground").hide();
	$("#promo_enclosure").hide();
        $("#promo_ballast").hide();
	
   });

$("#promo_ground_nav A, #pole_arrow_right A, #enclosure_arrow_left A").click(function(){
	$("#promo_ground_nav").addClass('promo_nav_on');
	$("#promo_array").hide();
	$("#promo_roof").hide();
	$("#promo_pole").hide();
	$("#promo_ground").fadeIn();
	$("#promo_enclosure").hide();
        $("#promo_ballast").hide();
	
   });

$("#promo_enc_nav A, #ground_arrow_right A, #roof_arrow_left A").click(function(){
	$("#promo_enc_nav").addClass('promo_nav_on');
	$("#promo_array").hide();
	$("#promo_roof").hide();
	$("#promo_pole").hide();
	$("#promo_ground").hide();
	$("#promo_enclosure").fadeIn();
        $("#promo_ballast").hide();
	
   });




/*Distributor Map*/
$("#map_menu_us A").click(function(){
	$("#map_menu_us").hide();
	$("#map_menu_int").show();
	$("#map_us").hide();
	$("#map_int").show();
	
});


$("#map_menu_int A").click(function(){
	$("#map_menu_int").hide();
	$("#map_menu_us").show();
	$("#map_us").show();
	$("#map_int").hide();
});



/* Product Pages */

$(".gen_tab P A").click(function(){
   $(".gen_tab").removeClass('gen_tab_selected');

	$("#T1_content").hide();
	$("#T2_content").hide();
	$("#T3_content").hide();
	$("#T4_content").hide();
	$("#T5_content").hide();
});



$("#T1_header P A").click(function(){
	$("#T1_header").addClass('gen_tab_selected');
	$("#T1_content").show();
   });

$("#T2_header P A").click(function(){
	$("#T2_header").addClass('gen_tab_selected');
	$("#T2_content").show();
   });

$("#T3_header P A").click(function(){
	$("#T3_header").addClass('gen_tab_selected');
	$("#T3_content").show();
   });

$("#T4_header P A").click(function(){
	$("#T4_header").addClass('gen_tab_selected');
	$("#T4_content").show();
   });

$("#T5_header P A").click(function(){
	$("#T5_header").addClass('gen_tab_selected');
	$("#T5_content").show();
   });


/* Resources */


$(".resources_button").click(function(){
   $(".resources_button").removeClass('resources_button_selected');
});


$("#resources_button_featured").click(function(){
	$("#resources_button_featured").addClass('resources_button_selected');
	$("#resources_content_featured").show();
	$("#resources_content_certs").hide();
	$("#resources_content_guides").hide();
	$("#resources_content_sheets").hide();
	$("#resources_content_faq").hide();
   });

$("#resources_button_certs").click(function(){
	$("#resources_button_certs").addClass('resources_button_selected');
	$("#resources_content_certs").show();
	$("#resources_content_guides").hide();
	$("#resources_content_sheets").hide();
	$("#resources_content_faq").hide();
	$("#resources_content_featured").hide();
   });

$("#resources_button_guides").click(function(){
	$("#resources_button_guides").addClass('resources_button_selected');
	$("#resources_content_certs").hide();
	$("#resources_content_guides").show();
	$("#resources_content_sheets").hide();
	$("#resources_content_faq").hide();
	$("#resources_content_featured").hide();
   });

$("#resources_button_sheets").click(function(){
	$("#resources_button_sheets").addClass('resources_button_selected');
	$("#resources_content_certs").hide();
	$("#resources_content_guides").hide();
	$("#resources_content_sheets").show();
	$("#resources_content_faq").hide();
	$("#resources_content_featured").hide();
   });

$("#resources_button_faq").click(function(){
	$("#resources_button_faq").addClass('resources_button_selected');
	$("#resources_content_certs").hide();
	$("#resources_content_guides").hide();
	$("#resources_content_sheets").hide();
	$("#resources_content_faq").show();
	$("#resources_content_featured").hide();
   });


/* Distributor Map */
	$('#map_ME').hover(function()
	{
	  $(this).attr("src", "assets/images/map_ME_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_ME_off.png");
	});

	$('#map_NH').hover(function()
	{
	  $(this).attr("src", "assets/images/map_NH_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_NH_off.png");
	});

	$('#map_VT').hover(function()
	{
	  $(this).attr("src", "assets/images/map_VT_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_VT_off.png");
	});

	$('#map_MA').hover(function()
	{
	  $(this).attr("src", "assets/images/map_MA_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_MA_off.png");
	});
	


	/*$('#map_RI').hover(function()
	{
	  $(this).attr("src", "assets/images/map_RI_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_RI_off.png");
	});

	$('#map_CT').hover(function()
	{
	  $(this).attr("src", "assets/images/map_CT_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_CT_off.png");
	});

	$('#map_NY').hover(function()
	{
	  $(this).attr("src", "assets/images/map_NY_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_NY_off.png");
	});

	$('#map_PA').hover(function()
	{
	  $(this).attr("src", "assets/images/map_PA_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_PA_off.png");
	}); */


	$('#map_MD').hover(function()
	{
	  $(this).attr("src", "assets/images/map_MD_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_MD_off.png");
	});
	
	$('#map_OH').hover(function()
	{
	  $(this).attr("src", "assets/images/map_OH_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_OH_off.png");
	});
	
	/*$('#map_VA').hover(function()
	{
	  $(this).attr("src", "assets/images/map_VA_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_VA_off.png");
	});
	
	
	$('#map_TN').hover(function()
	{
	  $(this).attr("src", "assets/images/map_TN_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_TN_off.png");
	});*/
	
	$('#map_FL').hover(function()
	{
	  $(this).attr("src", "assets/images/map_FL_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_FL_off.png");
	});
	
	$('#map_TX').hover(function()
	{
	  $(this).attr("src", "assets/images/map_TX_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_TX_off.png");
	});
	
	$('#map_NM').hover(function()
	{
	  $(this).attr("src", "assets/images/map_NM_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_NM_off.png");
	});
	
	/*$('#map_CO').hover(function()
	{
	  $(this).attr("src", "assets/images/map_CO_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_CO_off.png");
	});*/	

	$('#map_AZ').hover(function()
	{
	  $(this).attr("src", "assets/images/map_AZ_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_AZ_off.png");
	});
	
	$('#map_CA').hover(function()
	{
	  $(this).attr("src", "assets/images/map_CA_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_CA_off.png");
	});
	
	
/*	$('#map_AL').hover(function()
	{
	  $(this).attr("src", "assets/images/map_AL_over.png");
	}, function() {
	  $(this).attr("src", "assets/images/map_AL_off.png");
	});
		
*/	

	
	
/*Library Checkbox All Documents */

$('#cert_checkbox, #size_checkbox, #span_checkbox, #sheet_checkbox, #guide_checkbox ').click(function()
{
	$('#all_docs').removeAttr('checked');
	$('#all_doc_check').attr('value', '1');
	$('#document_product_category').submit();
	
});


$('#product_cats, #product_sub_cat_roof').change(function()
{
	
	if ($('#all_doc_check').attr('value') == '1') {
		$('#all_doc_check').attr('value', '1');
  } else {	
		$('#all_doc_check').attr('value', '0');
		
}; 
	
	$('#document_product_category').submit();
		
});



$('#all_docs').click(function()
{
	$('#cert_checkbox, #size_checkbox, #span_checkbox, #sheet_checkbox, #guide_checkbox').removeAttr('checked');
	$('#all_doc_check').attr('value', '0');
	$('#document_product_category').submit();
	
});





$('.gallery_thumb A').lightBox();
	

});

