﻿// Javascript Base de www.textilalcoyana.com
// © Agrupación Empresarial Textil Alcoyana 2004-2012

//
// Funciones Estándar para el Website
//

// Ir al TOP de la página actual
function irArriba()
{
	scroll(0,0);
}

// Ir a una URL
function goToUrl(url)
{
	location.href=url;
}

// Ir a la página anterior
function PaginaAnterior()
{
	window.history.back();
}

// Mostrar y ocultar capa
function ShowHide(objetoid)
{
    var o = document.getElementById(objetoid);
	
	switch (o.style.display)
	{
		case 'none':
			o.style.display = 'block';
			break;
		case 'block':
			o.style.display = 'none';
			break;
	}
}

function MostrarOcultar(objetoid)
{
    var o = document.getElementById(objetoid);

    if (o.className == 'Invisible')
        o.className = 'Visible';
    else
        o.className = 'Invisible';
}


$(document).ready(function ()
{
    $("#divMenu ul li a").hover(function ()
    {
        // Cuando estamos encima del Tab

        // Los siguientes eventos son aplicados a los subelementos

        $(this).addClass("Hover"); // Seleccionar Tab
        $(this).parent().find("ul.items").show(); // Desplegar menú

        $(this).parent().hover(function ()
        {
        }, function ()
        {
            $(this).parent().find("ul.items").hide(); // Ocultar menú cuando el ratón sale
            $(this).parent().find("a").removeClass("Hover"); // Deseleccionar Tab
        });
    });
});
