﻿var cwaFunctionUrl = "../cwa/cwaFunctions.aspx?cid=";
var maFunctionUrl = "../ma/maFunctions.aspx?mid=";
function deleteCWA(cid){
	var proceed = confirm('Are you sure you want to Delete the DRAFT Work Area?  Warning: This action cannot be undone.');
    if (proceed){

        window.location.href = cwaFunctionUrl + cid + "&TaskId=0"
    }
}
function publishCWA(cid){
    var proceed =confirm('Are you sure you want to Publish the DRAFT Work Area?  Warning: This action will make the work area open to all participants.');
    if (proceed){
        window.location.href = cwaFunctionUrl + cid + "&TaskId=1"
    }
}
function closeCWA(cid, requireMoreDocumentToClose){
    if (requireMoreDocumentToClose == "False" || requireMoreDocumentToClose == "false")
    {
        var proceed = confirm('Are you sure you want to Close the Work Area?  Warning: This action will close the work area to all participants and will only be available through the Archives section.');
         if (proceed)
         {
            window.location.href = cwaFunctionUrl + cid + "&TaskId=2"
         }   
    }
    else 
    {
        alert('This ANSI type work area is missing some required documents. Please use the Edit Setup wizard to add required documents.');
    }
}
function sendCommentReminder(cid){
        window.location.href = cwaFunctionUrl + cid + "&TaskId=3"
}

function sendVotingReminder(cid){
        window.location.href = cwaFunctionUrl + cid + "&TaskId=4"
}

function closeComment(cid){
	var proceed = confirm('Are you sure you want to Close the Comment Period?  Warning: This action cannot be undone.');
	if (proceed){
        window.location.href = cwaFunctionUrl + cid + "&TaskId=5"
	}
}
function closeVoting(cid){
	var proceed = confirm('Are you sure you want to Close the Voting Period?  Warning: This action cannot be undone.');
	
	if (proceed){
        window.location.href = cwaFunctionUrl + cid + "&TaskId=6"
	}
}

function sendResponsesComplete(cid){
        window.location.href = "../cwa/cwa.aspx?cid=" + cid + "&TaskId=7"
}

function sendResolutionNotification(cid){
        window.location.href = "../cwa/cwa.aspx?cid=" + cid + "&TaskId=8"
}

function deleteMA(mid){
	var proceed = confirm('Are you sure you want to Delete the DRAFT Meeting?  Warning: This action cannot be undone.');
	if (proceed){
        window.location.href = maFunctionUrl + mid + "&TaskId=0"
	}
}
function publishMA(mid){
	var proceed = confirm('Are you sure you want to Publish the DRAFT Meeting?  Warning: This action will make the meeting open to all invitees.');
	if (proceed){
        window.location.href = maFunctionUrl + mid + "&TaskId=1"
	}
}
function cancelMeeting(mid){
	var proceed = confirm('Are you sure you want to cancel the meeting?  Warning: This action cannot be undone.');
	if (proceed){
        window.location.href = maFunctionUrl + mid + "&TaskId=2"
	}
}

function showHelp(valPage){
     var name = "";
     name = window.open (valPage, "WebHelp", "height=500, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, width=700, top=5, left=5");
     name.focus();
}
     
function showSuggestion(valPage){
     var name = "";
    name = window.open (valPage, "Suggestions", "height=255, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, width=430, top=5, left=5");
    name.focus();
}

function showRecordings(valPage){
    var name = "";
    name = window.open (valPage, "Recordings", "height=500, location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, toolbar=no, width=700, top=5, left=5");
    name.focus();
}

function showContact(valPage){
    var name = "";
    name = window.open (valPage, "Contact", "height=375, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, width=550, top=5, left=5");
    name.focus();
}

function showFAQ(valPage){
    var name = "";
    name = window.open (valPage, "_blank");
    name.focus();
}
