function ProtectPath(path) {
	path = path.replace( /\\/g, '\\\\') ;
	path = path.replace( /'/g, '\\\'') ;
	return path ;
}
function DeleteFile() {
	var agree = confirm("Voulez-vous réellement supprimer ce fichier de la base ?");
	if (agree) return true ; 
	else return false ;
}
function OpenFile(fileUrl, id, type) {
	if( window.top.opener && window.top.opener.SetUrl(id, encodeURI( ProtectPath(fileUrl) ), type = null ) != false ) {
		window.top.close() ;	
		window.top.opener.focus() ;
	}
}
function setEltAfterUpload(val,obj1,obj2) {	document.getElementById(obj1).value=val;	if(obj2 != null) {
		document.getElementById(obj2).innerHTML ='<img src="/upload/images/mini/last_uploaded_mini.jpg?t='+Math.random()+'" />' ;
	}
}
function cookieErase() {
	var ArticleCookie = new Hash.Cookie('ArticleCookieDemo', {autoSave: false});
	Cookie.dispose('ArticleCookieDemo');
}
function cookieDiapoErase() {
	var ArticleCookie = new Hash.Cookie('HashCookieDemo', {autoSave: false});
	Cookie.dispose('HashCookieDemo');
}
function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}
