
	/* ajax */

	function createRequestObject(){
		var request_;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			request_ = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			request_ = new XMLHttpRequest();
		}
		return request_;
	}

	var http = createRequestObject();
	var isHttpBusy=false;

	function clearAacInfo(eid){
		document.getElementById(eid).innerHTML="&nbsp;";
		document.getElementById(eid).className="infoClear";
	}

		/* other */

	function insertAfter(parent, node, referenceNode) {
		parent.insertBefore(node, referenceNode.nextSibling);
	}

	function getNodeValue(obj,tag){
		return obj.getElementsByTagName(tag)[0].firstChild.nodeValue;
	}

	function reloadPage(){
		location.reload();
	}

	function $(){
		var elements = new Array();
		for (var i = 0; i < arguments.length; i++) {
			var element = arguments[i];
			if (typeof element == 'string')
				element = document.getElementById(element);
			if (arguments.length == 1)
				return element;
			elements.push(element);
		}
		return elements;
	}

	function showhide(ktery){
		if($(ktery).style.display=="block"){
			$(ktery).style.display="none";
		}else{
			$(ktery).style.display="block";
		}
	 }

	/* changeLanguage */

	function changeLanguage(howdy){
		$("uwLanguage").value=howdy;
		$("langForm").submit();
	}

	/* getAnchorPosition */

	function getAnchorPosition(anchorname) {
		// This function will return an Object with x and y properties
		var useWindow=false;
		var coordinates=new Object();
		var x=0,y=0;
		// Browser capability sniffing
		var use_gebi=false, use_css=false, use_layers=false;
		if ($) { use_gebi=true; }
		else if (document.all) { use_css=true; }
		else if (document.layers) { use_layers=true; }
		// Logic to find position
		if (use_gebi && document.all) {
			x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
			y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
			}
		else if (use_gebi) {
			var o=$(anchorname);
			x=AnchorPosition_getPageOffsetLeft(o);
			y=AnchorPosition_getPageOffsetTop(o);
			}
		else if (use_css) {
			x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
			y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
			}
		else if (use_layers) {
			var found=0;
			for (var i=0; i<document.anchors.length; i++) {
				if (document.anchors[i].name==anchorname) { found=1; break; }
				}
			if (found==0) {
				coordinates.x=0; coordinates.y=0; return coordinates;
				}
			x=document.anchors[i].x;
			y=document.anchors[i].y;
			}
		else {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		coordinates.x=x;
		coordinates.y=y;
		return coordinates;
		}

	function getAnchorWindowPosition(anchorname) {
		var coordinates=getAnchorPosition(anchorname);
		var x=0;
		var y=0;
		if ($) {
			if (isNaN(window.screenX)) {
				x=coordinates.x-document.body.scrollLeft+window.screenLeft;
				y=coordinates.y-document.body.scrollTop+window.screenTop;
				}
			else {
				x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
				y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
				}
			}
		else if (document.all) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else if (document.layers) {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		coordinates.x=x;
		coordinates.y=y;
		return coordinates;
		}

	// Functions for IE to get position of an object
	function AnchorPosition_getPageOffsetLeft (el) {
		var ol=el.offsetLeft;
		while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
		return ol;
		}
	function AnchorPosition_getWindowOffsetLeft (el) {
		return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
		}
	function AnchorPosition_getPageOffsetTop (el) {
		var ot=el.offsetTop;
		while((el=el.offsetParent) != null) { ot += el.offsetTop; }
		return ot;
		}
	function AnchorPosition_getWindowOffsetTop (el) {
		return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
		}

	/* clear input */

	function clearInput(frm,polozka){
		window.top.document.forms[frm].elements[polozka].value="";
	}

	/* clear element */

	function clearElement(eid){
		document.getElementById(eid).innerHTML="";
		document.getElementById(eid).className="";
	}

	/* go to uri */

	function goToUri(uri){
		if(isNaN(uri)){
			window.location=uri;
		}
	}

	/* change class */

	function changeClass(ktery,neco){
		if($(ktery)) $(ktery).className=neco;
	}

	/* show hide */

	function showHide(ktery){
		if($(ktery).style.display=="block"){
			$(ktery).style.display="none";
		}else{
			$(ktery).style.display="block";
		}
	}

	/* send form */
	function sendForm(fid){
		frm=$(fid);
		if(frm) frm.submit();
	}

	/* set Input Value */

	function setInputValue(target,val){
		if($(target)) $(target).value=val;
	}

	/* set Div Content */

	function setDivContent(target,val){
		if($(target)) $(target).innerHTML=val;
	}

	/* element */

	function displayElement(ktery){
		if($(ktery)) $(ktery).style.display="block";
	}
	function hideElement(ktery){
		if($(ktery)) $(ktery).style.display="none";
	}


	function fuck(txt){
		$("testArea").innerHTML+=txt+"<br />";
		//$("testArea").innerHTML="";
	}

	// funkce prebere vyraz z lang.js
	function getText(code){
		uwL=$("uwLanguage").value;

		// pokud nenajdu text v jazyku kterem chci, vratim ceskou variantu
		if(cfg['text'][code][uwL]){
			data=cfg['text'][code][uwL];
		}else{
			data=cfg['text'][code]['cz'];
		}

		return data;
	}


	function winHeight() {
	   if(top.document.documentElement && top.document.documentElement.clientHeight)
		  return top.document.documentElement.clientHeight;
	   else if(top.document.body && top.document.body.clientHeight)
		  return top.document.body.clientHeight;
	   else
		  return null;
	}

	function getSelectValue(select_id){
		if(document.getElementById(select_id)){
			sindex=document.getElementById(select_id).selectedIndex;
			hodnota=document.getElementById(select_id)[sindex].value;
			return hodnota;
		}else{
			return false;
		}
	}

	function Trim(STRING,TRIM){
		if(STRING.length<1){
			return"";
		}

		STRING = RTrim(STRING,TRIM);
		STRING = LTrim(STRING,TRIM);

		if(STRING==""){
			return "";
		}else{
			return STRING;
		}
	}


	function RTrim(VALUE,TRIM){
		var w_space = TRIM;
		var v_length = VALUE.length;
		var strTemp = "";

		if(v_length < 0){
			return "";
		}
		var iTemp = v_length -1;

		while(iTemp > -1){
			if(VALUE.charAt(iTemp) == w_space){

			}else{
				strTemp = VALUE.substring(0,iTemp +1);
				break;
			}
			iTemp = iTemp-1;

		} //End While

		return strTemp;

	}

	function LTrim(VALUE,TRIM){
		var w_space = TRIM;

		if(v_length < 1){
			return "";
		}

		var v_length = VALUE.length;
		var strTemp = "";
		var iTemp = 0;

		while(iTemp < v_length){
			if(VALUE.charAt(iTemp) == w_space){

			}else{
				strTemp = VALUE.substring(iTemp,v_length);
				break;
			}
			iTemp = iTemp + 1;
		} //End While

		return strTemp;

	}

	function getElementsByClass(searchClass,node,tag) {
		var classElements = new Array();
		if ( node == null )
			node = document;
		if ( tag == null )
			tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}

	function isInteger(val){
		if (isBlank(val)){ return false; }
		for(var i=0;i<val.length;i++){
			if(!isDigit(val.charAt(i))){ return false; }
		}
		return true;
	}

	function isBlank(val){
		if(val==null){return true;}
		for(var i=0;i<val.length;i++) {
			if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
			}
		return true;
	}

	function isDigit(num) {
		if (num.length>1){return false;}
		var string="1234567890";
		if (string.indexOf(num)!=-1){return true;}
		return false;
	}


	function ratePassword(input){
		v=document.getElementById(input).value;
		txt=document.getElementById("t_pass_quality_txt");
		bar=document.getElementById("t_pass_quality_bar");

		var passinfo = new Array();
		passinfo[0]=getText("password_quality_very_poor");
		passinfo[1]=getText("password_quality_short");
		passinfo[2]=passinfo[3]=getText("password_quality_poor");
		passinfo[4]=passinfo[5]=passinfo[6]=getText("password_quality_good");
		passinfo[7]=passinfo[8]=passinfo[9]=getText("password_quality_strong");
		passinfo[10]=getText("password_quality_very_strong");

		var passcolor = new Array("#feee00","#feee00","#FDB325","#FCAE23","#FC9B1F","#FA7C19","#F84C0F","#fe6137","#F61A06","#F40601","#FF0000");

		var pass_quality=0;

		txt.innerHTML=passinfo[0];
		bar.style.background="";
		bar.style.width="0px";

		var match_num = /\d/.test(v);
		var match_alpha = /[a-z]/.test(v);
		var match_az = /[A-Z]/.test(v);
		var match_other = /[^a-zA-Z0-9]/.test(v);

		if(match_num==true) pass_quality+=2;
		if(match_alpha==true) pass_quality+=2;
		if(match_az==true) pass_quality+=3;
		if(match_other==true) pass_quality+=3;

		if(v.length<6 && v.length>0){
			pass_quality=1;
		}

		txt.innerHTML=passinfo[pass_quality];
		bar.style.background=passcolor[pass_quality];
		bar.style.width=(pass_quality*12)+"px";
	}

	function getFormData(formId){
		var formData = "";
		form=$(formId);
		inputs = form.getElementsByTagName("input");
			formData+=getFormElementsValue(inputs);
		textareas = form.getElementsByTagName("textarea");
			formData+=getFormElementsValue(textareas);
		selects = form.getElementsByTagName("select");
			formData+=getFormElementsValue(selects);

		return formData;
	}

	function getFormElementsValue(obj){
	  getstr="";
      for (i=0; i<obj.length; i++) {
         if (obj[i].tagName == "INPUT") {
            if (obj[i].type == "checkbox") {
               if (obj[i].checked) {
                  getstr += obj[i].name + "=" + obj[i].value + "&";
               } else {
                  getstr += obj[i].name + "=&";
               }
            }else if(obj[i].type == "radio") {
               if (obj[i].checked){
                  getstr += obj[i].name + "=" + obj[i].value + "&";
               }
            }else{
               getstr += obj[i].name + "=" + obj[i].value + "&";
            }
         }
		 if (obj[i].tagName == "TEXTAREA") {
            getstr += obj[i].name + "=" + obj[i].value + "&";
         }
         if (obj[i].tagName == "SELECT") {
            var sel = obj[i];
            getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
         }
      }
      return getstr;
   }

	function resetForm(formId){
		var formData = "";
		form=$(formId);
		inputs = form.getElementsByTagName("input");
			clearElementsValue(inputs);
		textareas = form.getElementsByTagName("textarea");
			clearElementsValue(textareas);
		selects = form.getElementsByTagName("select");
			clearElementsValue(selects);

		return true;
	}

	function clearElementsValue(obj){
	  getstr="";
      for (i=0; i<obj.length; i++) {
         if (obj[i].tagName == "INPUT") {
            if (obj[i].type == "checkbox") {
               if (obj[i].checked) {
					obj[i].checked==false;
               }
            }else if(obj[i].type == "radio") {
               if (obj[i].checked){
					obj[i].checked==false;
               }
            }else if (obj[i].type == "text") {
				obj[i].value="";
            }
         }
         if (obj[i].tagName == "SELECT") {
            var selBox = obj[i];
			for(j=0;j<selBox.options.length;j++){
				if(selBox.options[j].value=="") selBox.selectedIndex=j;
			}
         }
      }
      return true;
   }


   /* checkAllWithClass */

var tmpUsersRightsArray = new Array();

function checkAllWithClass(cn){
	var aTmps = new Array();
	aTmps=getElementsByClass(cn);

	tmpUsersRightsArray[cn]=(tmpUsersRightsArray[cn]=="" ? false : true);

	aTmpsCheckStatus=(tmpUsersRightsArray[cn]==true ? true : false);

	for(var i=0;i<aTmps.length;i++) {
		aTmps[i].checked=aTmpsCheckStatus;
	}

	tmpUsersRightsArray[cn]=(tmpUsersRightsArray[cn]==true ? false : true);
}

function isArray(obj) {
	//returns true is it is an array
	if (obj.constructor.toString().indexOf("Array") == -1)
	return false;
	else
	return true;
}

function getLastKeyPressed(e){
	var code;
	if (!e)	var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	return code;
}

function setSliderValues(hodnoty){
	if($('mPage')){
		var temp = new Array();
		for(var c=1; c<=$('mPage').value; c++){
			temp[(c-1)]=c;
		}
		return temp;
	}
}

	/* dark box */


//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
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;
}


//
// pause(numberMillis)
// Pauses code execution for specified time. Uses busy code, not good.
// Code from http://www.faqts.com/knowledge_base/view.phtml/aid/1602
//
function pause(numberMillis) {
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true) {
		now = new Date();
		if (now.getTime() > exitTime)
			return;
	}
}


