/**
 *	File Name: common.js
 *	Brief Description of the file: The file contains the common Javascript
 *							functions used across the application.
 *	Author: aksarin      
 *	Last Update Date: 22 Sep 05
 *	Version: 1.18
**/
/**
  * Version: 1.01
  * Date: 05-Aug-05
  * Author: Ikram
  * Change Description: Fixed defect nbr 2
  * Logic added/modified/removed: message changed for deleting a faculty rule. 
**/
/**
  * Version: 1.02
  * Date: 05-Aug-05
  * Author: akpatel
  * Change Description: Fixed defect nbr 12
  * Logic added/modified/removed: Field value Change in checkBoxClick method
**/
/**
  * Version: 1.03
  * Date: 05-Aug-05
  * Author: akpatel
  * Change Description: Fixed defect nbr 19
  * Logic added/modified/removed: Set the scrollbars property of window.open method to yes.
**/
/**
  * Version: 1.04
  * Date: 11-Aug-05
  * Author: inmomin
  * Change Description: Fixed defect nbr 38
  * Logic added/modified/removed: Cleared institute and course if country changes in CAAOnChangeSubmit
**/
/**
  * Version: 1.05
  * Date: 12-Aug-05
  * Author: aksarin
  * Change Description: Fixed defect nbr 52
  * Logic added/modified/removed: Added the method checkIfBack. Added the implementation to catch
  * keyPress and keyDown events.
**/
/**
  * Version: 1.06
  * Date: 18-Aug-05
  * Author: akpatel
  * Change Description: Fixed defect nbr 95 & 96
  * Logic added/modified/removed: Data does not get deselected in Campus List box 
  * keyPress and keyDown events.
**/
/**
  * Version: 1.07
  * Date: 19-Aug-05
  * Author: sabraham
  * Change Description: Fixed defect nbr 123
  * Logic added/modified/removed: modified clearRegistrationForm();
**/

/**
  * Version: 1.09
  * Date: 19-Aug-05
  * Author: Ashsih
  * Change Description: Fixed defect nbr 130
  * Logic added/modified/removed: pdf rtf;
**/

/**
  * Version: 1.10
  * Date: 20-Aug-05
  * Author: Lawrence sujai
  * Change Description: Fixed defect nbr 139
  * Logic added/modified/removed: written a method displaySelected1() for highlighting the value selected in campus
**/

/**
  * Version: 1.11
  * Date: 20-Aug-05
  * Author: akpatel
  * Change Description: Fixed defect nbr 150
  * Logic added/modified/removed: checkAll function not properly working in credit Adviser.
**/

/**
  * Version: 1.12
  * Date: 24-Aug-05
  * Author: inmomin
  * Change Description: Fixed defect nbr 147
  * Logic added/modified/removed: Function PrintParts() added.
**/

/**
  * Version: 1.13
  * Date: 25-Aug-05
  * Author: inmomin
  * Change Description: Fixed defect nbr 185
  * Logic added/modified/removed: Function prevStudyEnglish() & year12() modified.
**/
/**
  * Version: 1.14
  * Date: 29-Aug-05
  * Author: nkthakre
  * Change Description: Defect Nbr 54 - CR - 35 - English Req Change
  * Logic added/modified/removed: Added the method checkIfBack. Added the implementation to catch
  * keyPress and keyDown events.
**/
/**
  * Version: 1.15
  * Date: 29-Aug-05
  * Author: inmomin
  * Change Description: Defect Nbr 195
  * Logic added/modified/removed:
**/
/**
  * Version: 1.16
  * Date: 30-Aug-05
  * Author: inmomin
  * Change Description: Defect Nbr 222
  * Logic added/modified/removed:
**/
/**
  * Version: 1.17
  * Date: 08-Aug-05
  * Author: inmomin
  * Change Description: Defect Nbr 270
  * Logic added/modified/removed:
**/
/**
  * Version: 1.18
  * Date: 22-Sep-05
  * Author: nkthakre
  * Change Description: Defect Nbr 288 - close the Adviser pop up window on click of exit button.  
  * Logic added/modified/removed:added - exitAdviser()
**/
/**
  * Version: 1.19
  * Date: 22-Sep-05
  * Author: nkthakre
  * Change Description: Defect Nbr 288 - close the Adviser pop up window on click of save and exit button. 
**/

