var maxCalendar=parseInt(12);var randomCalendars=new Array();var currentRandomCalendar=0;function nextCalendar(){if((document.getElementById("previouscalendar").style.display=="none")&&(currentRandomCalendar==1)){document.getElementById("previouscalendar").style.display="block"}var d;if(currentRandomCalendar<randomCalendars.length){d=randomCalendars[currentRandomCalendar]}else{var c="";if(randomCalendars.length>0){c="?calids="+randomCalendars.join(",")}d=getUrlContent("./embeddedcalendar/randomcalendarid/"+c);randomCalendars.push(d)}if(currentRandomCalendar<9){currentRandomCalendar++}else{document.getElementById("nextcalendar").style.display="none"}var b=document.getElementById("maincalendar");while(b.hasChildNodes()){b.removeChild(b.firstChild)}b.innerHTML='<span id="'+d+'_calendar" style="display:inline-block;margin-right:auto;margin-left:auto;position:relative;height:505px;width=650px;margin-top:5px;"></span>';var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("src","./embed/?calid="+d+"&langid=eng&firstday=sun");b.appendChild(a)}function previousCalendar(){if(currentRandomCalendar>0){currentRandomCalendar--;randomGUID=randomCalendars[currentRandomCalendar-1];var b=document.getElementById("maincalendar");while(b.hasChildNodes()){b.removeChild(b.firstChild)}b.innerHTML='<span id="'+randomGUID+'_calendar" style="display:inline-block;margin-right:auto;margin-left:auto;position:relative;height:505px;width=650px;margin-top:5px;"></span>';var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("src","./embed/?calid="+randomGUID+"&langid=eng&firstday=sun");b.appendChild(a)}if(currentRandomCalendar<2){document.getElementById("previouscalendar").style.display="none"}}function previousListItem(e,c){var d=parseInt(c)-1;var b=null;var a=document.getElementById(d+"_"+e);while(a){if(!b){if(a.style.display!="none"){b=a;document.getElementById(e+"_down").style.visibility="visible"}}d--;a=document.getElementById(d+"_"+e);if(a&&b){if(a.style.display=="none"){a.style.display="block";b.style.display="none";if(!(document.getElementById((d-1)+"_"+e))){document.getElementById(e+"_up").style.visibility="hidden"}break}}}}function nextListItem(d){var c=0;var b=null;var a=document.getElementById(c+"_"+d);while(a){if(!b){if(a.style.display!="none"){b=a;document.getElementById(d+"_up").style.visibility="visible"}}c++;a=document.getElementById(c+"_"+d);if(a&&b){if(a.style.display=="none"){a.style.display="block";b.style.display="none";if(!(document.getElementById((c+1)+"_"+d))){document.getElementById(d+"_down").style.visibility="hidden"}break}}}}function goToCalendar(c,d){var e=parseInt(d);var a=".";for(var b=0;b<e;b++){a=a+"."}window.location=a+"/calendar/?calid="+c}function goToCurrentRandomCalendar(){var a=randomCalendars[currentRandomCalendar-1];window.location="./calendar/?calid="+a}function goToMainPage(c){var d=parseInt(c);var a=".";for(var b=0;b<d;b++){a=a+"."}window.location=a}function overCalendar(a){var b=document.getElementById(a);b.style.background="#D0D0D0"}function notOverCalendar(a){var b=document.getElementById(a);b.style.background="#FFFFFF"}function getUrlContent(a){var b;if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{b=new ActiveXObject("Microsoft.XMLHTTP")}if(b){b.open("GET",a,false);b.send(null);return b.responseText}else{return""}}function updateLanguageSelection(e){var d=e.value;var a=document.getElementById("embedtag").innerHTML;a=decodeURI(a);if(a){var c=a.indexOf("langid=");if(c!=-1){var b=document.getElementById("languagespan").innerHTML;document.getElementById("languagespan").innerHTML=d;var b="langid="+b;d="langid="+d;a=a.replace(b,d);document.getElementById("embedtag").innerHTML=a}}}function updateFirstDaySelection(c){var e=c.value;var a=document.getElementById("embedtag").innerHTML;a=decodeURI(a);if(a){var b=a.indexOf("firstday=");if(b!=-1){var d=document.getElementById("firstdayspan").innerHTML;document.getElementById("firstdayspan").innerHTML=e;var d="firstday="+d;e="firstday="+e;a=a.replace(d,e);document.getElementById("embedtag").innerHTML=a}}};
