$(function() {		
		
	// positions for each overlay
	/* var positions = [ 
		[0, 	530],
		[400, 20] 
	];	*/
		
	// setup triggers
	$("a[rel]").each(function(i) {
			
		$(this).overlay({

			// common configuration for each overlay
			oneInstance: false, 
			// closeOnClick: false, 
			 
			// setup custom finish position
			/* top: positions[i][0],
			left: positions[i][1], */
			
			// use apple effect
			effect: 'apple',

			onBeforeLoad: function() {

			// grab wrapper element inside content
			var wrap = this.getContent().find(".contentWrap");

			// load the page specified in the trigger
			
			if (this.getTrigger().attr("href") != '#') {
				wrap.load(this.getTrigger().attr("href"));
			}
		}

			
		});			
	});

	$("area[rel]").each(function(i) {
			
		$(this).overlay({

			// common configuration for each overlay
			oneInstance: false, 
			// closeOnClick: false, 
			 
			// setup custom finish position
			/* top: positions[i][0],
			left: positions[i][1], */
			
			// use apple effect
			effect: 'apple',

			onBeforeLoad: function() {

			// grab wrapper element inside content
			var wrap = this.getContent().find(".contentWrap");

			// load the page specified in the trigger
			
			if (this.getTrigger().attr("href") != '#') {
				wrap.load(this.getTrigger().attr("href"));
			}
		}

			
		});			
	});	
	
	
});


$(function() {
	$("#apple img[rel]").overlay({effect: 'apple'});
});

$(function() {     
// setup ul.tabs to work as tabs for each div directly under div.panes     
$("ul.menu").tabs("div.pd-info > div"); 
});

$(document).ready(function() {
	 
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.li_top').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.li_top').removeClass('on');
		  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.pane').slideUp('normal');
   
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			
			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');
			  
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		 } 
		  
	 });
	 
	 
	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.li_top2').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.li_top2').removeClass('on');
		  
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.pane2').slideUp('normal');
   
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			
			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');
			  
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		 } 
		  
	 });	 
	  

	
	
});
