window.processPopupResult = function( kepId , kepCim , kepSzelesseg , kepMagassag )
{
	var hirKep = document.getElementById( 'hirKep' );
	hirKep.src    = kepCim;
	hirKep.width  = kepSzelesseg;
	hirKep.height = kepMagassag;
	document.getElementById( 'hirForm' ).kep.value = kepId;
}

function max( a, b, c )
{
	var d = a > b ? a : b;
	d = d > c ? d : c;
	return d;
}

function prepareHir()
{
	var img;
	var x;
	for ( x = 0; x < document.getElementById( 'hir-reteg' ).getElementsByTagName( 'img' ).length; x++ )
	{
		img = document.getElementById( 'hir-reteg' ).getElementsByTagName( 'img' )[ x ];
		if ( img.offsetWidth > 638 )
		{
			img.width = 638;
			img.height = document.getElementById( 'hirFullKep' ).height / document.getElementById( 'hirFullKep' ).width * 638;
		}
	}
	/*var i = document.getElementById( 'hirFullKep' ).offsetHeight;
	var j = document.getElementById( 'hirFullCim' ).offsetHeight;
	var k = document.getElementById( 'hirFullDatum' ).offsetHeight;
	if ( document.getElementById( 'hirFullReteg' ).offsetHeight < i + j + k + 10 )
	{
		document.getElementById( 'hirFullReteg' ).style.height = ( i + j + k + 10 ) + 'px' ;
	}
	document.getElementById( 'foOszlop' ).style.height = ( document.getElementById( 'hirFullReteg' ).offsetHeight + 18 ) + 'px';
	document.getElementById( 'kozepOszlop' ).style.height = parseInt( document.getElementById( 'foOszlop' ).style.height )  + parseInt( document.getElementById( 'cimkek' ).offsetHeight ) + 'px'; 
	document.getElementById( 'foReteg' ).style.height = max( document.getElementById( 'balOszlop' ).offsetHeight, document.getElementById( 'kozepOszlop' ).offsetHeight, document.getElementById( 'jobbOszlop' ).offsetHeight ) + 'px';
	document.getElementById( 'foReteg' ).style.marginTop = '10px';
	document.body.style.height = ( parseInt( document.getElementById( 'kozepOszlop' ).style.height ) + 160 ) + 'px';
	document.getElementById( 'cimkek' ).style.display = "block";
	i = document.getElementById( 'foOszlop' ).offsetHeight;
	j = document.getElementById( 'balOszlop' ).offsetHeight;
	k = document.getElementById( 'jobbOszlop' ).offsetHeight;
	i = max( i , j , k );
	var xx = parseInt( i - document.getElementById( 'balAloszlop' ).offsetHeight ) + 'px';
	//document.getElementById( 'foOszlop' ).style.height = i + 'px';
	document.getElementById( 'balOszlop' ).style.height = i + 'px';
	document.getElementById( 'jobbOszlop' ).style.height = i + 'px';
	document.getElementById( 'balAloszlopMyStat' ).style.height = xx;
	for ( i = 0; i < document.images.length; i++ )
	{
		if ( document.images[ i ].alt == 'MyStat - Az ingyenes webstatisztika' )
		{
			document.images[ i ].style.marginLeft = '20px';
			document.images[ i ].style.marginBottom = '10px';
		}
	} */
	i = document.getElementById( 'koz-oszlop' ).offsetHeight;
	j = document.getElementById( 'bal-oszlop' ).offsetHeight;
	k = document.getElementById( 'jobb-oszlop' ).offsetHeight;
	i = max( i , j , k );
	document.getElementById( 'koz-oszlop' ).style.height = i + 'px';
	document.getElementById( 'bal-oszlop' ).style.height = i + 'px';
	document.getElementById( 'jobb-oszlop' ).style.height = i + 'px';
}
