var FormControl = {
	swapForm:function(val) {
		var test = $('form-container').childElements();
		var p = test.length;
		//alert (test);
		for (i=0;i<p;i++) {
			if (test[i].visible()) {
				test[i].hide();
			}
		}
		var str = val.options[val.selectedIndex].value;
		$(str).show();
	}
}

/* Contact Us Properties XML Dom */
var ContactUsProperties = {
	UpdateProperty:function(rootNode, key, value)
	{
        var document = rootNode.ownerDocument;
        for (var i = 0; i < rootNode.childNodes.length; i++)
        {
            var existingNode = rootNode.childNodes[i];
            if (existingNode.nodeName == "item")
            {
                var curKey = existingNode.getAttribute("key");
                if (curKey == key)
                {
                    try
                    {
                        existingNode.childNodes[0].nodeValue = value;
                    }
                    catch (e)
                    {
                        existingNode.appendChild(document.createTextNode(value));
                    }
                    return;
                }
            }
        }
        ContactUsProperties.InsertProperty(rootNode, key, value);
    },
    InsertProperty:function(rootNode, key, value)
    {
        var document = rootNode.ownerDocument;
        var newNode = document.createElement("item");
        newNode.setAttribute("key", key);
        newNode.appendChild(document.createTextNode(value));
        rootNode.appendChild(newNode);
    },
    CreatePropertiesDom:function(tabRef)
    {
        var document = SafeCreateXmlDom();
        document.loadXML("<xml />");                
        var rootNode = document.getElementsByTagName("xml")[0];
        rootNode.setAttribute("tabRef", tabRef);
        return rootNode;
    },
    LoadPropertiesDom:function(xmlFrag)
    {
        var document = SafeCreateXmlDom();
        document.loadXML(xmlFrag);                
        var rootNode = document.getElementsByTagName("xml")[0];
        return rootNode;
    }
}