function initDarkbox(){

	if (!document.getElementsByTagName){ return; }

	// the rest of this code inserts html at the top of the page that looks like this:
	//
	// <div id="overlay">
	//		<a href="#" onclick="hideDarkbox(); return false;"><img id="loadingImage" /></a>
	//	</div>
	// <div id="darkbox">
	//		<div id="darkbox">
	//
	//		</div>
	// </div>

	var objBody = document.getElementsByTagName("body").item(0);

	// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','overlay');
	objOverlay.onclick = function () {hideDarkbox(); return false;}
	objOverlay.style.display = 'none';
	objOverlay.style.position = 'absolute';
	objOverlay.style.top = '0';
	objOverlay.style.left = '0';
	objOverlay.style.zIndex = '90';
 	objOverlay.style.width = '100%';
	objBody.insertBefore(objOverlay, objBody.firstChild);


	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	// create Darkbox div, same note about styles as above
	var objDarkbox = document.createElement("div");
	objDarkbox.setAttribute('id','darkbox');
	objDarkbox.style.display = 'block';
	objDarkbox.style.position = 'absolute';
	objDarkbox.style.zIndex = '100';
	objBody.insertBefore(objDarkbox, objOverlay.nextSibling);

	// create link
	var objLink = document.createElement("a");
	objLink.setAttribute('id','closer');
	objLink.setAttribute('href','#');
	objLink.setAttribute('title','x');
	objLink.innerHTML="&nbsp;";
	objLink.onclick = function () {hideDarkbox(); return false;}
	objDarkbox.appendChild(objLink);

	// create details div, a container for the caption and keyboard message
	var objDarkboxDetails = document.createElement("div");
	objDarkboxDetails.setAttribute('id','darkboxDetails');
	objDarkbox.appendChild(objDarkboxDetails);

}


