﻿

$(document).ready(function () {

    // alert('Mapping is correct');
    $('.JavaAnnoucement').hide();
   // $('#MembershipInfo').hide();

    $('#cContent .tabContent:not(:first)').hide();

    $('#composer-nav li').click(function (e) {
        $('#cContent .tabContent').hide();
        $('#composer-nav .current').removeClass("current");
        $(this).addClass('current');

        var clicked = $(this).find('a:first').attr('href');
        $('#cContent ' + clicked).fadeIn('fast');
        e.preventDefault();
    }).eq(0).addClass('current');


    var Clicked;
    $('.buyitnowContainer').click(function (e) {

        Clicked = $(this).find('.ProductsContainer').fadeIn('slow');



    });


    $('.CloseBtn').click(function (e) {

        $(Clicked).fadeOut('slow');
        return false;


    });


    $('#MemberInfoLink').click(function (e) {

        $('#MembershipInfo').toggle();

        if ($('#MembershipInfo').is(':visible')) {

            $('#MemberInfoLink').attr('value', 'Hide Membership Information');
        } else {
            $('#MemberInfoLink').attr('value', 'View Membership Information');
        }
    });



    $('#cleftColumn a').hover(function () {
        var strName = $(this).attr('href');
        var ext = strName.substring(strName.lastIndexOf('/') + 1, strName.length);
        ext = jQuery.trim(ext);

        $('#pText').text(ext);
    });



    //    $('.cImage').hover(function () {
    //        var strName = $(this).attr('alt');
    //        var ext = strName.substring(strName.lastIndexOf('/') + 1, strName.length);
    //        ext = jQuery.trim(ext);

    //        $('#pText').text(ext);

    //        $(this).css('margin', '0px').animate({ height: '+=5px' }, 200);
    //    }, function () {
    //        $(this).css('margin', '10px').animate({ height: '-=5px' }, 200);
    //    });



    $('.cImage img').animate({ height: 75 }, 0).css({'border': 'none'}); //Set all menu items to smaller size

    $('.cImage').mouseover(function () { //When mouse over menu item

        gridimage = $(this).find('img'); //Define target as a variable
        gridimage.stop().animate({ height: 125 }, 150); //Animate image expanding to original size

        var strName = $(this).find('img').attr('alt');
                var ext = strName.substring(strName.lastIndexOf('/') + 1, strName.length);
                ext = jQuery.trim(ext);

                $('#pText').text(ext);

    }).mouseout(function () { //When mouse no longer over menu item

        gridimage.stop().animate({ height: 75 }, 150); //Animate image back to smaller size

    });



});                         //end doc ready

    //    $('.pv').click(function () {

    //        var container = $('.Mastermain'),
    //    scrollTo = $('#PreviewSection');

    //        container.scrollTop(
    //    scrollTo.offset().top - container.offset().top);


    //    });

//    title = $("#PreviewSection #Labeltitle").val();

//    if (title.length > 0) {
//        $.scrollTo($(".Mastermain #PreviewSection #LabelDescriptionPreview"), { duration: 1000 });
//    }

//    $(".pv").click(function () {
//        isClicked = true;
//    });
//    function scrollTo() {
//        if (isClicked) {
//            $.scrollTo($(".Mastermain #PreviewSection #LabelDescriptionPreview"), { duration: 1000 });
//            isClicked = false;
//        }
//    }





//Menu Script/////////////////////

//    var d = 300;
//    $('#navigation a').each(function () {
//        $(this)
//        .stop(true, true)
//        .animate({'marginTop': '-80px'}, d +=300);
//    });

//    $('#navigation > li').hover(
//                function () {
//                    $('a', $(this)).stop(true, true).animate({
//                        'marginTop': '-70px'
//                    }, 200);
//                },
//                function () {
//                    $('a', $(this)).stop(true, true).animate({
//                        'marginTop': '-80px'
//                    }, 200);
//                }
//            );

//Menu Script End/////////////////////     

// hide all the content panes when the page loads
//                $('#AccordianDiv > div').hide();

//                // uncomment the next line if you'd like the first pane to be visible by default
//                $('#AccordianDiv > div:last').show();

//                $('#AccordianDiv h3').click(function () {
//                    $('#AccordianDiv > div').hide();
//                    $(this).next().animate(
//	                { 'height': 'toggle' }, 1500, 'easeOutBounce');

//                });

// END how 2 page script//


