﻿// JScript File

// hide show curriculum fit Section 9
function btCurFitHideShow(object) {
    var objectId = object.id;
    var objectValue = object.value;

    object.value = objectValue == "+" ? " - " : "+";
    var div;
    if (objectId == "btCurFitBussinesEduc")
        div = document.getElementById("phCurFitBussinesEduc");
    if (objectId == "btCurFitDance")
        div = document.getElementById("phCurFitDance");
    if (objectId == "btCurFitDrama")
        div = document.getElementById("phCurFitDrama");
    if (objectId == "btCurFitEnglisgLang")
        div = document.getElementById("phCurFitEnglisgLang");
    if (objectId == "btCurFitHealth")
        div = document.getElementById("phCurFitHealth");
    if (objectId == "btCurFitHomeEcon")
        div = document.getElementById("phCurFitHomeEcon");
    if (objectId == "btCurFitInfoComm")
        div = document.getElementById("phCurFitInfoComm");
    if (objectId == "btCurFitMath")
        div = document.getElementById("phCurFitMath");
    if (objectId == "btCurFitMusic")
        div = document.getElementById("phCurFitMusic");
    if (objectId == "btCurFitScience")
        div = document.getElementById("phCurFitScience");
    if (objectId == "btCurFitSocialStud")
        div = document.getElementById("phCurFitSocialStud");
    if (objectId == "btCurFitSpanish")
        div = document.getElementById("phCurFitSpanish");
    if (objectId == "btCurFitTechEdu")
        div = document.getElementById("phCurFitTechEdu");
    if (objectId == "btCurFitTourism")
        div = document.getElementById("phCurFitTourism");
    if (objectId == "btCurFitVisualArts")
        div = document.getElementById("phCurFitVisualArts");
    if (objectId == "btCurFitFineArts")
        div = document.getElementById("phCurFitFineArts");


    if (div.style.display == 'none')
        div.style.display = 'block';
    else
        div.style.display = 'none';
}

// hide show Section 8 for Multiple formats
function btSection8HideShow(object) {
    var objectId = object.id;
    var objectValue = object.value;

    object.value = objectValue == "+" ? " - " : "+";
    var div;
    if (objectId == "btnSection8ClassReference")
        div = document.getElementById("divSection8ClassReference");
    if (objectId == "btnSection8EducationalSw")
        div = document.getElementById("divSection8EducationalSw");
    if (objectId == "btnSection8Manipulative")
        div = document.getElementById("divSection8Manipulative");
    if (objectId == "btnSection8Novels")
        div = document.getElementById("divSection8Novels");
    if (objectId == "btnSection8ProfRes")
        div = document.getElementById("divSection8ProfRes");
    if (objectId == "btnSection8Print")
        div = document.getElementById("divSection8Print");
    if (objectId == "btnSection8Video")
        div = document.getElementById("divSection8Video");

    if (div.style.display == 'none')
        div.style.display = 'block';
    else
        div.style.display = 'none';
}




// Select All checkbox at different Curriculum Subject Session was selected.
function selectAllRowCurrSubject(checkBox, gridName) {
    var checkBoxId = checkBox.id;
    var checked = checkBox.checked;

    var initGridName = checkBoxId.indexOf(gridName);
    var rowSelected = checkBoxId.substr(initGridName + gridName.length + 4, 2);
    var rowInt = rowSelected - 2;               // there is and offsee of 2.
    var grid = document.getElementById("ctl00_BodyContent_" + gridName);
    var totCol = grid.rows[rowInt].cells.length;

    var rowName = checkBoxId.substr(0, initGridName + gridName.length + 7);
    // totCol-3 -> There are 3 cells that are not Grades checkboxes: DataField "Subject", checkbox "selAllcb" and label "SubjectId"  
    for (var x = 0; x < totCol - 3; x++) {
        var checkName = rowName + "cbCf" + x;
        var checkGrade = document.getElementById(checkName);
        if (checkGrade != null && !checkGrade.disabled)
            checkGrade.checked = checked;
    }
}




