window.addEvent('domready', function() {
	var list = $$('a.news4');
	list.each(function(element) {
		var fx = new Fx.Styles(element, {duration:100, wait:false});
	 
		element.addEvent('mouseenter', function(){
			fx.start({
				'background-color': '#b11111',
				'font-size': '15px',
				'padding-top': '2px',
				'padding-bottom': '6px'
			});
		});
	 
		element.addEvent('mouseleave', function(){
			fx.start({
				'background-color': '#ff0000',
				'font-size': '13px',
				'padding-top': '4px',
				'padding-bottom': '4px'
			});
		});
	 
	});
});

function is_numeric(num) {
	if (num == "") return false;
	var exp = new RegExp("^[0-9]*$", "g");
	return exp.test(num);
}

function PopCommande(CommRef) {
	window.open("commandepopup.php?id=" + CommRef, "popcommande", "width=550,height=650,scrollbars=yes,menubar=no,toolbar=no");
}

function SuiviCommandeGo(question)
{
	var NumCommande = prompt(question, "");
	if (is_numeric(NumCommande))
		PopCommande(NumCommande);
}

function makeRequest(url, ref)
{
	document.getElementById("btn_" + ref).disabled = true;
	
	var http_request = false;
    if (window.XMLHttpRequest)
	{ // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
    }
	else if (window.ActiveXObject)
	{ // IE
        try
		{
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        }
		catch (e)
		{
            try
			{
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            }
			catch (e)
			{}
        }
    }
    if (!http_request)
	{
        alert("Erreur : Impossible de créer une instance XMLHTTP...");
		document.getElementById("btn_" + ref).disabled = false;
        return false;
    }
	
	http_request.onreadystatechange = function() { majcount(http_request, ref); };
       http_request.open("GET", url, true);
       http_request.send(null);
  }

function majcount(http_request, ref)
{
    if (http_request.readyState == 4)
	{
        if (http_request.status == 200)
		{
               document.getElementById("paniercount").innerHTML = http_request.responseText;
			ChangerFond(ref);
        }
		else
		{
            alert("Erreur");
        }
		document.getElementById("btn_" + ref).disabled = false;
    }
}

function pop_album(AlbumRef)
{
	window.open("albumpopup.php?id=" + AlbumRef, "pop_album", "width=900,height=650,scrollbars=yes,menubar=no,toolbar=no");
}

function pop_texte(Texte)
{
	window.open("edit_text.php?le_texte=" + Texte, "pop_texte", "width=900,height=650,scrollbars=yes,menubar=no,toolbar=no");
}
