function zaskrtni(field) {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
return true; }


function odskrtni(field) {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
return true; }


//-------------------------------------------------

function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
}
//-------------------------------------------------
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 checkRadios(text) {
 var el = document.forms[0].elements;
 for(var i = 0 ; i < el.length ; ++i) {
  if(el[i].type == "radio") {
   var radiogroup = el[el[i].name]; 
   var itemchecked = false;
   for(var j = 0 ; j < radiogroup.length ; ++j) {
    if(radiogroup[j].checked) {
	 itemchecked = true;
	 break;
	}
   }
   if(!itemchecked) { 
    alert(text);
    if(el[i].focus)
     el[i].focus();
	return false;
   }
  }
 }
 return true;
} 

//------------------------------------------------------
function commentFormExtras(){
	isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
	var ele=document.getElementById('nucleus_cf_body');
	if (!ele) return;
	var base=ele.parentNode.insertBefore(createNewEle('div'),ele);
	base.id='toolbar';
	var toolbar=['odkaz místní','odkaz mimo','tučně','kurzíva','podtržené'];
	var href=[' [o cesta o][o]','[o http:// o][o] ',' [b][/b]',' [i][/i]',' [u][/u]'];
	var title=['odkaz místní web','odkaz mimo','tučně','kurzíva','podtržené'];
	for(var i=0; i<toolbar.length; i++) {
		var aEle;
		(aEle=base.appendChild(createNewEle('a'))).appendChild(document.createTextNode(toolbar[i]));
		aEle.href='javascript:ct(\''+href[i]+'\')';
		aEle.title=title[i];
	};
}

// --------------------------------------------------------
var isXHTML;
function createNewEle(ele){
	if(isXHTML) { return document.createElementNS('http://www.w3.org/1999/xhtml', ele); }
	else { return document.createElement(ele); };
};	

//----------------------------------------------------------
function isValidComment(f) {
	if (f.user) if (!validX(f.user, 'Please enter your name and/or nickname!')) return false;
	if (f.body) if (!validX(f.body, 'Please enter the comment!')) return false;
	return true;
}

function ct(text){ 
 if (p=document.getElementById('nucleus_cf_body')){
  p.focus(); 
  p.value+=" "+text;
 }
}

function openCalendar(params, form, field, type) {
    window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
    dateField = eval("document." + form + "." + field);
    dateType = type;
}