
function ajaxd() { 
$.get('clanky/zvoneni_top.php', {ajax: 'ajax'} , function(data) {
		  	$("#informace").html(data);
				});
}

//----------------------------------------------
function doubleConfirm(text1, text2)
{
	var check1=confirm(text1);
	if (check1)	{
		var check2=confirm(text2);
		if (check2) {
			return true;
		}
		else {
			return false;
		}
	}
	else
	{
		return false;
	}
}

//------------------------------
function prodluzDiv(div,min_vyska) {
var vyska = document.getElementById(div).offsetHeight;
document.getElementById('clanek').style.height = null;
if(vyska<min_vyska) document.getElementById(div).style.height = min_vyska+'px';
}

//------------------------------
var state = 'none'; 
function showhide(layer_ref) { 
if (state == 'block') { 
state = 'none'; 
} 
else { 
state = 'block'; 
} 
if (document.all) { //IS IE 4 or 5 (or 6 beta) 
eval( "document.all." + layer_ref + ".style.display = state"); 
} 
if (document.layers) { //IS NETSCAPE 4 or below 
document.layers[layer_ref].display = state; 
} 
if (document.getElementById &&!document.all) { 
hza = document.getElementById(layer_ref); 
hza.style.display = state; 
} 
} 

//-------------------------------------------------


function showTR(layer_ref){
if (document.getElementById(layer_ref).style.display!='table-row' && document.getElementById(layer_ref).style.display!='block') { 
try {
document.getElementById(layer_ref).style.display = 'table-row';
}
catch(iestupidproblem) {
document.getElementById(layer_ref).style.display = 'block';
}
}
else {
try {
document.getElementById(layer_ref).style.display = 'none';
}
catch(iestupidproblem) {
document.getElementById(layer_ref).style.display = 'none';
}
}

}

//-------------------------------------------------
function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "nofollow")  
     anchor.target = "_blank";
     
     /// alert(anchor.getAttribute("rel"));
     
 }  
} 

//-------------------------------------------------

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;
}


function Jump(theSelect){
    selindex = theSelect.selectedIndex;
    selvalue = theSelect.options[selindex].value;

    if (selvalue=="url") { 
        document.getElementById("url").className = 'sh_show'; 
        document.getElementById("soubor").className = 'sh_none'; 
      } else { 
        document.getElementById("url").className = 'sh_none'; 
        document.getElementById("soubor").className = 'sh_show'; 
      } 
}






