if (!window.GoalGuage)
	window.GoalGuage = {};

GoalGuage.Page = function() 
{
}

var YellowVal=0;
var RedVal=24080;
var BlueVal=0;
var GoalVal=24000;

GoalGuage.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		//document.getElementById("silverlightControlHost").style.marginTop="-42";
		this.control.content.findName("PageScale").ScaleX = ".75";
		this.control.content.findName("PageScale").Scaley = ".75";

		this.control.content.findName("RedValue").Text = "$" + String(RedVal);
    this.ScaleAnimation(RedVal, "RedKey",0);
		this.control.content.findName("RisingRed").Begin();
		
		//this.ScaleAnimation(YellowVal, "YellowKey",-20);
		//this.control.content.findName("RisingYellow").Begin();
		
		//this.ScaleAnimation(BlueVal, "BlueKey",0);
		//this.control.content.findName("RisingBlue").Begin();

		this.control.content.findName("RisingGoal").Begin();  
		
		this.control.content.findName("GoalValue").Text = "$"+String(GoalVal)+"\nGoal";
		
		//this.control.content.findName("YellowValue").Text = "$"+String(YellowVal);
		//this.control.content.findName("BlueValue").Text = "$"+String(BlueVal)+"\nGoal";
		
	}
	, 
	ScaleAnimation:function(StopValue, KeyName, textBump)
	{
		this.control.content.findName(KeyName+"1").Value = String(parseInt(this.control.content.findName(KeyName+"1").Value)*StopValue/GoalVal);
		this.control.content.findName(KeyName+"2").Value = String(parseInt(this.control.content.findName(KeyName+"2").Value)*StopValue/GoalVal);
		this.control.content.findName(KeyName+"3").Value = String(parseInt(textBump+this.control.content.findName(KeyName+"3").Value)*StopValue/GoalVal);
	}
}