var serveur;var RACINE_stage;var API; var lexique; var tabHistorique;var xmlParcours=null; var sysFich=null;var FICH_PARCOURS=""; var MOS_LMS_LOCAL=true;var etapeDepuisGNR="";function LMS_init(version){serveur=new LMSLocal;serveur.init(version);var strLoc=new String(window.location.href);if (strLoc.indexOf('plEc=oui')<0){try{if (FEN_L!=''){FEN_L=parseInt(FEN_L);}if (FEN_H!=''){ FEN_H=parseInt(FEN_H);}if (FEN_X!=''){ FEN_X=parseInt(FEN_X);}if (FEN_Y!=''){ FEN_Y=parseInt(FEN_Y);}if ((!isNaN(FEN_X))&&(!isNaN(FEN_Y))){window.moveTo(FEN_X,FEN_Y);}if ((!isNaN(FEN_L))&&(!isNaN(FEN_H))&&(FEN_L>0)&&(FEN_H>0)){if (FEN_L>window.screen.width){FEN_L=window.screen.width;}if (FEN_H>window.screen.height){FEN_H=window.screen.height-25;}window.resizeTo(FEN_L,FEN_H);}}catch(e){} }var indexD=strLoc.lastIndexOf("index.htm");if (indexD<0){indexD=strLoc.lastIndexOf("start.hta");}if (indexD<0){indexD=strLoc.length;}RACINE_stage=strLoc.substring(0,indexD);if (strLoc.indexOf("?sco")>0){try {if (window.opener.top.menu!=null){etapeDepuisGNR=donneParam("sco");}}catch(e){}}var refCods=RACINE_stage.substring(0,RACINE_stage.length-1);var indeB=refCods.lastIndexOf("/");serveur.codeStage=refCods.substring(indeB+1);indeB=refCods.lastIndexOf("MosPub");if ((strLoc.indexOf("http://")<0)&&(etapeDepuisGNR=="")){var psync=donneParam("sync");if (psync!=""){FICH_PARCOURS=refCods.substring(0,indeB)+"MosData/sync/"+serveur.codeStage+"/"+psync+".xml";try {sysFich=window.opener.mosUTF;}catch(e){sysFich=null;}} else {FICH_PARCOURS=RACINE_stage+"MosMtr/parcours.xml";}FICH_PARCOURS=unescape(FICH_PARCOURS);}lexique = new ICLexique();lexique.init();LEX_entrerLexs(); API=new APIAdapter();window.planLMS.location=RACINE_stage+"imsmanifest."+version;tabHistorique = new Array(); }function LMS_quitter(){if (window.contenuLMS.oSco){ window.contenuLMS.SCO_quitter();window.contenuLMS.etatSortie=true;}LMS_persisteParcours();xmlParcours=null;} function LMS_persisteParcours(){if (xmlParcours!=null){var loca=FICH_PARCOURS;if (sysFich==null){try {sysFich=new ActiveXObject("MOSUTF.ctlConvert");} catch(e){}}if (sysFich!=null){if (loca.indexOf("http://")<0){loca=loca.replace(/file:\/\/\//,'');loca=loca.replace(/\//g,"\\");sysFich.createUTF8File(window.planLMS.PLAN_donnerParcoursXML(),loca,false);var psync=donneParam("sync");if (psync!=""){try {window.opener.ATR_retourParc(serveur.codeStage,psync);}catch(e){}}}}}}function LMS_chargerParcoursLocal(){if (FICH_PARCOURS==""){return false;}xmlParcours = jsXML.createDOMDocument();xmlParcours.async=false; var succ=false;try { succ=xmlParcours.load(FICH_PARCOURS); } catch (e){} if (succ&&(xmlParcours.documentElement.tagName=="parcours")){var oRac=xmlParcours.documentElement;window.planLMS.dernierSCO=valAttrDom(oRac,"dernierSCO");serveur.codeStageParcours=valAttrDom(oRac,"codeStage");serveur.adresseMosManager=valAttrDom(oRac,"adresseMosManager");serveur.codeGroupe=valAttrDom(oRac,"codeGroupe");serveur.typeMosManager=valAttrDom(oRac,"typeMosManager");serveur.langueMng=valAttrDom(oRac,"langueMng");serveur.id=valAttrDom(oRac,"id");serveur.nomScorm=valAttrDom(oRac,"nomScorm");var lesunites=xmlParcours.getElementsByTagName("unite");for (var n=0;n<lesunites.length;n++){var oUnit=lesunites.item(n);var idUParc=oUnit.getAttribute("id");var itemParc=window.planLMS.MENU_trouveItemID(idUParc);if (itemParc!=null){chargeUnite(itemParc,oUnit);}}window.planLMS.PLAN_calculParcours(window.planLMS.itemRacine);} else {xmlParcours=null;}window.planLMS.MENU_afficheParcours();}function LMS_synchroniser(){if (LMS_synchroActive()){var oFen=window.open(RACINE_stage+"MosMtr/gen/synchroMosSrv.htm","fenSync","menubar=no,toolbar=no,location=no,height=28,width=250,top=50,left=100");oFen.focus();}} function LMS_synchroActive(){var res=false;if (serveur.adresseMosManager!=''){res=true;}return res;} function LMS_donneLex(num){var res2=lexique.lexs[num];if ((res2==null)||(res2=="undefined")){res2="[LEX_"+num+"]";}return res2;}function LMS_modePleinEcran(){var loc=window.location.href;var locSimple;if (loc.indexOf("index.html")<0){locSimple=loc+"index.html";} else {locSimple=loc.substring(0,loc.indexOf('.htm'))+'.html';}var optionPE='fullscreen=yes,';var ajoutFE;if (loc.indexOf('plEc=oui')>0){ajoutFE='&plEc=non';optionPE='';} else {ajoutFE='&plEc=oui';}var oPage=null;if (window.contenuLMS.oSco!=null){var oPage=window.contenuLMS.oSco.donnePage(window.contenuLMS.oSco.numPageCourante);}if (oPage!=null){locSimple+='?sco='+window.haut.oItemCourant.identifier+'&idPg='+oPage.code+ajoutFE;} else {locSimple+='?sco='+window.haut.oItemCourant.identifier+ajoutFE;}window.open(locSimple,'_blank',optionPE+'status=no,menubar=no,toolbar=no,location=no,resizable=yes,scrollbars=auto');LMS_fermer();}function LMS_fermer(){LMS_persisteParcours();opener = self; self.close();}function donneParam(nomP){ var res=''; var params=window.location.search; if ((params!="")&&(params.indexOf('%26')>0)){params=params.replace(/%26/,'&');} var ind=params.indexOf(nomP+'='); if (ind>0){ var reste=params.substring(ind+nomP.length+1); var indexFin=reste.indexOf('&'); if (indexFin<0){indexFin=params.length;} res= reste.substring(0,indexFin); } return res;}function getDateServeur(mode){var resu='';var dateJS=new Date();var moisServeur="0";var jourServeur="0";var anneeServeur=dateJS.getYear();if (dateJS.getUTCMonth()+1<10){moisServeur = moisServeur + (dateJS.getUTCMonth()+1).toString();}else{moisServeur=dateJS.getUTCMonth()+1;}if (dateJS.getUTCDate()<10){jourServeur = jourServeur + (dateJS.getUTCDate()).toString();}else{jourServeur=dateJS.getUTCDate();} if (mode=='yyyymmjj'){ resu=anneeServeur+ "-" + moisServeur + "-" + jourServeur;} else {var heureServeur="0";var minutesServeur="0";var secondesServeur="0"; if (dateJS.getUTCHours()<10){heureServeur+=(dateJS.getUTCHours()).toString();}else {heureServeur=dateJS.getUTCHours();}if (dateJS.getMinutes()<10){minutesServeur+=(dateJS.getMinutes()).toString();}else {minutesServeur=dateJS.getMinutes();}if (dateJS.getSeconds()<10){secondesServeur+=(dateJS.getSeconds()).toString();}else{secondesServeur=dateJS.getSeconds();} resu=anneeServeur+ "-" + moisServeur + "-" + jourServeur + "T" + heureServeur + ":" + minutesServeur + ":" + secondesServeur;}return resu;}function LMS_precedentHistorique(){if (window.haut.lienBoutonRetour!=''){var tabP=window.haut.lienBoutonRetour.split(";");window.haut.NAVIG_afficheLien(tabP[0],tabP[1]);}}function LMS_allerPrecedent(){window.haut.NAVIG_allerPrecedent();}function LMS_allerSuivant(){window.haut.NAVIG_allerSuivant();}function LMS_ouvrirGlossaire(){var largeur = 10;var hauteur = 10;var position="left="+largeur+",top="+hauteur+",screenX="+largeur+",screenY="+hauteur+",";var src=RACINE_stage+"MosMtr/ressources/style/glossaire.htm?ver="+serveur.version;if ((window.contenuLMS!=null)&&(window.contenuLMS.oSco!=null)){if (window.contenuLMS.oSco.refGlo!=''){src=RACINE_stage+"../"+window.contenuLMS.oSco.refGlo+"/MosMtr/ressources/style/glossaire.htm?ver="+serveur.version;}}var taille="width=800,height=560";if (screen.width>1000){taille="width=960,height=680";}var fen=window.open(src,'Glossaire','toolbar=no,status=no,menubar=no,'+taille+','+position+'scrollbars=no,resizable=yes');fen.focus();}function valAttrDom(noeud,nAttr){var res=noeud.getAttribute(nAttr);if (res==null){res="";}return res;}function valEltDom(noeud,nElt){var res="";var leselts=noeud.getElementsByTagName(nElt);if (leselts.length>0){var oTxt=leselts.item(0).firstChild;if (oTxt!=null){res=oTxt.nodeValue;}}return res;}function chargeUnite(itemParc,oUnit){itemParc.dateEntre=valAttrDom(oUnit,'dateEntre');itemParc.dateAcces=valAttrDom(oUnit,'dateAcces');itemParc.dateValide=valAttrDom(oUnit,'dateValide');itemParc.nbAcces=valAttrDom(oUnit,'nbAcces');var oCmi=itemParc.cmi;oCmi.core.lesson_location=valAttrDom(oUnit,'lesson_location');oCmi.core.lesson_status=valAttrDom(oUnit,'lesson_status');oCmi.core.entry=valAttrDom(oUnit,'entry');oCmi.core.score.setScore("raw",valAttrDom(oUnit,'score_raw'));oCmi.core.score.setScore("max",valAttrDom(oUnit,'score_max'));oCmi.core.score.setScore("min",valAttrDom(oUnit,'score_min'));oCmi.core.setTime('total_time',valAttrDom(oUnit,'total_time'));oCmi.suspend_data=valEltDom(oUnit,"suspend_data");oCmi.student_preference.audio=valAttrDom(oUnit,'audio'); oCmi.student_preference.text=valAttrDom(oUnit,'text'); oCmi.student_preference.language=valAttrDom(oUnit,'language'); oCmi.comments=valEltDom(oUnit,"comments");var lesobjs=oUnit.getElementsByTagName("objectif");for (var n=0;n<lesobjs.length;n++){var xmlObj=lesobjs.item(n);var oObjf=oCmi.objectives.ajouteObjectif(n); oObjf.id=valAttrDom(xmlObj,"id");oObjf.status=valAttrDom(xmlObj,"status");oObjf.score.setScore("raw",valAttrDom(xmlObj,"score_raw"));oObjf.score.setScore("max",valAttrDom(xmlObj,"score_max"));oObjf.score.setScore("min",valAttrDom(xmlObj,"score_min"));}lesobjs=oUnit.getElementsByTagName("interaction");for (var n=0;n<lesobjs.length;n++){var xmlObj=lesobjs.item(n);var oObjf=oCmi.interactions.ajouteInteraction(n); oObjf.id=valAttrDom(xmlObj,"id");oObjf.type=valAttrDom(xmlObj,"type");oObjf.result=valAttrDom(xmlObj,"result");oObjf.weighting=valAttrDom(xmlObj,"weighting");oObjf.student_response=valEltDom(xmlObj,"student_response");var oInterObj=oObjf.objectives.ajouteObjectif(0);oInterObj.id=valAttrDom(xmlObj,"refObj");}}/* fonctions DOM */if (document.implementation && document.implementation.createDocument) { Node.prototype.__defineGetter__("xml", _Node_getXML); Document.prototype.readyState = "0"; Document.prototype.__load__ = Document.prototype.load; Document.prototype.load = _Document_load; Document.prototype.onreadystatechange = null; Document.prototype.parseError = 0;}function jsXML(){}jsXML.createDOMDocument = function(strNamespaceURI, strRootTagName) { var objDOM = null; if (document.implementation && document.implementation.createDocument) { objDOM = document.implementation.createDocument(strNamespaceURI, strRootTagName, null); objDOM.addEventListener("load", _Document_onload, false); } else { var bFound = false; var ARR_ACTIVEX = ["Msxml2.DOMDocument","Msxml2.DOMDocument.4.0", "Msxml.DOMDocument","Microsoft.XmlDom"]; for (var i=0; i < ARR_ACTIVEX.length && !bFound; i++) { try { objDOM= new ActiveXObject(ARR_ACTIVEX[i]); bFound = true; if (strRootTagName) { objDOM.loadXML("<" + strRootTagName + "/>"); } } catch (objException) {} } } return objDOM;};function _Node_getXML() { var objXMLSerializer = new XMLSerializer; var strXML = objXMLSerializer.serializeToString(this); return strXML;}function _Document_load(strURL) { this.parseError = 0; changeReadyState(this, 1); try { this.__load__(strURL); } catch (objException) { this.parseError = -9999999; changeReadyState(this, 4); }}function _Document_onload() { handleOnLoad(this);}function handleOnLoad(objDOMDocument) { if (!objDOMDocument.documentElement || objDOMDocument.documentElement.tagName == "parsererror"){ objDOMDocument.parseError = -9999999;} changeReadyState(objDOMDocument, 4);}function changeReadyState(objDOMDocument, iReadyState) { objDOMDocument.readyState = iReadyState; if (objDOMDocument.onreadystatechange != null && (typeof(objDOMDocument.onreadystatechange)=="function")) objDOMDocument.onreadystatechange();}/* Classe Lexique */function ICLexique() { this.lexs; this.init = LEXO_init; this.ajLex = LEX_ajouterLex;}function LEXO_init(){this.lexs=new Array();}function LEX_ajouterLex(id,lex){this.lexs[id]=lex;}

