var GlobalVars = new Array();

var PreviousPage = '';
var CurrentLocation = '';

function InjectCSS(cssFile)
{
    $('head').append($('<link rel="stylesheet" href="' + cssFile + '" />'));
}

function InjectJS(jsFile)
{
    $('head').append($('<script type="text/javascript" src="' + jsFile + '" ></script>'));
}

function ShowBlackOverlay()
{
    $('#black-overlay').stop().css('display', 'block').animate({ opacity: '0.7' }, 500);
}

function HideBlackOverlay()
{
    $('#black-overlay').stop().animate({ opacity: '0' }, 500, function()
    {
        $('#black-overlay').css('display', 'none');
    });
}

function CheckLocationChange()
{
	if (CurrentLocation != window.location.href)
	{
		PreviousPage = CurrentLocation;
		CurrentLocation = window.location.href;
		SinglePageInitFull(CurrentLocation);
	}
}

$(window).ready(function()
{
   $('#black-overlay').css('opacity', '0'); 
   setInterval(CheckLocationChange, 500);
});

// Add a function to disable selection/highlighting of elements
jQuery.fn.extend({ 
        disableSelection : function() { 
                this.each(function() { 
                        this.onselectstart = function() { return false; }; 
                        this.unselectable = "on"; 
                        jQuery(this).css('-moz-user-select', 'none'); 
                }); 
                return this;
        }
});
