


//************************************************************************
//						DETECTION 2.0 - COMPTOIR DU TERROIR
//************************************************************************
// Auteur : Abiotik / jean luc COSTAGLIOLA
// contact : 04 67 57 03 72
//************************************************************************
// ------------------------------------- tous droits réservés abiotik 2011


//****************************************
// RECUP OLD URL 
//****************************************

	var designRub=0;
	
	if(urlOrigine==''){
		var recup = window.document.location;
		var chaine = recup.toString();
	}
	else{
		var chaine = urlOrigine;
	}	
	
	var longueur = chaine.length;


	// detection pour picto livraison caviar
		var activePictoCaviar=0;
		if(chaine.indexOf('type=42') > 0 || chaine.indexOf('type=53') > 0 || chaine.indexOf('type=54') > 0) 
			activePictoCaviar=1;
			


	var resultat = chaine.indexOf('num=');
	chaine = chaine.substring(resultat+4,longueur);	
	var resultat2 = chaine.indexOf('&');
	if(resultat2 < 0){
		extract = chaine.substring(0,longueur);	
	}
	else{
		extract = chaine.substring(0,resultat2);	
	}	
	extract=extract.toString()


//--------------------------------------- designation rub
	
/*	TABLEAU DE CORRESPONDANCE
****************************
RAYONS / UNIVERS
****************************

JAMBON									univers 1
-----------------------------------------------------
171 jambon espagne							1
81	jambon FR/It							2


CHARCUTERIE/FOIE GRAS					univers 2
-----------------------------------------------------
91	Charcuterie								11
191	Foie Gras								12


HUILES / EPICERIE FINE					univers 3
-----------------------------------------------------
141	huiles									21


CAVIAR / PRODUITS MER					univers 4
-----------------------------------------------------
201	Caviar									31
181	produits mer							32
281 Saumon fumé & Huître					33


VIN						 				univers 5
-----------------------------------------------------
131	vin										41


PRODUITS SUCRES				 			univers 6
-----------------------------------------------------
211	sucré									51


*/

// désignation des rayons
//******************************

	var designRub = 0;

	if (extract == 171) designRub = 1;
	else if(extract == 81) designRub = 2;
	
	else if(extract == 91) designRub = 11;
	else if(extract == 191) designRub = 12;
					
	else if(extract == 141) designRub = 21;
	
	else if(extract == 201) designRub = 31;
	else if(extract == 181) designRub = 32;
	else if(extract == 281) designRub = 33;
		
	else if(extract == 131) designRub = 41;

	else if(extract == 211) designRub = 51;	
	// sinon
	else{designRub = 0;}	



// désignation des Unvivers
//******************************
	var designUnivers = 0;

	if(designRub !=0){
		if(designRub <11) designUnivers=1;
		else if(designRub <21) designUnivers=2;
		else if(designRub <31) designUnivers=3;		
		else if(designRub <41) designUnivers=4;
		else if(designRub <51) designUnivers=5;
		else if(designRub <61) designUnivers=6;		
		else designUnivers=0;		
	}	
	
	
	


	
	
	
	
	
	


