function getStyle(elm,name){
if(elm.style[name]){
return elm.style[name]
}else if(elm.currentStyle){
return elm.currentStyle[name]
}else if(document.defaultView&&document.defaultView.getComputedStyle){
var name=name.replace(/([A-Z])/g,'-$1');
name=name.toLowerCase();
var s=document.defaultView.getComputedStyle(elm,'');
return s&&s.getPropertyValue(name)
}else{
return null
}
}
if(elm.style[name]){
return elm.style[name]
}else if(elm.currentStyle){
return elm.currentStyle[name]
}else if(document.defaultView&&document.defaultView.getComputedStyle){
var name=name.replace(/([A-Z])/g,'-$1');
name=name.toLowerCase();
var s=document.defaultView.getComputedStyle(elm,'');
return s&&s.getPropertyValue(name)
}else{
return null
}
}