function createCombinedAnnotation() {
    if (confirm('All of the changes in Combined Annotation will be overwritten. Are you sure?')) {
        // Section 3 - 7
        var curriculumFit = document.getElementById("ctl00_BodyContent_txtCurriculumFitSummaryComments").value;
        var socialConsideration = document.getElementById("ctl00_BodyContent_txtSocialConsiderationSummaryComments").value;
        var generalContent = document.getElementById("ctl00_BodyContent_txtGeneralContentSummaryComments").value;
        var techDesign = document.getElementById("ctl00_BodyContent_txtTechDesignSummaryComments").value;
        var instructionalDesign = document.getElementById("ctl00_BodyContent_txtInstructionalDesignSummaryComments").value;

        // Section 9 and section 10   
        var summarySuggestedUsage = document.getElementById("ctl00_BodyContent_txtSummarySuggestedUsage").value;
        var summarySuggestedOtherComments = document.getElementById("ctl00_BodyContent_txtSummarySuggestedOtherComments").value;
        var summarySuggestedRelevantKeywords = document.getElementById("ctl00_BodyContent_txtSummarySuggestedRelevantKeywords").value;
        var reasonsNotSelected = document.getElementById("ctl00_BodyContent_txtReasonsNotSelected").value;

        var combinedSummary = document.getElementById("ctl00_BodyContent_txtSummarySuggestedCombinedSummary");
        var newValue = "";
        var separtorLine = "\r\n\r\n";

        if (curriculumFit.length > 0) {
            newValue = "Curriculum Fit:\r\n" + curriculumFit;
            newValue += separtorLine;
        }
        if (socialConsideration.length > 0) {
            newValue += "Social Considerations:\r\n" + socialConsideration;
            newValue += separtorLine;
        }
        if (generalContent.length > 0) {
            newValue += "General Content:\r\n" + generalContent;
            newValue += separtorLine;
        }
        if (techDesign.length > 0) {
            newValue += "Technical Design:\r\n" + techDesign;
            newValue += separtorLine;
        }
        if (instructionalDesign.length > 0) {
            newValue += "Instructional Design:\r\n" + instructionalDesign;
            newValue += separtorLine;
        }

        // Elements for section 8. Different evaluations	
        var elem = document.getElementById("ctl00_BodyContent_txtPrintRelatedComments");
        if (elem != null && elem.value.length > 0) {
            newValue += "Print Related Comments:\r\n" + elem.value;
            newValue += separtorLine;
        }
        elem = document.getElementById("ctl00_BodyContent_txtNovelsPlotDescription");
        if (elem != null && elem.value.length > 0) {
            newValue += "Novel Plot Description:\r\n" + elem.value;
            newValue += separtorLine;
        }

        elem = document.getElementById("ctl00_BodyContent_txtNovelRelatedComments");
        if (elem != null && elem.value.length > 0) {
            newValue += "Novel Related Comments:\r\n" + elem.value;
            newValue += separtorLine;
        }
        elem = document.getElementById("ctl00_BodyContent_txtProfResWrittenDesc");
        if (elem != null && elem.value.length > 0) {
            newValue += "Professional Resources Written Description:\r\n" + elem.value;
            newValue += separtorLine;
        }

        elem = document.getElementById("ctl00_BodyContent_txtProfResRelatedComments");
        if (elem != null && elem.value.length > 0) {
            newValue += "Professional Resources Related Comments:\r\n" + elem.value;
            newValue += separtorLine;
        }

        elem = document.getElementById("ctl00_BodyContent_txtVideoRelatedComments");
        if (elem != null && elem.value.length > 0) {
            newValue += "Video Related Comments:\r\n" + elem.value;
            newValue += separtorLine;
        }
        // Section 9 - 10
        if (summarySuggestedUsage.length > 0) {
            newValue += "Suggested Classroom Usage:\r\n" + summarySuggestedUsage;
            newValue += separtorLine;
        }

        if (summarySuggestedOtherComments.length > 0) {
            newValue += "Other Comments:\r\n" + summarySuggestedOtherComments;
            newValue += separtorLine;
        }

        if (summarySuggestedRelevantKeywords.length > 0) {
            newValue += "Suggested Relevant Keywords:\r\n" + summarySuggestedRelevantKeywords;
            newValue += separtorLine;
        }

        if (reasonsNotSelected.length > 0) {
            newValue += separtorLine;
            newValue += "Reasons Not Selected:\r\n" + reasonsNotSelected;
        }

        combinedSummary.value = newValue;
    }
    else {
        return false;
    }
}

//function getRadiovalue(radioListName)
//{
//    var radListItems=document.getElementById(radioListName); 
//    var radListItesCount = radListItems.length;
//    for(var i=0;i<radListItesCount;i++)
//    {
//        if(radListItems[i].checked)
//        {
//              break;
//        }      
//    }
//}

