<!--
// Weboscope Performance - performance.js version 2.0
// Weboscope is a trademark property of weborama
// http://www.weboscope.com
// Derniere modification le  07/08/2006

////////////////////////
// Performance Class //
//////////////////////

// location
var WPERF_SERVER = ".weborama.fr";
var WPERF_PRGM = "/fcgi-bin/performance.fcgi";

function performancePassage(_FID_SITE, _ID_TRANSFO, _ID_PASSAGE)
{
    // Attributs
    this.FID_SITE = _FID_SITE;
    this.ID_TRANSFO = _ID_TRANSFO;
    this.ID_PASSAGE=_ID_PASSAGE;
    this.ACTION = 3;
	
    // Fonctions
    this.getURL = getURL;
    this.execute = execute;
}

function performanceScenario(_FID_SITE, _ID_TRANSFO, _ID_SCENARIO)
{
    // Attributs
    this.FID_SITE = _FID_SITE;
    this.ID_TRANSFO = _ID_TRANSFO;
    this.ID_SCENARIO = _ID_SCENARIO;
    this.ACTION = 4;
	
    // Fonctions
    this.getURL = getURL;
    this.execute = execute;
}

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;
    this.A_VALIDER = 0;
    this.ACTION = 2;
	
    // Fonctions
    this.setAmount = setAmount;
    this.setId = setId;
    this.setQuantity = setQuantity;
    this.setPostValidation = setPostValidation;
    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 setPostValidation(_V){this.A_VALIDER = _V;}

function getURL()
{
    var wbs_da = new Date();
    wbs_da = parseInt(wbs_da.getTime()/1000 - 60*wbs_da.getTimezoneOffset());
    
    // 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 + "?ID=" + this.FID_SITE + "&A=" + this.ACTION;
    wbs_arg += "&TR=" + this.ID_TRANSFO;
    
    if (this.ID_ACHAT != null && this.ID_ACHAT != 0){wbs_arg += "&AC=" + escape(this.ID_ACHAT);}
    if (this.MONTANT_ACHAT != null && this.MONTANT_ACHAT != 0){wbs_arg += "&MA=" + escape(this.MONTANT_ACHAT);}
    if (this.ARTICLE != null && this.ARTICLE != 0){wbs_arg += "&AR=" + this.ARTICLE;}
    if (this.ID_PASSAGE != null){wbs_arg += "&PT=" + this.ID_PASSAGE;}
    if (this.ID_SCENARIO != null){wbs_arg += "&SC=" + this.ID_SCENARIO;}
    if (this.A_VALIDER != null){wbs_arg += "&AV=" + this.A_VALIDER;}
    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;

//-->

