//--- MouseOver Youtube Images ---------//
//--- www.dynamiquegestion.com ---------//
//--- Patrick Potvin -------------------//
//--- Développeur php/js/vb/flash... ---//


var docIMG;
var idIMG;
var numIMG = 1;
var tIMG;	

function imgStatutNumero(){
	var n = new Array(0,3,1,2);
	docIMG.src = 'http://i.ytimg.com/vi/'+idIMG+'/'+n[numIMG]+'.jpg';
	numIMG++;
	imgOver();
}

function imgOver(){

	if(imgOver.arguments.length>=1){
		docIMG = imgOver.arguments[0];
		var reg=new RegExp("[a-zA-Z0-9\-_]{11}","i");
		idIMG = docIMG.src.match(reg);
	}

	if(numIMG>3){
		numIMG = 1;
	}
	tIMG = setTimeout(imgStatutNumero, 600);

}

function imgOut(){
	clearTimeout(tIMG);
	if(docIMG){
		docIMG.src = 'http://i.ytimg.com/vi/'+idIMG+'/2.jpg';
	}
	numIMG=1;
}


if (window.addEventListener){
	window.addEventListener('load', imgLoad, false);
}else if (window.attachEvent){
	window.attachEvent('onload', imgLoad);// IE
}else{
	window.onload = imgLoad();
}

function imgLoad(){
	var obj = new Array();
	var srcIMG = new Array();
	var reg=new RegExp("[a-zA-Z0-9\-_]{11}","i");
	var youtubeImg = document.getElementsByTagName("img");
	for (i=0;i<youtubeImg.length;i++){
		if(youtubeImg[i].src.indexOf('ytimg')!=-1){
			youtubeImg[i].onmouseover = function(){ imgOver(this); };
			youtubeImg[i].onmouseout = function(){ imgOut(); };
		}
	}

}

//--- MouseOver Youtube Images ---------//

function fnews(){
	
	
	var xhr; 
	try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
	catch (e) 
	{
		try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
		catch (e2) 
		{
		  try {  xhr = new XMLHttpRequest();     }
		  catch (e3) {  xhr = false;   }
		}
	 }
	
	xhr.onreadystatechange  = function()
	{ 
		 if(xhr.readyState  == 4)
		 {
				if(xhr.status  == 200){ 
					
					if(xhr.responseText!=''){

						document.getElementById('fnews').innerHTML = xhr.responseText;

					}
	
				}
		 }
		 
	}; 
	
	xhr.open( "POST", "fnews.php",  true); 
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xhr.send(); 

}