/*centerAbsolutePositionedLayout()
Author: Kenneth Fly
Created: 12/3/2004
Modifications:
12/8/2004- Finished script and removed debugging
Language: Javascript 1.2
Purpose: Center an absolutely posistioned layout within a current screen
Parameters:
layoutSize- the width of the number of pixels of the layout that needs to be centered in the window.
Browser Compatibility: 5+ 
Dependencies: DOM 2, CSS 1.2
Expected Output: Absolute Position Layout centered on page or error message
Errors and Error Handling: Checks if browser is DOM complient and has getElementsByTagName() method or incorrect display message will be output.
*/
function centerAbsolutePositionedLayout(layoutSize){
	var leftShift; //holds number of pixels before
	var divList; //holds Node List of all div tags
	var widthWindow; //width of the current window screen.
	//if broswer supports DOM get Element by tag name method
	if(document.getElementsByTagName){
		//if current browser uses the window inner width property
		if(window.innerWidth){
			//must deduct 19 for scroll bar to get correct width of document
			widthWindow=window.innerWidth-19;
		}
		//else if the current browser uses the body.clientWith property
		else if(document.body.clientWidth){
			widthWindow=document.body.clientWidth;
		}
		//else the browser does not have anything to check against so display will fail. Output error and stop function.
		else{
			alert('This browser does not support the needed Javascript properties.\n The page will not display properly.');
			return 0;
		}//end if current browser uses the window inner width property
		//if browser window is larger than layout
		if(widthWindow>layoutSize){
			leftShift=((widthWindow-layoutSize)/2);
			//get all div tags of document
			divList=document.getElementsByTagName('div');
			//Loop over each Div tag
			for(divCount in divList){
				//if the div tag has a style property
				if(divList[divCount].style){
					//if the div tag has the position style
					if(divList[divCount].style.position){
						//if the div is absolutely positioned
						if(divList[divCount].style.position=='absolute'){
							//apply the left shift
							divList[divCount].style.left=(parseInt(divList[divCount].style.left)+leftShift)+'px';
						}
					}
				}
			}//End Loop over each Div tag
		}//End if browser window is larger than layout
	}
	else{//else browser does not support DOM get Element by tag name method
		//alert: Page will not display correctly
		alert("This browser does not use the DOM 2 getElementsByTagName Javascript method.\n This page will not display correctly");
		return 0;
	}//end if broswer supports DOM get Element by tag name method
}//end Function