function showMenu(menuItem){
try{
 hideAllMenu();
}catch(e){}

try{
 document.getElementById(menuItem).style.display = 'block';
}catch(e){}
}

function hideMenu(menuItem){
try{
 document.getElementById(menuItem).style.display = 'none';
}catch(e){}
}

function hideAllMenu(){
 hideMenu('mnuServ');
 hideMenu('mnuRef');
 hideMenu('mnuComp');
 hideMenu('mnuPress');
 hideMenu('mnuCar');
 hideMenu('mnuCli');
 hideMenu('mnuCont');
 hideMenu('mnuBenef');
}

function setJazyk(){
 var jazyk = document.getElementById('jazyk').options[document.getElementById('jazyk').selectedIndex].value;
 var target = ur+'?lang='+jazyk+"&"+qs;

 document.location=target;
}


function viewSrc(){
if (edMode) {
 var s = Editor.document.body.innerHTML;
 Editor.document.body.innerText=s;
 edMode = false;
} else {
 var s = Editor.document.body.innerText;
 Editor.document.body.innerHTML=s;
 edMode = true;
}


}

function obnovStyl(){
 Editor.document.recalc(); 
}

function setFormat(fm,ot) {
 Editor.focus();

 if (!edMode) {
   alert(strErr);
   Editor.focus();
   return;
 }

 try{
   if (ot=="removeFormat") {
     fm=ot;
     ot=null;
   }

   if (edMode) {
     if (ot==null){     
      if ((Editor.document.selection.type !== "Control")) {
        Editor.document.execCommand(fm); 
       }
     } else {
       { 
       Editor.document.execCommand(fm,"",ot); 
       }
     }
   } 
 }catch(e){

 }  
 sel=null;
   Editor.focus()
}

function makeLink(){
  Editor.focus();
  if (!edMode) {
   alert(strErr);
   Editor.focus();
   return;
  } 

  obnovStyl();

  if ( !((Editor.document.selection.type === "Text")||(Editor.document.selection.type === "None")) ) 
   return;
  
  Editor.document.execCommand("CreateLink","true","");
  obnovStyl();
  Editor.focus();
}

function formatBlock(){
  var blok = document.all.BLOK;
  if (Editor.document.selection.type != "Control")   
     setFormat("formatBlock","<"+blok[blok.selectedIndex].value+">")
  blok.selectedIndex=0;
  Editor.focus()
}


function showImage(target){
 var wnd = window.open(target, "", "toolbar=no, resizable=yes, location=no, scrollbars=yes, width=700px, height=500px");
}
