$(document).ready(function(){

$(function(){	
	$('#koran-navig').jScrollPane({showArrows:true});
});


$("#skry-vyklad-a-vysvetlivky").click(function() {

/*var text='';

$("#content li strong").each(function(i){     
  text=text+' '+$(this).html();
                  
});
*/

//$("#content").html(text);

$("#content li span").css("letter-spacing","-1px");



$("#content li span").css("font-size","1px");
$("#content li span").css("color","white");
$("#content li p").hide();

$("#content strong").css("position","relative");
$("#content strong").css("top","-1px");
$("#content strong").css("font-size","13px");
$("#content strong").css("letter-spacing","0px");

});


$("#zobraz-vyklad-a-vysvetlivky").click(function() {

$("#content li span").css("letter-spacing","0px");
$("#content li span").css("font-size","12px");
$("#content li span").css("color","#888888");
$("#content li p").show();
$("#content strong").css("font-size","13px");
$("#content strong").css("top","0px");

});
	
	$("#sitemap-edit").mousedown(function(e) {
	
	
  
  
    if ($(e.target).attr("class")=='hook_thickbox' && $(e.target).attr("rel")!=='profil-atatched') {        
      $(e.target).attr('rel','profil-atatched'); //zabránime aby sa thicbox inicializoval viackrát    
      tb_init($(e.target)); //apply thickbox only to clicked element	  
    }
    
    //V pripade ze klikol na objekt ktory je vnutri linku
     if ($(e.target).parent().attr("class")=='hook_thickbox' && $(e.target).parent().attr("rel")!=='profil-atatched') {     
      $(e.target).parent().attr('rel','profil-atatched'); 
      //zabránime aby sa thicbox inicializoval viackrát    
      tb_init($(e.target).parent()); 
      //apply thickbox only to clicked element	  
    }
    
    
  
  });


$("#sitemap-edit").click(function(e) {
     //V pripade ze klikol na objekt ktory je vnutri linku
  
  if ($(e.target).parent().attr("rel")=='ajax-del') {     
    if(confirm("Naozaj zmazať?")==true) {
    
        myurl=$(e.target).parent().attr('href');
        myurl=myurl+'&m_ajax=1';
        
          $.post( myurl ,
      		  { delpath: 1 },
      		  function(data){
      			if (data !== '') { 
      				
      				//alert(data);
      				if (data=='OK!') {
      				  $(e.target).parent().parent().remove();
      				}
      			
      		
              					
      
      			  } else {  }
      		  }
      		); 
        
        return false;
    } else { return false; }
  }
    

});

});



function switchMenu(content){
	obj=document.getElementById('IDmainMenu');
	obj.className='CSSmenuCONTENT'+content;
	
	
	
	document.getElementById('SubMenuuvod').className='Moff';
	document.getElementById('SubMenuspravy').className='Moff';
	document.getElementById('SubMenulive_vysledky').className='Moff';
	document.getElementById('SubMenulive_prenosy').className='Moff';
	document.getElementById('SubMenuzabava').className='Moff';
	document.getElementById('SubMenutipovacka').className='Moff';
	document.getElementById('SubMenuuzivatelia').className='Moff';
	document.getElementById('SubMenublog').className='Moff';
	document.getElementById('SubMenuPodSpravy').className='Moff';
	
		
	
	/* onmouseout="javascript:switchMenu('none')" */
	
	obj=document.getElementById('SubMenu'+content);
	obj.className='Mon';
	
}




function switchTopXY(obj, show){
	/*
	obj.className='CSStopXY'+obj.value;
	*/
	obj.parentNode.parentNode.className='CSStopXY'+show;
	document.getElementById('ncc').className='vyp';
	document.getElementById('nhd').className='vyp';
	document.getElementById(show).className='zap';
}

var scroll_speed=0;
function scrollIt(id, speed){
	if(speed){
		scroll_speed=speed;
	}
	obj=document.getElementById(id);
	obj.scrollTop=obj.scrollTop+Math.round(scroll_speed);
	tmpid=id;
	scroll_timeout=setTimeout("scrollIt(tmpid)", 20);
}

function scrollStop(){
	clearTimeout(scroll_timeout);
}



function letternumber(e)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
// control keys
if ((key==null) || (key==0) || (key==8) || 
(key==9) || (key==13) || (key==27) )
return true;
// alphas and numbers
else if (((":0123456789").indexOf(keychar) > -1))
return true;
else
return false;
}	


function showpic(cesta, width, height) 
	{
	WinFeatures = 'toolbar=no,scrollbars=no,status=no,resizable=yes,width='+width+',height='+height;
	ShowWindow = window.open('showpic.php?path='+cesta,'info',WinFeatures);
	}



function isEmailAddress (string) {
  var addressPattern = 
    /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
  return addressPattern.test(string);
}
function checkEmail (field) {
  if (!isEmailAddress(field.value)) {
    alert('Please enter correct email address!');
    field.focus();
    field.select();
  }
}

// script by 1999 Idocs, Inc. http://www.idocs.com
function pismenacisla(e)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
// control keys
if ((key==null) || (key==0) || (key==8) || 
(key==9) || (key==13) || (key==27) )
return true;
// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
return true;
else
return false;
}	

/*
startList=function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("IDddmenu").firstChild;
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" CSSover";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" CSSover", "");
				}
			}
		}
	}
}


window.onload=startList;
*/


function livepopup() 
	{
	WinFeatures = 'scrollbars=no,status=no,resizable=no,width=270,height=270';
	ShowWindow = window.open('live_window.php','info',WinFeatures);
	}


function uploadpopup(parameter) 
	{
	WinFeatures = 'scrollbars=no,status=no,resizable=no,width=320,height=60';
	ShowWindow = window.open('pages_user/upload_popup.php'+parameter,'info',WinFeatures);
	}
function insertimagepopup() 	
	{
	WinFeatures = 'scrollbars=yes,status=no,resizable=yes,width=422,height=400';
	ShowWindow = window.open('pages_user/filemanager/browse.php','info',WinFeatures);
	}
function setImage (imgname)
	{
	document.settings_form.user_icon.value=imgname;
	document.user_image.src = 'icony/system/'+imgname;
	}

function setownImage (imgname)
	{
	document.settings_form.user_icon.value=imgname;
	document.user_image.src = 'icony/users/'+imgname;
	}

function setownPhoto (imgname,cislo_adresara)
	{
	foto_id=imgname.split("."); 
	document.fotozabava_form.foto_id.value=foto_id[0];
	document.user_image.src = 'photos_zabava/thumb'+cislo_adresara+'/'+imgname;
	pathpath= 'photos_zabava/thumb'+cislo_adresara+'/'+imgname;
	}


function fixLiveFrame (newsize) {

vyska=newsize+20+5;
document.getElementById('live2-iframe').style.cssText='width:255px; height:'+vyska+'px';

}



  try {
		document.execCommand("BackgroundImageCache", false, true);
	} catch(err) { }



