﻿if (!window.botoneraEstadio)
	window.botoneraEstadio = {};

botoneraEstadio.Page = function() 
{
}

var root;
var inMenu = false;
var inMenu2 = false;

botoneraEstadio.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		root = rootElement;		
		animation1 = root.findName('botonesInicio');
        animation1.Begin();
		
		// Sample event hookup:	
		//rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
	},
	
	// Sample event handler
	handleMouseDown: function(sender, eventArgs) 
	{
		// The following line of code shows how to find an element by name and call a method on it.
		// this.control.content.findName("Storyboard1").Begin();
	}
}
function fn_bot1Enter(sender, args)
{    
    animation1 = root.findName('boton1over');    
    animation1.Begin();  
    root.findName('menu_bot1').visibility = 'Visible';
    inMenu = true;  
    root.findName('menu_arg').visibility = 'Collapsed';
    root.findName('menu_chile').visibility = 'Collapsed';
    hideMenu2();    
}

function fn_bot2Enter(sender, args)
{    
    animation1 = root.findName('boton2over');
    root.findName('menu_bot2').visibility = 'Visible';    
    inMenu2 = true;
    animation1.Begin();    
    hideMenu1();    
}

function fn_bot3Enter(sender, args)
{    
    animation1 = root.findName('boton3over');
    animation1.Begin();    
    hideMenu1();   
    hideMenu2();   
}
function fn_bot3Leave(sender, args)
{
    animation1 = root.findName('boton3out');
    animation1.Begin();
}
function fn_bot4Enter(sender, args)
{    
    animation1 = root.findName('boton4over');
    animation1.Begin();    
    hideMenu1();
    hideMenu2();
        
}
function fn_bot4Leave(sender, args)
{
    animation1 = root.findName('boton4out');
    animation1.Begin();
}
function fn_bot5Enter(sender, args)
{    
    animation1 = root.findName('boton5over');
    animation1.Begin();     
    hideMenu1();   
    hideMenu2();
}
function fn_bot5Leave(sender, args)
{
    animation1 = root.findName('boton5out');
    animation1.Begin();
}
function fn_chileEnter(sender, args)
{
	if (inMenu)
	{
	    root.findName('menu_chile').visibility = 'Visible';    
	    root.findName('menu_arg').visibility = 'Collapsed';    
	    root.findName('ch_chile').foreground= "#FFFF0000"; 	    
	}

}
function fn_chileLeave(sender, args)
{    
    root.findName('ch_chile').foreground= "#FFFFFFFF"; 
}
function fn_argEnter(sender, args)
{
	if (inMenu)
	{
    	root.findName('menu_arg').visibility = 'Visible';    
	    root.findName('menu_chile').visibility = 'Collapsed';
	    root.findName('arg_argentina').foreground= "#FFFF0000";       
	}

}
function fn_argLeave(sender, args)
{    
    root.findName('arg_argentina').foreground= "#FFFFFFFF";
}

function fn_canvasLeave(sender, args)
{
    hideMenu1();  
    hideMenu2();  
}

function hideMenu1()
{
    if (inMenu)
    {
        animation2 = root.findName('boton1out');
        animation2.Begin();    
        root.findName('menu_bot1').visibility = 'Collapsed';
        root.findName('menu_arg').visibility = 'Collapsed';
        root.findName('menu_chile').visibility = 'Collapsed';
    }
    inMenu = false;
}

function hideMenu2()
{
    if (inMenu2)
    {        
        animation2 = root.findName('boton2out');
        animation2.Begin();    
        
    }
    root.findName('menu_bot2').visibility = "Collapsed";
        inMenu2 = false;
}

function fn_textEnter(sender, args)
{
    sender.foreground = "#FFFF0000";
}
function fn_textLeave(sender, args)
{
    sender.foreground = "#FFFFFFFF";
}
function showDiv(sender, args)
{
    var divName = sender.name;
    hideAllDivs();
    switch (divName)
    {
        case 'arg_fotos' :
        case 'ch_fotos' :
            divName = 'fotos';
            break;
        case 'arg_goleadores' :
        case 'ch_goleadores' :
            divName = 'ganadores';
            break;        
    }
    document.getElementById(divName).style.display = '';
}
function hideAllDivs()
{
    document.getElementById('fotos').style.display = 'none';    
    document.getElementById('ganadores').style.display = 'none';  
    document.getElementById('arg_argentina2').style.display = 'none';  
    document.getElementById('ch_chile2').style.display = 'none';  
    document.getElementById('arg_campeonato').style.display = 'none';  
    document.getElementById('ch_campeonato').style.display = 'none';  
    document.getElementById('arg_fechas').style.display = 'none';  
    document.getElementById('ch_fechas').style.display = 'none';  
    document.getElementById('estadiohome').style.display = 'none';  
    document.getElementById('entradasvip').style.display = 'none';  
    document.getElementById('imgBackground').background = '/conosur/estamosconlosheroes/futbol/images/fondo.jpg';
    document.getElementById('imgTop').src= '/conosur/estamosconlosheroes/futbol/images/mic_lat_heroes_est-home.jpg';
}

function boton3click(sender, args)
{
    hideAllDivs();
    document.getElementById('entradasvip').style.display = '';      
}
function boton5click(sender, args)
{
    hideAllDivs();
    document.getElementById('estadiohome').style.display = '';      
    document.getElementById('imgBackground').background = '/conosur/estamosconlosheroes/futbol/images/fondo2.jpg';
    document.getElementById('imgTop').src= '/conosur/estamosconlosheroes/futbol/images/mic_lat_heroes_est-home2.jpg';
}
function boton4click(sender, args)
{
    window.open('http://www.mslatam.com/latam/estamosconlosheroes/WS08-1.aspx');
}