﻿// JavaScript File

function toggleMeasure(unit) {
    var weightUnit = '';
    var heightUnit = '';
    //get the text boxes
    if (document.getElementById)
        {
        var lblHeight = document.getElementById('spanHeightUnit');
        var txtHeightSub = document.getElementById('ctl00_cphSubContent_txtHeightSub');
        var lblHeightSub = document.getElementById('spanHeightSubUnit');
        var lblWeight = document.getElementById('spanWeightUnit');   
      
        if (unit == 'm') {
            weightUnit = 'kg.';
            heightUnit = 'cm.';
            txtHeightSub.style.display = 'none';
            lblHeightSub.style.display = 'none';
            txtHeightSub.value = '';
        }
        else {
            weightUnit = 'lbs';
            heightUnit = 'ft.';
            txtHeightSub.style.display = 'inline';
            lblHeightSub.style.display = 'inline';
        }
     
        lblHeight.innerHTML = heightUnit;
        lblWeight.innerHTML = weightUnit;
    }
    return;  
}

function populateDiv(strSourceId, strTargetId) {
    var objTarget = document.getElementById(strTargetId);
    var objSource = document.getElementById(strSourceId);
    objTarget.innerHTML = objSource.innerHTML;
   
    return true;
}

function populateFaqAnswer(strTitleId, strTextId, strTargetTitleId, strTargetTextId) {
    //Fill in Faq Question:
    populateDiv(strTitleId, strTargetTitleId);
    //Fill in Faq Answer:
    populateDiv(strTextId, strTargetTextId);
}

function toggleHighlight(strObj, strColor) {
    var el = document.getElementById(strObj);
    if (el.style.bgColor != strColor) {
        el.style.bgColor = strColor;
    }
    else {
        //el.style.bgColor = '';
    }
}

/* PUT AT END OF JS FILE */
if (Sys && Sys.Application) {     
    Sys.Application.notifyScriptLoaded();
}