var myrules = {
	'td.calendar_main_cell' : function(element){
		element.onclick = function(){
			aidii = 'hidden_' + this.id;
			obj = document.getElementById(aidii);
			if(obj.style.display == 'none')
				Effect.Appear(aidii, { queue: { position: 'end', limit: 4, scope: 'clendar'}, to: 0.9, duration: 0.3});
			else
				Effect.Fade(aidii, { queue: { position: 'end', limit: 4, scope: 'clendar'}, duration: 0.3});
		}
	},
	'td.calendar_today_main_cell' : function(element){
		element.onclick = function(){
			aidii = 'hidden_' + this.id;
			
			obj = document.getElementById(aidii);
			if(obj.style.display == 'none')
				Effect.Appear(aidii, { queue: { position: 'end', limit: 4, scope: 'clendar'}, to: 0.9, duration: 0.3});
			else
				Effect.Fade(aidii, { queue: { position: 'end', limit: 4, scope: 'clendar'}, duration: 0.3});
		}
	},
	'.ajax_wrapper' : function(element) {
		element.onclick = function(e) {
			if (!e)
				var e = window.event;
			Event.stop(e);
		}
	},
	'.close_x' : function(element) {
		element.onclick = function() {
			aidii = this.parentNode.id;
			Effect.Fade(aidii, { queue: { position: 'end', limit: 4, scope: 'clendar'}, duration: 0.3});
		}
	},
	'.login' : function(element) {
		element.onclick = function() {
			document.forms['login_form'].submit();
		}
	},
	'.register' : function(element) {
		element.onclick = function() {
			return popitup('register.php',380,350);
		}
	}
	,
	'.event_header' : function(element) {
		element.onclick = function() {
			return popitup(this.href,300,400);
		}
	}
};

Behaviour.register(myrules);