function setAction(action, uid, muid, msg) {
	if(msg != '') {
		if(!confirm(msg)) {
			return ;
		}	
	}
	document.frmDetail.action.value = action ;
	document.frmDetail.uid.value = uid ;
	document.frmDetail.muid.value = muid ;
	document.frmDetail.submit() ;
}

function openPopup(url,nom,largeur,hauteur, options) {
	var haut=(screen.height-hauteur)/2;
	var Gauche=(screen.width-largeur)/2;
	_popup=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}

tinyMCE.init({
	mode : "specific_textareas",
	textarea_trigger : "tinytextarea",
	theme : "advanced",
	plugins : "table,preview,fontselect,fontsizeselect,insertdatetime,searchreplace",
	theme_advanced_buttons1_add_before : "save,newdocument,separator",
	theme_advanced_buttons1_add : "fontselect,fontsizeselect",
	theme_advanced_buttons2_add_before: "search,replace,separator",
	theme_advanced_buttons2_add : "preview, separator,insertdate,inserttime,separator,forecolor,backcolor",	
	theme_advanced_buttons3_add_before : "tablecontrols,separator",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	content_css : "themes/red/css/style.css",
    plugin_insertdate_dateFormat : "%d-%m-%Y",
    plugin_insertdate_timeFormat : "%H:%M:%S",	
	file_browser_callback : "fileBrowserCallBack",
	extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
	theme_advanced_resize_horizontal : false,
	theme_advanced_resizing : true,
	language : "fr",
	relative_urls : false,
	remove_script_host : false
});

function fileBrowserCallBack(field_name, url, type, win) {
	
	if(type=="image") {
		// This is where you insert your custom filebrowser logic
		alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
	} else if(type=="page") {
		alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
	} else if(type=="file") {
		alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
	}
}

