PageRenderTime 39ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/scm/WebContent/com/framework.js

http://demoasp.googlecode.com/
JavaScript | 404 lines | 321 code | 46 blank | 37 comment | 59 complexity | c55a7e81b5a3e0b2da22c85cff7b2be5 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. /**JSmart????*/
  2. function framework(){}
  3. /**????*/
  4. framework.version = "1.0";
  5. /**??*/
  6. framework.encoding = "UTF-8";
  7. /**?????????cookie?name*/
  8. framework.languageKey = "CLIENTLAN";
  9. /**??????*/
  10. framework.language = "zh-CN";
  11. /**??????*/
  12. framework.setupLanguages = ["zh-CN","en-US","zh-TW"];
  13. /**?????*/
  14. framework.getContextPath = function(){
  15. var pathName = document.location.pathname;
  16. return pathName.substr(0,(pathName.substr(1).indexOf("/"))+1);
  17. };
  18. /**??? ?cookie?? ???????*/
  19. framework.getLanguage = function(){
  20. var cookieArray=document.cookie.split("; "); //?????cookie???
  21. var cookie=new Object();
  22. for(var i=0;i<cookieArray.length;i++){
  23. var arr=cookieArray[i].split("="); //??????
  24. if(arr[0] == framework.languageKey){
  25. return unescape(arr[1]); //??????cookie???????
  26. }
  27. }
  28. return framework.language;
  29. };
  30. /**????*/
  31. framework.setLanguage = function(value){
  32. framework.language = value;
  33. var str = framework.languageKey + "="+escape(value);
  34. var date=new Date();
  35. var ms=9999 * 60 * 1000; //????60????1000??
  36. date.setTime(date.getTime()+ms);
  37. str+="; expires="+date.toGMTString();
  38. str+="; path=/"
  39. document.cookie=str;
  40. };
  41. /**??????*/
  42. framework.browser={
  43. ie:/msie/.test(window.navigator.userAgent.toLowerCase()),
  44. moz:/gecko/.test(window.navigator.userAgent.toLowerCase()),
  45. opera:/opera/.test(window.navigator.userAgent.toLowerCase()),
  46. safari:/safari/.test(window.navigator.userAgent.toLowerCase())
  47. };
  48. /*JS?????? isCrossdomain ????*/
  49. framework.importJS=function(path,id,isCrossdomain){
  50. var oHead = document.getElementsByTagName('HEAD').item(0);
  51. var oScript= document.createElement("script");
  52. var scriptTag = document.getElementById(id);
  53. if (scriptTag){
  54. oHead.removeChild(scriptTag);
  55. }
  56. if(isCrossdomain){
  57. document.write("<script id='"+id+"' charset='"+framework.encoding+"' defer src='"+path+"?version="+framework.version+"' type='text/javascript'><\/script>");
  58. }else{
  59. document.write("<script id='"+id+"' charset='"+framework.encoding+"' defer src='"+framework.getContextPath()+"/"+path+"?version="+framework.version+"' type='text/javascript'><\/script>");
  60. }
  61. };
  62. /**CSS??????*/
  63. framework.importCSS=function(path,id,isCrossdomain){
  64. document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\""+framework.getContextPath()+"/"+path+"?version="+framework.version+"\" \/>");
  65. };
  66. /**dialog????*/
  67. ymPrompt=parent.parent.ymPrompt;
  68. framework.open=function(title,url,name,w,h){
  69. var iTop = (window.screen.availHeight-30-w)/2;
  70. var iLeft = (window.screen.availWidth-10-h)/2;
  71. function handlerFrame(){
  72. ymPrompt.close();
  73. }
  74. ymPrompt.win({title:title,dragOut:true,fixPosition:true,maxBtn:true,minBtn:true,width:w,height:h,handler:handlerFrame,iframe:{id:'myId',name:'myName',src:url}});
  75. //window.showModalDialog(url,null,"dialogWidth:800px;dialogHeight:450px;top:'"+iTop+"px';left:'"+iLeft+"px';location:0;scroll:0;help:0;status:0");
  76. //window.open ("http://www.baidu.com", "newwindow", "height=400, width=500,top="+iTop+",iLeft="+iLeft+", toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
  77. //window.open(url,name,'height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,titlebar=no');
  78. //window.open(url,name,"height=300, width=500, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
  79. };
  80. framework.openOption=function(param){
  81. var iTop = (window.screen.availHeight-30-param.w)/2;
  82. var iLeft = (window.screen.availWidth-10-param.h)/2;
  83. ymPrompt.win({title:param.title,dragOut:true,fixPosition:true,maxBtn:true,minBtn:true,width:param.w,height:param.h,autoClose:false,handler:param.callback,iframe:{id:param.frameId,name:'myName',src:param.url},btn:[['????','yes']]});
  84. };
  85. /**?????*/
  86. framework.confirm = function(msg,handler){
  87. ymPrompt.confirmInfo({message:msg,handler:handler});
  88. };
  89. /**???*/
  90. framework.alert = function(msg){
  91. ymPrompt.alert(msg,null,null,'??',null);
  92. };
  93. Array.prototype.contains = function(e) {
  94. for(i=0;i<this.length;i++) {
  95. if(this[i] == e)
  96. return true;
  97. }
  98. return false;
  99. };
  100. /**?????????????onload????? */
  101. framework.onload = function(){};
  102. function GetParentElement(obj, tag){
  103. while(obj!=null && obj.tagName!=tag)
  104. obj=obj.parentNode;
  105. return obj;
  106. }
  107. function changeColor(evt){
  108. evt = evt ? evt : window.event;
  109. var el = evt.target ? evt.target : evt.srcElement;
  110. var tabElement=null;
  111. while (true){
  112. el=GetParentElement(el, "TR")
  113. if (el){
  114. tabElement=GetParentElement(el, "TABLE");
  115. if (tabElement!=null && tabElement.className.toUpperCase()=="LIST"){
  116. break;
  117. }
  118. el=tabElement;
  119. }else{
  120. return;
  121. }
  122. }
  123. for (var i=0;i <el.childNodes.length;i++){
  124. if (el.childNodes[i].tagName=="TD"){
  125. el.childNodes[i].style.backgroundColor="#F5F5F5";
  126. }
  127. }
  128. };
  129. function revertColor(evt){
  130. evt = evt ? evt : window.event;
  131. var el = evt.target ? evt.target : evt.srcElement;
  132. var tabElement=null;
  133. while (true){
  134. el=GetParentElement(el, "TR")
  135. if (el){
  136. tabElement=GetParentElement(el, "TABLE");
  137. if (tabElement!=null && tabElement.className.toUpperCase()=="LIST"){
  138. break;
  139. }
  140. el=tabElement;
  141. }else{
  142. return;
  143. }
  144. }
  145. for (var i=0;i <el.childNodes.length;i++){
  146. if (el.childNodes[i].tagName=="TD"){
  147. el.childNodes[i].style.backgroundColor="";
  148. }
  149. }
  150. };
  151. /**??????*/
  152. framework.toEdit = function(url,prefix){
  153. var objs = document.getElementsByName(prefix+"_row");
  154. var ids = "";
  155. var count = 0;
  156. for(var i=0; i<objs.length; i++) {
  157. if(objs[i].checked){
  158. ids += objs[i].value+"@";
  159. count++;
  160. }
  161. }
  162. if(count == 1){
  163. ids = ids.substring(0,ids.length-1);
  164. var f = "?";
  165. if(url.indexOf("?") > -1 ){
  166. f = "&";
  167. }
  168. window.location = url + f + "id="+ids;
  169. }else{
  170. framework.alert("???????");
  171. }
  172. };
  173. /**??????*/
  174. framework.doUpdate = function(url){
  175. if(confirm("?????")){
  176. window.location = url;
  177. }
  178. };
  179. /**????????? ?key?value*/
  180. function choiceDataCallBack(frameId,entityName,type,labelColumn){
  181. var doc = top.document.getElementById(frameId).contentWindow.document;
  182. var objs = doc.getElementsByName(entityName+"_row");
  183. var ids = [];
  184. var lable = [];
  185. for(var i=0; i<objs.length; i++) {
  186. if(objs[i].checked){
  187. var lableTemp = $(objs[i]).parent().next();
  188. if(labelColumn > 1){
  189. for(var k=0;k<labelColumn-1;k++){
  190. lableTemp = $(lableTemp).next();
  191. }
  192. }
  193. lable.push($.trim($(lableTemp).text()));
  194. ids.push(objs[i].value);
  195. if("radio"==type){
  196. break;
  197. }
  198. }
  199. }
  200. function data(){};
  201. data.ids = ids;
  202. data.lable = lable;
  203. ymPrompt.close();
  204. return data;
  205. };
  206. /**??????*/
  207. framework.doBatchDelete = function(url,prefix){
  208. var objs = document.getElementsByName(prefix+"_row");
  209. var ids = "";
  210. for(var i=0; i<objs.length; i++) {
  211. if(objs[i].checked){
  212. ids += objs[i].value+"@";
  213. }
  214. }
  215. if(ids.length > 0){
  216. ids = ids.substring(0,ids.length-1);
  217. }
  218. framework.doDelete(url,ids);
  219. };
  220. /**????*/
  221. framework.doDelete = function(url,ids){
  222. function handler(tp){
  223. if(tp == "ok"){
  224. var f = "?";
  225. if(url.indexOf("?") > -1 ){
  226. f = "&";
  227. }
  228. window.location = url + f + "ids="+ids;
  229. }
  230. }
  231. if(ids.length <= 0 ){
  232. fw.alert("?????????!");
  233. }else{
  234. fw.confirm("????" + ids.split("@").length +"????",handler);
  235. }
  236. };
  237. framework.gridSelectAll = function(prefix){
  238. var objs = document.getElementsByName(prefix+"_row");
  239. for(var i=0; i<objs.length; i++) {
  240. objs[i].checked = document.getElementById("selectAll").checked;
  241. }
  242. };
  243. framework.sys = function(){};
  244. /**?????? ????????*/
  245. window.onload = function(e)
  246. {
  247. try{
  248. //toolbar??
  249. var v = document.getElementsByName("tb");
  250. for(var i=0;i<v.length;i++){
  251. if(!toolbar.contains(v[i].id)){
  252. v[i].className = "l-btn l-btn-plain l-btn-disabled";
  253. $(v[i]).attr("disabled","disabled").attr("href","###").unbind();
  254. if(framework.sys.toolbarMode == "mode2" && v[i].getAttribute("bak")!="search" && v[i].getAttribute("bak")!="pagination" ){
  255. $(v[i]).hide();
  256. }
  257. }
  258. if(framework.sys.toolbarMode == "mode1" && v[i].getAttribute("bak")!="search" && v[i].getAttribute("bak")!="pagination"){
  259. //$(v[i]).hide();
  260. }
  261. }
  262. //????
  263. $("table").each(function(){
  264. if($(this).hasClass("list")){
  265. $(this).mouseover(changeColor);
  266. $(this).mouseout(revertColor);
  267. }
  268. });
  269. //?????? ?????
  270. if(framework.sys.inputType && "radio" == framework.sys.inputType){
  271. $(":checkbox").each(function(i){
  272. var value = this.value;
  273. var name = this.name;
  274. $(this).after("<input name='"+name+"' type='radio' value='"+ value +"'>");
  275. $(this).remove();
  276. });
  277. }
  278. //????
  279. var mm = document.getElementById("mm");
  280. if(mm)mm.style.display="";
  281. $('#export').click(function(e){
  282. using('menu', function(){
  283. $('#mm').menu('show',{
  284. left:e.pageX,
  285. top:e.pageY
  286. });
  287. });
  288. });
  289. framework.onload();
  290. }catch(e){
  291. throw e;
  292. }finally{
  293. }
  294. };
  295. function fw(){
  296. };
  297. fw = framework;
  298. /**??????*************************/
  299. function setupValidate(formName){
  300. $(document).ready(function() {
  301. $("#"+formName).validate({
  302. errorElement: "em",
  303. errorPlacement: function(error, element) {
  304. error.appendTo(element.parent());
  305. },
  306. success: function(label) {
  307. label.text("").addClass("success");
  308. }
  309. });
  310. });
  311. };
  312. /**??????*************************/
  313. function setupValidateSearch(formName){
  314. $(document).ready(function() {
  315. $("#"+formName).validate({
  316. errorElement: "em",
  317. errorContainer: $("#warning")
  318. });
  319. });
  320. };
  321. /*
  322. * My97 DatePicker 4.72 Release
  323. * License: http://www.my97.net/dp/license.asp
  324. */
  325. var $dp,WdatePicker;(function(){var _={
  326. $wdate:true,
  327. $dpPath:framework.getContextPath()+"/com/calendar/",
  328. $crossFrame:true,
  329. doubleCalendar:false,
  330. enableKeyboard:true,
  331. enableInputMask:true,
  332. autoUpdateOnChanged:null,
  333. whichDayIsfirstWeek:4,
  334. position:{},
  335. lang:"auto",
  336. skin:"default",
  337. dateFmt:"yyyy-MM-dd",
  338. realDateFmt:"yyyy-MM-dd",
  339. realTimeFmt:"HH:mm:ss",
  340. realFullFmt:"%Date %Time",
  341. minDate:"1900-01-01 00:00:00",
  342. maxDate:"2099-12-31 23:59:59",
  343. startDate:"",
  344. alwaysUseStartDate:false,
  345. yearOffset:1911,
  346. firstDayOfWeek:0,
  347. isShowWeek:false,
  348. highLineWeekDay:true,
  349. isShowClear:true,
  350. isShowToday:true,
  351. isShowOK:true,
  352. isShowOthers:true,
  353. readOnly:false,
  354. errDealMode:0,
  355. autoPickDate:null,
  356. qsEnabled:true,
  357. autoShowQS:false,
  358. specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,errMsg:"",quickSel:[],has:{}};WdatePicker=U;var X=window,O="document",J="documentElement",C="getElementsByTagName",V,A,T,I,b;switch(navigator.appName){case"Microsoft Internet Explorer":T=true;break;case"Opera":b=true;break;default:I=true;break}A=L();V=X;if(_.$crossFrame){try{while(V.parent&&V.parent[O]!=V[O]&&V.parent[O][C]("frameset").length==0)V=V.parent}catch(P){}}if(!V.$dp)V.$dp={ff:I,ie:T,opera:b,el:null,win:X,status:0,defMinDate:_.minDate,defMaxDate:_.maxDate,flatCfgs:[]};B();if($dp.status==0)Z(X,function(){U(null,true)});if(!X[O].docMD){E(X[O],"onmousedown",D);X[O].docMD=true}if(!V[O].docMD){E(V[O],"onmousedown",D);V[O].docMD=true}E(X,"onunload",function(){if($dp.dd)Q($dp.dd,"none")});function B(){V.$dp=V.$dp||{};obj={$:function($){return(typeof $=="string")?X[O].getElementById($):$},$D:function($,_){return this.$DV(this.$($).value,_)},$DV:function(_,$){if(_!=""){this.dt=$dp.cal.splitDate(_,$dp.cal.dateFmt);if($)for(var B in $)if(this.dt[B]===undefined)this.errMsg="invalid property:"+B;else{this.dt[B]+=$[B];if(B=="M"){var C=$["M"]>0?1:0,A=new Date(this.dt["y"],this.dt["M"],0).getDate();this.dt["d"]=Math.min(A+C,this.dt["d"])}}if(this.dt.refresh())return this.dt}return""},show:function(){var A=V[O].getElementsByTagName("div"),$=100000;for(var B=0;B<A.length;B++){var _=parseInt(A[B].style.zIndex);if(_>$)$=_}this.dd.style.zIndex=$+2;Q(this.dd,"block")},hide:function(){Q(this.dd,"none")},attachEvent:E};for(var $ in obj)V.$dp[$]=obj[$];$dp=V.$dp;$dp.dd=V[O].getElementById("_my97DP")}function E(A,$,_){if(T)A.attachEvent($,_);else if(_){var B=$.replace(/on/,"");_._ieEmuEventHandler=function($){return _($)};A.addEventListener(B,_._ieEmuEventHandler,false)}}function L(){var _,A,$=X[O][C]("script");for(var B=0;B<$.length;B++){_=$[B].src.substring(0,$[B].src.toLowerCase().indexOf("framework.js"));A=_.lastIndexOf("/");if(A>0)_=_.substring(0,A+1);if(_)break}return _}function F(F){var E,C;if(F.substring(0,1)!="/"&&F.indexOf("://")==-1){E=V.location.href;C=location.href;if(E.indexOf("?")>-1)E=E.substring(0,E.indexOf("?"));if(C.indexOf("?")>-1)C=C.substring(0,C.indexOf("?"));var G,I,$="",D="",A="",J,H,B="";for(J=0;J<Math.max(E.length,C.length);J++){G=E.charAt(J).toLowerCase();I=C.charAt(J).toLowerCase();if(G==I){if(G=="/")H=J}else{$=E.substring(H+1,E.length);$=$.substring(0,$.lastIndexOf("/"));D=C.substring(H+1,C.length);D=D.substring(0,D.lastIndexOf("/"));break}}if($!="")for(J=0;J<$.split("/").length;J++)B+="../";if(D!="")B+=D+"/";F=E.substring(0,E.lastIndexOf("/")+1)+B+F}_.$dpPath=F}function M(A,$,B){var D=X[O][C]("HEAD").item(0),_=X[O].createElement("link");if(D){_.href=A;_.rel="stylesheet";_.type="text/css";if($)_.title=$;if(B)_.charset=B;D.appendChild(_)}}function Z($,_){E($,"onload",_)}function G($){$=$||V;var A=0,_=0;while($!=V){var D=$.parent[O][C]("iframe");for(var F=0;F<D.length;F++){try{if(D[F].contentWindow==$){var E=W(D[F]);A+=E.left;_+=E.top;break}}catch(B){}}$=$.parent}return{"leftM":A,"topM":_}}function W(F){if(F.getBoundingClientRect)return F.getBoundingClientRect();else{var A={ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i},E=false,H=null,_=F.offsetTop,G=F.offsetLeft,D=F.offsetWidth,B=F.offsetHeight,C=F.offsetParent;if(C!=F)while(C){G+=C.offsetLeft;_+=C.offsetTop;if(S(C,"position").toLowerCase()=="fixed")E=true;else if(C.tagName.toLowerCase()=="body")H=C.ownerDocument.defaultView;C=C.offsetParent}C=F.parentNode;while(C.tagName&&!A.ROOT_TAG.test(C.tagName)){if(C.scrollTop||C.scrollLeft)if(!A.OP_SCROLL.test(Q(C)))if(!b||C.style.overflow!=="visible"){G-=C.scrollLeft;_-=C.scrollTop}C=C.parentNode}if(!E){var $=a(H);G-=$.left;_-=$.top}D+=G;B+=_;return{"left":G,"top":_,"right":D,"bottom":B}}}function N($){$=$||V;var B=$[O],A=($.innerWidth)?$.innerWidth:(B[J]&&B[J].clientWidth)?B[J].clientWidth:B.body.offsetWidth,_=($.innerHeight)?$.innerHeight:(B[J]&&B[J].clientHeight)?B[J].clientHeight:B.body.offsetHeight;return{"width":A,"height":_}}function a($){$=$||V;var B=$[O],A=B[J],_=B.body;B=(A&&A.scrollTop!=null&&(A.scrollTop>_.scrollTop||A.scrollLeft>_.scrollLeft))?A:_;return{"top":B.scrollTop,"left":B.scrollLeft}}function D($){var _=$?($.srcElement||$.target):null;try{if($dp.cal&&!$dp.eCont&&$dp.dd&&_!=$dp.el&&$dp.dd.style.display=="block")$dp.cal.close()}catch($){}}function Y(){$dp.status=2;H()}function H(){if($dp.flatCfgs.length>0){var $=$dp.flatCfgs.shift();$.el={innerHTML:""};$.autoPickDate=true;$.qsEnabled=false;K($)}}var R,$;function U(J,C){$dp.win=X;B();J=J||{};if(C){if(!G()){$=$||setInterval(function(){if(V[O].readyState=="complete")clearInterval($);U(null,true)},50);return}if($dp.status==0){$dp.status=1;K({el:{innerHTML:""}},true)}else return}else if(J.eCont){J.eCont=$dp.$(J.eCont);$dp.flatCfgs.push(J);if($dp.status==2)H()}else{if($dp.status==0){U(null,true);return}if($dp.status!=2)return;var F=D();if(F){$dp.srcEl=F.srcElement||F.target;F.cancelBubble=true}$dp.el=J.el=$dp.$(J.el||$dp.srcEl);if(!$dp.el||$dp.el["My97Mark"]===true||$dp.el.disabled||($dp.el==$dp.el&&Q($dp.dd)!="none"&&$dp.dd.style.left!="-1970px")){$dp.el["My97Mark"]=false;return}K(J);if(F&&$dp.el.nodeType==1&&$dp.el["My97Mark"]===undefined){$dp.el["My97Mark"]=false;var _,A;if(F.type=="focus"){_="onclick";A="onfocus"}else{_="onfocus";A="onclick"}E($dp.el,_,$dp.el[A])}}function G(){if(T&&V!=X&&V[O].readyState!="complete")return false;return true}function D(){if(I){func=D.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexOf("Event")>=0)return $;func=func.caller}return null}return event}}function S(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function Q(_,$){if(_)if($!=null)_.style.display=$;else return S(_,"display")}function K(H,$){for(var D in _)if(D.substring(0,1)!="$")$dp[D]=_[D];for(D in H)if($dp[D]!==undefined)$dp[D]=H[D];var E=$dp.el?$dp.el.nodeName:"INPUT";if($||$dp.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(E))$dp.elProp=E=="INPUT"?"value":"innerHTML";else return;if($dp.lang=="auto")$dp.lang=T?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase();if(!$dp.dd||$dp.eCont||($dp.lang&&$dp.realLang&&$dp.realLang.name!=$dp.lang&&$dp.getLangIndex&&$dp.getLangIndex($dp.lang)>=0)){if($dp.dd&&!$dp.eCont)V[O].body.removeChild($dp.dd);if(_.$dpPath=="")F(A);var B="<iframe style=\"width:1px;height:1px\" src=\""+_.$dpPath+"My97DatePicker.htm\" frameborder=\"0\" border=\"0\" scrolling=\"no\"></iframe>";if($dp.eCont){$dp.eCont.innerHTML=B;Z($dp.eCont.childNodes[0],Y)}else{$dp.dd=V[O].createElement("DIV");$dp.dd.id="_my97DP";$dp.dd.style.cssText="position:absolute";$dp.dd.innerHTML=B;V[O].body.appendChild($dp.dd);Z($dp.dd.childNodes[0],Y);if($)$dp.dd.style.left=$dp.dd.style.top="-1970px";else{$dp.show();C()}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont)C()}function C(){var F=$dp.position.left,B=$dp.position.top,C=$dp.el;if(C!=$dp.srcEl&&(Q(C)=="none"||C.type=="hidden"))C=$dp.srcEl;var H=W(C),$=G(X),D=N(V),A=a(V),E=$dp.dd.offsetHeight,_=$dp.dd.offsetWidth;if(isNaN(B)){if(B=="above"||(B!="under"&&(($.topM+H.bottom+E>D.height)&&($.topM+H.top-E>0))))B=A.top+$.topM+H.top-E-2;else B=A.top+$.topM+Math.min(H.bottom,D.height-E)+2}else B+=A.top+$.topM;if(isNaN(F))F=A.left+Math.min($.leftM+H.left,D.width-_-5)-(T?2:0);else F+=A.left+$.leftM;$dp.dd.style.top=B+"px";$dp.dd.style.left=F+"px"}}})();