function toggle( elem ) {
var style = elem.style;
if ( elem.ownerDocument && elem.ownerDocument.defaultView ) {
style = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
} else if ( elem.currentStyle ) {
style = elem.currentStyle;
}
elem.style.display = (style.display == 'none') ? '' : 'none';
}