+(function () {
+ var style_props = {
+ width: 'width',
+ height: 'height',
+ padingLeft: 'padding-left',
+ paddingRight: 'padding-right',
+ paddingTop: 'padding-top',
+ paddintBottom: 'padding-bottom',
+ borderLeftStyle: 'border-left-style',
+ borderRightStyle: 'border-right-style',
+ borderTopStyle: 'border-top-style',
+ borderBottomStyle: 'border-bottom-style',
+ borderLeftWidth: 'border-left-width',
+ borderRightWidth: 'border-right-width',
+ borderTopWidth: 'border-top-width',
+ borderBottomWidth: 'border-bottom-width',
+ fontFamily: 'font-family',
+ fontSize: 'font-size',
+ lineHeight: 'line-height',
+ letterSpacing: 'letter-spacing',
+ wordSpacing: 'word-spacing' };
+
+ function copy_style (from, to)
+ {
+ var from_style = getComputedStyle(from,'');
+
+ for(var name in style_props)
+ to.style[name] = from_style.getPropertyValue (style_props[name]);
+
+ to.style.left = from.offsetLeft + 'px';
+ to.style.top = from.offsetTop + 'px';
+ to.style.width = from.offsetWidth;
+ to.style.height = from.offsetHeight;
+ to.scrollLeft = from.scrollLeft;
+ to.scrollTop = from.scrollTop;
+ }
+
+ MIM.show = function (target, ic)
+ {
+ if (! ic.can_node)
+ {
+ var elm = document.createTextNode ('');
+
+ ic.can_node = document.createElement ('div');
+ ic.can_node.style.visibility="hidden";
+ ic.can_node.style.position = "absolute";
+ ic.can_node.appendChild (elm)
+ elm = document.createElement('span');
+ elm.innerHTML = '.';
+ ic.can_node.appendChild (elm)
+ document.getElementsByTagName ('body')[0].appendChild (ic.can_node);
+ }
+
+ copy_style (target, ic.can_node);
+ ic.can_node.firstChild.value = target.value.substr (0, ic.range[0]);
+ var x = target.offsetLeft + ic.can_node.lastChild.offsetLeft +2;
+ var y = target.offsetTop + ic.can_node.lastChild.offsetTop -2;
+
+ Xex.Log ("x:" + x + "px y:" + y + "px");
+ }
+}) ();
+