JS initSc() sometimes work sometimes not
<p>I've been having a problem with this for last a few days and 
I hope the awesome users here might enlighten me!</p>

<p>SO, I put initSc() in window load, and defined the function below. 
Sometimes in my local machine, it works but it doesn't work from a server. </p>

<p>Can anyone show me what I did wrong? </p>

<p>Here's a part of JS code: </p>

<pre><code>    $(window).load(function() {
        $.cookie("lingua","italiano");
        window.location.replace("#sett_main");

        $("#sett_contact").show(); 
        $("#sett_dish").show();
        $("#sett_brunch").show();

        var currenth = $(window).height();
        $('#sett_main').css('height', currenth);
        var hall = 11300 + currenth;

        $.Window = $(window);
        $.Scroll = ($.browser.mozilla || $.browser.msie) ? $('html') : $('body');
        $.Mobile = ($('body').hasClass('webkit-mobile') || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))),
        $.Unsupported = $('body').hasClass('unsupported-browser');
        $('.settore').initSc(); 
    });


    (function($) {
           $.fn.initSc = function(settings) {
           var config = {};
           if (settings) $.extend(config, settings);
                 this.each(function() { 
                 var $self = $(this),
                 $settname = $self.attr('id');
                 if ($self[$settname])
                 $self[$settname]();     
                           });   
           }
           })(jQuery); 
</code></pre>
