

/* 
weboscope.js
Weboscope version 5.0 copyright Weborama 30-03-2005
*/

/* ------------------ Variables ------------------------- */
var WEBO_ID_GROUPE = 197506;

/* ------------------ Générales ------------------------- */
function get_webo_arg_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC,_WEBOID2,_WEBOZONE2,_WEBOPAGE2)
{
        var wbs_da=new Date();
        wbs_da=parseInt(wbs_da.getTime()/1000 - 60*wbs_da.getTimezoneOffset());
var wbs_ref=''+escape(document.referrer);
var wbs_ta='0x0';
var wbs_co=0;
var wbs_nav=navigator.appName;
if (parseInt(navigator.appVersion)>=4)
{
	wbs_ta=screen.width+"x"+screen.height;
	wbs_co=(wbs_nav!="Netscape")?screen.colorDepth:screen.pixelDepth;
}
if((_ACC != null)&&(wbs_nav!="Netscape"))
{
	var reftmp = 'parent.document.referrer';
	if((_ACC<5)&&(_ACC>0))
	{
	for(_k=_ACC;_k>1;_k--) reftmp = 'parent.' + reftmp;
	}
	var mon_ref = eval(reftmp);
	
	if(document.referrer == parent.location || document.referrer=='') wbs_ref=''+escape(mon_ref)

}
var wbs_arg = ".weborama.fr/fcgi-bin/comptage.fcgi?ID="+_WEBOID;
if ( location.protocol == 'https:'){
 wbs_arg = "https://ssl" + wbs_arg;
}
else {
	wbs_arg =  "http://pro" + wbs_arg; 
}
wbs_arg+="&ZONE="+_WEBOZONE+"&PAGE="+_WEBOPAGE;

if((_WEBOID2 != null) &&
	(_WEBOZONE2 != null) && 
	(_WEBOPAGE2 != null) )
	wbs_arg+="&ID2="+_WEBOID2+"&ZONE2="+_WEBOZONE2+"&PAGE2="+_WEBOPAGE2;

wbs_arg+="&ver=2&da2="+wbs_da+"&ta="+wbs_ta+"&co="+wbs_co+"&ref="+wbs_ref;
if (parseInt(navigator.appVersion)>=3)
{
	webo_compteur = new Image(1,1);
	webo_compteur.src=wbs_arg;
}
else
{
	document.write('<IMG SRC="'+wbs_arg+'" border="0" height="1" width="1" alt="" id="weborama">');
}
}

function webo_zpi_groupe(_WEBOZONE,_WEBOPAGE,_WEBOID,_WEBOZONEGROUPE,_WEBOPAGEGROUPE,_ACC)
{
if ((_WEBOZONEGROUPE != null) && (_WEBOPAGEGROUPE != null) )
{
	get_webo_arg_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC,WEBO_ID_GROUPE,_WEBOZONEGROUPE,_WEBOPAGEGROUPE);
}
else {
	get_webo_arg_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC);
}
}

/* function webo_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC)
{
get_webo_arg_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC);
} */

function webo_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC)
{
get_webo_arg_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC,WEBO_ID_GROUPE,_WEBOID,_WEBOZONE);
}

/* ------------------ Compatibilité --------------------- */
function webossl_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC) {
webo_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC);
}

function flash_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC) {
webo_zpi(_WEBOZONE,_WEBOPAGE,_WEBOID,_ACC);
}



/* ------------ added for ajax request tracking ---- */
function ajaxWeboTrack(click_name) {

  //alert(click_name);

  trackWeborama();

  trackXiti(click_name);
}

function trackWeborama() {

if(typeof webo_compteur != "undefined")

{

  //alert("weborama found");
  var image = null;
  if(webo_compteur != null) {
     image = webo_compteur;
  } else {
     var weborama = document.getElementById("weborama");
     if (weborama != null) {
        image = weborama;
    }
  }

  if (image != null) {
    // force the browser to reload the image by replacing the da2 parameter.
    var currentDate = new Date();
    var currentDate =parseInt(currentDate.getTime()/1000 - 60*currentDate.getTimezoneOffset());
    image.src = image.src.replace(/da2=[0-9]*/, "da2=" + currentDate);
  }

}

}

function trackXiti(click_name) {

  // check if the Xiti variables are there, then call xt_click

  if(typeof xtn2 != "undefined" && typeof xtpage != "undefined") {

    //alert("xiti found");

    // set some default values

    if(click_name==undefined)  {

       click_name = xtpage;

    } else {

       click_name = xtpage + '::' + click_name;

    }

    // track as page ('F') not as click ('C').

    measurement_type = 'F';

    // execute the click tracking

    //alert("xiti: "+measurement_type+", "+xtn2+", "+click_name+", "+click_type);

    return xt_click(this, measurement_type, xtn2, click_name);

  }

}

/* ------------------ Indice de chargment --------------- */
webossl_ok = 1;
weboflash_ok = 1;
webo_ok= 1;