<!--
//******************************************************************************
//*************************function général*************************************
//******************************************************************************
function TBButtonclic() {
	var element, image;
	image = event.srcElement;
	element = image.parentElement; 
	if (element.TBSTATE == "gray") {
		event.cancelBubble=true;
		return;
		}
	// Change button look based on current state of image.
	if (image.className == "tbIcon") {
		element.className = "tbButtonDown";
		tbRaisedElement = element;
		} 
	else if (image.className == "tbIconDown") {
		element.className = "tbButtonDown";
		}
	event.cancelBubble=true;
}

function TBButtonMouseOver() {
	var element, image;
	image = event.srcElement;
	element = image.parentElement;
	if (element.TBSTATE == "gray") {
		event.cancelBubble=true;
		return;
		}
	// Change button look based on current state of image.
	if (image.className == "tbIcon") {
		element.className = "tbButtonMouseOverUp";
		tbRaisedElement = element;
		} 
	else if (image.className == "tbIconDown") {
		element.className = "tbButtonMouseOverDown";
		}
	event.cancelBubble=true;
} 

function TBButtonMouseOut() {
	var element, image;
	image = event.srcElement;
	element = image.parentElement; 
	if (element.TBSTATE == "gray") {
		event.cancelBubble=true;
		return;
	}
	// Change button look based on current state of image.
	if (image.className == "tbIcon") {
		element.className = "tbButton";
		tbRaisedElement = element;
		} 
	else if (image.className == "tbIconDown") {
		element.className = "tbButton";
		}
	event.cancelBubble=true;
}

function apropos(){
	window.open('apropos.htm','popup','width=304,height=384');
}

