calendar = function(name,target,date) { this.name=name; this.target=document.getElementById(target); this.date=date; this.width=210; this.height=1; this.left=0; this.top=0; this.createcontainer = function() { var doc=document; doc.writeln("
\n"); doc.close(); this.container=document.getElementById("cal"+this.name); this.hider=document.getElementById("calhider"+this.name); }, this.hide = function() { this.container.style.display='none'; this.hider.style.display='none'; }, this.settarget = function(value) { this.target.value=value; this.hide(); this.target.focus(); }, this.str2dt = function(str_datetime) { var re_date = /^(\d+)\.(\d+)\.(\d+)\.$/; if (!re_date.exec(str_datetime)) return alert("Helytelen dátumformátum "+ str_datetime); return (new Date (RegExp.$1, RegExp.$2-1, RegExp.$3)); }, this.dt2dtstr = function(dt_datetime) { var curr=""; curr=curr+dt_datetime.getFullYear()+"."; if(dt_datetime.getMonth()+1<10) curr=curr+"0"+(dt_datetime.getMonth()+1)+"."; else curr=curr+(dt_datetime.getMonth()+1)+"."; if(dt_datetime.getDate()<10) curr=curr+"0"+dt_datetime.getDate()+"."; else curr=curr+dt_datetime.getDate()+"."; return curr; }, this.tostamp = function(datearray) { if(parseInt(datearray[0])%4==0&&parseInt(datearray[0])%100!=0&&parseInt(datearray[0])%400==0) var months = new Array(0,31,29,31,31,31,31,31,31,31,31,31,31); else var months = new Array(0,31,28,31,31,31,31,31,31,31,31,31,31); stmp=0; for(y=0;y<=parseInt(datearray[0]);y++) if(y%4==0&&y%100!=0&&y%400==0) stmp+=366; else stmp+=365; for(m=1;m\n"; str_buffer+="\n"; str_buffer+="\n"; str_buffer+="\n\n"; str_buffer+="\n"; str_buffer+="\n\n"; var dt_current_day = new Date(dt_firstday); str_buffer+="\n"; for (var n=0; n<7; n++) str_buffer+="\n"; str_buffer+="\n"; while (dt_current_day.getMonth() == dt_datetime.getMonth() || dt_current_day.getMonth() == dt_firstday.getMonth()) { str_buffer+="\n"; for (var n_current_wday=0; n_current_wday<7; n_current_wday++) { if(dt_current_day.getDate()==dt_datetime.getDate()&&dt_current_day.getMonth()==dt_datetime.getMonth()) { str_buffer+=""; dt_current_day.setDate(dt_current_day.getDate()+1); } str_buffer+="\n"; } str_buffer+="
"+dt_datetime.getFullYear()+" "+arr_months[dt_datetime.getMonth()]+"
"+week_days[(n_weekstart+n)%7]+"
"; } else { if(dt_current_day.getDay()==0||dt_current_day.getDay()==6) { if(dt_current_day.getMonth()==dt_datetime.getMonth()) { str_buffer+=""; } else { str_buffer+=""; } } else { if(dt_current_day.getMonth()==dt_datetime.getMonth()) { str_buffer+=""; } else { str_buffer+=""; } } } str_buffer+=dt_current_day.getDate()+"
\n\n\n\n"; this.container.innerHTML=str_buffer; this.container.style.display='block'; this.hider.style.display='block'; this.container.style.position='absolute'; this.container.style.left=x+'px'; this.container.style.top=y+'px'; } this.createcontainer(); };