function ukaz_oblast(id_oblasti){ var entita_obrazok=document.getElementById(id_oblasti); id_oblasti=id_oblasti.replace(/obr/,"div"); var entita_div=document.getElementById(id_oblasti); if (entita_div.style.display=='none' || entita_div.style.display=='' ) { entita_div.style.display="block"; entita_obrazok.src="img/minus.gif"; } else { entita_div.style.display="none"; entita_obrazok.src="img/plus.gif"; } } function nacitaj_staty(typ,hodnota){ document.getElementById('wait_diag').style.visibility='visible'; window.frames['loading_frame'].location='jscript/loading.js.php?id_statu='+hodnota+'&typ='+typ; } function nacitaj_subtyp(hodnota){ document.getElementById('wait_diag').style.visibility='visible'; window.frames['loading_frame'].location='jscript/loading.js.php?id_nadstavby='+hodnota; } function odstran_vsetky(typ){ if (typ==0) var select_nadradeny=document.getElementById('oblasti_vybrane_nakladka'); else if (typ==1) var select_nadradeny=document.getElementById('oblasti_vybrane_vykladka'); while (select_nadradeny.options.length > 0){ select_nadradeny.removeChild(select_nadradeny.options[0]); // clean it up... } } function odstran_oblast(typ){ if (typ==0) var entita=document.getElementById('oblasti_vybrane_nakladka'); else if (typ==1) var entita=document.getElementById('oblasti_vybrane_vykladka'); for (var i = 0; i < entita.length; i++) { if (entita.options[i].selected) { entita.removeChild(entita.options[i]); } } } function odosli(typ){ var pom="";//pomocna premenna pre docasne potrebne informacie var novy=0; var doterajsi=0; if (document.form.novy.checked) novy=1; if (document.form.doterajsi.checked) doterajsi=1; if (novy==0 && doterajsi==0) { window.alert('Prosim zaskrtnite ci chcete vyhladavat novych alebo stavajicich dopravcov'); return(false); } //parametre nakladu pom=document.form.suprava; var suprava=pom.options[pom.selectedIndex].value; pom=document.form.subtyp; if (pom.selectedIndex<0) var subtyp=-1; else var subtyp=pom.options[pom.selectedIndex].value; pom=document.form.pocet; var pocet=pom.value; if (IsNumeric(pocet)==false) pocet=0; //miesto nakladky pom=document.getElementById('oblasti_vybrane_nakladka'); var nakladka=new Array(); for (var i = 0; i < pom.length; i++) { nakladka.push(pom.options[i].value); } pom=document.getElementById('oblasti_vybrane_vykladka'); var vykladka=new Array(); for (var i = 0; i < pom.length; i++) { vykladka.push(pom.options[i].value); } /*if (suprava==-1 || subtyp==-1 || vykladka.length==0 || nakladka.length==0) { window.alert('Nie su zadane vsetky parametre vyhladavania'); return(false); }*/ var dotaz="?hladaj=1&id_supravy="+suprava+"&id_subtyp="+subtyp+"&pocet="+pocet+"&nakladka="+nakladka.join(";")+"&vykladka="+vykladka.join(";")+'&novy='+novy+'&doterajsi='+doterajsi; if (typ==0) document.location="vyhladavanie.php"+dotaz; if (typ==1) return(dotaz); } function IsNumeric(hodnota){ var ValidChars = "0123456789."; var cislo=true; var znak; if ((hodnota*1)==0 || hodnota=="") return(false);//nechceme aby mohol byt zadany 0pocet suprav for (i = 0; i < hodnota.length && cislo == true; i++) { znak = hodnota.charAt(i); if (ValidChars.indexOf(znak) == -1) cislo = false; } return cislo; } function init(){ var elm=document.form.suprava; nacitaj_subtyp(elm.options[elm.selectedIndex].value); } function init2(){ } function triedenie(){ var adresa_povodna=odosli(1); var elm=document.radenie.radit_podla; var radit_podla=elm.options[elm.selectedIndex].value; var elm=document.radenie.detail; var detail=elm.options[elm.selectedIndex].value; elm=document.radenie.asc_desc; var vzostupne=elm.options[elm.selectedIndex].value; document.location="vyhladavanie.php"+adresa_povodna+"&radeni=1&radit_podla="+radit_podla+"&vzostupne="+vzostupne+"&detail="+detail; } function export_excel(id_dodavatel){ var adresa_povodna=document.location; if (id_dodavatel!=0) document.location=adresa_povodna+'&export=xls&detail=1&id_dodavatela='+id_dodavatel; else { var detail=0; var pocet_zaznamov=document.getElementById('celkovy_pocet_zaznamov').value; var volba=(document.getElementById('detail').value==1)? true:false; //if (pocet_zaznamov<15) volba=window.confirm ('Chcete zobrazit detailní výpis dodavatelů? (V opačném případě se zobrazí stručný)'); if (pocet_zaznamov>15 && volba==true) { volba=false; window.alert('Váš dotaz je příliš obsáhlý - bude generován stručný export dat'); } if (volba) detail=1; document.location=adresa_povodna+'&export=xls&detail='+detail; } }