clipBoard=Class.create();
clipBoard.prototype={initialize:function(){
this.val=null;
this.cutting=false;
this.copying=false;
},cut:function(v){
showStatus("cutting...");
this.val=v;
this.cutting=true;
this.copying=false;
},copy:function(v){
showStatus("copying...");
this.val=v;
this.copying=true;
this.cutting=false;
},_copy:function(_3){
if(window.clipboardData){
window.clipboardData.setData("Text",_3);
}else{
var _4="flashcopier";
if(!document.getElementById(_4)){
var _5=document.createElement("div");
_5.id=_4;
document.body.appendChild(_5);
}
document.getElementById(_4).innerHTML="";
var _6="<embed src=\"/common/js/_clipboard.swf\" FlashVars=\"clipboard="+escape(_3)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>";
document.getElementById(_4).innerHTML=_6;
}
},paste:function(_7){
showStatus("pasting...");
var _8=true;
try{
_7.setVal(this.val.getVal());
return;
}
catch(e){
}
try{
var _9=this.val.getCells();
var _a=toolkit.getRowColFromString(_7.getAddress());
var _b=this.val.topLeftCellId;
var _c=toolkit.getRowColFromString(_b);
var _d=this.val.bottomRightCellId;
var _e=toolkit.getRowColFromString(_d);
var _f=_e[0]-_c[0];
if(_f<0){
_f*=-1;
}
var _10=_e[1]-_c[1];
if(_10<0){
_10*=-1;
}
_a[0]+=_f;
_a[1]+=_10;
var _11=_7.getAddress()+":"+toolkit.formatLocation(_a);
var _12=uiWindowing.getActiveSheet();
var cr=new cellRange(_11,_12.sheetName);
_12.cellEditCursor.selectCellRange(cr);
var _14=cr.getCells();
if(_14.length==0){
_8=false;
}
for(t=0;t<_9.length;t++){
showStatus("pasting: "+_9[t].getVal());
if(_14[t]!=null){
_14[t].setVal(_9[t].getVal());
}
}
}
catch(e){
_8=false;
showStatus("paste failed: "+e.toString());
}
if(this.cutting&&_8){
try{
var _9=this.val.getCells();
for(t=0;t<_9.length;t++){
showStatus("removing: "+_9[t].getVal());
_9[t].setVal("");
}
}
catch(e){
showStatus("cut failed: "+e);
}
}
}};
var clipboard=new clipBoard();
