function showFavsUtility() {
	var imgs=document.getElementsByTagName("img");
	var totImgs=imgs.length;
	for(var i=0;i<totImgs;i++) {
		var theImg=imgs[i];
		if(theImg.className=="favs_ico") {
			var theImgCnt=theImg.parentNode;
			if (theImgCnt) {				
				theImgCnt.style.position = "relative";
				theImg.style.display = "block";
				theImg.onclick = function(){
					var modal="add";
					if(this.src.indexOf("remove")>-1)
						modal="remove";
					manageFavs(this.id.replace("favs_", ""),modal);
					return false;
				}
			}
		}
	}
}

function manageFavs(idf,modal) {
	req.open('GET','manage_favs.php?idf='+idf+'&modal='+modal,false);
	req.send(null);
	var response = req.responseText;
	eval(response);
}

addLoadEvent(function() {
	// shows icons/buttons for adding objs to the 'favourites' folder
	showFavsUtility();
});