rem: var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop + 
add: var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop + 
context: function Canvas_click(id){  var n,relation_name,selected = 0;  var a = new Array();  var Key0,Key1,Key2,Key3,Key;  Clear();  for (K in contr)    for (key in contr[K])      for (key2 in contr[K][key])        for (key3 in contr[K][key][key2])        {           if(!document.getElementById("check_vis_"+key2).checked ||              !document.getElementById("check_vis_"+contr[K][key][key2][key3][0]).checked) continue; // if hide          var x1_left  = document.getElementById(key2).offsetLeft + 1;//document.getElementById(key2+"."+key3).offsetLeft;          var x1_right = x1_left + document.getElementById(key2).offsetWidth;          var x2_left  = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft;//+document.getElementById(contr[K][key2][key3][0]+"."+contr[K][key2][key3][1]).offsetLeft          var x2_right = x2_left + document.getElementById(contr[K][key][key2][key3][0]).offsetWidth;          a[0] = Math.abs( x1_left - x2_left );  a[1] = Math.abs(x1_left  - x2_right);          a[2] = Math.abs( x1_right - x2_left ); a[3] = Math.abs(x1_right - x2_right);          n = s_left = s_right = 0;          for(var i=1;i<4;i++)            if(a[n]>a[i])n=i;          if(n==1){ x1 = x1_left-sm_s;  x2 = x2_right+sm_s; if(x1<x2)n=0;}          if(n==2){ x1 = x1_right+sm_s; x2 = x2_left-sm_s;  if(x1>x2)n=0;}          if(n==3){ x1 = x1_right+sm_s; x2 = x2_right+sm_s; s_right = 1; }          if(n==0){ x1 = x1_left-sm_s;  x2 = x2_left-sm_s;  s_left  = 1; }               var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2+"."+key3).offsetTop + height_field;          var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop +                    document.getElementById(contr[K][key][key2][key3][0]+"."+contr[K][key][key2][key3][1]).offsetTop + height_field;          if( !selected && Glob_X > x1-10 && Glob_X < x1+10 && Glob_Y > y1-7 && Glob_Y < y1+7)          {            Line0(x1-sm_x,y1-sm_y,x2-sm_x,y2-sm_y,"rgba(255,0,0,1)");             selected = 1; // Rect(x1-sm_x,y1-sm_y,10,10,"rgba(0,255,0,1)");             relation_name = key; //             Key0=contr[K][key][key2][key3][0]; Key1=contr[K][key][key2][key3][1];             Key2 = key2; Key3 = key3;            Key = K;          }           else              Line0(x1-sm_x,y1-sm_y,x2-sm_x,y2-sm_y,"rgba(0,100,150,1)");        }  if( selected )  // select relations  { //alert(Key0+' - '+Key1+' - '+Key2+' - '+Key3);    document.getElementById('layer_upd_relation').style.left = Glob_X - (document.getElementById('layer_upd_relation').offsetWidth>>1);    document.getElementById('layer_upd_relation').style.top  = Glob_Y - document.getElementById('layer_upd_relation').offsetHeight-10;    document.getElementById('layer_upd_relation').style.visibility = 'visible';    link_relation = 'T1='+Key0+'&F1='+Key1+'&T2='+Key2+'&F2='+Key3+'&K='+Key;  }}
meta: 8858	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8858/374abd5173baac3ed0f6912dfd48568b3eef8365/move.js/buggy/pmd/scripts/move.js