window.addEvent('domready', function() {

	// Tips
	var TipsInfo = new Tips($$('.tips'), {
		maxTitleChars: 150,
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 300, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});
	
	// Ajax Form
	var caption = '';
	var url = '#TB_inline?height=80&width=500&inlineId=callback';
	var group = false;
	if ($('newsForm')){
		$('newsForm').addEvent('submit', function(e) {			
			new Event(e).stop();
			$('callback').empty();	
			this.send({
				update: $('callback'),
				onComplete: function() {
					TB_show(caption, url, group);
				}
			});
		});
	}	
	
	// Diapo galerie
	if ($('linkGalery')){
		var s1 = new SWFObject("CS/swf/imagerotator.swf","rotator","109","80","7");
			s1.addParam("allowfullscreen","true");
			s1.addParam("wmode","transparent");  
			s1.addVariable("file","CS/swf/diapo_galerie.xml");
			s1.addVariable("width","109");
			s1.addVariable("height","80");
			s1.addVariable("shownavigation",false);
			s1.addVariable("screencolor","0x060708");
			s1.addVariable("rotatetime","4");
			s1.addVariable("transition","fade");					   
			s1.write("linkGalery");
	}
		
	// Diapo festival
	if ($('linkFestival')){
		var s2 = new SWFObject("CS/swf/imagerotator.swf","rotator","120","180","7");
			s2.addParam("allowfullscreen","true");
			s2.addParam("wmode","transparent");  
			s2.addVariable("file","CS/swf/diapo_festival.xml");
			s2.addVariable("width","120");
			s2.addVariable("height","180");
			s2.addVariable("shownavigation","false");
			s2.addVariable("screencolor","0x060708");
			s2.addVariable("rotatetime","4");
			s2.addVariable("transition","fade");
			s2.addVariable("linkfromdisplay",true);
			s2.addVariable("linktarget","_blank");  		   
			s2.write("linkFestival");
	}
	
	if ($('innerDiapo')){
		var s3 = new SWFObject("CS/swf/imagerotator.swf","rotator","200","140","7");
			s3.addParam("allowfullscreen","true");
			s3.addParam("wmode","transparent");  
			s3.addVariable("file","CS/swf/diapo_galerie2.xml");
			s3.addVariable("width","200");
			s3.addVariable("height","140");
			s3.addVariable("shownavigation","false");
			s3.addVariable("screencolor","0x060708");
			s3.addVariable("rotatetime","4");
			s3.addVariable("transition","fade");
			s3.addVariable("linkfromdisplay",true);
			s3.addVariable("linktarget","_blank");  		   
			s3.write("innerDiapo");
	}
	
	// Smoothbox dans pop inline
	if ($$('.popInfo')){
		$$('.popInfo a').each(function(elt,index){				
			elt.addEvent('click', function(e){
				//e = new Event(e);
				//alert('ok');
				//TB_remove();
				//e.stop();
			});
		});
	}
	
	P7_Uberlink('uberlink','menulist');
	modiftitle();
	MM_preloadImages('CS/images/bg_puce_hover.gif','CS/images/bg_puce_off.gif');
	/*
	function disableContextMenu(e)	{
		if(!e)	{
			event.cancelBubble = true;
		}
		else {
			if(e.stopPropagation){
				e.stopPropagation();
			}
			else {
				return false; //redundant as not called
			}
		}
	}
	document.oncontextmenu=function(){return false};
	document.oncontextmenu='';
	*/
	
});

function getPop(mail_id){
	
	var popWidth = 630;
	var popHeight = 400;
	var text = '';
	var url = 'esprit.Jazz.Mail.php?mail_id='+ mail_id +'&keepThis=true&TB_iframe=true&height='+ popHeight +'&width='+ popWidth;
	var rel = '';
	
	parent.TB_remove();
	TB_show(text, url, rel).delay(2000);
}
