﻿jQuery(document).ready(function () {
    // Initialization



    // EVENTS
    // This event is used to make the owner menu big or small
    $(".howitworks li a").mouseover(function () {
        var id = '#' + $(this).attr("name");
        $('.hidden').hide();
        $(id).show();
    }).mouseout(function () {
    });




    // Web Space 
    // check if the entered webspace name is used or not
    $("a[name=verifyWebSpace]").click(function () {
        var web = $("#WebSpaceName").val();
        var href = '/Partially/Ajax1/VerifyWebSpace/' + escape(web);
        $.ajax({
            url: href,
            type: "POST",
            dataType: "text",
            error: function (data, error) {
                // show the error
            },
            success: function (data) {
                // show the return message and form
                $("#jeClickBucket").html(data);

                showDialog({ 'title': 'Webspace Registration', 'height':400});
                // Start a five minutes timer
                var Countdown = setInterval(function () {
                    $("#webSpaceAddOnForm").html("Sorry yor time has expired! Please verify your web space name again if you have not reserved it.");
                    clearInterval(Countdown);
                }, 300000);
            }
        });
    })

    // end of document ready
});

