var dimensions = {}; var openedSection = -1; // none opened so far var sliderState = -1; // None set, so feed on slider.getAttribute("state"); reloadDimensions(); function reloadDimensions() { if(window.screenLeft) { //IE dimensions.getWindowX = window.screenLeft; dimensions.getWindowY = window.screenTop; } else if(window.screenX) { //Firefox dimensions.getWindowX = window.screenX; dimensions.getWindowY = window.screenY; } if(window.innerWidth) { //!IE dimensions.getViewportWidth = window.innerWidth; dimensions.getViewportHeight = window.innerHeight; dimensions.getHorizontalScroll = window.pageXOffset; dimensions.getVerticalScroll = window.pageYOffset; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 with DOCTYPE dimensions.getViewportWidth = document.documentElement.clientWidth; dimensions.getViewportHeight = document.documentElement.clientHeight; dimensions.getHorizontalScroll = document.documentElement.scrollLeft; dimensions.getVerticalScroll = document.documentElement.scrollTop; } else if (document.documentElement && document.documentElement.clientWidth) { //IE 6 sans DOCTYPE dimensions.getViewportWidth = document.body.clientWidth; dimensions.getViewportHeight = document.body.clientHeight; dimensions.getHorizontalScroll = document.body.scrollLeft; dimensions.getVerticalScroll = document.body.scrollTop; } if(document.documentElement && document.documentElement.scrollWidth) { dimensions.getDocumentWidth = document.documentElement.scrollWidth; dimensions.getDocumentHeight = document.documentElement.scrollHeight; } else if (document.body.scrollWidth) { dimensions.getDocumentWidth = document.body.scrollWidth; dimensions.getDocumentHeight = document.body.scrollHeight; } } function openFull(p,n) { var r = null; r = window.open(p,n,'width='+screen.width+',height='+screen.height+',top='+0+',left='+0+','+'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'); if(r!=null && window.focus) r.window.focus(); } function openSlider(forceSection, keepOpen) { var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); var opening = false; if (orientation == "left") { if (slider.style.width == '21px' || slider.style.width == '' || keepOpen != undefined) { slider.style.width = slider.getAttribute('maxwidth') + 'px'; opening = true; } else { slider.style.width = '21px'; } } else if (orientation == "right") { if (slider.style.width == '21px' || slider.style.width == '' || keepOpen != undefined) { slider.style.width = slider.getAttribute('maxwidth') + 'px'; slider.style.left = (dimensions.getDocumentWidth - parseInt(slider.getAttribute('maxwidth'))) + "px"; opening = true; } else { slider.style.width = '21px'; slider.style.left = (dimensions.getDocumentWidth - 21) + "px"; } } else if (orientation == "bottom") { if (slider.style.height == '21px' || slider.style.height == '' || keepOpen != undefined) { slider.style.height = slider.getAttribute('maxwidth') + 'px'; slider.style.top = (dimensions.getDocumentHeight - parseInt(slider.getAttribute('maxwidth'))) + "px"; opening = true; } else { slider.style.height = '21px'; slider.style.top = (dimensions.getDocumentHeight - 21) + "px"; } } if (opening) {// lets show one section; sliderState = "open"; showSliderSection(forceSection); } else { // It's closing sliderState = "close"; showSliderSection(openedSection, true); } } function showSliderSection(forceSection, hideAll) { var index = 0; if (forceSection == undefined) { if (openedSection == -1) openedSection = 0; } else openedSection = forceSection; var slider = document.getElementById('slider_' + index); document.getElementById('extra_window').setAttribute("state", sliderState); while (slider != undefined) { if (hideAll == true) slider.style.display = "none"; else slider.style.display = index == openedSection ? '' : 'none'; index++; var slider = document.getElementById('slider_' + index); } } function resizeContainer() { reloadDimensions(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var container = document.getElementById("core"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); if (top != undefined) { top.style.height= top.getAttribute("maxwidth") + "px"; height = height - parseInt(top.getAttribute("maxwidth")); } if (bottom != undefined) { bottom.style.height= bottom.getAttribute("maxwidth") + "px"; height = height - parseInt(bottom.getAttribute("maxwidth")); } if (left != undefined) { left.style.width= left.getAttribute("maxwidth") + "px"; width = width - parseInt(left.getAttribute("maxwidth")); } if (right != undefined) { right.style.width= right.getAttribute("maxwidth") + "px"; width = width - parseInt(right.getAttribute("maxwidth")); } container.style.width= width + 'px'; container.style.height= height + 'px'; } function resizePanel() { reloadDimensions(); var height = dimensions.getViewportHeight; var width = dimensions.getViewportWidth; var content = document.getElementById("content_td"); var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); var reste = 0; var internal = (document.getElementById("internal").value == "1"); if (internal) { if (bottom != undefined) height = height - parseInt(bottom.getAttribute("maxwidth")); } if (left != undefined && right != undefined) { right.style.height = height + "px"; left.style.height = height + "px"; content.style.width = (width - parseInt(right.getAttribute("maxwidth")) - parseInt(left.getAttribute("maxwidth"))) + "px"; right.style.left = (width - parseInt(right.getAttribute("maxwidth")) - parseInt(left.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; } if (left != undefined) { left.style.height = height + "px"; content.style.width = (width - parseInt(left.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; if(navigator.appName != "Microsoft Internet Explorer") { left.style.top = "0"; left.style.position = "absolute"; left.style.width = document.getElementById("left_td").style.width; left.style.overflow = "hidden"; } } if (right != undefined) { right.style.height = height + "px"; content.style.width = (width - parseInt(right.getAttribute("maxwidth"))) + "px"; content.style.height = height + "px"; if(navigator.appName != "Microsoft Internet Explorer") { right.style.top = "0"; right.style.position = "absolute"; right.style.width = document.getElementById("right_td").style.width; right.style.overflow = "hidden"; } } if(document.getElementById("shopping") != undefined) document.getElementById("shopping").scrolling = "no"; } function resizeSlider() { reloadDimensions(); var height = dimensions.getViewportHeight - 40; var width = dimensions.getViewportWidth; var slider = document.getElementById('extra_window'); var orientation = slider.getAttribute("orientation"); slider.style.display = "none"; if (orientation == "left" || orientation == "right") { slider.style.height = height + 'px'; } else { slider.style.height = "21px"; slider.style.width = width + "px"; } if (orientation == "right") { //alert(dimensions.getViewportWidth); slider.style.left = (dimensions.getDocumentWidth - 21) + "px"; } else if (orientation== "bottom") { slider.style.top = (dimensions.getDocumentHeight - 21) + "px"; } if (slider.getAttribute("state") == "open") openSlider(undefined, true); slider.style.display = ""; } function update(myPage) { var left = document.getElementById("left_panel"); var right = document.getElementById("right_panel"); var bottom = document.getElementById("bottom_panel"); var top = document.getElementById("top_panel"); var reference = "", lang = ""; if (left != undefined && (left.innerHTML == "" || left.getAttribute("static") == "0")) { reference += "left|" + left.getAttribute("reference") + "@@@"; lang = left.getAttribute("lang"); } if (right != undefined && (right.innerHTML == "" || right.getAttribute("static") == "0")) { reference += "right|" + right.getAttribute("reference") + "@@@"; lang = right.getAttribute("lang"); } if (bottom != undefined && (bottom.innerHTML == "" || bottom.getAttribute("static") == "0")) { reference += "bottom|" + bottom.getAttribute("reference") + "@@@"; lang = bottom.getAttribute("lang"); } if (top != undefined && (top.innerHTML == "" || top.getAttribute("static") == "0")) { reference += "top|" + top.getAttribute("reference") + "@@@"; lang = top.getAttribute("lang"); } var leftDone = false; var rightDone = false; var bottomDone = false; var topDone = false; if (reference != "") { var xmlHttp = getAjaxObj(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { if(xmlHttp.responseText) { ajaxText = xmlHttp.responseText.replace(/\r|\n/g, ""); //prompt("", ajaxText); var divs = ajaxText.split("@@@"); for(var i = 0; i < divs.length; i++) { var info = divs[i].split("|"); if (info.length == 2) { document.getElementById(info[0] + "_panel").innerHTML = info[1]; if (info[0] == "top") topDone = true; if (info[0] == "bottom") bottomDone = true; if (info[0] == "left") leftDone = true; if (info[0] == "right") rightDone = true; } } if (!topDone && top != undefined) top.innerHTML = ""; if (!bottomDone && bottom != undefined) bottom.innerHTML = ""; if (!leftDone && left != undefined) left.innerHTML = ""; if (!rightDone && right != undefined) right.innerHTML = ""; } } } //alert("reference=" + reference + "&mypage=" + myPage + "&lang=" + lang); xmlHttp.open("POST","/script/hybrid/hybrid.loader.php"); xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send("reference=" + reference + "&mypage=" + myPage + "&lang=" + lang); } //if (top.hybrid) //top.hybrid.switchPage(myPage); } if(!window.Node) { var Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_FRAGMENT_NODE: 11 }; } function registerOnLoadFunction(f) { var currentOnLoad = window.onload; if (typeof window.onload != "function") { window.onload = f; } else { window.onload = function() { currentOnLoad(); f(); } } } function getElementsByClassName(classname, node, tagname){ if(!node) node = document; else if (typeof node == "string") node = document.getElementById(node); if(!tagname) tagname = "*"; var loopNodes = node.getElementsByTagName(tagname); var foundNodes = []; for(var i = 0; i < loopNodes.length; i++) { var currentNodeClassesString = loopNodes[i].className; if(!currentNodeClassesString) continue; if(currentNodeClassesString == classname) { foundNodes.push(loopNodes[i]); continue; } var whiteSpaceRegex = /\s+/; if(!whiteSpaceRegex.test(currentNodeClassesString)) continue; var currentNodeClassesArray = currentNodeClassesString.split(whiteSpaceRegex); for(var i = 0; i < currentNodeClassesArray.length; i++) { if(currentNodeClassesArray[i] == classname) foundNodes.push(loopNodes[i]); } } return foundNodes; } function openPopup(url, popupWidth, popupHeight, popupAlign, popupVAlign, popupScrollbars, popupResizable) { var r = null; var width, height, scrollbars, resizable, top, left; popupWidth= String(popupWidth); popupHeight= String(popupHeight); width = (popupWidth.substr(popupWidth.length-1, 1) == "%") ? parseInt(popupWidth.substr(0, popupWidth.length - 1)) * screen.width / 100 : parseInt(popupWidth); height = (popupHeight.substr(popupHeight.length-1, 1) == "%") ? parseInt(popupHeight.substr(0, popupHeight.length - 1)) * screen.height / 100 : parseInt(popupHeight); switch(popupAlign) { case "left": left = 0; break; case "center": left = (screen.width - width) / 2 break; case "right": left = screen.width - width; break; default: left = 0; } switch(popupVAlign) { case "top": top = 0; break; case "middle": top = (screen.height - height) / 2 break; case "bottom": top = screen.height - height; break; default: top = 0; } scrollbars = (popupScrollbars == "yes") ? 1 : 0; resizable = (popupResizable == "yes") ? 1 : 0; r = window.open(url, "virtualpaper", "width="+width+",height="+height+",top="+top+",left="+left+","+"scrollbars="+scrollbars+",toolbar=no,location=no,status=no,menubar=no,resizable="+resizable+",dependent=no"); if(r!=null && window.focus) r.window.focus(); } function gotoPage(page) { document.getElementById('core').flashGotoPage(page); } //SHARING function delicious(p) { u = updateShareURL(location.href, p); window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=700,height=400'); } function stumble(p) { u = updateShareURL(location.href, p); window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)); } function digg(p) { u = updateShareURL(location.href, p); var bodytext=""; window.open('http://digg.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(document.title)+'&bodytext='+bodytext); } function facebook(p) { u = updateShareURL(location.href, p); t="";//document.title; bodytext=""; //alert('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t)); window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436'); } function myspace(p) { u = updateShareURL(location.href, p); t=document.title; c=""; window.open('http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(t) + '&c=' + encodeURIComponent(c) + '&u=' + encodeURIComponent(u)); } function twitthis(p) { u = updateShareURL(location.href, p); window.open("http://twitthis.com/twit?url="+encodeURIComponent(u)+"&title="+((document.title) ? encodeURIComponent(document.title.replace(/^\s*|\s*$/g,'')) : ""), "TwitThisPop", "width=600, height=500, location, status, scrollbars, resizable"); } function updateShareURL(u, p) { if(u.indexOf(".html") != -1) { us = u.split("/"); us.pop(); u = us.join("/"); } if(u.charAt(u.length-1) != "/") { u += "/"; } u += p + ".html"; return u; } //~ function loadPage(url, container, param) { //~ var xmlHttp = getAjaxObj(); //~ var dim = window.size(); //~ xmlHttp.onreadystatechange=function() { //~ if(xmlHttp.readyState==4) { //~ if(xmlHttp.responseText) { //~ ajaxText = xmlHttp.responseText.replace(/\r|\n/g, ""); //~ //alert(ajaxText); //~ if (container != "") //~ $(container).innerHTML = ajaxText; //~ if (url == 'ajax/get.cloud.php') { //~ $("whole").style.backgroundImage = $("etage").value == "0" ? "url(images/bgnature.jpg)" : "url(images/bgsoussol.jpg)"; //~ } //~ } //~ } //~ } //~ xmlHttp.open("POST",url); //~ xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); //~ xmlHttp.send("screen_width=" + dim.width + "&screen_height=" + dim.height + (param == undefined ? "" : param)); //~ } //~ function $(id) { //~ if (document.getElementById(id) == undefined) { //~ if (parent.document.getElementById(id) == undefined) //~ return undefined; //~ else return parent.document.getElementById(id); //~ } //~ else return ( document.getElementById(id)); //~ } function getAjaxObj() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return(xmlHttp); }