﻿$(document).ready(function() {

    
    //Hand-on class selection
    $("div.expandSectionTop").click(function() {
        var id = $(this).attr("id");
        var showid = "#" + id + "_Grid";
        var img = "#" + id + "_Img";
        var src = $(img).attr("src");


        if ($(showid).is(":hidden")) {
            $(showid).slideDown("slow");
            var newSrc = src.replace("plus.gif", "minus.gif");
            //var newSrc = src.replace("arrow_right.png", "arrow_down.png");
            $(img).attr("src", newSrc);
        }
        else {
            $(showid).slideUp("slow");
            var newSrc = src.replace("minus.gif", "plus.gif");
            //var newSrc = src.replace("arrow_down.png", "arrow_right.png");
            $(img).attr("src", newSrc);
        }
    });
  


    //Information about PDS
    $('#pdsMsg').click(function() {
        $.blockUI({
            message: $('#divpds'),
            fadeIn: 350,
            fadeOut: 1000,
            css: {
                top: ($(window).height() - 300) / 2 + 'px',
                left: ($(window).width() - 800) / 2 + 'px',
                width: '800px'
            }

        });
    });

    $('#imgPds').click(function() {
        $.unblockUI();
        return false;
    });


    //Handout popup
    $("#aHandouts").live("click", function() {
        $.blockUI({
            message: $('#divHandoutMsg'),
            fadeIn: 800,
            fadeOut: 800,
            css: {
                top: ($(window).height() - 350) / 2 + 'px',
                left: ($(window).width() - 700) / 2 + 'px',
                width: '700px'
            }

        });
    });

    $('#imgHandout').live("click", function() {
        $.unblockUI();
        return false;
    });

    //Countdown popup
    $("#aCountdown").live("click", function() {
        $.blockUI({
            message: $('#divCountDownMsg'),
            fadeIn: 800,
            fadeOut: 800,
            css: {
                top: ($(window).height() - 350) / 2 + 'px',
                left: ($(window).width() - 700) / 2 + 'px',
                width: '700px'
            }

        });
    });

    $('#imgCountDown').live("click", function() {
        $.unblockUI();
        return false;
    });

    
    //        $("*[name$='btnSubmitPayment']").click(function() {
    //            $(this).attr("disable", true);
    //            
    //            setTimeout('document.images["imgPayProcess"].src = "../image/payProcessing.gif"', 200);
    //            $.blockUI({
    //                message: $('#divpayProcess'),
    //                fadeIn: 500,
    //                fadeOut: 500,
    //                css: {
    //                    top: ($(window).height() - 100) / 2 + 'px',
    //                    left: ($(window).width() - 200) / 2 + 'px',
    //                    width: '200px'
    //                }
    //            });
    //        });


});

