﻿
var CountyLightBox = {
    CountyLightBoxItem: null,
    County: null,
    verticaloffset: 100,
    ScreenHight: null,
    ScreenWidth: null,
    init: function() {
        CountyLightBox.hook_buttons();

        if (ShowBrazilPopup)
            CountyLightBox.OpenCountyLightBox();

    },

    hook_buttons: function() {
        if (ShowBrazilPopup)
            CountyLightBox.OpenCountyLightBox();


    },

    OpenCountyLightBox: function(e) {
        CountyLightBox.ScreenHight = screen.height;
        CountyLightBox.ScreenWidth = screen.width;

        var Form = document.getElementById("CountyForm");




        Form.style.top = "150px"; //(CountyLightBox.ScreenHight / 2) - ((CountyLightBox.ScreenHight / 2) / 8) + "px";
        Form.style.left = (CountyLightBox.ScreenWidth / 2) - ((CountyLightBox.ScreenWidth / 2) / 4) + "px";
        Form.style.display = 'block';

        var overlay = document.getElementById("overlay");
        overlay.style.display = 'block';

    },


    CloseCountyLightBox: function(e) {
        //mean while no need this function because after save in the lightbox the page reload for getting relevant products


    },


    SaveCounty: function(e) {
        Mantis.CaesarStone.MasterPages.InnerMaster.SetCountyCookieValue(($$("input[name=CountyItem]:checked"))[0].getValue());
        CountyLightBox.CloseCountyLightBox();
        document.location.reload();
    }

};



