// JavaScript Document

function PopupCentrerNl(page,nom,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,nom,'top='+top+',left='+left+',width='+largeur+',height='+hauteur+','+options);
}
/********************************************************
*  EXTERNAL LINK
********************************************************/
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";
 } 
}

/********************************************************
*  NAVHOVER
********************************************************/

navHover = function() {
	var lis = document.getElementById("bloc").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
navHoverVert = function() {
	var lis = document.getElementById("blocVertUl").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
navHoverPrin = function() {
	var lis = document.getElementById("menuPrin").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}



/********************************************************
*  SLIDE NEWS
********************************************************/


var boxHeight
var repeatHeight
var stopScroll = 0
var x

function scrollMe() {
	clearTimeout(x)
	if(stopScroll==1) {
		return
	}
	$('highlights').scrollTop=$('highlights').scrollTop+1
	if($('highlights').scrollTop<=repeatHeight) {
		// keep on scrolin' 
		x = setTimeout("scrollMe()",40)
	}
	else { //we have hit the wrap point
		$('highlights').scrollTop=0
		x = setTimeout("scrollMe()",40)
	}
}

function start_scrollMe(start_frame, end_frame, delay) {
	if($('highlights'))
	{
		boxHeight 		=	$('highlights').style.height.replace('px','')
		repeatHeight 	=	$('highlights').scrollHeight
		$('highlights').innerHTML = $('highlights').innerHTML + $('highlights').innerHTML
		x = setTimeout("scrollMe()",1000);
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

Event.observe(window, 'load', externalLinks, false);

if( navigator.userAgent.indexOf('MSIE') > 0 )Event.observe(window, 'load', navHover, false);
if( navigator.userAgent.indexOf('MSIE') > 0 )Event.observe(window, 'load', navHoverVert, false);
if( navigator.userAgent.indexOf('MSIE') > 0 )Event.observe(window, 'load', navHoverPrin, false);



