var fixedCss = false; /*To avoid infinite loop on IE6 fixCSS only once per resize*/

function getElement(id)
{
	var element;
	if (document.getElementById) {
		element = document.getElementById(id);
	} else if (document.all) {
		element = document.all(id);
	}
	return element;
}

function setMinWidth(id, origWidth, minWidth)
{
	setMinWidth.el = getElement(id);

  	if (setMinWidth.el && !fixedCss) {
	//if (setMinWidth.el) {
		//alert('body.offsetWidth='+document.body.offsetWidth+' el.offsetWidth='+setMinWidth.el.offsetWidth+' minWidth='+parseInt(minWidth));
    	if (setMinWidth.el.offsetWidth<parseInt(minWidth) || document.body.offsetWidth<parseInt(minWidth)) {
		//if (setMinWidth.el.offsetWidth<(parseInt(minWidth)+(setMinWidth.el.offsetWidth*1/100)) || document.body.offsetWidth<parseInt(minWidth)+(document.body.offsetWidth*1/100)) {
			setMinWidth.el.style.width = minWidth;
			setMinWidth.el.style.marginLeft = '0%';
    	} else if (document.body.offsetWidth>parseInt(minWidth)) {
   			setMinWidth.el.style.width = origWidth;
			setMinWidth.el.style.marginLeft = '9%';
		}

		/*
		//Fix float style
		if (navigator.appVersion.indexOf('MSIE') !=-1) {
			setMinWidth.el.style.styleFloat = floatType;
		} else {
			setMinWidth.el.style.cssFloat = floatType;
		}
		*/
		fixedCss = true;
  	} else {
		fixedCss = false;
	}
}

function setMinHeight(id, origHeight, minHeight)
{
  setMinHeight.el = getElement(id);

  if (setMinHeight.el) {
    if (setMinHeight.el.offsetHeight<parseInt(minHeight)) {
      //setTimeout('setMinHeight.el.style.height="'+minHeight+'"',10);
      setMinHeight.el.style.height= minHeight;
    } else {
	  setMinHeight.el.style.height = origHeight;
	}
  }
}

/**
 *
 * @access public
 * @return void
 **/
function fix_min_width()
{
	//Fix min-width styles
	setMinWidth('layout','91%','776px');
}

/**
 *
 * @access public
 * @return void
 **/
function fix_contentBrdLeft_height()
{
    //Fix contentBrdLeft height that was causing problems on IE6
    if (navigator.appVersion.indexOf('MSIE 6') !=-1) {
        var mainBox;
        if (mainBox = getElement('mainBox')) {
            var height = mainBox.offsetHeight - 10;
            setMinHeight('contentBrdLeft', height, height);
        }
    }
}