//
//	Copyright?2005. FarPoint Technologies.	All rights reserved.
//

if (typeof(FarPoint)=="undefined")FarPoint={};
FarPoint.System={};
FarPoint.System.CheckBrowserByName=function (browsername,version){
var f0=window.navigator.userAgent;
var f1=false;
var f2=(""+browsername).toLowerCase();
if ((f2.indexOf("ms")>=0)||(f2.indexOf("msie")>=0)||(f2.indexOf("ie")>=0))
f1=(f0.indexOf("MSIE")>=1);
else if ((f2.indexOf("safari")>=0)||(f2.indexOf("apple")>=0))
f1=(f0.indexOf("Safari")>=1);
else if ((f2.indexOf("ff")>=0)||(f2.indexOf("firefox")>=0))
f1=(f0.indexOf("Firefox")>=1);
return f1;
};
FarPoint.System.IsChild=function (parent,child){
if (child==null||parent==null)return false;
var f3=child.parentNode;
while (f3!=null){
if (f3==parent)return true;
f3=f3.parentNode;
}
return false;
};
FarPoint.System.FindElementById=function (ctl,id,ATTRI_ID){
if (ctl==null)return null;
var f4=ctl.getAttribute(ATTRI_ID);
if (f4==null)return null;
return document.getElementById(f4+id);
};
FarPoint.System.GetEvent=function (e){
if (e!=null)return e;
return window.event;
};
FarPoint.System.GetTarget=function (e){
e=FarPoint.System.GetEvent(e);
if (e.target==document&&e.currentTarget!=null)return e.currentTarget;
if (e.target!=null)return e.target;
return e.srcElement;
};
FarPoint.System.CancelDefault=function (e){
if (e.preventDefault!=null){
e.preventDefault();
e.stopPropagation();
}else {
e.cancelBubble=true;
e.returnValue=false;
}
return false;
};
FarPoint.System.GetMouseCoords=function (ev){
if (ev.pageX||ev.pageY){
return {x:ev.pageX,y:ev.pageY};
}
return {
x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,
y:ev.clientY+document.body.scrollTop-document.body.clientTop
};
};
FarPoint.System.GetOffsetTop=function (ctl){
var f5=0;
while (ctl){
if ((ctl.tagName!="HTML")&&(typeof(ctl.tagName)!="undefined"))
f5+=typeof(ctl.offsetTop)!="undefined"?ctl.offsetTop:0-typeof(ctl.scrollTop)!="undefined"?ctl.scrollTop:0;
if (typeof(ctl.clientTop)=="number")f5+=ctl.clientTop;
ctl=ctl.offsetParent;
}
return parseInt(f5);
};
FarPoint.System.GetOffsetLeft=function (ctl){
var f6=0;
while (ctl){
if ((ctl.tagName!="HTML")&&(typeof(ctl.tagName)!="undefined"))
f6+=typeof(ctl.offsetLeft)!="undefined"?ctl.offsetLeft:0-typeof(ctl.scrollLeft)!="undefined"?ctl.scrollLeft:0;
if (typeof(ctl.clientLeft)=="number")f6+=ctl.clientLeft;
ctl=ctl.offsetParent;
}
return parseInt(f6);
};
FarPoint.System.AttachEvent=function (target,event,handler,useCapture){
if (target==null||event==null||handler==null)return ;
if (target.addEventListener!=null){
target.addEventListener(event,handler,useCapture);
}else if (target.attachEvent!=null){
target.attachEvent("on"+event,handler);
}
};
FarPoint.System.DetachEvent=function (target,event,handler,useCapture){
if (target==null||event==null||handler==null)return ;
if (target.removeEventListener!=null){
target.removeEventListener(event,handler,useCapture);
}else if (target.detachEvent!=null){
target.detachEvent("on"+event,handler);
}
};
FarPoint.System.Track=function (msg){
if (!FarPoint.System.Config.Consts.$FLAG_ISDEBUG)return ;
if (document.getElementById("txtOutput")==null){
var f7=document.createElement("textarea");
f7.id="txtOutput";
f7.style.width="100%";
f7.style.height="100px";
if (f7.style.bottom!=null&&f7.style.right!=null){
f7.style.bottom="0px";
f7.style.right="0px";
}
f7.style.color="#00ff00";
f7.style.position="absolute";
f7.style.backgroundColor="black";
if (FarPoint.System.CheckBrowserByName("IE")){
window.onload=function (){
if (document.all&&document.body.readyState=="complete"){
document.body.appendChild(f7);
}
};
}else {
document.body.appendChild(f7);
}
}
var f8=document.getElementById("txtOutput");
if (f8!=null){
f8.value="&nbsp;&nbsp;"+msg+"\r\n"+f8.value;
}
};
FarPoint.System.Config={};
FarPoint.System.Config.Consts={};
var f9=FarPoint.System.Config.Consts;
f9.$FLAG_ISDEBUG=false;
f9.$LEFT=37;
f9.$RIGHT=39;
f9.$UP=38;
f9.$DOWN=40;
f9.$ENTER=13;
f9.$CANCEL=27;
f9.$PageUp=33;
f9.$PageDown=34;
f9.$Home=36;
f9.$End=35;
f9.$Tab=9;
FarPoint.System.WebControl={};
FarPoint.System.WebControl.MultiColumnComboBoxCellTypeUtilitis={};
var g0=FarPoint.System.WebControl.MultiColumnComboBoxCellTypeUtilitis;
var g1=g0.Consts={
$ATTRI_MULTICOMBO_PART_TYPE:"MccbPartType",
$ATTRI_LIST_ALIGNMENT:"MccbListAlignment",
$ATTRI_LIST_OFFSET:"MccbListOffset",
$ATTRI_LIST_WIDTH:"MccbListWidth",
$ATTRI_LIST_HEIGHT:"MccbListHEIGHT",
$ATTRI_COLUMN_EDIT:"MccbColumnEdit",
$ATTRI_COLUMN_DATA:"MccbColumnData",
$ATTRI_ID:"MccbId",
$ATTRI_LIST_MIN_HEIGHT:"MccbListMinHeight",
$ATTRI_LIST_MIN_WIDTH:"MccbListMinWidth",
$TYPE_DROPDOWNBUTTON:"DropDownButton",
$ID_BUTTON_OUTSIDE:"_DropDownButtonOutside",
$ID_BUTTON_INSIDE:"_DropDownButtonInside",
$ID_INPUT:"_Input",
$ID_CONTAINER:"_Container",
$ID_CONTAINER_DIV:"_ContainerDiv",
$ID_SPREAD:"_FpSpread",
$ID_STATUS_RESIZE:"_ResizeButton",
$OBJECT_SUFFIX:"_Obj"
};
g0.CloseAll=function (){
var g2=document.body.lastChild;
if (g2!=null&&g2.tagName!=null&&g2.tagName=="DIV"){
if (g2.id!=null&&g2.close&&g2.id.match(new RegExp(g1.$ID_CONTAINER_DIV+"$"))){
g2.close();
}
}
};
FarPoint.System.WebControl.MultiColumnComboBoxCellType=function (mc){
if (mc==null)return null;
var g3=true;
var g4=null;
var g5=false;
var g6=false;
var g7=-1;
var g8=0;
var g9=false;
var h0=0;
var h1=0;
var h2=50;
var h3=200;
var h4=false;
var h5=this;
this.Init=function (){
if (g3){
this.InitSpread();
this.setController();
var h6=0;
while (h6<12){
if (h6==0||h6==1||h6==3){
h6++;
continue ;
}
if (g4[h6]!=null&&g4[h6].event=="SelectionChanged"){
if (FarPoint.System.CheckBrowserByName("IE")){
this.getFpSpread().onSelectionChanged=g4[h6].handler;
h6++;
continue ;
}
}
this.SetHandler(g4,h6,0);
h6++;
}
this.Value=null;
this.Text=null;
var h7=this.getControl();
var h8=FarPoint.System.FindElementById(h7,g1.$ID_BUTTON_INSIDE,g1.$ATTRI_ID);
if (h7!=null&&h8!=null){
if (h7.offsetHeight-5>0)
h8.style.height=h7.offsetHeight-5;
}
this.setListWidth(parseInt(this.getControl().getAttribute(g1.$ATTRI_LIST_WIDTH)));
this.setListHeight(parseInt(this.getControl().getAttribute(g1.$ATTRI_LIST_HEIGHT)));
h7.Init=true;
g3=false;
}
}
this.Dispose=function (){
var h9=this.getController();
if (!h9)return ;
var h6=0;
while (g4[h6]!=null){
if (g4[h6].event=="SelectionChanged"){
if (FarPoint.System.CheckBrowserByName("IE")){
this.getFpSpread().onSelectionChanged=null;
h6++;
continue ;
}
}
this.SetHandler(g4,h6,1);
h6++;
}
}
this.getDragOffsetX=function (){
return h0;
}
this.setDragOffsetX=function (value){
h0=value;
}
this.getDragOffsetY=function (){
return h1;
}
this.setDragOffsetY=function (value){
h1=value;
}
this.getStatusBarHeight=function (){
return 13;
}
this.getIsDrag=function (){
return g9;
}
this.setIsDrag=function (value){
var i0=12;
g9=value;
if (g9){
this.SetHandler(g4,i0,0);
}else {
this.SetHandler(g4,i0,1);
}
}
this.getHostSpread=function (){
var i1=this.getFpSpread();
if (i1==null)return null;
var i2=FarPoint.System.CheckBrowserByName("IE")?i1.hostspread:i1.getAttribute("hostspread");
return document.getElementById(i2);
}
this.getControl=function (){
return mc;
}
this.getFpSpread=function (){
var i3=this.getContainer();
if (i3==null)return null;
return i3.getElementsByTagName("div")[0];
}
this.getContainer=function (){
var h7=this.getControl();
if (h7==null)return null;
return FarPoint.System.FindElementById(h7,g1.$ID_CONTAINER,g1.$ATTRI_ID);
}
this.getContainerDiv=function (){
var h7=this.getControl();
if (h7==null)return null;
return FarPoint.System.FindElementById(h7,g1.$ID_CONTAINER_DIV,g1.$ATTRI_ID);
}
this.getInputControl=function (){
var h7=this.getControl();
if (h7==null)return null;
return FarPoint.System.FindElementById(h7,g1.$ID_INPUT,g1.$ATTRI_ID);
}
this.getResizeButton=function (){
var h7=this.getControl();
if (h7==null)return null;
return FarPoint.System.FindElementById(h7,g1.$ID_STATUS_RESIZE,g1.$ATTRI_ID);
}
this.getController=function (){
return g4;
}
this.setController=function (){
if (g4==null){
g4={
1:{target:document,event:"mousedown",handler:function (event){h5.MouseDownOutside(event)},useCapture:false},
3:{target:document,event:"mouseup",handler:function (event){h5.MouseUpOutside(event)},useCapture:false},
12:{target:document,event:"mousemove",handler:function (event){h5.MouseMove(event)},useCapture:false},
4:{target:this.getControl(),event:"mousedown",handler:function (event){h5.MouseDown(event)},useCapture:false},
7:{target:this.getInputControl(),event:"keydown",handler:function (event){h5.OnInputKeyDown(event)},useCapture:FarPoint.System.CheckBrowserByName("IE")?false:true},
6:{target:this.getContainer(),event:"mousedown",handler:function (event){h5.CancelEvent(event)},useCapture:false},
9:{target:this.getFpSpread(),event:"SelectionChanged",handler:function (event){h5.OnSpreadSelectionChanged(event)},useCapture:false},
8:{target:this.getResizeButton(),event:"mousedown",handler:function (event){h5.ResizeButtonMouseDown(event)},useCapture:false}
};
if (FarPoint.System.CheckBrowserByName("IE")?typeof(this.getFpSpread().EnableClientScript)=="undefined":this.getFpSpread().getAttribute("EnableClientScript")==null){
g4[13]={target:FarPoint.System.CheckBrowserByName("IE")?this.getHostSpread():the_fpSpread.GetViewport(this.getHostSpread()).parentNode,event:"scroll",handler:function (event){h5.MccbctScroll(event)},useCapture:false};
}
}
}
this.getIsDrop=function (){
return g5;
}
this.setIsDrop=function (value){
g5=value;
}
this.getIsDroping=function (){
return g6;
}
this.setIsDroping=function (value){
g6=value;
}
this.getListAlignment=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_LIST_ALIGNMENT);
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.getListOffset=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_LIST_OFFSET);
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.getListWidth=function (){
return h2;
}
this.setListWidth=function (value){
if ((value<this.getListMinWidth())&&(value!=-1))
h2=this.getListMinWidth();
else {
if (!FarPoint.System.CheckBrowserByName("IE"))
if (value>2000)
value=2000;
h2=value;
}
}
this.getListHeight=function (){
return h3;
}
this.setListHeight=function (value){
if (value<this.getListMinHeight())
h3=this.getListMinHeight();
else 
h3=value;
}
this.getListMinWidth=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_LIST_MIN_WIDTH);
return Math.min(Math.abs(parseInt(h6)),32767);
}catch (exception ){
return 50;
}
}
this.getListMinHeight=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_LIST_MIN_HEIGHT);
return Math.min(Math.abs(parseInt(h6)),32767);
}catch (exception ){
return 50;
}
}
this.getEditColumnIndex=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_COLUMN_EDIT);
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.setSelectedIndex=function (value){
g7=value;
}
this.getSelectedIndex=function (){
if (g7!=-1){
var i4=this.getFpSpread();
var i5=FarPoint.System.CheckBrowserByName("IE")?parseInt(i4.ActiveRow):parseInt(i4.GetActiveRow());
if (i4){
if (i5>=0){
this.setSelectedIndex(i5);
}
}
}
return g7;
}
this.setActiveColumnIndex=function (value){
g8=value;
}
this.getActiveColumnIndex=function (){
return g8;
}
this.getDataColumnIndex=function (){
try {
var h6=this.getControl().getAttribute(g1.$ATTRI_COLUMN_DATA);
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.getWorkEnvironment=function (){
try {
var h6=this.getControl().getAttribute("environment");
if (h6==null)
h6=-1;
return parseInt(h6);
}catch (exception ){
return -1;
}
}
this.FocusForEdit=function (){
var h7=this.getControl();
if (h7==null)return ;
if (h7.parentNode==null||typeof(h7.parentNode.tagName)=="undefined")return ;
if (h7.parentNode.tagName!="TD")return ;
if (h7.parentNode.getAttribute("FpCellType")!="MultiColumnComboBoxCellType")return ;
var i6=this.getInputControl();
if (i6!=null){
try {
i6.focus();
i6.select();
}catch (exception ){}
this.SetHandler(g4,7,1);
this.SetHandler(g4,7,0);
}
}
this.LockFocus=function (event){
var i7=this.getInputControl();
if (i7!=null&&typeof(i7.focus)!="undefined")
if (i7!=null){
try {
i7.focus();
i7.select();
}catch (exception ){}
}
}
this.MouseDown=function (event){
if (!FarPoint.System.CheckBrowserByName("IE")&&this.getControl().getAttribute("disabled")=="disabled")return FarPoint.System.CancelDefault(event);
if (!this.getIsDrop()&&event.button!=(FarPoint.System.CheckBrowserByName("IE")?1:0))return ;
var i8=FarPoint.System.GetTarget(event);
if (i8==null||i8.getAttribute(g1.$ATTRI_MULTICOMBO_PART_TYPE)!=g1.$TYPE_DROPDOWNBUTTON)return false;
this.setIsDroping(true);
var i9=this;
setTimeout(function (){i9.DropDown();},0);
}
this.DropDown=function (){
this.ShowHideContainer(!this.getIsDrop());
}
this.OnInputKeyDown=function (event){
if (event.altKey&&event.keyCode==f9.$DOWN){
this.ShowHideContainer(!this.getIsDrop());
FarPoint.System.CancelDefault(event);
return false;
}
switch (event.keyCode){
case f9.$UP:
if (this.getIsDrop()){
this.ChangeSelectedIndex(-1);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$LEFT:
if (this.getIsDrop()){
this.ChangedActiveColumnIndex(true);
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$DOWN:
if (this.getIsDrop()){
this.ChangeSelectedIndex(1);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$RIGHT:
if (this.getIsDrop()){
this.ChangedActiveColumnIndex(false);
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$ENTER:
if (this.getIsDrop()){
this.ShowHideContainer(false);
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("safari")&&this.getFpSpread().getAttribute("EnableClientScript")=="0"){
return FarPoint.System.CancelDefault(event);
}
break ;
case f9.$CANCEL:
if (this.getIsDrop()){
this.ShowHideContainer(false);
}
FarPoint.System.CancelDefault(event);
break ;
case f9.$PageUp:
if (this.getIsDrop()){
this.ChangeSelectedIndex(null,1);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$PageDown:
if (this.getIsDrop()){
this.ChangeSelectedIndex(null,2);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$Home:
if (this.getIsDrop()){
this.ChangeSelectedIndex(null,3);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$End:
if (this.getIsDrop()){
this.ChangeSelectedIndex(null,4);
var j0=this.getFpSpread();
if (!FarPoint.System.CheckBrowserByName("IE")){
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),this.getActiveColumnIndex());
}else {
j0.ScrollTo(j0.ActiveRow,this.getActiveColumnIndex());
}
if (FarPoint.System.CheckBrowserByName("IE"))
FarPoint.System.CancelDefault(event);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
}
break ;
case f9.$Tab:
if (this.getIsDrop()){
this.ShowHideContainer(false);
if (!FarPoint.System.CheckBrowserByName("IE")){
FarPoint.System.CancelDefault(event);
if (FarPoint.System.CheckBrowserByName("FF")){
var j1=this.getControl().getElementsByTagName("input")[1];
if (j1!=null){
var j2=document.createEvent('KeyboardEvent');
j2.initKeyEvent('keydown',true,true,null,null,null,null,null,9,null);
setTimeout(function (){j1.dispatchEvent(j2)},0);
}
}
}
}
break ;
}
}
this.OnSpreadSelectionChanged=function (event){
if (this.getWorkEnvironment()==0)
return ;
var i4=this.getFpSpread();
if (i4==null)return ;
if (!FarPoint.System.CheckBrowserByName("IE")){
this.setSelectedIndex(i4.GetActiveRow());
}else {
this.setSelectedIndex(i4.ActiveRow);
}
var i6=this.getInputControl();
if (i6==null)return ;
if (this.getSelectedIndex()>=0&&this.getEditColumnIndex()>=0&&this.getDataColumnIndex()>=0){
i6.value=i4.GetValue(this.getSelectedIndex(),this.getEditColumnIndex());
this.Text=i6.value;
if (this.GetUseValue()==1)
this.Value=i4.GetValue(this.getSelectedIndex(),this.getDataColumnIndex());
else 
this.Value=i6.value;
i6.setAttribute("DataValue",i4.GetValue(this.getSelectedIndex(),this.getDataColumnIndex()));
if (event!=null){
i6.select();
}
}
FarPoint.System.GetEvent(event).cancelBubble=true;
}
this.CancelEvent=function (event){
if (this.getIsDrop()){
this.LockFocus(event);
var j3=this;
setTimeout(function (){j3.LockFocus(event);},0);
}
return FarPoint.System.CancelDefault(event);
}
this.MouseDownOutside=function (event){
if (this.getIsDrag())
this.setIsDrag(false);
var j4=this.getContainerDiv();
var j5=this.getControl();
var j0=this.getFpSpread();
var j6=document.getElementById(j0.id+"_viewport");
var i8=FarPoint.System.GetTarget(event);
if (!FarPoint.System.IsChild(j4,i8)&&!FarPoint.System.IsChild(j5,i8)){
this.setIsDroping(false);
if (this.getIsDrop())
this.ShowHideContainer(false);
}
var j3=this;
setTimeout(function (){j3.LockFocus(event);},0);
}
this.MouseUpOutside=function (event){
var i8=FarPoint.System.GetTarget(event);
var j5=this.getControl();
if (this.getIsDroping()&&FarPoint.System.IsChild(j5,i8)){
this.setIsDroping(false);
return ;
}
if (this.getIsDrop()==false)return ;
if (this.getIsDrag()){
this.setIsDrag(false);
return ;
}
var j4=this.getContainerDiv();
var j0=this.getFpSpread();
var j6=document.getElementById(j0.id+"_viewport");
if (FarPoint.System.IsChild(j6,i8)||!FarPoint.System.IsChild(j4,i8)){
this.ShowHideContainer(false);
}
var j3=this;
setTimeout(function (){j3.LockFocus(event);},0);
}
this.ResizeButtonMouseDown=function (event){
this.LockFocus(event);
if (event.button!=(FarPoint.System.CheckBrowserByName("IE")?1:0))return ;
var i3=this.getContainer();
if (i3==null)return ;
var j7=FarPoint.System.GetMouseCoords(event);
this.setDragOffsetX(parseInt(i3.offsetLeft+i3.offsetWidth)-j7.x);
this.setDragOffsetY(parseInt(i3.offsetTop+i3.offsetHeight)-j7.y);
this.setIsDrag(true);
if (event.preventDefault)event.preventDefault();
event.returnValue=false;
event.cancelBubble=true;
return false;
}
this.MouseMove=function (event){
if (!this.getIsDrag())return ;
var i3=this.getContainer();
if (i3==null)return ;
var j8=this.getContainerDiv();
if (j8==null)return ;
var j7=FarPoint.System.GetMouseCoords(event);
var j9=j7.x-parseInt(i3.offsetLeft)+this.getDragOffsetX();
var k0=j7.y-parseInt(i3.offsetTop)+this.getDragOffsetY()-5;
if (j9>this.getListMinWidth()&&Math.abs(j9-i3.offsetWidth)>5){
j8.style.width=j9+"px";
i3.style.width=j9+"px";
this.setListWidth(j9+5);
}
if (k0>this.getListMinHeight()&&Math.abs(k0-i3.offsetHeight)>20){
var j0=this.getFpSpread();
if (j0!=null)
j0.style.height=""+(k0-this.getStatusBarHeight())+"px";
j8.style.height=(k0+5)+"px";
i3.style.height=k0+"px";
this.setListHeight(k0);
}
if (!FarPoint.System.CheckBrowserByName("IE")){
var k1=this.getFpSpread();
the_fpSpread.SizeSpread(k1)
the_fpSpread.Refresh(k1);
}
event.cancelBubble=true;
return false;
}
this.MccbctScroll=function (event){
var h7=this.getControl();
if (h7==null)return ;
var i3=this.getContainer();
if (i3==null)return ;
var j8=this.getContainerDiv();
if (j8==null)return ;
if (FarPoint.System.CheckBrowserByName("safari")&&h7.offsetHeight==0){
j8.style.top=(FarPoint.System.GetOffsetTop(h7)+25)-(this.GetSpreadClientData(this.getHostSpread(),1))+"px";
}else {
var k2=null;
if (FarPoint.System.CheckBrowserByName("IE")?typeof(this.getFpSpread().EnableClientScript)=="undefined":this.getFpSpread().getAttribute("EnableClientScript")==null)
k2=FarPoint.System.CheckBrowserByName("IE")?document.getElementById(this.getHostSpread().id+"_view"):document.getElementById(this.getHostSpread().id+"_viewport").parentNode;
var k3=FarPoint.System.IsChild(k2,h7)?(this.GetSpreadClientData(this.getHostSpread(),1)):0;
j8.style.top=(FarPoint.System.GetOffsetTop(h7)+h7.offsetHeight+2)-k3+"px";
}
}
this.GetAdjustorForScroll=function (){
var k4=0;var k5=0;
var f4=new String(this.getControl().getAttribute(g1.$ATTRI_ID));
k4=parseInt(f4.split(new RegExp("_"))[1]);
k5=parseInt(f4.split(new RegExp("_"))[2]);
var k6=f4.split(new RegExp("_"))[3];
var k7=this.getHostSpread();
var k8=FarPoint.System.CheckBrowserByName("IE");
var k9=FarPoint.System.CheckBrowserByName("safari");
var l0={left:0,top:0};
if (this.getFpSpread().getAttribute("EnableClientScript")=="0")
return l0;
if (k9){
if (k6!="sc"&&k6!="rh")
l0.left=this.GetSpreadClientData(k7,0);
if (k6!="ch"&&k6!="cf"&&k6!="sc")
l0.top=this.GetSpreadClientData(k7,1);
return l0;
}
var l1=k8?k7.getViewport():the_fpSpread.GetViewport(k7);
var l2=k8?k7.getViewport0():the_fpSpread.GetViewport0(k7);
var l3=k8?k7.getViewport1():the_fpSpread.GetViewport1(k7);
var l4=k8?k7.getViewport2():the_fpSpread.GetViewport2(k7);
var l5=0;var l6=0;
l5=k8?(l3!=null?l3.rows.length:0):k7.frzRows;
if (k8){
if (l2!=null){
var l7=l2.getElementsByTagName("COLGROUP");
if (l7!=null&&l7.length>0)
l6=l7[0].childNodes.length;
}else if (l4!=null){
var l7=l4.getElementsByTagName("COLGROUP");
if (l7!=null&&l7.length>0)
l6=l7[0].childNodes.length;
}
}else {
l6=k7.frzCols;
}
if ((k6!="ch"&&k6!="cf"&&k6!="sc")&&((l5>0&&(k4+1)>l5)||l5==0))
l0.top=this.GetSpreadClientData(k7,1);
if ((k6!="sc"&&k6!="rh")&&((l6>0&&(k5+1)>l6)||l6==0))
l0.left=this.GetSpreadClientData(k7,0);
return l0;
}
this.InitSpread=function (){
if (!FarPoint.System.CheckBrowserByName("IE")&&typeof(the_fpSpread)!="undefined"){
var j0=this.getFpSpread();
the_fpSpread.Init(j0);
the_fpSpread.SizeAll(j0);
j0.dispose=function (){
the_fpSpread.Dispose(j0);
}
}
}
this.IsContained=function (child){
return FarPoint.System.IsChild(this.getControl(),child)||FarPoint.System.IsChild(this.getContainer(),child);
}
this.GetActivePositonInDomTree=function (element){
if (element==null)return false;
while (element!=null&&element!=document.body){
if (element.tagName=="TR"&&element.getAttribute("FpSpread")!=null)return element.getAttribute("FpSpread");
element=element.parentNode;
}
return "";
}
this.GetSpreadClientData=function (j0,whichData){
if (this.getFpSpread().getAttribute("EnableClientScript")=="0")return 0;
var l8="";
var l9=0;
var m0=null;
if (FarPoint.System.CheckBrowserByName("ie")){
if (j0.GetParentSpread()!=null)return ;
m0=document.getElementById(j0.id+"_XMLDATA");
switch (whichData){
case 0:
l8="/root/scrollLeft";
break ;
case 1:
l8="/root/scrollTop";
break ;
}
var l9=m0.documentElement.selectSingleNode(l8);
if (l9!=null&&l9.text!=""){
l9=parseInt(l9.text);
}
}else {
if (the_fpSpread.GetParentSpread(j0)!=null)return ;
m0=the_fpSpread.GetData(j0);
var m1=m0.getElementsByTagName("root")[0];
switch (whichData){
case 0:
l8="scrollLeft";
break ;
case 1:
l8="scrollTop";
break ;
}
var m2=m1.getElementsByTagName(l8)[0];
if (m2!=null&&m2.innerHTML!=""){
l9=parseInt(m2.innerHTML);
}
}
if (isNaN(l9))l9=0;
return l9;
}
this.SetHandler=function (g4,index,method){
if (isNaN(index)||index<0)return ;
if ((typeof(g4[index])=="undefined")||(g4[index]==null))return ;
switch (method){
case 0:
FarPoint.System.AttachEvent(g4[index].target,g4[index].event,g4[index].handler,g4[index].useCapture);
break ;
case 1:
FarPoint.System.DetachEvent(g4[index].target,g4[index].event,g4[index].handler,g4[index].useCapture);
break ;
}
}
this.ChangeSelectedIndex=function (step,caseId){
var m3=0;
if (typeof(caseId)!="undefined")
m3=caseId;
var j0=this.getFpSpread();
if (!j0)return ;
var m4=j0.GetRowCount();
if (m4<=0)return ;
var m5=this.getSelectedIndex();
var m6=this.getActiveColumnIndex();
if (m6<0)m6=0;
switch (m3){
case 0:
m5+=step;
if ((m5<0)||(m5>=m4))return ;
break ;
case 1:
m5-=5;
m5=Math.max(m5,0);
break ;
case 2:
m5+=5;
m5=Math.min(m5,m4-1);
break ;
case 3:
m5=0;
break ;
case 4:
m5=m4-1;
break ;
}
this.setSelectedIndex(m5);
j0.SetActiveCell(m5,m6);
}
this.ChangedActiveColumnIndex=function (IsLeft){
var j0=this.getFpSpread();
if (!j0)return ;
var m7=j0.GetColCount();
if (m7<=0)return ;
var m8=FarPoint.System.CheckBrowserByName("IE")?j0.ActiveRow:j0.GetActiveRow();
var m9=this.getActiveColumnIndex();
if (isNaN(m9))m9=0;
m9=IsLeft?m9-1:m9+1;
if ((m9<0)||(m9>=m7)){
m9=Math.max(m9,0);
m9=Math.min(m9,m7-1);
this.setActiveColumnIndex(m9);
return ;
}
if (FarPoint.System.CheckBrowserByName("IE"))
j0.ScrollTo(m8,m9);
else 
the_fpSpread.ScrollTo(j0,m8,m9);
this.setActiveColumnIndex(m9);
}
this.ShowHideContainer=function (show){
var h7=this.getControl();
if (h7==null)return ;
var i3=this.getContainer();
if (i3==null)return ;
var j8=this.getContainerDiv();
if (j8==null)return ;
if (!FarPoint.System.CheckBrowserByName("IE")){
j8.style.display=(show?'block':'none');
j8.style.visibility=(show?'visible':'hidden');
}
if (show){
j8.style.zIndex=999;
i3.style.height=this.getListHeight()+"px";
j8.style.height=(this.getListHeight()+5)+"px";
var l0=this.GetAdjustorForScroll();
var k1=this.getHostSpread();
var n0=k1.offsetParent;
l0.top+=n0.scrollTop;
l0.left+=n0.scrollLeft;
if (FarPoint.System.CheckBrowserByName("safari")&&h7.offsetHeight==0){
j8.style.top=(FarPoint.System.GetOffsetTop(h7)+25)-l0.top+"px";
}else {
j8.style.top=(FarPoint.System.GetOffsetTop(h7)+h7.offsetHeight)-l0.top+"px";
}
var n1=FarPoint.System.GetOffsetLeft(h7);
if (this.getListAlignment()==0)
n1+=this.getListOffset();
else {
var n2=0;
if (this.getListWidth()!=-1)
n2=(this.getListWidth()-h7.parentNode.offsetWidth);
n1-=(this.getListOffset()+n2);
}
j8.style.left=n1-l0.left+"px";
var n3=this.getListWidth();
if (n3<0)n3=Math.max(this.getListMinWidth(),h7.parentNode.offsetWidth);
i3.style.width=(n3+5)+"px";
j8.style.width=(n3+5)+"px";
var n4=this.findContainer();
var n5=this.getWorkEnvironment();
if (n4!=null&&n5==0){
n4.appendChild(j8);
}else {
document.body.appendChild(j8);
}
var n6=this;
j8.close=function (){
n6.ShowHideContainer(false);
};
this.SetHandler(g4,1,0);
this.SetHandler(g4,3,0);
this.SetHandler(g4,13,0);
}else {
j8.style.zIndex=0;
j8.close=null;
h7.appendChild(j8);
j8.style.top=-10000;
j8.style.left=-10000;
this.SetHandler(g4,1,1);
this.SetHandler(g4,3,1);
this.SetHandler(g4,13,1);
}
var j0=this.getFpSpread();
if (show&&j0!=null){
if (document.documentMode)
{
j0.style.backgroundColor="white";
j0.style.position="relative";
}
j0.style.height=(parseInt(i3.style.height)-this.getStatusBarHeight())+"px";
}
this.setIsDrop(show);
if (!FarPoint.System.CheckBrowserByName("IE")){
if (j0!=null){
var d3=the_fpSpread.GetColHeader(j0);
if (d3!=null&&FarPoint.System.CheckBrowserByName("Firefox")){
d3.parentNode.style.height=""+(d3.offsetHeight-parseInt(d3.cellSpacing))+"px";
}
the_fpSpread.SizeAll(j0);
the_fpSpread.SizeAll(j0);
if (show){
if (this.getFpSpread().getAttribute("EnableClientScript")!="0"){
the_fpSpread.SetPageActiveSpread(j0);
the_fpSpread.SetActiveSpreadID(j0,j0.id,j0.id,false);
}
var m5=this.getSelectedIndex();
j0.SetActiveCell(m5,0);
this.setActiveColumnIndex(0);
if (j0.GetActiveRow()>-1)
the_fpSpread.ScrollTo(j0,j0.GetActiveRow(),0);
}else {
var n7=this.getHostSpread();
if (this.getFpSpread().getAttribute("EnableClientScript")!="0"){
the_fpSpread.SetPageActiveSpread(n7);
the_fpSpread.SetActiveSpreadID(n7,n7.id,n7.id,false);
}
}
}
}else {
if (show){
var m5=this.getSelectedIndex();
j0.SetActiveCell(m5,0);
this.setActiveColumnIndex(0);
if (j0.ActiveRow>-1)
j0.ScrollTo(j0.ActiveRow,0);
}
}
if (show){
var i9=this;
setTimeout(function (){i9.AnimShow(i3);},30);
}
var i6=this.getInputControl();
if (i6!=null){
try {
i6.focus();
i6.select();
if (i6.value.length>0&&this.getSelectedIndex()==-1){
this.SetText(i6.value);
}
}catch (exception ){}
}
if (FarPoint.System.CheckBrowserByName("IE")){
j8.style.display=(show?'block':'none');
j8.style.visibility=(show?'visible':'hidden');
if (document.documentMode)
{
j0.sizeSpread();
}
}
}
this.findContainer=function (){
var j0=this.getFpSpread();
var h7=j0;
var n4;
if (j0!=null){
while (h7!=null&&(h7.tagName!="FORM")&&(typeof(h7.tagName)!="undefined")){
n4=h7;
h7=h7.parentElement;
}
}
return n4;
}
this.AnimShow=function (i3){
var n8=i3.offsetTop;
if (n8>=0)return ;
var n9=n8<-5?n8*0.25:0;
i3.style.top=n9+"px";
var i9=this;
setTimeout(function (){i9.AnimShow(i3);},30);
}
this.SetText=function (text,whichColumn){
var j0=this.getFpSpread();
if (j0==null)return ;
var o0=this.getEditColumnIndex();
if (whichColumn!=null&&whichColumn==0)
o0=this.getDataColumnIndex();
var i6=this.getInputControl();
if (text==null){
if (i6!=null){
i6.value="";
this.setSelectedIndex(-1);
}
j0.SetActiveCell(-1,-1);
return ;
}
var o1=text.match(new RegExp("^\\s*(\\S+(\\s+\\S+)*)\\s*$"));
text=(o1==null)?"":o1[1];
if ((text.length==1&&text.charCodeAt(0)==160)||(text=="")||(text.length<=0)){
if (i6!=null){
i6.value="";
this.setSelectedIndex(-1);
}
j0.SetActiveCell(-1,-1);
return ;
}
if ((!FarPoint.System.CheckBrowserByName("IE"))&&typeof(j0.GetRowCount)=="undefined"){
var h6=0,m5=-1;
while ((h6<the_fpSpread.spreads.length)&&(m5==-1)){
if (the_fpSpread.spreads[h6].id==j0.id)m5=h6;
h6++;
}
the_fpSpread.spreads.splice(m5,1);
the_fpSpread.Init(document.getElementById(j0.id));
document.getElementById(j0.id).dispose=function (){
the_fpSpread.Dispose(document.getElementById(j0.id));
}
}
if (!FarPoint.System.CheckBrowserByName("IE")){
text=text.replace(new RegExp("\xA0","g"),String.fromCharCode(32));
}
var o2=j0.GetRowCount();
var m5=0;
for (;m5<o2;m5++){
try {
var o3=j0.GetValue(m5,o0);
if (o3==(FarPoint.System.CheckBrowserByName("IE")?text:the_fpSpread.Trim(text))){
var o4=this.getEditColumnIndex();
var o5=this.getDataColumnIndex();
this.Text=(whichColumn==0?j0.GetValue(m5,o4):o3);
this.Value=(whichColumn==0?o3:j0.GetValue(m5,o5));
j0.SetActiveCell(m5,o0);
break ;
}
}catch (exception ){
return ;
}
}
}
this.GetUseValue=function (){
try {
var h6=this.getControl().getAttribute("UseValue");
if (h6==null)
h6=0;
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.GetShowButton=function (){
try {
var h6=this.getControl().getAttribute("ShowButton");
if (h6==null)
h6=0;
return parseInt(h6);
}catch (exception ){
return 0;
}
}
this.SetValueToDataColumn=function (data){
this.SetText(data,0);
}
this.SetValueToTextColumn=function (text){
this.SetText(text,1);
}
this.getValue=function (whichColumn,data){
var j0=this.getFpSpread();
if (j0==null)return ;
var o5=this.getDataColumnIndex();
var o4=this.getEditColumnIndex();
var o0=(whichColumn==0)?o5:o4;
var o2=j0.GetRowCount();
var o3=null;
if (data==null){
var o6=this.getSelectedIndex();
o3=(o6>=0&&o0>=0)?j0.GetValue(o6,o0):null;
}else {
for (var m5=0;m5<o2;m5++)
{
var o7=j0.GetValue(m5,o4);
if (o7==(FarPoint.System.CheckBrowserByName("IE")?data:the_fpSpread.Trim(data))){
o3=(whichColumn==0)?j0.GetValue(m5,o5):o7;
break ;
}
}
}
return o3;
}
this.GetCurrentValue=function (cell){
if (this.Value==null){
this.updateTextToCell(cell);
this.Value=(this.GetUseValue()==1?this.getValue(0):this.getValue(1));
}
return this.Value;
}
this.updateTextToCell=function (cell){
var o7=null;
var i6=cell.getElementsByTagName("INPUT");
if (i6!=null&&i6.length>0){
o7=i6[0].value;
}else {
o7=(FarPoint.System.CheckBrowserByName("IE")?cell.innerText:cell.textContent);
}
this.SetValueToTextColumn(o7);
}
this.GetCurrentText=function (cell){
if (this.Text==null){
this.updateTextToCell(cell);
this.Text=this.getValue(1);
}
return this.Text;
}
this.GetValueFromDataColumn=function (o7){
return this.getValue(0,o7);
}
this.GetValueFromTextColumn=function (o7){
return this.getValue(1,o7);
}
this.GetValueByText=function (o7){
this.SetValueToTextColumn(o7);
var o8=this.getValue(0);
return o8;
}
this.GetTextByValue=function (o8){
this.SetValueToDataColumn(o8);
var o9=this.getValue(1);
return o9;
}
this.TestProps=function (){
if (!f9.$FLAG_ISDEBUG)return ;
}
this.Init();
}
FarPoint.System.WebControl.MultiColumnComboBoxCellType.CheckInit=function (id){
var h7=document.getElementById(id);
if (h7==null){
h7=document.getElementById(id+"Editor");
id+="Editor";
}
if (h7&&h7.Init)return ;
try {
var p0=eval(id+g1.$OBJECT_SUFFIX);
if (p0){
p0.Dispose();
delete p0;
}
}catch (exception ){}
var p1=id+g1.$OBJECT_SUFFIX+"=new FarPoint.System.WebControl.MultiColumnComboBoxCellType(document.getElementById('"+id+"'));";
eval(p1);
}
FarPoint.System._ExtenderHelper=function (){
this.ScriptHolderID="__PAGESCRIPT";
this.ScriptBlockID="__SCRIPTBLOCK";
this.StartupScriptID="__STARTUPSCRIPT";
this.ExpandosID="__EXPANDOSCRIPT"
this.ArrayDeclares="__ARRAYDECLARES"
this.CssLinksID="__CSSLINKS";
}
FarPoint.System._ExtenderHelper.prototype={
getExtenderScripts:function (){
var p2={};
var p3=document.getElementsByTagName("input");
for (var h6=0;h6<p3.length;h6++){
var p4=p3[h6].id.match(new RegExp("^(.+)_extender$"));
if (p4&&p4.length==2){
var p5=p4[1];
var p6=$get(p5);
if (p6&&(p6.FpSpread=="Spread"||p6.getAttribute("FpSpread")=="Spread")){
var p7=p3[h6].json||p3[h6].getAttribute("json");
var p8=eval("("+p7+")");
this.mergeExtenderScripts(p2,p8.extenderScripts);
}
}
}
return p2;
},
mergeExtenderScripts:function (i8,source){
for (var p9 in source){
var o3=source[p9];
if (!i8[p9]){
i8[p9]=o3;
}else {
for (var q0=0;q0<o3.length;q0++){
var q1=o3[q0];
if (!Array.contains(i8[p9],q1))i8[p9].push(q1);
}
}
}
},
getNeededExtenderScripts:function (newScripts,realScripts,loadedScripts){
var q2=[];
var q3=[];
for (var p9 in newScripts){
Array.addRange(q2,newScripts[p9]);
}
for (var p9 in loadedScripts){
Array.addRange(q3,loadedScripts[p9]);
}
var q4=[];
for (var h6=0;h6<realScripts.length;h6++){
var o3=realScripts[h6];
if (!Array.contains(q3,o3)&&Array.contains(q2,o3))
q4.push(o3);
}
return q4;
},
get_scriptHolder:function (){
var q5=$get(this.ScriptHolderID);
if (!q5){
q5=document.createElement("div");
q5.id=this.ScriptHolderID;
q5.style.display="none";
document.body.appendChild(q5);
}
return q5;
},
saveLoadedExtenderScripts:function (j0,cmd){
var q5=this.get_scriptHolder();
q5.innerHTML="";
var q6=this.getExtenderScripts();
var q3=q5.loaded;
if (!q3)q3={};
this.mergeExtenderScripts(q3,q6);
q5.loaded=q3;
if (typeof(FpExtender)!='undefined'&&cmd!="LoadOnDemand")FpExtender.Util.disposeExtenders(j0);
},
processCss:function (buff){
var q7=document.getElementsByTagName("head");
if (!q7){
q7=document.createElement("head");
document.documentElement.insertBefore(q7,document.body)
}else {
q7=q7[0];
}
var q8=[];
var q9=q7.getElementsByTagName("link");
if (q9){
for (var h6=0;h6<q9.length;h6++){
var r0=q9[h6];
if (r0.getAttribute("type")=="text/css"){
q8.push(r0.getAttribute("href"));
}
}
}
var r1=$get(this.CssLinksID,buff);
if (r1){
r1=eval("("+r1.value+")");
r1=r1.cssLinks;
for (var h6=0;h6<r1.length;h6++){
var r2=r1[h6];
if (!Array.contains(q8,r2)){
var r0=document.createElement("link");
r0.type="text/css";
r0.rel="stylesheet";
r0.href=r2;
q7.appendChild(r0);
}
}
}
},
loadExtenderScripts:function (j0,buff){
if (Sys.Browser.agent!=Sys.Browser.InternetExplorer)
this.processCss(buff);
var r3=[];
var r4=[];
var r5=$get(this.ScriptBlockID,buff);
if (r5){
var r6=new RegExp("<script src=\"(.+)\" type=\"text\\/javascript\"><\\/script>","gm");
var r7;
while ((r7=r6.exec(r5.value))!=null){
r4.push(r7[1]);
}
}
var r8=this.getExtenderScripts();
var q5=this.get_scriptHolder();
var q4=this.getNeededExtenderScripts(r8,r4,q5.loaded);
for (var h6=0;h6<q4.length;h6++)r3.push({src:q4[h6]});
var r9=$get(this.StartupScriptID,buff);
var s0=$get(this.ExpandosID,buff);
var s1=$get(this.ArrayDeclares,buff);
var s2=Sys._ScriptLoader.getInstance();
for (var h6=0;h6<r3.length;h6++){
var s3=r3[h6].src;
if (s3)s2.queueScriptReference(s3);
}
s2.loadScripts(0,function (){
if (s1&&typeof(FpExtender)!=='undefined'){
try {eval(s1.value);}catch (e){}
}
if (s0&&typeof(FpExtender)!=='undefined'){
try {eval(s0.value);}catch (e){}
}
if (r9&&typeof(FpExtender)!=='undefined'){
var s4=false;
var s5=FpExtender.Util.getExtenderInitScripts(j0,r9.value);
for (var h6=0;h6<s5.length;h6++){
eval(s5[h6]);
if (s5[h6].indexOf("Sys.Application.initialize")!=-1)s4=true;
}
if (!s4){
var s6=Sys.Application.getComponents();
for (var h6 in s6){
if (s6[h6].get_id().indexOf(j0.id)==0&&FpExtender.ContainerBehavior.isInstanceOfType(s6[h6]))
s6[h6]._load();
}
}
}
},function (){
},null);
}
}
FarPoint.System.ExtenderHelper=new FarPoint.System._ExtenderHelper();
function FpSpread(j0){
var s7=null;
if (typeof(j0)=="string"){
return document.getElementById(j0);
}
else if (typeof(j0.getAttribute)!="undefined"){
s7=j0.getAttribute("FpSpread");
}
if (s7==null)
s7=j0.FpSpread;
if (s7=="Spread")
return j0;
return null;
}
if (typeof(Sys)!='undefined'&&typeof(Sys.Application)!='undefined'){
Sys.Application.notifyScriptLoaded();
}
