
/*******************************************
 *****     PostRéponse Version 2.0     *****
 *******************************************/

var openFileW;
var saveFileW;
var openImageW;
var generatePdfW;

function openImage(){
	openImageW = window.open('openImage.php','openImageW','width=420,height=140,resizable=no');
	//openImageW = window.open('openImage.php','openImageW');
	openImageW.focus();
}

function openImageSubmit(imageTmpName,w,h,imagePath,imageEnc,imageName){
	var monAppliFlash = document.getElementById('enveloppeLaPoste');
 	monAppliFlash.SetVariable('phppassed',imageTmpName);
	monAppliFlash.SetVariable('message',"Cliquez sur valider pour insérer l'image : "+imageName);
	monAppliFlash.SetVariable('width_img',w);
	monAppliFlash.SetVariable('height_img',h);
	monAppliFlash.SetVariable('localPathImg',imagePath);
	monAppliFlash.SetVariable('stringImage',imageEnc);
	monAppliFlash.TSetProperty('/image_mc',7,'1')
	openImageW.close();
	self.focus();
}

function openFile(){
	var typeEnveloppe = enveloppeLaPoste.GetVariable("typeEnveloppe");
	openFileW = window.open('openFile.php?typeEnveloppe=' + typeEnveloppe ,'openFileW','width=420,height=120,resizable=no');
	openFileW.focus();
}

function openFileSubmit(fileNameS,fileContent){
	var monAppliFlash = document.getElementById('enveloppeLaPoste');
	monAppliFlash.SetVariable('nomDuFichier',fileNameS);	
	monAppliFlash.SetVariable('message',"Cliquez sur valider pour ouvrir le fichier : "+fileNameS);
	monAppliFlash.SetVariable('stringAll',fileContent);
	monAppliFlash.TSetProperty('/image_mc',7,'1')
	openFileW.close();
	self.focus();
}

function saveFile(){
	var Left=window.screen.width/2-210;
	var Top=window.screen.height/2-60;
	var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, width=420, height=120, left=" + Left + ", top=" + Top + "'";
	saveFileW = window.open('saveFile.html','saveFileW',Configuration);
	saveFileW.focus();
}


function savePDF(){
	var Left=window.screen.width/2-210;
	var Top=window.screen.height/2-60;
	//var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, width=420, height=120, left=" + Left + ", top=" + Top + "'";
	var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes,scrollbars=yes, width=420, height=400, left=" + Left + ", top=" + Top + "'";
	generatePdfW = window.open('generateur.html','generatePdfW',Configuration);
	generatePdfW.focus();	
}