var rel_value="splash";var margin_top=40;var margin_right=40;var margin_bottom=40;var margin_left=40;var splash_groups=new Array();var splash_as=new Array();var splash_titles=new Array();var slide_timeout;var slide_timeout_notification;var slide_timeout_value=4000;var current_group;var current_position;var is_sliding=false;var lightbox_replace=true;var set_bg=false;var z_index_mini=100000;var objects_2_hide=new Array();function splash_image(c){hide_and_show("hidden");obj_body=document.getElementsByTagName("body").item(0);rel_attr=new String(c.getAttribute("rel"));val=rel_attr.replace(rel_value+"|","");splash_id=(c.getAttribute("class"))?new String(c.getAttribute("class").match(new RegExp(/splash[0-9]+$/))):"";if(val!=rel_value&&splash_groups[val].length>0){current_group=val;current_position=in_array(splash_groups[val],splash_id)}else{current_group=current_position=""}if(!document.getElementById("splash_screen")){obj_splash_screen=document.createElement("a");obj_splash_screen.setAttribute("id","splash_screen");obj_splash_screen.setAttribute("title","Close the splash");obj_splash_screen.style.zIndex=z_index_mini;array_page_size=getPageSize();obj_splash_screen.style.width="100%";obj_splash_screen.style.height=array_page_size[1]+"px";obj_splash_screen.onclick=function(){splash_bye();return false};if(set_bg){obj_splash_screen.setAttribute("class","bg")}obj_body.appendChild(obj_splash_screen);obj_splash_screen.style.zIndex=z_index_mini;obj_content=document.createElement("div");obj_content.setAttribute("id","image_content");obj_content.style.width="200px";obj_content.style.height="200px";obj_content.className="ajax-loading";obj_body.appendChild(obj_content);obj_content.style.zIndex=z_index_mini+1;array_page_scroll=getPageScroll();array_page_size=getPageSize();obj_content.style.top=array_page_scroll[1]+margin_top+"px";obj_content.style.left=array_page_size[0]/2-(parseInt(obj_content.style.width)/2)+"px"}else{obj_splash_screen=document.getElementById("splash_screen");obj_content=document.getElementById("image_content");obj_content.removeChild(document.getElementById("splash_img"));obj_content.className="ajax-loading"}if(document.getElementById("title_content")){obj_title=document.getElementById("title_content");if(document.getElementById("splash_previous")){obj_title.removeChild(document.getElementById("splash_previous"));obj_title.removeChild(document.getElementById("splash_next"));if(document.getElementById("splash_notification")){obj_content.removeChild(document.getElementById("splash_notification"))}what=(is_sliding)?"splash_pause":"splash_play";obj_title.removeChild(document.getElementById(what))}obj_body.removeChild(obj_title)}ini_image(c)}function ini_image(c){img=new Image();img.src=c.href;if(!img.complete){img.onload=function(){image_display(c)}}else{image_display(c)}}function image_display(c){obj_body=document.getElementsByTagName("body").item(0);obj_content=document.getElementById("image_content");obj_splash_screen=document.getElementById("splash_screen");obj_image=document.createElement("img");obj_image.setAttribute("id","splash_img");obj_image.onclick=function(){splash_bye();return false};obj_content.appendChild(obj_image);obj_image.style.zIndex=z_index_mini+2;obj_content.style.width=img.width+"px";obj_content.style.height=img.height+"px";array_page_scroll=getPageScroll();array_page_size=getPageSize();obj_content.style.top=array_page_scroll[1]+margin_top+"px";obj_content.style.left=array_page_size[0]/2-(parseInt(img.width)/2)+"px";obj_content=document.getElementById("image_content");obj_content.className="";obj_image.setAttribute("src",c.href);obj_image.style.display="block";obj_close=document.createElement("a");obj_close.setAttribute("id","splash_close");obj_close.onclick=function(){splash_bye();return false};obj_content.appendChild(obj_close);obj_close.style.zIndex=z_index_mini+3;obj_title=document.createElement("div");obj_title.setAttribute("id","title_content");obj_body.appendChild(obj_title);obj_title.style.zIndex=z_index_mini+4;obj_title.style.width=(isie())?obj_image.offsetWidth+"px":img.width+"px";obj_title.style.top=array_page_scroll[1]+margin_top+(parseInt(obj_content.style.height))+20+"px";obj_title.style.left=array_page_size[0]/2-(parseInt(obj_content.style.width)/2)+"px";str_position=(current_group!="")?"Image "+(current_position+1)+" sur "+splash_groups[current_group].length+" :":"";obj_text=document.createTextNode(str_position);obj_title.appendChild(obj_text);obj_description=document.createElement("div");obj_description.setAttribute("id","splash_description");obj_title.appendChild(obj_description);obj_description.style.zIndex=z_index_mini+5;splash_id=(c.getAttribute("class"))?new String(c.getAttribute("class").match(new RegExp(/splash[0-9]+$/))):"";obj_text=document.createTextNode(splash_titles[splash_id]);obj_description.appendChild(obj_text);array_page_size=getPageSize();total_width=margin_left+parseInt(obj_content.style.width)+margin_right;if(total_width>array_page_size[0]){obj_splash_screen.style.width=total_width+"px";obj_content.style.left=margin_left+"px";obj_title.style.left=margin_left+"px"}total_height=margin_top+parseInt(obj_content.style.top)+parseInt(obj_image.height)+parseInt(obj_title.offsetHeight)+margin_bottom;if(total_height>array_page_size[1]){obj_splash_screen.style.height=total_height+"px"}ini_nav(c)}function ini_nav(d){clearTimeout(slide_timeout);obj_title=document.getElementById("title_content");rel_attr=new String(d.getAttribute("rel"));val=rel_attr.replace(rel_value+"|","");if(splash_groups[val]&&document.getElementById("splash_img")){obj_previous=document.createElement("a");obj_previous.setAttribute("id","splash_previous");obj_previous.setAttribute("title","Jump to the previous image");obj_previous.onmouseover=function(){obj_previous.className="over"};obj_previous.onmouseout=function(){obj_previous.className=""};obj_previous.onclick=function(){splash_previous()};obj_title.appendChild(obj_previous);obj_previous.style.zIndex=z_index_mini+6;obj_next=document.createElement("a");obj_next.setAttribute("id","splash_next");obj_next.setAttribute("title","Jump to the next image");obj_next.onmouseover=function(){obj_next.className="over"};obj_next.onmouseout=function(){obj_next.className=""};obj_next.onclick=function(){splash_next()};obj_title.appendChild(obj_next);obj_next.style.zIndex=z_index_mini+6;var e=document.createElement("a");if(!is_sliding){e.setAttribute("id","splash_play");e.setAttribute("title","Start the slide")}else{e.setAttribute("id","splash_pause");e.setAttribute("title","Pause the slide")}e.onclick=function(){splash_pause()};e.onmouseover=function(){e.className="over"};e.onmouseout=function(){e.className=""};obj_title.appendChild(e);e.style.zIndex=z_index_mini+6;if(is_sliding){slide_timeout=window.setTimeout(splash_next,slide_timeout_value)}}}function splash_previous(){current_position=(current_position-1<0)?splash_groups[current_group].length-1:current_position-1;splash_image(splash_as[splash_groups[current_group][current_position]])}function splash_next(){current_position=(current_position+1==splash_groups[current_group].length)?0:current_position+1;splash_image(splash_as[splash_groups[current_group][current_position]])}function splash_pause(){if(!is_sliding){is_sliding=true;document.getElementById("splash_play").setAttribute("id","splash_pause");document.getElementById("splash_pause").setAttribute("title","Pause the slide");current_position=(current_position==splash_groups[current_group].length)?0:current_position;slide_timeout=window.setTimeout(splash_next,slide_timeout_value/4)}else{is_sliding=false;document.getElementById("splash_pause").setAttribute("id","splash_play");document.getElementById("splash_play").setAttribute("title","Start the slide");clearTimeout(slide_timeout)}}function notification(){clearTimeout(slide_timeout_notification);obj_content=document.getElementById("image_content");if(!document.getElementById("splash_notification")){obj_slide=document.createElement("a");obj_slide.setAttribute("id","splash_notification");obj_slide.setAttribute("title","Sliding (ou pas)");obj_content.appendChild(obj_slide);obj_slide.style.zIndex=z_index_mini+6;obj_slide.style.top=(parseInt(obj_content.style.height)/2)-25+"px";obj_slide.style.left=(parseInt(obj_content.style.width)/2)-25+"px";obj_slide.style.width="50px";obj_slide.style.height="50px"}else{obj_slide=document.getElementById("splash_notification")}if(is_sliding){obj_slide.className="playing"}else{obj_slide.className="paused";slide_timeout_notification=setTimeout(splash_notification_bye,2000)}}function splash_notification_bye(){if(document.getElementById("image_content")){obj_content=document.getElementById("image_content");obj_content.removeChild(document.getElementById("splash_notification"))}clearTimeout(slide_timeout_notification)}function splash_bye(){clearTimeout(slide_timeout);clearTimeout(slide_timeout_notification);is_sliding=false;obj_body=document.getElementsByTagName("body").item(0);obj_body.removeChild(document.getElementById("splash_screen"));obj_body.removeChild(document.getElementById("image_content"));if(document.getElementById("title_content")){obj_body.removeChild(document.getElementById("title_content"))}hide_and_show("visible")}function key_check(c){if(document.getElementById("splash_img")){clearTimeout(slide_timeout);what=(c==null)?event.keyCode:c.which;if(in_array(new Array(27,38,46,88),what)>=0){splash_bye();return false}if(splash_groups[current_group]){if(in_array(new Array(13,32,40),what)>=0){splash_pause();notification();return false}if(in_array(new Array(33,37,109),what)>=0){splash_previous();return false}if(in_array(new Array(34,39,107),what)>=0){splash_next();return false}}}}function hide_and_show(c){for(i=0;i<objects_2_hide.length;i++){objects_2_hide[i].style.visibility=c}}function ini_splash_images(){objs=document.getElementsByTagName("object");for(i=0;i<objs.length;i++){if(objs[i].style.visibility=="visible"||objs[i].style.visibility==""){objects_2_hide[objects_2_hide.length]=objs[i]}}objs=document.getElementsByTagName("embed");for(i=0;i<objs.length;i++){if(objs[i].style.visibility=="visible"||objs[i].style.visibility==""){objects_2_hide[objects_2_hide.length]=objs[i]}}splash_groups=new Array();splash_as=new Array();splash_titles=new Array();as=document.getElementsByTagName("a");for(i=0;i<as.length;i++){a=as[i];rel_attr=new String(a.getAttribute("rel"));if(rel_attr.match("splash.image")){rel_attr=rel_attr.replace("splash.image","splash");a.setAttribute("rel",rel_attr)}if(lightbox_replace&&rel_attr.match("lightbox")){rel_attr=rel_attr.replace("lightbox","splash");rel_attr=rel_attr.replace("splash[","splash|");rel_attr=rel_attr.replace(/]$/,"");a.setAttribute("rel",rel_attr)}rel_attr=new String(a.getAttribute("rel"));if(rel_attr.match("splash")){splash_id="splash"+i;klass=(a.getAttribute("class"))?a.getAttribute("class")+" "+splash_id:splash_id;a.setAttribute("class",klass);a.onclick=function(){splash_image(this);return false};val=rel_attr.replace(rel_value+"|","");if(val!=rel_value){array=(!splash_groups[val]||typeof splash_groups[val]!="object")?new Array():splash_groups[val];array[array.length]=splash_id;splash_groups[val]=array;splash_as[splash_id]=a}splash_titles[splash_id]=(a.getAttribute("title"))?a.getAttribute("title"):"Image "+i}}document.onkeydown=key_check}function getPageScroll(){var c;if(self.pageYOffset){c=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){c=document.documentElement.scrollTop}else{if(document.body){c=document.body.scrollTop}}}arrayPageScroll=new Array("",c);return arrayPageScroll}function getPageSize(){var h,f;if(window.innerHeight&&window.scrollMaxY){h=document.body.scrollWidth;f=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){h=document.body.scrollWidth;f=document.body.scrollHeight}else{h=document.body.offsetWidth;f=document.body.offsetHeight}}var j,g;if(self.innerHeight){j=self.innerWidth;g=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){j=document.documentElement.clientWidth;g=document.documentElement.clientHeight}else{if(document.body){j=document.body.clientWidth;g=document.body.clientHeight}}}if(f<g){pageHeight=g}else{pageHeight=f}if(h<j){pageWidth=j}else{pageWidth=h}arrayPageSize=new Array(pageWidth,pageHeight,j,g);return arrayPageSize}function addEvent(h,j,l,g){if(h.addEventListener){h.addEventListener(j,l,g);return true}else{if(h.attachEvent){var k=h.attachEvent("on"+j,l);return k}else{alert("Handler could not be attached")}}}function in_array(d,e){if(d.length==0){return -1}for(i=0;i<d.length;i++){if(d[i]==e){return i}}return -1}function isie(){if(navigator.appName=="Microsoft Internet Explorer"){var k=new RegExp("MSIE [0-9]*.[0-9]*","gi");var j=new String(navigator.appVersion);var g=new String(j.match(k));var h=g.split(" ");var l=h[1];return l}else{return false}}addEvent(window,"load",ini_splash_images);