$(function(){var timeId=null,enabled=false,selectElement=null,currentElement=null;var elt=$("
");$.fn.bindDraw=function(opt){$(this).mousedown(function(e){if($("#kskm_titleinput").attr("disabled")){return}var obj=$(this).parents(opt.drawSelect).first()[0];currentElement=obj;currentElement.selector=opt.drawSelect;if($("#pup_upbox").is(":visible")){return}enabled=true;$(obj).after(elt);elt.show().css({height:$(obj).height(),width:$(obj).width()});$(obj).css({position:"absolute",opacity:.5,width:$(obj).width(),zIndex:99,marginLeft:0,left:$(obj).offset().left,top:$(obj).offset().top}).attr("initLeft",$(obj).offset().left);var element=$(e.srcElement||e.target);element.parent().parent().addClass("input_blue");var p=$(obj).offset();obj.pos={left:e.clientX-p.left,top:e.clientY-p.top+$(window).scrollTop()};$(obj).find("[contenteditable]").blur();$("body").append(obj);if(e.cancelBubble){e.cancelBubble=true}else{e.stopPropagation()}return false}).parent().parent().mouseup(function(e){if(!enabled){return}enabled=false;if($("#zwfpos").is(":visible")){elt.after(currentElement);$("body").append(elt.hide());$(currentElement).css({position:"",opacity:"",marginLeft:"",width:"",top:"",left:""});currentElement.style.zoom="";if(window.IS_MOVE){window.moveData&&window.moveData(currentElement);window.IS_MOVE=false}}$(".input_blue").removeClass("input_blue").find("input").css("-webkit-user-select","")})};$(document).mousemove(function(e){if(enabled){var winTop=$(window).scrollTop();$(currentElement).css({left:e.clientX-currentElement.pos.left,top:e.clientY-currentElement.pos.top+winTop});var top=e.clientY-currentElement.pos.top+winTop;elt.siblings(currentElement.selector).each(function(i,n){var meTop=$(this).offset().top;if(meTop>top+20&&i==0){$(this).before(elt);window.IS_MOVE=true;return false}if(top