// JavaScript Document

function verif_comment(){
	nb_er = 0;
	
	if (document.envoi_comment.pseudo.value == "" || document.envoi_comment.pseudo.value == "Ce champ est obligatoire" ){
       nb_er++;
	   document.envoi_comment.pseudo.value = "Ce champ est obligatoire";
    }
	if (document.envoi_comment.commentaire.value == "" || document.envoi_comment.commentaire.value == "Ce champ est obligatoire" ){
       nb_er++;
	   document.envoi_comment.commentaire.value = "Ce champ est obligatoire";
    }
	
	if(nb_er>0){
		return false;
	}
	
}

	function init() {
		if (arguments.callee.done) return;
		arguments.callee.done = true;
		
		//alert('page loadee');		
	};
	
	/* for Mozilla */
	if (document.addEventListener) {
		document.addEventListener("DOMContentLoaded", init, false);
	}
	
	
	var Site = {
	
	start: function(){
		Site.appearText();
				description = new Fx.Style('description', 'height', {
			duration: 1000, 
			transition: Fx.Transitions.quartInOut
		});
		description.start(0,135); 

	},
	
	appearText: function(){
		var timer = 0;
		var sideblocks = $$('#content h1, #content h2, #col1 h2,#col2 h2');
		
		var slidefxs = [];
		var colorfxs = [];
		
		sideblocks.each(function(el, i){
			el.setStyle('margin-left', '200px');
			timer += 150;
			slidefxs[i] = new Fx.Style(el, 'margin-left', {
				duration: 400,
				transition: Fx.Transitions.backOut,
				wait: false,
				onComplete: Site.createOver.pass([el, i])
			});
			slidefxs[i].start.delay(timer, slidefxs[i], 0);

		}, this);
	},
	
	createOver: function(el, i){
		var first = el.getFirst();
		if (!first || first.getTag() != 'a') return;
		var overfxs = new Fx.Styles(first, {'duration': 200, 'wait': false});
		if (first.hasClass('big')){
			var tocolor = '333';
			var fromcolor = 'fff';
		} else {
			var tocolor = 'faec8f';
			var fromcolor = '666';
		}
		el.addEvent('mouseover', function(){
			overfxs.start({
				'color': tocolor,
				'margin-left': 10
			});
		});
		el.addEvent('mouseout', function(){
			overfxs.start({
				'color': fromcolor,
				'margin-left': 0
			});
		});
	}
	
};


window.addEvent('domready', Site.start);
