function DragAndDropPanel(panelDescription, snapsrctotar, snapback, showtargetborders, showcircleborder, highlightanswer, horizontalonly, verticalonly, sources, targets, buttons)
{
	this.description = panelDescription;
	this.snapsrctotar = snapsrctotar;
   	this.snapbackifwrong = snapback;
   	this.showtargetborder = showtargetborders;
   	this.showcircleborder = showcircleborder;
   	this.highlightanswer = highlightanswer;
   	this.horizontalonly = horizontalonly;
   	this.verticalonly = verticalonly
   	this.sources = sources;
   	this.targets = targets;
   	this.buttons = buttons;
   	this.targetList = new Array();
   	this.dndpaneldiv;
   	this.top;
   	this.left;
   	this.width;
   	this.height;
	
	DragAndDropPanel.prototype.createNewPanel = function()
	{
		var newdiv  = window.parent.ContentFrame.document.getElementById(this.description);
		newdiv.style.zIndex = 100;
		this.top = parseInt(getStyle(this.description, "top"))
		this.left = parseInt(getStyle(this.description, "left"))
		this.width = parseInt(getStyle(this.description, "width"))
		this.height = parseInt(getStyle(this.description, "height"))
		if(document.all)
		{
			newdiv.isIE = true;
			this.isIE = true;
		}		
		this.dndpaneldiv = newdiv;
		if(this.sources)
			this.createSources();
		if(this.targets)
			this.createTargets();	
		if(this.buttons)
			this.createButtons();
		this.setSources();
	}
	
	DragAndDropPanel.prototype.createSources = function()
	{
		for(var x=0; x<this.sources.length; x++)
		{
			var idAndDirection = this.sources[x];
			var id = idAndDirection.substring(0, idAndDirection.length - 1);
			var direction = idAndDirection.substring(idAndDirection.length - 1);
			new DragAndDropSrcPanel(id, direction, this);
		}
	}
	
	DragAndDropPanel.prototype.createTargets = function()
	{
		var border = ""
		if(this.showtargetborder && !this.showcircleborder)
			border = "thin solid rgb(0,0,0)";
		else if(this.showtargetborder && this.showcircleborder)
			border = "circle";
		for(var x=0; x<this.targets.length; x++)
		{
			var tarObjProps = this.targets[x];
			var tarobj = new DragAndDropTargetPanel(tarObjProps[0], border, this, tarObjProps[1], tarObjProps[2]);
			this.targetList[this.targetList.length] = tarobj;
		}
	}	
	
	DragAndDropPanel.prototype.createButtons = function()
	{
		for(var x=0; x<this.buttons.length; x++)
		{
			var buttonObj = this.buttons[x];
			new DragAndDropButton(buttonObj[0], this, buttonObj[1]);
		}
	}	
	
	DragAndDropPanel.prototype.getWidth = function()
	{
		return this.width;
	}
	
	DragAndDropPanel.prototype.getHeight = function()
	{
		return this.height;
	}
	
	DragAndDropPanel.prototype.getDescription = function()
	{
		return this.description;
	}
	
	DragAndDropPanel.prototype.getTop = function()
	{
		return this.top;
	}	
	
	DragAndDropPanel.prototype.getLeft = function()
	{
		return this.left;
	}
	
	DragAndDropPanel.prototype.snapBack = function()
	{
		return this.snapbackifwrong;
	}	
	
	DragAndDropPanel.prototype.snapSourceToTarget = function()
	{
		return this.snapsrctotar;
	}
	
	DragAndDropPanel.prototype.showBorders = function()
	{
		return this.showtargetborder;
	}
	
	DragAndDropPanel.prototype.useCircleBorders = function()
	{
		return this.showcircleborder;
	}
	
	DragAndDropPanel.prototype.showCircleBorder = function()
	{
		return this.showcircleborder
	}
	
	DragAndDropPanel.prototype.highlightAnswer = function()
	{
		return this.highlightanswer
	}	
	
	DragAndDropPanel.prototype.getTargetList = function()
	{
		return this.targetList;
	}	
	
	DragAndDropPanel.prototype.getDiv = function()
	{
		return this.dndpaneldiv
	}
	
	DragAndDropPanel.prototype.getHorizontalOnly = function()
	{
		return this.horizontalonly
	}
	
	DragAndDropPanel.prototype.getVerticalOnly = function()
	{
		return this.verticalonly
	}
	
	DragAndDropPanel.prototype.reset = function()
	{
		for(var x=0; x<this.sources.length; x++)
		{
			var idAndDirection = this.sources[x];
			var srcObjId = idAndDirection.substring(0, idAndDirection.length - 1);
			var srcObj = window.parent.ContentFrame.document.getElementById(srcObjId);
			if(srcObj != null)
			{
				srcObj.style.top = srcObj.srcobj.getTop();
				srcObj.style.left = srcObj.srcobj.getLeft();
			}
		}
		var targets = this.getTargetList();
		if(targets != null)
		{
			for(var x=0; x<targets.length; x++)
			{
				var target = targets[x];
				target.currentsrc = null;
				target.highlightBorder(null, "#000000")
			}
		}
	}
	
	DragAndDropPanel.prototype.getAnswersString = function()
	{
		var retVal = ""; 
		var targets = this.getTargetList();
		if(targets != null)
		{
			for(var x=0; x<targets.length; x++)
			{
				var target = targets[x];
				if(target != null)
				{
					var source = target.getCurrentSource();
					var targetid = target.getDescription();
					var sourceid = "";
					if(source != null)
						sourceid = source.getDescription();
					if(x == 0)
						retVal += targetid + "," + sourceid;
					else
						retVal += ";" + targetid + "," + sourceid;
				}
				
			}
		}
		return retVal;
	}
	
	DragAndDropPanel.prototype.setSources = function()
	{
		var dndobjs = window.ContentFrame.itemOrder
		var targetandsource = dndobjs.split(";");
		for(var x=0; x<targetandsource.length; x++)
		{
			var dndobj = targetandsource[x].split(",");
			var tar = dndobj[0];
			var source = dndobj[1];
			var target = window.parent.ContentFrame.document.getElementById(tar);
			if(target != null)
			{
				var targetObj = target.srcobj;
				if(targetObj != null)
					targetObj.setCurrentSource(source);
			}
		}
	}
	this.createNewPanel();
}