function ShowMsgList()
{
getResponseWithScript('myContent','','LoadingPanel','/msg/MessageList.aspx');
}
function AlertGot(uid,aeid)
{
	switch(aeid){
		case 7:
			var param="list=GIT|"+uid+"|";
			//alert(param);
			getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/Alert/BenefitStartingDay.aspx');
		break;	
	}
}


function ShowAlert(id)
{
	var param="list=SA|"+id;
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/Alert/ShowAlert.aspx');		
}	

function DoHighPriorityMsg(ids)
{
	var param="list=H|"+ids;
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');		
}	

function DoHighPriorityMsg1(ids)
{
	var param="list=H|"+ids+"|A";
	getResponseWithScript('msgDetails1',param,'LoadingPanel','/msg/new.aspx');		
}

function DoNextMsg(){
	var param="list=H|"+GetValue("NoticeIds");
	getResponseWithScript('HighPriorityMsg',param,'LoadingPanel','/msg/new.aspx');
}



function DoSaveMsg(){
	if(CheckInfo()){
		var param = "list=S|"+GetMsgInfo()
		//alert(param);
		getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');	
	}else{
		alert("Select Groups or People on the left, fulfill Subject Line and Body of the message!\n Remove HTML formating from the SUBJECT line! ")
	
	}
}

function CheckInfo(){
	if((GetValue("GroupIds")!="" ||GetValue("PeopleIds")!="")&& GetValue("Subject")!="" && GetInnerHTML("MsgBody")!="" && CheckHTML())
		return true;
	else
		return false;
}
function CheckHTML(){
	if(GetValue("Subject").indexOf(">")>=0 && GetValue("Subject").indexOf("<")>=0)
		return false;
	else
		return true;
}
function GetMsgInfo(){
	var s=GetValue("GroupIds")+"|";
	s+=GetValue("PeopleIds")+"|";
	s+=GetValue("Subject")+"|";
	
	s+=GetInnerHTML("MsgBody")+"|";
	s+=GetValue("NoticeId")+"|";
	s+=GetValue("Priority_value")+"|";
	s+=GetChecked("cbxMailRecipients")+"|";
	return escape(s);//s
}

function DoFillTo(id){
	var param = "list=T|"+id
	//alert(param)
	window.setTimeout("getResponseWithScript('MsgGroups','"+param+"','LoadingPanel','/msg/SelectGroup.aspx')",100);
	window.setTimeout("getResponseWithScript('MsgPeople','"+param+"','LoadingPanel','/msg/SelectPeople.aspx')",200);
}


function DoNew(){
	var param = "list=N|"
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');
	window.setTimeout("getResponseWithScript('MsgGroups','list=N|','LoadingPanel','/msg/SelectGroup.aspx')",500);
	window.setTimeout("getResponseWithScript('MsgPeople','list=N|','LoadingPanel','/msg/SelectPeople.aspx')",1000);
}
function DoDelete(id){
	var param = "list=D|"+id
	//alert(param);
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');	
}
function DoReceived(id){
	var param = "list=R|"+id
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');	
}
function DoReceived2(id){
	var param = "list=R2|"+id
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');	
}
function DoReceived3(id){
	var param = "list=R2|"+id
	getResponseWithScript('msgDetails1',param,'LoadingPanel','/msg/new.aspx');	
}
function DoSelectGroup(lid){
	var param = "list=N|"+GetGroupIds(lid);
	getResponseWithScript('MsgGroups',param,'LoadingPanel','/msg/SelectGroup.aspx')
}
function DoRemoveGroup(lid){
	var param = "list=U|"+GetGroupIds(lid);
	getResponseWithScript('MsgGroups',param,'LoadingPanel','/msg/SelectGroup.aspx')
}

function GetGroupIds(id){
	var s=GetValue("GroupIds")+","+id+",";
	return s;
}

function DoSelectPeople(id){
	var param = "list=N|"+GetPeopleIds(id)
	getResponseWithScript('MsgPeople',param,'LoadingPanel','/msg/SelectPeople.aspx');
}
function DoRemovePeople(lid){
	var param = "list=U|"+GetPeopleIds(lid);
	getResponseWithScript('MsgPeople',param,'LoadingPanel','/msg/SelectPeople.aspx')
}
function GetPeopleIds(id){
	var s=GetValue("PeopleIds")+","+id+",";
	return s;
}







function DoEdit(id)
{
	if(id!=""){
		var param = "list=E|"+id
		getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');
	}
}


function DoMessage2(id)
{
	var param = "list=M|"+id
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');
}
function DoMyMessage(id)
{
	var param = "list=MM|"+id
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');
}
function DoMyArchive(id)
{
	var param = "list=MA|"+id
	getResponseWithScript('msgDetails',param,'LoadingPanel','/msg/new.aspx');
}



function MyDoAlerts()
{
	getResponseWithScript('Alerts','list=L|0','LoadingPanel','/msg/Alert/alerts.aspx');
}

function MyDoOutbox()
{
	getResponseWithScript('OutBox','list=L|0','LoadingPanel','/msg/outbox.aspx');
}
function MyDoInbox()
{
	getResponseWithScript('Inbox','list=L|0','LoadingPanel','/msg/inbox.aspx');
}
function MyDoArchive()
{
	getResponseWithScript('MsgArchive','list=L|0','LoadingPanel','/msg/archive.aspx');
}
function MyDoGroups()
{
	getResponseWithScript('GroupList','list=L|0','LoadingPanel','/AdminModulesCompany/group/GroupList.aspx');
}
function MyDoPeople()
{
	getResponseWithScript('SearchPeople','list=L|0','LoadingPanel','/AdminModulesCompany/user/PeopleList.aspx');
}
function DoMsgPeopleReverse(SortBy){
	getResponseWithScript('SearchPeople','list=L|'+SortBy,'LoadingPanel','/AdminModulesCompany/user/PeopleList.aspx');
}
		
		
		
