﻿

        $(document).ready(function ()
        {
            //  $("a.buttonnonbook").hide();
            //  $("a.buttonbook").show();
            //  alert(navigator.appName);

            var naw = navigator.appName;
            var naw2 = navigator.userAgent;

            if (naw2.indexOf("Safari") != -1)
            {
            }
            if (naw2.indexOf("Konqueror") != -1)
            {
                konqueror = 1;
            }
            if (naw.indexOf("Netscape") != -1)
            {
                mozilla = 1;
            }
            if (naw.indexOf("Explorer") != -1 && naw2.indexOf("Opera") == -1)
            {
                /*explorer = 1;
                if (naw2.indexOf("MSIE 5.0") != -1) explorer5 = 1;
                if (naw2.indexOf("MSIE 5.5") != -1) explorer55 = 1;
                if (naw2.indexOf("MSIE 6.0") != -1) explorer6 = 1;
                if (naw2.indexOf("MSIE 7.0") != -1) explorer7 = 1;
                */
            }










            $(".productHomeRollover").hide();
            $("#searchBoxProductRollover").hide();
            $(".shopHomeRollover").hide();
            $("#searchBoxShopRollover").hide();
            // $(".filmRollover").hide();
           


            $('#zzzProduct').click(function ()
            {
                $("#product").find(".productHomeRollover").fadeIn('fast', null);
                $("#product").find("#searchBoxProductRollover").fadeIn('fast', null);
                $("#shop").find(".shopHomeRollover").fadeOut('fast', null);
                $("#shop").find("#searchBoxShopRollover").fadeOut('fast', null);
                $('#HiddenShop').val("1");
            });

            $('#zzzShop').click(function ()
            {
                $("#shop").find(".shopHomeRollover").fadeIn('fast', null);
                $("#shop").find("#searchBoxShopRollover").fadeIn('fast', null);
                $('#product').find(".productHomeRollover").fadeOut('fast', null);
                $('#product').find("#searchBoxProductRollover").fadeOut('fast', null);

                $('#HiddenProd').val("1");
            });



            $("#product").find(".homepageTd").hover(function ()
            {
                $(this).addClass("shadow");
            });
            $("#product").find(".homepageTd").mouseleave(function ()
            {
                $(this).removeClass("shadow");
            });




            /*function HideAll()
            {
            if ($("#HiddenShop").val() == "0")
            {
            // alert("1");
            $('#shop').find(".productHomeRollover").fadeOut('fast', null);
            $('#shop').find("#searchBoxProductRollover").fadeOut('fast', null);
            }
            if ($("#HiddenProd").val() == "0")
            {
            // alert("1");  
            $('#product').find(".productHomeRollover").fadeOut('fast', null);
            $('#product').find("#searchBoxProductRollover").fadeOut('fast', null);
                   
            }
            }
            /* <input type="hidden" value="0" id="HiddenProd" />
            <input type="hidden" value="0" id="HiddenProdSearch" />
            <input type="hidden" value="0" id="HiddenShop" />
            <input type="hidden" value="0" id="HiddenShopSearch" />*/
            /* $('#product').mouseout(
            function ()
            {
            $('#HiddenProd').val("0");
            HideAll();
            });

            /*$('#product').focus(
            function ()
            {
            $('#HiddenProd').val("1");
               
            });*/

            /*

            $('#shop').mouseout(
            function ()
            {
            $('#HiddenShop').val("0");
            HideAll();
            });

            /* $('#shop').focus(
            function ()
            {
            $('#HiddenShop').val("1");
            HideAll();
            });*/




            $("#product").hover(
            function ()
            {

                //$(this).find(".productHomeRollover").fadeIn('fast', null);
                // $(this).find("#searchBoxProductRollover").fadeIn('fast', null);
            },
            function ()
            {
                $(this).find(".productHomeRollover").fadeOut('fast', null);
                $(this).find("#searchBoxProductRollover").fadeOut('fast', null);
            });


            $("#shop").hover(
            function ()
            {
                // alert("2");
                //$(this).find(".shopHomeRollover").fadeIn('fast', null);
                //$(this).find("#searchBoxShopRollover").fadeIn('fast', null);
            },
            function ()
            {
                $(this).find(".shopHomeRollover").fadeOut('fast', null);
                $(this).find("#searchBoxShopRollover").fadeOut('fast', null);
            }
            );

            $(".film").click(
                function ()
                {
                
                    $("#FilmDiv").dialog({ width: 910, height: 570, modal: true });
                }
            );


            $("#energyWash").addClass("energy1Default");
            $("#energyWash .info").css({ 'display': 'block', 'float': 'left', 'margin-top': '65px' });
            // $(".energyWash .info").removeClass("info");
            $("#energyLight").hover(
                function ()
                {
                    $("#energyWash .info").css({ 'display': 'none' });
                    $("#energyWash").removeClass("energy1Default");
                });

            $("#energyWash").hover(
            function ()
            {
                $("#energyWash").addClass("energy1Default");
                $("#energyWash .info").css({ 'display': 'block', 'float': 'left', 'margin-top': '65px' });
            });
            $("#energyCar").hover(
            function ()
            {
                $("#energyWash .info").css({ 'display': 'none' });
                $("#energyWash").removeClass("energy1Default");
            });
            /*});*/
            $("#energyModule").mouseleave(function ()
            {
                $("#energyWash").addClass("energy1Default");
                $("#energyWash .info").css({ 'display': 'block', 'float': 'left', 'margin-top': '65px' });
            });

            if(vIsRegister == 1) {
                ShowLoginRegisterDiv1();
            }
        });
    function StoresDivCloseClick() {
        $("#shop").find(".shopHomeRollover").fadeOut('fast', null);
        $("#shop").find("#searchBoxShopRollover").fadeOut('fast', null);
    }
    function ProdsDivCloseClick() {
        $("#product").find(".productHomeRollover").fadeOut('fast', null);
        $("#product").find("#searchBoxProductRollover").fadeOut('fast', null);
    }


        $(document).ready(function ()
        {
        QuoteChanger();
        });
        function goToStoreF(i) {
            document.getElementById("s_storName").value = document.getElementById("fa_storA" + i).value;
            document.getElementById("s_storAff").value = document.getElementById("fa_storAff" + i).value;
            document.getElementById("sendFormGoToMerchant").submit();
        }
         function scaleFavShop(i) {
            var ow = i.width;
            var oh = i.height;
            if (i.width > 190) {
                i.width = 190;
                i.height = 190 / (ow / oh);
            }
            if (i.height > 75) {
                i.height = 75;
                i.width = 75 / (oh / ow);
            }
           
            i.style.visibility = "visible";
        }
        function FilmDialogClose()
        {
            $('#FilmDiv').dialog('close');
             
            $(".film").show();
            $(".filmRollover").fadeOut('fast', null);
        }
        var numberQuotes=0;
        var actualQuote=0;
        function QuoteChanger()
        {
        numberQuotes=$("#fullMiddle_fullMiddle_HiddenQuotesNumber").val();
        var next=0;
        //alert("actualQuote "+actualQuote);
        //alert("numberQuotes "+$("#fullMiddle_fullMiddle_HiddenQuotesNumber").val());
        if(parseInt(actualQuote)+1<=parseInt(numberQuotes))
        {
        
        next=parseInt(actualQuote)+1;
        }
        else
        {
        next=0;
        }
        var itemOld="#quotation"+actualQuote;
        var itemNew="#quotation"+next;
        actualQuote=next;
        $(itemOld).hide();
        $(itemNew).show();
        setTimeout("QuoteChanger()",5000);
    }