function openResourceWindow(pos) {
    window.open('Learning Resources Evaluation Popups.htm#' + pos + '', 'Help', 'height=500, width=800, top=500, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
}


var popupOp = new Array(18);
popupOp[0] = "HelpPages/EvaCurriculumFit Popup.htm#section3";
popupOp[1] = "HelpPages/EvaSocConsidAge Popup.htm#section41";
popupOp[2] = "HelpPages/EvaSocConsidGenderRoles Popup.htm#section42";
popupOp[3] = "HelpPages/EvaSocConsidAboriginalPeoples Popup.htm#section43";
popupOp[4] = "HelpPages/EvaSocConsidMulticulturalism Popup.htm#section44";
popupOp[5] = "HelpPages/EvaSocConsidGenderIdentity Popup.htm#section45";
popupOp[6] = "HelpPages/EvaSocConsidAbility Popup.htm#section46";
popupOp[7] = "HelpPages/EvaSocConsidBeliefSystem Popup.htm#section47";
popupOp[8] = "HelpPages/EvaSocConsidSocioEconomic Popup.htm#section48";
popupOp[9] = "HelpPages/EvaSocConsidViolence Popup.htm#section49";
popupOp[10] = "HelpPages/EvaSocConsidEthical Popup.htm#section410";
popupOp[11] = "HelpPages/EvaSocConsidHumour Popup.htm#section411";
popupOp[12] = "HelpPages/EvaSocConsidSafety Popup.htm#section412";
popupOp[13] = "HelpPages/EvaSocConsidLanguage Popup.htm#section413";
popupOp[14] = "HelpPages/EvaGeneralContent Popup.htm#section5";
popupOp[15] = "HelpPages/EvaInstructionalDesignMore Popup.htm#section7-2";
popupOp[16] = "HelpPages/EvaLearningResources Popup.htm#section8";
popupOp[17] = "HelpPages/EvaSocConsidSustainability Popup.htm#section413";

var heightOp = new Array(18);
heightOp[0] = 350;
heightOp[1] = 240;
heightOp[2] = 310;
heightOp[3] = 325;
heightOp[4] = 330;
heightOp[5] = 355;
heightOp[6] = 270;
heightOp[7] = 375;
heightOp[8] = 340;
heightOp[9] = 285;
heightOp[10] = 280;
heightOp[11] = 305;
heightOp[12] = 305;
heightOp[13] = 280;
heightOp[14] = 240;
heightOp[15] = 195;
heightOp[16] = 230;
heightOp[17] = 350;

var popupOpFR = new Array(18);
popupOpFR[0] = "HelpPages/EvaCurriculumFit Popup_FR.htm#section3"; // *
popupOpFR[1] = "HelpPages/EvaSocConsidAge Popup_FR.htm#section41";
popupOpFR[2] = "HelpPages/EvaSocConsidGenderRoles Popup_FR.htm#section42";
popupOpFR[3] = "HelpPages/EvaSocConsidAboriginalPeoples Popup_FR.htm#section43";
popupOpFR[4] = "HelpPages/EvaSocConsidMulticulturalism Popup_FR.htm#section44";
popupOpFR[5] = "HelpPages/EvaSocConsidGenderIdentity Popup_FR.htm#section45";
popupOpFR[6] = "HelpPages/EvaSocConsidAbility Popup_FR.htm#section46";  // ***
popupOpFR[7] = "HelpPages/EvaSocConsidBeliefSystem Popup_FR.htm#section47";  // ***
popupOpFR[8] = "HelpPages/EvaSocConsidSocioEconomic Popup_FR.htm#section48"; // ***
popupOpFR[9] = "HelpPages/EvaSocConsidViolence Popup_FR.htm#section49";  // ***
popupOpFR[10] = "HelpPages/EvaSocConsidEthical Popup_FR.htm#section410"; // ***
popupOpFR[11] = "HelpPages/EvaSocConsidHumour Popup_FR.htm#section411";
popupOpFR[12] = "HelpPages/EvaSocConsidSafety Popup_FR.htm#section412";
popupOpFR[13] = "HelpPages/EvaSocConsidLanguage Popup_FR.htm#section413";    // ***
popupOpFR[14] = "HelpPages/EvaGeneralContent Popup_FR.htm#section5";
popupOpFR[15] = "HelpPages/EvaInstructionalDesignMore Popup_FR.htm#section7-2";
popupOpFR[16] = "HelpPages/EvaLearningResources Popup_FR.htm#section8";  // ***
popupOpFR[17] = "HelpPages/EvaSocConsidSustainability Popup_FR.htm#section413";

// Funtion to display htm form when press: consider...
function openEvaluationPopupWindow(pos) {
    window.open('' + popupOp[pos] + '', 'Help', 'height=' + heightOp[pos] + ', width=700, top=200, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
}

// Funtion to display htm form when press: consider...
function openEvaluationPopupWindowFR(pos) {
    window.open('' + popupOpFR[pos] + '', 'Help', 'height=' + heightOp[pos] + ', width=700, top=200, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
}


// Funtion to select Technical Text or Technical Video popup...
function openTechnical_Text_or_VideoWindow(mResource) {
    if (mResource == 'T' || mResource == 'N')
        window.open('HelpPages/EvaTechnicalDesignText Popup.htm#section6-1', 'Help', 'height=240, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
    else
        window.open('HelpPages/EvaTechnicalDesignVideo Popup.htm#section6-1', 'Help', 'height=290, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
}

// Funtion to select Technical Text or Technical Video popup French...
function openTechnical_Text_or_VideoWindowFR(mResource) {
    //   if (mResource == 'T')      *** for novels use Video 
    //       window.open('HelpPages/EvaTechnicalDesignText Popup.htm#section6-1','Help','height=240, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
    //   else
    window.open('HelpPages/EvaTechnicalDesignText Popup_FR.htm#section6-1', 'Help', 'height=290, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
}


// Funtion to select Instructional Text or Instructional Video popup...
function openInstructional_Text_or_VideoWindow(mResource) {
    if (mResource == 'T' || mResource == 'N')
        window.open('HelpPages/EvaInstructionalDesignText Popup.htm#section7-1', 'Help', 'height=350, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
    else
        window.open('HelpPages/EvaInstructionalDesignVideo Popup.htm#section7-1', 'Help', 'height=440, width=680, top=250, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
}

// Funtion to select Instructional Text or Instructional Video popup French...
function openInstructional_Text_or_VideoWindowFR(mResource) {
    //   if (mResource == 'T')      *** for novels use Video 
    //      window.open('HelpPages/EvaInstructionalDesignText Popup.htm#section7-1','Help','height=350, width=680, top=300, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
    //   else
    window.open('HelpPages/EvaInstructionalDesignText Popup_FR.htm#section7-1', 'Help', 'height=440, width=680, top=250, left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=n o, status=no');
}

function LimitWordCount(object, count) {
    var objectValue = object.value;
    if (objectValue.length > count - 1) // if too long...trim it!
        object.value = objectValue.substring(0, count - 1);
}

function LimitTextCount(field, cntfield, maxlimit) {
    if (field == null)
        return;
    if (cntfield == null)
        return;
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
        cntfield.value = maxlimit - field.value.length;

    // For evaluation form, assign hideSpellCheck control false. 
    var spellCheckDone = document.getElementById('ctl00_BodyContent_hidSpellCheckDone');
    if (spellCheckDone != null)
        spellCheckDone.value = "0";

}

$(document).ready(function() {
    var radioCurricumFitGoalsObjetive = document.getElementById('ctl00_BodyContent_radioCurricumFitGoalsObjetive_0');
    var radioCurriculumFitDegreeSupport = document.getElementById('ctl00_BodyContent_radioCurriculumFitDegreeSupport_0');
    var radioCurriculumFitCrossCurr = document.getElementById('ctl00_BodyContent_radioCurriculumFitCrossCurr_0');

    if (radioCurricumFitGoalsObjetive && radioCurriculumFitDegreeSupport && radioCurriculumFitCrossCurr) {
        GetTotalScore();
        $(radioCurricumFitGoalsObjetive).click(checkValueAndDetermineWhetherToDirect);
        $(radioCurriculumFitDegreeSupport).click(checkValueAndDetermineWhetherToDirect);
        $(radioCurriculumFitCrossCurr).click(checkValueAndDetermineWhetherToDirect);
    }
});

function checkValueAndDetermineWhetherToDirect() {
    var radioCurricumFitGoalsObjetive = document.getElementById('ctl00_BodyContent_radioCurricumFitGoalsObjetive_0');
    var radioCurriculumFitDegreeSupport = document.getElementById('ctl00_BodyContent_radioCurriculumFitDegreeSupport_0');
    var radioCurriculumFitCrossCurr = document.getElementById('ctl00_BodyContent_radioCurriculumFitCrossCurr_0');
    if (radioCurricumFitGoalsObjetive.checked && radioCurriculumFitDegreeSupport.checked && radioCurriculumFitCrossCurr.checked)
        sentToSetpDirect();
}

function sentToSetpDirect() {

    alert('Because this resource scored only 0 on the curriculum fit, you don\'t need to complete Sections 4-8 and instead should continue with Section 9');
    window.location.href = '#stepToSection9';
}

function selectDefaultTitle() {
    $("#ctl00_BodyContent_drResourceTitle")[0].options[0].selected = true;
}

// Enable Grades radio button list for french novel form Section 9
function enableGradeFrench(a) {
    if (document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevel") == null)
        return;
    // enable/disble by element for Grade Decisión 
    for (i = 0; i < document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevel").getElementsByTagName("input").length; i++) {
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevel").getElementsByTagName("input")[i].disabled = (a == 0);
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevel").getElementsByTagName("label")[i].disabled = (a == 0);
    }
}

// Enable Grades inmersion radio button list for french novel form Section 9
function enableGradeInmersion(b) {
    if (document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr2") == null)
        return;
    // enable/disble by element for Grade Decisión 
    for (i = 0; i < document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr2").getElementsByTagName("input").length; i++) {
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr2").getElementsByTagName("input")[i].disabled = (b == 0);
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr2").getElementsByTagName("label")[i].disabled = (b == 0);
    }
}

// Enable Grades francophone radio button list for french novel form Section 9
function enableGradeFrancophone(c) {
    if (document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr3") == null)
        return;
    // enable/disble by element for Grade Decisión 
    for (i = 0; i < document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr3").getElementsByTagName("input").length; i++) {
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr3").getElementsByTagName("input")[i].disabled = (c == 0);
        document.getElementById("ctl00_BodyContent_cbListEvaluationDecisionGradeLevelFr3").getElementsByTagName("label")[i].disabled = (c == 0);
    }
}

// Enable Grades radio button list for french novel form. all this is because in Firefox there wasn't working correctly.
// important, in aspx file asp:checkboxlist assing Enable="true"
function enableGrades(a, b, c) {
    ////// For French now not include this options
    //    enableGradeFrench(a);
    //    enableGradeInmersion(b);
    //    enableGradeFrancophone(c);
}

function enableReasonNotSelected(a) {
    for (i = 0; i < document.getElementById("ctl00_BodyContent_checkBoxReasonsNotSelected").getElementsByTagName("input").length; i++) {
        document.getElementById("ctl00_BodyContent_checkBoxReasonsNotSelected").getElementsByTagName("input")[i].disabled = (a == "e");
        document.getElementById("ctl00_BodyContent_checkBoxReasonsNotSelected").getElementsByTagName("label")[i].disabled = (a == "e");
    }
}

/////////////////////////////////////////////
function radioSelectedValue(flag) {
    var index0 = document.getElementById("ctl00_BodyContent_" + flag + "_0");
    var index1 = document.getElementById("ctl00_BodyContent_" + flag + "_1");
    var index2 = document.getElementById("ctl00_BodyContent_" + flag + "_2");
    var index3 = document.getElementById("ctl00_BodyContent_" + flag + "_3");
    // AR** var index4 = document.getElementById("ctl00_BodyContent_" +flag+"_4");
    if (index0 != null && index0.checked) {
        return 0;
    }
    else if (index0 != null && index1.checked) {
        return 1;
    }
    else if (index0 != null && index2.checked) {
        return 2;
    }
    else {
        return "N/A";
    }
}
//111111111   Section 3
function radioCurriculumFitIndexChanged() {
    var txt = document.getElementById("txtCurriculumFit");
    if (radioSelectedValue("radioCurriculumFitDegreeSupport") == "N/A" /* AR** && radioSelectedValue("radioCurriculumFitPrescribedLearning")=="N/A" **/) {
        txt.value = "N/A";
        return "N/A";
    }
    else     // AR**
    {
        var calc = radioSelectedValue("radioCurriculumFitDegreeSupport"); // txt.value = radioSelectedValue("radioCurriculumFitDegreeSupport")+ "/2" // AR** "/3";
        // A new display operation
        var prcent;
        prcent = (calc / 2) * 100;          // % over total points avaliable
        prcent = Round(prcent, 2);              // round 2 decimals             
        prcent = isNaN(prcent) ? 0 : prcent;
        txt.value = calc + "/2" + " (" + prcent + "%)";
        return radioSelectedValue("radioCurriculumFitDegreeSupport");

    }
    /*** AR**   
    else if(radioSelectedValue("radioCurriculumFitDegreeSupport")=="N/A")
    {
    txt.value = radioSelectedValue("radioCurriculumFitPrescribedLearning")+ "/3";
    return radioSelectedValue("radioCurriculumFitPrescribedLearning"); 
    }
    else if(radioSelectedValue("radioCurriculumFitPrescribedLearning")=="N/A")
    {
    txt.value = radioSelectedValue("radioCurriculumFitDegreeSupport")+ "/3";
    return radioSelectedValue("radioCurriculumFitDegreeSupport"); 
    }
    else 
    {
    txt.value = (radioSelectedValue("radioCurriculumFitDegreeSupport")+radioSelectedValue("radioCurriculumFitPrescribedLearning"))/2+ "/3";
    return (radioSelectedValue("radioCurriculumFitDegreeSupport")+radioSelectedValue("radioCurriculumFitPrescribedLearning"))/2;
    }
    **/
}
//22222222   Section 4
function radioSocialConsiderationsIndexChanged() {
    var txt = document.getElementById("txtSocialConsiderations");
    if (radioSelectedValue("radioSocialConsiderationSupport") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var calc = radioSelectedValue("radioSocialConsiderationSupport"); // txt.value =  radioSelectedValue("radioSocialConsiderationSupport")+ "/2" // AR** "/3";  
        // A new display operation
        var prcent;
        prcent = (calc / 2) * 100;          // % over total points avaliable
        prcent = Round(prcent, 2);              // round 2 decimals             
        prcent = isNaN(prcent) ? 0 : prcent;
        txt.value = calc + "/2" + " (" + prcent + "%)";

        return radioSelectedValue("radioSocialConsiderationSupport");
    }
}
//333333333   Section 5
function radioGeneralContentSuitableCurriculumIndexChanged() {
    var txt = document.getElementById("txtGeneralContent");
    if (radioSelectedValue("radioGeneralContentSuitableCurriculum") == "N/A" &&
       radioSelectedValue("radioGeneralContentCurrentCurriculum") == "N/A" &&
       radioSelectedValue("radioGeneralContentAccurateCurriculum") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 3;
        var calc = 0;
        if (radioSelectedValue("radioGeneralContentSuitableCurriculum") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioGeneralContentSuitableCurriculum");
        }
        if (radioSelectedValue("radioGeneralContentCurrentCurriculum") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioGeneralContentCurrentCurriculum");
        }
        if (radioSelectedValue("radioGeneralContentAccurateCurriculum") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioGeneralContentAccurateCurriculum");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;

            //            var x;
            //            x = calc3/i;                // AR** Separete in a new variable
            //            x = Round(x, 2);            // AR** Call new Round funtion
            //            x = isNaN(x) ? 0 : x;       // AR** Not display a Not a Number value
            //       
            //            txt.value = x + "/2";   
            //            return  x;
        }
    }
}
//4444444444   Section 6
function radioTechnicalDesignIndexChanged() {
    var txt = document.getElementById("txtTechnicalDesign");
    if (radioSelectedValue("radioTechDesignVisualPresentation") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var calc = radioSelectedValue("radioTechDesignVisualPresentation");
        // A new display operation
        var prcent;
        prcent = (calc / 2) * 100;          // % over total points avaliable
        prcent = Round(prcent, 2);              // round 2 decimals             
        prcent = isNaN(prcent) ? 0 : prcent;
        txt.value = calc + "/2" + " (" + prcent + "%)";
        return prcent;
    }
}
//555555555555   Section 7
function radioInstructionalDesignIndexChanged() {
    var txt = document.getElementById("txtInstructionalDesign");
    if (radioSelectedValue("radioInstructionalDesignEffective") == "N/A" &&
      radioSelectedValue("radioInstructionalDesignWideRange") == "N/A" &&
      radioSelectedValue("radioInstructionalDesignLogical") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 3;
        var calc = 0;
        if (radioSelectedValue("radioInstructionalDesignEffective") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioInstructionalDesignEffective");
        }
        if (radioSelectedValue("radioInstructionalDesignWideRange") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioInstructionalDesignWideRange");
        }
        if (radioSelectedValue("radioInstructionalDesignLogical") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioInstructionalDesignLogical");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;

            //            var x;
            //            x = calc4/i;                // AR** Separete in a new variable
            //            x = Round(x, 2);            // AR** Call new Round funtion
            //            x = isNaN(x) ? 0 : x;       // AR** Not display a Not a Number value
            //       
            //            txt.value = x + "/2";       // "/3"; <-- AR** Now just 2   
            //            return  x;
        }
        //(radioSelectedValue("radioInstructionalDesignEffective")+radioSelectedValue("radioInstructionalDesignWideRange")+radioSelectedValue("radioInstructionalDesignLogical")+radioSelectedValue("radioInstructionalDesignContribution"))/4+ "/3";  
    }
}

//66666666   Section 8 Just for Print - Text (Learning resources)
function radioPrintResourcesIndexChanged() {
    var txt = document.getElementById("txtPrintResources");
    if (txt == null) return;
    var calc, i = 1;

    if (txt == null)
        return;
    if (radioSelectedValue("radioInstructionalDesignContribution") == "N/A" && radioSelectedValue("radioTechDesignComponents") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else if (radioSelectedValue("radioInstructionalDesignContribution") == "N/A") {
        calc = radioSelectedValue("radioTechDesignComponents");
    }
    else if (radioSelectedValue("radioTechDesignComponents") == "N/A") {
        calc = radioSelectedValue("radioInstructionalDesignContribution");
    }
    else {
        calc = radioSelectedValue("radioInstructionalDesignContribution") + radioSelectedValue("radioTechDesignComponents");
        i = 2;
    }

    // A new display operation
    var prcent;
    var totValue = i * 2;                   // Max value per question is 2
    prcent = (calc / totValue) * 100;          // % over total points avaliable
    prcent = Round(prcent, 2);              // round 2 decimals             
    prcent = isNaN(prcent) ? 0 : prcent;
    txt.value = calc + "/" + totValue + " (" + prcent + "%)";
    return prcent;
}

//7777777777   Section 8 Just Novels Audience
function radioNovelsAudienceIndexChanged() {
    var txt = document.getElementById("txtNovelsAudience");

    if (txt == null) return;
    if (radioSelectedValue("radioNovelsLanguageApproriate") == "N/A" &&
      radioSelectedValue("radioNovelsContentAppropriate") == "N/A" &&
      radioSelectedValue("radioNovelsVisualAppropriate") == "N/A" &&
      radioSelectedValue("radioNovelsInterestMale") == "N/A" &&
      radioSelectedValue("radioNovelsInterestFemale") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 5;
        var calc = 0;
        if (radioSelectedValue("radioNovelsLanguageApproriate") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsLanguageApproriate");
        }
        if (radioSelectedValue("radioNovelsContentAppropriate") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsContentAppropriate");
        }
        if (radioSelectedValue("radioNovelsVisualAppropriate") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsVisualAppropriate");
        }
        if (radioSelectedValue("radioNovelsInterestMale") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsInterestMale");
        }
        if (radioSelectedValue("radioNovelsInterestFemale") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsInterestFemale");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;
        }
    }
}
//88888888   Just Section 8 Novels. Literary Merit
function radioNovelsLiteraryMeritIndexChanged() {
    var txt = document.getElementById("txtNovelsLiteraryMerit");
    if (txt == null) return;
    if (radioSelectedValue("radioNovelsHumanCondition") == "N/A" &&
      radioSelectedValue("radioNovelStudentExperiences") == "N/A" &&
      radioSelectedValue("radioNovelsCreative") == "N/A" &&
      radioSelectedValue("radioNovelsStylistically") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 4;
        var calc = 0;
        if (radioSelectedValue("radioNovelsHumanCondition") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsHumanCondition");
        }
        if (radioSelectedValue("radioNovelStudentExperiences") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelStudentExperiences");
        }
        if (radioSelectedValue("radioNovelsCreative") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsCreative");
        }
        if (radioSelectedValue("radioNovelsStylistically") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioNovelsStylistically");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;
        }
    }
}
//9999999   Section 8 Video
function radioVideoIndexChanged() {
    var txt = document.getElementById("txtVideo");
    if (txt == null) return;
    if (radioSelectedValue("radioVideoQuality") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var calc = radioSelectedValue("radioVideoQuality");
        // A new display operation
        var prcent;
        prcent = (calc / 2) * 100;          // % over total points avaliable
        prcent = Round(prcent, 2);              // round 2 decimals             
        prcent = isNaN(prcent) ? 0 : prcent;
        txt.value = calc + "/2" + " (" + prcent + "%)";

        return radioSelectedValue("radioVideoQuality");
    }
}
//10 10 10 10 Just Section 9 Professional Resources
function radioProfResProvSuppIndexChanged() {
    var txt = document.getElementById("txtProfRes");
    if (txt == null) return;
    if (radioSelectedValue("radioProfResProvSupp") == "N/A" &&
      radioSelectedValue("radioProfResSuppInstruc") == "N/A" &&
      radioSelectedValue("radioProfResProvTools") == "N/A" &&
      radioSelectedValue("radioProfResGiveEnrich") == "N/A" &&
      radioSelectedValue("radioProfResCiteSupp") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 5;
        var calc = 0;
        if (radioSelectedValue("radioProfResProvSupp") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioProfResProvSupp");
        }
        if (radioSelectedValue("radioProfResSuppInstruc") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioProfResSuppInstruc");
        }
        if (radioSelectedValue("radioProfResProvTools") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioProfResProvTools");
        }
        if (radioSelectedValue("radioProfResGiveEnrich") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioProfResGiveEnrich");
        }
        if (radioSelectedValue("radioProfResCiteSupp") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioProfResCiteSupp");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;
        }
    }
}
//11 11 11 11   Section 8 Just Learning Sw - Tech Design
function radioLearningSwTechDesignIndexChanged() {
    var txt = document.getElementById("txtLearningSwTechDesign");

    if (txt == null) return;
    if (radioSelectedValue("radioLearnSwStructInterfase") == "N/A" &&
      radioSelectedValue("radioLearnSwNavigationSimple") == "N/A" &&
      radioSelectedValue("radioLearnSwGoodVisual") == "N/A" &&
      radioSelectedValue("radioLearnSwLearnerControl") == "N/A" &&
      radioSelectedValue("radioLearnSwHelpSupport") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 5;
        var calc = 0;
        if (radioSelectedValue("radioLearnSwStructInterfase") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwStructInterfase");
        }
        if (radioSelectedValue("radioLearnSwNavigationSimple") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwNavigationSimple");
        }
        if (radioSelectedValue("radioLearnSwGoodVisual") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwGoodVisual");
        }
        if (radioSelectedValue("radioLearnSwLearnerControl") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwLearnerControl");
        }
        if (radioSelectedValue("radioLearnSwHelpSupport") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwHelpSupport");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;
        }
    }
}
//12 12 12 12   Section 8 Just Learning Sw - Instructional Design
function radioLearningSwInstrucDesignIndexChanged() {
    var txt = document.getElementById("txtLearningSwInstrucDesign");

    if (txt == null) return;
    if (radioSelectedValue("radioLearnSwDesignSuitable") == "N/A" &&
      radioSelectedValue("radioLearnSwMultiMediaSupport") == "N/A" &&
      radioSelectedValue("radioLearnSwInteraction") == "N/A" &&
      radioSelectedValue("radioLearnSwTimelyFrequent") == "N/A" &&
      radioSelectedValue("radioLearnSwPromoteActive") == "N/A" &&
      radioSelectedValue("radioLearnSwTeacherCustomize") == "N/A") {
        txt.value = "N/A";
        return "N/A";
    }
    else {
        var i = 6;
        var calc = 0;
        if (radioSelectedValue("radioLearnSwDesignSuitable") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwDesignSuitable");
        }
        if (radioSelectedValue("radioLearnSwMultiMediaSupport") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwMultiMediaSupport");
        }
        if (radioSelectedValue("radioLearnSwInteraction") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwInteraction");
        }
        if (radioSelectedValue("radioLearnSwTimelyFrequent") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwTimelyFrequent");
        }
        if (radioSelectedValue("radioLearnSwPromoteActive") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwPromoteActive");
        }
        if (radioSelectedValue("radioLearnSwTeacherCustomize") == "N/A") {
            i = i - 1;
        }
        else {
            calc = calc + radioSelectedValue("radioLearnSwTeacherCustomize");
        }

        if (i == 0) {
            txt.value = "N/A";
            return "N/A";
        }
        else {
            // A new display operation
            var prcent;
            var totValue = i * 2;                   // Max value per question is 2
            prcent = (calc / totValue) * 100;          // % over total points avaliable
            prcent = Round(prcent, 2);              // round 2 decimals             
            prcent = isNaN(prcent) ? 0 : prcent;
            txt.value = calc + "/" + totValue + " (" + prcent + "%)";
            return prcent;
        }
    }
}

// ** funtion that did a rounding. Round Rval value with any Rdecimal precision.
//public static float Round(float Rval, int Rdecimal) {
function Round(rval, rdecimal) {
    var p = Math.pow(10, rdecimal);
    rval = rval * p;
    var tmp = Math.round(rval);
    return tmp / p;
}


function GetTotalScore() {
    
    return;         // Not include Score 

    //   var total = document.getElementById("txtTotal");   
    //   var score = document.getElementById("txtScore");
    var i = 10; // i = 15; AR** now the maximum value is 10
    var c = 0;
    //1   Section 3
    if (radioCurriculumFitIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioCurriculumFitIndexChanged();
    }
    //2   Section 4 
    if (radioSocialConsiderationsIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioSocialConsiderationsIndexChanged();
    }
    //3   Section 5
    if (radioGeneralContentSuitableCurriculumIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioGeneralContentSuitableCurriculumIndexChanged();
    }
    //4   Section 6
    if (radioTechnicalDesignIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioTechnicalDesignIndexChanged();
    }
    //5   Section 7
    if (radioInstructionalDesignIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioInstructionalDesignIndexChanged();
    }

    //6   Just Section 8 Print - Text (Learning Resources)
    if (radioPrintResourcesIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioPrintResourcesIndexChanged();
    }

    //7   Just Section 8 Novels. Audience
    if (radioNovelsAudienceIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioNovelsAudienceIndexChanged();
    }

    //8   Just Section 8 Novels. Literary Merit
    if (radioNovelsLiteraryMeritIndexChanged() == "N/A") {
        i = i - 2; // i=i-3; AR** 
    }
    else {
        c += radioNovelsLiteraryMeritIndexChanged();
    }
    // 9 Just Section 8 Video. 
    if (radioVideoIndexChanged() == "N/A") {
        i = i - 2;
    }
    else {
        c += radioVideoIndexChanged();
    }
    // 10  Just Section 8 Professional Resources
    if (radioProfResProvSuppIndexChanged() == "N/A") {
        i = i - 2;
    }
    // 11 Just Section 8 Learning Software Technical Design
    if (radioLearningSwTechDesignIndexChanged() == "N/A") {
        i = i - 2;
    }
    else {
        c += radioLearningSwTechDesignIndexChanged();
    }
    // 11 Just Section 8 Learning Software Instructional Design
    if (radioLearningSwInstrucDesignIndexChanged() == "N/A") {
        i = i - 2;
    }
    else {
        c += radioLearningSwInstrucDesignIndexChanged();
    }
}

