dojo.require("dojo.behavior");



/* Logo */
dojo.behavior.add({
	"#logo .hover"	: {
		found	: function(node) {
			node.opacityIn = dojo.animateProperty({
				node		: node,
				duration	: 200,
				properties	: { opacity: 1 }
			});
			node.opacityOut = dojo.animateProperty({
				node: node,
				duration	: 400,
				properties	: { opacity: 0 }
			});
		},
		onmouseenter	: function(e) {
			this.opacityOut.stop();
			this.opacityIn.play();
		},					
		onmouseleave	: function(e) {
			this.opacityIn.stop();
			this.opacityOut.play();
		}
	}
});



/* Recherche rapide */
dojo.behavior.add({
	"#zone_fs"	: {
		found	: function(node) {
			node.styleIn = dojo.animateProperty({
				node		: node,
				duration	: 200,
				properties	: { height: 0, unit: "px" }
			});
		},
		onmouseleave	: function(e) {
			this.styleIn.play();
		}
	}
});



/* Réactions des fiches */
dojo.behavior.add({
	".nbr_reaction"	: {
		found	: function(node) {
			node.styleClick = dojo.animateProperty({
				node		: dojo.query("#ajax_reaction_"+node.id)[0],
				duration	: 400,
				properties	: { height: 110, unit: "px" }
			});
		},
		onclick	: function(e) {
			this.styleClick.play();
			ajax('reaction_read', this.id);
		}
	}
});



// console.debug(dojo.style(dojo.query('.video_play', this)[0], 'visibility'));

