function OnClientDragDropStart_StudentSchedule(source, target) 
{ 
	//debugger;
	//return true;
	var targetParentNode;
	if(target.getDepth() == 0)
	{
		targetParentNode = target;
	}
	else
	{
		targetParentNode = target.getParentTreeNode();
	}

	var childNodes;
		
	if(source.getParentTreeNode() == targetParentNode)
	{
		return true;
	}
	else
	{
		if(targetParentNode.getValue() == "1" && targetParentNode.getNodes().length >= NumChoices[0])
		{
			alert("You have already added the maximum number of first choices.");
			return false;
		}
		else if(targetParentNode.getValue() == "2" && targetParentNode.getNodes().length >= NumChoices[1])
		{
			alert("You have already added the maximum number of second choices.");
			return false;
		}
		
		childNodes = targetParentNode.getNodes();
		
		for(var i = 0; i < childNodes.length; i++)
		{
			if(source.getValue() == childNodes[i].getValue())
			{
				alert("Class " + childNodes[i].getText() + " already exists in list.");
				return false;
			}
		}
                
            if(limit != null && limit && 1==0)
		{
			if(targetParentNode.getValue() == "2" && (grade == 10 || grade == 11) && 
				targetParentNode.getNodes().length == 2)
			{
				alert('Current freshman and sophomores may only have 2 second choices.');
				return false;
			}
		}
	}
	return true;
}

function ViewUsers_ClientClickStart(node)
{
	if(node.isCheckable())
	{
		if(node.isChecked())
		{
			node.uncheck();
		}
		else
		{
			node.check();
		}
		return false;
	}
	return true;
}

function OnClientClick(node)
{
	//node.unselect();
	return true;
}

function DisplayPopupHelp(ModuleId)
{
	return overlib(eval('PopupHelp' + ModuleId + 'Text'),CAPTION,eval('PopupHelp' + ModuleId + 'Caption'),
		STICKY,AUTOSTATUSCAP,CLOSECLICK,DRAGGABLE,ABOVE,OFFSETY,20,WRAP,WRAPMAX,350,FGCOLOR,"whitesmoke",
		CGCOLOR,'#dcdce6',BGCOLOR,'#dcdce6',CAPCOLOR,'black',TEXTFONT,'Tahoma',CAPTIONFONT,'Tahoma',
		CLOSECOLOR,'black');
}

