function ftester(i,r=0) { prompt("fdbg: "+i+", řádek:"+r);} var pocasi = 6; /* celkem obrázků - pro posun obrázků počasí "http://www.meteopress.cz/pictures2/pp_cr_"+*/ var akt=0; /* aktuální obrázek - pro posun obrázků počasí */ var stp=akt; /* počáteční obrázek */ function ed3s() //příznak editace { document.getElementById("ed3s").textContent="(#)"; document.getElementById("ed3s").title="změna skriptu"; } function SUsera(){ //ftester('SU',25); if(document.getElementById('uzid').innerHTML!=0); document.getElementById('uzsave').style.visibility='hidden'; //u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+b+"&idu="+a+"&fce=DejUsera"; //ok s=document.getElementsByTagName('input'); // ? s=getElementsByClassName('u107'); //ok document.getElementsByClassName('107').length s=document.getElementsByClassName('107'); //ftester(s[19].value+s[20].value,33); //ftester(s[14].value+s[15].value+s[16].value+s[17].value+s[18].value+s[19].value+s[20].value,33); u=document.getElementById('4esa_ajx').value+".ajax.php?fce=SetUsera&p0="+document.getElementById('uzid').innerHTML+"&p1="+s[0].value+"&p2="+s[1].value+"&p3="+s[2].value+"&p4="+s[3].value+"&p5="+s[4].value+"&p6="+s[5].value+"&p7="+s[6].value+"&p8="+s[7].value+"&p9="+s[8].value+"&p10="+s[9].value+"&p11="+s[10].value+"&p12="+s[11].value+"&p13="+s[12].value+"&p14="+s[13].value+"&p15="+s[14].value+"&p16="+s[15].value+"&p17="+s[16].value+"&p18="+s[17].value+"&p19="+s[18].value+"&p20="+s[19].value+"&p21="+s[20].value; //+"&p22="+s[21].value; //ftester(u,34); getajx('s107',u); } function AddUsera(id=0){ document.getElementById('uzid').innerHTML=0; document.getElementById('uzsave').style.visibility='visible'; document.getElementById('us1').value='nový'; document.getElementById('us2').value='*'; document.getElementById('us3').value=''; document.getElementById('us4').value='0'; document.getElementById('us5').value='0'; document.getElementById('us6').value='@'; document.getElementById('us7').value=''; document.getElementById('us8').value='NULL'; document.getElementById('us9').value='NULL'; document.getElementById('us10').value='NULL'; document.getElementById('us11').value=''; document.getElementById('us12').value=''; document.getElementById('us13').value=''; document.getElementById('us14').value=''; document.getElementById('us15').value=''; document.getElementById('us16').value='0'; document.getElementById('us17').value='r'; document.getElementById('us18').value=''; document.getElementById('us19').value=''; document.getElementById('us20').value='1111000'; document.getElementById('us21').value='0'; document.getElementById('imgrs').src=''; } function ZClanek(x=0){ //ftester(document.getElementById('uzid').innerHTML,38); //ftester(parseInt(document.getElementById('clid').innerHTML),26); //S if(x<1){ if(document.getElementById('clid').innerHTML!='0') document.getElementById('clsave').style.visibility='visible'; }else{ if(document.getElementById('uzid').innerHTML!='0') document.getElementById('uzsave').style.visibility='visible'; } } function posun(y) { akt+=y; //ftester(akt,22); if(akt < stp) akt=stp; // netočíme if(akt > 5) akt=5; x=akt; document.getElementById("m0").src="https://meteopress.cz/pictures/pp_cr_"+x+"den.png"; x+=1; document.getElementById("m1").src="https://meteopress.cz/pictures/pp_cr_"+x+"den.png"; x+=1; document.getElementById("m2").src="https://meteopress.cz/pictures/pp_cr_"+x+"den.png"; } function getMeteoPress(i) // doplněk k počasí - linky { if(i==0) document.getElementById("pocasi").innerHTML='
 Počasí dnes
'; else if(i==1) document.getElementById("pocasi").innerHTML='
 Evropa - předpověď
'; else if(i==2) document.getElementById("pocasi").innerHTML='
 Teplota - zítra
'; else window.open("https://vystrahy-cr.chmi.cz/", '','width=600,height=500'); // document.getElementById("pocasi").innerHTML='
 Výstrahy ČHMÚ
