function isDefined(variable){ return (typeof(variable) == 'undefined')? false : true; } function ajax_get_date() { var req,datum,month,year; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } if (req != null) { req.open("POST", 'http://www.frogfish-studios.de/ajax/studio_common.php', true); req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); req.onreadystatechange = function (){ switch(req.readyState) { case 4: if(req.status!=200) { // AJAX Request fehlerhaft } else { datum = new Date(); if (isDefined(req.responseXML.getElementsByTagName("month")[0])) { month = req.responseXML.getElementsByTagName("month")[0].firstChild.nodeValue; } else month = datum.getMonth() + 1; if (isDefined(req.responseXML.getElementsByTagName("year")[0])) { year = req.responseXML.getElementsByTagName("year")[0].firstChild.nodeValue; } else year = datum.getFullYear(); bigcal_fill(1, month, year); } break; default: return false; break; } }; req.send("action=getdate"); } } function Numsort (a, b) { return a - b; } function make_bigcal() { var slot,y,newday,newdaylabel; slot = 0; for (y=1; y <= 42; y++) { if ((y%7)==0) newday = new Element('div',{'class':'bigcal_tag','id':('bigcal_slot' + slot),'style':'margin-right:0px;'}); else newday = new Element('div',{'class':'bigcal_tag','id':('bigcal_slot' + slot)}); newday.inject($('bigcal_tage')); newdaylabel = new Element('div',{'class':'minical_tag','id':('bigcal_tagnr' + slot),'style':'margin-left:5px;margin-top:5px;'}); newdaylabel.inject(newday); newdaycheck = new Element('div',{'class':'bigcal_check','id':('bigcal_check' + slot),'style':'margin-left:20px;margin-top:0px;'}); newdaycheck.inject(newday); slot++; } // daylist = new Element('input',{'class':'bigcal_daylist'}); // daylist.inject($('bigcal_rightnav')); $('bigcal_monat').set('text',"aktueller Monat"); $('bigcal_inc').addEvent('click', function(e) {bigcal_inc();}); $('bigcal_dec').addEvent('click', function(e) {bigcal_dec();}); ajax_get_date(); } function bigcal_fill(cal,month,year) { var datum,nowtime,monthname,i,j,day,datumtime; datum = new Date(); nowtime = datum.getTime(); datum.setDate(1); monthname = new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"); if (typeof(month) == 'undefined') month = datum.getMonth()+1; if (typeof(year) == 'undefined') year = datum.getFullYear(); if ((month >= 1) && (month <= 12)) { datum.setMonth(month - 1); } else month = datum.getMonth() + 1; // Year zweistellig bedeutet relativ zu 2000! if (year != 0) { if (year < 100) year = year + 2000; datum.setFullYear(year); } else year = datum.getFullYear(); datum.setDate(1); day = datum.getDay(); day = day - 1; if (day < 0) day = 6; i = 1; datumtime = 0; for (j=0;j" + daylist + auswahl_daylong + "." + auswahl_month + "." + auswahl_year + " - " + status_text + "
"; } document.getElementById('bigcal_rightnav').innerHTML = daylist; } break; default: return false; break; } }; req.send("action=getcalender&cal="+cal); } } function bigcal_inc() { var req,datum,month,year; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } if (req != null) { req.open("POST", 'http://www.frogfish-studios.de/ajax/studio_common.php', true); req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); req.onreadystatechange = function (){ switch(req.readyState) { case 4: if(req.status!=200) { // AJAX Request fehlerhaft } else { datum = new Date(); if (isDefined(req.responseXML.getElementsByTagName("month")[0])) { month = req.responseXML.getElementsByTagName("month")[0].firstChild.nodeValue; } else month = datum.getMonth() + 1; if (isDefined(req.responseXML.getElementsByTagName("year")[0])) { year = req.responseXML.getElementsByTagName("year")[0].firstChild.nodeValue; } else year = datum.getFullYear(); bigcal_fill(1, month, year); } break; default: return false; break; } }; req.send("action=incdate"); } } function bigcal_dec() { var req,datum,month,year; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } if (req != null) { req.open("POST", 'http://www.frogfish-studios.de/ajax/studio_common.php', true); req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); req.onreadystatechange = function (){ switch(req.readyState) { case 4: if(req.status!=200) { // AJAX Request fehlerhaft } else { datum = new Date(); if (isDefined(req.responseXML.getElementsByTagName("month")[0])) { month = req.responseXML.getElementsByTagName("month")[0].firstChild.nodeValue; } else month = datum.getMonth() + 1; if (isDefined(req.responseXML.getElementsByTagName("year")[0])) { year = req.responseXML.getElementsByTagName("year")[0].firstChild.nodeValue; } else year = datum.getFullYear(); bigcal_fill(1, month, year); } break; default: return false; break; } }; req.send("action=decdate"); } } function bigcal_ajax_toggleday(slot,start) { var day,slotnr_tens,slotnr_ones,auswahl_year,auswahl_month,auswahl_day; var req,now,nowtime,datum,termine,len,i,termin,tag,status; day = 0; slotnr_ones=parseInt(slot.id.charAt(slot.id.length-1)); slotnr_tens=parseInt(slot.id.charAt(slot.id.length-2)); if (!isNaN(slotnr_tens)) day = day + slotnr_tens*10; if (!isNaN(slotnr_ones)) day = day + slotnr_ones; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } if (req != null) { req.open("POST", 'http://www.frogfish-studios.de/ajax/studio_common.php', true); req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); req.onreadystatechange = function (){ switch(req.readyState) { case 4: if(req.status!=200) { // AJAX Request fehlerhaft } else { datum = new Date(); if (isDefined(req.responseXML.getElementsByTagName("month")[0])) { month = req.responseXML.getElementsByTagName("month")[0].firstChild.nodeValue; } else month = datum.getMonth() + 1; if (isDefined(req.responseXML.getElementsByTagName("year")[0])) { year = req.responseXML.getElementsByTagName("year")[0].firstChild.nodeValue; } else year = datum.getFullYear(); bigcal_fill(1, month, year); get_page('this'); } break; default: return false; break; } }; req.send("action=toggleday&day="+(day-start+1)); } }