//
// showDarkbox()
// Preloads images. Pleaces new image in Darkbox then centers and displays.
//
function showDarkbox(w,h,f){

	initDarkbox();

	// prep objects
	var objOverlay = document.getElementById('overlay');
	var objDarkbox = document.getElementById('darkbox');
	var objDarkboxDetails = document.getElementById('darkboxDetails');

	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	// set height of Overlay to take up whole page and show
	objOverlay.style.height = (arrayPageSize[1] + 'px');
	objOverlay.style.display = 'block';


		// center Darkbox and make sure that the top and left values are not negative
		// and the image placed outside the viewport
		var DarkboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - h) / 2);
		var DarkboxLeft = ((arrayPageSize[0] - 20 - w) / 2);

		objDarkbox.style.top = (DarkboxTop < 0) ? "0px" : DarkboxTop + "px";
		objDarkbox.style.left = (DarkboxLeft < 0) ? "0px" : DarkboxLeft + "px";

		objDarkboxDetails.style.width = w+'px';

	 	eval(f);

		// A small pause between the image loading and displaying is required with IE,
		// this prevents the previous image displaying for a short burst causing flicker.
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			pause(250);
		}

		// Hide select boxes as they will 'peek' through the image in IE
		selects = document.getElementsByTagName("select");
        for (i = 0; i != selects.length; i++) {
                selects[i].style.visibility = "hidden";
        }

		objDarkbox.style.display = 'block';

		// After image is loaded, update the overlay height as the new image might have
		// increased the overall page height.
		arrayPageSize = getPageSize();
		objOverlay.style.height = (arrayPageSize[1] + 'px');

}


