// themaingate.net
// Since you're poking around at this script, I thought I'd give you a little tour!  How kind of me!

var themaingate = function () {             // put everything under one namespace so we don't pollute the global namespace
    try {                                   // in the unlikely event jQuery isn't loaded, we'll get "$ is not defined" thrown, so catch it
        $(document).ready(function(){       // only attach events after the DOM is loaded
            $("#main div ul li a").each (function(){    // for each link, add a mouseover event
                $(this).hover (function(){  // onmouseover
                    $("div").animate ({width: "846px"}, {queue:false, duration:200});
                    $(this).animate ({width: "300px"}, {queue:false, duration:200});
                },function() {              // onmouseout
                    $("div").animate ({width: "680px"}, {queue:false, duration:200});
                    $(this).animate ({width: "134px"}, {queue:false, duration:200});
                });
            });
        });
    } catch (e) {   // if jQuery isn't loaded yet, wait a couple of seconds and try again
        setTimeout (themaingate(), 3000);
    }
};

themaingate (); // yes, we could auto-execute the function, but this would make it inaccessible to setTimeout