'; } function SetHmi() //uvodní nastavení HMI alert("hmi"); { document.getElementById("mhmi").innerHTML=' '; document.getElementById("mkg").value='0'; document.getElementById("mcm").value='0'; } // led function Pocitej1() { var form_sazba = document.getElementById("es"); var form_prikonLed = document.getElementById("wattL"); var form_prikonZ = document.getElementById("wattZ"); // alert(form_prikonZ.value+" , "+document.getElementById("wattZ").value); var form_pocetZ = document.getElementById("kus"); var form_provozZ = document.getElementById("hod"); var form_cenaLed = document.getElementById("cenaL"); var vysledek_spotrebaZ = document.getElementById("vysledek_spotrebaZ"); vysledek_spotrebaZ.innerHTML = Math.round((form_prikonZ.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)+ 0.49) + ",- Kč"; var vysledek_spotrebaLed = document.getElementById("vysledek_spotrebaLed"); vysledek_spotrebaLed.innerHTML = Math.round((form_prikonLed.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)) + ",- Kč"; var vysledek_usetrite = document.getElementById("vysledek_usetrite"); vysledek_usetrite.innerHTML = Math.round((form_prikonZ.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)-(form_prikonLed.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)) + ",- Kč"; var vysledek_investice = document.getElementById("vysledek_investice"); vysledek_investice.innerHTML = Math.round((1 / (((form_prikonZ.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)-(form_prikonLed.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)) / (form_cenaLed.value * form_pocetZ.value)))*100)/100 + " roku"; } function Pocitej() { var form_sazba = document.getElementById("es"); var form_prikonLed = document.getElementById("wattL"); var form_prikonZ = document.getElementById("wattZ"); var form_pocetZ = document.getElementById("kus"); var form_provozZ = document.getElementById("hod"); var form_cenaLed = document.getElementById("cenaL"); var spotrebaZ = Math.round((form_prikonZ.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)+ 0.49); var vysledek_spotrebaZ = document.getElementById("vysledek_spotrebaZ"); vysledek_spotrebaZ.innerHTML = spotrebaZ + ",- Kč"; var form_investice = document.getElementById("form_investice"); form_investice.innerHTML = Math.round(form_pocetZ.value * form_cenaLed.value) + ",- Kč"; var spotrebaLed = Math.round((form_prikonLed.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)); var vysledek_spotrebaLed = document.getElementById("vysledek_spotrebaLed"); vysledek_spotrebaLed.innerHTML = spotrebaLed + ",- Kč"; var vysledek_usetrite = document.getElementById("vysledek_usetrite"); vysledek_usetrite.innerHTML = Math.round(spotrebaZ-spotrebaLed) + ",- Kč"; var vysledek_investice = document.getElementById("vysledek_investice"); vysledek_investice.innerHTML = Math.round((1 / (((form_prikonZ.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)-(form_prikonLed.value * form_provozZ.value * 365 * (form_sazba.value / 1000) * form_pocetZ.value)) / (form_cenaLed.value * form_pocetZ.value)))*100)/100 + " roku"; } function mN38(a,b) { //ftester(b, 145); u=''; if(b==28) { u=document.getElementById('4esa_ajx').value+".ajax.php?idc="+a+"&fce=DejClanek"; document.getElementById('clid').innerHTML=a; document.getElementById('cldel').style.visibility='visible'; }else if(b==107) { u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+b+"&idu="+a+"&fce=DejUsera"; document.getElementById('uzid').innerHTML=a; document.getElementById('cldel').style.visibility='visible'; } //ftester(u, 156); getajx(b,u); } function Klavesa(e,t) // formuláře přihlášení do RS, WS, člen { if(e.keyCode == 13) { if(t.id=='email') document.getElementById('password').focus(); else if(t.id=='ipas') document.getElementById('kontrola').focus(); else if(t.id=='kontrola') document.getElementById('email').focus(); event.returnValue = false; // pro IE } } function Stisk(f) // brání použití klávesy enter, formuláře přihlášení do RS, WS, člen { f.press.value=1; //alert(f.press.value); } function Pressvalue(x=0) { document.getElementById('press').value=x; // alert("press="+x); } function ESendForm(f) // formuláře přihlášení editora 22 eskript4.php { //ftester(f.sid.value,181); //f.press.value+"ESendForm="+f.sid.value,125); if(f.press.value>0) // rs { f.press.value=0; //f.kontrola.hidden=true; //alert(f.press.value); if(f.sid.value==22) { f.test.value=hex_md5(f.email.value); f.press.value=hex_md5(f.kontrola.value+hex_md5(f.kontrola.value)); f.ipas.value=hex_md5(f.kontrola.value+hex_md5(f.ipas.value)); u=f.ajx.value+".ajax.php?sid="+f.sid.value+"&ipas="+f.ipas.value+"&test="+f.test.value+"&fce="+f.fce.value+"&kod="+f.press.value; }else u=''; //ftester(u,194); getajx(f.sid.value,u); return false; } return false; // enter } function SendForm(f) // formuláře přihlášení 19/registrace 20 usera { //ftester("19",145); // ftester(document.getElementById('4esa_ajx').value); if(f.press.value>0) // rs { f.press.value=0; f.kontrola.hidden=true; f.test.value=hex_md5(f.email.value); f.press.value=hex_md5(f.kontrola.value+hex_md5(f.kontrola.value)); //ftester(f.test.value,151); if(f.sid.value==19) { //f.ipas.value=f.kontrola.value+hex_md5(f.ipas.value); f.ipas.value=hex_md5(f.kontrola.value+hex_md5(f.ipas.value)); //f.email.value=''; u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&ipas="+f.ipas.value+"&test="+f.test.value+"&fce="+f.fce.value+"&kod="+f.press.value; }else // if(f.sid.value==20) u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&email="+f.email.value+"&test="+f.test.value+"&fce="+f.fce.value+"&kod="+f.press.value; // else if(f.sid.value==73) // u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&email="+f.email.value+"&test="+f.test.value+"&fce="+f.fce.value+"&kod="+f.press.value; // ftester(u,218); getajx(f.sid.value,u); return false; } return false; // enter } function FRedakce(f) //seznamy k redakci-redaktora { //ftester(f.sid.value,227); //ftester(f.fce.value,227); if(f.selIDW.value.length<1) u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&ida=0&r="+f.selIDR.value+"&p="+f.selIDP.value+"&fce="+f.fce.value; else u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&ida="+f.selIDW.value+"&r="+f.selIDR.value+"&p="+f.selIDP.value+"&fce="+f.fce.value; //ftester(u,232); getajx(f.sid.value,u); return false; } function FUsers(f) //seznamy k redakci-usery { //ftester(f,237); //if(f.selIDW.value.length>0){ // u=document.getElementById('4esa_ajx').value+".ajax.php?sid="+f.sid.value+"&idu="+f.selIDW.value+"&fce="+f.fce.value; u=document.getElementById('4esa_ajx').value+".ajax.php?sid=f&idu=0&fce=DejUsery"; //ftester(u,241); getajx(f,u); //} return false; } function DejPosun1(y=0) { y=document.getElementById('selIDF').childElementCount; //alert(document.getElementById('selIDF').childNodes[0].outerHTML); a=document.getElementById('selIDF').childNodes[0].outerHTML; b=document.getElementById('selIDF').childNodes[1].outerHTML; c=document.getElementById('selIDF').childNodes[2].outerHTML; d=document.getElementById('selIDF').childNodes[3].outerHTML; e=document.getElementById('selIDF').childNodes[4].outerHTML; x=0; //alert(a); for(i=4;i "; document.getElementById('tBody46').innerHTML=s; return false; } function getajx(x,u) { //ftester(x+" , "+u,283); if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { httpRequest = new XMLHttpRequest(); } httpRequest.open("GET", u, true); httpRequest.onreadystatechange= function () {procAjax(x); } ; httpRequest.send(null); // ftester(x,295); return false; } //var volil=0; function NastavA(t,r,a) //ankety { //ftester(t+','+r+','+a,300); // if(document.getElementById('ida'+a).value==0) // return true; document.getElementById('ida'+a).value=0; //ida = (id z tb anketa) url=document.getElementById('4esa_ajx').value+".ajax.php?ajxAnketa="+document.getElementById('anzv'+a).value+"&aid="+r+"&ida="+a; //ftester(url); if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { httpRequest = new XMLHttpRequest(); } httpRequest.open("GET", url, true); httpRequest.onreadystatechange= function () {procAjax(document.getElementById('anzv'+a).value); } ; httpRequest.send(null); return false; } function procAjax(x=0) { //ftester(x, 322); if (httpRequest.readyState == 4) { //ftester(httpRequest.status,324); if(httpRequest.status == 200) { //ftester(httpRequest.responseText.length); //ftester(httpRequest.responseText,327); if(x==0) // anketa malá { a=httpRequest.responseText.split("•"); //if(httpRequest.responseText.length>2) if(a[0]>0) { //a=httpRequest.responseText.split("•"); //c=parseInt(a[0]); // celkem nepoužito document.getElementById("asr"+a[1]).style.fontWeight="bold"; //color="#00f"; také OK document.getElementById("asr"+a[1]).style.color="blue"; //document.getElementById("sp"+a[2]).innerHTML="Děkujeme"; for(i=2;i 0) //!= { //a=httpRequest.responseText.split("•"); //ftester("sp"+a[0],282); c=parseInt(a[0]); // celkem document.getElementById("asr"+a[1]).style.fontWeight="bold"; document.getElementById("asr"+a[1]).style.color="red"; document.getElementById("sp"+a[2]).innerHTML="Děkujeme za hlasování"; for(i=3;i2) { a=httpRequest.responseText.split("•"); //ftester(httpRequest.responseText,274); //eval(a[3]) mNastav(a[3]); document.getElementById("kontrola").value="Přihlášen"; }else document.getElementById("kontrola").value="Nepřihlášen!"; }else if(x==22)//logedit { document.getElementById('loginu').hidden=true; document.getElementById("kontrola").style.fontWeight='bold'; document.getElementById("kontrola").hidden=false; // ftester(httpRequest.responseText,372); if(httpRequest.responseText.length>2) { a=httpRequest.responseText.split("•"); document.getElementById("rsp22").hidden=true; document.getElementById("iduname").value=a[1]; //a[0]+' '+a[1]; alert("Přihlášen"); }else document.getElementById("kontrola").value="Nepřihlášen!"; }else if(x==20)//registr { document.getElementById('registru').hidden=true; document.getElementById("kontrola").style.fontWeight='bold'; document.getElementById("kontrola").hidden=false; if(httpRequest.responseText.length>2) { a=httpRequest.responseText.split("•"); document.getElementById('regsp0').hidden=true; document.getElementById('regsp1').hidden=false; document.getElementById('regsp2').hidden=false; document.getElementById("kontrola").value="Registrován"; alert("Na uvedenou e-mail adresu byla adeslána aktivační zpráva.\nPřístup na web 4esa.eu aktivujte do 30minut.\n"); }else document.getElementById("kontrola").value="Neregistrován!"; }else if(x==73)//help { document.getElementById('helppwd').hidden=true; document.getElementById("kontrola").style.fontWeight='bold'; document.getElementById("kontrola").hidden=false; if(httpRequest.responseText.length>2) { //? a=httpRequest.responseText.split("•"); document.getElementById('regsp0').hidden=true; document.getElementById('regsp1').hidden=false; document.getElementById('regsp2').hidden=false; document.getElementById("kontrola").value="Registrován"; alert("Na uvedenou e-mail adresu byl odesláno nové heslo.\nPro přístup na web 4esa.eu.\n"); } }else if(x==58)//prehledy-seznamy-pg=2 { //ftester("58 "+httpRequest.responseText,310); if(httpRequest.responseText.length>2) { a=httpRequest.responseText.split("•"); //document.getElementById('selIDC').innerHTML=httpRequest.responseText; t='

