
function initMenu(tab)
{
  var myAccordion = new Accordion($$('.toggler'), $$('.accordion'), {
	  display: tab,
	  alwaysHide: true
	});
}

function initAccordion() {
	var accordion = new Accordion('h4.tog', 'div.element', {
		opacity: false
	}, $('accordion2'));
}

function initDiaporama(class_name){
	var diapo = $$('a.diaporama');
	diapo.each(function(item){
		item.addEvent('click', function(e) {
			e = new Event(e);
			$('large').innerHTML = '<img src="'+item.href+'" alt="'+item.title+'" title="'+item.title+'" class="'+class_name+'" />';
			e.stop();
		});
	});	
}	

// http://davidwalsh.name/mootools-12-tooltips-customize
// http://www.mootools.net/docs/Plugins/Tips
function showTips(cssTip, cssName) // Montre les bulles d'infos
{
     $$(cssTip).each(function(element,index) {  
         var content = element.get('title').split('::');  
         element.store('tip:title', content[0]);
         element.store('tip:text', content[1]);
     });
       
     //create the tooltips  
     var myTips  = new Tips(cssTip,{  
         className: cssName,
         fixed: false,  
         hideDelay: 50,  
         showDelay: 50,
         offsets: {'x': -72, 'y': -133}
     });  
}


function initLightBox(){
	SqueezeBox.initialize({
		size: {x: 350, y: 400},
		ajaxOptions: {
		method: 'get',
		evalScripts: true
	}
	});
	$ES('a.boxed').each(function(el) {
		el.addEvent('click', function(e) {
			e.stop();
			if (SqueezeBox.fromElement(el)) e.stop();
		}.bindWithEvent(el));
	});
}











/****************************************************************************************************/

window.onload = function () {
		if (self.dispCO) { dispCO(); }
		window.onresize = dispCO;
/*		jQuery(function()
		{
			jQuery('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth: 12, arrowSize: 16, dragMinHeight: 50 });
		});*/
}

function dispCO()
{
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}
	if (winW<1100) hideContent('comocean');
	else displayContent('comocean');
}

function hideContent(id) {
  if(document.getElementById(id)) document.getElementById(id).style.display='none'; return null;
}

function displayContent(id) {
  if(document.getElementById(id)) document.getElementById(id).style.display='block'; return null;
}
