
	var Gallery_actual=false;

	function Gallery(value, actual, url)
	{
		if(url)
		{
			var ex, gadmin=false, furl='/';

			ex=location.href.split('/');

			var max=4;
			for(key in ex)
			{
				if((ex[key] == 'en') || (ex[key] == 'de'))
				{
					furl+=ex[key] + '/';
					max++;
				}
				else if(ex[key] == 'admin')
				{
					if(max < 6) max=6;
					furl+='admin/';
				}
				else if(ex[key] == 'selecta')
				{
					max=7;
					furl+='selecta/';
				}
				else if(key < max)
				{
					if((key > 2) && ex[key])
					{
						furl+=ex[key] + '/';
					}
				}
			}

			furl+=url + '/';

			if(value != '0')
			{
				furl+=value + '/';
			}

			location.href=furl;

			return;
		}

		if(Gallery_actual)
		{
			if(Gallery_actual != value)
			{
				CCS('gcat-' + Gallery_actual, 'display', 'none');
			}
		}
		else if(actual && (value != actual))
		{
			CCS('gcat-' + actual, 'display', 'none');
		}

		CCS('gcat-' + value, 'display', 'block');
		Gallery_actual=value;
	}



	function Menu_Top(id)
	{
		GO('vrsek2').value=id;
	}




	var mu_structure_user_list=Array();
	var mu_structure_user_list_view=Array();

	function MU_Structure_Userlist(user, view)
	{
		if(view && !mu_structure_user_list_view[view])
		{
			mu_structure_user_list[user]=true;
			mu_structure_user_list_view[view]=true;
		}

		if(mu_structure_user_list[user])
		{
			CCS('mu-userinfo-' + user, 'display', 'none');
			CCS('mu-userinfo-phone-' + user, 'display', 'block');
			CCS('mu-userinfo-email-' + user, 'display', 'block');
			mu_structure_user_list[user]=false;
		}
		else
		{
			CCS('mu-userinfo-' + user, 'display', 'block');
			CCS('mu-userinfo-phone-' + user, 'display', 'none');
			CCS('mu-userinfo-email-' + user, 'display', 'none');
			mu_structure_user_list[user]=true;
		}
	}



	var idpactive;

	function PlanView(idp)
	{
		if(idpactive)
		{
			GO('planek-' + idpactive).style.display='none';
			idpactive=false;
		}

		if(!idp) return;

		idpactive=idp;

		GO('planek-' + idpactive).style.display='block';
	}



	function News(id, vz)
	{
		var height;

		if(!BH['run'])
		{
			CCS('newsc-' + id, 'display', 'none');
		}

		if(vz)
		{
			BHV('newsn-' + id);
		}

		if(BH['run'])
		{
			setTimeout('News(' + id + ')', 50);
			return;
		}

		BHV('news-' + id);
	}




	var BH=Array();
	BH['maxa']=Array(0, 112);

	function BHV(elem, max, speed)
	{
		if(BH['run']) return;

		BH['run']=true;
		BH['elem']=GO(elem);
		BH['back']=(BH['elem'].style.display == 'block') ? true : false;
		BH['elem'].blur();
		BH['speed']=speed ? speed : 22;

		if(max)
		{
			BH['max']=BH['maxa'][max];
		}
		else
		{
			if(BH['back'])
			{
				BH['max']=BH['elem'].offsetHeight;
			}
			else
			{
				CCS(elem, 'display', 'block');
				BH['max']=BH['elem'].offsetHeight;
				CCS(elem, 'display', 'none');
			}
		}


		if(BH['back'])
		{
			BH['height']=BH['max'];
		}
		else
		{
			BH['height']=0;
		}

		CCS(BH['elem'], 'overflow', 'hidden');
		CCS(BH['elem'], 'height', BH['height'] + 'px');
		CCS(BH['elem'], 'display', 'block');

		if(BH['elem'].id == 'login')
		{
			if(BH['back'])
			{
				CCS('login-close', 'display', 'none');
			}
		}

		BHV_Go();
	}



	function BHV_Go()
	{
		var plus=BH['back'] ? Math.ceil(BH['height'] / BH['speed']) : Math.ceil((BH['max'] - BH['height']) / BH['speed']);

		BH['height']=BH['back'] ? (BH['height'] - plus) : (BH['height'] + plus);

		if((BH['back'] && (BH['height'] <= 0)) || (!BH['back'] && (BH['height'] >= BH['max'])))
		{
			if(BH['back'])
			{
				CCS(BH['elem'], 'display', 'none');
				CCS(BH['elem'], 'height', 'auto');
			}
			else
			{
				CCS(BH['elem'], 'height', 'auto');
			}

			if(BH['elem'].id == 'login')
			{
				if(!BH['back'])
				{
					CCS('login-close', 'display', 'block');
				}

			}

			BH['run']=false;
		}
		else
		{
			CCS(BH['elem'], 'height', BH['height'] + 'px');
			setTimeout('BHV_Go();', 4);
		}
	}