﻿var loadLink = ""; var menuEffects = new Class({ initialize: function(selector, options) { this.options = Object.extend({ subElement: false, subElementSelector: 'a', slideIn: false, slideInDelayed: false, slideInDelay: 150, slideInProperty: 'margin-top', slideInRange: ['-30', '0']
}, options || {})
this.selector = selector; this.currTimer = 500; if (this.options.slideIn)
{ $A($E(selector).childNodes).each(function(el){ if ($type(el) == 'element')
{ el = $(el); if (this.options.subElement)
el = el.getElement(this.options.subElementSelector); this.slideIn(el); this.addSpecialEffects(el);}
}, this);}
if (this.options.slideOut)
{ $ES('a').each(function (element) { if (!(element.hasClass('QE_Link') | element.hasClass('download')))
{ element.onclick = function() { loadLink = function ()
{ document.location = this.href;}
mainContentEffect = new Fx.Style($E('.navigation ul'), 'opacity', { duration: 300, onComplete: loadLink.bind(this)
}); mainContentEffect.custom(1, 0); return false;};}
});}
$ES(selector + ' li ul').each(function(el) { el.setStyles({ 'display': 'block', 'opacity': 0
}); elParent = $(el.parentNode); currentMenu = new Fx.Style(el, 'opacity'); elParent.addEvents({ 'mouseover': function(submenu, myParent) { myParent.addClass('hover'); submenu.clearTimer(); submenu.custom(1);}.pass([currentMenu, elParent]), 'mouseout': function(submenu, myParent) { myParent.removeClass('hover'); submenu.clearTimer(); submenu.custom(0);}.pass([currentMenu, elParent])
})
}.bind(this));}, slideIn: function(el)
{ $(el).setStyle(this.options.slideInProperty, this.options.slideInRange[0] + "px"); var effect = el.effect(this.options.slideInProperty, {transition: Fx.Transitions.elasticOut, duration: 1000}); if (this.options.slideInDelayed)
{ effect.custom.delay(this.currTimer, effect, this.options.slideInRange); this.currTimer += this.options.slideInDelay;} else
effect.custom.delay(this.options.slideInDelay, effect, this.options.slideInRange);}, slideOut: function(el)
{ var effect = el.effect(this.options.slideOutProperty, {transition: Fx.Transitions.elasticOut, duration: 1000}); window.addEvent('beforeunload', function (effect) { effect.custom.pass(this.options.slideInRange, effect);}.pass(effect, this) );}, addSpecialEffects: function(el)
{ if (!$(el.parentNode).hasClass('active'))
{ el.setStyles({ 'borderTopWidth': '0px', 'borderTopColor': '#000', 'borderTopStyle': 'solid'
}); currentItem = new Fx.Style(el, 'borderTopWidth', {transition: Fx.Transitions.backOut, duration: 800}); $(el.parentNode).addEvents({ 'mouseover': function(itemBorder) { itemBorder.clearTimer(); itemBorder.custom(5);}.pass(currentItem), 'mouseout': function(itemBorder) { itemBorder.clearTimer(); itemBorder.custom(0);}.pass(currentItem)
})
}
}
}); function processMenuEffects (){ var myMenus = new menuEffects('.navigation ul', { slideIn: true, slideInDelayed: true, slideOut: true, subElement: true
});}
window.onDomReady(processMenuEffects); window.addEvent('domready', TB_init); TB_WIDTH = 0; TB_HEIGHT = 0; var TB_doneOnce = 0 ; function TB_init(){ $$("a.smoothbox").each(function(el){el.onclick=TB_bind});}
function TB_bind(event) { var event = new Event(event); event.preventDefault(); this.blur(); var caption = this.title || this.name || ""; var group = this.rel || false; TB_show(caption, this.href, group); this.onclick=TB_bind; return false;}
function TB_show(caption, url, rel) { if ( !$("TB_overlay") )
{ new Element('iframe').setProperty('id', 'TB_HideSelect').injectInside(document.body); $('TB_HideSelect').setOpacity(0); new Element('div').setProperty('id', 'TB_overlay').injectInside(document.body); $('TB_overlay').setOpacity(0); TB_overlaySize(); new Element('div').setProperty('id', 'TB_load').injectInside(document.body); $('TB_load').innerHTML = "<img src='data/loading.gif' />"; TB_load_position(); new Fx.Style('TB_overlay', 'opacity',{duration: 400, transition: Fx.Transitions.sineInOut}).start(0,0.6);}
if ( !$("TB_load") )
{ new Element('div').setProperty('id', 'TB_load').injectInside(document.body); $('TB_load').innerHTML = "<img src='data/loading.gif' />"; TB_load_position();}
if ( !$("TB_window") )
{ new Element('div').setProperty('id', 'TB_window').injectInside(document.body); $('TB_window').setOpacity(0);}
$("TB_overlay").onclick=TB_remove; window.onscroll=TB_positionEffect; var baseURL = url.match(/(.+)?/)[1] || url; var imageURL = /\.(jpe?g|png|gif|bmp)/gi; if ( baseURL.match(imageURL) ) { var dummy = { caption: "", url: "", html: "" }; var prev = dummy, next = dummy, imageCount = ""; if ( rel ) { function getInfo(image, id, label) { return { caption: image.title, url: image.href, html: "<span id='TB_" + id + "'>&nbsp;&nbsp;<a href='#'>" + label + "</a></span>"
}
}
var imageGroup = [] ; $$("a.smoothbox").each(function(el){ if (el.rel==rel) {imageGroup[imageGroup.length] = el ;}
})
var foundSelf = false; for (var i = 0; i < imageGroup.length; i++) { var image = imageGroup[i]; var urlTypeTemp = image.href.match(imageURL); if ( image.href == url ) { foundSelf = true; imageCount = "Image " + (i + 1) + " of "+ (imageGroup.length);} else { if ( foundSelf ) { next = getInfo(image, "next", "Next &gt;"); break;} else { prev = getInfo(image, "prev", "&lt; Prev");}
}
}
}
imgPreloader = new Image(); imgPreloader.onload = function() { imgPreloader.onload = null; var x = window.getWidth() - 150; var y = window.getHeight() - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y;}
} else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x;}
}
TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("TB_window").innerHTML += "<a href='' id='TB_ImageOff' title='Fermer'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + imageCount + prev.html + next.html + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Fermer'>Fermer</a></div>"; $("TB_closeWindowButton").onclick = TB_remove; function buildClickHandler(image) { return function() { $("TB_window").remove(); new Element('div').setProperty('id', 'TB_window').injectInside(document.body); TB_show(image.caption, image.url, rel); return false;};}
var goPrev = buildClickHandler(prev); var goNext = buildClickHandler(next); if ( $('TB_prev') ) { $("TB_prev").onclick = goPrev;}
if ( $('TB_next') ) { $("TB_next").onclick = goNext;}
document.onkeydown = function(event) { var event = new Event(event); switch(event.code) { case 27:
TB_remove(); break; case 190:
if( $('TB_next') ) { document.onkeydown = null; goNext();}
break; case 188:
if( $('TB_prev') ) { document.onkeydown = null; goPrev();}
break;}
}
$("TB_ImageOff").onclick = TB_remove; TB_position(); TB_showWindow();}
imgPreloader.src = url;} else { var queryString = url.match(/\?(.+)/)[1]; var params = TB_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30; TB_HEIGHT = (params['height']*1) + 40; var ajaxContentW = TB_WIDTH - 30, ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){ urlNoQuery = url.split('TB_'); $("TB_window").innerHTML += "<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Fermer'>Fermer</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' onload='TB_showWindow()'> </iframe>";} else { $("TB_window").innerHTML += "<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Fermer</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>";}
$("TB_closeWindowButton").onclick = TB_remove; if(url.indexOf('TB_inline') != -1){ $("TB_ajaxContent").innerHTML = ($(params['inlineId']).innerHTML); TB_position(); TB_showWindow();}else if(url.indexOf('TB_iframe') != -1){ TB_position(); if(frames['TB_iframeContent'] == undefined){ $(document).keyup( function(e){ var key = e.keyCode; if(key == 27){TB_remove()} }); TB_showWindow();}
}else{ var handlerFunc = function(){ TB_position(); TB_showWindow();}; var myRequest = new Ajax(url, {method: 'get',update: $("TB_ajaxContent"),onComplete: handlerFunc}).request();}
}
window.onresize=function(){ TB_position(); TB_load_position(); TB_overlaySize();}
document.onkeyup = function(event){ var event = new Event(event); if(event.code == 27){ TB_remove();}
}
}
function TB_showWindow(){ if (TB_doneOnce==0) { TB_doneOnce = 1; var myFX = new Fx.Style('TB_window', 'opacity',{duration: 250, transition: Fx.Transitions.sineInOut, onComplete:function(){if ($('TB_load')) { $('TB_load').remove();}} }).start(0,1);} else { $('TB_window').setStyle('opacity',1); if ($('TB_load')) { $('TB_load').remove();}
}
}
function TB_remove() { $("TB_overlay").onclick=null; document.onkeyup=null; document.onkeydown=null; if ($('TB_imageOff')) $("TB_imageOff").onclick=null; if ($('TB_closeWindowButton')) $("TB_closeWindowButton").onclick=null; if ( $('TB_prev') ) { $("TB_prev").onclick = null;}
if ( $('TB_next') ) { $("TB_next").onclick = null;}
new Fx.Style('TB_window', 'opacity',{duration: 250, transition: Fx.Transitions.sineInOut, onComplete:function(){$('TB_window').remove();} }).start(1,0); new Fx.Style('TB_overlay', 'opacity',{duration: 400, transition: Fx.Transitions.sineInOut, onComplete:function(){$('TB_overlay').remove();} }).start(0.6,0); window.onscroll=null; window.onresize=null; $('TB_HideSelect').remove(); TB_init(); TB_doneOnce = 0; return false;}
function TB_position() { $("TB_window").setStyles({width: TB_WIDTH+'px', left: (window.getScrollLeft() + (window.getWidth() - TB_WIDTH)/2)+'px', top: (window.getScrollTop() + (window.getHeight() - TB_HEIGHT)/2)+'px'});}
function TB_positionEffect() { new Fx.Styles('TB_window', {duration: 75, transition: Fx.Transitions.sineInOut}).start({ 'left':(window.getScrollLeft() + (window.getWidth() - TB_WIDTH)/2)+'px', 'top':(window.getScrollTop() + (window.getHeight() - TB_HEIGHT)/2)+'px'});}
function TB_overlaySize(){ $("TB_overlay").setStyles({"height": '0px', "width": '0px'}); $("TB_HideSelect").setStyles({"height": '0px', "width": '0px'}); $("TB_overlay").setStyles({"height": window.getScrollHeight()+'px', "width": window.getScrollWidth()+'px'}); $("TB_HideSelect").setStyles({"height": window.getScrollHeight()+'px',"width": window.getScrollWidth()+'px'});}
function TB_load_position() { if ($("TB_load")) { $("TB_load").setStyles({left: (window.getScrollLeft() + (window.getWidth() - 56)/2)+'px', top: (window.getScrollTop() + ((window.getHeight()-20)/2))+'px',display:"block"});}
}
function TB_parseQuery ( query ) { if( !query )
return {}; var params = {}; var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var pair = pairs[i].split('='); if ( !pair || pair.length != 2 )
continue; params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' ');}
return params;}
function alertes()
{ return true;}
window.onerror=alertes; var newWindow = null; window.addEvent('domready', function(){ var szNormal = 61, szSmall = 50, szFull = 780; var pages = $$("#pages .page"); var fx = new Fx.Elements(pages, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut}); pages.each(function(page, i) { page.addEvent("mouseenter", function(event) { var o = {}; o[i] = {width: [page.getStyle("width").toInt(), szFull]}
pages.each(function(other, j) { if(i != j) { var w = other.getStyle("width").toInt(); if(w != szSmall) o[j] = {width: [w, szSmall]};}
}); fx.start(o);});}); $("pages").addEvent("mouseleave", function(event) { var o = {}; pages.each(function(page, i) { o[i] = {width: [page.getStyle("width").toInt(), szNormal]}
}); fx.start(o);})
}); var MooTips = new Class({ options: { onShow: function(tip){ tip.setStyle('visibility', 'visible');}, onHide: function(tip){ tip.setStyle('visibility', 'hidden');}, showOnClick: false, showOnMouseEnter: true, maxTitleChars: 30, showDelay: 100, hideDelay: 100, className: 'tool', offsets: {'x': 16, 'y': 16}, fixed: false, loadingText: 'Loading...', errTitle: 'Error...', errText: 'There was a problem retrieving the contents of this tooltip.', evalAlways: false
}, initialize: function(elements, options){ this.setOptions(options); this.toolTip = new Element('div', { 'class': this.options.className + '-tip', 'styles': { 'position': 'absolute', 'top': '0', 'left': '0', 'visibility': 'hidden'
}, 'events': { 'mouseenter': function(event){ this.setProperty('state','mouseenter');}, 'mouseleave': function(event){ this.setProperty('state','mouseleave'); this.pather.end(event);}
}
}).inject(document.body); this.toolTip.pather = this; this.wrapper = new Element('div').inject(this.toolTip); $$(elements).each(this.buildEvents, this); $$(elements).each(this.build, this); if (this.options.initialize) this.options.initialize.call(this);}, buildEvents: function(el) { if (this.options.showOnClick) { el.addEvent('click', function(event){ this.start(el); if (!this.options.fixed) this.locate(event); else this.position(el);}.bindWithEvent(this));}
if (this.options.showOnMouseEnter) { el.addEvent('mouseenter', function(event){ this.start(el); if (!this.options.fixed) this.locate(event); else this.position(el);}.bind(this));}
if (!this.options.fixed) el.addEvent('mousemove', this.locate.bindWithEvent(this)); var end = this.end.bind(this); el.addEvent('mouseleave', end); el.addEvent('trash', end);}, build: function(el){ el.$tmp.myTitle = (el.href && el.getTag() == 'a') ? el.href.replace('http://', '') : (el.rel || false); if (el.title){ if (el.title.test('^DOM:', 'i')) { el.title = $(el.title.split(':')[1].trim()).innerHTML;} else if (el.title.test('^AJAX:', 'i')) { el.title = this.options.loadingText + '::' + el.title;} else if (el.title.test('^EVAL:', 'i')) { el.title = this.options.loadingText + '::' + el.title;}
var dual = el.title.split('::'); if (dual.length > 1) { el.$tmp.myTitle = dual[0].trim(); el.$tmp.myText = dual[1].trim();} else { el.$tmp.myTitle = false; el.$tmp.myText = el.title;}
el.removeAttribute('title');} else { el.$tmp.myText = false;}
if (el.$tmp.myTitle && el.$tmp.myTitle.length > this.options.maxTitleChars) el.$tmp.myTitle = el.$tmp.myTitle.substr(0, this.options.maxTitleChars - 1) + "&hellip;";}, start: function(el){ this.wrapper.empty(); if (el.$tmp.myText && el.$tmp.myText.test('^AJAX:', 'i')) { if(this.options.evalAlways) { el.$tmp.myEvalAlwaysText = el.$tmp.myText;}
this.ajax = new Ajax (el.$tmp.myText.replace(/AJAX:/i,''), { onComplete: function (responseText, responseXML) { el.title = responseText; this.build(el); this.start(el);}.bind(this), onFailure: function () { el.title = this.options.errTitle + '::' + this.options.errText; this.build(el); this.start(el);}.bind(this), method: 'get'
}).request(); el.$tmp.myText = '<div class="' + this.options.className + '-loading">&nbsp;</div>';} else if (el.$tmp.myText && el.$tmp.myText.test('^EVAL:', 'i')) { var tmp; if(this.options.evalAlways) { el.$tmp.myEvalAlwaysText = el.$tmp.myText;}
try { eval('tmp = ' + el.$tmp.myText.replace(/EVAL:/i, '') + ';'); var dual = tmp.split('::'); if (dual.length > 1) { el.$tmp.myTitle = dual[0].trim(); el.$tmp.myText = dual[1].trim();} else { el.$tmp.myTitle = false; el.$tmp.myText = tmp;}
} catch(err) { el.$tmp.myTitle = this.options.errTitle; el.$tmp.myText = this.options.errText + '<br />--------<br />' + err.description;}
}
if (el.$tmp.myTitle){ this.title = new Element('span').inject( new Element('div', {'class': this.options.className + '-title'}).inject(this.wrapper) ).setHTML(el.$tmp.myTitle);}
if (el.$tmp.myText){ this.text = new Element('span').inject( new Element('div', {'class': this.options.className + '-text'}).inject(this.wrapper) ).setHTML(el.$tmp.myText); if((this.options.evalAlways) && (el.$tmp.myEvalAlwaysText)) { el.$tmp.myText = el.$tmp.myEvalAlwaysText;}
}
$clear(this.timer); this.toolTip.setProperty('state','mouseleave'); this.timer = this.show.delay(this.options.showDelay, this);}, end: function(event){ $clear(this.timer); this.timer = this.hide.delay(this.options.hideDelay, this);}, position: function(element){ var pos = element.getPosition(); this.toolTip.setStyles({ 'left': pos.x + this.options.offsets.x, 'top': pos.y + this.options.offsets.y
});}, locate: function(event){ var win = {'x': window.getWidth(), 'y': window.getHeight()}; var scroll = {'x': window.getScrollLeft(), 'y': window.getScrollTop()}; var tip = {'x': this.toolTip.offsetWidth, 'y': this.toolTip.offsetHeight}; var prop = {'x': 'left', 'y': 'top'}; for (var z in prop){ var pos = event.page[z] + this.options.offsets[z]; if ((pos + tip[z] - scroll[z]) > win[z]) pos = event.page[z] - this.options.offsets[z] - tip[z]; this.toolTip.setStyle(prop[z], pos);};}, show: function(){ if (this.options.timeout) this.timer = this.hide.delay(this.options.timeout, this); this.fireEvent('onShow', [this.toolTip]);}, hide: function(){ if ((this.toolTip.getProperty('state') == 'mouseleave') || (!this.options.fixed))
this.fireEvent('onHide', [this.toolTip]);}
}); MooTips.implement(new Events, new Options); function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";}
}
window.onload = externalLinks; window.onload = function () { f_init(); liveSearchInit();}
window.onload = function() { var myTips1 = new MooTips($$('.toolTipImg'), { maxTitleChars: 50
}); var myTips2 = new MooTips($$('.toolTipImgDOM'), { showDelay: 500, maxTitleChars: 100
}); var myTips3 = new MooTips($$('.toolTipImgAJAX'), { evalAlways: true, maxTitleChars: 100, fixed: true, offsets: {'x':100,'y':100}
}); var myTips4 = new MooTips($$('.toolTipImgEVAL1'), { evalAlways: true, showOnClick: true, showOnMouseEnter: false
}); var myTips5 = new MooTips($$('.toolTipImgEVAL2'), {}); var myTips6 = new MooTips($$('.toolTipImgAJAX_Err'), {});}
function myEvalFunction() { return 'Eval Function Title::Text to be displayed in the body of the tooltip';}
<!-- document.write('<style type="text/css" media="screen"><!--'); document.write('#TB_overlay {filter:alpha(opacity=0); -moz-opacity: 0; opacity: 0;}'); document.write('#TB_window {filter:alpha(opacity=0);-moz-opacity: 0;opacity: 0;}'); document.write('#TB_HideSelect{filter:alpha(opacity=0);-moz-opacity: 0;opacity: 0;}'); document.write('--></style>

