<!--
// Weboscope Performance - wbo_performance_rnat.js version 1.0 ES
// Weboscope is a trademark property of weborama
// http://www.weboscope.com

///////////////////////////////////////////
// Performance Ref Nat Class Spanish version //
////////////////////////////////////////

/* This file is for Viajes Crisol */

// location
var WPERF_SERVER = ".weborama.fr";
var WPERF_PRGM = "/fcgi-bin/performance.fcgi";

function performanceRefNat()
{
    // Attributs
    this.FID_SITE = 293130;
    this.cookieSITE = 'perfvisite'+this.FID_SITE;
    
    this.C_RNAT = 2046;
    this.P_GOOGLE = 4006;
    this.L_GOOGLE_ES = 28557;
    this.L_GOOGLE_COM = 28558;
    this.L_GOOGLE_OTH = 28559;

    this.P_MSN = 4008;
    this.L_MSN_ES = 28563;
    this.L_MSN_COM = 28564;
    this.L_MSN_OTH = 28565;

    this.P_YAHOO = 4007;
    this.L_YAHOO_ES = 28560;
    this.L_YAHOO_COM = 28561;
    this.L_YAHOO_OTH = 28562;

    this.P_AOL = 4009;
    this.L_AOL_ES = 28566;
    this.L_AOL_COM = 28567;
    this.L_AOL_OTH = 28568;

    this.P_YA = 4010;
    this.L_YA_COM = 28569;

    this.P_NOXTRUM = 4018;
    this.L_NOXTRUM_COM = 28570;

    this.P_ASK = 4011;
    this.L_ASK_OTH = 28572;
    this.L_ASK_ES = 28571;

	this.P_HISPA = 4012;
    this.L_HISPA_COM = 28573;
	
	this.P_ALLTHE = 4013;
    this.L_ALLTHE_COM = 28574;
	
	this.P_TERRA = 4014;
    this.L_TERRA_COM = 28575;
    this.L_TERRA_ES = 28576;
    this.L_TERRA_OTH = 28577;

	this.P_ALTA = 4015;
    this.L_ALTA_COM = 28578;
    this.L_ALTA_ES = 28579;
    this.L_ALTA_OTH = 28580;

    this.P_LYCOS = 4016;
    this.L_LYCOS_COM = 28581;
    this.L_LYCOS_ES = 28582;
    this.L_LYCOS_OTH = 28583;

    this.P_OTHERS = 4017;
    this.L_OTHERS = 28584;
	
	this.C_USED = this.C_RNAT;
	this.P_USED = this.P_OTHERS;
	this.L_USED = this.L_OTHERS;
		
	this.NEED_PARSE_OTHERS = 1;
	
    // Fonctions
    this.launchParsing = launchParsing;
    this.parseGOOGLE = parseGOOGLE;
    this.parseMSN = parseMSN;
    this.parseYA = parseYA;
    this.parseASK = parseASK;
    this.parseTERRA = parseTERRA;
    this.parseALTA = parseALTA;
    this.parseALLTHE = parseALLTHE;
    this.parseHISPA = parseHISPA;
    this.parseLYCOS = parseLYCOS;
    this.parseYAHOO = parseYAHOO;
    this.parseAOL = parseAOL;
    this.parseNOXTRUM = parseNOXTRUM;
    this.parseOTHERS = parseOTHERS;
    this.getURL = refnatgetURL;
    this.setParseOthers = setParseOthers;
    this.execute = refnatexecute;
    this.doRequest = refnatdoRequest;
}

function setParseOthers(_VALUE)
{
	this.NEED_PARSE_OTHERS = _VALUE;	
}

function refnatexecute()
{
	if (webo_performance_rnat == 0) return 1;
	if (document.cookie.indexOf(this.cookieSITE) >= 0) return 2;

	var cur_domaine = document.location.host;
	var a_points = cur_domaine.split('.');
	if (a_points.length > 2) 
		cur_domaine = cur_domaine.substring(cur_domaine.indexOf('.')+1, cur_domaine.length);
	if (document.referrer)
	{
		this.REFERRER = document.referrer.toLowerCase();

		this.REF_DOMAIN = this.REFERRER;
		var a_div = this.REF_DOMAIN.split('/');	
		for (i = 2; i < a_div.length; ++i)
		{
			if (a_div[i].length)
			{
				this.REF_DOMAIN = a_div[i];
				i = a_div.length;
			}
		}					
		if (this.REF_DOMAIN.indexOf(cur_domaine) == -1)
		{
			if (this.launchParsing()) this.doRequest();
		}
	}	
	document.cookie = this.cookieSITE+"=1;path=/";
	return 0;
}

function launchParsing()
{
	if (this.parseGOOGLE()) return 1;
	if (this.parseMSN()) return 1;
	if (this.parseYAHOO()) return 1;
	if (this.parseYA()) return 1;
	if (this.parseTERRA()) return 1;
	if (this.parseALTA()) return 1;
	if (this.parseLYCOS()) return 1;
	if (this.parseAOL()) return 1;
	if (this.parseHISPA()) return 1;
	if (this.parseALLTHE()) return 1;
	if (this.parseASK()) return 1;
	if (this.parseNOXTRUM()) return 1;	

	if (this.NEED_PARSE_OTHERS) return this.parseOTHERS();	
	return 0;
}

function parseYA()
{
	if (this.REF_DOMAIN.indexOf('.ya.com') >= 0)
	{ 
		this.P_USED = this.P_YA;
		this.L_USED = this.L_YA_COM;
		return 1;
	}	
	return 0;
}

function parseNOXTRUM()
{
	if (this.REF_DOMAIN.indexOf('.noxtrum.com') >= 0)
	{ 
		this.P_USED = this.P_NOXTRUM;
		this.L_USED = this.L_NOXTRUM_COM;
		return 1;
	}	
	return 0;
}

