// JavaScript Document
// Burnt Mountain Llamas for Carothers Country Farm
//Load up jQuery
$(document).ready(function() {
	/* PREP EXPANDABLE MENU */
	prep_menu();
	/* HANDLE THE PHOTO ENLARGEMENTS! */
	$("div.photo_gallery a").each(function(){
		$(this).attr("rel","imagebox");	
	});
	/* float llama pics left */
	$("div.llama_block a img").each(function(){
		//$(this).parent("a").addClass("llamapic");
		$(this).parent("a").attr("rel","imagebox");
	});
	/* img box --MUST-- be init-ed last */
	$.ImageBox.init(
			{
				loaderSRC: '/wp-content/themes/Carothers/images/imagebox/loading.gif',
				closeHTML: '<img src="/wp-content/themes/Carothers/images/imagebox/close.jpg" />'
			}
		);
});
function prep_menu() {
	$("a.toggle").click(function(){
		clicked_item = $(this).attr("id");										 
		target_ul = clicked_item + "_sub";
		current_text = $(this).text();
		current_status = $("#"+target_ul).css("height");
		if(current_status == "0px") {
			current_text = current_text.replace(/\+/, "-");
			$("#"+target_ul).animate({
				height: "110px"
			}, 300, 'swing');
		} else {
			current_text = current_text.replace(/-/, "+");
			$("#"+target_ul).animate({
				height: "0px"
			}, 300, 'swing');
		}
		$(this).text(current_text);
		return false;
	});
}