function verif() {
	if(top.creation.incPrincipal != 1) {
	    top.creation.menuPrincipal(1);
	    top.creation.navigatePrincipal('IntPrincipal.asp', 1, 'level='+top.arbre.level+'&ref='+top.arbre.ref);
		var TheText = "";
		TheText = "Vous devez passer en mode Édition afin de modifier vos propriétées.\r";
		alert(TheText);
		return false;
	} else {
		return true;
	}	
}
//******************************************************************************
//*************************function général fin*********************************
//******************************************************************************
function TABLE_effacer_cellule() {
	TBButtonclic();
	if(verif() == true) {
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_DELETECELLS,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
			alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function AjoutURL() {
    if(verif() == true) {
        if(Select2.value=='portail'){
            window.parent.frames["principal"].DHTMLSafe1.LoadURL('http://intgext.pole-qca.com/extension/ZonePME/courriel.asp');
        }
        if(Select2.value=='serti'){
            window.parent.frames["principal"].DHTMLSafe1.LoadURL('http://intgext.pole-qca.com/extension/serti/courriel.asp');
        }
        window.parent.frames["principal"].DHTMLSafe1.focus();
    }
}

function TABLE_effacer_colonne() {
	TBButtonclic();
	if(verif() == true) {
		try{	
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_DELETECOLS,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
			alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_effacer_ligne() {
	TBButtonclic();
	if(verif()==true){
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_DELETEROWS,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_insertion_cellule() {
	TBButtonclic();
	if(verif()==true){
		try{	
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_INSERTCELL,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_insertion_colonne() {
	TBButtonclic();
	if(verif()==true){
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_INSERTCOL,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_insertion_ligne() {
	TBButtonclic();	
	if(verif()==true){
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_INSERTROW,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
			}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_fusionner_cellule() {
	TBButtonclic();
	if(verif()==true){
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_MERGECELLS,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_separer_cellule() {
	TBButtonclic();
	if(verif()==true){
		try{
			window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_SPLITCELL,OLECMDEXECOPT_DONTPROMPTUSER);
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
					alert("Vous devez insérer un tableau ou cliquer dans une cellule ");
		}
	}
}

function TABLE_creation() {
	if(verif()==true){
		var pVar = window.parent.frames["principal"].ObjTableInfo;
		var args = new Array();
		var arr = null;
		   
		// Display table information dialog
		args["NumRows"] = window.parent.frames["principal"].ObjTableInfo.NumRows;
		args["NumCols"] = window.parent.frames["principal"].ObjTableInfo.NumCols;
		args["TableAttrs"] = window.parent.frames["principal"].ObjTableInfo.TableAttrs;
		args["CellAttrs"] = window.parent.frames["principal"].ObjTableInfo.CellAttrs;
		args["Caption"] = window.parent.frames["principal"].ObjTableInfo.Caption;
		arr = null;  
		arr = showModalDialog("InsTable.asp",args,"dialogWidth:34em; dialogHeight:30em; scroll:no; center:yes; status:no");
		if (arr != null) {
		  // Initialize table object
		  for ( elem in arr ) {
		    if ("NumRows" == elem && arr["NumRows"] != null) {
		      window.parent.frames["principal"].ObjTableInfo.NumRows = arr["NumRows"];
		    } else if ("NumCols" == elem  ) {
		      window.parent.frames["principal"].ObjTableInfo.NumCols = arr["NumCols"];
		    } else if ("TableAttrs" == elem) {
		      window.parent.frames["principal"].ObjTableInfo.TableAttrs = arr["TableAttrs"];
		    } else if ("CellAttrs" == elem) {
		      window.parent.frames["principal"].ObjTableInfo.CellAttrs = arr["CellAttrs"];
		    } else if ("Caption" == elem) {
		      window.parent.frames["principal"].ObjTableInfo.Caption = arr["Caption"];
		    }
		  } 
		  window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_INSERTTABLE,OLECMDEXECOPT_DONTPROMPTUSER, pVar);  
		}
		//window.parent.frames["principal"].ObjTableInfo = null
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function gras() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand (DECMD_BOLD, OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function effacer() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand (DECMD_DELETE,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function italique() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand (DECMD_ITALIC, OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function couper() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_CUT,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function copier() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_COPY,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function souligner() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_UNDERLINE,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function arriere() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand (DECMD_UNDO,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}  

function avant() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_REDO,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function coller() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_PASTE,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function AjoutPoli(vari) {
	TBButtonclic();
	if(verif()==true){
		if (vari != "Aucun"){
			oSel = window.parent.frames["principal"].DHTMLSafe1.DOM.selection;
			sType=oSel.type;
			var oRange = oSel.createRange();
			oRange.pasteHTML("{[" + vari + "]}");
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
	}	
}

function justifier_droite() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_JUSTIFYRIGHT,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function justifier_gauche() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_JUSTIFYLEFT,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function justifier_centre() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_JUSTIFYCENTER,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function caractere() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_FONT,OLECMDEXECOPT_PROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}

function InsertImg_callback(success) {
    InsertImgSrc(top.uploader.url+top.uploader.local_name);
    
    if(top.uploader.uploaderWindow != null) {
        top.uploader.uploaderWindow.close();
    }
    return;
}

function InsertImg() {
	TBButtonclic();
	if(verif()==true) {
        // Cree une nouvelle instance de l'uploader
        // en specifiant notre fonction pour l'appel de retour
        top.uploader = new UploaderInstance(InsertImg_callback);
        
		window.open('../uploader/envoye.asp?img=1' ,'myWindow','width=410,height=160');
	}
}

function InsertImgSrc(ImgSrc) {
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand (DECMD_IMAGE, OLECMDEXECOPT_DONTPROMPTUSER, ImgSrc);
	}
}

function InsertFile_callback(success) {
    InsertFileSrc(top.uploader.url+top.uploader.local_name, top.uploader.original_name);
    
    if(top.uploader.uploaderWindow != null) {
        top.uploader.uploaderWindow.close();
    }
    return;
}

function InsertFile() {
	TBButtonclic();
	if(verif()==true) {
        // Cree une nouvelle instance de l'uploader
        // en specifiant notre fonction pour l'appel de retour
        top.uploader = new UploaderInstance(InsertFile_callback);
        
		window.open('../uploader/envoye.asp?img=2' ,'myWindow','width=410,height=160');
    }
}

function InsertFileSrc(FileSrc, FileName) {
	if(verif()==true){
		var oSel;
		oSel = window.parent.frames["principal"].DHTMLSafe1.DOM.selection;
		var oRange = oSel.createRange();
		oRange.pasteHTML("<a href=" + FileSrc + ">" + FileName + "</a>");
	}
}

function liste_numerique() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_ORDERLIST,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function liste_point() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_UNORDERLIST,OLECMDEXECOPT_DONTPROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function hyperlien() {
	TBButtonclic();
	if(verif()==true){
		window.parent.frames["principal"].DHTMLSafe1.ExecCommand(DECMD_HYPERLINK,OLECMDEXECOPT_PROMPTUSER);
		window.parent.frames["principal"].DHTMLSafe1.focus();
	}
}
function detail(){
	var element, image;
	image = event.srcElement;
	element = image.parentElement; 
	if(verif()==true){
		if(window.parent.frames["principal"].DHTMLSafe1.ShowDetails==true){
			element.className = "tbButtonMouseOverUp";
			tbRaisedElement = element;
			window.parent.frames["principal"].DHTMLSafe1.ShowDetails=false;
			//window.top.frames(1).window.detail.value=0;
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		else{
			window.parent.frames["principal"].DHTMLSafe1.ShowDetails=true;
			element.className = "tbButtonDown";
			tbRaisedElement = element;
			//window.top.frames(1).window.detail.value=1;
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
	}
}

    function visibleborders() {
	    var element, image;
	    image = event.srcElement;
	    element = image.parentElement;
	    if(top.creation.dhtml.borders == true) {
	        top.creation.dhtml.borders = false;
	        if (top.creation.incPrincipal == 1) {
		        window.parent.frames["principal"].DHTMLSafe1.ShowBorders=false;
		        window.parent.frames["principal"].DHTMLSafe1.focus();
            }
	        element.className = "tbButtonMouseOverUp";
	        tbRaisedElement = element;
	    } else {
	        top.creation.dhtml.borders = true;
	        if (top.creation.incPrincipal == 1) {
		        window.parent.frames["principal"].DHTMLSafe1.ShowBorders=true;
		        window.parent.frames["principal"].DHTMLSafe1.focus();
	        }
	        element.className = "tbButtonDown";
	        tbRaisedElement = element;
	    }
    }
//*****************************************Pipette**********************************************
function GetPCol(){
	TBButtonclic();
	if(verif()==true){
		try{
			window.pipette.options.length=5
			window.pipette.options[0].value='All';
			window.pipette.options[0].text='All';
			window.pipette.options[1].value=window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5011);
			window.pipette.options[1].text='Type   :'+window.pipette.options[1].value;
			window.pipette.options[2].value=window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5013);
			window.pipette.options[2].text='Font    :'+window.pipette.options[2].value;
			window.pipette.options[3].value=window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5014);
			window.pipette.options[3].text='Size    :'+window.pipette.options[3].value;
			window.pipette.options[4].value=window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5015);
			window.pipette.options[4].text='Color   :'+window.pipette.options[4].value;
			//window.pipette.options[5].value=window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5010);
			//window.pipette.options[5].text='BColor :'+window.pipette.options[5].value;
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
		}
	}
}
function SetPCol(){
	TBButtonclic();
	if(verif()==true){
		try{
			PipetteValue=window.pipette.selectedIndex
			if(PipetteValue==0){
				valeur=window.pipette.options(1).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5043,2,valeur);
				valeur=window.pipette.options(2).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5044,2,valeur);
				valeur=window.pipette.options(3).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5045,2,valeur);
				valeur=window.pipette.options(4).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5046,2,valeur);
				//valeur=window.pipette.options(5).value;
				//window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5042,2,valeur);
			}
			if(PipetteValue==1){
				valeur=window.pipette.options(1).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5043,2,valeur);
			}
			if(PipetteValue==2){
				valeur=window.pipette.options(2).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5044,2,valeur);
			}
			if(PipetteValue==3){
				valeur=window.pipette.options(3).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5045,2,valeur);
			}
			if(PipetteValue==4){
				valeur=window.pipette.options(4).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5046,2,valeur);
			}
			if(PipetteValue==5){
				valeur=window.pipette.options(5).value;
				window.parent.frames["principal"].DHTMLSafe1.ExecCommand(5042,2,valeur);
			}
			window.parent.frames["principal"].DHTMLSafe1.focus();
		}
		catch(err){
		}
	}
}
function EditCol(Quoi,pip){
	TBButtonclic();
	if(verif()==true){
		var VarSlice=window.document.getElementById(Quoi).value.slice(1,7);
		window.open('inc/selcolor.asp?Title='+Quoi+'&Color='+VarSlice+'&Pip='+pip,'IntGExt','width=350,height=380');
	}
}
function test(){
	test=window.parent.frames["principal"].DHTMLSafe1.QueryStatus(5052);
	alert(test);
}
//-->
