window.defaultStatus="eAMOS :: eLearning system";

function cOn(td){
  if(document.getElementById||(document.all && !(document.getElementById))){
    td.style.backgroundColor="#E7EAED";
  }
}

function cOut(td,cb){
var color_back=cb;
  if(document.getElementById||(document.all && !(document.getElementById))){
    td.style.backgroundColor=color_back;
  }
}


function tisk() {
var nav = navigator.appVersion;
if (nav.indexOf('MSIE 5') > 0)
  {window.print();
	}
}
function save_as(){
   var editorvalue = document.form1.body.value;
   var newinfo = "<html>";
	newinfo +=tinyMCE.getContent();
       //newinfo += "<body>"+editorvalue+"</body>";
       newinfo += "</html>";

       newFrame.document.open("text/html","replace")
       newFrame.document.write(newinfo)
       newFrame.document.close()
       newFrame.focus()
       newFrame.document.execCommand('SaveAs',false,'filename.html');
}
function kill()
{
    parent.window.close();
}
window.onload = window.focus;
window.onerror = stopError;
function stopError()
{
        return true;
}


function odeslat(form)
{

var arPole=[
	    form.first_name.value, 
	    form.lastname.value,
	    form.email.value, 
	    form.katedra.value, 
	   ]
  
var arPole_alert=[
		  "jméno",	     	      
 		  "příjmení",
		  "email",
	 	  "katedra",
	  	 ]   

var alert_pred="Musíte vyplnit položku "
var alert_psc="Špatně vyplněná položka PSČ. PSČ musí být číslo."
var alert_email="Musíte vyplnit uživatelův email ve formátu: xxx@yyy.zz"

var pocet_poli=arPole.length;

for(var i=0; i<=pocet_poli; i++)
  if (arPole[i]==""){
		alert(alert_pred + arPole_alert[i]+".")
		return false;								
  }

for(var i=0; i<=pocet_poli; i++)
  if (arPole_alert[i]=="PSČ"){
	var cislo=parseInt(arPole[i]);
	if (isNaN(cislo) || arPole[i]!=""+cislo) {
		alert (alert_psc);
		return false;
	}
  }

for(var i=0; i<=pocet_poli; i++)
  if (arPole_alert[i]=="email"){
	if (arPole[i].indexOf("@")==-1){
		alert(alert_email)
                return false;
	}
  }	

}

function delete_item(a,hlaska) {
          if (confirm(hlaska)) {
		window.location=a;
		      }
 }
function open_ext(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=400,height=200');}
function open_win(movie,sirka,vyska){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width='+sirka+',height='+vyska);}
function open_print(movie){
var x=600
var y=screen.availHeight-30
window.open(movie,"preview","scrollbars=yes,toolbar=no,resizable=yes,location=left,width="+x+",height="+y);
}
function open_w(stranka, x, y){
var movie=stranka;
x=window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width='+x+',height='+y); 
}
function open_small_pass(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=400,height=290');}
function open_theme(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=700,height=600');}
function open_fm(stranka){
var movie=stranka;
x=window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=600,height=300'); 
}
function open_news(movie){
var x=390
var y=screen.availHeight-30
window.open(movie,"preview","scrollbars=yes,toolbar=no,resizable=yes,location=left,width="+x+",height="+y);
}
function open_obr(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=500,height=400');}
function open_small_window1(movie){window.open(movie,'preview','scrollbars=no,toolbar=no,resizable=no,location=left,width=400,height=500');}
function open_small_window(movie){window.open(movie,'preview','scrollbars=no,toolbar=no,resizable=no,location=left,width=400,height=300');}
function open_kurz(movie){window.open(movie,'preview','scrollbars=yes,toolbar=yes,resizable=yes,location=center');}
function openmap(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=center,width=660,height=530');}
function OpenStat(movie){
var x=screen.availWidth-10
var y=screen.availHeight-30
window.open(movie,"preview","scrollbars=yes,toolbar=no,resizable=no,location=left,width="+x+",height="+y);
}
function open_help(movie){
var x=390
var y=screen.availHeight
window.open(movie,"preview","scrollbars=yes,toolbar=no,resizable=yes,location=left,width="+x+",height="+y);
}
function open_pop(kam){
var kam;
window.open(kam,'popup','width=750,height=570,scrollbars=yes,resizable=yes,toolbar=yes,status=yes');
}
function pozice_okna(x,y){window.moveTo(x,y);}
function open_flash(movie){window.open(movie,'preview','scrollbars=no,toolbar=no,resizable=no,location=left,width=600,height=400');}
function open_anotace(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=yes,location=left,width=400,height=250');}
function open_vzor(movie){window.open(movie,'preview','scrollbars=no,toolbar=no,resizable=no,location=left,width=350,height=330');}
function new_win_test(movie){window.open(movie,'preview','scrollbars=yes,toolbar=no,resizable=no,location=left,width=700,height=550');}
function setCheckboxes(the_form, do_check){
    var elts      = document.forms[the_form].elements['slozka[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else
    return true;
}

function log_out(){document.execCommand('ClearAuthenticationCache');}
function redirect(url){window.location=url;}
function open_passwd(movie){window.open(movie,'preview','scrollbars=no,toolbar=no,resizable=no,location=left,width=400,height=250'); }