<!--
   _editor_url = "../javascript/htmlarea/";
   _editor_lang = "fr";

function VerifEmail(email) {
  var verif = /[_\.0-9a-z-]+@([0-9a-z][0-9a-z.-]+\.)+[a-z]{2,4}$/
  if (verif.exec(email) == null) 
	return false;
  else 
	return true;
}
function switch_affichage(id) {
	thisId	= '#'+id;
	$(thisId).toggle("meduim");
}
function show(whichLayer) {
    if (document.getElementById) {
                layerName = document.getElementById(whichLayer);
                layerName.style.display = 'block';
    }
    else if (document.all) {
                layerName = eval(whichLayer);
                layerName.style.display = 'block';
    }
}

function hide(whichLayer) {
    if (document.getElementById) {
                layerName = document.getElementById(whichLayer);
                layerName.style.display = 'none';
    }
    else if (document.all) {
                layerName = eval(whichLayer);
                layerName.style.display = 'none';
    }
}
function switch_display(whichLayer) {
    if (document.getElementById)
                layerName = document.getElementById(whichLayer);
    else if (document.all)
                layerName = eval(whichLayer);
    
    if (layerName.style.display == 'none')
		show(whichLayer);
    else	hide(whichLayer);
}
function launch_thickbox(href) {
	TB_show('Preview',href,false);
	return false;
}
function deleteDialog(url) {
	if (confirm("Voulez-vous mettre ce produit off-line?"))
		document.location.href = url;
}
function deleteDialogSubmit(formId, inputId, value) {
	if (confirm("Souhaitez-vous supprimer cet élément et son contenu définitivement ?")) {
		document.getElementById(inputId).value = value;
		document.getElementById(formId).submit();
	}
}

function loading(id, size) {
	var oFCKeditor1 = new FCKeditor(id);
	oFCKeditor1.BasePath = "/javascript/fckeditor/";
	oFCKeditor1.ToolbarSet = "wa2" ;
	oFCKeditor1.Height = size;
	oFCKeditor1.ReplaceTextarea();
	/*config = new HTMLArea.Config();
	config.statusBar	= false;
	config.width		= '500px';
	config.height		= size+'px';
	config.sizeIncludesToolbar = false;

	// parameters:        button ID,   tooltip,          image,           textMode,
	config.registerButton("gauche_perso", "Alignement à gauche", "../javascript/htmlarea/images/ed_align_left.gif", false,
	// function that gets called when the button is clicked
	  function(editor, id) {
	    editor.surroundHTML('<div align="left">', '</div>');
	  }
	);

	// parameters:        button ID,   tooltip,          image,           textMode,
	config.registerButton("centrer_perso", "Alignement centré", "../javascript/htmlarea/images/ed_align_center.gif", false,
	// function that gets called when the button is clicked
	  function(editor, id) {
	    editor.surroundHTML('<div align="center">', '</div>');
	  }
	);

	// parameters:        button ID,   tooltip,          image,           textMode,
	config.registerButton("droite_perso", "Alignement à droite", "../javascript/htmlarea/images/ed_align_right.gif", false,
	// function that gets called when the button is clicked
	  function(editor, id) {
	    editor.surroundHTML('<div align="right">', '</div>');
	  }
	);

	// parameters:        button ID,   tooltip,          image,           textMode,
	config.registerButton("full_perso", "Alignement justifié", "../javascript/htmlarea/images/ed_align_justify.gif", false,
	// function that gets called when the button is clicked
	  function(editor, id) {
	    editor.surroundHTML('<div style="text-align:justify;">', '</div>');
	  }
	);

	config.toolbar = [
	  ['bold', 'italic', 'underline', 'separator',
	  "gauche_perso", "centrer_perso", "droite_perso", "full_perso", 'separator',
	  "insertorderedlist", "insertunorderedlist","createlink", "insertimage"]
	];
	HTMLArea.replace(id, config);*/
	
	//return oFCKeditor1;
}
function AddDownload (id, sTempUrl) {
	FCKeditorAPI.GetInstance(id).CreateLink(sTempUrl);
}
function gotodownload(url) {
	if (url != "") {
		window.open(url,"Download","width=100,height=100,left=10,top=10,status=no");
	}
}
function changeUni(Id, dir, src) {
	if (document.getElementById(Id)) {
		document.getElementById(Id).src	= dir+'/'+src;
	}
}
function chargeCookieIframe(url) {
	window.open("generate_cookie.php?frame_url="+url, "cookextranet", "scrollbars=no,lef=-1000,width=0,height=0,dependent=no,directories=no ,top=-1000,status=no,menubar=no,location=no,resizable=no");
}
function voir(id, session) {
	thisId	= '#'+id;
	
	conId	= $(thisId).val();
	
	if (conId.indexOf(";") > 0) {
		conId	= conId.substr(0, conId.indexOf(";"));
	}
	
	window.open("index.php?op=contacts&con_id="+conId+session, "Contact", "scrollbars=yes,lef=0,width=900,height=500,dependent=no,directories=no ,top=0,status=no,menubar=no,location=no,resizable=yes");
}
function voirMandat(id, session) {
	thisId	= '#'+id;
	
	manId	= $(thisId).val();
	
	if (manId.indexOf(";") > 0) {
		manId	= manId.substr(0, manId.indexOf(";"));
	}
	
	window.open("index.php?op=contacts&man_id="+manId+session, "Contact", "scrollbars=yes,lef=0,width=900,height=500,dependent=no,directories=no ,top=0,status=no,menubar=no,location=no,resizable=yes");
}
function visualisation(url) {
	window.open(url, "Visualisation", "scrollbars=yes,lef=0,width=900,height=500,dependent=no,directories=no ,top=0,status=no,menubar=no,location=no,resizable=yes");
}
function changeImg(id, src) {
	thisId	= '#'+id;
	$(thisId).attr('src', src);
}
function checkDisplayInfos() {
	if ($('#newsletter_recherche').attr('checked') == true) {
		$('#infos_newsletter').show("medium");
	}
	else {
		$('#infos_newsletter').hide("fast");
	}
}
function VerifFormVisite(thisForm) {
	if (!VerifEmail(thisForm.con_email.value)) {
		thisForm.con_email.focus();
		$(thisForm.con_email).css('background', 'red');
		window.setTimeout("$('#con_email').css('background', 'white')", 600);
		return false;
	}
	return true;
}
function MM_openWindow(theURL, winName, winWidth, winHeight, winLeft, winTop) {   
	var options = 'width='+winWidth + ',height='+winHeight + ',left='+winLeft + ',top='+winTop; 
	options += ", alwaysRaised=no";            
	options += ", dependent=no";       
	options += ", directories=no";      
	options += ", hotkeys=yes";         
	options += ", location=no";          
	options += ", menubar=no";          
	options += ", resizable=yes";       
	options += ", scrollbars=yes";       
	options += ", status=no";           
	options += ", toolbar=no";          
	options += ", fullscreen=no";            
	window.open(theURL, winName, options); 
}
//-->
