/* fonction servant pour le tracking */

var partner_tags = {
	"adomos_accueil": { /* formulaire simulateur */
		250: '<img src="http://test_msn.com" width="1" height="1" />',
		251: '<img src="http://ads.bluelithium.com/pixel?id=791226&t=2" width="1" height="1" />',
		252: '',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"scellier_simul": { /* formulaire simulateur */
		250: '',
		251: '<img src="http://ads.bluelithium.com/pixel?id=791227&t=2" width="1" height="1" />',
		252: '',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"scellier_suspect": { /* proposition 3 programmes */
		250: '<img height="1" width="1" src="http://view.atdmt.com/action/amfadm_AdomosFRinfosFormulaire120510_1"/>',
		251: '<img src="http://ads.bluelithium.com/pixel?id=791225&t=2" width="1" height="1" />',
		252: '<img src="http://ad.yieldmanager.com/pixel?id=767016&t=2" width="1" height="1" />',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"scellier_prospect": { /* confirmation 2nd formulaire */
		250: '',
		251: '',
		252: '',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"scellier_scpi": { /* Paris RP, revenus entre 10k et 25k */
		250: '',
		251: '',
		252: '',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"scellier_refus": { /* Non exploitable */
		250: '',
		251: '',
		252: '',
		28: '' /* ce point de diffusion est celui de Adomos.com, ne pas toucher */
	},
	"lmnp_bouvard_suspect": { /* affichage formulaire */
		980: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
		1000: '<img src="http://www.mediaffiliation.com/tracking/cpx.php?idc=469&type=cpl&tracking=###KEY###" height="1" width="1" border="0">',
		28: '' /* ce point de diffusion est celui du site, ne pas toucher */
	} /* pas de virgule pour le dernier bloc, sinon ie aime pas du tout */
};

var partner_pubs = {
	/* Mediaffiliation */
	7637: '<img src="http://www.mediaffiliation.com/tracking/cpx.php?idc=469&type=cpl&tracking=###KEY###" height="1" width="1" border="0">',
	/* El */
	6404: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7291: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7292: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7916: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7926: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7927: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7928: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7929: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	7934: '<img src="http://www.affiliatis.com/redirection/tracking.php?tracking=###KEY###&data=493|1" height="1" width="1" border="0">',
	/* Hakim */
	7972: '<img src="http://baseco.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=310703&A=2&TR=12950&CL=&AC=&MA=0.0&AR=1&AV=0" border="0" width="1" height="1">',
	8088: '<img src="http://baseco.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=310703&A=2&TR=1055&CL=&AC=&MA=0.0&AR=1&AV=0" border="0" width="1" height="1">',
	/* Max */
	7933: '',
	/* Site */
	234: ''
	
};

function rdp_callback (data) {
	// old format adapter
	// function rdp_callback ( dp, pub)
	// {
		// var f = window.document.forms[0];
		// if (f && f.x_provenance)
			// f.x_provenance.value = dp + '_' + pub;
	// }
	if (arguments.length == 2) {
		data = { rdid: arguments[0], rpid: arguments[1] };
	}

	if (data && data.rdid) {

		if (data.rpid) {
			var f = window.document.forms[0];
			if (f && f.x_provenance)
				f.x_provenance.value = data.rdid + '_' + data.rpid;
		}

		if (data.tag) {

			if (data.rdid == 980 && data.rpid in partner_pubs) {
				if (partner_pubs[data.rpid].length > 0) {
					var pixel = partner_pubs[data.rpid];
					if (data.key && pixel.search('###KEY###') != -1)
						pixel = pixel.replace(/###KEY###/g, data.key);
					document.write(pixel);
				}

<!-- PH: 		if ($PH_REVENU > 28000) { -->
				if (data.rpid == 7637) {
					if (data.tag in partner_tags ) {
						if (partner_tags[data.tag][1000].length > 0) {
							var pixel = partner_tags[data.tag][1000];
							if (data.key && pixel.search('###KEY###') != -1)
								pixel = pixel.replace(/###KEY###/g, data.key);
							document.write(pixel);
						}
					}
				}
<!-- PH:		} -->

			}
			else {
				if (data.tag in partner_tags && data.rdid in partner_tags[data.tag] )
					if (partner_tags[data.tag][data.rdid].length > 0)
						document.write(partner_tags[data.tag][data.rdid]);
			}
		}
	}
}




