var gctrl=false; document.onkeydown = function(e) { if (!e) { e = window.event; } var ns6=document.getElementById&&!document.all; var njobj=ns6? e.target : e.srcElement; if (njobj.id=="doll_name") return; var k = e.keyCode; if (k==17) gctrl=true; if ((k==37) || (k==100)) { //arrow left move_item("left"); return false; } if ((k==38) || (k==104)) { //arrow up move_item("top"); return false; } if ((k==39) || (k==102)) { //arrow right move_item("right"); return false; } if ((k==40) || (k==98)) { //arrow down move_item("bottom"); return false; } if (k==73){ //focus on items if (document.getElementById("maker_frame")){ if (typeof document.getElementById("maker_frame") != "undefined") document.getElementById("maker_frame").focus(); } } if (k==65){ if (typeof top.cur_focus_item != "undefined"){ top.move_top_sub(top.cur_focus_item,top.cur_focus_item); } } if ((k==66) || ((k==13) && (gctrl))){ if (top._onSubmit()){ top.document.form1.submit(); } } }; document.onkeyup = function(e) { if (!e) { e = window.event; } var k = e.keyCode; if (k==17) gctrl=false; }; function move_item(direction){ if ((typeof z == "undefined") || (z==-1)){ alert("No Items Selected. Please select the item with the mouse."); return false; } helpMsg="Did you know that you can hold <CTRL> key to move items faster..."; set_help(helpMsg,0); move_made=true; //record initial coordinates var z_id = z.id; var temp1=parseInt(z.style.left+0); var temp2=parseInt(z.style.top+0); //check the starting position and populate it if not set //rec starting position if it has not been recorded yet if (typeof im_start[z_id] == "undefined"){ //add image image object map to central map holder im_start[z_id]=new Object; im_start[z_id].z_id=z.id; im_start[z_id].z_x=temp1; im_start[z_id].z_y=temp2; } //calc new coord if (gctrl) { //15 pix move with control if (direction=="left") temp1-=15; if (direction=="right") temp1+=15; if (direction=="top") temp2-=15; if (direction=="bottom") temp2+=15; } else { //1 pix move if (direction=="left") temp1--; if (direction=="right") temp1++; if (direction=="top") temp2--; if (direction=="bottom") temp2++; } //make move z.style.left=temp1; z.style.top=temp2; //update cur item info show_item_info(z); //record current position if (typeof im_map[z_id] == "undefined") im_map[z_id]=new Object; im_map[z_id].z_id=z_id; im_map[z_id].z_x=temp1; im_map[z_id].z_y=temp2; }