/*
 *	Custom jQuery for Tandem Marketing Site
 * 	Author: James Lay
 */
	//fade toggle script
    jQuery.fn.fadeToggle = function(speed, easing, callback) {
	   	return this.animate({opacity: 'toggle'}, speed, easing, callback);
	};
	
	// jbGallery Custom Settings
    jQuery(document).ready(function(){
		jQuery(".jbgallery").jbgallery({
			menu : "numbers", 
			style: "zoom", 
		});
	});

	// #docs, #docs-opacity divs settings
	jQuery(document).ready(function(){
		jQuery("#docs-opacity").height(jQuery("#docs").height()).css("opacity","0.5");
		jQuery('a.blank').each(function(){
            this.target = "_blank";
        });
        jQuery('<a id="toggle-tandem" href="#">A spare bedroom</a>').click(function(){
            jQuery("#docs, #docs-opacity").fadeToggle();
            return false;
		 })
        .prependTo("body");
        //.trigger("click");
	});
	
	// Close About #docs, #docs-opacity divs
	$(document).ready(function(){
		$("#docs .delete").click(function(){
			$("#docs-opacity, #docs").animate({ opacity: 'hide' }, "fast");
		});
	});

jQuery(document).ready(function(){
		var _clicked = false;
		jQuery(".jbgallery").jbgallery({menu : "simple", fade : false, after : function(){
			if (!_clicked) {
				jQuery(".jbg-info").click();
				_clicked = true;
			}
		}});
	});
