// JavaScript Document for Peintreonline
// Author : Hajax & Manitra
// Neov S.A.
// October 2005

// OS detection
var detect = navigator.userAgent.toLowerCase();
var OS,userbrowser,navversion,total,thestring;

if (checkIt('konqueror'))
{
	userbrowser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('msie')) userbrowser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	userbrowser = "Netscape Navigator"
	navversion = detect.charAt(8);
}
else userbrowser = "An unknown browser";

if (!navversion) navversion = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac') && (checkIt('os x') || checkIt('osx'))) OS = "MacOSX"
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
// end os detection

// Browser check

function Browser(){
	b=navigator.appName;
	if(b=="Netscape"){
		this.b="ns"; 
	}else{
		if(b=="Microsoft Internet Explorer"){
			this.b="ie";
		}else{
			this.b=b;
		}
	}
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns"&&this.v>=4);
	this.ie=(this.b=="ie"&&this.v>=4);
	this.dom=((document.createRange&&(document.createRange().createContextualFragment))?true:false);
}

est=new Browser();

function getExplorerVersion() {
	var ieVers = parseFloat(navigator.appVersion);
	if( navigator.appName != 'Microsoft Internet Explorer' ) return ieVers;
	var tempVers = navigator.appVersion;
	var i = tempVers.indexOf( 'MSIE ' );
	if( i >= 0 ) {
		tempVers = tempVers.substring( i+5 );
		ieVers = parseFloat( tempVers ); 
	}
	return ieVers;
}

// end Check browser


/*
Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="180px"
//Specify the marquee's height
var marqueeheight="55px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=1
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

////NO NEED TO EDIT BELOW THIS LINE////////////

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
//var marqueecontent_2 = marqueecontent
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, cross_marquee_2, ns_marquee

function populate(){
	if (iedom){
		// marquee 1
		cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
		//cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
		cross_marquee.style.top=8+"px"
		cross_marquee.innerHTML=marqueecontent
		actualheight=cross_marquee.offsetHeight
		// marquee 2
		cross_marquee_2=document.getElementById? document.getElementById("iemarquee_2") : document.all.iemarquee_2
		cross_marquee_2.style.top=actualheight + parseInt(cross_marquee.style.top)+ "px"
		cross_marquee_2.innerHTML=marqueecontent
	
	}
	else if (document.layers){
		ns_marquee=document.ns_marquee.document.ns_marquee2
		ns_marquee.top=parseInt(marqueeheight)+8
		ns_marquee.document.write(marqueecontent)
		ns_marquee.document.close()
		actualheight=ns_marquee.document.height
	}
	//alert( cross_marquee.offsetHeight)
	lefttime=setInterval("scrollmarquee()",75)
}

window.onload=populate

function scrollmarquee(){

	if (iedom){
		
		// marquee 1
		if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
			cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
		else
			//cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
			cross_marquee.style.top=actualheight+"px"
			
		// marquee 2
		if (parseInt(cross_marquee_2.style.top)>(actualheight*(-1)+8))
			cross_marquee_2.style.top=parseInt(cross_marquee_2.style.top)-copyspeed+"px"
		else
			//cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
			cross_marquee_2.style.top=actualheight+"px"
	}
	else if (document.layers){
		if (ns_marquee.top>(actualheight*(-1)+8))
			ns_marquee.top-=copyspeed
		else
			ns_marquee.top=parseInt(marqueeheight)+8
	}
	 
}

function buildMarquee () {

	if (iedom||document.layers){
		with (document){
			if (iedom){
				write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
				write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">')
				write('</div>')
				write('<div id="iemarquee_2" style="position:absolute;left:0px;top:0px;width:100%;">')
				write('</div></div>')
			}
			else if (document.layers){
				write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
				write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
				write('</ilayer>')
			}
		}
	}
}
///////END MARQUEE/////////////////
///////POPUP//////////////////////
function popup(page,largeur,hauteur,options){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
//Appel: popup('nom de la page',longeur du popup,hauteur du popup,'menubar=no,scrollbars=no,statusbar=no')

/////////////////////////////////

//paramètre flash
var querystring = location.search.substring(1,location.search.length);


