Tip: Click lines to highlight, hold ctrl/cmd to multi-select

http://codedumper.com/umoqi (6-Aug @ 14:33)

Syntax Highlighted Code

  1. /*
  2. Author : Vipul Limbachiya
  3. FileName : jQuery.presentation
  4. Reqires : jQuery.js,jQuery.init.js,jQuery-ui-personalized-1.5.2.js
  5. */
  6.  
  7.  
  8. function Elem(elemId){return document.getElementById(elemId);}
  9.  
  10. jQuery.preloadImages = function()
  11. {  
  12.   for(var i = 0; i<arguments.length; i++)
  13.   {
  14.     jQuery("<img>").attr("src", arguments[i]);
  15.   }
  16. }
  17.  
  18. // Properties for handler classes and ID so later on we can change if required
  19. var Properties = {
  20.     currentDayBoxClass: ".calDayCur",
  21.     calendarBoxId: "#clndrEvent",    
  22.     eventContainerBoxId: "#events",
  23.     eventBoxClass: ".calEvent",
  24.     eventBoxClassOnDrag: ".calEventDrag"    
  25. };
  26.  
  27.  
  28. // This class manages all AJAX requests and response, its integrated with Presentation class
  29. var EventCallBack=
  30. {    
  31.     // This method is being called on drop of event box on day,
  32.     // Calls async page and retrives details of selected template and date.
  33.     // And generates form of event using presentation class
  34.     retriveEventTemplateDetais : function(eventBoxId,templateId,selDate)
  35.     {  
  36.         Presentation.appendMessage(eventBoxId,
  37.                                    "Wait...");
  38.        
  39.         $.ajax({type:"POST",
  40.                 url: "asyncHandler/handlerEvents.ashx",
  41.                 data: "act=getEventTemplateDetails&tempId=" + templateId + "&selDate=" + selDate,
  42.                 success:function(serverResponseData)
  43.                             {
  44.                                 EventCallBack.retriveEventTemplateDetaisSuccess(serverResponseData,selDate,eventBoxId);
  45.                             },
  46.                 error: function(reqObject,typeofError,exceptionObj)
  47.                             {
  48.                                 EventCallBack.retriveEventTemplateDetaisFailure(eventBoxId);
  49.                             },
  50.                 complete: function()
  51.                             {
  52.                                 Presentation.removeMessage(eventBoxId);
  53.                             }
  54.                 });
  55.     },    
  56.     // Being called on success of method : retriveEventTemplateDetais
  57.     retriveEventTemplateDetaisSuccess:function(responseText,selDate,eventBoxId)
  58.     {  
  59.        Presentation.refreshEventPanel();
  60.        
  61.        data = eval("(" + responseText + ")");
  62.                      
  63.        if(parseInt(data.response.error)===0)
  64.        {          
  65.           Presentation.generateMyReminderPanel(data.response.table,
  66.                                                 selDate,
  67.                                                 eventBoxId);
  68.        }
  69.        else
  70.        {
  71.           Presentation.alertMessage(data.response.message);          
  72.           Presentation.resetEventBoxIdPosition(eventBoxId,"");
  73.        }
  74.     },
  75.    
  76.     // Being called on failure of method : retriveEventTemplateDetais
  77.     retriveEventTemplateDetaisFailure:function(eventBoxId)
  78.     {
  79.         Presentation.alertMessage("Error occored while processing request on server!");
  80.         Presentation.resetEventBoxIdPosition(eventBoxId,"");
  81.     },
  82.    
  83.     // Submits selected option and data of event form
  84.     submitEventData : function(eventBoxId)
  85.     {        
  86.         if($("#myReminderPanel_isActive").val()=="yes")
  87.         {
  88.             Presentation.appendMessage("myReminderFormPanel",
  89.                                     "Please Wait...");
  90.                                    
  91.             var frequencyOption = "";            
  92.             $("#myReminderPanel_EventFreq_Panel > select option:selected").each(function () {
  93.                 if(frequencyOption.length>0)
  94.                 {
  95.                     frequencyOption += $(this).text() + ",";
  96.                 }
  97.                 else
  98.                 {
  99.                     frequencyOption = $(this).text();
  100.                 }
  101.               });
  102.              
  103.             var reminderOption = "";            
  104.             $("#myReminderPanel_EventReminder_Panel > select option:selected").each(function () {
  105.                 if(reminderOption.length>0)
  106.                 {
  107.                     reminderOption += $(this).text() + ",";
  108.                 }
  109.                 else
  110.                 {
  111.                     reminderOption = $(this).text();
  112.                 }
  113.               });
  114.              
  115.             var SelectedDate = $("#myReminderPanel_EventDate").val();
  116.            
  117.             var disableEmailReminder = false;
  118.            
  119.             if(Elem("myReminderPanel_EventDisableEmailReminder"))
  120.             {
  121.                 disableEmailReminder = Elem("myReminderPanel_EventDisableEmailReminder").checked;
  122.             }
  123.            
  124.             var disableSMSReminder = false;
  125.            
  126.             if(Elem("myReminderPanel_EventDisableSMSReminder"))
  127.             {
  128.                 disableSMSReminder = Elem("myReminderPanel_EventDisableSMSReminder").checked;
  129.             }
  130.                                    
  131.             $.ajax({type:"POST",
  132.                 url: "asyncHandler/handlerEvents.ashx",
  133.                 data: "act=add"
  134.                          + "&tempId=" + $("#myReminderPanel_EventTemplateId").val()
  135.                          + "&eventTitle=" + $("#myReminderPanel_EventTitle").val()
  136.                          + "&eventDate=" + SelectedDate
  137.                          + "&eventFreq=" + frequencyOption
  138.                          + "&eventReminder=" + reminderOption
  139.                          + "&disableEmailReminder=" + disableEmailReminder
  140.                          + "&disableSMSReminder=" + disableSMSReminder
  141.                          + "&eventAltEmail=" + $("#myReminderPanel_EventAltEmail").val()
  142.                          + "&eventAltMobile=" + $("#myReminderPanel_EventAltMobile").val(),
  143.                 success:function(serverResponseData)
  144.                             {
  145.                                 EventCallBack.submitEventDataSuccess(serverResponseData,SelectedDate);
  146.                             },
  147.                 error: function(reqObject,typeofError,exceptionObj)
  148.                             {
  149.                                 EventCallBack.submitEventDataFailure(SelectedDate);
  150.                             },
  151.                 complete: function()
  152.                             {
  153.                                 Presentation.removeMessage("myReminderFormPanel");
  154.                             }
  155.                 });
  156.         }  
  157.     },
  158.    
  159.     // Being called on success of method : submitEventData
  160.     submitEventDataSuccess:function(responseText,selDate)
  161.     {
  162.         data = eval("(" + responseText + ")");
  163.        
  164.         if(data.response.error==0)
  165.         {
  166.             var newEventId = data.response.newEvent[0].event_id;
  167.              
  168.             var strEventBoxId = Presentation.currentEventBoxId();  
  169.                              
  170.             Presentation.resetEventBoxIdPosition(strEventBoxId,selDate);
  171.            
  172.             var eventElem = $("#"+strEventBoxId);
  173.            
  174.             eventElem.effect("highlight", {}, 2000);            
  175.            
  176.             eventElem.removeAttr("id");
  177.            
  178.             eventElem.attr("id","UserEvent_"+newEventId);                        
  179.            
  180.             Presentation.alertMessage(data.response.message);
  181.         }
  182.         else
  183.         {
  184.             Presentation.alertMessage(data.response.message);
  185.             Presentation.resetEventBoxIdPosition(Presentation.currentEventBoxId(),"");      
  186.         }        
  187.         Presentation.showHideMyReminderPanel(false);
  188.     },
  189.    
  190.     // Being called on failure of method : submitEventData
  191.     submitEventDataFailure:function()
  192.     {
  193.         Presentation.alertMessage("Error Occured!");
  194.         Presentation.resetEventBoxIdPosition(Presentation.currentEventBoxId(),"");
  195.     },
  196.    
  197.    
  198.     // Retrive event data async call
  199.     retriveEventDetails: function(eventBoxId,eventId,selDate)
  200.     {
  201.         Presentation.appendMessage(eventBoxId,
  202.                                    "Wait...");
  203.        
  204.         $.ajax({type:"POST",
  205.                 url: "asyncHandler/handlerEvents.ashx",
  206.                 data: "act=getEventDetails&eventId=" + eventId,
  207.                 success:function(serverResponseData)
  208.                             {
  209.                                 EventCallBack.retriveEventDetailsSuccess(serverResponseData,selDate,eventBoxId);
  210.                             },
  211.                 error: function(reqObject,typeofError,exceptionObj)
  212.                             {
  213.                                 EventCallBack.retriveEventDetailsFailure(eventBoxId);
  214.                             },
  215.                 complete: function()
  216.                             {
  217.                                 Presentation.removeMessage(eventBoxId);
  218.                             }
  219.                 });
  220.     },
  221.    
  222.     // Being called on success of method : retriveEventDetails
  223.     retriveEventDetailsSuccess:function(responseText,selDate,eventBoxId)
  224.     {
  225.         data = eval("(" + responseText + ")");
  226.        
  227.         if(data.response.error==0)
  228.         {  
  229.             Presentation.generateMyReminderPanelForEdit(data.response.table,
  230.                                                 selDate,
  231.                                                 eventBoxId);
  232.         }
  233.         else
  234.         {
  235.             Presentation.showHideMyReminderPanel(false);
  236.             Presentation.alertMessage(data.response.message);
  237.             var selDate = $("#"+eventBoxId).attr("currentdate") || "";
  238.             Presentation.resetEventBoxIdPosition(eventBoxId,selDate);
  239.         }
  240.     },
  241.    
  242.     // Being called on failure of method : retriveEventDetails
  243.     retriveEventDetailsFailure:function(eventBoxId)
  244.     {
  245.         Presentation.alertMessage("Error occored while processing request on server!");
  246.     },
  247.    
  248.     // Update event async call
  249.     updateEvent: function(eventBoxId,templateId,selDate)
  250.     {
  251.         if($("#myReminderPanel_isActive").val()=="yes")
  252.         {
  253.             Presentation.appendMessage("myReminderFormPanel",
  254.                                        "Please Wait...");            
  255.                                    
  256.             var frequencyOption = "";            
  257.             $("#myReminderPanel_EventFreq_Panel > select option:selected").each(function () {
  258.                 if(frequencyOption.length>0)
  259.                 {
  260.                     frequencyOption += $(this).text() + ",";
  261.                 }
  262.                 else
  263.                 {
  264.                     frequencyOption = $(this).text();
  265.                 }  
  266.               });
  267.              
  268.             var reminderOption = "";            
  269.             $("#myReminderPanel_EventReminder_Panel > select option:selected").each(function () {                
  270.                 if(reminderOption.length>0)
  271.                 {
  272.                     reminderOption += $(this).text() + ",";
  273.                 }
  274.                 else
  275.                 {
  276.                     reminderOption = $(this).text();
  277.                 }
  278.               });
  279.              
  280.             var SelectedDate = $("#myReminderPanel_EventDate").val();
  281.            
  282.             var disableEmailReminder = false;
  283.            
  284.             if(Elem("myReminderPanel_EventDisableEmailReminder"))
  285.             {
  286.                 disableEmailReminder = Elem("myReminderPanel_EventDisableEmailReminder").checked;
  287.             }
  288.            
  289.             var disableSMSReminder = false;
  290.            
  291.             if(Elem("myReminderPanel_EventDisableSMSReminder"))
  292.             {
  293.                 disableSMSReminder = Elem("myReminderPanel_EventDisableSMSReminder").checked;
  294.             }
  295.                                    
  296.             $.ajax({type:"POST",
  297.                 url: "asyncHandler/handlerEvents.ashx",
  298.                 data: "act=updateEvent"
  299.                          + "&eventId=" + $("#myReminderPanel_EditEventId").val()
  300.                          + "&tempId=" + $("#myReminderPanel_EventTemplateId").val()
  301.                          + "&eventTitle=" + $("#myReminderPanel_EventTitle").val()
  302.                          + "&eventDate=" + SelectedDate
  303.                          + "&eventFreq=" + frequencyOption
  304.                          + "&eventReminder=" + reminderOption
  305.                          + "&disableEmailReminder=" + disableEmailReminder
  306.                          + "&disableSMSReminder=" + disableSMSReminder
  307.                          + "&eventAltEmail=" + $("#myReminderPanel_EventAltEmail").val()
  308.                          + "&eventAltMobile=" + $("#myReminderPanel_EventAltMobile").val(),
  309.                 success:function(serverResponseData)
  310.                             {
  311.                                 EventCallBack.updateEventSuccess(serverResponseData,SelectedDate,eventBoxId);
  312.                             },
  313.                 error: function(reqObject,typeofError,exceptionObj)
  314.                             {
  315.                                 EventCallBack.updateEventFailure(eventBoxId);
  316.                             },
  317.                 complete: function()
  318.                             {
  319.                                 Presentation.removeMessage("myReminderFormPanel");
  320.                             }
  321.                 });
  322.         }  
  323.     },
  324.    
  325.     // Being called on success of method : updateEvent
  326.     updateEventSuccess:function(responseText,selDate,eventBoxId)
  327.     {
  328.         data = eval("(" + responseText + ")");
  329.        
  330.         var strEventBoxId = Presentation.currentEventBoxId();
  331.        
  332.         if(data.response.error==0)
  333.         {  
  334.             $("#"+strEventBoxId).attr("currentdate",selDate);
  335.            
  336.             Presentation.resetEventBoxIdPosition(strEventBoxId,selDate);
  337.                        
  338.             $("#"+strEventBoxId).effect("highlight", {}, 2000);
  339.            
  340.             Presentation.alertMessage(data.response.message);
  341.         }
  342.         else
  343.         {
  344.             Presentation.alertMessage(data.response.message);
  345.             var boxselDate = $("#"+strEventBoxId).attr("currentdate") || "";            
  346.             Presentation.resetEventBoxIdPosition(strEventBoxId,boxselDate);
  347.         }  
  348.         Presentation.showHideMyReminderPanel(false);    
  349.     },
  350.    
  351.     // Being called on failure of method : updateEvent
  352.     updateEventFailure:function(eventBoxId)
  353.     {
  354.         Presentation.alertMessage("Error Occured!");
  355.         var selDate = $("#"+eventBoxId).attr("currentdate") || "";
  356.         Presentation.resetEventBoxIdPosition(eventBoxId,selDate);
  357.     }  
  358. }
  359.  
  360.  
  361. // This class manages presentation of calendar.
  362. // Drag drop and initilization of dragdrop is handled by init function
  363. var Presentation = {
  364.  
  365.     // Initializes events and drag drop
  366.     init:function()
  367.     {
  368.    
  369.         $.preloadImages("Images/throbber.gif");
  370.        
  371.         Presentation.initDragDrop();  
  372.        
  373.         $("#myReminderPanel_Close").bind("click",
  374.                                             Presentation.cancleAction);    
  375.                                        
  376.         $("#eventCalendar").after("<div id=\"alertMessage\" class=\"alertMessage\" style=\"width:350px;display:none;\"></div>");
  377.        
  378.         $(".calEvent").bind("click",
  379.                             function(){
  380.                             if($(this).attr("currentdate"))
  381.                             {
  382.                                 if($("#myReminderPanel_isActive").val()!="yes")
  383.                                 {
  384.                                     Presentation.onDropFunction(this.id,
  385.                                                             "dv"+$(this).attr("currentdate"),
  386.                                                             true);
  387.                                 }
  388.                             }
  389.                             });
  390.                      
  391.     },    
  392.     alertMessage:function(msg)
  393.     {
  394.         var alertMessageDiv=$("#alertMessage");
  395.         if(alertMessageDiv)
  396.         {
  397.             alertMessageDiv.text(msg);
  398.         }        
  399.         alertMessageDiv.fadeIn(1000).fadeOut(3000)
  400.     },
  401.     refreshEventBox:function(idOfDroppedElement)
  402.     {
  403.         var eventBoxId = Presentation.currentEventBoxId();
  404.        
  405.         if(eventBoxId!="" && eventBoxId!=idOfDroppedElement)
  406.         {
  407.             if(Presentation.isEditEvent())
  408.             {                
  409.                 var selDate = $("#"+eventBoxId).attr("currentdate");    
  410.                                            
  411.                 Presentation.resetEventBoxIdPosition(eventBoxId,
  412.                                                     selDate);                                                
  413.              
  414.             }
  415.             else
  416.             {
  417.                 Presentation.resetEventBoxIdPosition(eventBoxId,
  418.                                                     "");
  419.             }
  420.         }
  421.     },    
  422.     cancleAction: function()
  423.     {        
  424.         Presentation.refreshEventBox();
  425.         Presentation.refreshEventPanel();
  426.         Presentation.showHideMyReminderPanel(false);
  427.     },
  428.    
  429.     // Fuction being called on drop of event box
  430.     onDropFunction:function(droppedElement,idOfDateElement,flag)
  431.     {  
  432.        var idOfDroppedElement = "";
  433.        
  434.        if(flag)
  435.        {
  436.             idOfDroppedElement = droppedElement;
  437.        }
  438.        else
  439.        {
  440.             idOfDroppedElement = droppedElement[0].id;  
  441.        }
  442.        
  443.        //Not required, because drag is disabled when add/edit form is open
  444.        //Presentation.refreshEventBox(idOfDroppedElement);      
  445.        
  446.        if ("#"+idOfDateElement != Properties.eventContainerBoxId)
  447.         {
  448.             if(idOfDroppedElement.indexOf('EventTemplateId_')>=0) // Add event
  449.             {                
  450.                 EventCallBack.retriveEventTemplateDetais(idOfDroppedElement,
  451.                                   idOfDroppedElement.replace('EventTemplateId_',''),
  452.                                   idOfDateElement.replace('dv',''));
  453.                                  
  454.                 Presentation.refreshEventPanel();
  455.             }
  456.             else // Edit Event
  457.             {
  458.                 EventCallBack.retriveEventDetails(idOfDroppedElement,
  459.                                   idOfDroppedElement.replace('UserEvent_',''),
  460.                                   idOfDateElement.replace('dv',''));
  461.             }
  462.         }
  463.         else
  464.         {            
  465.             Presentation.showHideMyReminderPanel(false);
  466.         }
  467.     },
  468.    
  469.     // Init funciton for dragdrop
  470.     initDragDrop: function() {
  471.    
  472.          $(Properties.currentDayBoxClass).droppable({
  473.                     accept: Properties.eventBoxClass,
  474.                     drop: function(ev, ui) {                        
  475.                         $(this).append($(ui.draggable));
  476.                         Presentation.onDropFunction($(ui.draggable),this.id);                        
  477.                     }
  478.                 });
  479.                
  480.         $(Properties.eventContainerBoxId).droppable({
  481.                     accept: Properties.eventBoxClass,
  482.                     drop: function(ev, ui) {            
  483.                         $(this).append($(ui.draggable));
  484.                         Presentation.onDropFunction($(ui.draggable),this.id);
  485.                     }
  486.                 });
  487.        
  488.         $(Properties.eventBoxClass).draggable({
  489.                                     helper:'clone',
  490.                                     opacity:0.5
  491.                                     });                                    
  492.        
  493.     },
  494.      
  495.     // Removes previously created message box
  496.     removeMessage: function(targetElementId,postfix)
  497.     {
  498.            postfix = postfix || "msg";          
  499.            $("#"+targetElementId+"_" + postfix).remove();
  500.     },
  501.    
  502.     // Appends message box to given element by id and with options
  503.     appendMessage: function(targetElementId,text,msgDivPostfix,containerClass,messageElementClass)
  504.     {        
  505.         msgDivPostfix = msgDivPostfix || "msg";
  506.         containerClass = containerClass || "loaderContainer";
  507.         messageElementClass = messageElementClass || "waitMessage";
  508.        
  509.         if($("#"+targetElementId+"_"+msgDivPostfix).length>0)
  510.         {
  511.             Presentation.removeMessage(targetElementId,
  512.                                         msgDivPostfix);
  513.         }        
  514.         $("#"+targetElementId).prepend("<div title=\""+text+"\" class=\""+containerClass+"\" id=\""+ targetElementId + "_" + msgDivPostfix +"\"><span class=\""+messageElementClass+"\">"+text+"</span></div>");        
  515.     },
  516.    
  517.     // Refreshes event panle, to check whether more events available or not
  518.     refreshEventPanel:function()
  519.     {        
  520.         if($("#events div").length==0)
  521.         {
  522.             if($("#dvNoEventAvailableMessage").length==0)
  523.             {
  524.                 $("#events").append("<div id=\"dvNoEventAvailableMessage\" class=\"alertMessage\" title=\"No more events..!\">No more events available</div>")
  525.             }
  526.         }
  527.         else
  528.         {
  529.             $("#dvNoEventAvailableMessage").remove();
  530.         }
  531.     },
  532.    
  533.     // Sets visibility of event form
  534.     showHideMyReminderPanel :function(show)
  535.     {  
  536.         if(show)
  537.         {
  538.             $("#myReminderPanel").show();
  539.             $("#myReminderPanel_isActive").val("yes");
  540.             $(Properties.eventBoxClass).draggable("disable");
  541.             $(Properties.eventBoxClass).css({cursor:"text"});
  542.         }
  543.         else
  544.         {
  545.             $("#myReminderPanel").hide();
  546.             $("#myReminderPanel_isActive").val("no");
  547.             $(Properties.eventBoxClass).draggable("enable");
  548.             $(Properties.eventBoxClass).css({cursor:"move"});
  549.         }
  550.     },
  551.    
  552.     // Generates Event's form using json data retrived from server
  553.     generateMyReminderPanel :function(templateData,dateOfEvent,eventBoxId)
  554.     {  
  555.         if(templateData)
  556.         {        
  557.             if(templateData.length>0)
  558.             {  
  559.                 var currentTemplate = templateData[0];
  560.                
  561.                 Presentation.showHideMyReminderPanel(true);
  562.                
  563.                 Presentation.switchSubmitButtonActionForEdit(false);
  564.                
  565.                 $("#myReminderPanel_Header").html("Event details");
  566.                 $("#myReminderPanel_Submit").val("Save");
  567.                
  568.                 Presentation.currentEventBoxId(eventBoxId);
  569.                
  570.                 $("#myReminderPanel_EventDate").val(dateOfEvent);
  571.                
  572.                 $("#myReminderPanel_EventFreq").val(currentTemplate.event_template_frequency);
  573.                 $("#myReminderPanel_EventReminder").val(currentTemplate.event_template_reminder);
  574.                
  575.                 $("#myReminderPanel_EventFreq_Panel > select option:first-child").attr("selected","true");
  576.                 $("#myReminderPanel_EventReminder_Panel > select option:first-child").attr("selected","true");
  577.                
  578.                 if(Elem("myReminderPanel_EventDisableEmailReminder"))
  579.                 {
  580.                     Elem("myReminderPanel_EventDisableEmailReminder").checked=(currentTemplate.event_template_email=="y");
  581.                 }                
  582.                
  583.                 if(Elem("myReminderPanel_EventDisableSMSReminder"))
  584.                 {
  585.                     Elem("myReminderPanel_EventDisableSMSReminder").checked=(currentTemplate.event_template_sms=="y");
  586.                 }
  587.                
  588.                 $("#myReminderPanel_EventTitle").val(currentTemplate.event_template_name);
  589.                
  590.                 $("#myReminderPanel_EventTemplateId").val(currentTemplate.event_template_id);                
  591.                
  592.                
  593.                 if(currentTemplate.event_template_account_def_time!="y")
  594.                 {
  595.                     $("#myReminderPanel_EventReminder_Panel").hide();
  596.                 }
  597.                 else
  598.                 {
  599.                     $("#myReminderPanel_EventReminder_Panel").show();
  600.                 }
  601.                                                
  602.                 if(currentTemplate.event_template_email!="y")
  603.                 {
  604.                    $("#myReminderPanel_EventDisableEmailReminder_Panel").hide();
  605.                 }
  606.                 else
  607.                 {
  608.                     $("#myReminderPanel_EventDisableEmailReminder_Panel").show();
  609.                 }
  610.                
  611.                 if(currentTemplate.event_template_sms!="y")
  612.                 {
  613.                     $("#myReminderPanel_EventDisableSMSReminder_Panel").hide();
  614.                 }
  615.                 else
  616.                 {
  617.                     $("#myReminderPanel_EventDisableSMSReminder_Panel").show();
  618.                 }
  619.                
  620.                 if(currentTemplate.event_template_alt_email!="y")
  621.                 {
  622.                     $("#myReminderPanel_EventAltEmail_Panel").hide();
  623.                 }
  624.                 else
  625.                 {
  626.                     $("myReminderPanel_EventAltEmail_Panel").show();
  627.                 }
  628.                
  629.                 if(currentTemplate.event_template_alt_mobile!="y")
  630.                 {
  631.                     $("#myReminderPanel_EventAltMobile_Panel").hide();
  632.                 }
  633.                 else
  634.                 {
  635.                     $("#myReminderPanel_EventAltMobile_Panel").show();
  636.                 }        
  637.                
  638.                 $("#myReminderPanel_EventTitle").focus();      
  639.                
  640.             }
  641.         }
  642.     },
  643.    
  644.     isEditEvent:function()
  645.     {
  646.         return  $("#myReminderPanel_EditEventId").val()!="";
  647.     },
  648.      
  649.     currentEventBoxId:function(value)
  650.     {
  651.         if(value)
  652.         {
  653.             $("#myReminderPanel_currentEventBoxId").val(value);
  654.         }      
  655.        
  656.         return $("#myReminderPanel_currentEventBoxId").val();
  657.     },
  658.      
  659.     switchSubmitButtonActionForEdit:function(flag,eventId)
  660.     {
  661.         eventId = eventId || "";
  662.        
  663.         $("#myReminderPanel_Submit").unbind("click",
  664.                                             EventCallBack.updateEvent);
  665.                                            
  666.         $("#myReminderPanel_Submit").unbind("click",
  667.                                             EventCallBack.submitEventData);
  668.        
  669.         $("#myReminderPanel_EditEventId").val(eventId);
  670.                
  671.         if(flag)
  672.         {
  673.             $("#myReminderPanel_EventDate_Panel_Edit").show();
  674.            
  675.             $("#myReminderPanel_Submit").bind("click",
  676.   &nbs