 	
//-------------------------------------------------
function okno(action,winwidth,winheight,name,scroll,toolbar,status,resizable,menubar) {
	var PROFILE = null;
       
	PROFILE =  window.open ("", name, "toolbar="+toolbar+",width="+winwidth+",height="+winheight+",directories=no,location=no,status="+status+",scrollbars="+scroll+",resizable="+resizable+",menubar="+menubar+"");
        if (PROFILE != null) {
               if (PROFILE.opener == null) {
                   PROFILE.opener = self;
        	   }
	       PROFILE.location.href = action;
        } 
       
       
}
//-------------------------------------------------
function reokno(action,winwidth,winheight,name,scroll,toolbar,status,resize,menubar) 
	{
	
	window.close();
	
	b = window.opener;
	a = b.closed;
				
	if (!a)
	{
		var PROFILE = null;
	       	PROFILE =  self.open ("", "nalezen", "toolbar="+toolbar+",width="+winwidth+",height="+winheight+",directories=no, status="+status+",scrollbars="+scroll+",resize="+resize+",menubar="+menubar+"");
	        if (PROFILE != null) {
	               if (PROFILE.opener == null) {
	                   PROFILE.opener = self;
	        	   }
		       PROFILE.location.href = action;
	}
        }
}
//-------------------------------------------------
function reoknoclen(action,winwidth,winheight,name,scroll,toolbar,status,resize,menubar) 
	{
	
	window.close();
	
	b = window.opener;
	a = b.closed;
				
	if (!a)
	{
		var PROFILE = null;
	       	PROFILE =  self.open ("", "clen", "toolbar="+toolbar+",width="+winwidth+",height="+winheight+",directories=no, status="+status+",scrollbars="+scroll+",resize="+resize+",menubar="+menubar+"");
	        if (PROFILE != null) {
	               if (PROFILE.opener == null) {
	                   PROFILE.opener = self;
	        	   }
		       PROFILE.location.href = action;
	}
        }
        }
//-------------------------------------------------
function GetElementById(id){
	if (document.getElementById) {
		return (document.getElementById(id));
	} else if (document.all) {
		return (document.all[id]);
	} else {
		if ((navigator.appname.indexOf("Netscape") != -1) && parseInt(navigator.appversion == 4)) {
			return (document.layers[id]);
		}
	}
}
//-------------------------------------------------
function CheckAll(formname, switchid) {
	var ele = document.forms[formname].elements;
	var switch_cbox = GetElementById(switchid);
	for (var i = 0; i < ele.length; i++) {
		var e = ele[i];
		if ( (e.name != switch_cbox.name) && (e.type == 'checkbox') ) {
			e.checked = switch_cbox.checked;
		}
	}
}
//-------------------------------------------------
function stylTextu(formname, policko, styl) {
if(styl == "a")
{
	var adresa = prompt('Zadej adresu odkazu', '');
	var text = prompt('Zadej název odkazu', '');
	document.forms[formname].elements[policko].value += "<"+ styl +" href=\""+ adresa +"\">"+ text +"</"+ styl +">";
}
else
{
	var text = prompt('Zadej text', '');
	document.forms[formname].elements[policko].value += "<"+ styl +">"+ text +"</"+ styl +">";
}
}
//-------------------------------------------------
function anketa_check_form(formname,moznost) {
	var ele = formname.moznost;
var chyba = "Nevybrali jste žádnou možnost!";
		for (var i = 0; i < ele.length; i++) {
			var e = ele[i];
			if (e.checked == true){
			var chyba = "";
			}
		}
		if (chyba != ""){
			alert (chyba);
			return false;
		}
		else return true;
}
//-------------------------------------------------
function potvrzeni (adresa, hlaska) 
          {
          var potvrdit = confirm (hlaska);
          if (potvrdit)
               {
               self.location.href = adresa;
			   }
	     }
//-------------------------------------------------
function validate_email(field, alerttxt)
		{
			with (field){
				apos=value.indexOf("@");
				dotpos=value.lastIndexOf(".");
				if (apos<1||dotpos-apos<2){
					alert(alerttxt);
					return false;
				}
				else {return true;}
			}
		}
//-------------------------------------------------
function validate_empty(field, alerttxt)
		{
			with (field){
				if (value == ""){
					alert(alerttxt);
					return false;
				}
				else {return true;}
			}
		}
//-------------------------------------------------
function validate_radio(rb, alerttxt)
		{
			// set var radio_choice to false
			var radio_choice = false;
			
			// Loop from zero to the one minus the number of radio button selections
			for (var i = 0; i < rb.length; i++) {
				// If a radio button has been selected it will return true
				// (If not it will return false)
				if (rb[i].checked)
					radio_choice = true; 
			}
			
			if (!radio_choice){
				// If there were no selections made display an alert box 
				alert(alerttxt)
				return false;
			}
			else return true;
		}
//-------------------------------------------------
function UkazHide(div,stav)
{
   var d = getE(div);
   var _stav = stav;

   if (d == null) return;

   if (stav == 3)
   {
         if (d.style.display == "") _stav = 0;
         else                       _stav = 1;
   }

   if (_stav == 0)
   {
         d.style.visibility = "hidden";
         d.style.display    = "none";
   }
   else
   {
         d.style.visibility = "visible";
         d.style.display    = "";
   }
}
//-------------------------------------------------
function ZmenSelect(ele,value)
{
   var d = getE(ele);
   var v = value;
   d.selectedIndex = v;
}
//-------------------------------------------------
function kalendar_ucast_check_form(formname,ucast) {
	var ele = formname.ucast;
var chyba = "Nevybrali jste žádnou možnost!";
		for (var i = 0; i < ele.length; i++) {
			var e = ele[i];
			if (e.checked == true){
			var chyba = "";
			}
		}
		if (chyba != ""){
			alert (chyba);
			return false;
		}
		else return true;
}

