/*
	NOT IN USE
	
	Transferred all code to common.js, this file will be removed

*/

////////////////////////////////////////////////////////////
//	eliminates child margins for an element to be animated
/*
$.fn.safeMargins = function() {
	
	//grab first and last child
	var $firstChild = $(this).children(":first-child");
	var $lastChild = $(this).children(":last-child");
	
	//get their heights
	firstChildHeight = $firstChild.height();
	lastChildHeight = $lastChild.height();
	
	//kill their margins and explicitly set heights
	$firstChild.css({
		marginTop: 0,
		height: firstChildHeight
	});
	
	$lastChild.css({
		marginBottom: 0,
		paddingBottom: 12,
		height: lastChildHeight
	});

	return this;
};
*/

////////////////////////////////////////////////////////////
//	THE FAQ READY FUNCTION
/*
$(function(){
	$("dl.faq").each(function(){
		$(this).children("dt")
			.css({cursor: "pointer"})
			.each(function(){
				$(this)
					.click(function(){
						var $ddAnswer = $(this).next("dd");
						//var $bulletSpan = $(this).find("span.faqBullet");
						
						if ($ddAnswer.is(":hidden")) {
							$(this).addClass("expanded");
							//$bulletSpan.html("&ndash;&nbsp;");
							$ddAnswer.slideDown({
								duration: 500,
								method: "easeInOutQuad"
							});
						} else {
							$(this).removeClass("expanded");
							//$bulletSpan.html("+&nbsp;")
							$ddAnswer.slideUp({
								duration: 500,
								method: "easeInOutQuad"
							});
						}
					})
					//.prepend("<span class='faqBullet'>+&nbsp;</span>")	//write in a span for text bullets
					.hover(function(){		//apply the hover behavior
							$(this).addClass("faqHover");
						}, function(){
							$(this).removeClass("faqHover");	
					});
			});
	
		$("<a class='btn1small faqExpand' href='#'>Expand All</a>")	//write the "expand all/collapse all" button
			.toggle(function(){
					///////////	EXPAND ALL	///////////
					$(this).next("dl.faq")
						.find("dt")
							.addClass("expanded")
							.end()
						.find("dd")				//expand all answers
							.slideDown({
								duration: 500,
								method: "easeInOutQuad"
							});
					$(this).text("Collapse All");	//change text for next click
				},function(){
				////////////	COLLAPSE ALL	///////////
					$(this).next("dl.faq")
						.find("dt")
							.removeClass("expanded")
							.end()
						.find("dd")				//collapse all answers
							.slideUp({
								duration: 500,
								method: "easeInOutQuad"
							});
					$(this).text("Expand All");		//change text for next click
			})
			.insertBefore(this);	//insert the button before the faq
	
		$(this).children("dd")
			.each(function(){
				$(this)
					.safeMargins()	//fix margins for non-ie6 browsers for smooth animation
					.hide();	//hide the answers
			});
	});
});
*/