function checkbox_js (the_id) { if (document.form.elements[the_id].checked == true) { document.form.elements[the_id].checked = false; }else { document.form.elements[the_id].checked = true; } } function inarray (value,array) { for(var key in array){ if(array[key]==value) { return key; } } } function tostring (pole,oddelovac) { string = ""; for (var key in pole) { if(pole[key]!="") {string += pole[key]+oddelovac;} } return string; } function tosource (array) { string=""; carka=""; for (var key in array) { string += carka+"\""+array[key]+"\""; carka=","; } return string; } function dates (datum) { if(datum) { i = inarray(datum,pole) if (i || i==="0") { pole.splice(i,1); } else { pole[pole.length]=datum; } } paste_to_textarea(tostring(pole,'\n')); str=tosource(pole); document.forms["kalendar1"].elements["hidden"].value=str; document.forms["kalendar2"].elements["hidden"].value=str; document.forms["formular"].elements["hidden"].value=str; } function paste_to_textarea(strinL){ var input=document.forms["formular"].elements["terminy"]; input.value=strinL; }