/*
****************************************************************************
* Filename:   minWidth.js
* Function:   Detect if IE6<= and fixe min-width
*              
* Created by:  Vincent Perlerin
* Date:        2007
*
* Modification log:
* Author		Date		Modification
* ------		----		------------
*
****************************************************************************
*/



function getWindowWidth() {
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
				windowWidth = window.innerWidth;
		}
		else {
				if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
		}
		else {
				if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
		}
	}
  }
	return windowWidth;
}





function minWidth(id,minWidth,maxWidth) {
	
	if (document.getElementById) {
		var containerWidth = getWindowWidth();
		
		if (containerWidth <= minWidth) {
					document.getElementById(id).style.width = minWidth + 'px' ;
		} else {
					document.getElementById(id).style.width = 100 + '%' ;
		}	
		
		
		/*
		else if (containerWidth > minWidth && containerWidth < maxWidth) {
					document.getElementById(id).style.width = 100 + '%';
		} else if (containerWidth >= maxWidth) {
					document.getElementById(id).style.width = maxWidth + 'px' ;
		}
		*/
		
	}
}



window.onload = function() {
		minWidth("width",1020,1020);			
}
window.onresize = function() {
		minWidth("width",1020,1020);			
}