selected_menu_id = null;

/* Handling mouseOver events on navigation menus */
function hover(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;
	
	if(selected_menu_id != menu_id)
	{
		/* if current style is 'menuitem' ... set other style */
		if(class_id == 'menuitem')
		{
			menu_id.className='menuitem-hover';
		}
		else
		{
			menu_id.className='menuitem';
		}

		/* make the previously selected menu item active again */
		if(selected_menu_id != null)
		{
			document.getElementById(selected_menu_id).className='menuitem-active';
		}
	}
}

function active_new_window(menu_id, url, window_name)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='menuitem-active';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	/*top.main.location.href = '../' + url;*/
	
	win = window.open("", window_name);
  	win.location.href = '../' + url;
}

/* Handling mouseDown events on navigation menus for activated links */
function active(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='menuitem-active';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	top.main.location.href = '../' + url;
}

/* Handling mouseDown events on navigation menus for activated links */
function url_jump(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='menuitem-active';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	location.href = url;
}



/*====== NAV MENU ======================================*/
/* Handling mouseOver events on navigation menus */
function nav_hover(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;
	
	if(selected_menu_id != menu_id)
	{
		/* if current style is 'menuitem' ... set other style */
		if(class_id == 'nav-menuitem')
		{
			menu_id.className='nav-menuitem-over';
		}
		else
		{
			menu_id.className='nav-menuitem';
		}

		/* make the previously selected menu item active again */
		if(selected_menu_id != null)
		{
			document.getElementById(selected_menu_id).className='nav-menuitem-down';
		}
	}
}

/* Handling mouseDown events on navigation menus for activated links */
function nav_active(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='nav-menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='nav-menuitem-down';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	top.main.location.href = '../' + url;
}

/* Handling mouseDown events on navigation menus for activated links */
function nav_url_jump(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='nav-menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='nav-menuitem-down';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	location.href = url;
}
/*====== NAV MENU ======================================*/


/*====== PCAT MENU ======================================*/
/* Handling mouseOver events on navigation menus */
function pcat_hover(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;
	
	if(selected_menu_id != menu_id)
	{
		/* if current style is 'menuitem' ... set other style */
		if(class_id == 'pcat-menuitem')
		{
			menu_id.className='pcat-menuitem-over';
		}
		else
		{
			menu_id.className='pcat-menuitem';
		}

		/* make the previously selected menu item active again */
		if(selected_menu_id != null)
		{
			document.getElementById(selected_menu_id).className='pcat-menuitem-down';
		}
	}
}

/* Handling mouseDown events on navigation menus for activated links */
function pcat_active(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className='pcat-menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id).className='pcat-menuitem-down';
	/* store the selected active menu id */
	selected_menu_id = menu_id;
	top.main.location.href = '../' + url;
}

/* Handling mouseDown events on navigation menus for activated links */
function pcat_url_jump(menu_id, url)
{
	/* make the previously selected menu item inactive */
	if(selected_menu_id != null)
	{
		document.getElementById(selected_menu_id).className = 'pcat-menuitem';
	}
	/* make the selected menu item active */
	document.getElementById(menu_id.id).className = 'pcat-menuitem-down';
	/* store the selected active menu id */
	selected_menu_id = menu_id.id;
	location.href = url;
}
/*====== PCAT MENU ======================================*/












function listerhover(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;

	/* if current style is 'menuitem' ... set other style */
	if(class_id == 'row' ) { menu_id.className='row-hover'; }
	else if(class_id == 'row-hover' ) { menu_id.className='row'; }
	else if(class_id == 'row2' ) { menu_id.className='row-hover2'; }
	else if(class_id == 'row-hover2' ) { menu_id.className='row2'; }
}

function listeractive(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;

	/* if current style is 'menuitem' ... set other style */
	if(class_id == 'row-hover' ) { menu_id.className='row-active'; }
	else if(class_id == 'row-active' ) { menu_id.className='row-hover'; }
	else if(class_id == 'row-hover2' ) { menu_id.className='row-active2'; }
	else if(class_id == 'row-active2' ) { menu_id.className='row-hover2'; }
}

/* Hover handling for embedded lister */
function embedded_listerhover(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;

	/* if current style is 'menuitem' ... set other style */
	if(class_id == 'embedded-lister-row' ) { menu_id.className='embedded-lister-row-hover'; }
	else if(class_id == 'embedded-lister-row-hover' ) { menu_id.className='embedded-lister-row'; }
	else if(class_id == 'embedded-lister-row2' ) { menu_id.className='embedded-lister-row-hover2'; }
	else if(class_id == 'embedded-lister-row-hover2' ) { menu_id.className='embedded-lister-row2'; }
}

/* Hover active handling for embedded lister */
function embedded_listeractive(menu_id)
{
	/* get the current css class name */
	menu_id = document.getElementById(menu_id);
	class_id = menu_id.className;

	/* if current style is 'menuitem' ... set other style */
	if(class_id == 'embedded-lister-row-hover' ) { menu_id.className='embedded-lister-row-active'; }
	else if(class_id == 'embedded-lister-row-active' ) { menu_id.className='embedded-lister-row-hover'; }
	else if(class_id == 'embedded-lister-row-hover2' ) { menu_id.className='embedded-lister-row-active2'; }
	else if(class_id == 'embedded-lister-row-active2' ) { menu_id.className='embedded-lister-row-hover2'; }
}

function print_page()
{
	if(window.print)
	{
		setTimeout('window.print();',200);
	}
	else if (agt.indexOf("mac") != -1)
	{
		alert("Nyomja meg a 'Cmd+P' gombokat a nyomtatáshoz!");
	}
	else
	{
		alert("Nyomja meg a 'Ctrl+P' gombokat a nyomtatáshoz!")
	}
}

function confirmDialog(msg)
{
	var agree = confirm(msg);
	if(agree) 	return true;
	else 		return false;
}

function popUpBigImg(piID, fName, imgWidth, imgHeight)
{
	window.open('popup.php?pi_id='+piID+'&pic='+fName, 'img', 'width='+imgWidth+', height='+imgHeight+' status=yes');
}
