//  ------------------------------------------------------------------------------------------------------------------------------------
//  Set HTML Menu Bar
//  ------------------------------------------------------------------------------------------------------------------------------------

function imenus_data0(){

	this.enable_visual_design_mode = false
	this.main_is_horizontal = true
	this.menu_showhide_delay = 0

	this.main_expand_image = ""
	this.main_expand_image_hover = ""
	this.main_expand_image_width = ""
	this.main_expand_image_height = ""

	this.sub_expand_image = "images/templates/banner/educator/arrow_sub.gif"
	this.sub_expand_image_hover = "images/templates/banner/educator/arrow_sub.gif"
	this.sub_expand_image_width = "10"
	this.sub_expand_image_height = "13"

	//Main Menu

	this.main_container_styles = "background-color:; background-image:url('images/templates/banner/educator/tab_top.png'); border-style:solid; border-color:#769bba; border-width:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; "
	this.main_item_styles = "background-color:; background-image:; color:#333333; text-align:left; font-family:Verdana; font-size:10px; font-weight:bold; text-decoration:none; padding-top:9px; padding-right:5px; padding-bottom:10px; padding-left:15px; border-style:none; border-color:#000000; border-width:0px; "
	this.main_item_hover_styles = "background-color:; background-image:; color:#999333; font-weight:; text-decoration:; "
	this.main_item_active_styles = "background-color:; background-image:; color:#111111; font-weight:; text-decoration:; "

	//Sub Menu

	this.subs_container_styles = "background-color:transparent; background-image:; border-style:none; border-color:#356595; border-width:0px; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; "
	this.subs_item_styles = "background-color:; background-image:; color:#111111; text-align:center; font-family:verdana; font-size:9px; font-weight:bold; text-decoration:none; padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:8px; border-style:none; border-color:#000000; border-width:1px; "
	this.subs_item_hover_styles = "background-color:; background-image:; color:#999333; font-weight:; text-decoration:; "
	this.subs_item_active_styles = "background-color:; background-image:; color:#111111; font-weight:; text-decoration:; "

}

//  ------------------------------------------------------------------------------------------------------------------------------------
//  Set Navigation Menu Bar
//  ------------------------------------------------------------------------------------------------------------------------------------

function mmLoadMenus() 
{
  if (window.mm_menu_0318154434_0) return;
  	window.mm_menu_0318154434_0 = new Menu("root",110,18,"SF New Republic",11,"#OOOODD","#000000","#FEFF99","#CCCC66","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  	mm_menu_0318154434_0.addMenuItem(":. Question&nbsp;BCA","location='QuestionForm.*?qType=BCA'");
  	mm_menu_0318154434_0.addMenuItem(":. Question&nbsp;PBQ","location='QuestionForm.*?qType=PBQ'");
  	mm_menu_0318154434_0.addMenuItem(":. Question&nbsp;TNF","location='QuestionForm.*?qType=TNF'");
	mm_menu_0318154434_0.addMenuItem(":. Assessment","location='ExamDetailForm.*'");
   	mm_menu_0318154434_0.hideOnMouseOut=true;
   	mm_menu_0318154434_0.bgColor='#555555';
   	mm_menu_0318154434_0.fontWeight='bold';
   	mm_menu_0318154434_0.menuBorder=1;
   	mm_menu_0318154434_0.menuLiteBgColor='#FFFFFF';
   	mm_menu_0318154434_0.menuBorderBgColor='#777777';
	
  if (window.mm_menu_0318154625_0) return;
  	window.mm_menu_0318154625_0 = new Menu("root",110,18,"SF New Republic",11,"#OOOODD","#000000","#FEFF99","#CCCC66","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  	mm_menu_0318154625_0.addMenuItem(":. Question","location='QuestionSearch.*?action=SearchQuestion&openResult=No&questionFormatID=0'");
  	mm_menu_0318154625_0.addMenuItem(":. Assessment", "location='ExamSearch.*?action=SearchExam&openResult=No'");
   	mm_menu_0318154625_0.hideOnMouseOut=true;
   	mm_menu_0318154625_0.bgColor='#555555';
   	mm_menu_0318154625_0.fontWeight='bold';
   	mm_menu_0318154625_0.menuBorder=1;
   	mm_menu_0318154625_0.menuLiteBgColor='#FFFFFF';
   	mm_menu_0318154625_0.menuBorderBgColor='#777777';

  if (window.mm_menu_0318160155_0) return;
  	window.mm_menu_0318160155_0 = new Menu("root",110,18,"SF New Republic",11,"#OOOODD","#000000","#FEFF99","#CCCC66","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  	mm_menu_0318160155_0.addMenuItem(":. My&nbsp;Question","location='QuestionSearch.*?action=MyFolder&openResult=No&questionFormatID=0'");
  	mm_menu_0318160155_0.addMenuItem(":. My&nbsp;Assessment","location='ExamSearch.*?action=MyFolder&openResult=No'");
   	mm_menu_0318160155_0.hideOnMouseOut=true;
   	mm_menu_0318160155_0.bgColor='#555555';
   	mm_menu_0318160155_0.fontWeight='bold';
   	mm_menu_0318160155_0.menuBorder=1;
   	mm_menu_0318160155_0.menuLiteBgColor='#FFFFFF';
   	mm_menu_0318160155_0.menuBorderBgColor='#777777';
	mm_menu_0318160155_0.writeMenus();
} 

//  ------------------------------------------------------------------------------------------------------------------------------------
// Swap Image 
//  ------------------------------------------------------------------------------------------------------------------------------------

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Show / Hide Layer
//  ------------------------------------------------------------------------------------------------------------------------------------

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Drag n Drop Layer
//  ------------------------------------------------------------------------------------------------------------------------------------

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
  var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
  var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
  retVal = true; if(IE && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = MM_findObj(objName); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
      } else {
        if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div"); 
          for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
        for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i]; 
    } }
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
    curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
    curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft; 
    if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
    curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop; 
    if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  } else {
    var theEvent = ((NS)?objName.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (NS6) { parentLayer = aLayer.parentNode;
            while (parentLayer != null && parentLayer.style.position) {             
              parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
              parentLayer = parentLayer.parentNode;
          } } else if (IE) { parentLayer = aLayer.parentElement;       
            while (parentLayer != null && parentLayer.style.position) {
              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
          var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
          if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
        curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
        curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
        if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS4&&!NS6) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS4) {left = newLeft; top = newTop;}
        else if (NS6){style.left = newLeft; style.top = newTop;}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
             Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
          if (NS4) {left = MM_targL; top = MM_targT;}
          else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objName);
  } return retVal;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Open Special Character Window 
