function docTag_set_link() {
$("a.documentpreview[href],a.pictopreview[href]").each(function() {
var $a = $(this);
var url = $a.attr('href');
if(url.indexOf('document.php?')!=-1 && url.indexOf('action=delete')==-1 && url.indexOf('file=')!=-1) {
filename = $a.text();
if(filename == '') filename = $a.find('img').attr('alt');
var tag64 = window.btoa(url);
url = "javascript:docTag_pop('/test1/custom/doctag/tag.php?tag64="+ tag64 +"','"+filename+"')";
if($a.hasClass('pictopreview') && !$a.hasClass('documentpreview')) {
link = ' tag';
}
else if($a.parent().is('li')) {
link = '';
}
else{
link = '
';
}
if(link.length>0) {
$(this).after(link);
$.ajax({
url : "/test1/custom/doctag/script/interface.php?get=tag64exist&tag64="+tag64
}).done(function(nb_tag) {
if(nb_tag>0) {
$img = $('a[tag64="'+tag64+'"]').find("img");
$img.attr("src","/test1/custom/doctag/img/object_doctag_blue.png");
$img.attr("title",nb_tag+" tag(s)");
}
});
}
}
});
}
function docTag_pop(url, filename) {
$('#docTag').remove();
if($('#docTag').length==0) {
$('body').append('