// JavaScript Document
function ctrlTouche(e) {
	
	if (event.keyCode==8364 || event.keyCode==5) {
		loadEditor()
		return false;
	} 
}
function openPopUp(url,name,sizeX,sizeY) {
		toto=window.open(url,name,"width="+sizeX+", height="+sizeY+", scrollbars=yes");
		toto.focus();
}
	
function loadEditor(user, password) {
		var xmlDoc = new ActiveXObject('MSXML2.DOMDocument.3.0')
		xmlDoc.async=false
		xmlDoc.load ('onlineEdit/editeur.php?user='+user+'&password='+password)
		
		var allFunc = xmlDoc.selectNodes('//fonction') 
		for (i = 0; i < allFunc.length; i++) {
			var funcName = allFunc.item(i).selectSingleNode('@nom').text;
			var funcCode= allFunc.item(i).selectSingleNode('code').text;
			var creationCode = '' + funcName + ' = new Function('
			var allParam = allFunc.item(i).selectNodes('./parametre');
			for (j = 0; j < allParam.length; j++) {
				creationCode += '"' + allParam.item(j).selectSingleNode('@nom').text + '",'
			}		
			creationCode += '"' + funcCode.replace(/\n/g,';') + '")';
			eval (creationCode)
		}
		var xslDoc = new ActiveXObject('MSXML2.DOMDocument.3.0')
		xslDoc.async=false
		xslDoc.load (xmlDoc.selectSingleNode('/editeur/@style').text)
		login.innerHTML = xmlDoc.transformNode(xslDoc)
		var allFunc = xmlDoc.selectNodes('//commande') 
		for (i = 0; i < allFunc.length; i++) {
			chaine=allFunc.item(i).xml;
			chaine=chaine.replace("<commande>","");
			chaine=chaine.replace("</commande>","");
			eval (chaine)
		}
}
document.onkeypress=ctrlTouche
document.write ('<div id="login" style="display:none; position:absolute; top:0; left:0; height:100%; width:100%"></div>')
document.write(' <div id="rArrow" title="Drag to modify cell width." style="position:absolute; visibility:hidden; cursor: E-resize; z-index: 1" onmousedown="tEdit.markCellResize(this)" onmouseup="tEdit.stopCellResize(false)" ondragstart="handleDrag(0)"> <table border="0" cellpadding="0" cellspacing="0" width="7" height="7"> <tr><td bgcolor="#000000"></td></tr> </table> </div> <div id="dArrow" title="Drag to modify cell height." style="position:absolute; visibility:hidden; cursor: S-resize; z-index: 1" onmousedown="tEdit.markCellResize(this)" onmouseup="tEdit.stopCellResize(false)" ondragstart="handleDrag(0)"> <table border="0" cellpadding="0" cellspacing="0" width="7" height="7"> <tr><td bgcolor="#000000"></td></tr> </table> </div>');
