
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - smallbox.js - */
// http://www.observatoire-oci.org/portal_javascripts/smallbox.js?original=1
var protocolRxp=/[^:]+:[/]{2}[^/]+/;document.createXMLHttpRequest=function(){if(window.XMLHttpRequest) return new XMLHttpRequest();else
try{return new ActiveXObject("Msxml2.XMLHTTP")} catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")} catch(e){return null}}
return null}
function SmallBox(title,url){var box=this;var closeButton='<a href="javascript: void(0);" class="close" onclick="return SmallBox.close(this);"></a>';var HTMLCode='<div class="popup">'+'<div class="overlay"></div>'+'<div class="window">'+'<h4>'+closeButton+title+'</h4>'+'${innerHTML}'+'</div></div>';var xhr=document.createXMLHttpRequest();xhr.open('GET',url.replace(protocolRxp,''),true);xhr.onreadystatechange=function(){if(xhr.readyState!=4)
return null;document.body.innerHTML+=HTMLCode.replace('${innerHTML}',xhr.responseText);box.popup=document.body.lastChild;box.overlay=box.popup.firstChild;box.window=box.popup.lastChild;box.popup.box=box;box.window.center=function(){SmallBox.center(box)}
box.window.center();xhr.onreadystatechange=function(){};xhr=null}
xhr.send(null)}
SmallBox.center=function(box){var hh=window.innerHeight||document.documentElement.clientHeight;var ww=window.innerWidth||document.documentElement.clientWidth;var vscroll=document.documentElement.scrollTop||document.body.scrollTop;var hscroll=document.documentElement.scrollLeft||document.body.scrollLeft;box.popup.style.width=box.overlay.style.width=(ww+hscroll)+'px';box.popup.style.height=box.overlay.style.height=(hh+vscroll)+'px';if(box.window.offsetHeight>hh)
var top=50;else
var top=(vscroll+(hh/ 2) - (box.window.offsetHeight / 2));box.window.style.top=top+"px";box.window.style.left=(hscroll+(ww/ 2) - (box.window.offsetWidth / 2))+"px";box.window.style.position='absolute';if(box.window.style.visibility!='visible'){if(window.attachEvent){window.attachEvent('onresize',box.window.center);window.attachEvent('onscroll',box.window.center)} else{window.addEventListener('resize',box.window.center,false);window.addEventListener('scroll',box.window.center,false)}
box.window.style.visibility='visible'}}
SmallBox.prototype.onclose=function(){}
SmallBox.close=function(node){while(node.parentNode.nodeName!='BODY')
node=node.parentNode;if(window.removeEventListener){window.removeEventListener('resize',node.box.window.center,false);window.removeEventListener('scroll',node.box.window.center,false)} else{window.detachEvent('onresize',node.box.window.center);window.detachEvent('onscroll',node.box.window.center)}
node.box.onclose();document.body.removeChild(node);return false}


/* - intergrosociextranet.js - */
// http://www.observatoire-oci.org/portal_javascripts/intergrosociextranet.js?original=1
var serverRxp=/[^:]+:[/]{2}[^/]+/;
function changePage(item){if(!item.selectedIndex) return false;document.location.href=item.options[item.selectedIndex].value}
function initMultiPageDocument(){var doc=document.getElementById('multiPageDocument');var sectionList=document.getElementById('sectionList')
var sections=doc.getElementsByTagName('H5');for(var i=0;i<sections.length;++i){var sectionName='section-'+i;var anchor=sections[i].parentNode.getElementsByTagName('A')[0];anchor.setAttribute('name',sectionName);anchor.setAttribute('id',sectionName);sectionList.innerHTML+='<li><a href="#'+sectionName+'">'+sections[i].innerHTML+'</a></li>'}}
function changeSection(target){var frm=document.forms['downloads_filter'];frm.path.value=target.href.replace(serverRxp,'');frm.submit();return false}
function openContentPopup(e){var e=e||window.event;var target=e.target||e.srcElement;var mouseButton=e.which||(e.button+1);if(mouseButton==1&&target.nodeName=='A'){if(typeof arguments[1]=='function')
var box=arguments[1](target)
else
var box=new SmallBox(target.innerHTML,target.href+'/'+arguments[1]);if(e.stopPropagation){e.stopPropagation();e.preventDefault()} else{e.cancelBubble=true;e.returnValue=false}}
return false}
function openVideoPopup(e){return openContentPopup(e,'popup-player.html')}
function openNewsPopup(e){return openContentPopup(e, function(target){return new SmallBox(target.previousSibling.innerHTML,target.href+'/oci_newsitem_popup')})}
function IntergrosOCI_init(){}
registerPloneFunction(IntergrosOCI_init)

