﻿/// <reference path="../Plugins/jquery-1.3.2-vsdoc.js" />
$(document).ready(function() {
    if ($("#IsB2CCustomer").is(':checked')) {
        $("#companyRegistrations").hide();
        $("#persnr").show();
        $("#orgnr").hide();
    }
    else {
        $("#companyRegistrations").show();
        $("#persnr").hide();
        $("#orgnr").show();
    }
    ShowHideAddress();
    $("#hideDeliveryAddress").click(function() { ShowHideAddress(); });

    $("#IsB2CCustomer").click(function() {
        if ($(this).is(':checked')) {
            $("#companyRegistrations").hide();
            $("#persnr").show();
            $("#orgnr").hide();
        }
        else {
            $("#companyRegistrations").show();
            $("#persnr").hide();
            $("#orgnr").show();
        }
    });


    // From the page.
    $(".customerPassword").hide();

    $("#Password").focus(function() {
        $(".customerPassword").show();
    });

    $("#Password").focusout(function() {
        $(".customerPassword").hide();
    });
    $(".single-field input").focus(function() {
        $(this)
					.parent()
						.addClass("curFocus")
					.children("div")
						.toggle();
    });
    $(".single-field input").blur(function() {
        $(this)
					.parent()
						.removeClass("curFocus")
					.children("div")
						.toggle();
    });

});
function ShowHideAddress() {
    if ($("#hideDeliveryAddress").attr('checked')) {
        $("#deliveryAddress").hide();
    } else {
        $("#deliveryAddress").show();
    }
}
