﻿// PFichas para Argentina

// Borramos las cookies que no sirven ya 
if(typeof(deleteCookie)=='function'){
	deleteCookie('INV_18','');
	deleteCookie('INV_17','');
}

var imagenespia='<img src="/emag_users/commons/set_pfichas.cfm'+location.search;

if(location.search!='') imagenespia+='&'; 
else  imagenespia+='?'; 

if(location.href.indexOf('#')!=-1){
   queryaddword=location.href.split('#')[1];
   imagenespia+=queryaddword+"&";
}

imagenespia+='referencia='+document.referrer.replace(new RegExp('&','gi'), '|');
imagenespia+='&entrada='+location.href.replace(new RegExp('&','gi'), '|');
imagenespia+='" width="0" height="0" style="position:absolute;top:-100px">';

document.write(imagenespia);

// Google Analytics
function ga(){
	var readVal="";
	if (document.getElementById('readableVal') != null) {
		readVal=document.getElementById('readableVal').value;
	}
	cpoh=document.getElementsByTagName('head')[0];
	urch1=document.createElement('script');
	if (top.location.href.indexOf("https://")==-1){		
		urch1.setAttribute('src','http://www.google-analytics.com/ga.js');
	}else{
		urch1.setAttribute('src','https://ssl.google-analytics.com/ga.js');	
	}	
	cpoh.appendChild(urch1);
	urch2=document.createElement('script');
	urch2.setAttribute('src','/emag_users/commons/js/analytics.cfm?readableVal='+readVal);	
	cpoh.appendChild(urch2);

}
ga();





