var tour=1;
var infopanier;
var timer;
function pub_melrosys()
{
	changeoffre();
	setInterval("changeoffre()", 1000*15);
}

function writediv(html,view)
{
	if($(view))
	{
		$(view).innerHTML = html;
	}
}

function writedivrelay(idtext)
{

    $.blockUI({ message: $(idtext), css: { width: '275px' } });
	infopanier=html;
}

function write(id,html)
{
	if($(id))
	{
		$(id).innerHTML = "html";
	}
}

function getHTTPObject() // Function pour créer l'objet xmlhttprequest //
{
   var xmlhttp=false;
    try
    {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
        try
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e)
        {
            xmlhttp = false;
        }
    }
    
    if (!xmlhttp && typeof XMLHttpRequest != "undefined")
    {
        xmlhttp = new XMLHttpRequest();
    }

    return xmlhttp;
}

function file(fichier,value,view,ol)
{
	var datas="";
	var tti=(new Date()).getTime();
	
	datas += (datas.length == 0) ? "time" + "=" + escape(tti) : ""+ol+"&" + "time" + "=" + escape(tti);
	datas += (datas.length == 0) ? value : "&" + value;
	
	fichier = (datas.length > 0) ? fichier + "?" + datas : fichier;
	
	writediv("<img src='images/chargement4.gif'>",view);
	
	var xhr_object = getHTTPObject();
	xhr_object.open("GET",fichier);
	xhr_object.send(null);
	
	xhr_object.onreadystatechange = function() 
	{
		if (xhr_object.readyState == 4 && xhr_object.status == 200) 
		{
			writediv(xhr_object.responseText,view);
		}
	}
}
