overall_drag_left = 0; overall_drag_top = 0; max_drag_left = 0; max_drag_top = 0; div_wid = 150; div_hei = 150; PhotoEditor = new Object(); PhotoEditor.popup = function(img, wid, hei, id, cfg){ div_wid = wid; div_hei = hei; CmsJavPopup(photoeditorvar+'gallery_default/PhotoEditor?img='+img+'&wid='+wid+'&hei='+hei+'&fld_id='+id+'&cfg='+cfg, 'hei:700;wid:900;'); } PhotoEditor.mask = function(bg_wid, bg_hei){ max_drag_left = bg_wid - div_wid - 2; max_drag_top = bg_hei - div_hei - 2; siezimg = bg_wid; div = document.createElement("div"); div.style['position'] = 'relative'; div.style['top'] = '0px'; div.style['left'] = '0px'; div.style['width'] = div_wid+'px'; div.style['height'] = div_hei+'px'; div.style['background'] = '#000000'; div.style['border'] = 'solid #ffffff 1px'; div.style['opacity'] = '0.5'; div.style['cursor'] = 'move'; div.style['zIndex'] = '5'; div.id = 'dsakljgejahjygjelhae'; document.getElementById('dasljgkeahkehae').appendChild(div); div.onmousedown = function(e){ PhotoEditor.drag(e); } } PhotoEditor.IncreaseArea = function(){ if(max_drag_top > 10 && div_wid 60){ prop = div_hei / div_wid; max_drag_top += 10 * prop; max_drag_left += 10; document.getElementById('5436934kyjkrldkujlreure_wid').value = div_wid; document.getElementById('5436934kyjkrldkujlreure_hei').value = div_hei; div_wid -= 10; div_hei -= 10 * prop; document.getElementById('dsakljgejahjygjelhae').style['width'] = div_wid + 'px'; document.getElementById('dsakljgejahjygjelhae').style['height'] = div_hei + 'px'; document.getElementById('dsakljgejahjygjelhae').style['top'] = 0; document.getElementById('dsakljgejahjygjelhae').style['left'] = 0; document.getElementById('dealkjgeklajheq').value = 0; document.getElementById('rewywerkjqwhejyew').value = 0; } } PhotoEditor.drag = function(e){ obj = document.getElementById('dsakljgejahjygjelhae'); offX = (e) ? e.pageX : event.clientX; offY = (e) ? e.pageY : event.clientY; tmpX = parseInt(obj.style.left); tmpY = parseInt(obj.style.top); dragApproved = true; document.onmousemove = function(e) { if(dragApproved == true){ offX2 = (e) ? e.pageX : event.clientX; offY2 = (e) ? e.pageY : event.clientY; doDrag = 1; dragLeft = tmpX + offX2 - offX; dragTop = tmpY + offY2 - offY; dragLeft = (dragLeft < 0) ? 0 : dragLeft; dragLeft = (dragLeft > max_drag_left) ? max_drag_left : dragLeft; dragTop = (dragTop < 0) ? 0 : dragTop; dragTop = (dragTop > max_drag_top) ? max_drag_top : dragTop; document.getElementById('dealkjgeklajheq').value = dragLeft; document.getElementById('rewywerkjqwhejyew').value = dragTop; if(dragTop <= max_drag_top && dragTop >= 0){ obj.style['top'] = dragTop + 'px'; } if(dragLeft <= max_drag_left && dragLeft >= 0){ obj.style['left'] = dragLeft + 'px'; } } } document.onmouseup = function() { dragApproved = false; } } var photoeditorvar='go.live.php/';