<!--
// Weboscope Performance - performance.js version 1.1
// Weboscope is a trademark property of weborama
// http://www.weboscope.com
// Derniere modification le  21/10/2004

////////////////////////
// Performance Class //
//////////////////////

// location
var WPERF_SERVER = ".weborama.fr";
var WPERF_PRGM = "/fcgi-bin/performance.fcgi";

function performanceTransfo(_FID_SITE, _ID_TRANSFO)
{
    // Attributs
    this.FID_SITE = _FID_SITE;
    this.ID_TRANSFO = _ID_TRANSFO;
    this.ID_ACHAT = 0;
    this.MONTANT_ACHAT = 0; // ascii value
    this.ARTICLE = 0;
	
    // Fonctions
    this.setAmount = setAmount;
    this.setId = setId;
    this.setQuantity = setQuantity;
    this.getURL = getURL;
    this.execute = execute;
}

function setAmount(_PRICE)
{
    this.MONTANT_ACHAT = _PRICE;
}

function setId(_ID)
{
    this.ID_ACHAT = _ID;
}

function setQuantity(_NB)
{
    this.ARTICLE = _NB;
}


function getURL()
{
    var wbs_da = new Date();
    wbs_da = parseInt(wbs_da.getTime()/1000 - 60*wbs_da.getTimezoneOffset());
    var wbs_nav = navigator.appName;
    
    // Connection type auto detection : HTTP ou HTTPS
    var WEBO_CONNEXION = (location.protocol == 'https:')?"https://ssl":"http://perf";
        
    var wbs_arg = WEBO_CONNEXION + WPERF_SERVER + WPERF_PRGM + "?FID_SITE=" + this.FID_SITE + "&ACTION=2";
    wbs_arg += "&ID_TRANSFO=" + this.ID_TRANSFO;
    
    if (this.ID_ACHAT != 0)
	{
	    wbs_arg += "&ID_ACHAT=" + escape(this.ID_ACHAT);
	}
    if (this.MONTANT_ACHAT != 0)
	{
	    wbs_arg += "&MONTANT_ACHAT=" + escape(this.MONTANT_ACHAT);
	}
    if (this.ARTICLE != 0)
	{
	    wbs_arg += "&ARTICLE=" + this.ARTICLE;
	}

    wbs_arg += "&da=" + wbs_da;    

    return wbs_arg;
}

function execute()
{
    if (parseInt(navigator.appVersion) >= 3)
	{
	    webo_compteur = new Image(1,1);
	    webo_compteur.src = this.getURL();
	}
    else
	{
	    document.write("<img src='" + this.getURL() + "' border='0' height='1' width='1' alt=''>");
	}
}

////////////////////////////////////
// Weboscope performance ON /OFF //
//////////////////////////////////

webo_performance = 1;

//-->


