function Capabilities(){function r(){}function i(r){e=r,funcObj.devCon.sendMsg(e,"capabilities");var i=funcObj.devCon.getDevice(e).type;if(i in n){funcObj.margeComm.retrieveMargeDeviceSettings(e);var s=n[i];for(var o in s)t[o]=s[o]}funcObj.devCon.sendMsg(e,"bassCapabilities")}function s(e){return t[e]}function o(e,n){var r=t[e];n=n==="true"||n==="false"?n==="true":n;if(r===n)return;t[e]=n,p(e,n),e==="bluetooth_enabled"&&funcObj.deviceTray.updateTrayView(!1)}function u(e){var n=e.nodeName;n=="updates"&&(n=e.firstElementChild.firstElementChild.nodeName,e=e.firstElementChild.firstElementChild);if(t[n]){var r=e.attributes;for(var i=0,s=r.length;i<s;i++)t[n][r[i].nodeName]=h(r[i].nodeValue);if(e.hasChildNodes()){var o=l(e);Object.keys(o).forEach(function(e){t[n][e]=$.extend(t[n][e],o[e])})}}}function a(n){var r=$(n),i=r.children();for(var s=0,o=i.length;s<o;s++){var u=i[s],a=u.nodeName.toLowerCase();switch(a){case"capability":var c=f(u);t[c.capability]=c.value;break;default:var h=l(u);for(var p in h)h.hasOwnProperty(p)&&(t[p]=h[p])}}t.lrStereoCapable&&funcObj.groupCon.groupDeviceController.fetchDeviceGroup(e)}function f(t){var n={},r={},i=t.attributes;for(var s=0,o=i.length;s<o;s++)i[s].name!="name"&&(r[i[s].name]=i[s].value);n.capability=i.name.value,n.value=r;if(n.value.url){var u=n.value.url.slice(1);funcObj.devCon.sendMsg(e,u)}return n}function l(e){var t={},n=$(e),r=e.nodeName;if(n.children().length>0){var i=n.children();for(var s=0,o=i.length;s<o;s++){var u=$(i[s]);u[0].attributes.length>0?t[i[s].nodeName]=c(u[0]):t[i[s].nodeName]=h($(u).text())}}else t[r]=h($(n).text());return t}function c(e){var t={};for(var n=0,r=e.attributes.length;n<r;n++){var i=e.attributes[n];t[i.nodeName]=h(i.nodeValue)}return t}function h(e){var t;return t=e==="true",t||e!=="false"&&e!==""&&(t=e),t}function p(t,n){switch(t){case"bluetooth_enabled":n===!0?funcObj.devCon.sendMsg(e,"sources"):funcObj.sources.removeLocalSource(e,"bluetooth")}}var e,t={bluetooth_toggle:null,bluetooth_enabled:!0},n={"SoundTouch SA-5":{bluetooth_toggle:!0}};this.setup=i,this.get=s,this.set=o,this.parseCaps=a,this.updateCapability=u,this.capabilities=t,this.traverseSubNodes=l,this.parseGenericCap=f,this.getNodeValue=h,r()};