function adjustLayout() {
	mCol=xGetElementById('lContent');
	lCol=xGetElementById('lLeftCol');	
	rCol=xGetElementById('lRightCol');
	mainCol=xGetElementById('lMain');
	infoCol=xGetElementById('lRightColInfo');
	
	if( xClientWidth()>1003 && xIE ){ mainCol.style.width= xClientWidth(); }
	
	h=xClientHeight();
	if( xHeight(mainCol)<= h ){
		newHeight = h-xHeight(xGetElementById('lLangBack'))-xHeight(xGetElementById('lHeader'))-xHeight(xGetElementById('lMenuTop'))-xHeight(xGetElementById('lFooter'));
		if(xIE){ mCol.style.height = mCol.style.minHeight = newHeight-29+'px'; }
		if(!xIE){ mCol.style.minHeight = newHeight-30+'px'; }
	} 

 	//sprawdzenie wysokości dla elelmentówe srodkowej kolumny
 	if(!xIFOldFF()){ mColTop=xHeight(mCol)-30; } else { mColTop=xHeight(mCol)+2; }
 	
	lColTop=xHeight(lCol)-31;
	rColTop=xHeight(rCol)-31;
	
	//sprawdzenie najwyższej wartości i przypisanie jej do zmiennej "m"
	m=Math.max(lColTop, mColTop, rColTop);
	
	//nadanie elementom środkowej kolumny odpowiedniej wysokości
	if(xIE){ 
		mCol.style.height = m+'px';
		rCol.style.height = lCol.style.height = m+28+'px';
		mCol.style.minHeight = m+'px';
		rCol.style.minHeight = lCol.style.minHeight = m+28+'px';
	}
	if(!xIE){ 
		//sprawdzenie wersji FF, czy nie wersja 1.0.7
		if(xIFOldFF()){ add = 28; } else { add = 0; }
		mCol.style.minHeight = m+add+'px';
		rCol.style.minHeight = lCol.style.minHeight = m+29+'px';
	}
	//rCol.style.height = rCol.style.minHeight = m+28+'px';
	
}


function xIFOldFF(){
	if( navigator.appName == 'Netscape' && navigator.appVersion == '5.0 (Windows; pl-PL)' ) {
		return true;
	}
}

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);
	}
}
