var oetker;
	if (!oetker) { oetker = {} }
	$.extend(oetker, {
		nyro_options : {},
		VERSION: 'Release 1.2 (2010-04-14)',
		getBrowser: function() {
			b = ''
			if (/chrome/.test( navigator.userAgent.toLowerCase() )) b = 'ch'
			if (/a/[-1]=='a') b = 'ff'
			if (/firefox\/3.6/.test( navigator.userAgent.toLowerCase() )) b = 'ff' // to recognize ff 3.6
			if ('\v'=='v') b = 'ie'
			if (/^function \(/.test([].sort)) b = 'op'
			if (/a/.__proto__=='//') b = 'sf'
			if (b == '') b = 'undefinded'
			return b
		},
		moveLightbox: function(what) {
			var contentHeight = oetker.getDimension('h')
			var contentWidth = oetker.getDimension('w')
			var clientHeight = oetker.getWindowDimension('h')
			var clientWidth = oetker.getWindowDimension('w')
			topPosition = ((clientHeight - contentHeight) / 2) + $(document).scrollTop()
			leftPosition = (clientWidth - contentWidth) / 2
			switch (what) {
				case 'resize' :
					$('#nyroModalWrapper').css('top',topPosition+'px')
					$('#nyroModalWrapper').css('left',leftPosition+'px')
					$('#nyroModalBg').css('width',clientWidth+'px')
					break
				case 'scroll' :
					$('#nyroModalWrapper').css('top',topPosition+'px')
					break
				default :
					//recalculate bg-height for chrome
					if (oetker.getBrowser() == 'ch') {
						$('#nyroModalBg').css('height', $(document).height() + 'px')
					}
					$('#nyroModalWrapper, .wrapperIframe, #nyroModalContent, #nyroModalIframe').css({
						height: contentHeight,
						width: contentWidth
					})
					$('#nyroModalWrapper').css({
						top: topPosition+'px',
						left: leftPosition+'px'
					})
					break
			}
		},
		getWindowDimension: function(what) {
			var windowWidth = 0, windowHeight = 0;
			if( typeof( window.innerWidth ) == 'number' ) {
				windowWidth = document.innerWidth;
				windowHeight = document.innerHeight;
			}
			if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			}
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}
			var returnVal = (what == "w") ? windowWidth : windowHeight;
			return returnVal
		},
		getDimension: function(what) {
			if ( (typeof nyroModalIframe) != "undefined") {
				if (jQuery.browser.msie) {
					var elHeight = nyroModalIframe.document.getElementById('zoomwindowImage').height
					var elWidth = nyroModalIframe.document.getElementById('zoomwindowImage').width
				}
				else {
					var elHeight = document.getElementById('nyroModalIframe').contentDocument.getElementById('zoomwindowImage').height
					var elWidth = document.getElementById('nyroModalIframe').contentDocument.getElementById('zoomwindowImage').width
				}
			} else {
				var elHeight = $("#nyroModalImg").height()
				var elWidth = $("#nyroModalImg").width()
			}
			var returnVal = (what == "w") ? elWidth : elHeight;
			return returnVal
		},
		nyroSetOptions: function(type) {
			nyro_options = {
				forceType: type,
				zIndexStart: 600,
				minWidth: 1,
	  			minHeight: 1,
				windowResize: false,
				resizable: false,
				autoSizable: false,
		    	showBackground: function(elts, settings, callback){elts.bg.css({opacity:0}).fadeTo(200, 0.4, callback)},
				showContent: function(elts, settings, callback){
					elts.contentWrapper
					.css({
						width: settings.width + 'px',
						height: settings.height + 'px',
						opacity: 1
					})
					.fadeIn()
					callback()
					if (type != 'iframe') oetker.moveLightbox('resize')
				},
				hideContent: function(elts, settings, callback) {
					elts.contentWrapper.hide()
					callback()
				},
				css: {
					bg: {height: $(document).height()+'px'},
					loading: {display: 'none'}
				},
				endRemove: function() {if (oetker.getBrowser() != 'ie') $('.frameMain .container').css('zIndex',300)}
			}
			return nyro_options
		}
	})
	$(document).ready(function(e) {
		$(window).scroll(function() { if ($('#nyroModalWrapper').css('display') == 'block') oetker.moveLightbox('scroll') })
		$(window).resize(function() { if ($('#nyroModalWrapper').css('display') == 'block') oetker.moveLightbox('resize') })
		$('.oe-lightbox').click(function(e) {$('.frameMain .container').css('zIndex','-1')}).nyroModal(oetker.nyroSetOptions(''))
		$('.oe-lightbox-iframe').click(function(e) {$('.frameMain .container').css('zIndex','-1')}).nyroModal(oetker.nyroSetOptions('iframe'))
	})
