function resCol(a,b){
	document.getElementById('col1').wtogo=a;
	document.getElementById('col2').wtogo=b;
	if (document.newAnim){
		window.clearInterval(document.newAnim);
	}
	document.newAnim=window.setInterval(resColCheck,30);
}

function resDiv(trg,h){
	trg.htogo=h;
	trg.origh=trg.offsetHeight;
	trg.acth=trg.origh;
	//alert (trg.htogo+" "+trg.origh);
	if (trg.origh!=trg.htogo){
		if (trg.newAnim){
			window.clearInterval(trg.newAnim);
		}
		var actStep = 0;
	
		trg.newAnim=window.setInterval(
			function(){
				
				if (trg.origh!=trg.htogo){
				
					trg.origh+=(trg.htogo-trg.origh)/2;
			
					if (Math.abs(trg.htogo-trg.origh)<1){
						trg.oright=trg.htogo;
					}
			
					trg.style.height=trg.origh+'px';
				}else{
					if (trg.newAnim){
						window.clearInterval(trg.newAnim);
					}
				}
			}
		,30);
	}
}

function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) { 
//Generic Animation Step Value Generator By www.hesido.com 
    var delta = maxValue - minValue; 
    var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
    return Math.ceil(stepp) 
    } 


function resColCheck(){
	
	if (document.getElementById('col1').wtogo==undefined) {
		if (document.newAnim){
			window.clearInterval(document.newAnim);
		}
		return false;
	}
	
	if (document.getElementById('col1').offsetWidth!=document.getElementById('col1').wtogo){
		
		w1=document.getElementById('col1').offsetWidth;
		w1tg=parseInt(document.getElementById('col1').wtogo);
		w2=document.getElementById('col2').offsetWidth;
		w2tg=parseInt(document.getElementById('col2').wtogo);
		
		//alert (w2);
		//alert (w2tg);
		
		w1+=(w1tg-w1)/2;
		w2+=(w2tg-w2)/2;

		if (Math.abs(w1tg-w1)<1){
			w1=w1tg;
			w2=w2tg;
		}
		
		document.getElementById('col1').style.width=w1+'px';
		document.getElementById('col2').style.width=w2+'px';
	}else{
		if (document.newAnim){
			window.clearInterval(document.newAnim);
		}
	}
	
	return true;
}

function closeHandle(event){
	//alert (event.mouseY);
	/*if (event.clientY < 0){
		alert ('kilépési rutinok meghívása sikeres! (IE)');
	}
	if (e.offsetY < 0){
		alert ('kilépési rutinok meghívása sikeres! (FF)');
	}*/
}
