var Filmlijst = {
				
		init: function (options) {

			$$('.menu').each(function(item){	
				item.getElements('li.menu_item').each(function(elem){
					var list = elem.getElement('ul');
					var myFx = new Fx.Slide(list).hide();
					elem.addEvents({
						'mouseenter' : function(){
							myFx.cancel();
							myFx.slideIn();
						},
						'mouseleave' : function(){
							myFx.cancel();
							myFx.slideOut();
						}
					});
				}.bind(this));
			});

			url=$('details-url');
			if  (url!=null) {
				url=url.get('text'); 
				if (url!='') this.show_detail(url);
			}
					
			if ($('loading-mask')==null) return;
			$('loading-mask').destroy();
			return;
			
			$('filmlijst').setOpacity(0.3);	
			this.fadeFx = new Fx.Morph($('filmlijst'), {duration: 500, transition: Fx.Transitions.Expo.easeIn});					
			this.fadeFx2 = new Fx.Morph($('loading-mask'), {duration: 500, transition: Fx.Transitions.Expo.easeOut});					

			this.fadeFx2.start({ 
				'opacity': 0.3 
			}).chain(function(){
				$('loading-mask').destroy();
			});

			this.fadeFx.start({ 
				'opacity': 1 
			}).chain(function(){
				//$('loading-mask').destroy();
			});
		},
					
		show_detail: function (url){
			var request = new Request.HTML({				
					url :        	url,
					method: 			"post", 
					data: 				"key="+_key,
    			evalScripts: 	false,
          evalResponse : false, 
          onFailure: function() {alert('Er is iets misgegaan bij de aanroep');},
					onComplete: function(responseTree, responseElements, responseHTML, responseJavaScript) {
		      	$('detail_wrapper').set('html', responseHTML);		      	
          	$exec(responseJavaScript);
					}
			}).send();
		}		
}

// startup
window.addEvent('domready', Filmlijst.init.bind(Filmlijst));
/*
writeCookie(); 

function writeCookie() 
{ 
var today = new Date(); 
var the_date = new Date("December 31, 2023"); 
var the_cookie_date = the_date.toGMTString(); 
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height; 
var the_cookie = the_cookie + ";expires=" + the_cookie_date; 
document.cookie=the_cookie 

*/