﻿if (!window.homeheroes)
	window.homeheroes = {};

homeheroes.Page = function() 
{
}

homeheroes.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		
		this.Animacion1 = this.control.content.findName('llave1');		
		this.Animacion2 = this.control.content.findName('puntos1');		
		
		this.Animacion1.Begin();
		this.Animacion2.Begin();
		
		this.RollOver1= this.control.content.findName('rollover1');		
		this.RollOut1= this.control.content.findName('rollout1');		
		this.RollOver2= this.control.content.findName('rollover2');		
		this.RollOut2= this.control.content.findName('rollout2');		
		this.RollOver3= this.control.content.findName('rollover3');		
		this.RollOut3= this.control.content.findName('rollout3');		
		this.RollOver4= this.control.content.findName('rollover4');		
		this.RollOut4= this.control.content.findName('rollout4');		
		
		// Sample event hookup:			
		this.button1 = this.control.content.findName('acceso1');
		this.button1.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button1Rollover));		
		this.button1.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button1RollOut));		
		this.button1.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button1Click));
		
		this.button2 = this.control.content.findName('acceso2');
		this.button2.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button2Rollover));		
		this.button2.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button2RollOut));
		this.button2.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button2Click));
		
		this.button3 = this.control.content.findName('acceso3');
		this.button3.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button3Rollover));		
		this.button3.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button3RollOut));
		this.button3.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button3Click));
		
		this.button4 = this.control.content.findName('acceso4');
		this.button4.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.button4Rollover));		
		this.button4.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.button4RollOut));
		this.button4.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.button4Click));
		
		this.Llave= this.control.content.findName('llave');		
		
		var foo = document.getElementById('lnkPassport');		
		if (foo.href.indexOf('logout') > 0)
		    this.Llave.Visibility = 'Collapsed';
        else
            this.Llave.Visibility = 'Visible';
        
		this.Llave.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.clickLlave));		
		
		
	},
	clickLlave: function(sender, eventArgs) 
	{
	    location.href = document.getElementById('lnkPassport').href;
	},
	button1Rollover: function(sender, eventArgs) 
	{   
	    this.RollOver1.Begin();
	},
	button1RollOut: function(sender, eventArgs) 
	{	
	    this.RollOut1.Begin();	  
	},
	button2Rollover: function(sender, eventArgs) 
	{	    
	    this.RollOver2.Begin();	    	    
	},
	button2RollOut: function(sender, eventArgs) 
	{   	    
	    this.RollOut2.Begin();
	},
	button3Rollover: function(sender, eventArgs) 
	{	    
	    this.RollOver3.Begin();	    	    
	},
	button3RollOut: function(sender, eventArgs) 
	{   	    
	    this.RollOut3.Begin();
	},
	button4Rollover: function(sender, eventArgs) 
	{	    
	    this.RollOver4.Begin();	    	    
	},
	button4RollOut: function(sender, eventArgs) 
	{
	    this.RollOut4.Begin();
	},

	button1Click : function(sender, eventArgs)
	{
	    location.href = 'http://www.microsoft.com/conosur/estamosconlosheroes/futbol/';
	},
	button2Click : function(sender, eventArgs)
	{
	    location.href = 'http://www.microsoft.com/mexico/eventos/lucha/';
	},
	button3Click : function(sender, eventArgs)
	{
	    location.href = 'http://www.mslatam.com/latam/estamosconlosheroes/robot.aspx';	    
	},
	button4Click : function(sender, eventArgs)
	{
	    location.href = 'http://www.mslatam.com/latam/estamosconlosheroes/video.aspx';	    
	}	
}