function computeHCG()
{
    var owgt = 0    // overall weight
    var rwwgt = 0   // rear wheel weight
    var wb = 0      // wheelbase
    var cgx = 0     // center of gravity location behind front wheel,
                    //      what we're solving for
    while (owgt == 0)
    {
        owgt = prompt("Enter the OVERALL WEIGHT of the bike - ", 0);
    }
    while (rwwgt == 0)
    {
        rwwgt = prompt("Enter the REAR WHEEL WEIGHT of the bike - ", 0);
    }
    while (wb == 0)
    {
        wb = prompt("Enter the WHEELBASE of the bike - ", 0);
    }
    cgx = (rwwgt/owgt) * wb
    cgx = cgx + " "
    if (cgx != 0)
    {
        alert("Your HORIZONTAL CENTER OF GRAVITY lies " + cgx.substring(0,6) + " inches behind the front wheel");
    }
}

function computeVCG()
{
    var owgt = 0	  // overall weight
	var lwb = 0		  // level wheelbase
	var rwb = 0		  // raised wheelbase
	var dr = 0		  // distance raised
	var awgt = 0	  // added weight on scale
	var ycg = 0		  // vertical center of gravity, what we're
			  		  //     solving for
	var tempnum = 0	  // temporary number					  
    while (owgt ==0)
    {
        owgt = prompt("Enter the OVERALL WEIGHT of the bike - ", 0);
    }
    while (rwb == 0)
    {
        rwb = prompt("Enter the RAISED WHEELBASE of the bike - ", 0);
    }
    while (dr == 0)
    {
        dr = prompt("Enter the DISTANCE RAISED - ", 0);
    }
    while (awgt == 0)
    {
        awgt = prompt("Enter the WEIGHT ADDED to rear wheel scale - ", 0);
    }
	// c^2 = a^2 + b^2 or a^2 = c^2 - b^2
	tempnum = (rwb * rwb) - (dr * dr);
	lwb = Math.sqrt(tempnum);
	cgy = (lwb * rwb * awgt)/(dr * owgt);
	cgy = cgy + " "			    
    if (cgy != 0)
    {
        alert("Your VERTICAL CENTER OF GRAVITY lies " + cgy.substring(0,6) + " inches");
    }
}

function computeDWT()
{
    var fwt = 0		 // flywheel torque
    var pr = 0	  // primary ratio
	var ir = 0		  // internal ratio
	var sr = 0		  // secondary ratio
	var eff = 0		  // efficiency, usuall about 85%
	var dwt = 0		  // drive wheel torque, what we're
			  		  //     solving for
    while (fwt ==0)
    {
        fwt = prompt("Enter the FLYWHEEL TORQUE AT LAUNCH RPM of the bike - ", 0);
    }					  					  
    while (pr ==0)
    {
        pr = prompt("Enter the PRIMARY RATIO of the bike - ", 0);
    }
    while (ir ==0)
    {
        ir = prompt("Enter the INTERNAL RATIO of the bike - ", 0);
    }	
    while (sr ==0)
    {
        sr = prompt("Enter the SECONDARY RATIO of the bike - ", 0);
    }	
    while (eff ==0)
    {
        eff = prompt("Enter the EFFICIENCY FACTOR of the bike - ", 0);
    }	
	dwt = fwt * pr * ir * sr * eff;
	dwt = dwt + " ";
    if (dwt != 0);
    {
        alert("Your DRIVE WHEEL TORQUE is " + dwt.substring(0,6));
    }
}
	 
function computeWT()
{
    var dwt = 0		 // drive wheel torque
    var rr = 0	  // tire rolling radius in feet
	var wt = 0		  // wheel thrust, what we're
			  		  //     solving for
    while (dwt ==0)
    {
        dwt = prompt("Enter the DRIVE WHEEL TORQUE of the bike - ", 0);
    }					  					  
    while (rr ==0)
    {
        rr = prompt("Enter the ROLLING RADIUS of the rear wheel (in feet) - ", 0);
    }	
	wt = dwt/rr
	wt = wt + " ";
    if (wt != 0);
    {
        alert("Your WHEEL THRUST is " + wt.substring(0,6));
    }
}

function computeGF()
{
    var wt = 0		 // wheel thrust
    var owgt = 0	  // overall weight, bike and rider
	var gf = 0		  // g force, what we're
			  		  //     solving for
    while (wt ==0)
    {
        wt = prompt("Enter the WHEEL THRUST of the bike - ", 0);
    }					  					  
    while (owgt ==0)
    {
        owgt = prompt("Enter the OVERALL WEIGHT (BIKE AND RIDER) - ", 0);
    }	
	gf = wt/owgt;
	gf = gf + " ";
    if (gf != 0);
    {
        alert("Your G FORCE is " + gf.substring(0,6));
    }
}

function computeWGTT()
{
    var owgt = 0	// oveall weight
    var cgy = 0	 	// center of gravity heighth
	var wb = 0		  // wheelbase
	var gf = 0		  // g force
	var wgtt = 0		  // weight transfer, what we're
			  		  //     solving for
    while (owgt == 0)
    {
        owgt = prompt("Enter the OVERALL WEIGHT (BIKE AND RIDER) - ", 0);
    }					  					  
    while (cgy == 0)
    {
        cgy = prompt("Enter the CENTER OF GRAVITY HEIGHT of the bike - ", 0);
    }
    while (wb == 0)
    {
        wb = prompt("Enter the WHEELBASE of the bike - ", 0);
    }	
    while (gf == 0)
    {
        gf = prompt("Enter the G FORCE of the bike - ", 0);
    }		
	wgtt = ((owgt * cgy)/wb) * gf;
	wgtt = wgtt + " ";
    if (wgtt != 0);
    {
        alert("Your WEIGHT TRANSFER is " + wgtt.substring(0,6));
    }
}
								  

