
//this function is called when date is selected in calendar
function onDateChange(sender, selectedDate) {
	var month = selectedDate.getMonth();
	var day = selectedDate.getDate() - 1;
	var year = selectedDate.getFullYear() - 1999;
	
	document.getElementById("selMonth").options[month].selected = true;
	document.getElementById("selDay").options[day].selected = true;
	document.getElementById("selYear").options[year].selected = true;
}

//called when one of the comboboxes is changed
function selectDate() {
	var month = document.getElementById("selMonth").selectedIndex;
	var day = document.getElementById("selDay").selectedIndex;
	var year = document.getElementById("selYear").selectedIndex;
	
	var selectedDate = new Date(year + 1999, month, day + 1);
	
	calDate.setDate(selectedDate, selectedDate);
}

function fctConfirmAction(strParam) {              
    var strConfirm
    
    switch (strParam) {
    case "DeleteEvent": 
    strConfirm = "This action will delete this event permanently. Are you sure you want to do this?";
    break;
    case "DeleteDocument": 
    strConfirm = "This action will delete this document permanently. Are you sure you want to do this?";
    break;
    case "DeleteSubCategory": 
    strConfirm = "This action will delete this sub-category permanently. No events will be lost. Are you sure you want to do this?";
    break;
    case "DeleteInvitation": 
    strConfirm = "This action will delete this invitation permanently. Are you sure you want to do this?";
    break;
    case "RejectInvitation": 
    strConfirm = "You are about to reject this invitation. Once rejected, this invitation will be deleted permanently. Are you sure you want to do this?";
    break;
    case "RemoveFriend": 
    strConfirm = "You are about to remove a friend from your friend list. Once removed, he or she won't be able to access your account and vice-versa. Are you sure you want to do this?";
    break;
    case "leave": 
    strConfirm = "You are about to leave this website. Are you sure you want to do this?";
    break;
    default: strConfirm = "Are you sure you want to do this?";
    }
    return confirm(strConfirm);
}

function clickSwitch(linker,switchbox)
{
    box = document.getElementById(switchbox);
    link = document.getElementById(linker);
    box.style.display=box.style.display=='none'?'':'none';
}