Codebase.load("http://codebase.gd-ks.com/js/Object.js"); Codebase.load("http://codebase.gd-ks.com/js/Browser.js"); var Style={ setAttributes: function(el, attributes) { var o={}; if(Object.isString(attributes)) { var declarations=attributes.split(";"); for(var i=0; i<declarations.length; i++) { var splitData=declarations[i].split(":"); if(splitData.length==2) { o[splitData[0].replace(/^\s+|\s+$/g,"")]=splitData[1].replace(/^\s+|\s+$/g,""); } } delete declarations; delete splitData; } else { o=attributes; } for(var key in o) { var correctedKey; correctedKey=(/^float$/.test(key) ? (Browser.isIE ? "styleFloat" : "cssFloat") : key); if(/^borderRadius$/.test(key)) { el.style.MozBorderRadius=el.style.WebkitBorderRadius=o[key]; } if(/^opacity$/.test(key)) { el.style.filter="alpha(opacity:" + o[key]*100 + ")"; el.style.KHTMLOpacity=el.style.MozOpacity=o[key]; } el.style[correctedKey]=o[key]; delete correctedKey; } }, get: function(el, attribute) { var v=""; if(document.defaultView && document.defaultView.getComputedStyle) { v=document.defaultView.getComputedStyle(el, "").getPropertyValue(attribute); } else if(el.currentStyle) { attribute=attribute.replace(/\-(\w)/g, function (strMatch, p1) 	 { 	 return p1.toUpperCase(); 	 }); v=el.currentStyle[attribute]; } if(v=="") { v=el.style[attribute]; } return v; }, getAttribute: function(el, attribute) { return (el.style ? el.style[attribute] : ""); } };