function Size(sizes,name,parent)
{
	this.sizes=sizes
	this.outerAllTop=0
	this.outerAllLeft=0
	this.outerAllRight=0
	this.outerAllBottom=0
	this.outerAllWidth=0
	this.outerAllHeight=0
	this.parent=(parent)?parent:''
	
	var sheet,y
	for(var x=0;x<document.styleSheets.length;x++)
	{
		sheet=document.styleSheets[x];
		var rules=(sheet.cssRules)?sheet.cssRules:sheet.rules
		for(y=0;y<rules.length;y++)
		{
			if(rules[y].selectorText==('.'+name))
			{
				var style=rules[y].style
				this.outerTop=((style.borderTopWidth)?parseInt(style.borderTopWidth):0)
				+((style.marginTop)?parseInt(style.marginTop):0)
				+((style.paddingTop)?parseInt(style.paddingTop):0)
				this.outerLeft=(this.borderLeft=((style.borderLeftWidth)?parseInt(style.borderLeftWidth):0))
				+(this.marginLeft=((style.marginLeft)?parseInt(style.marginLeft):0))
				+(this.paddingLeft=((style.paddingLeft)?parseInt(style.paddingLeft):0))
				this.outerRight=(this.borderRight=((style.borderRightWidth)?parseInt(style.borderRightWidth):0))
				+(this.marginRight=((style.marginRight)?parseInt(style.marginRight):0))
				+(this.paddingRight=((style.paddingRight)?parseInt(style.paddingRight):0))
				this.marginWidth=this.marginLeft+this.marginRight
				this.paddingWidth=this.paddingLeft+this.paddingRight
				this.borderWidth=this.borderLeft+this.borderRight
				
				this.outerBottom=((style.borderBottomWidth)?parseInt(style.borderBottomWidth):0)
				+((style.marginBottom)?parseInt(style.marginBottom):0)
				+((style.paddingBottom)?parseInt(style.paddingBottom):0)
				this.outerHeight=this.outerTop+this.outerBottom
				this.outerWidth=this.outerLeft+this.outerRight
				this.innerHeight=((style.height)?parseInt(style.height):0)
				this.innerWidth=((style.width)?parseInt(style.width):0)
				this.width=this.innerWidth+this.outerWidth
				this.height=this.innerHeight+this.outerHeight
			}
		}
	}
}

Size.prototype.setParentSize=function setParentSize(name)
{
	if(this.sizes[name].parent && this.sizes[name].parent!='container') 
	{
		this.setParentSize(this.sizes[name].parent)
		//this.sizes[this.sizes[name].parent].height+=this.height
		//this.sizes[this.sizes[name].parent].innerHeight+=this.height
		//this.sizes[this.sizes[name].parent].outerHeight+=this.height
		//this.sizes[this.sizes[name].parent].outerTop+=this.outerTop
		//this.sizes[this.sizes[name].parent].outerBottom+=this.outerBottom
	}
	
	this.outerAllTop+=sizes[name].outerTop
	this.outerAllLeft+=sizes[name].outerLeft
	this.outerAllRight+=sizes[name].outerRight
	this.outerAllBottom+=sizes[name].outerBottom
	this.outerAllHeight=this.outerAllTop+this.outerAllBottom
	this.outerAllWidth=this.outerAllLeft+this.outerAllRight
	
	
}

function Sizes()
{
	
}

Sizes.prototype.addElement=function addElement(name,parent)
{
	this[name]=new Size(this,name,parent);
	this[name].setParentSize(name)
}

function sizesSetup()
{
	sizes=new Sizes()
	sizes.addElement('container')
	sizes.addElement('bar','container')
	sizes.addElement('barText','bar')
	sizes.addElement('tabs','container')
	sizes.addElement('tab','tabs')
	sizes.addElement('tabSelected','tabs')
	sizes.addElement('sectionsContainer','container')
	sizes.addElement('sections','sectionsContainer')
	sizes.addElement('section','sections')
	sizes.addElement('statusBar','container')
	sizes.addElement('statusBarText','statusBar')
	sizes.addElement('grouping','container')
	sizes.addElement('iconListContainer','grouping')
	sizes.addElement('iconList','iconListContainer')
	sizes.addElement('nodeTreeContainer','grouping')
	sizes.addElement('nodeTree','nodeTreeContainer')
	sizes.addElement('searchResultsContainer','grouping')
	sizes.addElement('searchResults','searchResultsContainer')
	sizes.addElement('sendBack','container')
	sizes.addElement('statusBarSEResize','container')
	sizes.addElement('markerIcon','container')
	sizes.addElement('editIFrame','section')
	sizes.addElement('selectButtonIcon','container')
	sizes.addElement('selectButton','container')
	sizes.addElement('selectText','container')
	sizes.addElement('selectTextEdit','container')
	sizes.addElement('selectOptions','container')
	sizes.addElement('selectOption','selectOptions')
}
