// JavaScript Document
var notes;

$(window).load(function(){
						
		ptFix();
		multiLine();
		DialogDivHide()
	$('.closeBtn').click(function(){								
		$(this).parents('.holNotes').slideUp(500);
		$('.darkBg').hide('slow');
		$.cookie('noteClosed', true, { path: '/',domain: 'bhphotovideo.com', expires: 1 });
		return false;	
	 });
	
$('.okBtn').click(function() {
		$('.darkBg').hide('slow');
		$('.holNotes').css("z-index","1");
		$(this).hide();
		$('.bigNote p').slideUp(500, function(){$('.holNotes h2 span').fadeIn();});
		$('.holNotes .expendBtn').show();
		$('.holNotes').removeClass('expanded');
		$('.holNotes').addClass('collapsed');
		$('.hideBigots').removeClass('hideBigots');
		ptFix();
		$.cookie('noteClosed', true, { path: '/', domain: 'bhphotovideo.com', expires: 1 });
		return false;
	});
	
$('.expendBtn').click(function() {
		$(this).hide();
		$("div.collapsed h2").removeAttr("style")//fix for pt lonnnnnnnng text 
		$('.bigNote p').slideDown(500);
		$('.holNotes h2 span').hide();
		$('.holNotes').removeClass('collapsed');
		$('.holNotes').addClass('expanded');
		$('.holNotes .okBtn').css({"display":"block"});
		return false;
	});
	
// adds class hideBigots to the parent item of embeds and select fields that need to be hidden	

	if($('.holNotes').siblings().hasClass('darkBg')){
		$('.holNotes').css("z-index","9999");
		$('.tBlock, #tContent').addClass('hideBigots');
	}else if($('.holNotes').hasClass('smallNote5')){
		$('#promo').hide();
	}else if($('.holNotes').hasClass('overlayNote')){
		$('.tBlock').addClass('hideBigots');
		if(!($.browser.msie && $.browser.version < 7)){
			$('.holNotes').css("position", "fixed");
		}
	}
});

//fix for pt lonnnnnnnng text 
function ptFix(){
	if($('div.collapsed h2:contains("Pesach")').length == 1)
		$('div.collapsed h2').css("height","48px")
	}

//removes the regular Shabbos Note if a Holiday site closed note is desplayed. (div id="DialogDiv" class="siteClosedMsg") (not the 5minBeforeClosing)
function DialogDivHide(){
	if($(".holSiteClosed" ).length){
		$(".siteClosedMsg").css("display","none");
	}
};
function multiLine() {
  if($("h2.multiLine").length){
  	$(".holNotes .expendBtn").css("top","22px")
  }
}

$(document).ready(function() {
	$("img.planAhead").click(function (){
		$("div.hsa2010MainContainer").show();
		$("div#flashcontent").hide();
		$("div#promo").hide();
		/*$("body > div").css("position", "relative");*/
	});
	$("a.holCloseButton").click(function (){
		$("div.hsa2010MainContainer").hide();
		$("div#flashcontent").show();
		$("div#promo").show();
		/*$("body > div").css("position", "static");*/
	})
	
	$("a.viewSchedule").click(function (){
		$("div.hsa2010MainContainer").show();
		$("div#flashcontent").hide();
		$("div#promo").hide();
		/*$("body > div").css("position", "relative");*/
	});
	$("a.holCloseButton").click(function (){
		$("div.hsa2010MainContainer").hide();
		$("div#flashcontent").show();
		$("div#promo").show();
		/*$("body > div").css("position", "static");*/
	})
});
