// Ajuste la taille de l'iframe
function setIframeHeight() {
	parentHeight = parent.document.getElementById("wrapperShaddow").clientHeight-50-315;
	pageHeight = document.getElementById("container").clientHeight;
	if (pageHeight < parentHeight) {
		newHeight = parentHeight;
	}else{
		newHeight = pageHeight;
	}
	parent.document.getElementById("center").style.height = newHeight + "px";
}


// ouverture d'une pop-up 640x480 centrée
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	l = (screen.width-640)/2;
	t = ((screen.height-480)/2)-20;
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480,left = "+l+",top = "+t+"');");
}

// texte défilant verticalement
var	scrollIT_swidth;
var	scrollIT_sheight;
var	scrollIT_msg;
var	scrollIT_sbcolor;
var	scrollIT_sspeed;
var	scrollIT_resumesspeed;

function scrollIT(sheight,msg)
{
	scrollIT_sheight = sheight;
	scrollIT_msg = msg;
	
	//background color
	scrollIT_sbcolor = '';
	
	//scroller's speed
	scrollIT_sspeed=2;
	scrollIT_resumesspeed=scrollIT_sspeed;
}

function scrollIT_start() {
	if (document.getElementById('ticker') != null)
	{
		if (document.all) iemarquee(ticker);
		else if (document.getElementById)
			ns6marquee(document.getElementById('ticker'));
	}
}

function iemarquee(whichdiv){
	iediv=eval(whichdiv);
	scrollIT_sheight += 50;
	iediv.style.pixelTop=scrollIT_sheight;
	iediv.innerHTML=scrollIT_msg;
	sizeup=iediv.offsetHeight;
	ieslide();
}

function ieslide(){
	if (iediv.style.pixelTop>=sizeup*(-1)){
		iediv.style.pixelTop-=scrollIT_sspeed;
		setTimeout("ieslide()",100);
	}
	else{
		iediv.style.pixelTop=scrollIT_sheight;
		ieslide();
	}
}

function ns6marquee(whichdiv){
	ns6div=eval(whichdiv);
	scrollIT_sheight += 50;
	ns6div.style.top=scrollIT_sheight + "px";
	ns6div.innerHTML=scrollIT_msg;
	sizeup=ns6div.offsetHeight;
	ns6slide();
}

function ns6slide(){
	if (parseInt(ns6div.style.top)>=sizeup*(-1)){
		theTop = parseInt(ns6div.style.top)-scrollIT_sspeed;
		ns6div.style.top = theTop + "px";
		setTimeout("ns6slide()",100);
	}
	else {
		ns6div.style.top = scrollIT_sheight + "px";
		ns6slide();
	}
}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
	if(opacStart > opacEnd)
	{
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
	else if(opacStart < opacEnd)
	{
		for(i = opacStart; i <= opacEnd; i++) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}