/*
    Document   : decor.js
    Created on : 2008-jan-28, 18:40:42
    Author     : Andreas Jorneus
*/
function myParseFloat(num){
	var ret=parseFloat(num);
	if(isNaN(ret))
		return 0;
	return ret;
}
function recursiveFixIEProblem(obj)
{
        for(var i = 0; i < obj.children.length; i++)
        {
                recursiveFixIEProblem(obj.children[i]);
        }

        if(obj.style && obj.style.left && obj.style.right)
        {
                obj.style.setExpression("width","this.offsetParent.offsetWidth-myParseFloat(this.offsetParent.style.borderLeftWidth)-myParseFloat(this.offsetParent.style.borderRightWidth)+"+(- (myParseFloat(obj.style.left)+myParseFloat(obj.style.right)+myParseFloat(obj.style.borderLeftWidth)+myParseFloat(obj.style.borderRightWidth)+myParseFloat(obj.style.paddingRight)+myParseFloat(obj.style.paddingLeft)+myParseFloat(obj.style.marginLeft)+myParseFloat(obj.style.marginRight)) )+"+'px'");
                obj.style.right = "";
        }

        if(obj.style && obj.style.top && obj.style.bottom)
        {
                obj.style.setExpression("height","this.offsetParent.offsetHeight-myParseFloat(this.offsetParent.style.borderTopWidth)-myParseFloat(this.offsetParent.style.borderBottomWidth)+"+(- (myParseFloat(obj.style.top)+myParseFloat(obj.style.bottom)+myParseFloat(obj.style.borderTopWidth)+myParseFloat(obj.style.borderBottomWidth)+myParseFloat(obj.style.paddingBottom)+myParseFloat(obj.style.paddingTop)+myParseFloat(obj.style.marginTop)+myParseFloat(obj.style.marginBottom)) )+"+'px'");
                obj.style.bottom = "";
        }

}
 
function ieFix(obj)
{
    if(document.selection&&!window.opera)
    {
        var appVersion = parseFloat(navigator.appVersion.match(/MSIE (\d\.\d)/)[1]);
     
        if(appVersion < 7 )
        {
			
            recursiveFixIEProblem(obj);
			window.setTimeout("IE7.recalc()",10);
        }
    }
	
}
