var wizard = {
    init : function()
    {
        var headerLinks = jQuery("a.wizardLink")
        headerLinks.unbind();
        headerLinks.click(wizard.clickHandler);
    },
    
    clickHandler : function(e)
    {
        if (e.preventDefault)
        {
            e.preventDefault();
        }
        
        url = jQuery(this).attr("href");

        // Remove hash from url
        hashIndex = url.lastIndexOf('#')
        if (hashIndex >= 0)
            url = url.substring(0, hashIndex);
            
        if (window.location.href.indexOf('https') >= 0)
        {
            if (url.indexOf('?') < 0)
            {
                url = url + '?RequiresSecure=1';
            }
            else 
            {
                url = url + '&RequiresSecure=1';
            }
        }
        
        jQuery("#wizard").load(url + " #wizard .wizardMainContent", "", function(){wizard.init(); media.init();});
    }
}
jQuery(document).ready(wizard.init);
