var IE; var NS; var NS6; var NS6a; var old_day = 0; var old_month = 0; var calendar_flag = 1; function init(home) { IE=(document.all)?true:false; NS=(navigator.appName=="Netscape")?true:false; NS6a=(document.getElementById)?true:false; if(NS6a && NS){ NS6=true; //document.getElementById("message").style.left = 255+"px"; //document.getElementById("message").style.top = -540+"px"; if(home == 1) { document.getElementById("message").style.display = "block"; document.getElementById("message").style.background = "url(../images/bg_message.png)"; } } else{ NS6=false; if(home == 1) { document.getElementById("message").style.display = "block"; } } } //== COSMETICS ============================================================================================= function closeMessage() { //alert('a'); document.getElementById("message").style.visibility = "hidden"; //document.getElementById("message").style.display = "none"; } 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\""); } } function over(img_num,type) { if(IE) { if(type == 1) { eval("document.all['pimg"+img_num+"'].src = \"images/fruits_icon_"+img_num+"_sel.jpg\""); } if(type == 2) { eval("document.all['zimg"+img_num+"'].src = \"images/grain_icon_"+img_num+"_sel.jpg\""); } } if(NS6) { if(type == 1) { eval("window.document.getElementById('pimg"+img_num+"').src = \"images/fruits_icon_"+img_num+"_sel.jpg\""); } if(type == 2) { eval("window.document.getElementById('zimg"+img_num+"').src = \"images/grain_icon_"+img_num+"_sel.jpg\""); } } } function out(img_num,type) { if(IE) { if(type == 1) { eval("document.all['pimg"+img_num+"'].src = \"images/fruits_icon_"+img_num+".jpg\""); } if(type == 2) { eval("document.all['zimg"+img_num+"'].src = \"images/grain_icon_"+img_num+".jpg\""); } } if(NS6) { if(type == 1) { eval("window.document.getElementById('pimg"+img_num+"').src = \"images/fruits_icon_"+img_num+".jpg\""); } if(type == 2) { eval("window.document.getElementById('zimg"+img_num+"').src = \"images/grain_icon_"+img_num+".jpg\""); } } } //========================================================================================================== //== FORMS ================================================================================================= function submit_form() { 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; } }