$(function() {
 
	// setup overlay actions to buttons

	$("a.showvideo[rel]").overlay({
 
		// use the Apple effect for overlay
		effect: 'apple',		
		
		expose: '#000',				
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},
		
		onClose: function(content) {
			$f().unload();
		}
	});			
	
	$("img[rel]").overlay({
 
		// use the Apple effect for overlay
		effect: 'apple',		
		
		expose: '#000',				
		
		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},
		
		onClose: function(content) {
			$f().unload();
		}
	});				
	
	// install flowplayers
	
	$("a.player").flowplayer("/ajrgfx/flowplayer/flowplayer.commercial-3.2.7.swf", {
		// product key from your account
		key: '#$e0829f54828c53465a6',
		logo: {
			url: '/ajrgfx/flowplayer/alerisph.png',
			fullscreenOnly: false,
			displayTime: 15
		},
		clip:  {
		    autoPlay: true,
		    autoBuffering: true
		  }		

	});
	
	$('#slidefxwrapper').click( function(){
	
		if ($(this).css("marginTop")=='0px'){
			$(this).stop(true, true).animate({ marginTop: 122 }, 500);
		} else {
			$(this).stop(true, true).animate({ marginTop: 0 }, 500);
		}
	
	});

});