\n

\n\n\n'; for(i=0;i'+a[i+3]+'

'; } document.fSez58.innerHTML=t+''; //ftester(t+'',324); }else a57=httpRequest.responseText; }else if(x==31)//prehledy-seznamy-pg=3 { ftester("31 "+httpRequest.responseText,379); if(httpRequest.responseText.length>2) { a=httpRequest.responseText.split("•"); //document.getElementById('selIDC').innerHTML=httpRequest.responseText; t='

\n

\n\n\n'; for(i=0;i'+a[i+3]+'

'; } document.fSez31.innerHTML=t+''; //ftester(t+'',338); }else a29=httpRequest.responseText; }else if(x==38)//redakce-seznamy { //ftester(httpRequest.responseText,430); if(httpRequest.responseText.length>2) { document.getElementById('selIDC').innerHTML=httpRequest.responseText; document.getElementById('clf').disabled=''; } }else if(x=='s107')//redakce-usera - ulozit { //ftester(httpRequest.responseText,436); if(httpRequest.responseText.length>9) alert(httpRequest.responseText); else alert('Uživatel ID: '+httpRequest.responseText+' uložen'); }else if(x==107)//redakce-usera { //ftester(httpRequest.responseText,442); if(httpRequest.responseText.length>2) { //document.getElementById('selIDW').innerHTML=httpRequest.responseText; //document.getElementById('clf').disabled=''; document.getElementById('uzsave').style.visibility='hidden'; a=httpRequest.responseText.split("•"); //document.getElementById('uzid').innerHTML=a[0]; ftester(a[0],415); //us0 document.getElementById('sp0cl').innerHTML='Vytvořen: '+a[8]+', Aktivní: '+a[10]+', Stav: '+a[5]+''; for(i=1; i2) { a=httpRequest.responseText.split("•"); document.getElementById('divtxt').innerHTML=''; //ftester(a[0],460); //ftester(a[0].substr(1),461); //ftester(a[0].length,462); document.getElementById('clnzv').value=a[0]; //.substr(1); document.getElementById('clrem').value=a[3]; document.getElementById('clprd').value=a[1]; //document.getElementById('pacl').value=a[12]; // v DejSel //document.getElementById('dscl').value=a[13]; // v DejSel DejSel(a[5],a[4],a[12],a[13]); // nutné - naplní selekty document.getElementById('sp0cl').innerHTML='Vytvořen: '+a[6]+', Aktualizace: '+a[7]+', Zveřejněn: '+a[8]+', Přečteno: '+a[9]+'x'; document.getElementById('imgrs').src='./rs/'+a[10]; //a[11] = ikona //ftester('cc: '+document.getElementById('imgrs').attributes[1].value.length); } }else if(x==1090) { document.getElementById('cldel').style.visibility='hidden'; document.getElementById('clid').innerHTML='S'; document.getElementById('clsave').style.visibility='hidden'; }else if(x==1091) { //document.getElementById('cldel').style.visibility='visible'; //document.getElementById('clid').innerHTML=httpRequest.responseText; ftester(httpRequest.responseText,478); if(httpRequest.responseText.length>0){ alert('Uloženo'); document.getElementById('clsave').style.visibility='hidden'; //fRedakce(fRed38); } }else if(x==1092) { document.getElementById("imgrs").src="./rs/"; }else if(x==46) { document.getElementById("imgrs").src="./rs/"; } } } } function DejSel(p,r,pa,ds) //clanky/skripty OK { //ftester( ds,488); y=document.getElementById('clp'); y.options.length=1; for(i=1; i0) document.getElementById('clsave').style.visibility='hidden'; else document.getElementById('selIDC').options.length=0; }else document.getElementById('uzsave').style.visibility='hidden'; document.getElementById('clrsn').style.visibility='visible'; document.getElementById('cldel').style.visibility='hidden'; y=document.fRed38.selIDW; if(y.selectedIndex<0) y.selectedIndex=0; document.getElementById('idw').value=y.options[y.selectedIndex].value;; } function NClanek() { //var f=document.getElementById('clf').files[0],name; //ftester(document.getElementById('clf').value); if(document.fRed38.selIDW.selectedIndex > -1) //(document.getElementsByName('rstxt')) { document.getElementById('clid').innerHTML='N'; document.getElementById('sp0cl').innerHTML='Vytvořen: , Aktualizace: , Zveřejněn: NE'; document.getElementById('clnzv').value=''; //document.getElementById('clnzv').readOnly=''; document.getElementById('clrem').value=''; //document.getElementById('clrem').readOnly=''; document.getElementById('clprd').value=''; //document.getElementById('clprd').readOnly=''; //document.getElementById('clf').disabled=''; document.getElementById('divtxt').innerHTML=''; //document.getElementById('pacl').selectedIndex=0; //v DejSel //document.getElementById('dscl').selectedIndex=0; //v DejSel DejSel(-1,-1,0,0); //naplní selekty // ,-1); // document.getElementById('rstxt').innerHTML=''; document.getElementById('clsave').style.visibility='hidden'; document.getElementById('cldel').style.visibility='hidden'; document.getElementById("imgrs").src="./rs/"; } } function DClanek() { if(parseInt(document.getElementById('clid').innerHTML)) { cid=document.getElementById('clid').innerHTML; u=document.getElementById('4esa_ajx').value+".ajax.php?idc="+cid+'&fce=DClanek'; getajx(1090,u); } return false; } function UClanek(f) { //ftester(f.nzv.value,575); // f.nzv.value = OK, f.dscl.selectedOptions[0].text OK, f.dscl.value OK f.idc.value=document.getElementById('clid').innerHTML; //článek y=document.fRed38.selIDW; f.idw.value=y.options[y.selectedIndex].value; //user return true; // txt=f.rstxt.value.replace(/#/g,'%23'); // if(txt.lenght>14000){ // txta=txt.slice(0,7000); // txtb=txt.slice(7000,14000); // txtc=txt.slice(14000); // }else if(txt.lenght>7000){ // txta=f.txt.slice(0,7000); // txtb=f.txt.slice(7000); // txtc=''; // }else{ // txta=txt; // txtb=''; // txtc=''; // } // ftester(txt,593);//.serialize() //***** !!!!! nelze použít dále - problém s délkou řádku !!!!!! .replace(/#/g,'%23') nahradí v textu # za %23 //*****u=document.getElementById('4esa_ajx').value+".ajax.php?idc="+f.idc.value+'&ida='+f.idw.value+'&fce=UClanek'+'&clr='+f.clr.value+'&clp='+f.clp.value+'&nzv='+f.clnzv.value.replace(/#/g,'%23')+'&rem='+f.clrem.value.replace(/#/g,'%23')+'&prd='+f.clprd.value.replace(/#/g,'%23')+'&st='+f.rstxt.value.replace(/#/g,'%23')+'&pacl='+f.pacl.value+'&dscl='+f.dscl.value; //**3**u=document.getElementById('4esa_ajx').value+".ajax.php?idc="+f.idc.value+'&ida='+f.idw.value+'&fce=UClanek'+'&clr='+f.clr.value+'&clp='+f.clp.value+'&nzv='+f.clnzv.value.replace(/#/g,'%23')+'&rem='+f.clrem.value.replace(/#/g,'%23')+'&prd='+f.clprd.value.replace(/#/g,'%23')+'&sta='+txta+'&stb='+txtb+'&stc='+txtc+'&pacl='+f.pacl.value+'&dscl='+f.dscl.value; //*****//ftester(u,580); //*****getajx(1091,u); } // editace RS function VlozTextT() // vkládá html tagy do textu: nepárové table { //ftester(477); veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m='
'+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+'
'; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+m.length; document.getElementById("rstxt").selectionEnd=st+m.length; } function VlozTextI() // vkládá html tagy do textu: nepárové img { //ftester(487); veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m='foto-obr'; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+m.length; document.getElementById("rstxt").selectionEnd=st+m.length; } function VlozText(s) // vkládá thtml tagy do textu: nepárové { veta=document.getElementById("rstxt").value; //ftester(s,499); st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); document.getElementById("rstxt").value=veta.slice(0,st)+s+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+s.length; document.getElementById("rstxt").selectionEnd=st+s.length; } function VlozText2(s1,s2) // vkládá thtml tagy - párové { veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=s1+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s2; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+m.length; document.getElementById("rstxt").selectionEnd=st+m.length; } function VlozText9(s1) //s1,s2,s3) // vkládá thtml tag table { alert(1); } function VlozText3(s1,s2,s3) // vkládá thtml tagy do textu: barva { var f=prompt("číslo barvy (hex)", "#ff0000"); if(f) // vložím barvu písma { f=s1+'"'+f+'"'+s2; veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=f+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s3; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+f.length; document.getElementById("rstxt").selectionEnd=st+f.length; } } function VlozText4(s1,s2,s3,s4) // vkládá thtml tagy do textu: zarovnání { f=s1+'"'+s2+'"'+s3; veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=f+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s4; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+f.length; document.getElementById("rstxt").selectionEnd=st+f.length; } function VlozTextP(s1,s2) // vkládá thtml tagy do textu: barva Pozadí ff00ff { var f=prompt("číslo barvy (hex)", "#99ff00"); if(f) { f=''; // vložím barvu pozadí veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=f+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s2; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+f.length; document.getElementById("rstxt").selectionEnd=st+f.length; } } function VlozTextV(s1,s2,s3) // vkládá thtml tagy do textu: velikost písma 3 { var f=prompt("Písmo (1-7)", "3"); if(f) { f=s1+'"'+f+'"'+s2; // vložím číslo velikosti fontu veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=f+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s3; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+f.length; document.getElementById("rstxt").selectionEnd=st+f.length; } } function VlozLink(s1,s2,s3) // vkládá thtml tagy do textu: odkaz-link { var f=prompt("text odkazu", "https:// (odkaz-link)"); if(f) // vložím odkaz { f=s1+'"'+f+'"'+' style="" title="odkaz"'+s2; veta=document.getElementById("rstxt").value; st=document.getElementById("rstxt").selectionStart; document.getElementById("rstxt").focus(); m=f+veta.substr(st, document.getElementById("rstxt").selectionEnd-st)+s3; document.getElementById("rstxt").value=veta.slice(0,st)+m+veta.slice(document.getElementById("rstxt").selectionEnd); document.getElementById("rstxt").selectionStart=st+f.length; document.getElementById("rstxt").selectionEnd=st+f.length; } } showrs=false; // náhled článku function NahledRS(path,obr,h,w) // ukáže náhled článku při editaci 150= h= _RSHSPACE 250= w= _RSVSPACE { //ftester(path,582); //obr); if(obr.length<10) t=''; else t=''; if(!showrs) // shodné s funkci mOkno { showrs=new popUp(100, 150, 650, 300, 'viewrs','
'+t+document.getElementById("rstxt").value+"
", "white", "black", "10pt sans-serif", "Náhled: "+document.getElementById("clnzv").value, "blue", "#f0f0f0", "#dddddd", "gray", "gray", false, true, true, true, true); }else document.getElementById('viewrs_c').innerHTML='
'+t+document.getElementById("rstxt").value+"
"; showbox('viewrs'); } function AvPopis(t) // avatar - dá hodnotu popis do edit pole pro změnu { document.getElementById('eav').value=t.title; // popis document.getElementById('idav').value=t.name; // id - změna document.getElementById('xav').value+=(t.name+'•'); // id - seznam del } // Popup Windows - V 3.0 // Author: Brian Gosselin // Site URL: http://scriptasylum.com // // Browser compatibility: // IE4+, NS4+, NS6+ (with limited functionality in pre 5.0 browsers) // // Supported Features: // > Seperate Drag and Drop (both can be disabled), minimize/restore/close, drag resize, and // fonts/colors/dimensions/placement for each popup. // > Allows any number of popups per page limited only by browser/computer performance. // > Popups are created after page runtime allowing for truly dynamic windows. // > Popups can be created in their "closed" state and then opened via javascript function if desired. // > Degrades gracefully in older browsers by creating normal browser windows. // //* VF doplneno o promenou: ismix //* ismix=true resi minimalizaci a maximalizaci okna bez nutnosti nastavit: isresize=true //* var w3c=(document.getElementById)? true: false; var ie5=(w3c && document.all)? true : false; var ns6=(w3c && (navigator.appName=="Netscape"))? true: false; currIDb=null; xoff=0; yoff=0; currRS=null; rsxoff=0; rsyoff=0; oldac=null; newac=null; zdx=99; mx=0; my=0; sumk=362880; maxodk=20; var idlist=new Array(); idlist.btns=new Array(); idlist.btns[0]=new Image(); idlist.btns[0].src="./img/min1.png"; idlist.btns[1]=new Image(); idlist.btns[1].src="./img/max1.png"; idlist.btns[2]=new Image(); idlist.btns[2].src="./img/close1.png"; idlist.btns[3]=new Image(); idlist.btns[3].src="./img/resize1.png"; function hidebox(id){ if(w3c){ document.getElementById(id+'_b').style.display='none'; document.getElementById(id+'_s').style.display='none'; }} function exitbox(id){ if(w3c){ document.getElementById(id+'_b').style.display='none'; document.getElementById(id+'_s').style.display='none'; document.getElementById(id+'_c').innerHTML=''; // exit }} function showbox(id){ if(w3c){ var bx=document.getElementById(id+'_b').style; var sh=document.getElementById(id+'_s').style; bx.display='block'; sh.display='block'; sh.zIndex=++zdx; bx.zIndex=++zdx; }} function minimize(){ if(w3c){ this.IDS[0].style.height=(ie5)? '28px':'24px'; this.IDS[3].style.height='28px'; this.IDS[2].style.display='none'; this.IDS[4].style.display='none'; setTimeout('ns6bugfix()',100); }} function restore(){ if(w3c){ var h=this.IDS[10]; this.IDS[0].style.height=h+'px'; //box this.IDS[3].style.height=(ie5)? h+'px':h+5+'px'; //shd this.IDS[2].style.display='block'; this.IDS[4].style.display='block'; setTimeout('ns6bugfix()',100); }} function ns6bugfix(){ self.resizeBy(0,1); self.resizeBy(0,-1); } function trackmouse(evt){ mx=(ie5)?event.clientX+document.body.scrollLeft:evt.pageX; my=(ie5)?event.clientY+document.body.scrollTop:evt.pageY; if(!ns6)movepopup(); if((currIDb!=null)||(currRS!=null))return false; } function movepopup(){ if((currIDb!=null)&&w3c){ var x=mx+xoff; var y=my+yoff; currIDb.style.left=x+'px'; currIDs.style.left=x+8+'px'; currIDb.style.top=y+'px'; currIDs.style.top=y+8+'px'; } if((currRS!=null)&&w3c){ var rx=mx+rsxoff; var ry=my+rsyoff; var c=currRS; c.style.left=Math.max(rx,((ie5)?88:92))+'px'; c.style.top=Math.max(ry,((ie5)?68:72))+'px'; c.IDS[0].style.width=Math.max(rx+((ie5)?12:8),100)+'px'; c.IDS[0].style.height=Math.max(ry+((ie5)?12:8),80)+'px'; c.IDS[1].style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px'; c.IDS[5].style.left=parseInt(c.IDS[1].style.width)-48+'px'; c.IDS[3].style.width=Math.max(rx+12,((ie5)?100:104))+'px'; c.IDS[3].style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px'; c.IDS[2].style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px'; c.IDS[2].style.height=Math.max(ry-((ie5)?24:28),44)+'px'; c.IDS[10]=parseInt(c.IDS[0].style.height); }} function startRS(evt){ var ex=(ie5)?event.clientX+document.body.scrollLeft:evt.pageX; var ey=(ie5)?event.clientY+document.body.scrollTop:evt.pageY; rsxoff=parseInt(this.style.left)-ex; rsyoff=parseInt(this.style.top)-ey; currRS=this; if(ns6)this.IDS[2].style.overflow='hidden'; return false; } function stopdrag(){ currIDb=null; ns6bugfix(); } function grab_id(evt){ var ex=(ie5)?event.clientX+document.body.scrollLeft:evt.pageX; var ey=(ie5)?event.clientY+document.body.scrollTop:evt.pageY; xoff=parseInt(this.IDS[0].style.left)-ex; yoff=parseInt(this.IDS[0].style.top)-ey; currIDb=this.IDS[0]; currIDs=this.IDS[3]; return false; } function subBox(x,y,w,h,bgc,id){ var v=document.createElement('div'); v.setAttribute('id',id); v.style.position='absolute'; v.style.left=x+'px'; v.style.top=y+'px'; v.style.width=w+'px'; v.style.height=h+'px'; v.style.backgroundColor=bgc; v.style.visibility='visible'; v.style.padding='0px 0px 0px 0px'; return v; } function popUp(x,y,w,h,cid,text,bgcolor,textcolor,fontstyleset,title,titlecolor,titletextcolor,bordercolor,scrollcolor,shadowcolor,showonstart,isdrag,isresize,oldOK,ismix){ if(w3c){ var tw, th; w=Math.max(w,100); h=Math.max(h,80); var rdiv=new subBox(w-((ie5)?12:8),h-((ie5)?12:8),7,7,'',cid+'_rs'); if(isresize){ rdiv.innerHTML=''; rdiv.style.cursor='move'; } tw=(ie5)?w:w+4; th=(ie5)?h:h+6; var shadow=new subBox(x+8,y+8,tw,th,shadowcolor,cid+'_s'); if(ie5)shadow.style.filter="alpha(opacity=50)"; else shadow.style.MozOpacity=.5; shadow.style.zIndex=++zdx; var tw,th; var outerdiv=new subBox(x,y,w,h,bordercolor,cid+'_b'); outerdiv.style.borderStyle="outset"; outerdiv.style.borderWidth="2px"; outerdiv.style.borderColor=bordercolor; outerdiv.style.zIndex=++zdx; tw=(ie5)?w-8:w-5; th=(ie5)?h+4:h-4; var titlebar=new subBox(2,2,tw,20,titlecolor,cid+'_t'); titlebar.style.overflow="hidden"; titlebar.style.cursor="default"; if(ismix){ //* VF titlebar.innerHTML=''+title+''; }else{ titlebar.innerHTML=''+title+''; } tw=(ie5)?w-7:w-13; th=(ie5)?h-36:h-36; var content=new subBox(2,24,tw,th,bgcolor,cid+'_c'); content.style.borderColor=bordercolor; content.style.borderStyle="inset"; content.style.borderWidth="2px"; content.style.overflow="auto"; content.style.padding="0px 2px 0px 4px"; content.style.font=fontstyleset; content.style.color=textcolor; if(ie5)content.style.scrollbarBaseColor=scrollcolor; content.innerHTML=text; outerdiv.appendChild(titlebar); outerdiv.appendChild(content); outerdiv.appendChild(rdiv); document.body.appendChild(shadow); document.body.appendChild(outerdiv); if(!showonstart)hidebox(cid); var IDS=new Array(); IDS[0]=document.getElementById(cid+'_b'); IDS[1]=document.getElementById(cid+'_t'); IDS[2]=document.getElementById(cid+'_c'); IDS[3]=document.getElementById(cid+'_s'); IDS[4]=document.getElementById(cid+'_rs'); IDS[5]=document.getElementById(cid+'_btt'); IDS[6]=document.getElementById(cid+'_min'); IDS[7]=document.getElementById(cid+'_max'); IDS[8]=document.getElementById(cid+'_cls'); IDS[9]=cid; IDS[10]=h; this.IDb=IDS[0]; this.IDb.IDS=IDS; this.IDt=IDS[1]; this.IDt.IDS=IDS; this.IDc=IDS[2]; this.IDc.IDS=IDS; this.IDs=IDS[3]; this.IDs.IDS=IDS; this.IDrs=IDS[4]; this.IDrs.IDS=IDS; this.IDbtt=IDS[5]; this.IDbtt.IDS=IDS; this.IDmin=IDS[6]; this.IDmin.IDS=IDS; this.IDmax=IDS[7]; this.IDmax.IDS=IDS; this.IDcls=IDS[8]; this.IDcls.IDS=IDS; this.IDb.activecolor=titlecolor; this.IDb.inactivecolor=scrollcolor; if(oldac!=null)oldac.IDS[1].style.backgroundColor=oldac.inactivecolor; oldac=this.IDb; this.IDcls.onclick=new Function("hidebox('"+cid+"');"); //("exitbox('"+cid+"');"); if(ismix){ //* VF this.IDmin.onclick=minimize; this.IDmax.onclick=restore; } if(isresize){ //* VF this.IDrs.onmousedown=startRS; this.IDrs.onmouseup=new Function("currRS=null"); } this.IDb.onmousedown=function(){ if(oldac!=null){ oldac.IDS[1].style.backgroundColor=oldac.inactivecolor; } if(ns6)this.IDS[2].style.overflow='auto'; oldac=this; this.IDS[1].style.backgroundColor=this.activecolor; this.IDS[3].style.zIndex=++zdx; this.style.zIndex=++zdx; } if(isdrag){ this.IDt.onmousedown=grab_id; this.IDt.onmouseup=stopdrag; } }else{ if(oldOK){ var ctr=new Date(); ctr=ctr.getTime(); var win=window.open("" ,"abc"+ctr,"status=no,menubar=no,width="+w+",height="+h+",resizable=yes,scrollbars=yes"); var t=''+title+''+text+''; win.document.write(t); win.document.close(); }}} if(ns6)setInterval('movepopup()',40); if(w3c){ document.onmousemove=trackmouse; document.onmouseup=new Function("currRS=null"); } var osx=10; //10, 10, 280, 310 var osy=10; var o_s=280; var o_v=310; var txt=''; var nzv=''; window.onload=function(){ info(); //new popUp(osx, osy, o_s, o_v, "Div", txt, "white", "black", "bold 10pt sans-serif", nzv, "navy", "white", "#dddddd", "gray", "gray", true, true, false, true, true); } function pastecode(){ var d=document.f; d.codea.value='new popUp('+d.x.value+', '+d.y.value+', '+d.w.value+', '+d.h.value+', "'+d.id.value+'", "'+d.ctxt.value+'", "'+d.cbgc.value+'", "'+d.ctc.value+'", "'+d.fss.value+'", "'+d.ttxt.value+'", "'+d.tbgc.value+'", "'+d.ttc.value+'", "'+d.bc.value+'", "'+d.sbc.value+'", "'+d.sc.value+'", '+d.sos.value+', '+d.dg.value+', '+d.rsz.value+', '+d.okold.value+', '+d.mix.value+');' } function openpopup(){ var d=document.f; new popUp(parseInt(d.x.value), parseInt(d.y.value), parseInt(d.w.value), parseInt(d.h.value), d.id.value+(new Date().getTime()), d.ctxt.value, d.cbgc.value, d.ctc.value, d.fss.value, d.ttxt.value, d.tbgc.value, d.ttc.value, d.bc.value, d.sbc.value, d.sc.value, eval(d.sos.value), eval(d.dg.value), eval(d.rsz.value), eval(d.okold.value), eval(d.mix.value)); }