﻿function menuCall(myname)
{
    if (myname == "1") {
        jQuery('#aboutus').addClass("wp-button-active");
    }
    else if (myname == "2") {
        jQuery('#services').addClass("serv-button-active");
    }
    else if (myname == "3") {
        jQuery('#projects').addClass("prdct-button-active");
    }
    else if (myname == "4") {
        jQuery('#clients').addClass("clnt-button-active");
    }
    else if (myname == "5") {
        jQuery('#videos').addClass("vdo-button-active");
    }
    else if (myname == "6") {
        jQuery('#trainings').addClass("trng-button-active");
    }
    else if (myname == "7") {
        jQuery('#blogs').addClass("blog-button-active");
    }
    else if (myname == "8") {
        jQuery('#downloads').addClass("dwnld-button-active");
    }
    else if (myname == "9") {
        jQuery('#forums').addClass("frm-button-active");
    }
    else if (myname == "10") {
        jQuery('#whitepapers').addClass("whitepapers-btn-active");
    }
}

$(document).ready(function() {

    //Get the height of the first item
    $('#mask').css({ 'height': $('#panel-1').height() });

    //Calculate the total width - sum of all sub-panels width
    //Width is generated according to the width of #mask * total of sub-panels
    $('#panel').width(parseInt($('#mask').width() * $('#panel div').length));

    //Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
    $('#panel div').width($('#mask').width());

    //Get all the links with rel as panel
    $('a[rel=panel]').click(function() {

        //Get the height of the sub-panel
        var panelheight = $($(this).attr('href')).height();

        //Set class for the selected item
        $('a[rel=panel]').removeClass('selected');
        $(this).addClass('selected');

        //Resize the height
        $('#mask').animate({ 'height': panelheight }, { queue: false, duration: 500 });

        //Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
        $('#mask').scrollTo($(this).attr('href'), 800);

        //Discard the link default behavior
        return false;
    });

});

$(document).ready(function() {
    $("#slider").easySlider();
});	

function Linker(url)
{
    window.open(url, '', 'width=1024,height=768');
}
