﻿/*! Copyright © 2010 General Mills. All Rights Reserved. No permission is granted to use, copy or extend this code. */
QRV.namespace('QRV.PageManager');
QRV.PageManager =
{
    init: function(loginRequired, loggedIn, url)
    {
        this.IsLogginRequired = (loginRequired == 'true');
        this.IsLoggedUser = (loggedIn == 'true');

        this.pageTitle = encodeURIComponent(document.title);
        this.host = location.host;
        this.port = window.location.port == '' ? '' : ':' + window.location.port;
        this.absoluteURI = this.host + this.port;

        this.canonicalPath = $('link[rel=canonical]').attr('href');

        if (url != null)
        {
            this.RootUrl = url.replace(/\/$/, '');
        }

        if ($.ajaxSetup)
        {
            $.ajaxSetup({ cache: false, contentType: 'application/json; charset=utf-8' });
        }

        $(document).ready(function()
        {
            if ($().pngFix != undefined)
            {
                $(document).pngFix();
            }
        });
    }
};
