jQuery(function($) {
	
	var oTm = {
		_delay:6000,
		_msi:false,
		_obj:null,
		_url:null,
		_nbo:0,
		_hgt:0,
		_cpt:1
	};
	
	function TmInit(args) {
		$.extend(oTm, args);
		oTm._nbo = ($(oTm._obj).children().length) - 1;
		oTm._msi = jQuery.browser.msie;
		oTm._hgt = $(oTm._obj).parent().height();
		if(oTm._url != null) {
			$(oTm._obj).click(function () { 
				window.location.href = oTm._url;
    		});
		}
		TmNextTem();
	}
	function TmNextTem() {
		setTimeout(TmHide, oTm._delay);
	}
	function TmHide() {
		$(oTm._obj).fadeOut("fast",TmShow);
	}
	function TmShow() {
		$(oTm._obj).css({"top" : (oTm._cpt * -oTm._hgt) + "px"});
		if(oTm._msi) {
			$(oTm._obj).get(0).style.removeAttribute('filter');
			$(oTm._obj).show();
			TmSetNext();
		}
		else {
			$(oTm._obj).fadeIn("slow",TmSetNext);
		}
	}
	function TmSetNext() {
		if(oTm._cpt < oTm._nbo) {
			oTm._cpt++;
		}
		else {
			oTm._cpt = 0;
		}
		TmNextTem();
	}
	
	TmInit({_obj: "#tmCont", _url:"/temoignages.html"});
	
	$("#chCont").click(function () { 
		window.location.href = "/inscription.html";
	});
	
	
});
