	var click_dis = false;

	function roll(item) {
		var pom;
		if (item.classNameRoll) {
			pom = item.classNameRoll;
			item.classNameRoll = item.className;
			item.className = pom;
		} else {
			item.classNameRoll = item.className;
			item.className = 'activ';
		}
	}

	function clickme(item) {
		var pom;
		if (click_dis)
		{
			click_dis = false;
			return;
		}
		if (item.className == item.classNameRoll) {
			item.classNameRoll = item.classNameClick;
			item.className = 'activ';
		} else {
			item.classNameClick = item.classNameRoll
			item.className = 'click';
			item.classNameRoll = 'click';
		}
	}

	function openPage(url, target, width, height) {
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=5,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		win = window.open(url, target, options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}

	function openImage(imgSrc) {
	    var img = new Image();
	    img.src = imgSrc;
	    width = img.width+40;
	    height = img.height+40;
	
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=0,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		win = window.open(imgSrc, '', options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}


	function validate(prvek,validate)
	{
		var errorName = 'error';
		var className = '';

		value = prvek.value;
		if (validate == 'not-empty')
		{
			if (value=='')
				className = errorName;
		}

		if (validate == 'email')
		{
			var regular = new RegExp("^[a-zA-Z][a-zA-Z0-9\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
			if (!regular.test(value)) className = errorName;

		}

		if (validate.substring(0,4)=='reg:')
		{
			if (value.ereg(validate.substring(4,value.length-4))) className = errorName;
		}

		prvek.className = className;
	}
