function addToFavorite(label, classname, furl){
	var IEstring = "<a class='" + classname + "' href='javascript:window.external.addfavorite(\""+furl+"\",document.title);' title='Ajouter le site aux favoris'>"+label+"<\/a>" ;
	var NSstring = "<a class='" + classname + "' href='javascript:void(0);' onclick='alert(\"Presser [Ctrl + D] pour ajouter le site aux favoris.\")'>"+label+"</a>";
	var OPstring = "<a class='" + classname + "' href='javascript:void(0);' onclick='alert(\"Presser [Ctrl + T] pour ajouter le site aux favoris.\")'>"+label+"</a>";
	var OTHstring = "<a class='" + classname + "' href='javascript:void(0);' onclick='alert(\"Vous devez ajouter manuellement le site à vos favoris.\")'>"+label+"</a>"
	var whichString = OTHstring ;
	
	var agt = navigator.userAgent.toLowerCase();
	var app = navigator.appName.toLowerCase();
	var ieAgent = agt.indexOf('msie');
	var nsAgent = app.indexOf('netscape');
	var opAgent = app.indexOf('opera');
	
	if (ieAgent!= -1) { 
		whichString = IEstring; 
	} else if (nsAgent!= -1){ 
		whichString = NSstring; 
	} else if (opAgent!= -1){
		whichString = OPstring; 
	}
	
	document.write(whichString);
}


function openPrintWindow(url) {
	document.body.style.cursor="wait";
  	popupWin = window.open(url, "Popup", "directories=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=yes,width=620,innerWidth=615,height=580,left=5,top=10");
}

function openPopupWindow(url) {
  	popupWin = window.open(url, "Popup", "directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400,left=5,top=10");
}

function openPopupWindow(url, width, height) {
  	popupWin = window.open(url, "Popup", "directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left=5,top=10");
}

function resizeWindow(addWidth, addHeight) {
	var img = new Image();
	img.src = window.document.images[0].src;

	var goodWidth = img.width + 50 + addWidth;
	var goodHeight = img.height + 80 + addHeight;
		
	if (goodWidth > screen.availWidth)
		goodWidth = screen.availWidth-5;

	if (goodHeight > screen.availHeight)
		goodHeight = screen.availHeight-10;
		
	if (goodWidth < 190)
		goodWidth = 190;

	if (goodHeight < 30)
		goodHeight = 30;
		
	window.resizeTo(goodWidth, goodHeight);
	
	document.body.style.cursor="default";
	window.opener.document.body.style.cursor="default";
}


function getUrlPageForPrint (){
	if (window.location.href.indexOf('?')!=-1)
		return window.location.href + "&decorator=print";
	else return window.location.href + "?decorator=print";
}