
function new_popup(URL,popW, popH, scroll)
{
 var winleft = (screen.width - popW) / 2;
 var winUp = (screen.height - popH) / 2;
 winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+'';
 Win = window.open(URL,'edunet_pop', winProp);
}



function menuNAV(cat_id) 
{
	if(prev_cat_div!= '') {
		document.getElementById(prev_cat_div).style.display = 'none';
	}
	document.getElementById('cat-'+cat_id).style.display = 'inline';
	prev_cat_div = 'cat-'+cat_id;
}
var prev_cat_div = 'cat-8';


var timeout	= 250;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}



function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


var tableRow = 3;

function showNextRow() {
	tableRow++;
	rowObj = document.getElementById('row'+tableRow);
	if ( rowObj ) {
		rowObj.style.display = 'table-row';
		if ( tableRow == 12 )
			document.getElementById('addmorebutton').style.display = 'none';
	}
}

function alapterulet( ertek1, ertek2, ertek3 ) {

	var szelesseg   = document.getElementById('form_elements'+ertek1);
	var hosszusag   = document.getElementById('form_elements'+ertek2);
	var alapterulet = document.getElementById('form_elements'+ertek3);

	if ( szelesseg.value != '' && hosszusag.value != '' ) {
		alapterulet.value = ( szelesseg.value * hosszusag.value ) / 10000;
	}
}
