// JavaScript Document

var menu_button = '';
var menu_img = '';

function rollover(id, img)
{
	menu_button = id;
	menu_img = document.getElementById(id).src;
	document.getElementById(id).src = img;	
}

function restore()
{
	document.getElementById(menu_button).src = menu_img;
	menu_button = '';
	menu_img = '';
}

var submenu_button = '';
var submenu_img = '';

function subrollover(id, img)
{
	submenu_button = id;
	submenu_img = document.getElementById(id).src;
	document.getElementById(id).src = img;	
}

function subrestore()
{
	document.getElementById(submenu_button).src = submenu_img;
	submenu_button = '';
	submenu_img = '';
}


function submenu(id, arg)
{
	if(arg == 'show')
	{
		document.getElementById(id).style.display = 'block';
	}
	else
	{
		document.getElementById(id).style.display = 'none';
	}
}

var open_slide = "";
var action = true;

function slide(id, arg)
{
	if(action == true)
	{
		action = false;
		if(arg == 'close')
		{
			Effect.BlindUp(id,{duration: 0.5, afterFinish: function(){ action = true; }});
			open_slide = "";
		}
		else
		{
			if(open_slide != id)
			{
				if(open_slide == "")
				{
					Effect.BlindDown(id,{duration: 0.5, afterFinish: function(){ action = true; }});
					open_slide = id;
				}
				else
				{
					Effect.BlindUp(open_slide,{duration: 0.5});
					Effect.BlindDown(id,{delay: 0, duration: 0.5, afterFinish: function(){ action = true; }});
					open_slide = id;
				}
			}
			else
			{
				Effect.BlindUp(open_slide,{duration: 0.5, afterFinish: function(){ action = true; }});
				open_slide = "";
			}
		}
	}
}

var open_tekst = '';

function toggle_tekst(id)
{
	
	if(open_tekst != '')
	{
		$(open_tekst).style.display = 'none';
		open_tekst = '';
	}
	
	if($(id).style.display == 'none')
	{
		$(id).style.display = 'block';
		open_tekst = id;
	}
	
}

