function isWebOSDevice() {
	return (navigator.userAgent.indexOf('Pre/') > -1) || (navigator.userAgent.indexOf('Pixi/') > -1);
}

var stylePopup = {
	'transitionIn'	:	'elastic',
	'transitionOut'	:	'elastic',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'overlayShow'	:	true,
	'overlayColor'  :   '#000',
	'overlayOpacity':   0.7
};

$(document).ready(function() {
	$(".popup-image").fancybox(stylePopup);
	
	if (!isWebOSDevice()) {
		var styleIframe = stylePopup;
		styleIframe.type   = 'iframe';
		styleIframe.width  = '900';
		styleIframe.height = '800';
		
		$(".popup-iframe").fancybox(styleIframe);
		
		$(".popup-youtube").click(function() {
			var styleYoutube = stylePopup;
			styleYoutube.tyle = 'swf';
			styleYoutube.swf  = {
				'wmode': 'transparent',
				'allowfullscreen': 'true'
			}
			styleYoutube.width  = 680;
			styleYoutube.height = 495;
			styleYoutube.href   = this.href.replace(new RegExp("watch\\?v=", "i"), 'v/');
			$.fancybox(styleYoutube);
			return false;
		});
	}
});
