/*
version:		1.0
*/

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function copyObject( srcObj, destObj )
{
	trace("copyObject()");
	for ( childName in srcObj )
	{
		trace("");
		trace("childName: "+childName);
		thisChild = srcObj[childName];
		childType = getType(thisChild);
		
		trace(childName+":  "+childType);
		// handle variables
		if (childType == "variable")
		{
			destObj[childName] = thisChild;
		}
		
		// handle Arrays
		if (childType == "array")
		{
			// // create new array
			destObj[childName] = new Array();
			// // set dest, scan array
			copyObject( thisChild, destObj[childName] );
		}
		
		// handle Objects
		if (childType == "object")
		{
			// // create new object
			destObj[childName] = new Object();
			// // set dest, scan object
			copyObject( thisChild, destObj[childName] );
		}
		
	}// END:  for...in
	
}



function getType( inputObject )
{
	var output = "";
	if ( inputObject instanceof Array )
	{
		trace("array");
		// this is an array
		output = "array";
	}
	else if ( inputObject instanceof Object )
	{
		trace("object");
		// this is an object
		output = "object";
	}
	else
	{
		// this is a regular variable
		trace("variable");
		output = "variable";
	}
	trace("Object Type:  "+output);
	return output;	// object, array, string, number, boolean
}



// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



function emptyObject( inputObject )
{
	for ( nam in inputObject )
	{
		delete inputObject[nam];
	}
}


