var actions;var Szene1MycalendarBehaviour={".mycalendar_jump_day":function(B){var A=false;B.onclick=function(C){Event.stop(C);identifier=B.id.split("_");referringUrl=identifier[3].replace(/\|/g,"_");document.location.href=referringUrl+"day/"+identifier[4]}},".mycalendar_jump_entry":function(B){var A=false;B.onclick=function(C){Event.stop(C);identifier=B.id.split("_");referringUrl=identifier[3].replace(/\|/g,"_");showElement(Szene1Translator.translate("calendarEntry"),referringUrl+"entry/"+identifier[4]);return false}},".calendarEntry":function(B){B.onmouseover=function(D){Event.stop(D);$(B).setStyle({cursor:"pointer"})};B.onclick=function(G){Event.stop(G);var F=B.readAttribute("action");var E="/ajax/calendar/entry";if(F=="delete"){if(confirm(Szene1Translator.translate("doYouReallyWantToDeleteThisEntry"))){var D="action=delete&userId="+B.readAttribute("userId")+"&userType="+B.readAttribute("userType")+"&calendarType="+B.readAttribute("calendarType")+"&calendarId="+B.readAttribute("calendarId")}}else{var D=$("calendarEntryPost").serialize()}new Ajax.Request(E,{method:"post",postBody:D,onSuccess:C,onFailure:A})};function C(D){if(D.responseText=="true"){notifyBox(Szene1Translator.translate("entrySaved"),"reload");return true}else{if(D.responseText=="trued"){notifyBox(Szene1Translator.translate("entrySuccessfullyDeleted"),"reload")}else{if(D.responseText=="falsed"){notifyBox(Szene1Translator.translate("errorSavingEntry"),"noreload")}else{notifyBox(D.responseText,"noreload");return false}}}}function A(D){alert("request failed"+D)}},".mycalendar_make_entry":function(B){B.onmouseover=function(D){Event.stop(D);$(B).setStyle({cursor:"pointer"})};B.onclick=function(G){Event.stop(G);actions=B.id.split("_");var F=B.readAttribute("action");var E="/ajax/calendar/entry";var D="userId="+actions[3]+"&userType="+actions[2]+"&calendar_type="+actions[4]+"&link_id="+actions[5];if(actions[1]=="delete"){if(confirm(Szene1Translator.translate("doYouReallyWantToDeleteThisEntry"))){D=D+"&action=delete"}}new Ajax.Request(E,{method:"post",postBody:D,onSuccess:C,onFailure:A})};function C(D){notifyBox(D.responseText,actions[6]);return ;if(D.responseText=="true"){notifyBox(Szene1Translator.translate("entrySaved"),actions[6]);if(actions[6]&&actions[6]=="reload"){}return true}else{if(D.responseText=="trued"){notifyBox(Szene1Translator.translate("entrySuccessfullyDeleted"),actions[6]);if(actions[6]&&actions[6]=="reload"){top.cleanUpCalendar()}}else{if(D.responseText=="falsed"){notifyBox(Szene1Translator.translate("errorDeletingEntry"),actions[6]);if(actions[6]&&actions[6]=="reload"){top.cleanUpCalendar()}}else{notifyBox(Szene1Translator.translate("errorSavingEntry"),actions[6]);return false}}}}function A(D){alert("request failed"+D)}}};Behaviour.register(Szene1MycalendarBehaviour);var calendarWin;function showElement(B,A){calendarWin=new Window({className:"alphacube",width:400,height:500,zIndex:100,resizable:true,title:B,showEffect:Effect.Appear,hideEffect:Effect.Fade,effectOptions:true,draggable:true,wiredDrag:true,showEffectOptions:{duration:1.5}});refresher={onDestroy:function(C,D){if(D==calendarWin){location.reload()}}};calendarWin.setURL(A);calendarWin.getURL();calendarWin.showCenter(0.7);calendarWin.setDestroyOnClose();Windows.addObserver(refresher)}function cleanUpCalendar(){if(calendarWin){calendarWin.close()}else{location.reload()}}function notifyBox(B,A){if($("notificationbox_container")){$("notificationbox_container").remove()}var C;C='<div class="szene1_quickinfo" id="notificationbox_container" ';C+='     style="position: absolute; width:250px;">';C+='  <div class="edge_top"><div><div>&nbsp;</div></div></div>';C+='  <div class="body" style="padding:8px; font-size: 11px; text-align: center;" ';C+='       id="userTaggingNotify">';C+=B+"\n";C+="  </div>";C+='  <div class="edge_bottom"><div><div>&nbsp;</div></div></div>';C+="</div>";new Insertion.Bottom("szene1AdditionalWindows",C);Position.center("notificationbox_container",{update:true});if(A!="reload"){window.setTimeout("new Effect.Fade($('notificationbox_container'));",2000)}else{window.setTimeout("new Effect.Fade($('notificationbox_container'),{ afterFinish : function() {top.cleanUpCalendar();}});",2000)}};