//TarrantIT 2005
function SetCalc()
{
	CalcOval();
}
function CalcOval()
{
    var major = parseInt(document.getElementById("ddOvalMajFeet").value) * 384 + parseInt(document.getElementById("ddOvalMajInches").value) * 32 + parseInt(document.getElementById("ddOvalMajFrac").value);
    var minor = parseInt(document.getElementById("ddOvalMinFeet").value) * 384 + parseInt(document.getElementById("ddOvalMinInches").value) * 32 + parseInt(document.getElementById("ddOvalMinFrac").value);
    if (minor >= major)
    {
        alert ("Minor axis length must be less than Major axis length");
        return;
    }
    var majorH = major / 2;
    var minorH = minor / 2;
    var p1 = Math.sqrt((majorH * majorH) - (minorH * minorH));
    document.getElementById("spnP1").innerHTML = ConEng(p1, true);
    document.getElementById("spnCtoP1").innerHTML = ConEng(p1, true);
    var area = (Math.PI * majorH * minorH) / 147456;
    document.getElementById("spnMajor").innerHTML = ConEng(major, true);
    document.getElementById("spnMinor").innerHTML = ConEng(minor, true);
    document.getElementById("spnArea").innerHTML = RoundTo(area, 2);
}
function RoundTo(val, places)
{
    places = Math.pow(10, places);
    d = Math.round(val * places) / places;
    return d;
}