
function ObjGetProperties(obj,propnames)
{var props={};for(var i in obj)
{if((i in Object.prototype))continue;if((!propnames)||(propnames&&InArray(propnames,i)))
{props[i]=obj[i];}}
return props;}
function ObjSetProperties(obj,props,propnames)
{if(!obj)
return props;for(var i in props)
{if((i in Object.prototype))continue;if((!propnames)||(propnames&&InArray(i,propnames)))
{obj[i]=props[i];}}}
function ObjToSource(obj)
{if(obj.getSource)
return obj.toSource();else
return json.stringify(obj);}
function ObjFromSource(strSource)
{var x;eval("x="+strSource);return x;}
function Serialize(obj,propnames)
{var props=ObjGetProperties(obj,propnames);var strSource=ObjToSource(props);return strSource;}
function Deserialize(obj,strSource)
{var props=ObjFromSource(strSource);obj=ObjSetProperties(obj,props);return obj;}
debug("serialize.js 2323");debug("Serialize.attach="+Serialize.attach);