function calculateScore() {
    var Factor1 = 0;
    var Factor1_Weight = 0.35;
    var SubFactor1_Use = 0;
    var SubFactor1_Purpose = 0;
    var SubFactor1_Transform = 0;

    var Factor2 = 0;
    var Factor2_Weight = 0.15;

    var Factor3 = 0;
    var Factor3_Weight = 0.15;
    var SubFactor3_Taken = 0;
    var SubFactor3_Quality = 0;
    var SubFactor3_Ratio = 0;

    var Factor4 = 0;
    var Factor4_Weight = 0.35;
    var SubFactor4_Original = 0;
    var SubFactor4_Derivative = 0;

    var Factor5 = 0;
    var Factor5_Weight = 0.1;

    var myScore = 0;
    //---------------------------------------------------------
    // Factor 1 - Purpose and Character of Use
    //----------------------------------------------------------
    // Factor 1 - Use
    SubFactor1_Use = parseInt(document.forms[0].MainContent_tbUse.value);
    if (document.forms[0].MainContent_cblPurpose_0.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_1.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_2.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_3.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_4.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_5.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_6.checked) {
        SubFactor1_Purpose += 1;
    }
    if (document.forms[0].MainContent_cblPurpose_7.checked) {
        SubFactor1_Purpose += 1;
    }    
    if (SubFactor1_Purpose > 0) {
        SubFactor1_Purpose = 72 + ((SubFactor1_Purpose - 1) * 4);
    }
    // Factors 1 - Transformation
    SubFactor1_Transform = parseInt(document.forms[0].MainContent_tbTransform.value);
    // Normalize Factor1
    if (SubFactor1_Transform > 50) {
        SubFactor1_Use += 1;
        SubFactor1_Use *= 2;
        if (SubFactor1_Use > 100) {
            SubFactor1_Use = 100;
        }
    }
    Factor1 = (SubFactor1_Use + SubFactor1_Purpose + SubFactor1_Transform) / 3;
    //----------------------------------------------------------
    // Factor 2 - Nature of Copyrighted Works (Worthiness)
    //----------------------------------------------------------
    Factor2 = parseInt(document.forms[0].MainContent_tbProtectable.value);
    //----------------------------------------------------------
    // Factor 3 - Amount and Substantiality of Use
    //----------------------------------------------------------
    SubFactor3_Taken = parseInt(document.forms[0].MainContent_tbTaken.value);
    SubFactor3_Quality = parseInt(document.forms[0].MainContent_tbQuality.value);
    SubFactor3_Ratio = parseInt(document.forms[0].MainContent_tbRatio.value);
    // Normalize Factor3
    if (SubFactor1_Transform > 50) {
        SubFactor3_Taken += 1;
        SubFactor3_Ratio += 1;
        SubFactor3_Taken *= 2;
        SubFactor3_Ratio *= 2;
        if (SubFactor3_Taken > 100) {
            SubFactor3_Taken = 100;
        }
        if (SubFactor3_Ratio > 100) {
            SubFactor3_Ratio = 100;
        }
    }
    Factor3 = (SubFactor3_Taken + SubFactor3_Quality + SubFactor3_Ratio) / 3;
    //----------------------------------------------------------
    // Factor 4 - The Effect of the Use upon the Potential Market for or Value of the Copyrighted Work
    //----------------------------------------------------------
    SubFactor4_Original = parseInt(document.forms[0].MainContent_tbOriginal.value);
    SubFactor4_Derivative = parseInt(document.forms[0].MainContent_tbDerivative.value);
    // Normalize Factor4
    Factor4 = (SubFactor4_Original + SubFactor4_Derivative) / 2;
    //----------------------------------------------------------
    // Factor 5 - Bonus Points for Good Faith
    //----------------------------------------------------------
    Factor5 = parseInt(document.forms[0].MainContent_tbBonus.value);
    // run the Transformation transformation
    if (SubFactor1_Transform > 50) {
        if (SubFactor1_Transform > 90) {
            SubFactor1_Transform = 90;
        }
        Factor1_Weight += (SubFactor1_Transform - 50) / 100;
        Factor2_Weight -= ((SubFactor1_Transform - 50) / 100) / 3;
        Factor3_Weight -= ((SubFactor1_Transform - 50) / 100) / 3;
        Factor4_Weight -= ((SubFactor1_Transform - 50) / 100) / 3;
    }
    //----------------------------------------------------------
    // Total Score
    //----------------------------------------------------------	
    myScore = (Factor1 * Factor1_Weight) +
			              (Factor2 * Factor2_Weight) +
			              (Factor3 * Factor3_Weight) +
			              (Factor4 * Factor4_Weight) +
			              (Factor5 * Factor5_Weight);
    myScore = Math.round(myScore);

    document.getElementById("fuvScoreNumeric").innerHTML = myScore; //"Fair Use Score: " + 

    var WidthOfGraphicBeingUsedForScoreImage = 400;
    document.getElementById("fuvBar").style.width = (WidthOfGraphicBeingUsedForScoreImage / 100) * myScore + 'px';
//    if (myScore > 50) then {
//        document.getElementById("fuvBar").setAttribute(background-image, url("/images/progress-noninfringe.gif"));
//    }
}

// required by the ScriptManager
if (typeof (Sys) != "undefined") {
    Sys.Application.notifyScriptLoaded();
}

