	function Chargement(site,id_doc,langue) {
		if (top.LE_HAUT)
		{ 
			top.frames['LE_HAUT'].cols='*,13';
			top.frames['DROIT'].location.href="/scripts/"+site+"/PubliGen/InsideEditing/adm/InsideEditing.asp?P="+id_doc+"&L="+langue;
		}
	}

	function createMailto(sourceForm, targetField, urlType) {
		var to      = sourceForm.to.value;
		var cc      = sourceForm.cc.value;
		var bcc     = sourceForm.bcc.value;
		var subject = sourceForm.subject.value;
		var body    = sourceForm.body.value;
		var urltext = '';
		if (to != '') {
			urltext += to;
		}
		else {
			alert('Vous devez remplir le champ To');
			sourceForm.to.focus();
			return(1);
		}

		if (cc != '') {
			urltext = addDelimiter(urltext);
			urltext += 'CC=' + cc;
		}

		if (bcc != '') {
			urltext = addDelimiter(urltext);
			urltext += 'BCC=' + bcc;
		}

		if (subject != '') {
			urltext = addDelimiter(urltext);
			urltext += 'Subject=' + escape(subject);
		}

		if (body != '') {
			urltext = addDelimiter(urltext);
			urltext += 'Body=' + escape(body);
		}

		if (urlType == 'url') {
			urltext = 'mailto:' + urltext;
		}
		else {
			urltext = '<A HREF=\'mailto:' + urltext + '\'>linkText</A>';
		}

		targetField.value = urltext;
		targetField.focus();
		targetField.select();
		return(1);
	}

	function testMailto(loc) {
		var doc = loc;
		if (doc.indexOf('HREF=') != -1) {
			var doc = doc.substring(doc.indexOf('HREF=')+6, doc.indexOf('>')-1);
		}
		window.location = doc;
	}

	function viewMailto(linktext) {
		alert('URL:\n\n' + linktext);
	}
// OPENWIN
	function openWin(name,src,lngWidth,lngHeight,bScroll) {
		var xCoord;
		var yCoord;
		var strAgent=navigator.userAgent;
		if (typeof(window['tmp']) != 'undefined'){
			if (tmp) tmp.close();
			}
		if (strAgent.indexOf('Mozilla/3')==-1 && strAgent.indexOf('MSIE 3')==-1) {
			xCoord=(screen.width/2 - (lngWidth/2));
			yCoord=(screen.height/2 - (lngHeight/2));
		}
		tmp=open(src,name,'top='+ yCoord +',left='+ xCoord +',directories=no,menubar=no,scrollbars='+bScroll+',resizable=no,location=no,toolbar=no,width='+lngWidth+',height='+lngHeight);
		if (strAgent.indexOf('MSIE 3')==-1) tmp.focus();
	}

	function addDelimiter(inputString) {
		var inString = inputString;
		if (inString.indexOf('?') == -1) {
			inString += '?';
		}
		else {
			inString += '&';
		}
		return inString;
	}

	function zoom()
	{
		if (top!=this) {
			open(location.href,'Zoom','directories=no,menubar=yes,scrollbars=yes,resizable=yes,location=no,toolbar=no');
		}
		else {
			close();
		}
	}

function flipflop() {
	if( document.getElementById("MENUACCESDIRECT").className=='showAccesDirect'){
		document.getElementById("MENUACCESDIRECT").className='hideAccesDirect' }
		else { 
		document.getElementById("MENUACCESDIRECT").className='showAccesDirect' }
}
function deroule() {
	document.getElementById("MENUACCESDIRECT").className='showAccesDirect';
}
function enroule() {
	document.getElementById("MENUACCESDIRECT").className='hideAccesDirect';
}

function ChangeOnglet(idbrique, identifiant){
	voirBlabla('CAT_' + identifiant + '_' + idbrique,idbrique);
}

function ChangeTab(idbrique, identifiant){
	voirBlabla('CAT_' + identifiant + '_' + idbrique,idbrique);
}

function ChangeOngletInline(idbrique, identifiant){
	voirBlablaInline('CAT_' + identifiant + '_' + idbrique,idbrique);
}

function ChangeTabInline(idbrique, identifiant){
	voirBlablaInline('CAT_' + identifiant + '_' + idbrique,idbrique);
}


function getXhr(){ 

	var xhr = null; 
	if(window.XMLHttpRequest) // Firefox et autres
	   xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
	   try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
	}
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   xhr = false; 
	} 
	return xhr

}

function setTools(URL){
	
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4 && xhr.status == 200){
			if (document.getElementById('trait').style.visibility == "hidden"){
				document.getElementById('appli').innerHTML= xhr.responseText;
				}
			else
				{
				document.getElementById('appli').style.visibility = "hidden";
				document.getElementById('appli').innerHTML= xhr.responseText;
				flipflop();
				document.getElementById('appli').style.visibility = "visible";
				}
		}
	}
	xhr.open("GET",URL,true);
	xhr.send(null);
}

function rollIcone(id,status) {
	if(status=='on'){
		document.all['IconeLink'][id].src = arrICONE_ON[id].src;}
	else{
		document.all['IconeLink'][id].src = arrICONE_OFF[id].src;}
	}	

	
function mapauto(strID_DOC,strID_LANG){
	var strTreeName;
	if (top.TOC!=null){ 
		strTreeName=top.TOC.GetTreeName();
		var strLink=escape('P='+ strID_DOC + '&L=' + strID_LANG ); 
		url=location.href;
		location='/scripts/' + url.substring(url.indexOf("scripts/")+8,url.indexOf("/publigen")) + '/publigen/tree/templates/map.asp?TREE=' + strTreeName + '&LEVEL=all&REFERER=' + strLink;
	}
}

function fillDiv(div_id, URL){
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4 && xhr.status == 200){
			document.getElementById(div_id).innerHTML= xhr.responseText;		
			}
	}
	xhr.open("GET",URL,true);
	xhr.send(null);
}

function ReadCookie(cookieName) {
	cookieName = cookieName.replace(/_/g, "%5F");
	cookieName = cookieName.replace(/-/g, "%2D");
	var theCookie = "" + parent.document.cookie;
	var ind = theCookie.indexOf(cookieName);
	if (ind == -1 || cookieName == "") return "";
	var ind1 = theCookie.indexOf(';', ind);
	if (ind1 == -1) ind1 = theCookie.length;
	return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
}
