function adjustLayout() {
	
	boxBorder('borderBox','Main');
	boxShadow('shBox','Main');
	boxBorder('borderBox','ColLeft');
	boxShadow('shBox','ColLeft');
	
	//FOOTER
	xTop('lFooter',xHeight('lMain')+25);
	xShow('lFooter');
}


function xSizeToParent(id) {
	d=xGetElementById(id);
	dParent=xParent(d);
	h=xHeight(dParent);
	w=xWidth(dParent);
	//USUWANIE JEDNEGO PIKSELA PRZY NIEPARZYSTYCH WYMIARACH
	if(xIE) {
		if(w%2) { w-=1; xWidth(dParent,w); }
		if(h%2) { h-=1; xHeight(dParent,h);	}
	}
	//MARGIN
	h-=xGetComputedStyle(d,'margin-top',true);
	h-=xGetComputedStyle(d,'margin-bottom',true);
	w-=xGetComputedStyle(d,'margin-left',true);
	w-=xGetComputedStyle(d,'margin-right',true);
	//PADDING PARENTA
	h-=xGetComputedStyle(dParent,'padding-top',true);
	h-=xGetComputedStyle(dParent,'padding-bottom',true);
	w-=xGetComputedStyle(dParent,'padding-left',true);
	w-=xGetComputedStyle(dParent,'padding-right',true);
	
	xHeight(d,h);
	xWidth(d,w);
}

//CIEN DLA BOXOW (EFEKT CIENIA DOOKOLA)
function boxShadow(idPre,idPost) {
	box=xGetElementById(idPre+idPost);
	Parent=xParent(box);
	shLT=xGetElementsByClassName(idPre+'LT',box);
	shRT=xGetElementsByClassName(idPre+'RT',box);
	shLB=xGetElementsByClassName(idPre+'LB',box);
	shRB=xGetElementsByClassName(idPre+'RB',box);
	shL=xGetElementsByClassName(idPre+'L',box);
	shR=xGetElementsByClassName(idPre+'R',box);
	shT=xGetElementsByClassName(idPre+'T',box);
	shB=xGetElementsByClassName(idPre+'B',box);
	//WIDTH & HEIGHT
	ParentW=xWidth(Parent);
	ParentH=xHeight(Parent);
	//USUWANIE JEDNEGO PIKSELA PRZY NIEPARZYSTYCH WYMIARACH
	if(xIE) {
		if(ParentW%2) { ParentW-=1; xWidth(Parent,ParentW); }
		if(ParentH%2) { ParentH-=1; xHeight(Parent,ParentH); }
	}
	//USTAWIANIE WYMIAROW TAKICH SAMYCH JAK PARENT
	xWidth(box,ParentW);
	xHeight(box,ParentH);
	
	//TOP
	shLTW=xWidth(shLT[0]);
	shRTW=xWidth(shRT[0]);
	xWidth(shT[0],ParentW-shLTW-shRTW);
	xLeft(shT[0],shLTW);
	//BOTTOM
	shLBW=xWidth(shLB[0]);
	shRBW=xWidth(shRB[0]);
	xWidth(shB[0],ParentW-shLBW-shRBW);
	xLeft(shB[0],shLBW);
	//LEFT
	shLTH=xHeight(shLT[0]);
	shLBH=xHeight(shLB[0]);
	xHeight(shL[0],ParentH-shLTH-shLBH);
	xTop(shL[0],shLTH);
	//RIGHT
	shRTH=xHeight(shRT[0]);
	shRBH=xHeight(shRB[0]);
	xHeight(shR[0],ParentH-shRTH-shRBH);
	xTop(shR[0],shRTH);
	//SHOW
	xShow(box);
}

//BORDER DLA BOXOW (ZAOKRAGLONY)
function boxBorder(idPre,idPost) {
	box=xGetElementById(idPre+idPost);
	Parent=xParent(box);
	shLT=xGetElementsByClassName(idPre+'LT',box);
	shRT=xGetElementsByClassName(idPre+'RT',box);
	shLB=xGetElementsByClassName(idPre+'LB',box);
	shRB=xGetElementsByClassName(idPre+'RB',box);
	shL=xGetElementsByClassName(idPre+'L',box);
	shR=xGetElementsByClassName(idPre+'R',box);
	shT=xGetElementsByClassName(idPre+'T',box);
	shB=xGetElementsByClassName(idPre+'B',box);
	//WIDTH & HEIGHT
	ParentW=xWidth(Parent);
	ParentH=xHeight(Parent);
	
	//USUWANIE JEDNEGO PIKSELA PRZY NIEPARZYSTYCH WYMIARACH
	if(xIE) {
		if(ParentW%2) { ParentW-=1; xWidth(Parent,ParentW); }
		if(ParentH%2) { ParentH-=1; xHeight(Parent,ParentH); }
	}
	
	boxW=ParentW;
	boxH=ParentH;
	
	//MARGIN
	boxH-=xGetComputedStyle(box,'margin-top',true);
	boxH-=xGetComputedStyle(box,'margin-bottom',true);
	boxW-=xGetComputedStyle(box,'margin-left',true);
	boxW-=xGetComputedStyle(box,'margin-right',true);
	
	//USTAWIANIE WYMIAROW TAKICH SAMYCH JAK PARENT
	xWidth(box,boxW);
	xHeight(box,boxH);
	
	//TOP
	shLTW=xWidth(shLT[0]);
	shRTW=xWidth(shRT[0]);
	xWidth(shT[0],boxW-shLTW-shRTW);
	xLeft(shT[0],shLTW);
	//BOTTOM
	shLBW=xWidth(shLB[0]);
	shRBW=xWidth(shRB[0]);
	xWidth(shB[0],boxW-shLBW-shRBW);
	xLeft(shB[0],shLBW);
	//LEFT
	shLTH=xHeight(shLT[0]);
	shLBH=xHeight(shLB[0]);
	xHeight(shL[0],boxH-shLTH-shLBH);
	xTop(shL[0],shLTH);
	//RIGHT
	shRTH=xHeight(shRT[0]);
	shRBH=xHeight(shRB[0]);
	xHeight(shR[0],boxH-shRTH-shRBH);
	xTop(shR[0],shRTH);
	//SHOW
	xShow(box);
}