/**
 * Controller for medizinwelten-services.com
 * (c) 2011, M.Sc. Benjamin Zaiser, info@benjamin-zaiser.de
 */
var agent = navigator.userAgent.toLowerCase();
var is_iphone = (agent.indexOf('iphone') != -1 || agent.indexOf('ipad') != -1) ? true : false; 

$(document).ready(function(){

	if(!is_iphone){
		// setup button action. it will fire our overlay 
		$("a[rel]").overlay({

			// use the Apple effect for overlay
			//effect: 'apple',
			// some mask tweaks suitable for facebox-looking dialogs
	//		mask: {
	//			// you might also consider a "transparent" color for the mask
	//			color: '#fff',
	//			// load mask a little faster
	//			loadSpeed: 300,
	//			// very transparent
	//			opacity: 0.5
	//		}, 

			// when overlay is opened, load our player
			onLoad: function() {
				this.getOverlay().find("a.player").flowplayer(0).load();
			},

			// when overlay is closed, unload our player
			onClose: function() {
				$f().unload();
			}
		});
		
		// install flowplayers
		//$("a.player").flowplayer("http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf"); 
	}
});
