/* Js for , Version=1777896463 */
 v.lang = {"confirmDelete":"Do you want to delete it?","deleteing":"Deleting","doing":"Doing","loading":"Loading","updating":"Updating","timeout":"Timeout. Please try it again.","errorThrown":"Error : ","continueShopping":"Continue shopping","required":"Required","back":"Back","continue":"Continue","bindWechatTip":"Posting sets the limit for binding WeChat. Please bind WeChat user first.","importTip":"Old layout data will be replaced","fullImportTip":"Old article, product, layout data will be replaced and import test data"};;v.goToPay = "The order is created successfully. Please go to the payment page to complete the payment.";;v.paid = "I have paid";;v.nameEmpty = "Please input Full Name";;v.emailEmpty = "Please input Email Address";;v.countryEmpty = "Please input Country";;v.birthdayEmpty = "Please input Date of Birth";;v.mobileEmpty = "Please input Phone Number";;$(document).ready(function()
{
    $('#submit').click(function()
    {   
        var name = $('#name').val();
        var birthday = $('#birthday').val();
        var email = $('#email').val();
        var mobile = $('#mobile').val();
        var country = $('#country').val();
        if(!name)
        {
            bootbox.alert(v.nameEmpty); 
            return false;
        }
        if(!birthday)
        {
            bootbox.alert(v.birthdayEmpty); 
            return false;
        }
        if(!email)
        {
            bootbox.alert(v.emailEmpty); 
            return false;
        }
        if(!mobile)
        {
            bootbox.alert(v.mobileEmpty); 
            return false;
        }
        if(!country)
        {
            bootbox.alert(v.countryEmpty); 
            return false;
        }
        var payment = $('input:radio[name=payment]:checked').val();
        if(payment == 'zelle')
        {   
            $('#checkForm').attr('target', '');
            $('#myModal').modal({show : true});
            return false;
        }
        if(payment == 'bank')
        {   
            $('#checkForm').attr('target', '');
            $('#myModal2').modal({show : true});
            return false;
        }
        if(payment == 'paypal')
        {
            $('#checkForm').attr('target', '_blank');
            bootbox.dialog(
            {  
                message: v.goToPay,  
                buttons:
                {  
                    paySuccess:
                    {
                        label:     v.paid,  
                        className: 'btn-primary',  
                        callback:  function() { setTimeout(function(){location.href = createLink('index', 'index');}, 600); }  
                    }
                }
            });
        }
    });

    $('.zellepay-btn').click(function()
    {
        $.setAjaxForm('#submitForm');
        $('#submitForm').submit();
        $('#myModal').modal('hide');
    });

    $('.bankpay-btn').click(function()
    {
        $.setAjaxForm('#submitForm');
        $('#submitForm').submit();
        $('#myModal2').modal('hide');
    });
});
$('#foot').insertBefore('#footer');
;
function loadCartInfo(twinkle)
{
    $('#siteNav').load(createLink('misc', 'printTopBar'),
        function()
        {
            if(twinkle) 
            {
                bootbox.dialog(
                {  
                    message: v.addToCartSuccess,  
                    buttons:
                    {  
                        back:
                        {  
                            label:     v.lang.continueShopping,
                            className: 'btn-primary',  
                            callback:  function(){location.reload();}  
                        },
                        cart:
                        {  
                            label:     v.gotoCart,  
                            className: 'btn-primary',  
                            callback:  function(){location.href = createLink('cart', 'browse');}  
                        }  
                    }  
                });
            }
        }
    );
}
