// JavaScript Document
jQuery(document).ready(function () {
    var viewportHeight = $(window).height();
    var aboutPos = jQuery('#aboutPos').position();
    var innerPageHeight = jQuery('.innerPage').height();
    var innerContentHeight = jQuery('.innerContent').height();
    jQuery('.innerPage').height(0);
   	jQuery('.innerContent').height(0);
    jQuery('.fixedHeight').height(viewportHeight - aboutPos.top);
    jQuery('.fixedHeight').jScrollPane();
    jQuery('.closeBtn').hide();
    $('#recentWorks').hoverscroll({
        vertical: true,
        // Display the list vertically or not
        width: 232,
        // Width of the list
        height: viewportHeight - aboutPos.top,
        // Height of the list
        arrows: true,
        // Display arrows to the left and top or the top and bottom
        arrowsOpacity: 0.7,
        // Maximum opacity of the arrows if fixedArrows
        fixedArrows: false,
        // Fix the displayed arrows to the side of the list
        debug: false // Display some debugging information in firebug console
    });
    jQuery('.enterBtn').click(function () {
        $('.innerPage').animate({
            height: '100%'
        }, 500, function () {
            jQuery('.closeBtn').fadeIn();
            jQuery('.innerContent').animate({
                height: '100%'
            }, 600);
        });
    });


    jQuery('.closeBtn').click(function () {
		jQuery('.closeBtn').fadeOut();
         $('.innerContent').animate({
            height: 0
        }, 600, function () {
            
            jQuery('.innerPage').animate({
                height: 0
            }, 500);
        });
    });
	
    jQuery('#recentWorks li a').css("opacity", "0");
    jQuery('#recentWorks li').hover(

    function () {
        $(this).find('a').stop().animate({
            opacity: 1
        }, "700");
    }, function () {
        $(this).find('a').stop().animate({
            opacity: 0
        }, "700");
    });


});

jQuery(document).ready(function () {
$('#sectionsList').cycle({ 
    fx:     'scrollVert', 
    speed:  'fast', 
    timeout: 0, 
    pager:  '#leftMenu',
	nowrap:  1,
	rev:  1,
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#leftMenu li:eq(' + idx + ') a'; 
    } 
});

jQuery('.priceList li .head').click(function () 
    {
        jQuery(this).next('.priceListOut').slideDown();
        jQuery('.priceList li  .head').removeClass('blueTxt');
        jQuery(this).addClass('blueTxt');
        var indexA = jQuery(".priceList li .head").index(this);
        jQuery('.priceList li').find('.priceListOut').filter(function (index)
        {
            return index != indexA;
        }).slideUp();
    });
});