//
// hideDarkbox()
//
function hideDarkbox()
{
	// get objects
	objOverlay = document.getElementById('overlay');
	objDarkbox = document.getElementById('darkbox');

	// hide Darkbox and overlay
	objOverlay.style.display = 'none';
	objDarkbox.style.display = 'none';

	// make select boxes visible
	selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}

}

function selectFile(fileUrl){
	if(navigator.appName.indexOf('Microsoft')!=-1){
		window.returnValue=fileUrl;
	}else{
		window.opener.setAssetValue(fileUrl);
	}

	self.close();
}

function getBiggerOffset(){
	var listHeight=winHeight();
	if(window.innerHeight) listHeight=window.innerHeight;

	var listHeight=listHeight-140;

	var offsetValue=Math.round(listHeight/21)-2;
	$('offset').value=offsetValue;
}

function setValue(e,v){
	if($(e)) $(e).value=v;
}

function css(a,o,c1,c2){
	switch (a){
		case 'swap':
			o.className=!css('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
		break;
		case 'add':
			if(!css('check',o,c1)){o.className+=o.className?' '+c1:c1;}
		break;
		case 'remove':
			var rep=o.className.match(' '+c1)?' '+c1:c1;
			o.className=o.className.replace(rep,'');
		break;
		case 'check':
			var found=false;
			var temparray=o.className.split(' ');
			for(var i=0;i<temparray.length;i++){
				if(temparray[i]==c1){found=true;}
			}
			return found;
		break;
	}
}

function simpleTrim(str){
   return str.replace(/^\s*|\s*$/g,"");
}

function dollarAction(action,o,c1,c2){

	switch (action){
		case 'swap':
			o.className=!dollarAction('check',o,c1)? o.value.replace(c2,c1): o.value.replace(c1,c2);
		break;
		case 'add':
			if(!dollarAction('check',o,'t'+c1+'t')){ o.value += o.value ? ' t'+c1+'t' : 't'+c1+'t';}
		break;
		case 'remove':
			var rep=o.value.match(' t'+c1+'t')? ' t'+c1+'t' : 't'+c1+'t';
			o.value=o.value.replace(rep,'');
		break;
		case 'check':
			var found=false;
			var temparray=o.value.split(' ');
			for(var i=0;i<temparray.length;i++){
				if(temparray[i]==c1){found=true;}
			}
			return found;
		break;
		case 'count':
			if(o.value==" " || o.value==""){
				return 0;
			}else{
				var temparray=o.value.split(' ');
				return temparray.length;
			}
		break;
	}

	o.value=simpleTrim(o.value);
}

function imgSrcMagic(action,e,what){

	o=$(e);
	switch (action){
		case 'add':
			var rep=".gif";
			o.src=o.src.replace(rep,what+'.gif');
		break;
		case 'remove':
			var rep=what+".gif";
			o.src=o.src.replace(rep,'.gif');
		break;
	}
}



function getDimensions(element) {
    element = $(element);
    var originalWidth = element.clientWidth;
    var originalHeight = element.clientHeight;
    return originalWidth+";"+originalHeight;
}

function getElementWidth(element) {
    element = $(element);
    return element.clientWidth;
}

function getElementHeight(element) {
    element = $(element);
    return element.clientHeight;
}


/* showlayer */

var tid=new Array();
var tmpOpenedLayer="";

function showLayer(takjak,layer){

	clearTimeout(tid[layer]);

	if(takjak==false){
		$("list_"+layer).style.display="none";
		css("remove",$("butt_"+layer),"hover");
		if($("absoluteLayerShadow")) $("absoluteLayerShadow").style.display="none";
		tmpOpenedLayer="";

	}else{
		y=getAnchorPosition("butt_"+layer).y;
		x=getAnchorPosition("butt_"+layer).x;

		$("list_"+layer).style.left=(x+(-13))+"px";
		$("list_"+layer).style.top=(y+21)+"px";

		if(tmpOpenedLayer!="" && layer!=tmpOpenedLayer){
			$("list_"+tmpOpenedLayer).style.display="none";
			css("remove",$("butt_"+tmpOpenedLayer),"hover");

			if($("absoluteLayerShadow")) $("absoluteLayerShadow").style.display="none";
			tmpOpenedLayer="";
		}
		tmpOpenedLayer=layer;

		$("list_"+layer).style.display="block";
		css("add",$("butt_"+layer),"hover");

		if($("absoluteLayerShadow")){
			$("absoluteLayerShadow").style.height=(getElementHeight("list_"+layer)+6)+"px";
			$("absoluteLayerShadow").style.width=getElementWidth("list_"+layer)+"px";

			$("absoluteLayerShadow").style.left=(x+(-7))+"px";
			$("absoluteLayerShadow").style.top=(y+21)+"px";

			$("absoluteLayerShadow").style.display="block";
		}
	}

}

var openedShortcut="";

function ezopShowShortcutInfo(v,cut){
	content=$("shortcutInfoButton["+v+"]").getAttribute('title');

	if(openedShortcut==v){
		ezopCloseShortcutInfo();

	}else{

		if(content!=""){
			// znicime predchozi info (pokud je)
			if(openedShortcut!=""){
				var d = $("shortcutInfoArea["+openedShortcut+"]");
				d.parentNode.removeChild(d);
			}

			openedShortcut=v;

			y=getAnchorPosition("shortcutInfoButton["+v+"]").y;
			x=getAnchorPosition("shortcutInfoButton["+v+"]").x;

			var a=$("headerAbs");
			var e = document.createElement("span");
			e.setAttribute("id","shortcutInfoArea["+v+"]");

			e.style.position="absolute";
			e.style.top=(y+22)+"px";
			e.style.left=(x-15)+"px";
			e.style.background="white";
			e.style.textAlign="left";
			e.style.border="2px solid #03438E";
			e.style.padding="7px 10px 7px 10px";
			e.style.zIndex="15000";
			e.style.width="250px";

			e.innerHTML=content;
			a.insertBefore(e, $("subnavi"));
		}
	}
}

function ezopCloseShortcutInfo(){
	// znicime predchozi info (pokud je)
	if(openedShortcut!=""){
		var d = $("shortcutInfoArea["+openedShortcut+"]");
		d.parentNode.removeChild(d);
		openedShortcut="";
	}
}

function hideLayer(layer){
	tid[layer] = setTimeout("showLayer(false,'"+layer+"')", 250);
}

	function getAnnex(num,type){

		if(num==1){
			if(type=="hours") data="hodinu";
			if(type=="minutes") data="minutu";
			if(type=="tasks") data="úkol";
			if(type=="mails") data="novou zprávu";
			if(type=="answers") data="odpověď";
			if(type=="redakcni") data="redakční";
			if(type=="selected") data="Vybrána";
			if(type=="photos") data="fotka";
			if(type=="is") data="je";
			if(type=="was") data="byla";
			if(type=="added") data="přidána";
			if(type=="u_photos") data="fotky";
		}else if(num>=2 && num<=4){
			if(type=="hours") data="hodiny";
			if(type=="minutes") data="minuty";
			if(type=="tasks") data="úkoly";
			if(type=="mails") data="nové zprávy";
			if(type=="answers") data="odpovědi";
			if(type=="redakcni") data="redakční";
			if(type=="selected") data="Vybrány";
			if(type=="photos") data="fotky";
			if(type=="is") data="jsou";
			if(type=="was") data="byly";
			if(type=="added") data="přidány";
			if(type=="u_photos") data="fotek";
		}else{
			if(type=="hours") data="hodin";
			if(type=="minutes") data="minut";
			if(type=="tasks") data="úkolů";
			if(type=="mails") data="nových zpráv";
			if(type=="answers") data="odpovědí";
			if(type=="redakcni") data="redakčních";
			if(type=="selected") data="Vybráno";
			if(type=="photos") data="fotek";
			if(type=="is") data="je";
			if(type=="was") data="bylo";
			if(type=="added") data="přidáno";
			if(type=="u_photos") data="fotek";
		}
		return data;
	}


	function fcc(fccfrm){

		zzz=document.forms[fccfrm];

		pole_povinne = new Array();
		pole_email = new Array();
		pole_stejne = new Array();
		pole_area = new Array();

		if(zzz.elements["fcc_require"]) pole_povinne=zzz.elements["fcc_require"].value.split(',');
		if(zzz.elements["fcc_email"]) pole_email=zzz.elements["fcc_email"].value.split(',');
		if(zzz.elements["fcc_year"]){ pole_year=zzz.elements["fcc_year"].value.split(',');} else {pole_year='';};
		if(zzz.elements["fcc_same"]) pole_stejne=zzz.elements["fcc_same"].value.split(',');
		if(zzz.elements["fcc_area"]) pole_area=zzz.elements["fcc_area"].value.split(',');

			for(n=0;n<zzz.elements.length;n++){
				for(m=0;m<pole_povinne.length;m++){
					if(zzz.elements[n].name==pole_povinne[m] && (zzz.elements[n].type=="text" || zzz.elements[n].type=="password" || zzz.elements[n].type=="hidden")){
						if(zzz.elements[n].value.length<=1){
							alert("Tuto položku musíte vyplnit.");
							zzz.elements[n].focus();
							zzz.elements[n].style.border="1px solid red";
							return false;
						}
					}else{
						repro = 1;
					}
				}

				if(pole_email.length>0){
					//e-mail
					for(m=0;m<pole_email.length;m++){
						if(zzz.elements[n].name==pole_email[m]){
							re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
							if (!re.test(zzz.elements[n].value)){
								alert("Toto není správný formát e-mailové adresy.");
								zzz.elements[n].focus();
								return false;
							}
						}else{
							repro = repro;
						}
					}
				}

				if(pole_year.length>0){
					//e-mail
					for(m=0;m<pole_year.length;m++){
						if(zzz.elements[n].name==pole_year[m]){
							if (zzz.elements[n].value!=new Date().getFullYear()){
								alert("Toto není letošní rok.");
								zzz.elements[n].focus();
								return false;
							}
						}else{
							repro = repro;
						}
					}
				}

				for(m=0;m<pole_area.length;m++){
					if(zzz.elements[n].name==pole_area[m]){
						if(zzz.elements[n].value.length<=5){
							alert("Tuto položku musíte vyplnit.");
							zzz.elements[n].focus();
							zzz.elements[n].style.border="1px solid red";
							return false;
						}
					}else{
						repro = 1;
					}
				}

			}

		if(pole_stejne.length>0){
			// same
			if(zzz.elements[pole_stejne[0]].value!=zzz.elements[pole_stejne[1]].value){
				alert("Hesla nejsou schodná.");
				zzz.elements[pole_stejne[1]].focus();
				return false;
			}else{
				repro = repro;
			}
		}

		if(repro==1) zzz.submit();
	}


	function odbarvy(frm,ktery) {
		zzz=document.forms[frm];
		zzz.elements[ktery.name].style.background="#FFFFFF";
	}