function adjustLayout() {
	
	lCol=xGetElementById('lLeftCol');
	cCol=xGetElementById('lContent');
	rCol=xGetElementById('lRightCol');
	
	cColTop=xHeight(cCol);

	if(lCol!=undefined) {
		cColTop=xHeight(cCol);
		lColTop=xHeight(lCol);
	   if(lColTop>cColTop){
	      cCol.style.height= lColTop+'px';
	      cCol.style.minHeight= lColTop+'px';
	   }
		
		cCol.style.paddingLeft= '250px';
	} else {
		cCol.style.paddingLeft= '14px';
	}

 
	if(rCol!=undefined) {
		cColTop=xHeight(cCol);
		rColTop=xHeight(rCol);

	   if(rColTop>cColTop){
	      cCol.style.height= rColTop+'px';
	      cCol.style.minHeight= rColTop+'px';
	   }

		cCol.style.paddingRight= '250px';
	} else {
		if(!xIE){
		cCol.style.paddingRight= '62px';
		}
		if(xIE){
		cCol.style.paddingRight= '54px';		
		}
		if(lCol!=undefined) {
	      cColTop=xHeight(cCol);
	      lColTop=xHeight(lCol);
	      if(lColTop>cColTop){
	         cCol.style.height= lColTop+'px';
	         cCol.style.minHeight= lColTop+'px';
	      }
		}
	}
	
	tCol=xGetElementById('lLogoTop');
	fCol=xGetElementById('lTopFrame');
	bCol=xGetElementById('lBlueMenu');
	
	tColTop=xWidth(tCol);
	fColTop=xWidth(fCol);
	bColTop=xWidth(bCol);

	/*
	if(bColTop+156>fColTop){
   	fCol.style.width= bColTop+156+'px';
	}
   */
   /*
	tColTop=xWidth(tCol);
	fColTop=xWidth(fCol);
	if(tColTop-41>fColTop){
   	fCol.style.width= tColTop-41+'px';
   	
	} 
	fColTop=xWidth(fCol);	  
   //tCol.style.width= fColTop+106+'px';   
   */
	tCol.style.width= fColTop+108+'px';   
   	 
 	xSizeToParent('lPageShLeft','h');
	xSizeToParent('lPageShRight','h');
	
	if(xIE){
		adjustIE();
	}
}

function adjustIE(){


	lCol=xGetElementById('lLeftCol');
	cCol=xGetElementById('lContent');
	rCol=xGetElementById('lRightCol');
	
	cColTop=xHeight(cCol);

	if(rCol!=undefined) {
		cColTop=xHeight(cCol);
		rColTop=xHeight(rCol);

	   if(rColTop>cColTop){
	      cCol.style.height= rColTop+'px';
	      cCol.style.minHeight= rColTop+'px';
	   }

		cCol.style.paddingRight= '245px';
	} else {
		if(!xIE){
		cCol.style.paddingRight= '60px';
		}
		if(xIE){
		cCol.style.paddingRight= '50px';		
		}
		if(lCol!=undefined) {
	      cColTop=xHeight(cCol);
	      lColTop=xHeight(lCol);
	      if(lColTop>cColTop){
	         cCol.style.height= lColTop+'px';
	         cCol.style.minHeight= lColTop+'px';
	      }
		}
	}
	
}


function xSizeToParent(id,direction) {
	/*
	direction= 'h' (height)) lub 'w' (width)
	*/
	d=xGetElementById(id);
	dParent=xParent(d);
	
	if(!direction || direction=='h') {
		h=xHeight(dParent);
		//USUWANIE JEDNEGO PIKSELA PRZY NIEPARZYSTYCH WYMIARACH
		if(xIE) {
			if(h%2) { h-=1; xHeight(dParent,h);	}
		}
		//MARGIN
		h-=xGetComputedStyle(d,'margin-top',true);
		h-=xGetComputedStyle(d,'margin-bottom',true);
		//PADDING PARENTA
		h-=xGetComputedStyle(dParent,'padding-top',true);
		h-=xGetComputedStyle(dParent,'padding-bottom',true);
		xHeight(d,h);
	}
	if(!direction || direction=='w') {
		w=xWidth(dParent);
		//USUWANIE JEDNEGO PIKSELA PRZY NIEPARZYSTYCH WYMIARACH
		if(xIE) {
			if(w%2) { w-=1; xWidth(dParent,w); }
		}
		//MARGIN
		w-=xGetComputedStyle(d,'margin-left',true);
		w-=xGetComputedStyle(d,'margin-right',true);
		//PADDING PARENTA
		w-=xGetComputedStyle(dParent,'padding-left',true);
		w-=xGetComputedStyle(dParent,'padding-right',true);
		xWidth(d,w);
	}
}

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);
}
