jQuery(document).ready(function() {
    jQuery("#header").supersleight();//make transparent PNGs appear properly in IE6

    jQuery("#nav").find('div[urls]').each(function(ignored, div) {
        var continueLooping = true;
        jQuery.each(div.getAttribute("urls").split(";"), function(ignored, url) {
            if (window.location.pathname == url) {
                jQuery(div).addClass("selected");
                continueLooping = false;
                return false;
            }
        });
        return continueLooping;
    })
    .click(function(event) {
        var urls = event.target.getAttribute("urls");
        if (urls)
            window.location = urls.split(";")[0];
    });

    var params = window.location.search.length > 0 ? jQuery.parseQuery(window.location.search) : undefined;

    var markup;
    if ((markup = jQuery("#signup"))[0])
        document.currentPage = new SignupPage(markup, params);
    else if ((markup = jQuery("#myAccount"))[0])
        document.currentPage = new MyAccountPage(markup, params);
});

