
$(document).ready(function(){	
		 $("#askalib").click(function(){
 //check to see if the panel is already open and close it if it is
 if ($("#askembed").hasClass('open')){
 $("#askembed").stop(false, true).animate({height: 'toggle'}, 500).removeClass("open").addClass("hidden");
 return false;
 }
 //if it doesn't, open it.
 else{
 $("#askembed").stop(false, true).animate({height: 'toggle'}, 500).removeClass("hidden").addClass("open");
 return false;
}
 }); 				   
						   
						   
	//TABS CODE FROM LIB CUSTOM for multiple tabbed boxes on same page
	
	$(".tabs1 .tab:nth-child(1), .tabs2 .tab:nth-child(1)").addClass("first");
	
	
	var tabClick = function(selector) {
		$(selector+' h2').click(function(){
			$(selector+" .tab.on").removeClass('on');
			$(this).parent().addClass('on');
			$(selector+" .tab .tab_content1").hide();
			showTheOnTab(selector);
		});
	};
	
	var showTheOnTab = function(selector){
		$(selector+" .tab.on .tab_content1").show();
		tab_height = $(selector+" .tab.on .tab_content1").height();
		tabs_container_height = (tab_height + 30) + 'px';
		$(selector).css('height',tabs_container_height);
	};
	//Add your parent tab box selectors here
	tabArray = ['.tabs1','.tabs2'];
	//iterate through each selector adding necesarry click functions and setups.
	$(tabArray).each (function(index,item){
	 		$(item+" .tab_content1").hide();
			showTheOnTab(item);
			tabClick(item);
	});
	
});
