﻿//PAGE LOAD =============================================================================
$(document).ready(function () {
    setupGui();
});

//SETUP GUI
function setupGui() {

    //SIGNUP BUTTON
    $(".imgSignupHereButton").click(function () {
        $(".tblcheckDomainForm").slideToggle("fast");
    });

    bindClientDomainEvents();


    //CONTINUE TO SIGNUP FORM
    $(".imgContinueToSignupForm").click(function () {

        //alert("The website will be live shortly!");

        var clientID = $("#txtclientID").val();

        if (clientID.length >= 3) {
            if ($(".domainGreenBox:visible").length > 0) {

                window.location.replace("https://www.quickfile.co.uk/register.aspx?clID=" + clientID);
            } else {
                alert("Please enter a valid name before continuing!");
            }
        } else {
            alert("Your name must contain at least three characters!");
        }

    });


    //Feature slides
    $(".feature_button_01").click(function () {
        closeOpenFeatures();
        $("#imgFeature").attr("src", "/images/site-pics/accounting-dashboard.jpg");
        $("#feature_panel_01").show();
    });
    $(".feature_button_02").click(function () {
        closeOpenFeatures();
        $("#imgFeature").attr("src", "/images/site-pics/cloud-invoicing.jpg");
        $("#feature_panel_02").show();
    });
    $(".feature_button_03").click(function () {
        closeOpenFeatures();
        $("#imgFeature").attr("src", "/images/site-pics/client-management.jpg");
        $("#feature_panel_03").show();
    });
    $(".feature_button_04").click(function () {
        $("#imgFeature").attr("src", "/images/site-pics/customisation.jpg");
        closeOpenFeatures();
        $("#feature_panel_04").show();
    });
    $(".feature_button_05").click(function () {
        $("#imgFeature").attr("src", "/images/site-pics/payment-online.jpg");
        closeOpenFeatures();
        $("#feature_panel_05").show();
    });
    $(".feature_button_06").click(function () {
        $("#imgFeature").attr("src", "/images/site-pics/receipt-digitisation.jpg");
        closeOpenFeatures();
        $("#feature_panel_06").show();
    });
    $(".feature_button_07").click(function () {
        $("#imgFeature").attr("src", "/images/site-pics/bank-tagging.jpg");
        closeOpenFeatures();
        $("#feature_panel_07").show();
    });
}


//CLOSE ALL OPEN FEATURE PANELS
function closeOpenFeatures() {

    if ($("#feature_panel_01:visible").length > 0) {
        $("#feature_panel_01").hide();
    }

    if ($("#feature_panel_02:visible").length > 0) {
        $("#feature_panel_02").hide();
    }

    if ($("#feature_panel_03:visible").length > 0) {
        $("#feature_panel_03").hide();
    }

    if ($("#feature_panel_04:visible").length > 0) {
        $("#feature_panel_04").hide();
    }

    if ($("#feature_panel_05:visible").length > 0) {
        $("#feature_panel_05").hide();
    }

    if ($("#feature_panel_06:visible").length > 0) {
        $("#feature_panel_06").hide();
    }

    if ($("#feature_panel_07:visible").length > 0) {
        $("#feature_panel_07").hide();
    }


}




