// JavaScript Document
function getWith() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}
function res(){
	var pix_w=107+4;
	var w=getWith()-18;
	w1=Math.floor(w/pix_w)*pix_w
	//w=w<854?7*pix_w:w;
	document.getElementById("pix").style.width=w1+"px";
	//w2=(w-w1)/2
	//document.getElementById("video").style.left=w2
}
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}
var inter;
function send(texte) {	 		
		if(typeof(getFlashMovie("videoswf").charger)=="function"){
			clearInterval(inter);
			getFlashMovie("videoswf").charger(texte);
		}
}
function toggle(etat, id){	
	if(document.getElementById("temporaire")){
		document.getElementById("temporaire").style.display="none"; 
	}
	if(etat=="close"){
		document.getElementById("video").style.display="none"; 
	}else{
		document.getElementById("video").style.display="block";
		var u=window.location.href;
		window.location.href=u.substr(0, u.indexOf("#h"))+"#h";

		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ // pour ie, pas de call back
			getFlashMovie("videoswf").movie="swf/video.swf?video="+id;
		}else{
			clearInterval(inter);
			inter=setInterval("send('"+id+"')", 250);
		}
	}
}

var win;
function fenetre(url, width, height){
	if(win) win.close();
	win=open(
	url, 
	"fenetre", 
	'statusbar=no,status=no,width='+width+',height='+height+',screenX=200,screenY=100,scrollbars=yes,top=100,left=200');
}
function searching(){
	document.searchf.submit();
}
function swap(){
	if(document.getElementById('en').style.display=='block'){
		document.getElementById('en').style.display='none';
		document.getElementById('fr').style.display='block';
	}else{
		document.getElementById('en').style.display='block';
		document.getElementById('fr').style.display='none'	;		
	}
}
