// Appends a delay functionality to jQuery
jQuery.fn.delay = function( time, func )
{
	this.each( function() 
	{
		setTimeout( func, time );
	} );	
	return this;
};

// Changes the Inner HTML of the objID to a loading animation
function changeToLoading( objID, strFunctionName )
{
	$( '#' + objID ).empty();
	$( '#' + objID ).html( '<div><img src="includes/media/images/gui/loading-animation.gif" class="loading-animation" alt="loading" /></div>' );
	$( '#' + objID ).delay( 250, function() {
		eval( strFunctionName + ';' );
	} );
}

// Opens the provided URL in a new window, to maintain XHTML compliancy
function openInNewWindow( strURL, strWindowName )
{
	if ( strWindowName != "" )
	{
		window.open( strURL, strWindowName );
	} 
	else
	{
		window.open( strURL, 'newWin' );
	}
	return false;
}

// This function fixes the problem with IE where it does not move the footer to the bottom of the screen when jQuery is interacted with
function fixIEFooterPosition() {
	$( '#footer-container' ).css( 'bottom', '1px' );
	$( '#footer-container' ).css( 'bottom', '0px' );
}