IE= null;
NS= null;

ua = navigator.appName.toLowerCase();

if(ua.indexOf('explorer')>-1 && document.getElementById && document.childNodes) {IE=true;}
if(ua.indexOf('netscape')>-1 && document.getElementById && document.childNodes) {NS=true;}

// zmeni kurzor
function changeCursor(obj,onoff) {
if (IE==true) {
    if (onoff==1) { obj.style.cursor='hand'; }
        else { obj.style.cursor='auto'; }
    }
    else {
    if (onoff==1) { obj.style.cursor='pointer'; }
       else { obj.style.cursor='auto'; }
    }
 return(true);   
}

//prida dalsi input file
function addElement() {
  var ni = document.getElementById('app');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById('theValue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  var ran_unrounded=Math.random()*10000;
  var ran_number=Math.floor(ran_unrounded);
  newdiv.innerHTML = '<input type="file" name="' +ran_number+ '" size="40" />';
  ni.appendChild(newdiv);
}

//kontroluje povinne polozky dokumentu
function doControl(form) {
    var chyba = '';
    
    if(form.title.value == '') chyba += "není vyplněn název \n";
    if(form.abstrakt.value == '') chyba += "není vyplněn abstrakt \n";
    
    if(chyba == '') { return true;}
    else {alert(chyba); return false;}
}

//kontroluje povinne polozky dokumentu ke stazeni
function doDownloadsControl(form) {
    var chyba = '';
    
    if(form.doc.value == '') chyba += "není přiložen dokument \n";
    //if(form.img.value == '') chyba += "není přiložen obrázek \n";
    if(form.desc.value == '') chyba += "není vyplněn popis \n";
    
    if(chyba == '') { return true;}
    else {alert(chyba); return false;}
}
