
/**
 * Called from the list of tasks on the right hand side of the full calendar view.
 * @param myMonth
 * @param myDay
 * @param myYear
 * @param eventId
 * @return
 */
function editTask(myMonth, myDay, myYear,eventId){
	addCalendarEventPopup('day'+myDay,myMonth,myDay,myYear,eventId);
}

function addiconshow(onday, element){
	element.style.backgroundImage = "url(/img/add_event_on.png)";
}

function addiconhide(onday, element){
	element.style.backgroundImage = "url(/img/add_event_off.png)";
}

/**
 * On the large calendar screen, this is used when the user clicks on the delete icon from 
 * the task controls mouse over
 * 
 * @return
 */
function deleteTask(){
	
	//show animated gif while submitting
	var messageElement = YAHOO.util.Dom.get("addCalendarEventPanelMessageArea");
	messageElement.innerHTML = "<img src='/img/ajaxloadingsmall.gif'/> Deleting, please wait...";
	
	
	var fulltaskEl = YAHOO.util.Dom.get("fulltask"+currentlySelectedEventGk);
	var taskEl = YAHOO.util.Dom.get("task"+currentlySelectedEventGk);
	taskEl.parentNode.removeChild(taskEl);
	fulltaskEl.parentNode.removeChild(fulltaskEl);	
	var deleteTail = YAHOO.util.Dom.get("deletetail"); //need to hide this when done.
	
	// Delete the task using YUI AJAX
    var callback = { 
    	success : 
    		function(o) { 
    			if (isSessionValid(o.responseText)){
    				messageElement.innerHTML = "Delete Successful.";
    				alert('Deleted');
        			if (addCalendarEventPanel!=null)addCalendarEventPanel.hide();
        			deleteTail.style.visibility = "hidden";
        			
        			//WISE-489: reload the screen so the right rail can refresh (if no more tasks exist for date)
        			self.location.reload();
    			}else{
    				self.location.href="/wclogin";
    			}
    			
    		},
    	failure : 
    		function(o) { 
    			alert('Unable to Delete!');
    		} 
    	};
    var conn = YAHOO.util.Connect.asyncRequest("GET", "/tools/calendar/deleteEvent/" + currentlySelectedEventGk, callback);
}
