﻿$(document).ready(function () {
    if ($('.watermarked_phone').length > 0) {
        $('.watermarked_phone').watermark('watermarked_phone', 'optional');
    }

    



});

jQuery(function ($) {
    // Load dialog on page load
    //$('#basic-modal-content').modal();

    $('#termsLink').click(function (e) {
        $("#sample").modal();
        return false;

    });

    $('#termsCheckBox').click(function (e) {
        if ($("#termsCheckBox").is(':checked')) {
            if ($("#product-purchase").is(":hidden")) {
                $("#product-purchase").slideDown();
            }
        } else {
            if (!$("#product-purchase").is(":hidden")) {
                $("#product-purchase").slideUp();
            }
        }
        //alert($("#termsCheckBox").is(':checked'));
        //return false;

    });

});

(function ($) {
    $.fn.watermark = function (css, text) {
        return this.each(function () {
            var i = $(this), w;
            i.focus(function () {
                w && !(w = 0) && i.removeClass(css).data('w', 0).val('');
            })
			.blur(function () {
			    !i.val() && (w = 1) && i.addClass(css).data('w', 1).val(text);
			})
			.closest('form').submit(function () {
			    w && i.val('');
			});
            i.blur();
        });
    };
    $.fn.removeWatermark = function () {
        return this.each(function () {
            $(this).data('w') && $(this).val('');
        });
    };
})(jQuery);


