	function winH() {
	   if (window.innerHeight)
	      return window.innerHeight;
	   else if
	   (document.documentElement &&
	   document.documentElement.clientHeight)
	      return document.documentElement.clientHeight;
	   else if
	   (document.body && document.body.clientHeight)
	      return document.body.clientHeight; 
	   else
	      return null;
	}
	function editorPreview(frame){
		parent.document.getElementById(frame).innerHTML = CKEDITOR.instances.editor1.getData() ;
	}
	function pageResize(){
		var height = winH()-70 ;	
		var editor = CKEDITOR.instances.editor1 ;
		editor.resize(editor.config.width,height);
		//alert(frame);
	}
	
	
	function onBodyLoad(){
		var right = document.getElementById('recent-posts') ;
		var left = document.getElementById('latest-post') ;
		//alert(right.clientHeight+"/"+left.clientHeight+"/"+left.style.height) ;
		if (left.clientHeight<right.clientHeight){
			left.style.height = right.clientHeight+"px" ;
		}
		//alert(right.clientHeight+"/"+left.clientHeight+"/"+left.style.height) ;
	}
	
	function openEditor(page,subpage,frame){
		var editor_window = dhtmlwindow.open("editor_window", "iframe", "index_editor.php?page="+page+"&subpage="+subpage+"&frame="+frame+"", "Editor stránek", 
   			"width=800px,height=620px,center=1,scrolling=0,resize=1", "recal");
	}
	
	function openNewsEditor(newid){
		var editor_window = dhtmlwindow.open("editor_window", "iframe", "index_news_editor.php?newid="+newid, "Editor novinek", 
   			"width=800px,height=620px,center=1,scrolling=0,resize=1", "recal");
	}
	
	//----------- banner ------------------

	function show_index_banner(caption,page,param){
	    
		var date = new Date() ;
	   var win = dhtmlmodal.open("banner_1", "iframe", page+"?"+date+"&"+param, caption, 
	   "width=740px,height=610px,center=1,scrolling=0,resize=0", "recal");
	   win.onclose=function(){ 
	       return true ;
	   }
	}
