var obj=null;var cur_div=null;var tempObj=null;var r=false;var move_div=null;function startDrag(){obj=event.srcElement;if(obj.tagName!="DIV"||obj.tagName=="IMG"){return;}if(!obj||(obj.id=="left_bt_div"||obj.id=="right_bt_div")){return;}if(!obj.parentNode||(obj.parentNode.id!="left_bt_div"&&obj.parentNode.id!="right_bt_div")){return;}obj.setCapture();var divs=obj.parentNode.getElementsByTagName("DIV");for(var i=0;i<divs.length;i++){if(obj!=divs[i]){divs[i].className="";}obj.className="cur_select";}if(obj.parentNode.id=="right_bt_div"){r=true;	}cur_div=obj;}function Drag(){if(!cur_div){return;}var tuo=document.getElementById("tuo_div");tuo.style.left=event.x+10;tuo.style.top=event.y+10;if(event.y<=10){cur_div=null;return;}var sibling=event.srcElement;if(!sibling){cur_div=null;return;}if((cur_div.id!=sibling.id&&cur_div.parentNode.id==sibling.parentNode.id&&sibling.parentNode.id!="div_body")||sibling.parentNode.tagName=="DIV"&&sibling.parentNode.id!="div_body"){var divs=sibling.parentNode.getElementsByTagName("DIV");for(var i=0;i<divs.length;i++){if(sibling!=divs[i]){divs[i].className="";}if(sibling.parentNode.id=="right_bt_div"||cur_div.parentNode.id==sibling.parentNode.id){sibling.className="div_top_boder";}}}cur_div.className="";move_div=sibling;tuo.style.display="block";}function stopDrag(){var srcObj=event.srcElement;tuo_div.style.display="none";if(srcObj.parentElement.id!="left_bt_div"&&srcObj.id=="div_body"&&srcObj.parentElement.id!="right_bt_div"&&srcObj.parentElement.tagName!="DIV"&&srcObj.id!="left_bt_div"&&srcObj.id!="right_bt_div"){tuo_div.style.display="none";obj=null
cur_div=null;tempObj=null;move_div=null;return;}tempObj=srcObj;srcObj=cur_div;if(!srcObj||!srcObj.parentElement){return;}var divs=tempObj.parentNode.childNodes;if(tempObj.id=="right_bt_div"||tempObj.id=="left_bt_div"){divs=tempObj.childNodes;	}for(var i=0;i<divs.length;i++){if(divs[i].className=="cur_select"){divs[i].className='';}}srcObj.className="cur_select";if(move_div)move_div.className="";if(tempObj.id!="left_bt_div"&&tempObj.id!="right_bt_div"){if(tempObj.parentNode.id=="left_bt_div"||tempObj.parentNode.id=="right_bt_div"){tempObj.insertAdjacentHTML("beforeBegin",srcObj.outerHTML);}}else if(tempObj.id=="left_bt_div"||tempObj.id=="right_bt_div"){tempObj.insertAdjacentHTML("beforeEnd",srcObj.outerHTML);	}save_buttons(0);if(r&&tempObj.parentNode.id!=srcObj.parentNode.id){srcObj.removeNode(true);return_position();r=false;}else if(tempObj.parentNode.id=="left_bt_div"||tempObj.parentNode.id=="right_bt_div"||tempObj.id=="left_bt_div"||tempObj.id=="right_bt_div"){srcObj.removeNode(true);}build_sel_bts();obj.releaseCapture();obj=null
cur_div=null;tempObj=null;move_div=null;}