var global_control;
var pageno="";
if (!window.nav)
	nav = {};

nav.Page = function() 
{
}


nav.Page.prototype =
{


	handleLoad: function(control, userContext, rootElement) 
	{
		if (pageno=="")
			pageno=1;	
			
		this.control = control;	
		global_control=control;
			
		this.text1 = this.control.content.FindName ("text1");
		this.text1.cursor="Hand";
		this.text1.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text1.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text1.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		this.text2 = this.control.content.FindName ("text2");
		this.text2.cursor="Hand";
		this.text2.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text2.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text2.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		this.text3 = this.control.content.FindName ("text3");
		this.text3.cursor="Hand";
		this.text3.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text3.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text3.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		this.text4 = this.control.content.FindName ("text4");
		this.text4.cursor="Hand";
		this.text4.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text4.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text4.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		this.text5 = this.control.content.FindName ("text5");
		this.text5.cursor="Hand";
		this.text5.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text5.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text5.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		this.text6 = this.control.content.FindName ("text6");
		this.text6.cursor="Hand";
		this.text6.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button_MouseEnter));
		this.text6.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button_MouseLeave));		
		this.text6.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button_MouseDown));						
		
		global_control.content.FindName ("btn"+pageno+"_stay").opacity = 1;

	},
	
	button_MouseEnter: function(sender, eventArgs)
	{
		if(sender.Name.toString() == "text1" && pageno!="1")
		{
			this.control.content.FindName ("btn_on1").Visibility="Visible";
			this.control.content.FindName ("btn_on1_rollover").begin();
		}
		else if(sender.Name.toString() == "text2" && pageno!="2")
		{
			this.control.content.FindName ("btn_on2").Visibility="Visible";
			this.control.content.FindName ("btn_on2_rollover").begin();
		}
		else if(sender.Name.toString() == "text3" && pageno!="3")
		{
			this.control.content.FindName ("btn_on3").Visibility="Visible";
			this.control.content.FindName ("btn_on3_rollover").begin();
		}
		else if(sender.Name.toString() == "text4" && pageno!="4")
		{
			this.control.content.FindName ("btn_on4").Visibility="Visible";
			this.control.content.FindName ("btn_on4_rollover").begin();
		}
		else if(sender.Name.toString() == "text5" && pageno!="5")
		{
			this.control.content.FindName ("btn_on5").Visibility="Visible";
			this.control.content.FindName ("btn_on5_rollover").begin();
		}
		else if(sender.Name.toString() == "text6" && pageno!="6")
		{
			this.control.content.FindName ("btn_on6").Visibility="Visible";
			this.control.content.FindName ("btn_on6_rollover").begin();
		}
	},
	button_MouseLeave: function(sender, eventArgs)
	{
		if(sender.Name.toString() == "text1" && pageno!="1")
		{
			this.control.content.FindName ("btn_on1_rollout").begin();
			this.control.content.FindName ("btn_on1").Visibility="Collapsed";
		}
		else if(sender.Name.toString() == "text2" && pageno!="2")
		{
			this.control.content.FindName ("btn_on2_rollout").begin();
			this.control.content.FindName ("btn_on2").Visibility="Collapsed";
		}
		else if(sender.Name.toString() == "text3" && pageno!="3")
		{
			this.control.content.FindName ("btn_on3_rollout").begin();
			this.control.content.FindName ("btn_on3").Visibility="Collapsed";
		}
		else if(sender.Name.toString() == "text4" && pageno!="4")
		{
			this.control.content.FindName ("btn_on4_rollout").begin();
			this.control.content.FindName ("btn_on4").Visibility="Collapsed";
		}
		else if(sender.Name.toString() == "text5" && pageno!="5")
		{
			this.control.content.FindName ("btn_on5_rollout").begin();
			this.control.content.FindName ("btn_on5").Visibility="Collapsed";
		}
		else if(sender.Name.toString() == "text6" && pageno!="6")
		{
			this.control.content.FindName ("btn_on6_rollout").begin();
			this.control.content.FindName ("btn_on6").Visibility="Collapsed";
		}
	},
	button_MouseDown: function(sender, eventArgs)
	{
		if(sender.Name.toString() == "text1" && pageno!="1")
		{
			window.location="default.aspx";
		}
		else if(sender.Name.toString() == "text2" && pageno!="2")
		{
			window.location="whyattend.aspx";
		}
		else if(sender.Name.toString() == "text3" && pageno!="3")
		{
			window.location="Reliveteched2008.aspx";
		}
		else if(sender.Name.toString() == "text4" && pageno!="4")
		{
			window.location="agenda.aspx";
		}
		else if(sender.Name.toString() == "text5" && pageno!="5")
		{
			window.location="speakers.aspx";
		}
		else if(sender.Name.toString() == "text6" && pageno!="6")
		{
			window.location="partner.aspx";
		}
	},
	button_MouseUp: function(sender, eventArgs)
	{		
	}
}

function setpageNo(id)
{
	pageno=id;
}