function getStyle(obj,attr,value){ if(!value){ if(window.getComputedStyle){ return window.getComputedStyle(obj)[attr]; }else { return obj.currentStyle[attr]; } }else { obj[attr] = value; } }