var AlignFactory = (function(){ //Aligns objects in the window
	
	//Private Instance Methods
        function GetWindowWidth(){
            var fLocalWidth = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                fLocalWidth = window.innerWidth;
            } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                fLocalWidth = document.documentElement.clientWidth;
            } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                fLocalWidth = document.body.clientWidth;
            }
            return fLocalWidth;
        }

        function GetWindowHeight(){
            var fLocalHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                fLocalHeight = window.innerHeight;
            } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                fLocalHeight = document.documentElement.clientHeight;
            } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                fLocalHeight = document.body.clientHeight;
            }
            return fLocalHeight;
        }
 
	//Shared Instance Methods
	return ({
		Center:function(sParamObjectID, iParamHOffset, iParamVOffset){ //Centers Object
                  var fLocalTopPos = (GetWindowHeight() - iParamVOffset) / 2;
                  var fLocalLeftPos = (GetWindowWidth() - iParamHOffset) / 2;
                  var oLocalSplash = document.getElementById(sParamObjectID);
                  if (fLocalTopPos < 5) fLocalTopPos = 5;
                  if (fLocalLeftPos < 5) fLocalLeftPos = 5;

                  oLocalSplash.style.visibility = 'visible';
                  oLocalSplash.style.position = 'absolute'; 
                  oLocalSplash.style.top = fLocalTopPos + 'px';
                  oLocalSplash.style.left = fLocalLeftPos + 'px';
		}
 	});
})();
