//Enter your wordpress root here, this is the location that your wp-content folder is in. Do not add a trailing slash. var siteurl="http://www.landsofdarkness.com"; var dateDay=['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato']; var dateDayShort=['D','L','M','M','G','V','S']; var dateMon=['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre']; var dateMonShort=['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic']; var entries_cache=new Array(); function addEvent(el,ev,fn){ if(el.attachEvent)el.attachEvent('on'+ev,fn); else if(el.addEventListener)el.addEventListener(ev,fn,false); } addEvent(window,'load',kcalendar_refresh); function kcalendar_build(year,month,day){ var today=new Date; shownDate=new Date(year,month,day); cal=document.createElement('table'); cal.id="wp-calendar"; caption=document.createElement('caption'); caption.appendChild(document.createTextNode(dateMon[shownDate.getMonth()]+' '+shownDate.getFullYear())); cal.appendChild(caption); // draw day headers cal_row=cal.insertRow(0); cal_row.id="calendar_daysRow"; for(i=0;i<7;i++){ cal_cell=cal_row.insertCell(i); cal_cell.appendChild(document.createTextNode(dateDayShort[i])); cal_cell.title=dateDay[i]; } // get date of first cell firstcelldate=new Date(shownDate.getFullYear(),shownDate.getMonth(),1); cellDate=1-firstcelldate.getDay(); if(cellDate>1)cellDate-=7; // draw rest of month days_in_last_month=kcalendar_daysInMonth(shownDate.getFullYear(),shownDate.getMonth()-1); for(i=0;i<6;i++){ cal_row=cal.insertRow(1+i); for(j=0;j<7;j++){ cal_cell=cal_row.insertCell(j); class_to_show='faded'; if(cellDate<1){ num_to_show='';//days_in_last_month+cellDate; }else if(cellDate>kcalendar_daysInMonth(shownDate.getFullYear(),shownDate.getMonth())){ num_to_show='';//cellDate-kcalendar_daysInMonth(shownDate.getFullYear(),shownDate.getMonth()); }else{ num_to_show=cellDate; class_to_show=''; if(shownDate.getFullYear()==today.getFullYear() && shownDate.getMonth()==today.getMonth() && cellDate==today.getDate()){ class_to_show+=" today" } } cal_cell.appendChild(document.createTextNode(num_to_show)); cal_cell.className=class_to_show; cal_cell.id="kcalendar_"+shownDate.getFullYear()+"_"+(shownDate.getMonth()+1)+"_"+cellDate; window.status=cal_cell.id; cellDate++; } } // draw navigation row cal_row=cal.insertRow(7); cal_cell=cal_row.insertCell(0); link_year=shownDate.getFullYear(); link_month=shownDate.getMonth()-1; if(link_month==-1){link_month=11;link_year--;} link=document.createElement('a'); link.appendChild(document.createTextNode('<' + dateMonShort[link_month] +' '+ link_year)); link.href="javascript:kcalendar_refresh("+link_year+","+link_month+");"; cal_cell.colSpan=3; cal_cell.appendChild(link); //make spinny go now! cal_cell=cal_row.insertCell(1); cal_cell.id="calendar_spin"; spinner = document.createElement("IMG"); spinner.src = siteurl + "/wp-content/livecalendar/wait.gif"; cal_cell.appendChild(spinner); //cal_cell.appendChild(document.createTextNode(shownDate.getFullYear()+' '+dateMonShort[shownDate.getMonth()])); //if (current month != month requested) and (current year != year requested) then do // if dec <> jan and 2004 == 2009 if ( (today.getMonth() == shownDate.getMonth()) && (today.getFullYear() == shownDate.getFullYear()) ){ /* cal_cell=cal_row.insertCell(2); link_year=shownDate.getFullYear(); link_month=shownDate.getMonth()+1; if(link_month==12){link_month=0;link_year++;} link=document.createElement('a'); link.appendChild(document.createTextNode(dateMonShort[link_month] +' '+ link_year + '>')); cal_cell.colSpan=3; cal_cell.appendChild(link);*/ } else { cal_cell=cal_row.insertCell(2); link_year=shownDate.getFullYear(); link_month=shownDate.getMonth()+1; if(link_month==12){link_month=0;link_year++;} link=document.createElement('a'); link.appendChild(document.createTextNode(dateMonShort[link_month] +' '+ link_year + '>')); link.href="javascript:kcalendar_refresh("+link_year+","+link_month+");"; cal_cell.colSpan=3; cal_cell.appendChild(link); } // get any applicable links for the dates tocall='kcalendar_'+(shownDate.getFullYear())+"_"+(shownDate.getMonth()); // if(entries_cache[tocall]){ // kcalendar_create_links(entries_cache[tocall]); // }else{ var req = new XMLHttpRequest(); if (req) { req.onreadystatechange=function(){ if(req.readyState==4&&req.status==200&&req.responseText!='') { entries_cache[tocall]=req.responseText.split(/\n/); kcalendar_create_links(entries_cache[tocall]); } }; req.open('GET', siteurl + '/wp-content/livecalendar/kcalendar.php?year='+shownDate.getFullYear()+'&month='+(shownDate.getMonth()+1)); req.send(null); } // } return cal; } function kcalendar_create_links(arr){ for(i=0;i