
function showLesson(_courseDiv,_courseDivother,idlesson){
    document.getElementById(_courseDiv).style.display = "block";
	 document.getElementById(_courseDivother).style.display = "none";
	if (idlesson != "")
	{
        var thedata = "";
        thedata = "lesson=" + idlesson;
		thedata =thedata + "&div_name=" + _courseDiv;
        postDataValue("sscripts/getlesson.php", document.getElementById(_courseDiv), thedata);
    } 
      else 
        document.getElementById(_courseDiv).innerHTML = MLJS("txtleconindispo");
    return;
}
function showListing(_courseDiv,_courseDivother,idlisting){
    document.getElementById(_courseDiv).style.display = "block";
	 document.getElementById(_courseDivother).style.display = "none";
	if (idlisting != "")
	{
        var thedata = "";
        thedata = "listing=" + idlisting;
		thedata =thedata + "&div_name=" + _courseDiv;
        postDataValue("sscripts/getlisting.php", document.getElementById(_courseDiv), thedata);
    } 
      else 
        document.getElementById(_courseDiv).innerHTML = MLJS("txtleconindispo");
    return;
}

function loadLessonInfo(lessonid,webuserid){
	var data = "lessonid="+lessonid+"&webuserid="+webuserid;
	getDataValueJSON("sscripts/getlessoninfo.php",data,repLoadLessonInfo);
	
}

function repLoadLessonInfo(xmlRep){

	xmlRep = json(xmlRep);
	var res = "";
	var nomlevel = g1J(xmlRep, "nomlevel");
	var nomtopic = g1J(xmlRep, "nomtopic");
	var nomlang = g1J(xmlRep, "nomlang");
	var description = g1J(xmlRep, "description");
	var horlyrate = g1J(xmlRep, "horlyrate");
	var label_currency = g1J(xmlRep, "label_currency");
	var newhorlyrate = g1J(xmlRep, "newhorlyrate");
	var currencyid = g1J(xmlRep, "currencyid");
	var newcurrencyid = g1J(xmlRep, "newcurrencyid");
	var nickname = g1J(xmlRep, "nickname");
	var teacherid = g1J(xmlRep, "teacherid");
	var nbstudent = g1J(xmlRep, "nbstudent");
	var planification = g1J(xmlRep, "planification");
	var leng = g1J(xmlRep, "length");
	var listingid = g1J(xmlRep, "listingid");
	res += addLessionInfo(nomlevel, nomtopic, nomlang, description, horlyrate, label_currency, newhorlyrate, currencyid, newcurrencyid, nickname, teacherid, nbstudent, planification, leng);
	var CourseDiv = document.getElementById('Course_Div');
	if (parseInt(listingid) != '0') {

		if ((newhorlyrate != horlyrate) || (newcurrencyid != currencyid)) {
			var txtprixdifferent = document.getElementById('txtprixdifferent');
			txtprixdifferent.style.display = "block";
		}
	}
	CourseDiv.style.display="block";
//	CourseDiv.innerHTML = res;
	createFrmPopup(1,"",res,"","","alertPanel");
}
function addLessionInfo(nomlevel,nomtopic,nomlang,description,horlyrate,label_currency,newhorlyrate,currencyid,newcurrencyid,nickname,teacherid,nbstudent,planification,leng){
	var templateCouseInfoDiv = document.getElementById('templateCouseInfoDiv').innerHTML;
	var templateCouseInfoCopieDiv = "templateCouseInfoCopieDiv";

	templateCouseInfoDiv = repS(templateCouseInfoDiv,"txtprixdifferent","txtprixdifferent");			
		
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"NomLevelCourseInfo",nomlevel);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"NomTopic",nomtopic);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"NomLangCourseInfo",nomlang);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"DescriptionCourseInfo",description);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"HorlyrateCourseInfo",newhorlyrate);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"Label_currencyCourseInfo",label_currency);	
	
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"SchedCourseInfo",planification);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"LengthCourseInfo",leng);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"UserUrlCourseInfo","ficheuser.php?nickname="+nickname);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"NicknameCourseInfo",nickname);
	templateCouseInfoDiv = repS(templateCouseInfoDiv,"NbstudentsCourseInfo",nbstudent);

	return templateCouseInfoDiv;
	
}
