/*****************************************************
 *
 *  Copyright (c) 2005-2007, SWCast Network, Inc.
 *  Unauthorized Reproduction Prohibited.
 *
 *****************************************************/

function RateCalc( LM, LA, LN, RA, RP, RD )
{
	this.Hrs = ( LM * 6 + LA * 6 + LN * 12 ) * 30;
	this.Rev = RA * 4 + RP * 4 + RD * 4;

	if( this.Hrs >= 128000 || this.Rev >= 400 )
        {
		this.Prog = 'Not Eligible';
		this.Note = 'Sorry, you are not eligible for the JPL Program.';
        }
        else if( this.Hrs >= 64000 || this.Rev >= 200 )
        {
		this.Prog = 'Pro 4 Tier';
		this.Note = ( this.Hrs >= 115200 || this.Rev >= 360 ?
			'You are within 10% of exceeding the Pro 4 Tier qualifications.' :
			'You are eligible for the Pro 4 Tier.'
		)
	}
        else if( this.Hrs >= 32000 || this.Rev >= 100 )
        {
		this.Prog = 'Pro 3 Tier';
		this.Note = ( this.Hrs >= 57600 || this.Rev >= 180 ?
			'Because you are within 10% of exceeding the Pro 3 Tier qualifications, you should consider the Pro 4 Tier.' :
			'You are eligible for the Pro 3 Tier.'
		)
	}
        else if( this.Hrs >= 16000 || this.Rev >= 50 )
        {
		this.Prog = 'Pro 2 Tier';
		this.Note = ( this.Hrs >= 28800 || this.Rev >= 90 ?
			'Because you are within 10% of exceeding the Pro 2 Tier qualifications, you should consider the Pro 3 Tier.' :
			'You are eligible for the Pro 2 Tier.'
		)
	}
	else if( this.Hrs >= 8000 || this.Rev > 0 )
	{
		this.Prog = 'Pro 1 Tier';
		this.Note = ( this.Hrs >= 14400 || this.Rev >= 45 ?
			'Because you are within 10% of exceeding the Pro 1 Tier qualifications, you should consider the Pro 2 Tier.' :
			'You are eligible for the Pro 1 Tier.'
		)
	}
	else if( this.Hrs >= 4000 )
	{
		this.Prog = 'Basic Tier';
		this.Note = ( this.Hrs >= 7200 ?
			'Because you are within 10% of exceeding the Basic Tier qualifications, you should consider the Pro 1 Tier.' :
			'You are eligible for the Basic Tier.'
		)
	}
	else if( this.Hrs >= 2000 )
	{
		this.Prog = 'Intro Tier';
		this.Note = ( this.Hrs >= 3600 ?
			'Because you are within 10% of exceeding the Intro Tier qualifications, you should consider the Basic Tier.' :
			'You are eligible for the Intro Tier.'
		)
	}
	else
	{
		this.Prog = 'Trial Tier';
		this.Note = ( this.Hrs >= 1800 ?
			'Because you are within 10% of exceeding the Trial Tier qualifications, you should consider the Intro Tier.' :
			'You are eligible for the Trial Tier.'
		)
	}
};
