﻿/// <reference path="libs/jquery-1.3.2-vsdoc.js" />
/**
*	Javascript Tools based on jquery
*
*	@date		2009-03-13
*	@author		Michal Gondar
*	@copyright	Live Nation (Music) UK
*   @require    jquery
*   @jquery     jquery-1.3.1.min.js
*
*   used on info
*/


var info = {

    aLinks: new Array,
    aConten: new Array,

    init: function() {
        this.aLinks = $(".info-body");

        // hide all body
        $(".info-body").hide();

        // open first
        $(this.aLinks[0]).show();

        // select first active item in left menu
        $(".info-menu:first").addClass("active");

        // change id, reason: prevent jumping page when using javascript to showing content
        $(".info-body").each(function() {
            this.id = "JS" + this.id;
        });

        // make links
        $(".info-menu").click(function() {

            // hide all
            $(".info-body").hide();

            // open selected
            var id = this.id.substring(4);
            $(info.aLinks[id - 1]).show();
            $('#submenuinfo li a').removeClass('active');
            $('#menu' + this.id.substring(4)).addClass('active');
        });
        
        // open post if deep linking is in use
        var pathArray = window.location + '';
        pathArray = pathArray.split('#');
        if(pathArray[1] == undefined)
        {}
        else
        {
            // hide all
            $(".info-body").hide();
            $('#submenuinfo li a').removeClass('active');

            $("#JS" + pathArray[1]).show();
            $('#menu' + pathArray[1].substring(4)).addClass('active');
        }
    }
};
