function popup(url, name, scrollbars, width, height)
{
	window.open( url, name, 'scrollbars='+scrollbars+', width='+width+', height='+height );
}

function checkMontant(champ)
{
	var isOk;
	if (champ.value != '')
	{
		if (isNaN(champ.value))
			isOk = false;
		else
		{
			if (champ.value < 0)
				isOk = false;
			else
				isOk = true;
		}
	}
	else
		isOk = true;
		
	if (isOk == false)
	{
		alert('Ce montant doit être un nombre positif');
		champ.focus();
	}
	return isOk;
}

function checkMontantR(champ)
{
	var isOk;
	if (champ.value != '')
	{
		if (isNaN(champ.value))
			isOk = false;
	}
	else
		isOk = true;
		
	if (isOk == false)
	{
		alert('Ce montant est incorrect');
		champ.focus();
	}
	return isOk;
}

function ExportExcel()
{
	var oExcel;
	var oExcelSheet;
	var oWkBooks;
	
	textRange = document.body.createTextRange();
	textRange.moveToElementText(divMain);
	textRange.execCommand('Copy');
	
	oExcel = new ActiveXObject('Excel.Application');
	oWkBooks = oExcel.Workbooks.Add;
	oExcelSheet = oWkBooks.Worksheets(1);
	oExcelSheet.Application.Visible = true;                
	      
	oExcelSheet.Activate();
	
	oExcel.ActiveSheet.Range('A1').Select;
	oExcel.ActiveCell.PasteSpecial(0,false,false);
	                     
	oExcel.ActiveSheet.Cells.EntireColumn.AutoFit;
	oExcel.ActiveSheet.Cells.EntireRow.AutoFit.AutoFit;
	oExcel.ActiveSheet.Range('A1').Select;
}