function parseHISPA()
{
	if (this.REF_DOMAIN.indexOf('.hispavista.com') >= 0 || this.REF_DOMAIN.indexOf('.hispavista.es') >= 0)
	{ 
		this.P_USED = this.P_HISPA;
		this.L_USED = this.L_HISPA_COM;
		return 1;
	}	
	return 0;
}

function parseALLTHE()
{
	if (this.REF_DOMAIN.indexOf('.alltheweb.com') >= 0)
	{ 
		this.P_USED = this.P_ALLTHE;
		this.L_USED = this.L_ALLTHE_COM;
		return 1;
	}	
	return 0;
}

function parseGOOGLE()
{
	if (this.REF_DOMAIN.indexOf('.google.') >= 0)
	{ 
		this.P_USED = this.P_GOOGLE;
		this.L_USED = this.L_GOOGLE_OTH;
		if (this.REF_DOMAIN.indexOf('.google.es') >= 0) this.L_USED = this.L_GOOGLE_ES;
		if (this.REF_DOMAIN.indexOf('.google.com/') >= 0) this.L_USED = this.L_GOOGLE_COM;
		return 1;
	}	
	return 0;
}

function parseASK()
{
	if (this.REF_DOMAIN.indexOf('.ask.com') >= 0)
	{ 
		this.P_USED = this.P_ASK;
		this.L_USED = this.L_ASK_OTH;
		if (this.REF_DOMAIN.indexOf('es.ask.com') >= 0) this.L_USED = this.L_ASK_ES;
		return 1;
	}	
	return 0;
}

function parseTERRA()
{
	if (this.REF_DOMAIN.indexOf('.terra.') >= 0)
	{ 
		this.P_USED = this.P_TERRA;
		this.L_USED = this.L_TERRA_OTH;
		if (this.REF_DOMAIN.indexOf('.terra.es') >= 0) this.L_USED = this.L_TERRA_ES;
		if (this.REF_DOMAIN.indexOf('.terra.com/') >= 0) this.L_USED = this.L_TERRA_COM;
		return 1;
	}	
	return 0;
}

function parseLYCOS()
{
	if (this.REF_DOMAIN.indexOf('.lycos.') >= 0)
	{ 
		this.P_USED = this.P_LYCOS;
		this.L_USED = this.L_LYCOS_OTH;
		if (this.REF_DOMAIN.indexOf('.lycos.es') >= 0) this.L_USED = this.L_LYCOS_ES;
		if (this.REF_DOMAIN.indexOf('.lycos.com/') >= 0) this.L_USED = this.L_LYCOS_COM;
		return 1;
	}	
	return 0;
}

function parseALTA()
{
	if (this.REF_DOMAIN.indexOf('.altavista.') >= 0)
	{ 
		this.P_USED = this.P_ALTA;
		this.L_USED = this.L_ALTA_OTH;
		if (this.REF_DOMAIN.indexOf('es.altavista.com') >= 0) this.L_USED = this.L_ALTA_ES;
		if (this.REF_DOMAIN.indexOf('www.altavista.com') >= 0) this.L_USED = this.L_ALTA_COM;
		return 1;
	}	
	return 0;
}

function parseMSN()
{
	if (this.REF_DOMAIN.indexOf('.msn.') >= 0)
	{ 
		this.P_USED = this.P_MSN;
		this.L_USED = this.L_MSN_OTH;
		if (this.REF_DOMAIN.indexOf('.msn.es') >= 0) this.L_USED = this.L_MSN_ES;
		if (this.REF_DOMAIN.indexOf('.msn.com') >= 0) this.L_USED = this.L_MSN_COM;
		return 1;
	}	
	return 0;
}

function parseYAHOO()
{
	if (this.REF_DOMAIN.indexOf('.yahoo.') >= 0)
	{ 
		this.P_USED = this.P_YAHOO;
		this.L_USED = this.L_YAHOO_OTH;
		
		if (this.REF_DOMAIN.indexOf('es.search.yahoo.com') >= 0) this.L_USED = this.L_YAHOO_ES;
		else if (this.REF_DOMAIN.indexOf('.yahoo.es') >= 0) this.L_USED = this.L_YAHOO_ES;
		else if (this.REF_DOMAIN.indexOf('.yahoo.com') >= 0) this.L_USED = this.L_YAHOO_COM;
		return 1;
	}	
	return 0;
}

function parseAOL()
{
	if (this.REF_DOMAIN.indexOf('.aol.') >= 0)
	{ 
		this.P_USED = this.P_AOL;
		this.L_USED = this.L_AOL_OTH;
		if (this.REF_DOMAIN.indexOf('.aol.es') >= 0) this.L_USED = this.L_AOL_ES;
		if (this.REF_DOMAIN.indexOf('.aol.com/') >= 0) this.L_USED = this.L_AOL_COM;
		return 1;
	}	
	return 0;
}

function parseOTHERS()
{
	if (this.REF_DOMAIN.length)
	{
		this.REFERRER = "?Q="+escape(this.REF_DOMAIN);
		return 1;
	}
	return 0;
}

function refnatgetURL()
{
    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 + "&RN=1&A=1&T=I&W=1";
    wbs_arg += "&C=" + this.C_USED + "&P=" + this.P_USED + "&L=" + this.L_USED;
    wbs_arg += "&URL=http%3A%2F%2Fstatic.weborama.fr%2Fimages%2Ftransp.gif";
    wbs_arg += "&RND=" + wbs_da;    
    wbs_arg += "&NREF="+escape(this.REFERRER);

    return wbs_arg;
}

function refnatdoRequest()
{
    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 Ref Nat ON /OFF //
//////////////////////////////////

webo_performance_rnat = 1;

//-->




