ControlAttribute=function()
{
    this.ID="";
    
    this.Type="";
    
    this.Left=0;
    this.Top=0;
    this.Width=0;
    this.Height=0;
    this.Selected=0;
    this.Content="";
    this.Zindex;
    
    this.Owner=null;
    
    this.Controls=new Hashtable();
    
    this.saveXML=function()
    {
        var xml="";
        xml+="\
        <obxControl>\
			<properties>\
				<id>"+this.ID+"</id>\
				<owner>"+this.Owner.id+"</owner>\
				<type>"+this.Type+"</type>\
				<left>"+this.Left+"</left>\
				<top>"+this.Top+"</top>\
				<width>"+this.Width+"</width>\
				<height>"+this.Height+"</height>\
				<selected>"+this.Selected+"</selected>\
			</properties>"
	    if(this.Controls.count()>0)
	    {
	        xml+="<content>";
	        for(var i in this.Controls._hash)
	        {
	            xml+=this.Controls.item(i).Attribute.saveXML();
	        }
	        xml+="</content>";
	    }
		xml+="</obxControl>";
        return xml;
    }
    this.loadXML=function(xml)
    {
    //alert(xml.xml);
        this.ID=xml.selectSingleNode("/obxControl/properties/id").text;
        this.Type=xml.selectSingleNode("/obxControl/properties/type").text;
        this.Owner=$(xml.selectSingleNode("/obxControl/properties/owner").text);
        this.Left=parseInt(xml.selectSingleNode("/obxControl/properties/left").text);
        this.Top=parseInt(xml.selectSingleNode("/obxControl/properties/top").text);
        this.Height=parseInt(xml.selectSingleNode("/obxControl/properties/height").text);
        this.Width=parseInt(xml.selectSingleNode("/obxControl/properties/width").text);
        this.Selected=parseInt(xml.selectSingleNode("/obxControl/properties/selected").text);
        
        var nodeContent=xml.selectSingleNode("/obxControl/content");
        
//1-ELEMENT
//2-ATTRIBUTE
//3-TEXT
//4-CDATA
//5-ENTITY REFERENCE
//6-ENTITY
//7-PI (processing instruction)
//8-COMMENT
//9-DOCUMENT
//10-DOCUMENT TYPE
//11-DOCUMENT FRAGMENT
//12-NOTATION

        if(this.Type.toLowerCase()!="obxform")
        {
            this.Content=nodeContent.text;
        }
        else
        {
            this.Content=new XMLDOM(nodeContent.xml);
        }
    }
}
