function file(fichier)
{
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}


var xhr=new Array();


function getXhr(name){
	if(window.XMLHttpRequest){
		xhr[name]=new XMLHttpRequest();
	}else if(window.ActiveXObject){
		try{
			xhr[name]=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch(e){
			xhr[name]=new ActiveXObject('Microsoft.XMLHTTP');
		}
	}else{
		window.alert('Votre navigateur ne supporte pas les objets XMLHTTPRequest, veuillez le mettre à jour');
		xhr[name]=false;
	} 
}





function ajax_check(xhr_object){
	xhr_object.onreadystatechange=function(){
		if(xhr_object.readyState==4&&xhr_object.status==200){
			eval(xhr_object.responseText);
		}
	}
}




function ajax_bloc(bloc,get,form){
	randomid=Math.random();
	request='dummy=1';
	if(form!=false){
		for(i=0;i<document.getElementById(form).length;i++){
			if(document.getElementById(form).elements[i].name!=''){
				text=escape(document.getElementById(form).elements[i].value);
				text=text.replace(/\+/g,'%2B')
				request+='&'+document.getElementById(form).elements[i].name+'='+text;
			}
		}
	}
	getXhr('loadbloc_'+randomid);
	ajax_check(xhr['loadbloc_'+randomid]);
	if(get==false){
		var get='';
	}else{
		get=get.replace(/\+/g,'%2B')
	}
	xhr['loadbloc_'+randomid].open('POST','http://www.mauriceradiolibre.com/web-'+bloc+'.asp?'+get,true);
	xhr['loadbloc_'+randomid].setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr['loadbloc_'+randomid].send(request);
	return(false);
}


function $(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); }
function $S(o) { return((typeof(o)=='object'?o:$(o)).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function abPos(o) { var o=(typeof(o)=='object'?o:$(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); }
function XY(e,v) { var o=agent('msie')?{'X':event.clientX+document.documentElement.scrollLeft,'Y':event.clientY+document.documentElement.scrollTop}:{'X':e.pageX,'Y':e.pageY}; return(v?o[v]:o); }

star={};

star.mouse=function(e,o) { if(star.stop || isNaN(star.stop)) { star.stop=0;

	document.onmousemove=function(e) { var n=star.num;
	
		var p=abPos($('star'+n)), x=XY(e), oX=x.X-p.X, oY=x.Y-p.Y; star.num=o.id.substr(4);

		if(oX<1 || oX>84 || oY<0 || oY>19) { star.stop=1; star.revert(); }
		
		else {

			$S('starCur'+n).width=oX+'px';
			$S('starUser'+n).color='#111';
			$('starUser'+n).innerHTML=Math.round(oX/84*100)+'%';
		}
	};
} };

star.update=function(e,o) { var n=star.num, v=parseInt($('starUser'+n).innerHTML);

	n=o.id.substr(4); $('starCur'+n).title=v;

	req=new XMLHttpRequest(); req.open('GET','?vote='+(v/100),false); req.send(null);    

};

star.revert=function() { var n=star.num, v=parseInt($('starCur'+n).title);

	$S('starCur'+n).width=Math.round(v*84/100)+'px';
	$('starUser'+n).innerHTML=(v>0?Math.round(v)+'%':'');
	$('starUser'+n).style.color='#888';
	
	document.onmousemove='';

};

star.num=0;