// JavaScript Document

$(function() {
 
 	
	$("body").append('<div class="apple_overlay" id="overlay"><div class="contentWrap"></div></div>');
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("a[rel*=overlay]").overlay({

		onBeforeLoad: function() {
			$(".contentWrap").html("<img src='"+this.getTrigger().attr("href")+"' width='575' />");
		}

	});
	
	$(".scrollable").scrollable();	
	$(".scrollkeeper").append("<div style='width: 280px; display:block; clear: both;'><p style='text-align:center; color: #55c'>click image to enlarge</p></div>");
	
	
	$("ul.css-tabs").tabs("> div.css-panes > div", {
			effect: 'fade',
			onBeforeClick: function(event, i) {
				var pane = this.getPanes().eq(i);
				//if (pane.is(":empty")) {
					pane.load(this.getTabs().eq(i).attr("href"));
				//}
			}});  
	        
	
});
