var IE; var old_day = 0; var old_month = 0; var calendar_flag = 1; function init() { IE=(document.all)?true:false; } //== COSMETICS ============================================================================================= function initLogin() { document.onkeydown = keyDown; } function keyDown() { //alert(event.keyCode); //alert(String.fromCharCode(event.keyCode)); if(event.keyCode == 13) { document.forms['uf'].submit(); } if(event.keyCode == 27) { document.forms['uf'].user.value = ""; document.forms['uf'].pass.value = ""; } } function capover(capt) { if(IE) { eval("document.all['"+capt+"'].style.textDecoration = \"underline\""); } if(NS6) { eval("window.document.getElementById('"+capt+"').style.textDecoration = \"underline\""); } } function capout(capt) { if(IE) { eval("document.all['"+capt+"'].style.textDecoration = \"none\""); } if(NS6) { eval("window.document.getElementById('"+capt+"').style.textDecoration = \"none\""); } } //========================================================================================================== //== FORMS ================================================================================================= function submit_form(act) { document.forms['f'].action = act; document.forms['f'].submit(); } function set_value(variable , val) { eval("document.forms['f']."+variable+".value = "+val); } function set_str_value(variable , val) { eval("document.forms['f']."+variable+".value = '"+val+"'"); } function is_fill(str) { if(str == "") { return false; } else { return true; } } //========================================================================================================== //== CALENDAR ============================================================================================== function pop_window(url,name,w,h,t,l) { var popit = window.open(url,name,"statusbar=yes, scrollbars=no, height="+h+", width="+w+",top="+t+",left="+l+",screenX=300,screenY=300"); } function calendarche(t,l,tx,field,postfield) { eval("document.all['"+field+"'].innerHTML=tx"); eval("document.forms['f']."+postfield+".value = ''"); pop_window('calendar.php?field='+field+'&postfield='+postfield,'cal',210,200,t,l); } function date_return(y,m,d,od,om,field,postfield) { IE=(document.all)?true:false; NS=(navigator.appName=="Netscape")?true:false; NS6a=(document.getElementById)?true:false; if(NS6a && NS){ NS6=true; } else{ NS6=false; } /*if(calendar_flag == 2) { alert(month+" "+day); }*/ if(m == om && om != 0 && calendar_flag == 1) { //calendar_flag markira che e izbrana data => pti powtorno izbirane starata trqbwa da se razmarkira old_day = od; // towa se prawi zaradi prezkachaneto m/u razlichnitte meseci da move da se syhrani starata markirana data, zashtoto tam datata se prehwyrlq chrez _POST i om i od sydyrjat syotwetno $_POST['m'] i $_POST['d']; old_month = om; calendar_flag = 0; } if(old_day == 0 && old_month == 0) { old_day = d; old_month = m; } else { if(old_day<10) { old_day = "0"+old_day; } if(old_month<10) { old_month = "0"+old_month; } if(IE) { eval("document.all['date"+old_month+old_day+"'].style.color = '#000000'"); eval("document.all['date"+old_month+old_day+"'].style.fontWeight = 'normal'"); eval("document.all['td"+old_month+old_day+"'].background = ''"); } if(NS) { eval("document.getElementById('date"+old_month+old_day+"').style.color = '#000000'"); eval("document.getElementById('date"+old_month+old_day+"').style.fontWeight = 'normal'"); eval("document.getElementById('td"+old_month+old_day+"').background = ''"); } old_day = d; old_month = m; } if(m<10) { m= "0"+m; } if(d<10) { d= "0"+d; } if(IE) { eval("document.all['date"+m+d+"'].style.color = '#000000'"); eval("document.all['date"+m+d+"'].style.fontWeight = 'bold'"); eval("document.all['td"+m+d+"'].background = '../images/calendar_select.gif'"); } if(NS) { eval("document.getElementById('date"+m+b+"').style.color = '#000000'"); eval("document.getElementById('date"+m+b+"').style.fontWeight = 'bold'"); eval("document.getElementById('date"+m+b+"').background = '../images/calendar_select.gif'"); } document.forms['f'].m.value = m; document.forms['f'].d.value = d; month = m; day = d; vdate = y+"."+m+"."+d; eval("opener.document.forms['f']."+postfield+".value = vdate"); revdate = d+"."+m+"."+y; if(IE) { eval("opener.document.all['"+field+"'].innerHTML = revdate"); } if(NS) { eval("opener.document.getElementById('"+field+"').innerHTML = revdate"); } } function cal_close() { window.close(); } //========================================================================================================== function sh_image() { if(document.forms('f').parent.value == 1111) { document.forms('f').image.disabled = false; } else { document.forms('f').image.disabled = true; } } function set_fields(text,id,ord) { document.forms['f'].name.value = text; document.forms['f'].id.value = id; document.forms['f'].order.options[ord].selected = true; }