﻿

$(document).ready(function () {

    $("#ctl00_Welcome").hover(function () {
        $("#ctl00_Welcome").attr('src', '/images/welcome-Over.png');
    }, function () {
        $("#ctl00_Welcome").attr('src', '/images/welcome.png');
        var url = window.location.pathname;
        if (url.indexOf("default") > -1 || url.trim() == "/") {
            $('#ctl00_Welcome').attr('src', '/images/welcome-Over.png');


        }
    });
    $("#ctl00_benefits").hover(function () {
        $("#ctl00_benefits").attr('src', '/images/Benefits-over.png');
    }, function () {
        $("#ctl00_benefits").attr('src', '/images/Benefits.png');
        var url = window.location.pathname;
        if (url.indexOf("benefits") > -1) {
            $('#ctl00_benefits').attr('src', '/images/Benefits-over.png');

        }
    });
    $("#ctl00_forms").hover(function () {
        $("#ctl00_forms").attr('src', '/images/forms-over.png');
    }, function () {
        $("#ctl00_forms").attr('src', '/images/forms.png');
        var url = window.location.pathname;
        if (url.indexOf("forms11") > -1) {
            $('#ctl00_forms').attr('src', '/images/forms-over.png');


        }
    });
    $("#ctl00_quote").hover(function () {
        $("#ctl00_quote").attr('src', '/images/onlineQuote-Over.png');
    }, function () {
        $("#ctl00_quote").attr('src', '/images/onlineQuote.png');
        var url = window.location.pathname;
        if (url.indexOf("new") > -1) {
            $('#ctl00_quote').attr('src', '/images/onlineQuote-Over.png');

        }
    });
    $("#ctl00_faq").hover(function () {
        $("#ctl00_faq").attr('src', '/images/FAQ-over.png');
    }, function () {
        $("#ctl00_faq").attr('src', '/images/FAQ.png');
        var url = window.location.pathname;

        if (url.indexOf("faq") > -1) {
            $('#ctl00_faq').attr('src', '/images/FAQ-over.png');


        }
    });
    $("#ctl00_pi").hover(function () {
        $("#ctl00_pi").attr('src', '/images/propertyInsurance-active.png');
    }, function () {
        $("#ctl00_pi").attr('src', '/images/propertyInsurance.png');
        var url = window.location.pathname;
        if (url.indexOf("property") > -1) {
            $('#ctl00_pi').attr('src', '/images/propertyInsurance-active.png');


        }
    });
    $("#ctl00_about").hover(function () {
        $("#ctl00_about").attr('src', '/images/aboutUs-Over.png');
    }, function () {
        $("#ctl00_about").attr('src', '/images/aboutUs.png');
        var url = window.location.pathname;
        if (url.indexOf("about") > -1) {
            $('#ctl00_about').attr('src', '/images/aboutUs-Over.png');
        }
    });
    $("#ctl00_ceo").hover(function () {
        $("#ctl00_ceo").attr('src', '/images/ceo-over.png');
    }, function () {
        $("#ctl00_ceo").attr('src', '/images/ceo.png');
        var url = window.location.pathname;
        if (url.indexOf("ceo") > -1) {
            $('#ctl00_ceo').attr('src', '/images/ceo-over.png');


        }
    });
    $("#ctl00_contact").hover(function () {
        $("#ctl00_contact").attr('src', '/images/contactUs-over.png');
    }, function () {
        $("#ctl00_contact").attr('src', 'images/contactUs.png');
        var url = window.location.pathname;
        if (url.indexOf("contact") > -1) {
            $('#ctl00_contact').attr('src', '/images/contactUs-over.png');


        }
    });
    function settopmenu() {
        var url = window.location.pathname;
        //alert(url); 
        var pageset = false;

        if (url.indexOf("End") > -1 || url.indexOf("end") > -1) {

            $('#quote').attr('src', '/images/onlineQuote-Over.png');
            pageset = true;
        }
        if (url.indexOf("roperty") > -1) {
            $('#pi').attr('src', '/images/propertyInsurance-active.png');
            pageset = true;

        }

        if (url.indexOf("forms") >-1) {

            $('#forms').attr('src', '/images/forms-over.png');
            pageset = true;

        }
        if (url.indexOf("ben") > -1) {

            $('#benefits').attr('src', '/images/Benefits-over.png');
            pageset = true;
        }
        if (url.indexOf("ceo") > -1) {
            $('#ceo').attr('src', '/images/ceo-over.png');
            pageset = true;

        }
        if (url.indexOf("faq") > -1) {
            $('#faq').attr('src', '/images/FAQ-over.png');
            pageset = true;

        }
        if (url.indexOf("property") > -1) {
            $('#pi').attr('src', '/images/propertyInsurance-active.png');
            pageset = true;

        }

        if (url.indexOf("contact") > -1) {
            $('#contact').attr('src', '/images/contactUs-over.png');
            pageset = true;

        }
        if (url.indexOf("about") > -1) {
            $('#about').attr('src', '/images/aboutUs-Over.png');
            pageset = true;

        }
        if (url.indexOf("default") > -1 || url.trim() == "/") {
            $('#welcome').attr('src', '/images/welcome-Over.png');
            pageset = true;
        }
        else if (url.indexOf("ben") > -1) {
            $('#benefits').attr('src', '/images/Benefits-over.png');
            pageset = true;
        }
        else if (url == "/forms11.aspx") {

            $('#forms').attr('src', '/images/forms-over.png');
            pageset = true;

        }
        else if (url.indexOf("new") > -1) {

            $('#quote').attr('src', '/images/onlineQuote-Over.png');
            pageset = true;
        }
        else if (url.indexOf("faq") > -1) {
            $('#faq').attr('src', '/images/FAQ-over.png');
            pageset = true;

        }
        else if (url.indexOf("property") > -1) {
            $('#pi').attr('src', '/images/propertyInsurance-active.png');
            pageset = true;

        }
        else if (url.indexOf("about") > -1) {
            $('#about').attr('src', '/images/aboutUs-Over.png');
            pageset = true;

        }
        else if (url.indexOf("ceo") > -1) {
            $('#ceo').attr('src', '/images/ceo-over.png');
            pageset = true;

        }
        else if (url.indexOf("contact") > -1) {
            $('#contact').attr('src', '/images/contactUs-over.png');
            pageset = true;

        }
        if (!pageset) {
            $('#welcome').attr('src', '/images/welcome-Over.png');
        }
    }

    $('#constructive').click(function () {
        var posTop = $('#ans').position().top ;
       
       $('html, body').animate({scrollTop: $("#ans").position().top}, 2000);

   });

   $('#ph').click(function () {
       var posTop = $('#ans9').position().top ;
       
       $('html, body').animate({ scrollTop: $("#ans9").position().top }, 2000);

   });
   $('#sum').click(function () {
       var posTop = $('#ans8').position().top;

       $('html, body').animate({ scrollTop: $("#ans8").position().top }, 2000);

   });
   $('#loss').click(function () {
       var posTop = $('#ans7').position().top;

       $('html, body').animate({ scrollTop: $("#ans7").position().top }, 2000);

   });
   $('#third').click(function () {
       var posTop = $('#ans6').position().top;

       $('html, body').animate({ scrollTop: $("#ans6").position().top }, 2000);

   });
   $('#fire').click(function () {
       var posTop = $('#ans5').position().top;

       $('html, body').animate({ scrollTop: $("#ans5").position().top }, 2000);

   });
   $('#comp').click(function () {
       var posTop = $('#ans4').position().top;

       $('html, body').animate({ scrollTop: $("#ans4").position().top }, 2000);

   });
   $('#ncd').click(function () {
       var posTop = $('#ans3').position().top;

       $('html, body').animate({ scrollTop: $("#ans3").position().top }, 2000);

   });
   $('#young').click(function () {
       var posTop = $('#ans2').position().top;

       $('html, body').animate({ scrollTop: $("#ans2").position().top }, 2000);

   });
   $('#excess').click(function () {
       var posTop = $('#ans1').position().top;

       $('html, body').animate({ scrollTop: $("#ans1").position().top }, 2000);

   });
    settopmenu();


}); 
