
//Cfg
/*
var nasteoWidth = 300;
var nasteoHeight = 600;
var nasteoDepth = 1;//1 : Site complet, 2 : page
var ID = fichier de conf XML
*/
function nasteoTag (nasteoWidth, nasteoIfrHeight, nasteoDepth, nasteoIdTag, nasteoIdSite, nasteoModo, nasteoModoOnly ) {

				 var nasteoHeight = nasteoIfrHeight;
				 
				 if(!nasteoIDPasserelle)
					var nasteoIDPasserelle = '';
				 
				 //Catchall pour anciens tags
				 if(nasteoIdSite == '') {
				 				 nasteoIdSite = 1;
				 }
				 
				 var nasteoSrcUrl = "http://www.nasteo.net/index.html";
				 				 
				 //Recup des params d'accès de la page
				 switch (nasteoDepth) {
				 				//Channel site complet
								case 1:
										 var nasteoQr = htmlEnc(window.location.hostname);
								break;
				 				//Channel page								
								case 2:
										 //Faudra penser au nettoyage des phpsessid et ce genre de choses, et permettre au wmaster de preciser quels parametres nettoyer (PHPSESSID, etc)
										 var nasteoQr = htmlEnc(window.location.hostname+window.location.pathname+window.location.search);						
								break;
				 }
				 var nasteoFullUrl = escape(htmlEncLight(window.location.hostname+window.location.pathname+window.location.search));						
				 var nasteoIframeUrl = nasteoSrcUrl+"?nasteoModoOnly="+nasteoModoOnly+"&nasteoBoxWidth="+nasteoWidth+"&nasteoBoxHeight="+nasteoHeight+"&nasteoIDPass="+nasteoIDPasserelle+"&nasteoChan="+nasteoQr+"&site="+nasteoIdSite+"&tag="+nasteoIdTag+"&www=dev.nasteo.net&nasteoModo="+escape(nasteoModo)+"&full_url="+nasteoFullUrl;
				 //var nasteoIframeUrl = nasteoSrcUrl+"?nasteoChan="+nasteoQr+"&id="+nasteoId;
				 document.write ("<iframe src='"+nasteoIframeUrl+"' width='"+nasteoWidth+"' height='"+nasteoIfrHeight+"' frameborder='0' scrolling='no'></iframe>");
}

function htmlEnc(str) {
  if (!str)
    return null;

  str = str.replace(/\//g,"slash");
  str = str.replace(/\?/g,"intero");
  str = str.replace(/\./g,"dot");
  str = str.replace(/&/g,"ecom");
  str = str.replace(/\=/g,"equ");	
  str = str.replace(/\_/g,"und");	
  str = str.replace(/</g,"cro");
  str = str.replace(/>/g,"dec");
  return str;
}

function htmlEncLight(str) {
  if (!str)
    return null;

  str = str.replace(/&/g,"ecom");
  return str;
}