/**
  * Version: 1.20
  * Date: 24-Oct-05
  * Author: akpatel
  * Change Description: Defect Nbr Defect Nbr:-325 CR58
**/
        <!-- variable to capture Alt keydown event -->
        var altKeyPressed = false;
        
        function checkIfBack(event, flag) {
          <!-- for IE -->
          if(navigator.appName == 'Microsoft Internet Explorer') {
            
            <!-- altKey is 18, back key is 37, forward key is 39 -->
            if(event.keyCode == 18) {
                altKeyPressed = flag;
            }
            if(event.keyCode == 37 && altKeyPressed == true) {
                alert("This function is not allowed in the application");
                altKeyPressed = false;
                return false;
            }
            if(event.keyCode == 39 && altKeyPressed == true) {
                alert("This function is not allowed in the application"); 
                altKeyPressed = false;
                return false;
            }
          }
        }
    
        <!-- For IE 6 : disable context menu -->
        document.oncontextmenu = function(evt) {
            return false;
        };
        
        <!-- For Mozilla : disable context menu -->
        
        document.onkeypress = function check(event) {
            if(navigator.appName == 'Netscape') {
                if(event.keyCode == 37 || event.keyCode == 39) {
                    if(event.altKey) {
                        alert("This function is not allowed in the application");
                        return false;
                    }
                }
            }
        };
        
		var disableButton = 'false';
		function deleteAlert(message){
			var answer=confirm(message);
			if (answer){
				return true;
			}else{
				return false;
			}
		}
		
		function cmOnChangeMajor(objFrm, varName){				
			objFrm.elements["courseMapInquiryVO.campusCode"].value = '-1';
			objFrm.elements["courseMapInquiryVO.versionNo"].value = '-1';
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		}
		function cmOnBlurCourseCode(objFrm,varName){
		    objFrm.elements["courseMapInquiryVO.majorCode"].value ='-1';
		    objFrm.elements["courseMapInquiryVO.campusCode"].value = '-1';
			objFrm.elements["courseMapInquiryVO.versionNo"].value = '-1';
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		
		}
		
		function cmOnChangeCampus(objFrm, varName){							
			objFrm.elements["courseMapInquiryVO.versionNo"].value = '-1';
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		}
		
		function cmOnBlurCourseCodec(objFrm,varName){
		    objFrm.elements["copyCourseMapVO.majorcd"].value ='-1';
		    objFrm.elements["copyCourseMapVO.campuscd"].value = '-1';
			objFrm.elements["copyCourseMapVO.versioncd"].value = '-1';
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		
		}
		
		function cmOnChangeMajorc(objFrm, varName){				
			objFrm.elements["copyCourseMapVO.campuscd"].value = '-1';
			objFrm.elements["copyCourseMapVO.versioncd"].value = '-1';
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();		
			
		}
		
		function cmOnChangeCampusc(objFrm, varName){							
		    objFrm.elements["copyCourseMapVO.versioncd"].value = '-1';
		    objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		}
		
		
		function cmOnChangeVersion(objFrm, varName){
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["subEvent"].value = varName;
			objFrm.submit();			
		}
		
		function admCourseMapEvents(objFrm, eventName) {
			objFrm.elements["event"].value = eventName;
			if (eventName == "Add" || eventName == "Modify" || eventName == "MapRules" || eventName == "Copy") {
				objFrm.submit();
				return;
			}
			if (eventName == "Delete") 
			{
			
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  	var flag = confirm('Are you sure you want to delete Course Map slots?');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   }
		}							
			
		function checkBoxesCheckedState(form) {   
			var i = 0; 
			for( ; i < form.chkBoxCounter.value ; ++i) {
				var inputId = 'inputCheckBox[' + i + ']';
				var inputObj = document.getElementById(inputId);   
				
				if (inputObj != null) {
					if(inputObj.name != "checkAll") {
						if(inputObj.checked == true){
							 return true; 
						}
					}
				}
			}
			return false;
		}
		
		function checkCheckAllState(form) {
			if(form.checkAll.checked == true){
				setCheckBoxesState(form,true);
			} else {
				setCheckBoxesState(form,false);
			}
		}
		function setCheckBoxesState(form,state) {
			var i = 0; 
			for( ; i < form.chkBoxCounter.value ; ++i) {
				var inputId = 'inputCheckBox[' + i + ']';
				var inputObj = document.getElementById(inputId);   
				
				if (inputObj != null) {
					if(inputObj.name != "checkAll") {
						inputObj.checked = state;
					}
				}
			}
		}
		
		function setCheckAllState(form, elem) {
			if(elem.checked != true) {
				form.checkAll.checked = false;
			}
		}
			
		function onUnitEquivalenceSubmit(objFrm, varName) {

			if(varName == "Modify" || varName == "ShowHistory" || varName == "Add"
				|| varName == "ResultPage" || varName =="Back" || varName =="export" ) {
				objFrm.elements["event"].value = varName;
					objFrm.submit();
					return;
			}
			if(varName == "Delete") {
				var checkedCount = checkBoxesCheckedState(objFrm);
				if(checkedCount == true ) {
					var flag = deleteAlert('Are you sure you want to delete Unit Equivalence(s)?');
					if(flag) {
						objFrm.elements["event"].value = varName;
						objFrm.submit();
					}
				} else {
					objFrm.elements["event"].value = varName;
					objFrm.submit();
					return;
				}
			}
		}
		
	
		function subjectEquivalenceAddModify(objFrm, varName){
			objFrm.elements["event"].value = varName;
			objFrm.submit();
		}
		
		function subjetEquivCheckSelection(field,obj1) {   
			
			if (!field.checked) {      
				document.getElementById(obj1).checked = false;
			}
		}
		
		function subjetEquivDetsCheckSelectionFunction(field,obj1) {   
			if (field.checked) {      
				document.getElementById(obj1).value = "Y";
			} else {
				document.getElementById(obj1).value = "N";
			}
		}
		
		function getpInstitute(selValue){
		    var prvValue = document.pstudyfrm.elements["pstudy.institute"].value;
		    onSelect(selValue,prvValue,'piframe','genericListURL','institute');
		    getpCourse("-1"); 	
		}
		
		function populateHidden(objFrm){
			objFrm.elements["pstudy.institute"].value=document.piframe.piform.elements["pstudy.institute"].value;
			objFrm.elements["pstudy.course"].value=document.pcframe.pcform.elements["pstudy.course"].value;
			objFrm.submit();
		}
		
		function onSelect(selectValue,previousValue,frmName,locationHref,listName){
		   document.frames[frmName].location.href = ""+locationHref+"?getList="+listName+"&selectValue="+selectValue+"&previousValue="+previousValue;	
		}

		function getpCourse(selValue){
		    var prvCourse = document.pstudyfrm.elements["pstudy.course"].value;
		    onSelect(selValue,prvCourse,'pcframe','genericListURL','course');
		}
	
		function newloc()
		{
			location.href="http://www.monash.edu.au/courses/";
		}
		
		function appendRole()
		{
			var constant = "$$^";
			var name = document.loginForm.elements["login"].value;
			document.loginForm.j_username.value=constant+document.loginForm.role.value+name;
		}				

		function getEnglishDetail() {
		/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
			window.open('getEnglishDetail?englishInfo=<c:out value="${requestScope.englishInfo}"/>', 'spapopup', 'width=700, height=600, resizable=yes, scrollbars=yes');
		/* Modify-End: Defect Nbr 19, Date 08-AUG-05  */
		}
		
		function getEnglishMinimum(){
		/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
			var selValue =document.forms['englishDetailsfrm'].elements["english.englishLevelTest"].value;
		    window.open('getEnglishMinimum?selectedValue='+selValue,'spapopup', 'width=700, height=600, resizable=yes, scrollbars=yes');
		/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
		}

		function getUnivLevelFurtherInfo(){
			window.open('getUnivLevelFurtherInfo','spapopup', 'width=700, height=600, scrollbars=yes, resizable=yes');
		}
		
		function getInstStudyFurtherInfo1(){
			window.open('getInstStudyFurtherInfo1','spapopup', 'width=700, height=600, scrollbars=yes, resizable=yes');
		}
		
		function getInstStudyFurtherInfo2(){
			window.open('getInstStudyFurtherInfo2','spapopup', 'width=700, height=600, scrollbars=yes, resizable=yes');
		}
		
		function getEnglishLookUp() {
			window.open('getEnglishLookUp?country=-1&institute=-1&subjectEquivalenceId=-1&unit=-1','spapopup', 'width=700, height=600, scrollbars=yes, resizable=yes');
		}
		
			
		//country not listed
		function getEnglishInstitute(country){			
			if(country == '0'){				
				window.opener.document.forms['englishDetailsfrm'].elements['english.year12Level'][1].checked = true;				
				window.close();
				window.opener.document.forms['englishDetailsfrm'].elements["english.year12Level"].value = '0';
				window.opener.document.forms['englishDetailsfrm'].submit();
			}
		    document.location.href = 'getEnglishLookUp?country='+country+'&subjectEquivalenceId=-1&unit=-1';
		}	
		
		//alternative flow for admission adviser -2.3.17 No Institution/Qualification found
		function getEnglishUnits(subjectEquivalenceId){
			var country = document.forms['engLookUpfrm'].elements["english.countryId"].value;
			if(subjectEquivalenceId == '0'){
				window.opener.document.forms['englishDetailsfrm'].elements['english.previousStudyEnglish'][1].checked = true;
				window.close();
				window.opener.document.forms['englishDetailsfrm'].elements["english.previousStudyEnglish"].value = '0';
				window.opener.document.forms['englishDetailsfrm'].submit();
			}
		    document.location.href = 'getEnglishLookUp?country='+country+'&subjectEquivalenceId='+subjectEquivalenceId+'&unit=-1';
		}		
		
		//alternative flow for admission adviser -	2.3.18	No Unit Description found
		function getEnglishUnitDetails(subjectEquivalenceId, unitValue) {
			var country = document.forms['engLookUpfrm'].elements["english.countryId"].value;
			//alert(subjectEquivalenceId);
			if(unitValue == '0'){
				window.opener.document.forms['englishDetailsfrm'].elements['english.previousStudyEnglish'][1].checked = true;				
				window.close();
				window.opener.document.forms['englishDetailsfrm'].elements["english.previousStudyEnglish"].value = '0';
				window.opener.document.forms['englishDetailsfrm'].submit();
			}else{
				document.location.href = 'getEnglishLookUp?country='+country+'&subjectEquivalenceId='+subjectEquivalenceId+'&unit='+unitValue;
			}
		}
		
		function populateEnglishDetailsHidden(objFrm) {
			objFrm.elements["english.institute"].value = document.eiframe.piform.elements["english.institute"].value;
			objFrm.elements["english.units"].value = document.euframe.pcform.elements["englist.units"].value;
		}		

	
		function checkNextCourseSelection(fname){		
			var count = fname.elements["preReqId"].length;
			alert(count);
			var flag= false;
			for ( i =0; i < count ; i++){
				alert(document.caaAssesmentForm.preReqId[i].checked);
				if (document.caaAssesmentForm.preReqId[i].checked) {
					
					flag= true;
					break;
				}
			}
			
			if (!flag){
				alert("Please select at least one course and then click continue");
				return false;
			}else{
				return true;
			}
		}
		
		function checkSelection(selectForm, preReqFlag){

			var flag= false;
			if(selectForm.preReqId.length){
				var count = selectForm.preReqId.length;
				for ( i =0; i < count ; i++){
					if (selectForm.preReqId[i].checked) {
						flag= true;
						break;
					}
				}
			}else{
				flag = selectForm.preReqId.checked;
			}
			
			if (preReqFlag && preReqFlag == true) {
				selectForm["validateYN"].value = 'Y';
			}
			
			if (!flag){
				if (selectForm["selectedYN"]) {
					selectForm["selectedYN"].value = 'N';
				}
			}else{
				if (selectForm["selectedYN"]) {
					selectForm["selectedYN"].value = 'Y';
				}
			}
			return true;
		}		
		
		function loginAlert(){
			
			var answer=confirm("You must login or register to be able to use this service, would you like to login or register?");
			if(answer){
				location.href='/Monash/redirect.jsp';
			}
		}
		
		function creditAdviserAlert(){
			var answer=confirm("Do you wish to go to Credit Assesment?");
			if(answer){
				location.href='creditAdviser';
			}
		}
		function saveAlert(){
			var answer=confirm("Are you sure you want to save this data?");
			if (answer){
				return true;
			}else{
				return false;
			}
		}
		function getCACourseType(selValue){
		    var prvCourseLeval = document.mCourseDetailsForm.elements["monashDetails.courseType"].value;
		    onSelect(selValue, prvCourseLeval, 'mctframe', 'genericListURL', 'courseType');
		}

		function getCACourseMajor(selValue){
		    var prvCourseMajor = document.mCourseDetailsForm.elements["monashDetails.courseMajor"].value;
		    onSelect(selValue, prvCourseMajor, 'mcmframe', 'genericListURL', 'courseMajor');
		    getCACourseCampus("-1");
		}
		
		function getCACourseCampus(selValue){
			
			if (selValue == '0') {
				callExitFlow('campusNotListed', selValue);
			}
			else {
			
				var prvCampus = document.mccframe.mccform.elements["monashDetails.campus"].value;
				onSelect(selValue, prvCampus, 'mccframe', 'genericListURL', 'courseCampus');
				//getAdvisorMCourse("-1");
			}
		}

		function populateCourseDecisionHidden(objFrm) {
		}
		
		function changeCAStudyLevel(selValue) {

			document.prevDetailsForm.elements["previousStudy.studyLevel"].value = selValue;

			document.prevDetailsForm.action = 'caExitFlow?exitFlowName=checkStudyLevel&setectedValue=' + selValue;
			document.prevDetailsForm.submit();
		}
		
		function changeCACountry(selValue) {
			if (selValue == '0') {
				document.prevDetailsForm.elements["previousStudy.countryId"].value = selValue;
				document.prevDetailsForm.action = 'caExitFlow?exitFlowName=countryNotListed&setectedValue=' + selValue;
				document.prevDetailsForm.submit();
			}
			else {
				var prvCountry = document.prevDetailsForm.elements["previousStudy.countryId"].value;
				//alert('prev Country ' + prvCountry);
				onSelect(selValue, prvCountry, 'psinstframe', 'genericListURL', 'caInstitute');
			}
		}
		
		function getCAInstitution(selValue) {
			if (selValue == '0') {
				//document.prevDetailsForm.elements["previousStudy.institutionId"].value = document.psinstframe.psinstform.elements["previousStudy.institutionId"].value;
				document.prevDetailsForm.elements["previousStudy.institutionId"].value = selValue;
				document.prevDetailsForm.action = 'caExitFlow?exitFlowName=institutionNotListed&setectedValue=' + selValue;
				document.prevDetailsForm.submit();
			}
			else {
				var prvInst = document.psinstframe.psinstform.elements["previousStudy.institutionId"].value;
				onSelect(selValue, prvInst, 'pscourframe', 'genericListURL', 'caPrevCourse');
			}
		}

		function changeMonashCourse(selValue) {
			//callExitFlow('MonashCourseExit', selValue);

			document.mCourseDetailsForm.elements["monashDetails.courseType"].value = document.mctframe.mctform.elements["monashDetails.courseType"].value;
			document.mCourseDetailsForm.elements["monashDetails.courseMajor"].value = document.mcmframe.mcmform.elements["monashDetails.courseMajor"].value;
			document.mCourseDetailsForm.elements["monashDetails.campus"].value = document.mccframe.mccform.elements["monashDetails.campus"].value;
			document.mCourseDetailsForm.elements["monashDetails.monashCourse"].value = document.mcourseframe.mcourseform.elements["monashDetails.monashCourse"].value;

			//vat addQS = '';
			document.mCourseDetailsForm.action = 'caExitFlow?exitFlowName=MonashCourseExit&setectedValue=' + selValue;
			document.mCourseDetailsForm.submit();
		}
		
		function callExitFlow(flowName, selValue) {
			document.location.href = 'caExitFlow?exitFlowName=' + flowName + '&setectedValue=' + selValue + '';
		}
		
		function backCreditAdvisor(sendCurrPage) {
			//alert(sendCurrPage);
			var target = '?_target' + sendCurrPage + '=' + sendCurrPage;
			//alert('target ' + target);
			document.location.href = 'creditAdviser' + target;
		}

		function CAExitSend() {
			alert('Functionality is not yet decided');
		}
		
	/* Modify-Begin: Defect Nbr 150, Date 20-AUG-05  */	
		function CACourseDecisionSelAll() {
		 
			if (document.caCourseDecisionForm.chkBoxCounter) {
				var chkBoxCounter = document.caCourseDecisionForm.chkBoxCounter.value;
				var isSel = false;
				var isAllSel = false;
				
				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'U2UCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);
		            if (chkBox && chkBox.checked == true) {
						//chkBox.checked = false;
						isSel = true;
						isAllSel = true;
					}
					if (chkBox && chkBox.checked == false) {
						//chkBox.checked = true;
						isAllSel = false;
					}
				}
				//alert('isAllSel ' + isAllSel);
				//alert('isSel ' + isSel);
				
				if (document.caCourseDecisionForm.checkAll.checked == false) {
					for (var i = 0; i <= chkBoxCounter; i++) {
						var chkBoxId = 'U2UCHKBOX' + i;
						var chkBox = document.getElementById(chkBoxId);
						
						if (chkBox) {
							chkBox.checked = false;
						}
					}
				}
				else if (document.caCourseDecisionForm.checkAll.checked==true) {
					for (var i = 0; i <= chkBoxCounter; i++) {
						var chkBoxId = 'U2UCHKBOX' + i;
						var chkBox = document.getElementById(chkBoxId);
						
						if (chkBox) {
							chkBox.checked = true;
						}
					}
				}
			}
		}
		
		/* Modify-End: Defect Nbr 150 , Date 20-AUG-05  */
		
		
    	function onChangeSubmit(objFrm) {
			objFrm.elements["event"].value="onChange";
			objFrm.submit();
		}
		
		function caOnChangeSubmit(objFrm, varName, flag, selval) {
			if(flag) {
				if (selval == '0') {
					objFrm.elements["event"].value = "onChange";
					objFrm.elements["listName"].value = varName;
					objFrm.submit();
				}
			}
			else {
				objFrm.elements["event"].value = "onChange";
				objFrm.elements["listName"].value = varName;
				objFrm.submit();
			}
		}

		function caOnChangeCountry(objFrm, varName) {
			objFrm.elements["previousStudy.institutionId"].value = '-1';
			objFrm.elements["previousStudy.prevCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}

		function caOnChangeInstitute(objFrm, varName) {
			objFrm.elements["previousStudy.prevCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}

		function caOnChangeCourseLevel(objFrm, varName) {
			objFrm.elements["monashDetails.courseType"].value = '-1';
			objFrm.elements["monashDetails.broadAreaOfStudy"].value = '-1';
			objFrm.elements["monashDetails.courseMajor"].value = '-1';
			objFrm.elements["monashDetails.campus"].value = '-1';
			objFrm.elements["monashDetails.monashCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}
		
		function caOnChangeCourseType(objFrm, selValue) {
			objFrm.elements["monashDetails.broadAreaOfStudy"].value = '-1';

			var courseMajor = objFrm.elements["monashDetails.courseMajor"];
			removeSelectOptions(courseMajor);

			var campus = objFrm.elements["monashDetails.campus"];
			removeSelectOptions(campus);

			var monashCourse = objFrm.elements["monashDetails.monashCourse"];
			removeSelectOptions(monashCourse);
		}
		
		function caOnChangeBAS(objFrm, varName, selValue) {
			objFrm.elements["monashDetails.courseMajor"].value = '-1';
			objFrm.elements["monashDetails.campus"].value = '-1';
			objFrm.elements["monashDetails.monashCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}

		function caOnChangeCourseMajor(objFrm, varName, selValue) {
			objFrm.elements["monashDetails.campus"].value = '-1';
			objFrm.elements["monashDetails.monashCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}

		function caOnChangeCampus(objFrm, varName, selValue) {
			objFrm.elements["monashDetails.monashCourse"].value = '-1';
			caOnChangeSubmit(objFrm, varName);
		}
		
 	 	function changeStatus(objFrm){
 	 	  objFrm.elements["qualificationMaintainVo.change"].value='true';
 	 	}
 	 	 
 	 	 
		
		function caOnChangeMonashCourse(objFrm, varName, selValue) {
			if (selValue != -1) {
				caOnChangeSubmit(objFrm, varName);
			}
		}

		function caPrevDetailSubmit(objFrm, varName) {
			objFrm.elements["listName"].value = varName;
		}

		function caMonashDetailSubmit(objFrm, varName) {
			objFrm.elements["listName"].value = varName;
		}

		function caCourseDecisionSubmit(objFrm, varName) {
			//alert('caCourseDecisionSubmit ' + varName);
			objFrm.elements["listName"].value = varName;
			//objFrm.submit();
		}

		function removeSelectOptions(control) {

			var len = control.length - 1;
			for (i=len; i >= 0; i--) {
				control.options[i] = null;
			}

			createSelectOptions(control, 0, '- Select -', '-1');
		}

		function createSelectOptions(control, indx, text, value) {
			var op = new Option();
			op.text = text;
			op.value = value;

			control[indx] = op;
		}

		
		function caaOnChangeSubmit(objFrm, varName) {
				objFrm.elements["event"].value = "onChange";
				objFrm.elements["listName"].value = varName;
				
				/* Modify-Begin: Defect Nbr 38, Date 11-AUG-05  */
				if (varName == 'monash-country') {
					objFrm.elements["previousStudyMap.institutionId"].value = '-1';
					objFrm.elements["previousStudyMap.course"].value = '-1';
				/* Modify-End: Defect Nbr 38, Date 11-AUG-05  */
				} else if (varName == 'caa-coursetype') {
					objFrm.elements["monashDetails.courseType"].value = '-1';
					objFrm.elements["monashDetails.broadAreaOfStudy"].value = '-1';
					objFrm.elements["monashDetails.courseMajor"].value = '-1';
					//objFrm.elements["monashDetails.campus"].value = '-1';
					objFrm.elements["monashDetails.monashCourse"].value = '-1';
					objFrm.elements["monashDetails.clearCampusSelection"].value = 'true';
				}else if (varName == 'caa-coursemajor') {
					objFrm.elements["monashDetails.courseMajor"].value = '-1';
					objFrm.elements["monashDetails.monashCourse"].value = '-1';
					objFrm.elements["monashDetails.clearCampusSelection"].value = 'true';
				}else if (varName == 'caa-studylevel') {
					if (objFrm.elements["previousStudyMap.countryId"]) {
						objFrm.elements["previousStudyMap.countryId"].value = '-1';
					}
					if (objFrm.elements["previousStudyMap.institutionId"]) {
						objFrm.elements["previousStudyMap.institutionId"].value = '-1';
					}					
					if (objFrm.elements["previousStudyMap.course"]) {
						objFrm.elements["previousStudyMap.course"].value = '-1';
					}					
				}
				else if (varName == 'caa-pscountry') {
					
					if (objFrm.elements["previousStudyMap.institutionId"]) {
						objFrm.elements["previousStudyMap.institutionId"].value = '-1';
					}
					objFrm.elements["previousStudyMap.course"].value = '-1';
				}
				else if (varName == 'caa-coursecampus' || varName == 'caa-coursemajor') {
					objFrm.elements["monashDetails.clearCampusSelection"].value = 'true';
				}
				objFrm.submit();
		}
		
		function caBackButtonClicked(objFrm) {
			objFrm.elements["backButtonClicked"].value = "Y";
		}
		
		function caaBackButtonClicked(objFrm) {		
			objFrm.elements["backButtonClicked"].value = "Y";
		}		
		
		function setDocCheckBoxValue(objFrm, obj, indx){
			var hiddenChkBox = document.getElementById('documentCheckBox'+indx);			
			if(obj.checked){
				hiddenChkBox.value = "true";
				eval('objFrm.elements["'+obj.name+'"].value = "true"');
			}
			else{
				hiddenChkBox.value = "false";
				eval('objFrm.elements["'+obj.name+'"].value = "false"');
			}		
		}
		
		function checkInternational(objFrm, obj){
			objFrm.elements["national"].checked = false;
			objFrm.elements["domestic"].value = "false";
		}
		
		function checkDomestic(objFrm, obj){
			objFrm.elements["international"].checked = false;
			objFrm.elements["domestic"].value = "true";
		}
		
		function setCheckBoxValue(objFrm, obj) {
			var domesticChkBox = objFrm.elements["domestic"];
			var termsChkBox = objFrm.elements["terms"];
			
			if (obj.name == domesticChkBox.name) {
				if (obj.checked) {
					domesticChkBox.value = "true";
				}
				else{
					domesticChkBox.value = "false";
				}
			}
			if (obj.name == termsChkBox.name) {
				if (obj.checked) {
					termsChkBox.value = "true";
				}
				else{
					termsChkBox.value = "false";
				}
			}
		}
		
		function setAllCheckBoxValue(objFrm,obj,count){
		var all = eval('objFrm.elements["'+obj.name+'"]');
			if(obj.checked){
				eval('objFrm.elements["'+obj.name+'"].value = "true"');
			}
			else{
				eval('objFrm.elements["'+obj.name+'"].value = "false"');
			}
			for(var i=0; i<count; i++) {
				var current = eval('objFrm.elements["documentList['+i+'].checked"]');
				current.checked = all.checked;
				current.value = all.value;
			}
		}
		
		function submitDecisionfrm(objFrm, selValue) {
			var count = document.decisionDocumentsForm.documentCount.value;

			for (var i=0; i<count; i++) {
				var current = eval('objFrm.elements["documentList['+i+'].checked"]');
				var current1 = eval('objFrm.elements["documentList['+i+'].check1"]');

				if (document.getElementById('documentCheckBox' + i) != null) {
					if (current.checked) {
						current1.value = 'true';
					}
					else {
						current1.value = 'false';
					}
				}
			}	
			objFrm.elements["event"].value = selValue;
			objFrm.submit();
		}

		function submitSaveDecisionfrm(objFrm, selValue) {
			objFrm.elements["event"].value = selValue;
			objFrm.submit();
		}
		
		function onClose() {
			window.opener.document.forms["saveDocumentForm"].elements["event"].value = 'refresh';
			window.opener.document.forms["saveDocumentForm"].submit();
			window.close();
		}
		
		function onCourseDecisionSubmit(objFrm, operation){
			objFrm.elements["courseDecisionVO.operation"].value = operation;
    		objFrm.submit();
		}
		
		function onBulkDecisionSubmit(objFrm) {
			objFrm.submit();
		}
		
		function onUnitDecisionSubmit(objFrm, operation){
			objFrm.elements["unitDecisionVO.operation"].value = operation;
			objFrm.submit();
		}
		
		function subjEquivalOnChangeSubmit(objFrm, varName) {
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["listName"].value = varName;

			if (varName == "countryList") {
				objFrm.elements["subjectEquivalenceSearchVO.institutionID"].value='-1';
				objFrm.elements["subjectEquivalenceSearchVO.qualificationID"].value='-1';
				objFrm.elements["subjectEquivalenceSearchVO.prevStudyUnitID"].value='-1';
			}
			if (varName == "institutionList") {
				objFrm.elements["subjectEquivalenceSearchVO.qualificationID"].value='-1';
				objFrm.elements["subjectEquivalenceSearchVO.prevStudyUnitID"].value='-1';
			}
			if (varName == "qualificationList") {
				objFrm.elements["subjectEquivalenceSearchVO.prevStudyUnitID"].value='-1';
			}			
			document.subjectEquivalInquiryForm.submit();
		}

		function subjectEquivalOnChangeSubmit(objFrm, varName) {
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["listName"].value = varName;
			if (varName == "countryList") {
				objFrm.elements["subjectEquivalenceVO.institutionID"].value='-1';
				objFrm.elements["subjectEquivalenceVO.qualificationID"].value='-1';
				objFrm.elements["subjectEquivalenceVO.prevStudyUnitID"].value='-1';
			}
			if (varName == "institutionList") {
				objFrm.elements["subjectEquivalenceVO.qualificationID"].value='-1';
				objFrm.elements["subjectEquivalenceVO.prevStudyUnitID"].value='-1';
			}
			if (varName == "qualificationList") {
				objFrm.elements["subjectEquivalenceVO.prevStudyUnitID"].value='-1';
			}
			document.addSubjectEquivalenceForm.submit();
		}		
		
		function decInqrOnChangeSubmit(objFrm, varName) {
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["listName"].value = varName;
			
			if ('dec-inqr-institute' == varName ) {
				objFrm.elements["decSearchVO.institutionId"].value = '-1';
			}
			//objFrm.elements["decSearchVO.dueForReview"].value = 'false';
			document.decisionSearchForm.submit();
		}
		
		function submitDecisionForm(objFrm, event) {
			objFrm.elements["event"].value = event;
			document.decisionSearchForm.submit();
		}

		function prev()
		{
			
			if(confirm('Do you want to save the document?')!=true)
			{
				location.href='asd-results.html';
			}
		}
		
		function delDecDocConfirmation(objfrm) {
			for (i=0,n=objfrm.elements.length;i<n;i++) {
				if(objfrm.elements[i].type == "checkbox" && objfrm.elements[i].checked) {
					var retval = window.confirm('Are you sure you want to Delete this Document?');
					if(!retval){
						for (i=0; i < objfrm.elements.length;i++) {		
							if(objfrm.elements[i].type == "checkbox") {
								objfrm.elements[i].checked = false;
								objfrm.elements[i].value = false;
							}
						}
						return;
					}	
					else{
						submitDecisionfrm(objfrm, 'delete');
						return;
					}						
				}
			}	
			submitDecisionfrm(objfrm, 'delete');
		}
		
		function attach() {
			if(document.documentUploadForm.document.value=="") {
				document.documentUploadForm.document.focus();
				return false;
			}
			var div1 = document.getElementById("attachDocDiv");
			div1.innerHTML ="Attaching...";
			document.documentUploadForm.submit();
		}
		
		function decInqrClearFormSubmit(objFrm) {
			objFrm.elements["event"].value = "clearForm";
			objFrm.submit();
		}
		
		function attachDoc(){
			if(document.reviewForm.elements["reviewVO.attachDoc"].checked){
				document.reviewForm.elements["reviewVO.attachDoc"].value = 'true';
			}else{
				document.reviewForm.elements["reviewVO.attachDoc"].value = 'false';				
			}					
		}
		function inqrResultCourseDecisionGetPage(objFrm, pageNo) {
			objFrm.elements["courseDecisionPageNo"].value = pageNo;
			objFrm.submit();
		}
		function inqrResultCourseDecisionGetNextPage(objFrm) {
			objFrm.elements["courseDecisionPageNo"].value = parseInt(objFrm.elements["courseDecisionPageNo"].value) + 1;
			objFrm.submit();
		}
		function inqrResultCourseDecisionGetPrevPage(objFrm) {
			objFrm.elements["courseDecisionPageNo"].value = parseInt(objFrm.elements["courseDecisionPageNo"].value) - 1;
			objFrm.submit();
		}
		function inqrResultCourseDecisionGetOrderByPage(objFrm, orderBy, pageNo) {
			var sortOrder = objFrm.elements["courseDecisionSortOrder"].value;
			
			if(sortOrder == '') {
				objFrm.elements["courseDecisionSortOrder"].value = 'asc';
			}

			if(sortOrder == 'asc') {
				objFrm.elements["courseDecisionSortOrder"].value = 'desc';
			}

			if(sortOrder == 'desc') {
				objFrm.elements["courseDecisionSortOrder"].value = 'asc';
			}
			
			objFrm.elements["courseDecisionOrderBy"].value = orderBy;
			objFrm.elements["courseDecisionPageNo"].value = pageNo;
			objFrm.submit();
		}
		function inqrResultUnitDecisionGetPage(objFrm, pageNo) {
			objFrm.elements["unitDecisionPageNo"].value = pageNo;
			objFrm.submit();
		}
		function inqrResultUnitDecisionGetNextPage(objFrm) {
			objFrm.elements["unitDecisionPageNo"].value = parseInt(objFrm.elements["unitDecisionPageNo"].value) + 1;
			objFrm.submit();
		}
		function inqrResultUnitDecisionGetPrevPage(objFrm) {
			objFrm.elements["unitDecisionPageNo"].value = parseInt(objFrm.elements["unitDecisionPageNo"].value) - 1;
			objFrm.submit();
		}
		function inqrResultUnitDecisionGetOrderByPage(objFrm, orderBy, pageNo) {
			var sortOrder = objFrm.elements["unitDecisionSortOrder"].value;
			
			if(sortOrder == '') {
				objFrm.elements["unitDecisionSortOrder"].value = 'asc';
			}

			if(sortOrder == 'asc') {
				objFrm.elements["unitDecisionSortOrder"].value = 'desc';
			}

			if(sortOrder == 'desc') {
				objFrm.elements["unitDecisionSortOrder"].value = 'asc';
			}
			
			objFrm.elements["unitDecisionOrderBy"].value = orderBy;
			objFrm.elements["unitDecisionPageNo"].value = pageNo;
			objFrm.submit();
		}

		function courseDecisionHistoryGetPage(objFrm, pageNo) {
			objFrm.elements["courseDecHisPageNo"].value = pageNo;
			objFrm.submit();
		}
		function courseDecisionHistoryGetNextPage(objFrm) {
			objFrm.elements["courseDecHisPageNo"].value = parseInt(objFrm.elements["courseDecHisPageNo"].value) + 1;
			objFrm.submit();
		}
		function courseDecisionHistoryGetPrevPage(objFrm) {
			objFrm.elements["courseDecHisPageNo"].value = parseInt(objFrm.elements["courseDecHisPageNo"].value) - 1;
			objFrm.submit();
		}
		function courseDecisionHistoryGetOrderByPage(objFrm, orderBy, pageNo) {
			var sortOrder = objFrm.elements["courseDecHisSortOrder"].value;
			
			if(sortOrder == '') {
				objFrm.elements["courseDecHisSortOrder"].value = 'asc';
			}

			if(sortOrder == 'asc') {
				objFrm.elements["courseDecHisSortOrder"].value = 'desc';
			}

			if(sortOrder == 'desc') {
				objFrm.elements["courseDecHisSortOrder"].value = 'asc';
			}
			
			objFrm.elements["courseDecHisOrderBy"].value = orderBy;
			objFrm.elements["courseDecHisPageNo"].value = pageNo;
			objFrm.submit();
		}

		function unitDecisionHistoryGetPage(objFrm, pageNo) {
			objFrm.elements["unitDecHisPageNo"].value = pageNo;
			objFrm.submit();
		}
		function unitDecisionHistoryGetNextPage(objFrm) {
			objFrm.elements["unitDecHisPageNo"].value = parseInt(objFrm.elements["unitDecHisPageNo"].value) + 1;
			objFrm.submit();
		}
		function unitDecisionHistoryGetPrevPage(objFrm) {
			objFrm.elements["unitDecHisPageNo"].value = parseInt(objFrm.elements["unitDecHisPageNo"].value) - 1;
			objFrm.submit();
		}
		function unitDecisionHistoryGetOrderByPage(objFrm, orderBy, pageNo) {
			var sortOrder = objFrm.elements["unitDecHisSortOrder"].value;
			
			if(sortOrder == '') {
				objFrm.elements["unitDecHisSortOrder"].value = 'asc';
			}

			if(sortOrder == 'asc') {
				objFrm.elements["unitDecHisSortOrder"].value = 'desc';
			}

			if(sortOrder == 'desc') {
				objFrm.elements["unitDecHisSortOrder"].value = 'asc';
			}
			
			objFrm.elements["unitDecHisOrderBy"].value = orderBy;
			objFrm.elements["unitDecHisPageNo"].value = pageNo;
			objFrm.submit();
		}
		
		function showCourseDecisionHistory(objFrm) {
			objFrm.elements["backAction"].value = objFrm.elements["event"].value;
			objFrm.elements["event"].value = 'view';
			objFrm.submit();
		}
		
		function InqrResultCourseDecisionSelAll() {
			
			var chkBoxAll = document.getElementById('checkAllCourseDecision');
			
			if (document.resultForm.cdchkBoxCounter) {
				var chkBoxCounter = document.resultForm.cdchkBoxCounter.value;

				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'INQRRESULTCDCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);

					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				}
			}
		}
		function InqrResultCourseDecisionCopySelAll() {
			
			var chkBoxAll = document.getElementById('checkAllCourses');
			
			if (document.copyCourseDecForm.cdchkBoxCounter) {
				var chkBoxCounter = document.copyCourseDecForm.cdchkBoxCounter.value;

				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'INQRRESULTCDCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);

					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				}
			}
		}

		function InqrResultUnitDecisionSelAll() {
			var chkBoxAll = document.getElementById('checkAllUnitDecision');
			
			if (document.resultForm.udchkBoxCounter) {
				var chkBoxCounter = document.resultForm.udchkBoxCounter.value;

				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'INQRRESULTUDCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);

					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				}
			}
		}
		
		function HistoryCourseDecisionSelAll() {
			
			var chkBoxAll = document.getElementById('checkAllCourseDecisionHist');
			
			if (document.showCourseHistory.cdhistchkBoxCounter) {
				var chkBoxCounter = document.showCourseHistory.cdhistchkBoxCounter.value;

				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'HISTORYCDCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);

					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				}
			}
		}
		
		function HistoryUnitDecisionSelAll() {
			
			var chkBoxAll = document.getElementById('checkAllUnitDecisionHist');
			
			if (document.showCourseHistory.udhistChkBoxCounter) {
				var chkBoxCounter = document.showCourseHistory.udhistChkBoxCounter.value;

				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'HISTORYUDCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);

					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				}
			}
		}
		function onCourseDecCopyButtonClick(event) {
			var resultform = document.copyCourseDecForm;
			resultform.event.value = event;
			document.copyCourseDecForm.submit();
		}
		function onInqResultButtonClick(event) {
			//disableButtons();
			var resultform = document.resultForm;
			document.resultForm.eventName.value = event;
			if(disableButton == 'false'){
				disableButton = 'true'
				if(event == 'Delete'){
					for (i=0 ; i < resultform.elements.length; i++) {
						if(resultform.elements[i].type == "checkbox" && resultform.elements[i].checked) {						
							var retval = window.confirm('Are you sure you want to Delete the selected decision?');
							if(!retval){
								if(document.getElementById('checkAllCourseDecision')){
									document.getElementById('checkAllCourseDecision').checked = false;
								}
								if(document.getElementById('checkAllUnitDecision')){	
									document.getElementById('checkAllUnitDecision').checked = false;
								}	
								enableButtons();
								InqrResultCourseDecisionSelAll();
								InqrResultUnitDecisionSelAll();
								return;
							}	
							else{
								document.resultForm.submit();
								enableButtons();
								return;
							}	
						}	
					}	
					document.resultForm.submit();
				}else{
					document.resultForm.submit();
				}	
			}	
		}
		
		function generatePdfRtfPrint(objForm){	
		
			if(	objForm.forms[1] != null){
				if(objForm.forms[1].name == 'accesmentfrm' || objForm.forms[1].name == 'caaSummaryFrm'
				|| objForm.forms[1].name == 'caaAssesmentForm'){
				
					var selValue=objForm.forms[1].elements["pdfType"].value;
					if(objForm.forms[1].elements["generatePDF"].value == 'true'){
						objForm.forms[1].elements["generatePDF"].value ='false';
						createAdmAdviserPDF(selValue);
					}else if(objForm.forms[1].elements["generateRTF"].value == 'true'){
						objForm.forms[1].elements["generateRTF"].value ='false';
						createAdmAdviserRTF(selValue);
					}
				}
			}	
			if (objForm.forms[1] && objForm.forms[1].name == 'courseMapForm'){
				if(objForm.forms[1].elements["generatePDF"].value == 'true'){
					objForm.forms[1].elements["generatePDF"].value ='false';
					createCreditAdviserPDF();
				}else if(objForm.forms[1].elements["generateRTF"].value == 'true'){
					objForm.forms[1].elements["generateRTF"].value ='false';
					createCreditAdviserRTF();
				}
			}
			
			if(objForm.forms[1] && objForm.forms[1].name == 'accesmentfrm') {
				if(objForm.forms[1] && objForm.forms[1].elements["generatePrint"].value == 'true'){
					objForm.forms[1].elements["generatePrint"].value = 'false';
					/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
					window.open('./caaAdviserPrint','myWin','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=650, height=500'); 
					/* Modify-End: Defect Nbr 19, Date 08-AUG-05  */
				}
			}
			if(objForm.forms[1] && objForm.forms[1].name == 'caaSummaryFrm') {
				if(objForm.forms[1].elements["generatePrint"].value == 'true'){
					objForm.forms[1].elements["generatePrint"].value = 'false';
					/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
					window.open('./preRequisitesPrint','myWin','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=550, height=500'); 
					/* Modify-End: Defect Nbr 19, Date 08-AUG-05  */
				}
			}
			if(objForm.forms[1] && objForm.forms[1].name == 'caaAssesmentForm') {
				if(objForm.forms[1].elements["generatePrint"].value == 'true'){
					objForm.forms[1].elements["generatePrint"].value = 'false';
					/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
					window.open('./preReqAssesmentPrint','myWin','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=550, height=500'); 
					/* Modify-End: Defect Nbr 19, Date 08-AUG-05  */
				}
			}
			if(objForm.forms[1] && objForm.forms[1].name == 'courseMapForm') {
				/* Modify-Begin: Defect Nbr 288, Date 27-Sep-05  */
				if(objForm.forms[1].elements["exitFlag"].value == 'true'){
					exitAdviser();				
				}
				/* Modify-Begin: Defect Nbr 288, Date 27-Sep-05  */
				if(objForm.forms[1].elements["generatePrint"].value == 'true'){
					objForm.forms[1].elements["generatePrint"].value = 'false';
					/* Modify-Begin: Defect Nbr 19, Date 08-AUG-05  */
					window.open('./creditAdviserPrint','myWin','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=650, height=600'); 
					/* Modify-End: Defect Nbr 19, Date 08-AUG-05  */
				}
			}
		}
		
		/** Modified begin: Ashish Sarin defect 130 **/
		function createAdmAdviserPDF(selValue){
			//myself = window.open('getAdmAdviserPDF?selectedValue='+selValue,'', 'width=500, height=300');
			//myself.setTimeout('window.close()', 5000);
				
			//var poppedwin = window.open('getAdmAdviserPDF?selectedValue='+selValue,'', 'resizable=yes, scrollbars=yes,width=800, height=800');
			window.location = 'getAdmAdviserPDF?selectedValue='+selValue;
            //mainwindow = window.self; 

            //mainwindow.opener = window.self;             
            //poppedwin.focus(); 
            //poppedwin.setTimeout('poppedwin.close()',10000); 
			
		}
		
		function closeWin() {
		myself.close();
		}
		
		function createAdmAdviserRTF(selValue){
			//window.open('getAdmAdviserRTF?selectedValue='+selValue,'', 'resizable=yes, scrollbars=yes,width=800, height=800');
			window.location = 'getAdmAdviserRTF?selectedValue='+selValue;
		}
		
		function createCreditAdviserPDF(){
			//window.open('pdfCreditAdvisermap','myPdfWin', 'resizable=yes, scrollbars=yes,width=800, height=800');
			window.location = 'pdfCreditAdvisermap';
		}
		
		function createCreditAdviserRTF(){
			//window.open('rtfCreditAdvisermap','myRtfWin', 'resizable=yes, scrollbars=yes,width=800, height=800');
			window.location = 'rtfCreditAdvisermap';	
		}
       /** Modified end: Ashish Sarin defect 130 **/
		function admCourseInqrOnchange(objFrm, eventName) {
			objFrm.elements["eventName"].value = eventName;
			objFrm.submit();
		}				
		
		function setButtonName(obj,objForm){
			eval('objForm.elements["actionName"].value ="'+obj.value+'"');
			objForm.submit();
		}
		
		
		function prevStudyEnglish(obj){
		/* Modify-Begin: Defect Nbr 185, Date 24-AUG-05  */ 
			document.englishDetailsfrm.elements["event"].value = "onChange";
		/* Modify-End: Defect Nbr 185, Date 24-AUG-05  */ 
			if(document.englishDetailsfrm.elements["english.previousStudyEnglish"][0].checked){
	 			document.englishDetailsfrm.elements["english.previousStudyEnglish"].value = '1';
			}
			if(document.englishDetailsfrm.elements["english.previousStudyEnglish"][1].checked){
				document.englishDetailsfrm.elements["english.previousStudyEnglish"].value = '0';
			}
			document.englishDetailsfrm.submit();	
		}
		
		function year12(obj){
			document.englishDetailsfrm.elements["event"].value = "onSelect";
			if(obj.name == "english.englishLevelTest"){
				document.englishDetailsfrm.elements["event"].value = "onChange";
			}
			document.englishDetailsfrm.submit();
		}
		
		function admInqrUnderGrad(objFrm, eventName) {
			objFrm.elements["event"].value = eventName;
			if (eventName == "Add" || eventName == "Modify" || eventName == "ShowHistory" || eventName == "CourseInquiry") {
				objFrm.submit();
				return;
			}
			if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  	var flag = confirm('Are you sure you want to delete Undergraduate Entry Level(s)?');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   }
		}
		
		
		function admInqrUnderGradCourse(objFrm,eventName)
		{
		  objFrm.elements["event"].value = eventName;
		  if(eventName == "Modify" || eventName == "Show History" || eventName =="Copy")
		   {
		     objFrm.submit();
		     return;
		    }
		  if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  	var flag = confirm('Are you sure you want to delete Record(s)?');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   } 
		    
		}	
		
		function admInqrGpaAssign(objFrm,eventName)
		{
		  objFrm.elements["event"].value = eventName;
		  if(eventName == "Modify" || eventName == "Show History" || eventName =="Copy")
		   {
		     objFrm.submit();
		     return;
		    }
		  if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  	var flag = confirm('Are you sure you want to delete Record(s)?');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   } 
		    
		}	
		function refPreviouseCourseEdit(objFrm,eventName)
		 {
		    objFrm.elements["event"].value = eventName;
		    objFrm.submit();
		 }
		function refInqrPreviousCourse(objFrm,eventName)
		{
		  
		  objFrm.elements["event"].value = eventName;
		  if(eventName == "Modify" || eventName == "Add")
		   {
		     objFrm.submit();
		     return;
		    }
		  if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  	var flag = confirm('Are you sure you want to delete Record(s)?');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   } 
		    
		}	
		
		function addUnderGradCourseBackSubmit(objFrm,varName)
		 {
		   objFrm.elements["event"].value=varName;
		   objFrm.submit();
		 } 
		 
		 function addUnderGradCourseHistoryBackSubmit(objForm)
		  {
		     objForm.submit();
		  }  

       function underGradCopy(objFrm,varName)
		 {
		   objFrm.elements["event"].value=varName;
		   objFrm.submit();
		 } 
		 
	  function gpaCourseCopy(objFrm,varName)
		 {
		   objFrm.elements["event"].value=varName;
		   objFrm.submit();
		 } 	 
	  function addGpaCourseBackSubmit(objFrm,varName)
		 {
		   objFrm.elements["event"].value=varName;
		   objFrm.submit();
		 } 	 	 
		 
		 function getInstituteName(objFrm,varName){
		  objFrm.elements["event"].value="onChange";
		  objFrm.elements["listName"].value=varName;
		  objFrm.submit();
		} 

		function addUnderGradOnChangeSubmit(objFrm, varName) {
			objFrm.elements["event"].value = "onChange";
			objFrm.elements["listName"].value = varName;
			document.updateUnderGradQualificationForm.submit();
		}	
		  
		function refPreCheckbox(objFrm, obj,name){
		   if(obj.checked != true) {
			 objFrm.elements[name].value='N';
	 	   }
	 	   else{
	 	   objFrm.elements[name].value='Y';
	 	   }
	 	   
	   }
		
		function onChangeSubmit(objFrm, varName) {

				objFrm.elements["event"].value = "onChange";
				objFrm.submit();
//				objFrm.elements["listName"].value = varName;		

		}
		
		function beforeSubmit(objFrm){
		objFrm.elements["event"].value = "onSubmit";
		return true;
		}

		function qualCourseSelection(objFrm, eventName, formName) {
			objFrm.elements["eventName"].value = eventName;
			var selection;
			if(objFrm.type[0].checked){
				selection = 'Course';
			} else if (objFrm.type[1].checked) {
				selection = 'Qualification';
			}
			if(objFrm.elements["typeName"].value == 'Course' && !objFrm.type[0].checked) {
				objFrm.elements["typeName"].value = 'Qualification';
				
				if(formName == 'AddModify'){
					qualType(objFrm);
				}
				
				objFrm.submit();
			}
			else if(objFrm.elements["typeName"].value == 'Qualification' && !objFrm.type[1].checked) {
				objFrm.elements["typeName"].value = 'Course';
				
				if(formName == 'AddModify'){
					courseType(objFrm);	
				}
				
				objFrm.submit();		
			}
		}

		function facultyStandardSelection (ObjForm, action) {

			ObjForm.elements["_action"].value = action; 
			if (action != "delete" ) 
			{
			ObjForm.submit();
			}
			if (action == "delete") 
			{
			  var count = checkBoxesCheckedState(ObjForm);
			  if (count == true) 
			  {
			  /* Modify-Begin: Defect Nbr 2, Date 05-AUG-05  */
			  	var flag = confirm('Are you sure you want to delete Standard Course Credit Decision(s)?');
              /* Modify-End: Defect Nbr 2, Date 05-AUG-05   */
			  	if (flag) {
			  		ObjForm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     ObjForm.submit();
			     return;
		      }
		   }
		
		
		}

		function courseType(objFrm){
				objFrm.elements["previousStudyVO.countryCD"].value = "-1";
				objFrm.elements["previousStudyVO.instituteID"].value = "-1";
				if(objFrm.elements["previousStudyVO.facultyCD"].type == 'select-one'){
					objFrm.elements["previousStudyVO.facultyCD"].value = "-1";
				}
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";		
		}
		function qualType(objFrm){
				objFrm.elements["previousStudyVO.countryCD"].value = "-1";
				objFrm.elements["previousStudyVO.instituteID"].value = "-1";
				
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";	
		}
		function onCountryChange(objFrm){
		
				objFrm.elements["previousStudyVO.instituteID"].value = "-1";
				
				if(objFrm.elements["typeName"].value == 'Qualification'){
					objFrm.elements["previousStudyVO.qualCD"].value = "-1";
				}
				else{
					objFrm.elements["previousStudyVO.courseCD"].value = "-1";
				}
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";		
		}
		
		function onInstituteChange(objFrm){
		
				if(objFrm.elements["typeName"].value == 'Qualification'){				
					objFrm.elements["previousStudyVO.qualCD"].value = "-1";
				}
				else{
					objFrm.elements["previousStudyVO.courseCD"].value = "-1";
				}
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";		
		}
		
		function onCourseChange(objFrm){
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";		
		}
		
		function onQualChange(objFrm){
				objFrm.elements["previousStudyVO.mactID"].value = "-1";
				objFrm.elements["previousStudyVO.statusCD"].value = "PN";		
		}
		
		function isAdmDataChanged(objFrm,eventName){
			objFrm.elements["changed"].value = true;
			if(eventName != 'TextField'){
				admInqrOnchange(objFrm, eventName);	
			}
		}
		function admInqrOnchange(objFrm, eventName) {
			objFrm.elements["eventName"].value = eventName;
			if(eventName == 'country'){
				onCountryChange(objFrm);
			}
			
			if(eventName == 'institute'){
				onInstituteChange(objFrm);
			}
			
			if(eventName == 'adm-inqr-qual'){
				onQualChange(objFrm);
			}
			
			if(eventName == 'adm-inqr-course'){
				onCourseChange(objFrm);
				return;
			}
			
			if(eventName == 'course' || eventName == 'status' || eventName == 'faculty' || eventName == 'amact' ){
				return;
			}
			else if(eventName == 'Delete'){
					var count = checkBoxesCheckedState(objFrm);
					if(count == true){
						var dec = confirm("Are you sure you want to delete Previous Study Record(s)");
						if(dec != true){
							return;
						}
					}
			}
			
			objFrm.submit();
		}
		
		function admInqrOnchangeInquiry(objFrm, eventName) {
		
			objFrm.elements["eventName"].value = eventName;
			
			if(eventName == 'course' || eventName == 'status' || eventName == 'faculty' || eventName == 'amact' ){
				return;
			}
			else if(eventName == 'Delete'){
					var count = checkBoxesCheckedState(objFrm);
					if(count == true){
						var dec = confirm("Are you sure you want to delete Previous Study Record(s)");
						if(dec != true){
							return;
						}
					}
			}
			objFrm.submit();
		}
	
		function checkBoxesPrevStudy(objFrm, obj){
			if(objFrm.elements["checkAll"].checked){
				objFrm.elements["checkAll"].checked = false;
				
			}
			if(objFrm.elements[obj].checked == true) {
				objFrm.elements[obj].value = 'true';
				objFrm.elements[obj].value = 'true';
			} else  {
			objFrm.elements[obj].value='false';
			objFrm.elements[obj].value = 'false';
			}
		}
		//added by kbtawari
		
		function selectAllPreReqCourse(objFrm){
			// alert('hi');
			var flag = objFrm.elements["all"].checked;
			var count = objFrm.elements['chkBoxCounter'].value;
			for (i = 0; i <= count; i++) {
				if(flag == true) {
					document.getElementById('courseInfo'+i).checked = true;
				}
				else {
					document.getElementById('courseInfo'+i).checked = false;
				}
			}	
		}

		function submitForm(objFrm)
		{
			var objMode = objFrm.elements['preInqVO.modecd'];
		//	alert('--'+objMode.options[objMode.selectedIndex].text);
		//	alert('List value '+ objMode.value);
			objFrm.elements['preInqVO.modename'].value = objMode.options[objMode.selectedIndex].text;
			objFrm.elements['preInqVO.mode'].value = objMode.value;
			objFrm.elements["event"].value="onSubmit";
			return true;
		}
		
		function submitMactForm(objFrm, naction)
		{

			if(naction == 'DELETE'){
				var checkBoxCnt = mactCheckBoxCount(objFrm);
				if(checkBoxCnt > 0){
					var flag = deleteAlert('Are you sure you want to delete Monash Admission Course Type(s)?');
					if(!flag) {
					return false;
					}
				}
			}
			objFrm.elements["action"].value= naction;		
			objFrm.submit();
			return true;
		}
		
		function mactCheckBoxCount(objFrm) 
		{
			var count = 0;
			var chkBoxCounter = objFrm.elements["counterCheck"].value;
			//alert(objFrm.elements["chkBoxCounter"].value);
			for (var i = 0; i < chkBoxCounter; i++)
			 {
				var chkBoxId = 'inputCheckBox['+i+']' ;
//				alert('>> '+chkBoxId);
				if(document.getElementById(chkBoxId)){
				var chkBox = document.getElementById(chkBoxId);
	//			alert('<<'+chkBox.checked);
				if (chkBox.checked == true) 
				{
					count = count + 1 ;
				}
				}
			}
			//alert(count);
			return count;
		}
		
		
		function submitPreInqResultForm(objform,buttonpressed)
		{
			objform.elements["event"].value =buttonpressed.value;
			//alert(objform.elements["event"].value);
			if(buttonpressed.value == "Delete") 
			{
				var checkedCount = PreReqResultSelectedCheckBoxCount(objform);
			//	alert('in if');
			//	alert(checkedCount);
				
				if(checkedCount > 0 )
				 {
					var flag = deleteAlert('Are you sure you want to delete PreRequisite(s)?');
					if(flag) 
					{
						objform.elements["event"].value =buttonpressed.value;
						objform.submit();
					}
					
				}
				else
				{
					objform.submit();
				}
			} 
			else
			{
				//alert('hi in else');
				objform.submit();
			}
			
		}
		function submitPreRequisitesDetailForm(objFrm,buttonpressed)
		{
			//alert('hi');
			objFrm.elements["event"].value =buttonpressed.value
			//alert(objFrm.elements["event"].value);
			objFrm.submit();
		}
		
		function PreReqResultSelectedCheckBoxCount(objFrm) 
		{
			var count = 0;
			var chkBoxCounter = objFrm.elements["chkBoxCounter"].value;
			//alert(objFrm.elements["chkBoxCounter"].value);
			for (var i = 0; i < chkBoxCounter; i++)
			 {
				var chkBoxId = 'resultValue' + i;
				if(document.getElementById(chkBoxId)){
			//	alert(chkBoxId);
				var chkBox = document.getElementById(chkBoxId);
				if (chkBox.checked == true) 
				{
					count = count + 1 ;
				}
				}
			}
		//	alert(count);
			return count;
		}
		
		function selectAllPreReqCourseResult(objFrm){
		    //alert('hi');
		    //alert(objFrm.elements['chkBoxCounter'].value);
			var flag = objFrm.elements["checkAll"].checked;
			//alert(flag);
			var count = objFrm.elements['chkBoxCounter'].value;
			for (i = 0; i < count; i++) {
			if(document.getElementById('resultValue'+i)!=null)
				 {
				if(flag == true) {
				     document.getElementById('resultValue'+i).checked = true;
					
				}
				else {
					document.getElementById('resultValue'+i).checked = false;
				}
			}
			}	
		}
		
		function deselectAllPreReqResult(objform)
		{
		
			document.getElementById('abc').checked = false
			
		}
		
		//end by kbtawari
		
		
		function onPreReqAddSubmit(objFrm) {
		
			objFrm.submit();
		}
		
		// Begin: added by raenagan for entry req stmt
		function onEntryReqStmtAddSubmit(objFrm) {
		
			objFrm.submit();
		}

		function onEntryReqStmtHistorySubmit(objFrm, buttonpressed) {
		
			objFrm.elements["event"].value = buttonpressed.value;
			objFrm.submit();
		}
		// End: added by raenagan for entry req stmt
		
		// Begin: added by raenagan for english requirements
		function onEngRequirementsSubmit(objFrm) {
		
			objFrm.submit();
		}		
		function onEngRequirementsSubmit(objFrm, buttonpressed){

			if(buttonpressed.value == 'Save'){
				objFrm.elements["event"].value = 'Modify';
			}
			else if(buttonpressed.value == 'Save '){
				objFrm.elements["event"].value = 'Create New Version';
			}
			else{
				objFrm.elements["event"].value = buttonpressed.value;
			}

			objFrm.submit();
		}

		function selectAllEngReqResult(objFrm){
		    //alert('hi eng req');
		    //alert(objFrm.elements['chkBoxCounter'].value);
			var flag = objFrm.elements["checkAll"].checked;
			//alert(flag);
			var count = objFrm.elements['chkBoxCounter'].value;
			for (i = 0; i < count; i++) {
				if(document.getElementById('engRequirementsVOList['+i+']')!=null){
					if(flag == true) {
						 document.getElementById('engRequirementsVOList['+i+']').checked = true;						
					}
					else {
						document.getElementById('engRequirementsVOList['+i+']').checked = false;
					}
				}
			}	
		}

		function deselectAllEngReqResult(objform)
		{
			//alert('deselect eng req');
			document.getElementById('abc').checked = false;
			
		}
		// End: added by raenagan for english requirements
		
		function uirChangeStatus(obj){
			document.userInquiryResultForm.elements[obj].value = 'true';
		}
		
		function changeStatus(objElement){
			objElement.value = 'true';
		}
		
		
		function checkBoxes(objFrm, obj){
			
			if(objFrm.elements[obj+'-chk'].checked) {
				objFrm.elements[obj+'-chk'].value='true';
				objFrm.elements[obj].value='true';
			} else  {
			objFrm.elements[obj+'-chk'].value='false';
			objFrm.elements[obj].value = 'false';
			}

		}
		
		function checkBoxes1(objFrm, obj){
			
			if(objFrm.elements[obj].checked) {
				objFrm.elements[obj].value='true';
			} else  {
			objFrm.elements[obj].value = 'false';
			}

		}
		
		
		
		function addUnderGradBackSubmit(objFrm) {
			objFrm.elements["event"].value = "Back";
			document.addUnderGradQualificationForm.submit();
		}				

		function getPreviousInstitutes(country) {
		    document.location.href = 'guideline3?country='+country+"&qualifictaionId=-1";
		}		
		
		function getSubjectEquivalance(qualification,country){
		    document.location.href = 'guideline3?country='+country+"&qualifictaionId="+qualification;
		}
		
		
		function gpaResult(objFrm, eventName){
		
			objFrm.elements["event"].value = eventName;
			
			if (eventName == "Add" || eventName == "Modify" || eventName == "ShowHistory" || eventName == "View" || eventName == "Copy" ) {
				objFrm.submit();
				return;
			}
			if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			 // 	var flag = confirm('Are you sure you want to delete GPA Country Assessment(s)?');
			 var flag = confirm('By deleting this record, one or more admission period(s) will not have a valid decision. Do you wish to continue with the deletion? Y/N');
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {			     
			     objFrm.submit();
			     return;
		      }
		   }
		}
				
	function keepFocus(field, objfrm){
	objfrm.elements[field.value].focus();
	}
	
	function storeField(fieldName, source){
	source.value = fieldName;
	}


	
	function clickNormal(objfrm){
      objfrm.elements["event"].value = "onChange";
      objfrm.elements["subEvent"].value = "options";
      objfrm.elements["checkForModify"].value = "1";
      objfrm.submit();
	}
	
	function clickOptions(objfrm){
  	  objfrm.elements["event"].value = "onChange";
  	  objfrm.elements["subEvent"].value = "options";
  	  objfrm.elements["checkForModify"].value = "1";
	  objfrm.submit();
	}
	
	function checkForModify(objfrm){
	   objfrm.elements["checkForModify"].value = "1";		
	}
	
	function clickSave(objfrm){
	objfrm.elements["event"].value="Save";
	objfrm.submit();
	}
	
	function clickConfirm(objfrm){
	objfrm.elements["event"].value ="Confirm";
	objfrm.submit();
	}
	function clickBack(objfrm){
	objfrm.elements["event"].value ="Back";
	objfrm.submit();
	}
	
	function clickUnitCode(objfrm){
   	  objfrm.elements["event"].value = "onChange";
   	  objfrm.elements["subEvent"].value = "ucd";
   	  objfrm.elements["checkForModify"].value = "1";
   	  objfrm.submit();

	}
	function test(objfrm) {
		var list = objfrm.elements["addCourseMapVO.unitIdcd"];
   	  	for(i =0; i < list.options.length; i++) {
   	  		if(list.options[i].selected) {
   	  			list.focus();
   	  		}	
   	  	}	  
	}
	function clickUnitCode1(objfrm){
   	  objfrm.elements["event"].value = "onChange";
   	  objfrm.elements["subEvent"].value = "ucd1";
   	  objfrm.elements["checkForModify"].value = "1";
	  objfrm.submit();
	}
	
	function clickUnitLevel(objfrm){
   	  objfrm.elements["event"].value = "onChange";
   	  objfrm.elements["subEvent"].value = "ul";
   	  objfrm.elements["checkForModify"].value = "1";
	  objfrm.submit();
	  
	}
	function clickOrgUnit(objfrm){
  	  objfrm.elements["event"].value = "onChange";
  	  objfrm.elements["subEvent"].value = "org";
  	  objfrm.elements["checkForModify"].value = "1";
      objfrm.submit();
	}
	
	function checkForModifyYes(objfrm){
	    objfrm.elements["checkForModify"].value = "1";
    }
    
    function checkForModifyNo(objfrm){
	    objfrm.elements["checkForModify"].value = "1";
    }
    
    function changeReportRange(objfrm){
     	objfrm.elements["event"].value = "onChange";
     	objfrm.submit();
    }
    
    function clickSystemUsageInquiry(objfrm){
    	objfrm.elements["event"].value = "Inquiry";
    	objfrm.submit();
    }

	
	function rptInqrOnchange(objFrm, eventName) {
			objFrm.elements["eventName"].value = eventName;
			if (eventName == "monashcourse"){
				if(document.getElementById("monashCourseCode").value != ""){
					document.getElementById("monashFaculty").value = "-1";
					document.getElementById("monashCourseName").value = "-1";
					document.getElementById("monashFaculty").disabled = true;
					document.getElementById("monashCourseName").disabled= true;
				}
				else{
					document.getElementById("monashFaculty").disabled = false;
					document.getElementById("monashCourseName").disabled= false;
				}
				objFrm.submit();
				return;
			}
			
			if (eventName == "faculty"){
				if(document.getElementById("monashFaculty").value != "-1"){
					document.getElementById("monashCourseCode").value = "";
					document.getElementById("monashCourseCode").disabled = true;
					objFrm.elements['monashInquiryVO.monashCourseCode'].value = "";
				}
				else{
					document.getElementById("monashCourseCode").disabled =false;
					document.getElementById("monashCourseName").value="-1";
				}
			}
			objFrm.submit();
		}

						
		function onDisclaimerSubmit(objFrm, opr){
			objFrm.elements["operation"].value = opr;
			if(objFrm.elements["international"].checked == false && objFrm.elements["national"].checked == false){
				objFrm.elements["operation"].value = "";
			}
    		objFrm.submit();
		}
		
		
		function loading(objFrm){
         alert("Lawrence");		
		}
		 
		function sendNotification(objFrm) {
			
			if (objFrm.elements["event"].value == "Add") {
				objFrm.elements["event"].value="AddSend";
			} else if (objFrm.elements["event"].value == "Update") {
				objFrm.elements["event"].value="UpdateSend";
			}
			objFrm.submit();
		}

		function reviewDocument(objFrm) {
		objFrm.elements["docEvent"].value= "doc";
		objFrm.submit();
		}
		
		function admPrevStudyBack(objFrm) {
			objFrm.action = 'prevStudyInquiryResult?Back=true';
			objFrm.submit();
		}
		
		function admPrevStudyResultBack(objFrm) {
			objFrm.action = 'admissions-inquiry';
			objFrm.submit();
		}
		
		function refPrevStudyCountryChange(objform){
			var objMode = objform.elements['prevStudySearchVO.prevStudyType'];
			var objInstitute = objform.elements['prevStudySearchVO.instituteID'];
			objform.prevStudyTypeEvent.value = objMode.options[objMode.selectedIndex].text;
			//objform.prevStudyTypeEvent.value = document.getElementById("prevStudySearchVO.prevStudyType").value;
			if(objInstitute.options[objInstitute.selectedIndex].value == "-1")
			{
				objform.event.value = 'beforeInstitute';
			}
			else
			{
				objform.event.value = 'afterInstitute';
			}	
            objform.elements['prevStudySearchVO.instituteID'].value = "-1";
			objform.submit();
		}
		
		function changePrevStudyType(objform){
		    objform.prevStudyTypeEvent.value = "TypeChange";
			objform.submit();
		}
		
		
		function refPrevStudyInstituteChange(objform,item){
			var objMode = objform.elements['prevStudySearchVO.prevStudyType'];
			objform.prevStudyTypeEvent.value = objMode.options[objMode.selectedIndex].text;
			//objform.prevStudyTypeEvent.value = document.getElementById("prevStudySearchVO.prevStudyType").value;
			objform.event.value = 'afterInstitute';
			objform.submit();
		}
		function submitSearchForm(objform){
			var objMode = objform.elements['prevStudySearchVO.prevStudyType'];
			objform.prevStudyTypeEvent.value = objMode.options[objMode.selectedIndex].text;
			//objform.prevStudyTypeEvent.value = document.getElementById("prevStudySearchVO.prevStudyType").value;
			objform.event.value = 'Inquire';
			objform.submit();
		}

	function admFacultRuleSubmit(objFrm, eventName) {
			objFrm.elements["event"].value = eventName;
			if (eventName == "Add" || eventName == "Modify" || eventName == "View") {
				objFrm.submit();
				return;
			}
			if (eventName == "Delete") 
			{
			  var count = checkBoxesCheckedState(objFrm);
			  if (count == true) 
			  {
			  /* Modify-Begin: Defect Nbr 2, Date 05-AUG-05  */
			  	var flag = confirm('Are you sure you want to delete Faculty Rule(s)?');
              /* Modify-End: Defect Nbr 2, Date 05-AUG-05   */
			  	if (flag) {
			  		objFrm.submit();
			  		return;
			  	}
			  }
		      else 
		      {
			     objFrm.submit();
			     return;
		      }
		   }
		}
		
		function prevStudyReportPrint(objFrm, event){
		        window.open('./prevstudy-report-result-print-view');
		        objFrm.elements["eventName"].value = event;
		        objFrm.submit();
		}
		
		function admPrevStudyRptResultBack(objFrm) {
			objFrm.action = 'prevstudy-report-inquiry';
			objFrm.submit();
		}		
		
		function disableButtons(){
			/*var obj = document.forms[0].elements["all"];
			for (i=0; i < document.forms[0].elements.length;i++) {					
				if(document.forms[0].elements[i].type == "button") {
					document.forms[0].elements[i].disabled = true;
				}
			}*/
			disableButton = 'true';
		}
		
		function enableButtons(){
			disableButton = 'false';
			/*var obj = document.forms[0].elements["all"];
			for (i=0; i < document.forms[0].elements.length;i++) {					
				if(document.forms[0].elements[i].type == "button") {
					document.forms[0].elements[i].disabled = false;
				}
			}*/			
		}
		
		function displaySelected(){
			//if(document.forms[0].elements){
				for (i=0; i < document.forms[0].elements.length;i++) {					
					if(document.forms[0].elements[i].type == "select-multiple") {			
						for(k=(document.forms[0].elements[i].length-1); k>=0; k--){
							if(document.forms[0].elements[i].options[k].selected == true){
								document.forms[0].elements[i].options[k].selected=true;
							}
						}
					}
				}
			//}	
		}
	/* Modify-Begin Defect Nbr - 139, 20-Aug-05 */	
		function displaySelected1(){
			//if(document.forms[1].elements){
				for (i=0; i < document.forms[1].elements.length;i++) {					
					if(document.forms[1].elements[i].type == "select-multiple") {			
						for(k=(document.forms[1].elements[i].length-1); k>=0; k--){
							if(document.forms[1].elements[i].options[k].selected == true){
								document.forms[1].elements[i].options[k].selected=true;
							}
						}
					}
				}
			//}	
		}
	/* Modify-End Defect Nbr - 139, 20-Aug-05 */		
		function caaExitSubmit(objFrm) {
			objFrm.elements["event"].value = '_finish';
			objFrm.submit();
		}
		
		function prevInstituteEventHandler(objFrm,event,auth){
			 objFrm.eventName.value = event;
			
			 if(auth == 'UNIT' ){
			    objFrm.elements["prevUnitInfoVO.unitCode"].value=objFrm.elements["uCode"].value;
			 }
			 else if(event == 'Delete' && auth != 'F'){
					var count = checkBoxesCheckedState(objFrm);
					if(count == true){
						var dec = confirm("Are you sure you want to delete Previous Study Record(s)");
						if(dec != true){
							return;
						}
					}
			 }
			
		     objFrm.submit();
		}
		
	    function admPrevStudyBack(objFrm) {
			objFrm.action = 'prevStudyInquiryResult?Back=true';
			objFrm.submit();
		}
		
		function onCheckDueReAssessment(objFrm){
			var obj=objFrm.elements["decSearchVO.dueForReview"];
			if(obj.checked == true){
				objFrm.elements["decSearchVO.dueForReview"].value=true;
			}else{
				objFrm.elements["decSearchVO.dueForReview"].value=false;
			}			
			objFrm.elements["event"].value = "clearStatus";
			objFrm.submit();
		}
		
		function onBackDecisionDocument(objFrm, operation){
			if(operation==null || operation==""){
				objFrm.action = 'inquiryResult?back=true';
	    		objFrm.submit();
			}else{
				objFrm.elements["event"].value = operation;
	    		objFrm.submit();
	    	}	
		}
		
		function showPreviousPage(objFrm) {
			var operation = objFrm.elements["event"].value;
			if(operation==null || operation==""){
				objFrm.action = 'inquiryResult';
			}
			objFrm.submit();
		}
		
		function checkBoxClick(objFrm,obj,name){
		
		   if(name=='1'){
		   		
		   		if(obj.checked){
		   		   
		   			objFrm.elements["prevUnitInfoVO.advanceStanding"].value='Y'
		   		}
		   		else{
		   		/* Modify-Begin: Defect Nbr 12, Date: 05 Aug 05  */
		   			objFrm.elements["prevUnitInfoVO.advanceStanding"].value='N'
		   	    /* Modify-End: Defect Nbr 12, Date: 05 Aug 05  */		
		   		}
		   }
		   
		   else if(name=='2'){
		       
		   		if(obj.checked){
		   	
		   			objFrm.elements["prevUnitInfoVO.unitEquiv"].value='Y'
		   		}
		   		else{
		   			objFrm.elements["prevUnitInfoVO.unitEquiv"].value='N'
		   		}
		   }
		}
		
		
		
	   function callForUnitCode(objfrm){
		   var decision = confirm("Some of the Units in the 'FROM' Course might not belong to the campus of the 'TO' Course. Do you still want to proceed with the COPY?");
		   if(decision == true){
		   objfrm.submit();
		   }
		}
		
		
		function submitInquirycm(objfrm){
		 objfrm.elements["event"].value = "Inquire";
		 objfrm.submit();
		}
		
		function admMulEntryContinue(objfrm){
		 objfrm.submit();
		} 
		 
		
		function clearRegistrationForm(){
		   for(i=0; i<document.registerStudentForm.elements.length; i++){
			   if(document.registerStudentForm.elements[i].type == "text" ||
			   		document.registerStudentForm.elements[i].type == "password"){
			   		document.registerStudentForm.elements[i].value= "";
			   }else if(document.registerStudentForm.elements[i].type == "select-one"){
			   		document.registerStudentForm.elements[i].options[0].selected = true;
			   }else if(document.registerStudentForm.elements[i].type == "radio"){
			   		document.registerStudentForm.elements["registerStudentVO.emailFormat"][0].checked = true;
			   }
		   }
		}
		
		
	function fun(addCourseMapForm)
	{
		if(addCourseMapForm.elements["addCourseMapVO.selection"].value == 'ucd') {
			addCourseMapForm.elements["addCourseMapVO.unitIdcd"].focus();
		}
		
		if(addCourseMapForm.elements["addCourseMapVO.selection"].value == 'ucd1') {
			addCourseMapForm.elements["addCourseMapVO.unitIdcd1"].focus();
		}
		
		if(addCourseMapForm.elements["addCourseMapVO.selection"].value == 'ul') {
			addCourseMapForm.elements["addCourseMapVO.unitLevel"].focus();
		}
		if(addCourseMapForm.elements["addCourseMapVO.selection"].value == 'org') {
			addCourseMapForm.elements["addCourseMapVO.orgUnit"].focus();
		}
	}
	
/* Modify-Begin: Defect Nbr 95 & 96, Date 18-AUG-05  */	
	function getMultiple(objFrm,ob)
    {
     // alert(objFrm[ob].options.length);
     if (objFrm[ob].selectedIndex == -1){
        objFrm[ob].options[0].selected=true;
      }
      for(i=1;i<objFrm[ob].options.length-1;i++){
        if(objFrm[ob].options[i].selected==true){
          objFrm[ob].options[0].selected=false;
        }
      }
     
    }
/* Modify-End: Defect Nbr 95 & 96, Date 18-AUG-05  */    
/* Modify-Begin: Defect Nbr 147, Date 24-AUG-05  */ 		
    function PrintParts()
      {
	    if(document.layers)	   //NN4+
	    {
	       document.layers['element2'].visibility = "hid";
	       window.print();
	       document.layers['element2'].visibility = "show";
	    }
	    else if(document.getElementById)	  //gecko(NN6) + IE 5+
	    {
	      var obj = document.getElementById('element2');
	      obj.style.visibility = "hidden";
	      window.print();
	       //obj.style.visibility= "visible";
	    }
	    else if(document.all)	// IE 4
	    {
	        document.all['element2'].style.visibility = "hidden";
	        window.print();
	        document.all['element2'].style.visibility = "visible";
	    }
	} 
/* Modify-End: Defect Nbr 147, Date 24-AUG-05  */ 		

function chkChange(chk) {
	document.pstudyfrm["event"].value = 'onChange';
	
	if (chk.checked == false) {
	   document.pstudyfrm["previousStudyMap.startFlag"].value=false;
	   chk.checked=true;
	}
	document.pstudyfrm.submit();
}		
/* Modify-Begin: Defect Nbr 288 , 22 Sep 05 */
function exitAdviser(){
		window.close();
}
/* Modify-End: Defect Nbr 288 , 22 Sep 05 */


/* Modify-Begin: Defect Nbr 325 , 24 Oct 05 */
function onTypeOfYr12(form,event)
{
  form.elements["event"].value=event
  form.submit();
}

/* Modify-End: Defect Nbr 288 , 24 Oct 05 */

function onRptInquirySubmit(objFrm, operation)
	{		
		objFrm.elements["eventName"].value = operation;
		objFrm.submit();
	}
function admRptResultSubmit(objFrm, operation)
	{		
		objFrm.elements["eventName"].value = operation;
		objFrm.submit();
	}	
function admRptConinue(objFrm, operation)
	{		
		objFrm.elements["eventName"].value = operation;
		objFrm.submit();
	}		
	
		function CAdmissionRptSelAll() {
		 
			if (document.advStandDecisionChoiceForm.chkBoxCounter) {
				var chkBoxCounter = document.advStandDecisionChoiceForm.chkBoxCounter.value;
				var isSel = false;
				var isAllSel = false;
				
				for (var i = 0; i <= chkBoxCounter; i++) {
					var chkBoxId = 'U2UCHKBOX' + i;
					var chkBox = document.getElementById(chkBoxId);
		            if (chkBox && chkBox.checked == true) {
						//chkBox.checked = false;
						isSel = true;
						isAllSel = true;
					}
					if (chkBox && chkBox.checked == false) {
						//chkBox.checked = true;
						isAllSel = false;
					}
				}
				//alert('isAllSel ' + isAllSel);
				//alert('isSel ' + isSel);
				
				if (document.advStandDecisionChoiceForm.checkAll.checked == false) {
					for (var i = 0; i <= chkBoxCounter; i++) {
						var chkBoxId = 'U2UCHKBOX' + i;
						var chkBox = document.getElementById(chkBoxId);
						
						if (chkBox) {
							chkBox.checked = false;
						}
					}
				}
				else if (document.advStandDecisionChoiceForm.checkAll.checked==true) {
					for (var i = 0; i <= chkBoxCounter; i++) {
						var chkBoxId = 'U2UCHKBOX' + i;
						var chkBox = document.getElementById(chkBoxId);
						
						if (chkBox) {
							chkBox.checked = true;
						}
					}
				}
			}
		}
		

		function setCheckAllState1(form, elem) {
			if(elem.checked != true) {
				form.checkAll.checked = false;
			}
		}
	
	
		function printAdmEntRepMail(){
			var header = document.all['header'].innerHTML;
			document.all['header'].style.visibility = "hidden";
			document.all['header'].innerHTML = null;
			document.all['backButton'].style.visibility = "hidden";
			document.all['printButton'].style.visibility = "hidden";
			window.print();
			document.all['header'].innerHTML = header;
			document.all['header'].style.visibility = "visible";
			document.all['backButton'].style.visibility = "visible";
			document.all['printButton'].style.visibility = "visible";
		}
	
			function cmOnBlurCourseCodeHouseKeeping(objFrm,varName){
				objFrm.elements["event"].value = "onChange";
				objFrm.elements["subEvent"].value = varName;
				objFrm.submit();			
			}
	
			function hkMonashCourseDelete(objFrm){
				var checkBoxArr = getSelectedCheckbox(objFrm.elements["chkCourse"]);				
				if(checkBoxArr != ""){
					objFrm.elements["selectedIndex"].value=checkBoxArr;
					var isDelete = confirm("Are you sure you want to Delete the selected decision?")
				}else if(document.getElementById("chkCourse[0]").checked){
					objFrm.elements["selectedIndex"].value=0;
					var isDelete = confirm("Are you sure you want to Delete the selected decision?")
				}else{
					var isDelete = true;				
				}

				if(isDelete){
					document.all['deleteButton'].style.visibility = "hidden";
					document.all['processingText'].style.visibility = "visible";
					objFrm.elements["event"].value = "Delete";
				}

				objFrm.submit();
			}
	
			function getSelectedCheckbox(buttonGroup) {
			   // Go through all the check boxes. return an array of all the ones
			   // that are selected (their position numbers). if no boxes were checked,
			   // returned array will be empty (length will be zero)
			   var retArr = new Array();
			   var lastElement = 0;
			   for (var i=0; i<buttonGroup.length; i++) {
		         if (buttonGroup[i].checked) {
		            retArr.length = lastElement;
		            retArr[lastElement] = i;
		            lastElement++;
		         }
			   }
			   return retArr;
			} // Ends the "getSelectedCheckbox" function
	
			function housekeepingMonashCourseSelAll(objFrm){
				var chkBoxAll = document.getElementById('checkAllMonashCourse');
				var buttonGroup = objFrm.elements["chkCourse"];
				if(buttonGroup && buttonGroup.length != null){
					for (var i=0; i<buttonGroup.length; i++) {
						var chkBoxId = 'chkCourse[' + i + ']';
						var chkBox = document.getElementById(chkBoxId);
						if (chkBox && chkBoxAll.checked == true) {
							chkBox.checked = true;
						}
						else if (chkBox && chkBoxAll.checked == false) {
							chkBox.checked = false;
						}
					}
				}else{
					var chkBox = document.getElementById("chkCourse[0]");
					if (chkBox && chkBoxAll.checked == true) {
						chkBox.checked = true;
					}
					else if (chkBox && chkBoxAll.checked == false) {
						chkBox.checked = false;
					}
				} 
			}
			

/**
 * Modify Begin
 * Date: 18th May 2006, SPAT-651
 * Function to check if the selected faculy is being changed,
 * the related further information is affected, so the user is
 * asked of question	
**/
function checkFaculty(objFrm, indx, facAbbr){
	if(facAbbr != "" && facAbbr != "-1"){
		var i = "infoList[" + indx + "].facultyFurtherInfo";
		var message = "The faculty specific further information for ";
		message = message + facAbbr + " will be deleted. Are you sure you wish to continue?";
		if((objFrm.elements[i].value) != ""){
			var Question = confirm(message);
			if(Question == false){
				i = "infoList[" + indx + "].facultyCode";
				objFrm.elements[i].value = facAbbr;
			}
		}
	}
}

function onCountryChangeAdmEntry(objFrm,operation)
{
	objFrm.elements["listEvent"].value = operation;
	objFrm.submit();
}

function checkSOR(objFrm, chk, courseType){
	if( chk.checked == false){

		var message = "The scores for " + courseType;
		message = message + " standard level will be deleted. Are you sure you wish to continue?";

		if(objFrm.elements["score"] != null && objFrm.elements["score"].length != null){
			var L = objFrm.elements["score"].length;
			for (i=0;i<L;i++) {			
				if(objFrm.elements["score"](i).value != ""){
					if(!confirm(message)){
						chk.checked = true;
						break;
					}else{
						var chkBoxName = chk.name.substring(0, chk.name.length-4);
						objFrm.elements[chkBoxName].value = false;
						onSubmitForm(gpaAddForm,'Display');
						break;
					}
				}
			}
		}else{

			if(objFrm.elements["score"] != null && objFrm.elements["score"].value != ""){
				if(!confirm(message)){
					chk.checked = true;
				}else{
					var chkBoxName = chk.name.substring(0, chk.name.length-4);
					objFrm.elements[chkBoxName].value = false;
					onSubmitForm(gpaAddForm,'Display');
				}
			}
		}
	}
}
		
function onSubmitForm(objFrm,operation)
{
	objFrm.elements["prevEvent"].value = objFrm.elements["event"].value;
	objFrm.elements["event"].value = operation;
	objFrm.submit();
}
// 704 change
function admPeriodPopup(start, source) 
{
var url = "./end-date-popup?start=" + start + "&source="+source;
//'./end-date-popup'
window.open(url, 'spapopup', 'width=350, height=400, resizable=yes, scrollbars=yes');
}

function muLevelFinalisePopup(){
	var msg = "There is already a decision at the Monash University level. Have you checked that your score is higher than MU level score ?";
	if(confirm(msg)){
	document.getElementById("overrideMURecord").value="Y";
	document.getElementById("btnSave").click();
	}else{
	document.getElementById("overrideMURecord").value="N";
	}
		
}

function AdmGapPopup(){
var msg = "The admission period entered will create 1 or more admission period(s) without a valid Decision. Do you wish to continue? Y/N";
	if(confirm(msg)){
		document.getElementById("allowGap").value="Y";
		document.getElementById("btnSave").click();
	}else{
		document.getElementById("allowGap").value="N";
	}
}

function admissionPeriodsGapPopup(){
	var msg = "The admission period entered will create 1 or more admission period(s) without a valid course map. Do you wish to continue? Y/N";
	if(confirm(msg)){
		//alert(document.forms[0].name);
		if(document.forms[0].name=='frmCourseMapRule'){
			document.getElementById("add").click();
		}
		else{
			document.forms[0].submit();
		}
	}
	else{
		//alert(document.getElementById("popUp"));
		//alert(document.getElementById("popUp").value);
		document.getElementById("popUp").value="N";
		document.getElementById("Submit5").click();	
	}
}

function admissionPeriodsGapPopupER(){
	var msg = "This admission entry decision contains 1 or more admission period(s) without a valid decision. Do you wish to continue? Y/N";
	if(confirm(msg)){
		//alert(document.forms[0].name);
		if(document.forms[0].name=='frmCourseMapRule'){
			document.getElementById("add").click();
		}
		else{
			document.forms[0].submit();
		}
	}
	else{
		document.getElementById("popUp").value="N";	//Cancelled
		//alert(document.getElementById("popUp").value);
		document.getElementById("Submit5").click();	
	}
}

/**
 * Modify End
 * Date: 18th May 2006, SPAT-651
 **/
function clickSaveMapRule(objfrm){
	objfrm.elements["event"].value = "Save";
	var startPeriod = objfrm.elements['courseMapRuleVO.startPeriod'][objfrm.elements['courseMapRuleVO.startPeriod'].selectedIndex].text;
	var endPeriod = objfrm.elements['courseMapRuleVO.endPeriod'][objfrm.elements['courseMapRuleVO.endPeriod'].selectedIndex].text;
	//alert("ping="+objfrm.elements['courseMapRuleVO.endPeriod'].value);

	objfrm.elements['courseMapRuleVO.startPeriodName'].value = startPeriod;	
	if(objfrm.elements['courseMapRuleVO.endPeriod'].value == "-1"){
		objfrm.elements['courseMapRuleVO.endPeriodName'].value = "";
	}
	else{
		objfrm.elements['courseMapRuleVO.endPeriodName'].value = endPeriod;
	}

	objfrm.submit();
}

function setAgentDisclaimerAcceptValue(objFrm, obj) {
	var acceptChkBox = objFrm.elements["agentDataVO.disclaimerAccept"];
	if (obj.name == acceptChkBox.name) {
		if (obj.checked) {
			acceptChkBox.value = "true";
		}else{
			acceptChkBox.value = "false";
		}
	}
}
// for agent portal menu

function toggleMenu(objID,url) {
// for test and prod
//url='#';

	if (!document.getElementById) return;
	var ob = document.getElementById(objID).style;
	ob.display = (ob.display == 'block')?'none': 'block';
	if (ob.display == 'block'){
		document.getElementById('main-menu').innerHTML='-&nbsp;&nbsp;<a href='+url+'>In2Monash Reports</a>';
	}else{
		document.getElementById('main-menu').innerHTML='+&nbsp;<a href='+url+'>In2Monash Reports</a>';
	}
}
function submitAgentLogin(form){
	//alert("Opening new window");
	window.close();
	window.open('./preRequisitesPrint','myWin','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=550, height=500'); 
	
}

function openAgentWindow(){
  url = "./agent-disclaimer";                //Set address of new window
  var height = 600;                       //Set height
  var width = 800;                        //Set width
  var name = "Popup";             //Set window name
  var top = 20;                            //Set distance from top
  var left = 20;                            //Set distance from bottom
  newwin=window.open(url, name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=1000, height=800");
//   newwin=window.open(url, name, "fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=no,location=yes,width=1000, height=800");
  // Cannot perform across all browsers
  this.focus();
  self.opener = this;
  self.close();
}
function switchMenu(obj) {

	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function ChangeRowVisibility(strVisibility, intRowIndex)
{
if(navigator.product == "Gecko" && navigator.productSub && navigator.productSub > "20041010" && (navigator.userAgent.indexOf("rv:1.8") != -1 || navigator.userAgent.indexOf("rv:1.9") != -1))
{
document.getElementById("idtable").rows[intRowIndex].style.visibility = strVisibility;
}
else if(strVisibility == "visible")
	{
	if(document.all && document.compatMode && document.compatMode == "CSS1Compat" && !window.opera)
		{
		document.getElementById("idtable").rows[intRowIndex].style.display = "block";
		}
	else if(document.getElementById && document.getElementById("idtable").rows)
		{
		document.getElementById("idtable").rows[intRowIndex].style.display = "table-row";
		};
	}
else if(strVisibility == "collapse")
	{
	document.getElementById("idtable").rows[intRowIndex].style.display = "none";
	};
}
function toggle(id,str,idx){
	var t;
	var s;
	if (str=='collapse'){
		s="visible";
	}else{
		s="collapse";
	}
	if (id=='primary-study'){
		t='<a onclick="javascript:toggle(\''+id+'\',\''+s+'\',1);">++ Additional Study(Optional)</a>';

	}else if (id=''){
	
	}else {

	}
//	alert(t);	

	document.getElementById(id).innerHTML=t;
	ChangeRowVisibility(str, idx);
}

function formSubmit(frm,action){
	frm.elements["eventName"].value = action;
	frm.submit();
}