//  ------------------------------------------------------------------------------------------------------------------------------------

function MM_openBrWindow(theURL,winName,features) 
{ 
  window.open(theURL,winName,features);
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Question - Create/Upload Question
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateFormCreate(formName) 
{	
	var qType = formName.qType.value;
	
	if (formName.qTopicID.value == "0") {
		alert("Tolong pilih Topik !");
		formName.qTopicID.focus();
		return false;
	}

	if (qType == "BCA" || qType == "TNF")  
	{
		if (formName.qQuestion.value == "" && formName.qQuestionDir.value == "") {
			alert("Tolong masukkan Soalan !");
			formName.qQuestion.focus();
			return false;
		}
	}
	
	if (formName.qStatus.value == "Submitted") 
	{
		if (formName.qMark.value == "") {
			alert("Tolong masukkan Markah !");
			formName.qMark.focus();
			return false;
		}

		if (formName.qMark.value == 0) {
			alert("Data salah! 0 tidak diterima!");
			formName.qMark.focus();
			return false;
		}

		var valueQMark = "yes";
		valueQMark = validateInteger(formName, 'qMark');
		
		if (valueQMark == "no")	{
			alert("Data salah! Hanya nombor sahaja diterima!");
			formName.qMark.focus();
			return false;
		}

		if (qType == "BCA") 
		{
			if (formName.qAnswerA.value == "" && formName.qAnswerADir.value == "") {
				alert("Tolong masukkan jawapan untuk A");
				formName.qAnswerA.focus();
				return false;
			}
			
			if (formName.qAnswerB.value == "" && formName.qAnswerBDir.value == "") {
				alert("Tolong masukkan jawapan untuk B");
				formName.qAnswerB.focus();
				return false;
			}
		
			if (formName.qAnswerC.value == "" && formName.qAnswerCDir.value == "") {
				alert("Tolong masukkan jawapan untuk C");
				formName.qAnswerC.focus();
				return false;
			}
		
			if (formName.qAnswerD.value == "" && formName.qAnswerDDir.value == "") {
				alert("Tolong masukkan jawapan untuk D");
				formName.qAnswerD.focus();
				return false;
			}
			
			var valueQAnswer;
			for (var i = 0; i < formName.qAnswer.length; i++) 
			{
				if (formName.qAnswer[i].checked) {
					valueQAnswer = formName.qAnswer[i].value;
					break;
			   }
			}
			
			if ((valueQAnswer != "A") && (valueQAnswer != "B" ) && (valueQAnswer != "C" ) && (valueQAnswer != "D" ) && (valueQAnswer != "E" )) {
				alert("Tolong pilih jawapan yang benar");
				return false;		
			}
		} 
				
		var agree = confirm("Anda pasti untuk menyimpan soalan ini secara kekal?")
		if (agree)
			return true ;
		else
			return false ;
	}
	
	return true;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Question - Update Question
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateFormEdit(formName) 
{	
	var qType = formName.qType.value;
	
	if (formName.qEducationLevelID.value == "0") {
		alert("Please choose the Education Level !");
		formName.qEducationLevelID.focus();
		return false;
	}

	if (formName.qSubjectID.value == "0") {
		alert("Please choose the Subject !");
		formName.qSubjectID.focus();
		return false;
	}

	if (formName.qChapterID.value == "0") {
		alert("Please choose the Chapter !");
		formName.qChapterID.focus();
		return false;
	}

	if (formName.qUnitID.value == "0") {
		alert("Please choose the Unit !");
		formName.qUnitID.focus();
		return false;
	}

	if (qType == "BCA") 
	{
		if (formName.qQuestion.value == "" && (formName.qQuestionDir.value == "" && formName.currentQuestionDir.value == "")) {
			alert("Please enter the question !");
			formName.qQuestion.focus();
			return false;
		}
		
		if (formName.qQuestion.value == "" && (formName.qQuestionDir.value == "" && formName.removeQuestionDir.checked )) {
			alert("Please enter the Question ! \nYou are removing the picture but Question is blank!");
			formName.qQuestion.focus();
			return false;
		}
		
		if (formName.currentQuestionDir.value != "") {
			if (formName.removeQuestionDir.checked && formName.qQuestionDir.value != "" ) {
				alert("Please choose either to update or remove the image for question. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qQuestionDir.focus();
				return false;
			}
		}

		if (formName.currentAnswerADir.value != "") {
			if (formName.removeAnswerADir.checked && formName.qAnswerADir.value != "" ) {
				alert("Please choose either to update or remove the image for Answer A. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qAnswerADir.focus();
				return false;
			}
		}
		
		if (formName.currentAnswerBDir.value != "") {
			if (formName.removeAnswerBDir.checked && formName.qAnswerBDir.value != "" ) {
				alert("Please choose either to update or remove the image for Answer B. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qAnswerBDir.focus();
				return false;
			}
		}
	
		if (formName.currentAnswerCDir.value != "") {
			if (formName.removeAnswerCDir.checked && formName.qAnswerCDir.value != "") {
				alert("Please choose either to update or remove the image for Answer C. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qAnswerCDir.focus();
				return false;
			}
		}
		
		if (formName.currentAnswerDDir.value != "") {
			if (formName.removeAnswerDDir.checked && formName.qAnswerDDir.value != "" ) {
				alert("Please choose either to update or remove the image for Answer D. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qAnswerDDir.focus();
				return false;
			}
		}
	}
	
	if (qType == "PBQ") 
	{
		if (formName.qQuestion.value == "") {
			alert("Please enter the question !");
			formName.qQuestion.focus();
			return false;
		}
		
		if (formName.qQuestionDir.value == "" && formName.currentQuestionDir.value == "") { 
			alert("Please browse for picture !");
			formName.qQuestionDir.focus();
			return false;
		}

		if (formName.qAnswerA.value == "" && formName.qAnswerB.value != "" ) {
			alert("Please enter the Answer c");
			formName.qAnswerA.focus();
			return false;
		}

		if (formName.qAnswerB.value == "" && formName.qAnswerC.value != "" ) {
			alert("Please enter the Answer for B");
			formName.qAnswerB.focus();
			return false;
		}

		if (formName.qAnswerC.value == "" && formName.qAnswerD.value != "" ) {
			alert("Please enter the Answer for C");
			formName.qAnswerC.focus();
			return false;
		}

		if (formName.qAnswerD.value == "" && formName.qAnswerE.value != "" ) {
			alert("Please enter the Answer for D");
			formName.qAnswerD.focus();
			return false;
		}
	
		if (formName.qAnswerE.value == "" && formName.qAnswerF.value != "" ) {
			alert("Please enter the Answer for E");
			formName.qAnswerE.focus();
			return false;
		}
	
		if (formName.qAnswerF.value == "" && formName.qAnswerG.value != "" ) {
			alert("Please enter the Answer for F");
			formName.qAnswerF.focus();
			return false;
		}
	
		if (formName.qAnswerG.value == "" && formName.qAnswerH.value != "" ) {
			alert("Please enter the Answer for G");
			formName.qAnswerG.focus();
			return false;
		}
	
		if (formName.qAnswerH.value == "" && formName.qAnswerI.value != "" ) {
			alert("Please enter the Answer for H");
			formName.qAnswerH.focus();
			return false;
		}
	
		if (formName.qAnswerI.value == "" && formName.qAnswerJ.value != "" ) {
			alert("Please enter the Answer for I");
			formName.qAnswerI.focus();
			return false;
		}
	}
	
	if (qType == "TNF") 
	{
		if (formName.qQuestion.value == "" && (formName.qQuestionDir.value == "" && formName.currentQuestionDir.value == "")) {
			alert("Please enter the question !");
			formName.qQuestion.focus();
			return false;
		}
		
		if (formName.qQuestion.value == "" && (formName.qQuestionDir.value == "" && formName.removeQuestionDir.checked )) {
			alert("Please enter the Question ! \nYou are removing the picture but Question is blank!");
			formName.qQuestion.focus();
			return false;
		}
		
		if (formName.currentQuestionDir.value != "") {
			if (formName.removeQuestionDir.checked && formName.qQuestionDir.value != "" ) {
				alert("Please choose either to update or remove the image for question. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qQuestionDir.focus();
				return false;
			}
		}

		if (formName.currentStatementADir.value != "") {
			if (formName.removeStatementADir.checked && formName.qStatementADir.value != "" ) {
				alert("Please choose either to update or remove the image for Statement A. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qStatementADir.focus();
				return false;
			}
		}
		
		if (formName.currentStatementBDir.value != "") {
			if (formName.removeStatementBDir.checked && formName.qStatementBDir.value != "" ) {
				alert("Please choose either to update or remove the image for Statement B. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qStatementBDir.focus();
				return false;
			}
		}
	
		if (formName.currentStatementCDir.value != "") {
			if (formName.removeStatementCDir.checked && formName.qStatementCDir.value != "") {
				alert("Please choose either to update or remove the image for Statement C. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qStatementCDir.focus();
				return false;
			}
		}
		
		if (formName.currentStatementDDir.value != "") {
			if (formName.removeStatementDDir.checked && formName.qStatementDDir.value != "" ) {
				alert("Please choose either to update or remove the image for Statement D. \nIf you want to only update just select the image file without checking the \'Remove picture\' checkbox.");
				formName.qStatementDDir.focus();
				return false;
			}
		}
	}

	if (formName.qStatus.value == "Submitted") 
	{
		if (formName.qMark.value == "") {
			alert("Please enter the Mark !");
			formName.qMark.focus();
			return false;
		}

		if (formName.qMark.value == 0) {
			alert("Invalid Entry! 0 not allowed!");
			formName.qMark.focus();
			return false;
		}

		var valueQMark = "yes";
		valueQMark = validateInteger(formName, 'qMark');
		
		if (valueQMark == "no") {
			alert("Invalid entry! Only numbers are accepted!");
			formName.qMark.focus();
			return false;
		}
		
		if (qType == "BCA") 
		{
			if (formName.qAnswerA.value == "" && (formName.qAnswerADir.value == "" && formName.currentAnswerADir.value == "")) {
				alert("Please enter the Answer for A");
				formName.qAnswerA.focus();
				return false;
			}
			
			if (formName.qAnswerA.value == "" && (formName.qAnswerADir.value == "" && formName.removeAnswerADir.checked)) {
				alert("Please enter the Answer for A ! \nYou are removing the picture but answer A is blank!");
				formName.qAnswerA.focus();
				return false;
			}
	
			if ((formName.qAnswerB.value == "") && (formName.qAnswerBDir.value == "" && formName.currentAnswerBDir.value == "")) {
				alert("Please enter the Answer for B");
				formName.qAnswerB.focus();
				return false;
			}
	
			if (formName.qAnswerB.value == "" && (formName.qAnswerBDir.value == "" && formName.removeAnswerBDir.checked)) {
				alert("Please enter the Answer for B ! \nYou are removing the picture but answer B is blank!");
				formName.qAnswerB.focus();
				return false;
			}
	
			if ((formName.qAnswerC.value == "") && (formName.qAnswerCDir.value == "" && formName.currentAnswerCDir.value == "")) {
				alert("Please enter the Answer for C");
				formName.qAnswerC.focus();
				return false;
			}
	
			if (formName.qAnswerC.value == "" && (formName.qAnswerCDir.value == "" && formName.removeAnswerCDir.checked)) {
				alert("Please enter the Answer for C ! \nYou are removing the picture but answer C is blank!");
				formName.qAnswerC.focus();
				return false;
			}
	
			if ((formName.qAnswerD.value == "") && (formName.qAnswerDDir.value == "" && formName.currentAnswerDDir.value == "")) {
				alert("Please enter the Answer for D");
				formName.qAnswerD.focus();
				return false;
			}
			
			if (formName.qAnswerD.value == "" && (formName.qAnswerDDir.value == "" && formName.removeAnswerDDir.checked)) {
				alert("Please enter the Answer for D ! \nYou are removing the picture but answer D is blank!");
				formName.qAnswerD.focus();
				return false;
			}
			
			var valueQAnswer;
			for (var i = 0; i < formName.qAnswer.length; i++) 
			{
				if (formName.qAnswer[i].checked) {
					valueQAnswer = formName.qAnswer[i].value;
					break;
			   }
			}
			
			if ((valueQAnswer != "A") && (valueQAnswer != "B" ) && (valueQAnswer != "C" ) && (valueQAnswer != "D" ) && (valueQAnswer != "E" )) {
				alert("Please choose the True Answer");
				return false;		
			}
		}
		
		if (qType == "PBQ") 
		{
			if (formName.qAnswerA.value == "") {
				alert("Please enter the Answer for A");
				formName.qAnswerA.focus();
				return false;
			}
	
			if (formName.qAnswerB.value == "") {
				alert("Please enter the Answer for B");
				formName.qAnswerB.focus();
				return false;
			}
	
			if (formName.qAnswerC.value == "") {
				alert("Please enter the Answer for C");
				formName.qAnswerC.focus();
				return false;
			}
		}
		
		if (qType == "TNF") 
		{
		// statement A
			if (formName.qStatementA.value == "" && (formName.qStatementADir.value == "" && formName.currentStatementADir.value == "")) {
				alert("Please enter the Statement for A");
				formName.qStatementA.focus();
				return false;
			}
			
			if (formName.qStatementA.value == "" && (formName.qStatementADir.value == "" && formName.removeStatementADir.checked)) {
				alert("Please enter the Statement for A ! \nYou are removing the picture but Statement A is blank!");
				formName.qStatementA.focus();
				return false;
			}
			
			var valueQAnswerA;
			for (var i = 0; i < formName.qAnswerA.length; i++) 
			{
				if (formName.qAnswerA[i].checked) {
					valueQAnswerA = formName.qAnswerA[i].value;
					break;
			   }
			}
			
			if ((valueQAnswerA != "T") && (valueQAnswerA != "F")) {
				alert("Please choose the response of Statement A");
				return false;		
			}
	
		// statement B
			if ((formName.qStatementB.value == "") && (formName.qStatementBDir.value == "" && formName.currentStatementBDir.value == "")) {
				alert("Please enter the Statement for B");
				formName.qStatementB.focus();
				return false;
			}
	
			if (formName.qStatementB.value == "" && (formName.qStatementBDir.value == "" && formName.removeStatementBDir.checked)) {
				alert("Please enter the Statement for B ! \nYou are removing the picture but Statement B is blank!");
				formName.qStatementB.focus();
				return false;
			}
	
			var valueQAnswerB;
			for (var i = 0; i < formName.qAnswerB.length; i++) 
			{
				if (formName.qAnswerB[i].checked) {
					valueQAnswerB = formName.qAnswerB[i].value;
					break;
			   }
			}
			
			if ((valueQAnswerB != "T") && (valueQAnswerB != "F")) {
				alert("Please choose the response of Statement B");
				return false;		
			}

		// statement C
			if ((formName.qStatementC.value == "") && (formName.qStatementCDir.value == "" && formName.currentStatementCDir.value == "")) {
				alert("Please enter the Statement for C");
				formName.qStatementC.focus();
				return false;
			}
	
			if (formName.qStatementC.value == "" && (formName.qStatementCDir.value == "" && formName.removeStatementCDir.checked)) {
				alert("Please enter the Statement for C ! \nYou are removing the picture but Statement C is blank!");
				formName.qStatementC.focus();
				return false;
			}
	
			var valueQAnswerC;
			for (var i = 0; i < formName.qAnswerC.length; i++) 
			{
				if (formName.qAnswerC[i].checked) {
					valueQAnswerC = formName.qAnswerC[i].value;
					break;
			   }
			}
			
			if ((valueQAnswerC != "T") && (valueQAnswerC != "F")) {
				alert("Please choose the response of Statement C");
				return false;		
			}
	
		// statement D
			if ((formName.qStatementD.value == "") && (formName.qStatementDDir.value == "" && formName.currentStatementDDir.value == "")) {
				alert("Please enter the Statement for D");
				formName.qStatementD.focus();
				return false;
			}
			
			if (formName.qStatementD.value == "" && (formName.qStatementDDir.value == "" && formName.removeStatementDDir.checked)) {
				alert("Please enter the Statement for D ! \nYou are removing the picture but Statement D is blank!");
				formName.qStatementD.focus();
				return false;
			}
			
			var valueQAnswerD;
			for (var i = 0; i < formName.qAnswerD.length; i++) 
			{
				if (formName.qAnswerD[i].checked) {
					valueQAnswerD = formName.qAnswerD[i].value;
					break;
			   }
			}
			
			if ((valueQAnswerD != "T") && (valueQAnswerD != "F")) {
				alert("Please choose the response of Statement D");
				return false;		
			}
		}
		
		var agree = confirm("Are you ready to submit this question?")
		if (agree)
			return true ;
		else
			return false ;
	}

	return true;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Exam - Create/Upload Exam Details
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateFormExamDetail(formName)
{
	if (formName.eTitle.value == "") {
		alert("Tolong masukkan Tajuk !");
		formName.eTitle.focus();
		return false;
	}

	if (formName.eTopicID.value == "0") {
		alert("Tolong pilih Topik !");
		formName.eTopicID.focus();
		return false;
	}
		
	// temporary open, used if TST/QZS/EXM :optional for timer/date set
	if (formName.eDateSet.value == "None" || formName.eDateSet.value == "") 
	{
		if (formName.hourTime.value != "" || formName.minTime.value != "")
		{
		alert("Set Tarikh sebelum set Masa !");
		formName.eDateSet.focus();
		return false;
		}
	}
		
	if (formName.eDurationSet.value != "") 
	{
		if (formName.eDurationSet.value == "0") {
			alert("Data salah! 0 tidak dibenarkan !");
			formName.eDurationSet.focus();
			return false;
		}
		
		var valueDuration = "yes";
		valueDuration = validateInteger(formName, 'eDurationSet');
		if (valueDuration == "no") 
		{
			alert("Data salah! Hanya nombor sahaja diterima!");
			formName.eDurationSet.focus();
			return false;
		}
	}
	
	var agree = confirm("Anda pasti untuk teruskan?");
	if (agree)
		return true ;
	else
		return false ;

	return true;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Exam - Create/Upload Exam
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateFormExam(formName, eType)
{
	var minTotal = 5;
	var maxTotal = 100;

	var totalQuestion = formName.totalQuestion.value;
	var status = formName.eStatus.value;
		
	if (status == "Submitted")
	{
		for (var i=1; i <= totalQuestion; i++) 
		{
			var qID = "qID"+i;
			
			if (formName.elements[qID].value == "" || formName.elements[qID].value == " ") {
				alert("Soalan No "+i+" kosong. Sila hapuskan atau masukkan soalan.");
				return false;
			}
		}
		
		if (totalQuestion < minTotal){
			alert("Jumlah minima soalan ialah "+minTotal+". Sila tambah lagi soalan.");
			return false;
		}
		
	}
	var note;
	if (status == "Simpan Sementara")	{
		note = "Anda pasti untuk menyimpan sementara latih ini? SIMPAN SEMENTARA membenarkan anda untuk ubah sebelum SIMPAN KEKAL ke dalam sistem.";
	} 
	else if (status == "Simpan Kekal") {
		note = "Anda pasti untuk menyimpan kekal latihan ini? SIMPAN KEKAL membenarkan pelajar untuk menjawabnya.";
	}
	
	var agree = confirm(note)
	if (agree)
		return true ;
	else
		return false ;

	return true;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Set Status Submission : Save / Submit 
//  ------------------------------------------------------------------------------------------------------------------------------------

function setStatus(formName, fieldInput, statusInput) 
{
	formName.elements[fieldInput].value = statusInput;
	
	return statusInput;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Integer Field
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateInteger(formName, integerInput) 
{
	var validInteger = "0123456789";
	var acceptInteger = "yes";
	var input;
	var total;
		
	for (var i=0; i<formName.elements[integerInput].value.length; i++) 
	{
		input = "" + formName.elements[integerInput].value.substring(i, i+1);
		if (validInteger.indexOf(input) == "-1") 
			acceptInteger = "no";
	}
	return acceptInteger;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Word Counter
//  ------------------------------------------------------------------------------------------------------------------------------------

function textCounter(field, countField, maxLimit) 
{
	if (field.value.length > maxLimit) // if too long...trim it!
	{
		field.value = field.value.substring(0, maxLimit);
		alert('Text can only be ' +maxLimit+ ' characters in length.'); 
	}
	else 
		countField.value = maxLimit - field.value.length;
}

function textCounter2(field, countField, maxLimit) 
{
	if (field.value.length > maxLimit) // if too long...trim it!
	{
		field.value = field.value.substring(0, maxLimit);
		alert('Text can only be ' +maxLimit+ ' characters in length.'); 
	}
	else 
		countField.value = maxLimit - field.value.length;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Search - Question : formInput (1) Question (2) Exam / Attempt
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateFormSearch(formName, formInput)
{
	if (formInput == "1") 
	{		
		if (formName.qEducationLevelID.value == "0") {
			alert("Please choose the Education Level !");
			formName.qEducationLevelID.focus();
			return false;
		}
		
		if (formName.qSubjectID.value == "0") {
			alert("Please choose the Subject !");
			formName.qSubjectID.focus();
			return false;
		}
	
		/*if (formName.qChapterID.value == "0") {
			alert("Please choose the Chapter !");
			formName.qChapterID.focus();
			return false;
		}*/
	
		/*if (formName.qUnitID.value == "0") {
			alert("Please choose the Unit !");
			formName.qUnitID.focus();
			return false;
		}*/
	}
	else if (formInput == "2") 
	{
		
		if (formName.eEducationLevelID.value == "0") {
			alert("Please choose the Education Level !");
			formName.eEducationLevelID.focus();
			return false;
		}
		
		if (formName.eSubjectID.value == "0") {
			alert("Please choose the Subject !");
			formName.eSubjectID.focus();
			return false;
		}
	}
	return true;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Delete Confirmation
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateDelete() 
{
	var agree = confirm("Anda pasti untuk hapus?");
	if (agree)
		return true ;
	else
		return false ;
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Form Alert Message
//  ------------------------------------------------------------------------------------------------------------------------------------

function validationForm(formName, fieldRequired, fieldDescription){
	var alertMessage = "Please complete the following fields:\n";
	
	var message = alertMessage.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMessage += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null || obj.value == "None"){
					alertMessage += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}
	
	if (alertMessage.length == message){
		return true;
	}else{
		alert(alertMessage);
		return false;
	}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Set Education Level : Education Type Choosen Action : formInput (1) Question (2) Exam (3) Attempt
//  ------------------------------------------------------------------------------------------------------------------------------------
	
function educationTypeChoosen(formName, formInput, levelID, levelName)
{            
	var n=1;
	var intCount = 0;
	
	if (formInput == "1") // Question
	{
		var educationTypeChoosen = formName.qEducationTypeID.options[formName.qEducationTypeID.selectedIndex].value;
		
		intCount = levelID.length;
		formName.qEducationLevelID.style.visibility = 'visible';
		formName.qEducationLevelID.options.length = 1;
		formName.qSubjectID.options.length = 1;
		formName.qChapterID.options.length = 1;
		formName.qUnitID.options.length = 1;		
		
		for (var i = 0; i < intCount; i++){
			if (levelID[i].substring(0,3) == educationTypeChoosen.substring(0,3)) {
				formName.qEducationLevelID[n++] = new Option(levelName[i], levelID[i]);
			}
		}
	}
	else if (formInput == "2") // Exam
	{
		var educationTypeChoosen = formName.eEducationTypeID.options[formName.eEducationTypeID.selectedIndex].value;
		
		intCount = levelID.length;
		formName.eEducationLevelID.style.visibility = 'visible';
		formName.eEducationLevelID.options.length = 1;
		formName.eSubjectID.options.length = 1;
		formName.eChapterID.options.length = 1;
		formName.eUnitID.options.length = 1;

		for (var i = 0; i < intCount; i++){
			if (levelID[i].substring(0,3) == educationTypeChoosen.substring(0,3)) {
				formName.eEducationLevelID[n++] = new Option(levelName[i], levelID[i]);
			}
		}
	}
	else if (formInput == "3") // Attempt
	{
		var educationTypeChoosen = formName.eEducationTypeID.options[formName.eEducationTypeID.selectedIndex].value;
		
		intCount = levelID.length;
		formName.eEducationLevelID.style.visibility = 'visible';
		formName.eEducationLevelID.options.length = 1;
		formName.eSubjectID.options.length = 1;

		for (var i = 0; i < intCount; i++){
			if (levelID[i].substring(0,3) == educationTypeChoosen.substring(0,3)) {
				formName.eEducationLevelID[n++] = new Option(levelName[i], levelID[i]);
			}
		}
	}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Set Subject : Education Level Choosen Action : formInput (1) Question (2) Exam (3) Attempt
//  ------------------------------------------------------------------------------------------------------------------------------------

function educationLevelChoosen(formName, formInput, subjectID, subjectName)
{            
	var n=1;
	var intCount = 0;
	
	if (formInput == "1") // Question
	{
		var educationLevelChoosen = formName.qEducationLevelID.options[formName.qEducationLevelID.selectedIndex].value;
		
		intCount = subjectID.length;
		formName.qSubjectID.options.length = 1;
		formName.qChapterID.options.length = 1;
		formName.qUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if (subjectID[i].substring(4,6) == educationLevelChoosen.substring(3,5)) {
				formName.qSubjectID[n++] = new Option(subjectName[i], subjectID[i]);
			}
		}
	}
	else if (formInput == "2") // Exam
	{
		var educationLevelChoosen = formName.eEducationLevelID.options[formName.eEducationLevelID.selectedIndex].value;
		
		intCount = subjectID.length;
		formName.eSubjectID.options.length = 1;
		formName.eChapterID.options.length = 1;
		formName.eUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if (subjectID[i].substring(4,6) == educationLevelChoosen.substring(3,5)) {
				formName.eSubjectID[n++] = new Option(subjectName[i], subjectID[i]);
			}
		}
	}
	else if (formInput == "3") // Attempt
	{
		var educationLevelChoosen = formName.eEducationLevelID.options[formName.eEducationLevelID.selectedIndex].value;
		
		intCount = subjectID.length;
		formName.eSubjectID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if (subjectID[i].substring(4,6) == educationLevelChoosen.substring(3,5)) {
				formName.eSubjectID[n++] = new Option(subjectName[i], subjectID[i]);
			}
		}
	}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Set Chapter : Subject Choosen Action : formInput (1) Question (2) Exam
//  ------------------------------------------------------------------------------------------------------------------------------------

function subjectChoosen(formName, formInput, chapterID, chapterName)
{            
	var n=1;
	var intCount = 0;
	
	if (formInput == "1") // Question
	{
		var levelChoosen = formName.qEducationLevelID.options[formName.qEducationLevelID.selectedIndex].value;
		var subjectChoosen = formName.qSubjectID.options[formName.qSubjectID.selectedIndex].value;
		
		intCount = chapterID.length;
		formName.qChapterID.options.length = 1;
		formName.qUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if ((chapterID[i].substring(1,3) == subjectChoosen.substring(6,8)) && (chapterID[i].substring(3,8) == levelChoosen.substring(5,10))) {
				formName.qChapterID[n++] = new Option(chapterName[i], chapterID[i]);
			}
		}
	}
	else if (formInput == "2") // Exam
	{
		var levelChoosen = formName.eEducationLevelID.options[formName.eEducationLevelID.selectedIndex].value;
		var subjectChoosen = formName.eSubjectID.options[formName.eSubjectID.selectedIndex].value;
		
		intCount = chapterID.length;
		formName.eChapterID.options.length = 1;
		formName.eUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if ((chapterID[i].substring(1,3) == subjectChoosen.substring(6,8)) && (chapterID[i].substring(3,8) == levelChoosen.substring(5,10))) {
				formName.eChapterID[n++] = new Option(chapterName[i], chapterID[i]);
			}
		}
	}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Set Unit : Chapter Choosen Action : formInput (1) Question (2) Exam
//  ------------------------------------------------------------------------------------------------------------------------------------

function chapterChoosen(formName, formInput, unitID, unitName, unitChapter)
{            
	var n=1;
	var intCount = 0;
	
	if (formInput == "1") // Question
	{
		var chapterChoosen = formName.qChapterID.options[formName.qChapterID.selectedIndex].value;
		
		intCount = unitID.length;
		formName.qUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if (unitChapter[i] == chapterChoosen) {
				formName.qUnitID[n++] = new Option(unitName[i], unitID[i]);
			}
		}
	}
	else if (formInput == "2") // Exam
	{
		var chapterChoosen = formName.eChapterID.options[formName.eChapterID.selectedIndex].value;
		
		intCount = unitID.length;
		formName.eUnitID.options.length = 1;
		
		for (var i = 0; i < intCount; i++){
			if (unitChapter[i] == chapterChoosen) {
				formName.eUnitID[n++] = new Option(unitName[i], unitID[i]);
			}
		}
	}
}

//  ------------------------------------------------------------------------------------------------------------------------------------
// Validate Cancel Confirmation
//  ------------------------------------------------------------------------------------------------------------------------------------

function validateCancel() 
{
	var agree = confirm("Anda pasti untuk batalkan sesi ini?");
	if (agree)
		return true ;
	else
		return false ;
}

