on_off = 0; 
x_bak = 0; 


    //정리 
    function move_onoff(chk,e,i){ 
		if(i==0){
    obj = document.getElementById('ttt'); 
		}else{
	obj = document.getElementById('z'); 
		}	
        if(chk == 1){ 
            
            x_margin =  e.clientX - obj.offsetLeft; 
            y_margin =  e.clientY - obj.offsetTop; 
        
        } 
        on_off = chk; 

    } 
    
    
    //이동 
    function moven(e){ 
    //obj = document.getElementById('ttt'); 
    if(on_off == 1){ 
                                  x_result =  e.clientX - x_margin; 
                                  y_result =  e.clientY  - y_margin; 
                                  if(x_result > 0){obj.style.left = x_result;} 
                                  if(y_result > 0){obj.style.top =  y_result;} 
            
                        }    
                } 
    
