﻿// JScript File
//Ajax call to the web service
            function getSchools()
            {
                KaplanSchool.GetSchools(getSchoolSuccess);
                KaplanSchool.GetMillitaryQuestions(GetMillitarySuccess);
                KaplanSchool.GetMillitaryQuestionAnswers(GetMillitaryAnswerSuccess);
                KaplanSchool.GetMillitaryQuestionslist(GetMillitaryQuestionsSuccess);
                KaplanSchool.GetTrackDispalyInfo(GetTrackDisplaySuccess);
                KaplanSchool.GetTrackQuestionAnswers(GetTrackAnswerSuccess);
                KaplanSchool.GetTrackQuestionslist(GetTrackQuestionsSuccess);
                KaplanSchool.GetTrackMCPDDispalyInfo(GetTrackMCPDDisplaySuccess);
                KaplanSchool.GetTrackMCPDQuestionAnswers(GetTrackMCPDAnswerSuccess);
                KaplanSchool.GetTrackMCPDQuestionslist(GetTrackMCPDQuestionsSuccess);
                //document.getElementById("Kaplan_IndexSIF1_ddlTimeEmployed").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlEmpStatus").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlTransferCredits").style.display = "none";
                document.getElementById("Kaplan_IndexSIF1_ddlMilitary2").style.display = "none";

            } 
            
            function getAnClnSchools() {
                KaplanSchool.GetAnClnSchools(getSchoolSuccess);
                document.getElementById("Kaplan_SIF1_ddlMilitary2").style.display = "none";                
            }
             function getClnSchools()
            {
                KaplanSchool.GetClnSchools(getSchoolSuccess);
                //document.getElementById("Kaplan_IndexSIF1_ddlTimeEmployed").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlEmpStatus").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlTransferCredits").style.display = "none";
                document.getElementById("Kaplan_IndexSIF1_ddlMilitary2").style.display = "none";
            }
             function getCaClnSchools()
            {
                KaplanSchool.GetCAClnSchools(getSchoolSuccess);
                //document.getElementById("Kaplan_IndexSIF1_ddlTimeEmployed").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlEmpStatus").style.display = "none";
                //document.getElementById("Kaplan_IndexSIF1_ddlTransferCredits").style.display = "none";
                document.getElementById("Kaplan_IndexSIF1_ddlMilitary2").style.display = "none";
            }
             function getIntClnSchools()
            {
                KaplanSchool.GetIntClnSchools(getSchoolSuccess);
            }
            function getCanClnSchools() {
                KaplanSchool.GetCanClnSchools(getSchoolSuccess);
            }
            
            function getSchoolSuccess(result)
            {
                if($get("text1a")!=null)
                    $get("text1a").innerHTML = result;
				onloadcheck();
            }
            
            function GetMillitarySuccess(result)
            {
                if($get("text5a")!=null)
                    $get("text5a").innerHTML = result;
				onloadcheck();
            }
            
            function GetMillitaryAnswerSuccess(result)
            {
                if(document.getElementById('millitaryvallist')!=null)
                    document.getElementById('millitaryvallist').value = result;
				onloadcheck();
            }
            
            function GetMillitaryQuestionsSuccess(result)
            {
                if(document.getElementById('millitaryquestionlist')!=null)
                    document.getElementById('millitaryquestionlist').value = result;
				onloadcheck();
            }
            
            function GetTrackDisplaySuccess(result)
            {
                if($get("text6a")!=null)
                    $get("text6a").innerHTML = result;
				onloadcheck();
            }
            
            function GetTrackAnswerSuccess(result)
            {
                if(document.getElementById('trackvallist')!=null)
                    document.getElementById('trackvallist').value = result;
				onloadcheck();
            }
            
            function GetTrackQuestionsSuccess(result)
            {
                if(document.getElementById('trackquestionlist')!=null)
                    document.getElementById('trackquestionlist').value = result;
				onloadcheck();
            }
            
            function GetTrackMCPDDisplaySuccess(result)
            {
                if($get("text7a")!=null)
                    $get("text7a").innerHTML = result;
				onloadcheck();
            }
            
            function GetTrackMCPDAnswerSuccess(result)
            {
                if(document.getElementById('trackMCPDvallist')!=null)
                    document.getElementById('trackMCPDvallist').value = result;
				onloadcheck();
            }
            
            function GetTrackMCPDQuestionsSuccess(result)
            {
                if(document.getElementById('trackMCPDquestionlist')!=null)
                    document.getElementById('trackMCPDquestionlist').value = result;
				onloadcheck();
            }
            
           function getProgram(schoolid)
            {
                
                if (schoolid >0)
                {
                    KaplanSchool.GetProgram(schoolid,getProgramSucces);
                }
            }
            
            function getProgramSucces(result)
            {
                if($get("text2a")!=null)
                    $get("text2a").innerHTML = result;
                    var str = window.location.href;
                     if(str.match('mpa.aspx')) 
                     {
                        document.getElementById('text2').innerHTML=document.getElementById('item173').innerHTML;
                        getQuestions('16','173');
                        document.getElementById('programval').value='173';
                     }
			 
            }
            function getQuestions(schoolid,programid)

            {
                KaplanSchool.GetHTML(schoolid,programid,onSuccess);
            }

            function onSuccess(result)

            {
                if($get("dynaQuestions")!=null)
                {
                    $get("dynaQuestions").innerHTML = result;
                    var str = window.location.href;
                     if(str.match('mpa.aspx')) 
                     {
                     document.getElementById('s2gate1').style.display = "block";
                     }
                     }

            }   


            function getQuestionsIntcln(schoolid,programid)
            {
                KaplanSchool.GetHTMLIntCln(schoolid,programid,onSuccess);
            }
            
            function getProgramIntCln(schoolid)
            {
                
                if (schoolid >0)
                {
                    KaplanSchool.GetProgramIntCln(schoolid,getProgramSuccesIntCln);
                }
            }
            
            function getProgramSuccesIntCln(result)
            {
                if($get("text2a")!=null)
                    $get("text2a").innerHTML = result;
            }


            function getQuestionsAncln(schoolid, programid) {
                KaplanSchool.GetHTMLAnCln(schoolid, programid, onSuccess);
            }

            function getProgramAnCln(schoolid) {

                if (schoolid > 0) {
                    KaplanSchool.GetProgramAnCln(schoolid, getProgramSuccesAnCln);
                }
            }

            function getProgramSuccesAnCln(result) {
                if ($get("text2a") != null)
                    $get("text2a").innerHTML = result;
            }
            
            
            
            
             function getTrackQuestions(questionid,trackid)
            {
                KaplanSchool.GetTrackHTML(questionid,trackid,onTrackSuccess);
            }
            function onTrackSuccess(result)
            {
                if($get("trackdynaQuestions")!=null)
                    $get("trackdynaQuestions").innerHTML = result;
            }

            function getMSQuestions(questionid, trackid) { 
                KaplanSchool.GetTrackHTML(questionid, trackid, onTrackMSSuccess);
            }
            function onTrackMSSuccess(result) {
                if ($get("trackdynaQuestions") != null)
                    $get("trackdynaQuestions").innerHTML = result;
            }
