function adjustLayout() {
		mCol=xGetElementById('lMain');
		
		
		if(!xIE || xGetElementById('leftOffer')!=undefined || xWidth(xGetElementById('leftOffer'))>340){ xGetElementById('lLeftCol').style.minWidth = xWidth(xGetElementById('leftOffer'))+'px'; } 

		mCol.style.marginLeft= xWidth(xGetElementById('lLeftCol'))+'px';		
		/*
		if(!xIE){
			if(xGetElementById('leftOffer')!=undefined){
				if(xWidth(xGetElementById('leftOffer'))>340){
					xGetElementById('lLeftCol').style.width = xWidth(xGetElementById('leftOffer'))+'px';
				}
			}
		}
		*/
		
		xGetElementById('lYellowFr').style.width= xWidth(xGetElementById('lLeftCol'))-10+'px';
		xGetElementById('lYellSh').style.width= xWidth(xGetElementById('lLeftCol'))+'px';
		if( xGetElementById('mTab')!=undefined){ 
			xGetElementById('mTab').style.width= xWidth(xGetElementById('lLeftCol'))-10+'px'; }
		xGetElementById('lMain').style.minWidth= 729-xWidth(xGetElementById('lYellowFr'))+10+'px';

	adjustHeight();
}
function adjustHeight(){
	lCol=xGetElementById('lLeftCol');
	mCol=xGetElementById('lMain');
	cCol=xGetElementById('lContent');	
	rCol=xGetElementById('lRightFr');
	fCol=xGetElementById('lFooter');
	
		if( xHeight(xGetElementById('lYellowFr'))>xHeight(cCol) ){
		   cCol.style.height= xHeight(xGetElementById('lYellowFr'))+'px';
		   cCol.style.minHeight= xHeight(xGetElementById('lYellowFr'))+'px';
	   }
		mColW=xWidth(mCol);
		w=xClientWidth();
		if(xIE){
			adjustIE();
		}
		if(!xIE){
			if( xWidth(xGetElementById('conWidth'))+20 > xWidth(xGetElementById('lMain')) ){
				xGetElementById('lMain').style.minWidth= xWidth(xGetElementById('conWidth'))+20+'px'; }
		}
		
	   lColTop=xHeight(lCol);
	   mColTop=xHeight(mCol);
	   cColTop=xHeight(cCol);
	   fColTop=xHeight(fCol);
	   
	   //tu toprawić bo meże nie być - layer offer
	   //lTopH = xHeight(xGetElementById('lYellowFr')) + 50 + xHeight(xGetElementById('lOffer'));
	   
	   cTop = cColTop + 10 + fColTop;
	   
	   h=xClientHeight();
	   m=Math.max(lColTop, cTop);
	   if(m<h-86) { m=h-86; }
	   
	   mCol.style.height= m+'px';
	   mCol.style.minHeight= m+'px';
	   
		if(!xIE){ mColW=xWidth(mCol);
			xGetElementById('lTop').style.width= mColW+xWidth(xGetElementById('lLeftCol'))+20+'px'; }

	adjustShadow();
		
	   lCol.style.height= m-30+'px';
	   lCol.style.minHeight= m-30+'px';
		rCol.style.height= m+'px';
}

function adjustIE(){
			Main = 729-xWidth(xGetElementById('lYellowFr'))-10;
			if( w-xWidth(xGetElementById('conWidth')) > w-xWidth(xGetElementById('lMain')) ){
				White = w-xWidth(xGetElementById('lMain'));
				xGetElementById('lRightFr').style.right= -21+'px';
			} else{ White = w-xWidth(xGetElementById('conWidth')); }
			
			if(White<Main){
				xGetElementById('lContent').style.width= Main+'px';
	         xGetElementById('lFooter').style.width= Main+'px';
				rCol = xGetElementById('lRightFr');
				xGetElementById('lTop').style.width= xWidth(xGetElementById('lLeftCol'))+xWidth(xGetElementById('lMain'))+20+'px';
				adjustRight();
			} 
			if( xWidth(xGetElementById('lMain'))>xWidth(xGetElementById('lContent')) ){
				xGetElementById('lContent').style.width= '';
				xGetElementById('lFooter').style.width= '';				
				xGetElementById('lTop').style.width= '';
				adjustRight();
			}
}

function adjustRight(){
		if(isEven(w)){ xGetElementById('lRightFr').style.right= -20+'px';
		} else { xGetElementById('lRightFr').style.right= -21+'px'; }
}

function adjustShadow(){
	   xGetElementById('lShRight').style.height= cColTop+2+'px';
	   xGetElementById('lShLeft').style.top= xHeight(xGetElementById('lYellowFr'))+'px';
		xGetElementById('lShLeft').style.height= cColTop-xHeight(xGetElementById('lYellowFr'))+4+'px';
	   xGetElementById('lShBottom').style.width= mColW+'px';
	   xGetElementById('lShTop').style.width= xWidth(xGetElementById('lTop'))-730-20+'px';
}

function isEven(x){return~x&1}

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);
}