function display(blockid)
{
	if (document.getElementById(blockid).style.display=='')
	{
		document.getElementById(blockid).style.display='none';
	}
	else
	{
		document.getElementById(blockid).style.display='';
	}
}
function checkAll(blockid,a)
{
	for(i=0;i<blockid.length;i++)
	{
		if(blockid[i].type=="checkbox")
		{
			blockid[i].checked = a.checked?true:false
		}
	}
}
function selectParentRecipients(select)
{
    var option = select.options[select.selectedIndex];
    var ul = document.getElementById("parentUl");
    var choices = ul.getElementsByTagName('input');
    if (option.value == "#")
        return;
    for (var i = 0; i < choices.length; i++)
        if (choices[i].value == option.value)
            return;
    var li = document.createElement('li');
    var input = document.createElement('input');
    var text = document.createTextNode(option.firstChild.data);
    input.name = 'parentIds[]';
    input.type = 'hidden';
    input.value = option.value;
    li.appendChild(input);
    li.appendChild(text);
    li.setAttribute('onclick', 'this.parentNode.removeChild(this);decreaseTotalRecipients(1);');
    ul.appendChild(li);
    increaseTotalRecipients(1);
}
function increaseTotalRecipients(iInt)
{
    var total = document.getElementById("totalRecipients");
    total.value = eval(total.value)+eval(iInt);
}
function decreaseTotalRecipients(iInt)
{
    var total = document.getElementById("totalRecipients");
    total.value = eval(total.value)-eval(iInt);
}