/* START Telerik.Web.UI.Common.Core.js */
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(err){
}
Type.registerNamespace("Telerik.Web.UI");
window.$telerik=window.TelerikCommonScripts=Telerik.Web.CommonScripts={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],radControls:[],registerControl:function(_1){
if(!Array.contains(this.radControls,_1)){
Array.add(this.radControls,_1);
}
},unregisterControl:function(_2){
Array.remove(this.radControls,_2);
},repaintChildren:function(_3){
var _4=_3.get_element();
for(var i=0,_6=this.radControls.length;i<_6;i++){
var _7=this.radControls[i];
if(_7.repaint&&this.isDescendant(_4,_7.get_element())){
_7.repaint();
}
}
},_borderThickness:function(){
$telerik._borderThicknesses={};
var _8=document.createElement("div");
var _9=document.createElement("div");
_8.style.visibility="hidden";
_8.style.position="absolute";
_8.style.fontSize="1px";
_9.style.height="0px";
_9.style.overflow="hidden";
document.body.appendChild(_8).appendChild(_9);
var _a=_8.offsetHeight;
_9.style.borderTop="solid black";
_9.style.borderTopWidth="thin";
$telerik._borderThicknesses["thin"]=_8.offsetHeight-_a;
_9.style.borderTopWidth="medium";
$telerik._borderThicknesses["medium"]=_8.offsetHeight-_a;
_9.style.borderTopWidth="thick";
$telerik._borderThicknesses["thick"]=_8.offsetHeight-_a;
if(typeof (_8.removeChild)!=="undefined"){
_8.removeChild(_9);
}
document.body.removeChild(_8);
_8=null;
_9=null;
},getCurrentStyle:function(_b,_c,_d){
var _e=null;
if(_b){
if(_b.currentStyle){
_e=_b.currentStyle[_c];
}else{
if(document.defaultView&&document.defaultView.getComputedStyle){
var _f=document.defaultView.getComputedStyle(_b,null);
if(_f){
_e=_f[_c];
}
}
}
if(!_e&&_b.style.getPropertyValue){
_e=_b.style.getPropertyValue(_c);
}else{
if(!_e&&_b.style.getAttribute){
_e=_b.style.getAttribute(_c);
}
}
}
if((!_e||_e==""||typeof (_e)==="undefined")){
if(typeof (_d)!="undefined"){
_e=_d;
}else{
_e=null;
}
}
return _e;
},getInheritedBackgroundColor:function(_10){
if(!_10){
return "#FFFFFF";
}
var _11=$telerik.getCurrentStyle(_10,"backgroundColor");
try{
while(!_11||_11==""||_11=="transparent"||_11=="rgba(0, 0, 0, 0)"){
_10=_10.parentNode;
if(!_10){
_11="#FFFFFF";
}else{
_11=$telerik.getCurrentStyle(_10,"backgroundColor");
}
}
}
catch(ex){
_11="#FFFFFF";
}
return _11;
},getLocation:function(_12){
if(_12===document.documentElement){
return new Sys.UI.Point(0,0);
}
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
if(_12.window===_12||_12.nodeType===9||!_12.getClientRects||!_12.getBoundingClientRect){
return new Sys.UI.Point(0,0);
}
var _13=_12.getClientRects();
if(!_13||!_13.length){
return new Sys.UI.Point(0,0);
}
var _14=_13[0];
var _15=0;
var _16=0;
var _17=false;
try{
_17=_12.ownerDocument.parentWindow.frameElement;
}
catch(ex){
_17=true;
}
if(_17){
var _18=_12.getBoundingClientRect();
if(!_18){
return new Sys.UI.Point(0,0);
}
var _19=_14.left;
var _1a=_14.top;
for(var i=1;i<_13.length;i++){
var r=_13[i];
if(r.left<_19){
_19=r.left;
}
if(r.top<_1a){
_1a=r.top;
}
}
_15=_19-_18.left;
_16=_1a-_18.top;
}
var _1d=_12.document.documentElement;
var _1e=new Sys.UI.Point(_14.left-2-_15+_1d.scrollLeft,_14.top-2-_16+_1d.scrollTop);
if($telerik.quirksMode){
_1e.x+=document.body.scrollLeft;
_1e.y+=document.body.scrollTop;
}
return _1e;
}
var _1e=Sys.UI.DomElement.getLocation(_12);
if($telerik.isOpera){
var _1f=_12.offsetParent;
while(_1f&&_1f.tagName.toUpperCase()!="BODY"&&_1f.tagName.toUpperCase()!="HTML"){
_1e.x-=_1f.scrollLeft;
_1e.y-=_1f.scrollTop;
_1f=_1f.offsetParent;
}
}
if($telerik.isSafari){
var _1f=_12.parentNode;
while(_1f&&_1f.tagName.toUpperCase()!="BODY"&&_1f.tagName.toUpperCase()!="HTML"){
_1e.x-=_1f.scrollLeft;
_1e.y-=_1f.scrollTop;
_1f=_1f.parentNode;
}
}
if($telerik.isIE&&$telerik.quirksMode){
_1e.x+=document.body.scrollLeft;
_1e.y+=document.body.scrollTop;
}
return _1e;
},setLocation:function(_20,_21){
Sys.UI.DomElement.setLocation(_20,_21.x,_21.y);
},getContentSize:function(_22){
if(!_22){
throw Error.argumentNull("element");
}
var _23=$telerik.getSize(_22);
var _24=$telerik.getBorderBox(_22);
var _25=$telerik.getPaddingBox(_22);
return {width:_23.width-_24.horizontal-_25.horizontal,height:_23.height-_24.vertical-_25.vertical};
},getSize:function(_26){
if(!_26){
throw Error.argumentNull("element");
}
return {width:_26.offsetWidth,height:_26.offsetHeight};
},setContentSize:function(_27,_28){
if(!_27){
throw Error.argumentNull("element");
}
if(!_28){
throw Error.argumentNull("size");
}
if($telerik.getCurrentStyle(_27,"MozBoxSizing")=="border-box"||$telerik.getCurrentStyle(_27,"BoxSizing")=="border-box"){
var _29=$telerik.getBorderBox(_27);
var _2a=$telerik.getPaddingBox(_27);
_28={width:_28.width+_29.horizontal+_2a.horizontal,height:_28.height+_29.vertical+_2a.vertical};
}
_27.style.width=_28.width.toString()+"px";
_27.style.height=_28.height.toString()+"px";
},setSize:function(_2b,_2c){
if(!_2b){
throw Error.argumentNull("element");
}
if(!_2c){
throw Error.argumentNull("size");
}
var _2d=$telerik.getBorderBox(_2b);
var _2e=$telerik.getPaddingBox(_2b);
var _2f={width:_2c.width-_2d.horizontal-_2e.horizontal,height:_2c.height-_2d.vertical-_2e.vertical};
$telerik.setContentSize(_2b,_2f);
},getBounds:function(_30){
var _31=$telerik.getLocation(_30);
return new Sys.UI.Bounds(_31.x,_31.y,_30.offsetWidth||0,_30.offsetHeight||0);
},setBounds:function(_32,_33){
if(!_32){
throw Error.argumentNull("element");
}
if(!_33){
throw Error.argumentNull("bounds");
}
$telerik.setSize(_32,_33);
$telerik.setLocation(_32,_33);
},getClientBounds:function(){
var _34;
var _35;
switch(Sys.Browser.agent){
case Sys.Browser.InternetExplorer:
_34=document.documentElement.clientWidth;
_35=document.documentElement.clientHeight;
if(_34==0&&_35==0){
_34=document.body.clientWidth;
_35=document.body.clientHeight;
}
break;
case Sys.Browser.Safari:
_34=window.innerWidth;
_35=window.innerHeight;
break;
case Sys.Browser.Opera:
_34=Math.min(window.innerWidth,document.body.clientWidth);
_35=Math.min(window.innerHeight,document.body.clientHeight);
break;
default:
_34=Math.min(window.innerWidth,document.documentElement.clientWidth);
_35=Math.min(window.innerHeight,document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0,0,_34,_35);
},getMarginBox:function(_36){
if(!_36){
throw Error.argumentNull("element");
}
var box={top:$telerik.getMargin(_36,Telerik.Web.BoxSide.Top),right:$telerik.getMargin(_36,Telerik.Web.BoxSide.Right),bottom:$telerik.getMargin(_36,Telerik.Web.BoxSide.Bottom),left:$telerik.getMargin(_36,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getPaddingBox:function(_38){
if(!_38){
throw Error.argumentNull("element");
}
var box={top:$telerik.getPadding(_38,Telerik.Web.BoxSide.Top),right:$telerik.getPadding(_38,Telerik.Web.BoxSide.Right),bottom:$telerik.getPadding(_38,Telerik.Web.BoxSide.Bottom),left:$telerik.getPadding(_38,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getBorderBox:function(_3a){
if(!_3a){
throw Error.argumentNull("element");
}
var box={top:$telerik.getBorderWidth(_3a,Telerik.Web.BoxSide.Top),right:$telerik.getBorderWidth(_3a,Telerik.Web.BoxSide.Right),bottom:$telerik.getBorderWidth(_3a,Telerik.Web.BoxSide.Bottom),left:$telerik.getBorderWidth(_3a,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},isBorderVisible:function(_3c,_3d){
if(!_3c){
throw Error.argumentNull("element");
}
if(_3d<Telerik.Web.BoxSide.Top||_3d>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_3d,"Telerik.Web.BoxSide"));
}
var _3e=$telerik._borderStyleNames[_3d];
var _3f=$telerik.getCurrentStyle(_3c,_3e);
return _3f!="none";
},getMargin:function(_40,_41){
if(!_40){
throw Error.argumentNull("element");
}
if(_41<Telerik.Web.BoxSide.Top||_41>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_41,"Telerik.Web.BoxSide"));
}
var _42=$telerik._marginWidthNames[_41];
var _43=$telerik.getCurrentStyle(_40,_42);
try{
return $telerik.parsePadding(_43);
}
catch(ex){
return 0;
}
},getBorderWidth:function(_44,_45){
if(!_44){
throw Error.argumentNull("element");
}
if(_45<Telerik.Web.BoxSide.Top||_45>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_45,"Telerik.Web.BoxSide"));
}
if(!$telerik.isBorderVisible(_44,_45)){
return 0;
}
var _46=$telerik._borderWidthNames[_45];
var _47=$telerik.getCurrentStyle(_44,_46);
return $telerik.parseBorderWidth(_47);
},getPadding:function(_48,_49){
if(!_48){
throw Error.argumentNull("element");
}
if(_49<Telerik.Web.BoxSide.Top||_49>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_49,"Telerik.Web.BoxSide"));
}
var _4a=$telerik._paddingWidthNames[_49];
var _4b=$telerik.getCurrentStyle(_48,_4a);
return $telerik.parsePadding(_4b);
},parseBorderWidth:function(_4c){
if(_4c){
switch(_4c){
case "thin":
case "medium":
case "thick":
return $telerik._borderThicknesses[_4c];
case "inherit":
return 0;
}
var _4d=$telerik.parseUnit(_4c);
return _4d.size;
}
return 0;
},parsePadding:function(_4e){
if(_4e){
if(_4e=="inherit"){
return 0;
}
var _4f=$telerik.parseUnit(_4e);
return _4f.size;
}
return 0;
},parseUnit:function(_50){
if(!_50){
throw Error.argumentNull("value");
}
_50=_50.trim().toLowerCase();
var l=_50.length;
var s=-1;
for(var i=0;i<l;i++){
var ch=_50.substr(i,1);
if((ch<"0"||ch>"9")&&ch!="-"&&ch!="."&&ch!=","){
break;
}
s=i;
}
if(s==-1){
throw Error.create("No digits");
}
var _55;
var _56;
if(s<(l-1)){
_55=_50.substring(s+1).trim();
}else{
_55="px";
}
_56=parseFloat(_50.substr(0,s+1));
if(_55=="px"){
_56=Math.floor(_56);
}
return {size:_56,type:_55};
},containsPoint:function(_57,x,y){
return x>=_57.x&&x<=(_57.x+_57.width)&&y>=_57.y&&y<=(_57.y+_57.height);
},isDescendant:function(_5a,_5b){
for(var n=_5b.parentNode;n!=null;n=n.parentNode){
if(n==_5a){
return true;
}
}
return false;
},isDescendantOrSelf:function(_5d,_5e){
if(_5d===_5e){
return true;
}
return $telerik.isDescendant(_5d,_5e);
},setOuterHeight:function(_5f,_60){
if(_60<=0||_60==""){
_5f.style.height="";
}else{
_5f.style.height=_60+"px";
var _61=_5f.offsetHeight-_60;
var _62=_60-_61;
if(_62>0){
_5f.style.height=_62+"px";
}else{
_5f.style.height="";
}
}
},setOpacity:function(_63,_64){
if(!_63){
throw Error.argumentNull("element");
}
if(_63.filters){
var _65=_63.filters;
var _66=true;
if(_65.length!==0){
var _67=_65["DXImageTransform.Microsoft.Alpha"];
if(_67){
_66=false;
_67.opacity=_64*100;
}
}
if(_66){
_63.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(_64*100)+")";
}
}else{
_63.style.opacity=_64;
}
},getOpacity:function(_68){
if(!_68){
throw Error.argumentNull("element");
}
var _69=false;
var _6a;
if(_68.filters){
var _6b=_68.filters;
if(_6b.length!==0){
var _6c=_6b["DXImageTransform.Microsoft.Alpha"];
if(_6c){
_6a=_6c.opacity/100;
_69=true;
}
}
}else{
_6a=$telerik.getCurrentStyle(_68,"opacity",1);
_69=true;
}
if(_69===false){
return 1;
}
return parseFloat(_6a);
},addCssClasses:function(_6d,_6e){
for(var i=0;i<_6e.length;i++){
Sys.UI.DomElement.addCssClass(_6d,_6e[i]);
}
},removeCssClasses:function(_70,_71){
for(var i=0;i<_71.length;i++){
Sys.UI.DomElement.removeCssClass(_70,_71[i]);
}
},setOuterWidth:function(_73,_74){
if(_74<=0||_74==""){
_73.style.width="";
}else{
_73.style.width=_74+"px";
var _75=_73.offsetWidth-_74;
var _76=_74-_75;
if(_76>0){
_73.style.width=_76+"px";
}else{
_73.style.width="";
}
}
},getScrollOffset:function(_77,_78){
var _79=0;
var top=0;
var _7b=_77;
while(_7b!=null&&_7b.scrollLeft!=null){
_79+=_7b.scrollLeft;
top+=_7b.scrollTop;
if(!_78||(_7b==document.body&&(_7b.scrollLeft!=0||_7b.scrollTop!=0))){
break;
}
_7b=_7b.parentNode;
}
return {x:_79,y:top};
},getElementByClassName:function(_7c,_7d,_7e){
var _7f=null;
if(_7e){
_7f=_7c.getElementsByTagName(_7e);
}else{
_7f=_7c.getElementsByTagName("*");
}
for(var i=0,_81=_7f.length;i<_81;i++){
var _82=_7f[i];
if(Sys.UI.DomElement.containsCssClass(_82,_7d)){
return _82;
}
}
return null;
},addExternalHandler:function(_83,_84,_85){
if(_83.addEventListener){
_83.addEventListener(_84,_85,false);
}else{
if(_83.attachEvent){
_83.attachEvent("on"+_84,_85);
}
}
},removeExternalHandler:function(_86,_87,_88){
if(_86.addEventListener){
_86.removeEventListener(_87,_88,false);
}else{
if(_86.detachEvent){
_86.detachEvent("on"+_87,_88);
}
}
},cancelRawEvent:function(e){
if(!e){
return false;
}
if(e.preventDefault){
e.preventDefault();
}
if(e.stopPropagation){
e.stopPropagation();
}
e.cancelBubble=true;
e.returnValue=false;
return false;
},getOuterHtml:function(_8a){
if(_8a.outerHTML){
return _8a.outerHTML;
}else{
var _8b=_8a.cloneNode(true);
var _8c=_8a.ownerDocument.createElement("DIV");
_8c.appendChild(_8b);
return _8c.innerHTML;
}
},setVisible:function(e,_8e){
if(!e){
return;
}
if(_8e!=$telerik.getVisible(e)){
if(_8e){
if(e.style.removeAttribute){
e.style.removeAttribute("display");
}else{
e.style.removeProperty("display");
}
}else{
e.style.display="none";
}
e.style.visibility=_8e?"visible":"hidden";
}
},getVisible:function(e){
if(!e){
return false;
}
return (("none"!=$telerik.getCurrentStyle(e,"display"))&&("hidden"!=$telerik.getCurrentStyle(e,"visibility")));
},getViewPortSize:function(){
var _90=0;
var _91=0;
var _92=document.body;
if(!$telerik.quirksMode&&!$telerik.isSafari){
_92=document.documentElement;
}
if(window.innerWidth){
_90=window.innerWidth;
_91=window.innerHeight;
}else{
_90=_92.clientWidth;
_91=_92.clientHeight;
}
_90+=_92.scrollLeft;
_91+=_92.scrollTop;
return {width:_90-6,height:_91-6};
},elementOverflowsTop:function(_93){
return $telerik.getLocation(_93).y<0;
},elementOverflowsLeft:function(_94){
return $telerik.getLocation(_94).x<0;
},elementOverflowsBottom:function(_95,_96){
var _97=$telerik.getLocation(_96).y+_96.offsetHeight;
return _97>_95.height;
},elementOverflowsRight:function(_98,_99){
var _9a=$telerik.getLocation(_99).x+_99.offsetWidth;
return _9a>_98.width;
},getDocumentRelativeCursorPosition:function(e){
var _9c=document.documentElement.scrollLeft||document.body.scrollLeft;
var _9d=document.documentElement.scrollTop||document.body.scrollTop;
var _9e=e.clientX+_9c;
var top=e.clientY+_9d;
return {left:_9e,top:top};
},getFirstChildByTagName:function(_a0,_a1,_a2){
if(!_a0||!_a0.childNodes){
return null;
}
var _a3=_a0.childNodes[_a2]||_a0.firstChild;
while(_a3){
if(_a3.nodeType==1&&_a3.tagName.toLowerCase()==_a1){
return _a3;
}
_a3=_a3.nextSibling;
}
return null;
},getChildByClassName:function(_a4,_a5,_a6){
var _a7=_a4.childNodes[_a6]||_a4.firstChild;
while(_a7){
if(_a7.nodeType==1&&_a7.className.indexOf(_a5)>-1){
return _a7;
}
_a7=_a7.nextSibling;
}
return null;
},getChildrenByTagName:function(_a8,_a9){
var _aa=new Array();
var _ab=_a8.childNodes;
for(var i=0,_ad=_ab.length;i<_ad;i++){
var _ae=_ab[i];
if(_ae.nodeType==1&&_ae.tagName.toLowerCase()==_a9){
Array.add(_aa,_ae);
}
}
return _aa;
},getChildrenByClassName:function(_af,_b0){
var _b1=new Array();
var _b2=_af.childNodes;
for(var i=0,_b4=_b2.length;i<_b4;i++){
var _b5=_b2[i];
if(_b5.nodeType==1&&_b5.className.indexOf(_b0)>-1){
Array.add(_b1,_b5);
}
}
return _b1;
}};
$telerik.isIE=Sys.Browser.agent==Sys.Browser.InternetExplorer;
$telerik.isIE7=$telerik.isIE&&Sys.Browser.version==7;
$telerik.isIE6=$telerik.isIE&&Sys.Browser.version<7;
$telerik.isOpera=Sys.Browser.agent==Sys.Browser.Opera;
$telerik.isSafari=Sys.Browser.agent==Sys.Browser.Safari;
$telerik.isSafari3=$telerik.isSafari&&Sys.Browser.version>500;
$telerik.isSafari2=$telerik.isSafari&&Sys.Browser.version<=500;
$telerik.isFirefox=Sys.Browser.agent==Sys.Browser.Firefox;
$telerik.quirksMode=$telerik.isIE&&document.compatMode!="CSS1Compat";
$telerik.standardsMode=!$telerik.quirksMode;
$telerik._borderThickness();
Telerik.Web.UI.Orientation=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.Orientation.prototype={Horizontal:0,Vertical:1};
Telerik.Web.UI.Orientation.registerEnum("Telerik.Web.UI.Orientation",false);
Telerik.Web.UI.RadWebControl=function(_b6){
Telerik.Web.UI.RadWebControl.initializeBase(this,[_b6]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.RadWebControl.prototype={initialize:function(){
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"initialize");
$telerik.registerControl(this);
if(!this.get_clientStateFieldID()){
return;
}
var _b7=$get(this.get_clientStateFieldID());
if(!_b7){
return;
}
_b7.setAttribute("autocomplete","off");
},dispose:function(){
$telerik.unregisterControl(this);
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"dispose");
},raiseEvent:function(_b8,_b9){
var _ba=this.get_events().getHandler(_b8);
if(_ba){
if(!_b9){
_b9=Sys.EventArgs.Empty;
}
_ba(this,_b9);
}
},updateClientState:function(){
this.set_clientState(this.saveClientState());
},saveClientState:function(){
return null;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_bb){
if(this._clientStateFieldID!=_bb){
this._clientStateFieldID=_bb;
this.raisePropertyChanged("ClientStateFieldID");
}
},get_clientState:function(){
if(this._clientStateFieldID){
var _bc=document.getElementById(this._clientStateFieldID);
if(_bc){
return _bc.value;
}
}
return null;
},set_clientState:function(_bd){
if(this._clientStateFieldID){
var _be=document.getElementById(this._clientStateFieldID);
if(_be){
_be.value=_bd;
}
}
},_getChildElement:function(id){
return $get(this.get_id()+"_"+id);
},_findChildControl:function(id){
return $find(this.get_id()+"_"+id);
}};
Telerik.Web.UI.RadWebControl.registerClass("Telerik.Web.UI.RadWebControl",Sys.UI.Control);
Telerik.Web.Timer=function(){
Telerik.Web.Timer.initializeBase(this);
this._interval=1000;
this._enabled=false;
this._timer=null;
this._timerCallbackDelegate=Function.createDelegate(this,this._timerCallback);
};
Telerik.Web.Timer.prototype={get_interval:function(){
return this._interval;
},set_interval:function(_c1){
if(this._interval!==_c1){
this._interval=_c1;
this.raisePropertyChanged("interval");
if(!this.get_isUpdating()&&(this._timer!==null)){
this._stopTimer();
this._startTimer();
}
}
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_c2){
if(_c2!==this.get_enabled()){
this._enabled=_c2;
this.raisePropertyChanged("enabled");
if(!this.get_isUpdating()){
if(_c2){
this._startTimer();
}else{
this._stopTimer();
}
}
}
},add_tick:function(_c3){
this.get_events().addHandler("tick",_c3);
},remove_tick:function(_c4){
this.get_events().removeHandler("tick",_c4);
},dispose:function(){
this.set_enabled(false);
this._stopTimer();
Telerik.Web.Timer.callBaseMethod(this,"dispose");
},updated:function(){
Telerik.Web.Timer.callBaseMethod(this,"updated");
if(this._enabled){
this._stopTimer();
this._startTimer();
}
},_timerCallback:function(){
var _c5=this.get_events().getHandler("tick");
if(_c5){
_c5(this,Sys.EventArgs.Empty);
}
},_startTimer:function(){
this._timer=window.setInterval(this._timerCallbackDelegate,this._interval);
},_stopTimer:function(){
window.clearInterval(this._timer);
this._timer=null;
}};
Telerik.Web.Timer.registerClass("Telerik.Web.Timer",Sys.Component);
Telerik.Web.BoxSide=function(){
};
Telerik.Web.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};
Telerik.Web.BoxSide.registerEnum("Telerik.Web.BoxSide",false);
if(Sys.CultureInfo.prototype._getAbbrMonthIndex){
try{
Sys.CultureInfo.prototype._getAbbrMonthIndex("");
}
catch(ex){
Sys.CultureInfo.prototype._getAbbrMonthIndex=function(_c6){
if(!this._upperAbbrMonths){
this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}
return Array.indexOf(this._upperAbbrMonths,this._toUpper(_c6));
};
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
}
}
Type.registerNamespace("Telerik.Web.UI.Dialogs");
Telerik.Web.IParameterConsumer=function(){
};
Telerik.Web.IParameterConsumer.prototype={clientInit:function(_c7){
throw Error.notImplemented();
}};
Telerik.Web.IParameterConsumer.registerInterface("Telerik.Web.IParameterConsumer");
Telerik.Web.UI.Dialogs.CommonDialogScript=function(){
};
Telerik.Web.UI.Dialogs.CommonDialogScript.get_windowReference=function(){
if(window.radWindow){
return window.radWindow;
}
if(window.frameElement&&window.frameElement.radWindow){
return window.frameElement.radWindow;
}
return null;
};
Telerik.Web.UI.Dialogs.CommonDialogScript.registerClass("Telerik.Web.UI.Dialogs.CommonDialogScript",null);
Telerik.Web.UI.WebServiceLoaderEventArgs=function(_c8){
Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context=_c8;
};
Telerik.Web.UI.WebServiceLoaderEventArgs.prototype={get_context:function(){
return this._context;
}};
Telerik.Web.UI.WebServiceLoaderEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderEventArgs",Sys.EventArgs);
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs=function(_c9,_ca){
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this,[_ca]);
this._data=_c9;
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.prototype={get_data:function(){
return this._data;
}};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderSuccessEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoaderErrorEventArgs=function(_cb,_cc){
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this,[_cc]);
this._message=_cb;
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.prototype={get_message:function(){
return this._message;
}};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderErrorEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoader=function(_cd){
this._webServiceSettings=_cd;
this._events=null;
this._currentWebRequest=null;
this._onWebServiceSuccessDelegate=Function.createDelegate(this,this._onWebServiceSuccess);
this._onWebServiceErrorDelegate=Function.createDelegate(this,this._onWebServiceError);
};
Telerik.Web.UI.WebServiceLoader.prototype={get_webServiceSettings:function(){
return this._webServiceSettings;
},get_events:function(){
if(!this._events){
this._events=new Sys.EventHandlerList();
}
return this._events;
},loadData:function(_ce,_cf){
var _d0=this.get_webServiceSettings();
if(_d0.get_isEmpty()){
Error.invalidOperation("Please, specify valid web service and method.");
return;
}
var _d1=_d0.get_path();
var _d2=_d0.get_method();
this._raiseEvent("loadingStarted",new Telerik.Web.UI.WebServiceLoaderEventArgs(_cf));
this._currentWebRequest=Sys.Net.WebServiceProxy.invoke(_d1,_d2,false,_ce,this._onWebServiceSuccessDelegate,this._onWebServiceErrorDelegate,_cf);
},add_loadingStarted:function(_d3){
this.get_events().addHandler("loadingStarted",_d3);
},add_loadingError:function(_d4){
this.get_events().addHandler("loadingError",_d4);
},add_loadingSuccess:function(_d5){
this.get_events().addHandler("loadingSuccess",_d5);
},_onWebServiceSuccess:function(_d6,_d7){
var _d8=new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(_d6,_d7);
this._raiseEvent("loadingSuccess",_d8);
},_onWebServiceError:function(_d9,_da){
var _db=new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(_d9.get_message(),_da);
this._raiseEvent("loadingError",_db);
},_raiseEvent:function(_dc,_dd){
var _de=this.get_events().getHandler(_dc);
if(_de){
if(!_dd){
_dd=Sys.EventArgs.Empty;
}
_de(this,_dd);
}
}};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings=function(_df){
this._path=null;
this._method=null;
if(!_df){
_df={};
}
if(typeof (_df.path)!="undefined"){
this._path=_df.path;
}
if(typeof (_df.method)!="undefined"){
this._method=_df.method;
}
};
Telerik.Web.UI.WebServiceSettings.prototype={get_path:function(){
return this._path;
},set_path:function(_e0){
this._path=_e0;
},get_method:function(){
return this._method;
},set_method:function(_e1){
this._method=_e1;
},get_isEmpty:function(){
var _e2=this.get_path();
var _e3=this.get_method();
return (!(_e2&&_e3));
}};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");


/* END Telerik.Web.UI.Common.Core.js */
/* START Telerik.Web.UI.Ajax.Ajax.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxControl=function(_1){
Telerik.Web.UI.RadAjaxControl.initializeBase(this,[_1]);
this._clientEvents={};
this._uniqueID="";
this._enableHistory=false;
this._enableAJAX=true;
this._requestQueueSize=0;
this._requestQueue=[];
this._loadingPanelsToHide=[];
this._initializeRequestHandler=null;
this._endRequestHandler=null;
this._isRequestInProgress=false;
this._links=[];
this._styles=[];
this.Type="Telerik.Web.UI.RadAjaxControl";
this.UniqueID=this._uniqueID;
this.EnableHistory=this._enableHistory;
this.EnableAJAX=this._enableAJAX;
this.Links=this._links;
this.Styles=this._styles;
this._updatePanels="";
};
Telerik.Web.UI.RadAjaxControl.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxControl.callBaseMethod(this,"initialize");
for(var _2 in this._clientEvents){
if(typeof (this._clientEvents[_2])!="string"){
continue;
}
if(this._clientEvents[_2]!=""){
var _3=this._clientEvents[_2];
if(_3.indexOf("(")!=-1){
this[_2]=_3;
}else{
this[_2]=eval(_3);
}
}else{
this[_2]=null;
}
}
var _4=Sys.WebForms.PageRequestManager.getInstance();
this._initializeRequestHandler=Function.createDelegate(this,this._initializeRequest);
_4.add_initializeRequest(this._initializeRequestHandler);
},_onFormSubmitCompleted:function(_5,_6){
if(_5._xmlHttpRequest!=null&&!_5.get_timedOut()){
var _7=this.getResponseItems(_5.get_responseData(),"scriptBlock");
for(var i=0,_9=_7.length;i<_9;i++){
var _a=_7[i].content;
if(_a.indexOf(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID))!=-1){
var _b=_a.substr(_a.indexOf("\"links\":")+10,_a.indexOf("]",_a.indexOf("\"links\":"))-(_a.indexOf("\"links\":")+10)).replace(/\"/g,"");
if(_b!=""){
this._links=_b.split(",");
this.updateHeadLinks();
}
}
if(_a.indexOf(".axd")==-1&&_7[i].id=="ScriptPath"){
Telerik.Web.UI.RadAjaxControl.IncludeClientScript(_a);
}
}
var _c=this.getResponseItems(_5.get_responseData(),"updatePanel");
Telerik.Web.UI.RadAjaxControl.panelsToClear=[];
for(var i=0,_9=_c.length;i<_9;i++){
var _d=_c[i];
if(!$get(_d.id)){
var _e=document.createElement("div");
_e.id=_d.id;
var _f=$get(_d.id.replace("Panel",""));
if(!_f){
continue;
}
var _10=_f.parentNode;
var _11=_f.nextSibling||Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling(_f);
if(_f.nodeType===1){
if(_f.dispose&&typeof (_f.dispose)==="function"){
_f.dispose();
}else{
if(_f.control&&typeof (_f.control.dispose)==="function"){
_f.control.dispose();
}
}
var _12=Sys.UI.Behavior.getBehaviors(_f);
for(var j=_12.length-1;j>=0;j--){
_12[j].dispose();
}
}
Sys.WebForms.PageRequestManager.getInstance()._destroyTree(_f);
_10.removeChild(_f);
Telerik.Web.UI.RadAjaxControl.InsertAtLocation(_e,_10,_11);
Telerik.Web.UI.RadAjaxControl.panelsToClear[Telerik.Web.UI.RadAjaxControl.panelsToClear.length]=_d;
}
}
}
_5.get_webRequest().remove_completed(this._onFormSubmitCompletedHandler);
},dispose:function(){
this.hideLoadingPanels();
var _14=Sys.WebForms.PageRequestManager.getInstance();
_14.remove_initializeRequest(this._initializeRequestHandler);
Telerik.Web.UI.RadAjaxControl.callBaseMethod(this,"dispose");
},get_enableAJAX:function(){
return this._enableAJAX;
},set_enableAJAX:function(_15){
if(this._enableAJAX!=_15){
this._enableAJAX=_15;
}
},get_enableHistory:function(){
return this._enableHistory;
},set_enableHistory:function(_16){
if(this._enableHistory!=_16){
this._enableHistory=_16;
}
},get_clientEvents:function(){
return this._clientEvents;
},set_clientEvents:function(_17){
if(this._clientEvents!=_17){
this._clientEvents=_17;
}
},get_links:function(){
return this._links;
},set_links:function(_18){
if(this._links!=_18){
this._links=_18;
if(this._links.length>0){
this.updateHeadLinks();
}
}
},get_styles:function(){
return this._styles;
},set_styles:function(_19){
if(this._styles!=_19){
this._styles=_19;
if(this._styles.length>0){
this.updateHeadStyles();
}
}
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_1a){
if(this._uniqueID!=_1a){
this._uniqueID=_1a;
window[Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID)]=this;
}
},get_requestQueueSize:function(){
return this._requestQueueSize;
},set_requestQueueSize:function(_1b){
if(_1b>0){
this._requestQueueSize=_1b;
this.raisePropertyChanged("requestQueueSize");
}
},isChildOf:function(_1c,_1d){
while(_1c!=null){
if(_1c==_1d){
return true;
}
_1c=_1c.parentNode;
}
return false;
},_initializeRequest:function(_1e,_1f){
var _20=Sys.WebForms.PageRequestManager.getInstance();
if(_20.get_isInAsyncPostBack()&&this._requestQueueSize>0){
this._queueRequest(_1e,_1f);
}
if(this.Type=="Telerik.Web.UI.RadAjaxManager"){
if(_1f.get_postBackElement()!=this.get_element()){
var _21=this._updatePanels.split(",");
if(Array.contains(_21,_1f.get_postBackElement().id)){
this._isRequestInProgress=true;
this._attachRequestHandlers(_1e,_1f,false);
return false;
}else{
var _22=_1f.get_postBackElement().parentNode;
var _23=false;
while(_22!=null){
if(_22.id&&Array.contains(_21,_22.id)){
_23=true;
break;
}
_22=_22.parentNode;
}
if(_23){
this._isRequestInProgress=true;
this._attachRequestHandlers(_1e,_1f,false);
return false;
}
}
if(!this._initiators[_1f.get_postBackElement().id]){
var _22=_1f.get_postBackElement().parentNode;
var _23=false;
while(_22!=null){
if(_22.id&&this._initiators[_22.id]){
_23=true;
break;
}
_22=_22.parentNode;
}
if(!_23){
this._isRequestInProgress=true;
this._attachRequestHandlers(_1e,_1f,false);
return false;
}
}
}
}
if(this.Type=="Telerik.Web.UI.RadAjaxPanel"){
var _24=this._getParentAjaxPanel(_1f.get_postBackElement());
if(_24&&_24.get_id()!=this.get_id()){
return false;
}
if(!this.isChildOf(_1f.get_postBackElement(),this.get_element())){
return false;
}
}
if(this._enableHistory){
if(Telerik.Web.UI.RadAjaxControl.History[""]==null){
Telerik.Web.UI.RadAjaxControl.HandleHistory(_1e._uniqueIDToClientID(this._uniqueID),"");
}
Telerik.Web.UI.RadAjaxControl.HandleHistory(_1e._uniqueIDToClientID(this._uniqueID),_1f.get_request().get_body());
}
if(_1e._form["__EVENTTARGET"]&&_1e._form["__EVENTTARGET"].value){
this.__EVENTTARGET=_1e._form["__EVENTTARGET"].value;
}else{
this.__EVENTTARGET=_1f.get_postBackElement().id;
}
if(_1f.get_postBackElement().name){
this.__EVENTTARGET=_1f.get_postBackElement().name;
}
this.__EVENTARGUMENT=_1e._form["__EVENTARGUMENT"].value;
var evt=new Telerik.Web.UI.RadAjaxRequestEventArgs(this.__EVENTTARGET,_1e._form["__EVENTARGUMENT"].value,this._enableAJAX);
var _26=this.fireEvent(this,"OnRequestStart",[evt]);
if(evt.get_cancel()||(typeof (_26)!="undefined"&&!_26)){
_1f.set_cancel(true);
return;
}
if(!evt._enableAjax||!evt.EnableAjax){
_1f.set_cancel(true);
_1e._form["__EVENTTARGET"].value=this.__EVENTTARGET;
_1e._form["__EVENTARGUMENT"].value=this.__EVENTARGUMENT;
_1e._form.submit();
return;
}
this._isRequestInProgress=true;
this._attachRequestHandlers(_1e,_1f,true);
},_endRequest:function(_27,_28){
_27.remove_endRequest(this._endRequestHandler);
for(var i=0,_2a=Telerik.Web.UI.RadAjaxControl.panelsToClear.length;i<_2a;i++){
var _2b=Telerik.Web.UI.RadAjaxControl.panelsToClear[i];
var _2c=document.getElementById(_2b.id);
var _2d=$get(_2b.id.replace("Panel",""));
if(!_2d){
continue;
}
var _2e=_2c.parentNode;
var _2f=_2c.nextSibling||Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling(_2c);
Telerik.Web.UI.RadAjaxControl.InsertAtLocation(_2d,_2e,_2f);
_2c.parentNode.removeChild(_2c);
}
this._isRequestInProgress=false;
this.hideLoadingPanels();
if(typeof (this.__EVENTTARGET)!="undefined"&&typeof (this.__EVENTARGUMENT)!="undefined"){
var evt=new Telerik.Web.UI.RadAjaxRequestEventArgs(this.__EVENTTARGET,this.__EVENTARGUMENT,this._enableAJAX);
this.fireEvent(this,"OnResponseEnd",[evt]);
}
if(this._requestQueue.length>0){
this._executePendingRequest();
}
},_queueRequest:function(_31,_32){
_32.set_cancel(true);
if(this._requestQueue.length>=this._requestQueueSize){
return;
}
var _33=_32.get_postBackElement();
var _34=_33.id;
if(_33.name){
_34=_33.name;
}
if(_31._form["__EVENTTARGET"]&&_31._form["__EVENTTARGET"].value){
_34=_31._form["__EVENTTARGET"].value;
}
var _35=_31._form["__EVENTARGUMENT"].value;
Array.enqueue(this._requestQueue,[_34,_35]);
},_executePendingRequest:function(){
var _36=Array.dequeue(this._requestQueue);
var _37=_36[0];
var _38=_36[1];
var _39=Sys.WebForms.PageRequestManager.getInstance();
_39._doPostBack(_37,_38);
},_attachRequestHandlers:function(_3a,_3b,_3c){
this._endRequestHandler=Function.createDelegate(this,this._endRequest);
_3a.add_endRequest(this._endRequestHandler);
this._onFormSubmitCompletedHandler=Function.createDelegate(this,this._onFormSubmitCompleted);
_3b.get_request().add_completed(this._onFormSubmitCompletedHandler);
_3b.get_request()._get_eventHandlerList()._list.completed.reverse();
if(_3c){
var _3d=_3b.get_request().get_body();
var _3e=(_3d.lastIndexOf("&")!=_3d.length-1)?"&":"";
_3d+=_3e+"RadAJAXControlID="+_3a._uniqueIDToClientID(this._uniqueID);
_3b.get_request().set_body(_3d);
}
},_getParentAjaxPanel:function(_3f){
var _40=null;
while(_3f!=null){
if(typeof (_3f.id)!="undefined"&&$find(_3f.id)&&$find(_3f.id).Type=="Telerik.Web.UI.RadAjaxPanel"){
_40=$find(_3f.id);
break;
}
_3f=_3f.parentNode;
}
return _40;
},getResponseItems:function(_41,_42,_43){
var _44=Sys.WebForms.PageRequestManager.getInstance();
var _45=_41;
var _46,len,_48,id,_4a;
var _4b=0;
var _4c=null;
var _4d="|";
var _4e=[];
while(_4b<_45.length){
_46=_45.indexOf(_4d,_4b);
if(_46===-1){
_4c=_44._findText(_45,_4b);
break;
}
len=parseInt(_45.substring(_4b,_46),10);
if((len%1)!==0){
_4c=_44._findText(_45,_4b);
break;
}
_4b=_46+1;
_46=_45.indexOf(_4d,_4b);
if(_46===-1){
_4c=_44._findText(_45,_4b);
break;
}
_48=_45.substring(_4b,_46);
_4b=_46+1;
_46=_45.indexOf(_4d,_4b);
if(_46===-1){
_4c=_44._findText(_45,_4b);
break;
}
id=_45.substring(_4b,_46);
_4b=_46+1;
if((_4b+len)>=_45.length){
_4c=_44._findText(_45,_45.length);
break;
}
if(typeof (_44._decodeString)!="undefined"){
_4a=_44._decodeString(_45.substr(_4b,len));
}else{
_4a=_45.substr(_4b,len);
}
_4b+=len;
if(_45.charAt(_4b)!==_4d){
_4c=_44._findText(_45,_4b);
break;
}
_4b++;
if(_42!=undefined&&_42!=_48){
continue;
}
if(_43!=undefined&&_43!=id){
continue;
}
Array.add(_4e,{type:_48,id:id,content:_4a});
}
return _4e;
},pageLoading:function(_4f,_50){
},pageLoaded:function(_51,_52){
},hideLoadingPanels:function(){
for(var i=0;i<this._loadingPanelsToHide.length;i++){
var _54=this._loadingPanelsToHide[i].Panel;
var _55=this._loadingPanelsToHide[i].ControlID;
if(_54!=null){
_54.hide(_55);
Array.remove(this._loadingPanelsToHide,this._loadingPanelsToHide[i]);
i--;
}
}
},fireEvent:function(_56,_57,_58){
var _59=true;
if(typeof (_56[_57])=="string"){
_59=eval(_56[_57]);
}else{
if(typeof (_56[_57])=="function"){
if(_58){
if(typeof (_58.unshift)!="undefined"){
_58.unshift(_56);
_59=_56[_57].apply(_56,_58);
}else{
_59=_56[_57].apply(_56,[_58]);
}
}else{
_59=_56[_57]();
}
}
}
if(typeof (_59)!="boolean"){
return true;
}else{
return _59;
}
},updateHeadLinks:function(){
var _5a=this.getHeadElement();
var _5b=_5a.getElementsByTagName("link");
var _5c=[];
for(var j=0,_5e=_5b.length;j<_5e;j++){
var _5f=_5b[j].getAttribute("href");
_5c.push(_5f);
}
for(var i=0,_61=this._links.length;i<_61;i++){
var _62=this._links[i];
_62=_62.replace(/&amp;amp;t/g,"&t");
_62=_62.replace(/&amp;t/g,"&t");
var _63=Array.contains(_5c,_62);
if(!_63){
if(_62==""){
continue;
}
var _64=document.createElement("link");
_64.setAttribute("rel","stylesheet");
_64.setAttribute("href",_62);
_5a.appendChild(_64);
}
}
},updateHeadStyles:function(){
if(document.createStyleSheet!=null){
for(var i=0,_66=this._styles.length;i<_66;i++){
var _67=this._styles[i];
var _68=null;
try{
_68=document.createStyleSheet();
}
catch(e){
}
if(_68==null){
_68=document.createElement("style");
}
_68.cssText=_67;
}
}else{
var _69=null;
if(document.styleSheets.length==0){
css=document.createElement("style");
css.media="all";
css.type="text/css";
var _6a=this.getHeadElement();
_6a.appendChild(css);
_69=css;
}
if(document.styleSheets[0]){
_69=document.styleSheets[0];
}
for(var i=0;i<this._styles.length;i++){
var _67=this._styles[i];
var _6b=_67.split("}");
for(var j=0;j<_6b.length;j++){
if(_6b[j].replace(/\s*/,"")==""){
continue;
}
_69.insertRule(_6b[j]+"}",j+1);
}
}
}
},getHeadElement:function(){
var _6d=document.getElementsByTagName("head");
if(_6d.length>0){
return _6d[0];
}
var _6e=document.createElement("head");
document.documentElement.appendChild(_6e);
return _6e;
},ajaxRequest:function(_6f){
__doPostBack(this._uniqueID,_6f);
},ajaxRequestWithTarget:function(_70,_71){
__doPostBack(_70,_71);
},__doPostBack:function(_72,_73){
var _74=Sys.WebForms.PageRequestManager.getInstance()._form;
if(_74!=null){
if(_74["__EVENTTARGET"]!=null){
_74["__EVENTTARGET"].value=_72;
}
if(_74["__EVENTARGUMENT"]!=null){
_74["__EVENTARGUMENT"].value=_73;
}
_74.submit();
}
}};
Telerik.Web.UI.RadAjaxControl.registerClass("Telerik.Web.UI.RadAjaxControl",Sys.UI.Control);
Telerik.Web.UI.RadAjaxRequestEventArgs=function(_75,_76,_77){
Telerik.Web.UI.RadAjaxRequestEventArgs.initializeBase(this);
this._enableAjax=_77;
this._eventTarget=_75;
this._eventArgument=_76;
this._postbackControlClientID=_75.replace(/(\$|:)/g,"_");
this._eventTargetElement=$get(this._postbackControlClientID);
this.EnableAjax=this._enableAjax;
this.EventTarget=this._eventTarget;
this.EventArgument=this._eventArgument;
this.EventTargetElement=this._eventTargetElement;
};
Telerik.Web.UI.RadAjaxRequestEventArgs.prototype={get_enableAjax:function(){
return this._enableAjax;
},set_enableAjax:function(_78){
if(this._enableAjax!=_78){
this._enableAjax=_78;
}
},get_eventTarget:function(){
return this._eventTarget;
},get_eventArgument:function(){
return this._eventArgument;
},get_eventTargetElement:function(){
return this._eventTargetElement;
}};
Telerik.Web.UI.RadAjaxRequestEventArgs.registerClass("Telerik.Web.UI.RadAjaxRequestEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadAjaxControl.History={};
Telerik.Web.UI.RadAjaxControl.HandleHistory=function(_79,_7a){
if(window.netscape){
return;
}
var _7b=$get(_79+"_History");
if(_7b==null){
_7b=document.createElement("iframe");
_7b.id=_79+"_History";
_7b.name=_79+"_History";
_7b.style.width="0px";
_7b.style.height="0px";
_7b.src="javascript:''";
_7b.style.visibility="hidden";
var _7c=function(e){
if(!Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory){
Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory=true;
return;
}
var _7e="";
var _7f="";
var _80=_7b.contentWindow.document.getElementById("__DATA");
if(!_80){
return;
}
var _81=_80.value.split("&");
for(var i=0,_83=_81.length;i<_83;i++){
var _84=_81[i].split("=");
if(_84[0]=="__EVENTTARGET"){
_7e=_84[1];
}
if(_84[0]=="__EVENTARGUMENT"){
_7f=_84[1];
}
var _85=document.getElementById(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(_84[0]));
if(_85!=null){
Telerik.Web.UI.RadAjaxControl.RestorePostData(_85,Telerik.Web.UI.RadAjaxControl.DecodePostData(_84[1]));
}
}
if(_7e!=""){
var _85=document.getElementById(Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(_7e));
if(_85!=null){
__doPostBack(_7e,Telerik.Web.UI.RadAjaxControl.DecodePostData(_7f),_79);
}
}
};
$addHandler(_7b,"load",_7c);
document.body.appendChild(_7b);
}
if(Telerik.Web.UI.RadAjaxControl.History[_7a]==null){
Telerik.Web.UI.RadAjaxControl.History[_7a]=true;
Telerik.Web.UI.RadAjaxControl.AddHistoryEntry(_7b,_7a);
}
};
Telerik.Web.UI.RadAjaxControl.AddHistoryEntry=function(_86,_87){
Telerik.Web.UI.RadAjaxControl.ShouldLoadHistory=false;
_86.contentWindow.document.open();
_86.contentWindow.document.write("<input id='__DATA' name='__DATA' type='hidden' value='"+_87+"' />");
_86.contentWindow.document.close();
if(window.netscape){
_86.contentWindow.document.location.hash="#'"+new Date()+"'";
}
};
Telerik.Web.UI.RadAjaxControl.DecodePostData=function(_88){
if(decodeURIComponent){
return decodeURIComponent(_88);
}else{
return unescape(_88);
}
};
Telerik.Web.UI.RadAjaxControl.RestorePostData=function(_89,_8a){
if(_89.tagName.toLowerCase()=="select"){
for(var i=0,_8c=_89.options.length;i<_8c;i++){
if(_8a.indexOf(_89.options[i].value)!=-1){
_89.options[i].selected=true;
}
}
}
if(_89.tagName.toLowerCase()=="input"&&(_89.type.toLowerCase()=="text"||_89.type.toLowerCase()=="hidden")){
_89.value=_8a;
}
if(_89.tagName.toLowerCase()=="input"&&(_89.type.toLowerCase()=="checkbox"||_89.type.toLowerCase()=="radio")){
_89.checked=_8a;
}
};
Telerik.Web.UI.RadAjaxControl.GetNodeNextSibling=function(_8d){
if(_8d!=null&&_8d.nextSibling!=null){
return _8d.nextSibling;
}
return null;
};
Telerik.Web.UI.RadAjaxControl.InsertAtLocation=function(_8e,_8f,_90){
if(_90!=null){
return _8f.insertBefore(_8e,_90);
}else{
return _8f.appendChild(_8e);
}
};
Telerik.Web.UI.RadAjaxControl.FocusElement=function(_91){
var _92=document.getElementById(_91);
if(_92){
var _93=_92.tagName;
var _94=_92.type;
if(_93.toLowerCase()=="input"&&(_94.toLowerCase()=="checkbox"||_94.toLowerCase()=="radio")){
window.setTimeout(function(){
try{
_92.focus();
}
catch(e){
}
},500);
}else{
try{
Telerik.Web.UI.RadAjaxControl.SetSelectionFocus(_92);
_92.focus();
}
catch(e){
}
}
}
};
Telerik.Web.UI.RadAjaxControl.SetSelectionFocus=function(_95){
if(_95.createTextRange==null){
return;
}
var _96=null;
try{
_96=_95.createTextRange();
}
catch(e){
}
if(_96!=null){
_96.moveStart("textedit",_96.text.length);
_96.collapse(false);
_96.select();
}
};
Telerik.Web.UI.RadAjaxControl.panelsToClear=[];
Telerik.Web.UI.RadAjaxControl.UpdateElement=function(id,_98){
var _99=$get(id);
if(_99!=null){
_99.innerHTML=_98;
var _9a=Telerik.Web.UI.RadAjaxControl.GetScriptsSrc(_98);
for(var i=0,_9c=_9a.length;i<_9c;i++){
Telerik.Web.UI.RadAjaxControl.IncludeClientScript(_9a[i]);
}
_9a=Telerik.Web.UI.RadAjaxControl.GetTags(_98,"script");
for(var i=0,_9c=_9a.length;i<_9c;i++){
var _9d=_9a[i];
if(_9d.inner!=""){
Telerik.Web.UI.RadAjaxControl.EvalScriptCode(_9d.inner);
}
}
var _9e=document.getElementsByTagName("head")[0];
var _9f=Telerik.Web.UI.RadAjaxControl.GetLinkHrefs(_98);
for(var i=0,_9c=_9f.length;i<_9c;i++){
var _a0=_9f[i];
var _a1=document.createElement("link");
_a1.setAttribute("rel","stylesheet");
_a1.setAttribute("href",_a0);
_9e.appendChild(_a1);
}
}
};
Telerik.Web.UI.RadAjaxControl.IncludeClientScript=function(src){
var _a3=(window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
_a3.open("GET",src,false);
_a3.send(null);
if(_a3.status==200){
var _a4=_a3.responseText;
Telerik.Web.UI.RadAjaxControl.EvalScriptCode(_a4);
}
};
Telerik.Web.UI.RadAjaxControl.EvalScriptCode=function(_a5){
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_a5=_a5.replace(/^\s*<!--((.|\n)*)-->\s*$/mi,"$1");
}
var _a6=document.createElement("script");
_a6.setAttribute("type","text/javascript");
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_a6.appendChild(document.createTextNode(_a5));
}else{
_a6.text=_a5;
}
var _a7=document.getElementsByTagName("head")[0];
_a7.appendChild(_a6);
if(Telerik.Web.UI.RadAjaxControl.IsSafari()){
_a6.innerHTML="";
}else{
_a6.parentNode.removeChild(_a6);
}
};
Telerik.Web.UI.RadAjaxControl.GetTags=function(_a8,_a9){
var _aa=[];
var _ab=_a8;
while(1){
var _ac=Telerik.Web.UI.RadAjaxControl.GetTag(_ab,_a9);
if(_ac.index==-1){
break;
}
_aa[_aa.length]=_ac;
var _ad=_ac.index+_ac.outer.length;
_ab=_ab.substring(_ad,_ab.length);
}
return _aa;
};
Telerik.Web.UI.RadAjaxControl.GetTag=function(_ae,_af,_b0){
if(typeof (_b0)=="undefined"){
_b0="";
}
var _b1=new RegExp("<"+_af+"[^>]*>((.|\n|\r)*?)</"+_af+">","i");
var _b2=_ae.match(_b1);
if(_b2!=null&&_b2.length>=2){
return {outer:_b2[0],inner:_b2[1],index:_b2.index};
}else{
return {outer:_b0,inner:_b0,index:-1};
}
};
Telerik.Web.UI.RadAjaxControl.GetLinkHrefs=function(_b3){
var _b4=_b3;
var _b5=[];
while(1){
var _b6=_b4.match(/<link[^>]*href=('|")?([^'"]*)('|")?([^>]*)>.*?(<\/link>)?/i);
if(_b6==null||_b6.length<3){
break;
}
var _b7=_b6[2];
_b5[_b5.length]=_b7;
var _b8=_b6.index+_b7.length;
_b4=_b4.substring(_b8,_b4.length);
}
return _b5;
};
Telerik.Web.UI.RadAjaxControl.GetScriptsSrc=function(_b9){
var _ba=_b9;
var _bb=[];
while(1){
var _bc=_ba.match(/<script[^>]*src=('|")?([^'"]*)('|")?([^>]*)>.*?(<\/script>)?/i);
if(_bc==null||_bc.length<3){
break;
}
var _bd=_bc[2];
_bb[_bb.length]=_bd;
var _be=_bc.index+_bd.length;
_ba=_ba.substring(_be,_ba.length);
}
return _bb;
};
Telerik.Web.UI.RadAjaxControl.IsSafari=function(){
return (navigator.userAgent.match(/safari/i)!=null);
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxLoadingPanel=function(_bf){
Telerik.Web.UI.RadAjaxLoadingPanel.initializeBase(this,[_bf]);
this._uniqueID="";
this._minDisplayTime=0;
this._initialDelayTime=0;
this._isSticky=false;
this._transparency=0;
this._manager=null;
this._zIndex=90000;
this.UniqueID=this._uniqueID;
this.MinDisplayTime=this._minDisplayTime;
this.InitialDelayTime=this._initialDelayTime;
this.IsSticky=this._isSticky;
this.Transparency=this._transparency;
this.ZIndex=this._zIndex;
};
Telerik.Web.UI.RadAjaxLoadingPanel.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxLoadingPanel.callBaseMethod(this,"initialize");
},dispose:function(){
Telerik.Web.UI.RadAjaxLoadingPanel.callBaseMethod(this,"dispose");
},get_zIndex:function(){
return this._zIndex;
},set_zIndex:function(_c0){
if(this._zIndex!=_c0){
this._zIndex=_c0;
}
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_c1){
if(this._uniqueID!=_c1){
this._uniqueID=_c1;
window[Sys.WebForms.PageRequestManager.getInstance()._uniqueIDToClientID(this._uniqueID)]=this;
}
},get_initialDelayTime:function(){
return this._initialDelayTime;
},set_initialDelayTime:function(_c2){
if(this._initialDelayTime!=_c2){
this._initialDelayTime=_c2;
}
},get_isSticky:function(){
return this._isSticky;
},set_isSticky:function(_c3){
if(this._isSticky!=_c3){
this._isSticky=_c3;
}
},get_minDisplayTime:function(){
return this._minDisplayTime;
},set_minDisplayTime:function(_c4){
if(this._minDisplayTime!=_c4){
this._minDisplayTime=_c4;
}
},get_transparency:function(){
return this._transparency;
},set_transparency:function(_c5){
if(this._transparency!=_c5){
this._transparency=_c5;
}
},show:function(_c6){
var _c7=$get(_c6+"_wrapper");
if((typeof (_c7)=="undefined")||(!_c7)){
_c7=$get(_c6);
}
var _c8=this.get_element();
if(!(_c7&&_c8)){
return false;
}
var _c9=this._initialDelayTime;
var _ca=this;
var _cb=(!this._isSticky)?this.cloneLoadingPanel(_c8,_c6):_c8;
if(_c9){
window.setTimeout(function(){
try{
if(_ca._manager!=null&&_ca._manager._isRequestInProgress){
_ca.displayLoadingElement(_cb,_c7);
}
}
catch(e){
}
},_c9);
}else{
this.displayLoadingElement(_cb,_c7);
}
return true;
},hide:function(_cc){
var _cd=$get(_cc);
var _ce=String.format("{0}_wrapper",_cc);
var _cf=$get(_ce);
if(_cf){
_cd=_cf;
}
if(this.get_element()==null){
return;
}
var _d0=(!this._isSticky)?$get(this.get_element().id+_cc):this.get_element();
var now=new Date();
if(_d0==null){
return;
}
var _d2=now-_d0._startDisplayTime;
var _d3=this._minDisplayTime;
if(this._isSticky){
if(_d3>_d2){
window.setTimeout(function(){
_d0.style.display="none";
},_d3);
}else{
_d0.style.display="none";
}
}else{
if(_d3>_d2){
window.setTimeout(function(){
_d0.parentNode.removeChild(_d0);
if(typeof (_cd)!="undefined"&&(_cd!=null)){
_cd.style.visibility="visible";
}
},_d3);
}else{
_d0.parentNode.removeChild(_d0);
if(typeof (_cd)!="undefined"&&(_cd!=null)){
_cd.style.visibility="visible";
}
}
}
},cloneLoadingPanel:function(_d4,_d5){
var _d6=_d4.cloneNode(false);
_d6.innerHTML=_d4.innerHTML;
_d6.id=_d4.id+_d5;
document.body.insertBefore(_d6,document.body.firstChild);
return _d6;
},displayLoadingElement:function(_d7,_d8){
if(!this._isSticky){
var _d9=this.getElementRectangle(_d8);
_d7.style.position="absolute";
_d7.style.width=_d9.width+"px";
_d7.style.height=_d9.height+"px";
_d7.style.left=_d9.left+"px";
_d7.style.top=_d9.top+"px";
_d7.style.textAlign="center";
_d7.style.zIndex=this._zIndex;
var _da=100-parseInt(this._transparency);
if(parseInt(this._transparency)>0){
if(_d7.style&&_d7.style.MozOpacity!=null){
_d7.style.MozOpacity=_da/100;
}else{
if(_d7.style&&_d7.style.opacity!=null){
_d7.style.opacity=_da/100;
}else{
if(_d7.style&&_d7.style.filter!=null){
_d7.style.filter="alpha(opacity="+_da+");";
}
}
}
}else{
_d8.style.visibility="hidden";
}
}
_d7.style.display="";
_d7._startDisplayTime=new Date();
},getElementRectangle:function(_db){
if(!_db){
_db=this;
}
var _dc=$telerik.getLocation(_db);
var _dd=_dc.x;
var top=_dc.y;
var _df=_db.offsetWidth;
var _e0=_db.offsetHeight;
return {"left":_dd,"top":top,"width":_df,"height":_e0};
}};
Telerik.Web.UI.RadAjaxLoadingPanel.registerClass("Telerik.Web.UI.RadAjaxLoadingPanel",Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxManager=function(_e1){
Telerik.Web.UI.RadAjaxManager.initializeBase(this,[_e1]);
this._ajaxSettings=[];
this._defaultLoadingPanelID="";
this._initiators={};
this._loadingPanelsToHide=[];
this._isRequestInProgress=false;
this.Type="Telerik.Web.UI.RadAjaxManager";
this._updatePanelsRenderMode=null;
this.AjaxSettings=this._ajaxSettings;
this.DefaultLoadingPanelID=this._defaultLoadingPanelID;
};
Telerik.Web.UI.RadAjaxManager.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"initialize");
var _e2=this.get_element();
if(_e2!=null&&_e2.parentNode!=null&&_e2.parentNode.id==_e2.id+"SU"){
_e2.parentNode.style.display="none";
}
var _e3=this.get_ajaxSettings();
for(var i=0,_e5=_e3.length;i<_e5;i++){
this._initiators[_e3[i].InitControlID]=_e3[i].UpdatedControls;
}
},dispose:function(){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"dispose");
},get_ajaxSettings:function(){
return this._ajaxSettings;
},set_ajaxSettings:function(_e6){
if(this._ajaxSettings!=_e6){
this._ajaxSettings=_e6;
}
},get_defaultLoadingPanelID:function(){
return this._defaultLoadingPanelID;
},set_defaultLoadingPanelID:function(_e7){
if(this._defaultLoadingPanelID!=_e7){
this._defaultLoadingPanelID=_e7;
}
},get_updatePanelsRenderMode:function(){
return this._updatePanelsRenderMode;
},set_updatePanelsRenderMode:function(_e8){
if(this._updatePanelsRenderMode!=_e8){
this._updatePanelsRenderMode=_e8;
this._applyUpdatePanelsRenderMode(_e8);
}
},_applyUpdatePanelsRenderMode:function(_e9){
var _ea=Sys.WebForms.PageRequestManager.getInstance();
var ids=_ea._updatePanelClientIDs;
for(var i=0;i<ids.length;i++){
var _ed=$get(ids[i]);
if(_ed){
if(_ed.tagName.toLowerCase()=="span"){
continue;
}
_ed.style.display=(_e9==0)?"block":"inline";
}
}
},showLoadingPanels:function(id,_ef){
for(var i=0,_f1=_ef.length;i<_f1;i++){
if(_ef[i].InitControlID==id){
var _f2=_ef[i];
for(var j=0,_f4=_f2.UpdatedControls.length;j<_f4;j++){
var _f5=_f2.UpdatedControls[j];
var _f6=_f5.PanelID;
if(_f6==""){
_f6=this._defaultLoadingPanelID;
}
var _f7=_f5.ControlID;
if(_f7==this._uniqueID){
continue;
}
var _f8=$find(_f6);
if(_f8!=null){
_f8._manager=this;
if(_f8.show(_f7)){
var obj={"Panel":_f8,"ControlID":_f7};
if(!Array.contains(this._loadingPanelsToHide,obj)){
this._loadingPanelsToHide[this._loadingPanelsToHide.length]=obj;
}
}
}
}
}
}
},_initializeRequest:function(_fa,_fb){
Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"_initializeRequest",[_fa,_fb]);
if(!this._isRequestInProgress){
return;
}
var _fc=_fb.get_postBackElement();
if(_fc!=null){
if(this._initiators[_fc.id]){
this.showLoadingPanels(_fc.id,this.get_ajaxSettings());
}else{
var _fd=_fc.parentNode;
var _fe=false;
while(_fd!=null){
if(_fd.id&&this._initiators[_fd.id]){
_fe=true;
break;
}
_fd=_fd.parentNode;
}
if(_fe){
this.showLoadingPanels(_fd.id,this.get_ajaxSettings());
}
}
}
},updateElement:function(id,html){
Telerik.Web.UI.RadAjaxControl.UpdateElement(id,html);
}};
Telerik.Web.UI.RadAjaxManager.registerClass("Telerik.Web.UI.RadAjaxManager",Telerik.Web.UI.RadAjaxControl);
Telerik.Web.UI.RadAjaxManager.UpdateElement=function(id,html){
Telerik.Web.UI.RadAjaxControl.UpdateElement(id,html);
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadAjaxPanel=function(_103){
Telerik.Web.UI.RadAjaxPanel.initializeBase(this,[_103]);
this._loadingPanelID="";
this._loadingPanelsToHide=[];
this.Type="Telerik.Web.UI.RadAjaxPanel";
this.LoadingPanelID=this._loadingPanelID;
};
Telerik.Web.UI.RadAjaxPanel.prototype={initialize:function(){
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"initialize");
},dispose:function(){
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"dispose");
},_initializeRequest:function(_104,args){
Telerik.Web.UI.RadAjaxPanel.callBaseMethod(this,"_initializeRequest",[_104,args]);
if(!this._isRequestInProgress){
return;
}
var _106=args.get_postBackElement();
if(_106!=null&&(_106==this.get_element()||this.isChildOf(_106,this.get_element()))){
var _107=$find(this._loadingPanelID);
if(_107!=null){
_107._manager=this;
if(_107.show(this.get_element().id)){
var obj={"Panel":_107,"ControlID":this.get_element().id};
if(!Array.contains(this._loadingPanelsToHide,obj)){
this._loadingPanelsToHide[this._loadingPanelsToHide.length]=obj;
}
}
}
}
},get_loadingPanelID:function(){
return this._loadingPanelID;
},set_loadingPanelID:function(_109){
if(this._loadingPanelID!=_109){
this._loadingPanelID=_109;
}
}};
Telerik.Web.UI.RadAjaxPanel.registerClass("Telerik.Web.UI.RadAjaxPanel",Telerik.Web.UI.RadAjaxControl);


/* END Telerik.Web.UI.Ajax.Ajax.js */
/* START Infragistics.Web.UI.Scripts.0_igControlMain.js */
Type.registerNamespace("Infragistics.Web.UI");

var $IG = Infragistics.Web.UI;

if (typeof ig_controls != "object")
	var ig_controls = new Object();


$IG.ControlMainProps = new function()
{
	/// <summary>For internal use only.</summary>
	this.Flags = [0, 0];
	this.Count = 1;
};



$IG.ControlMain = function(elem)
{
	///<summary>
	/// The client side base class for all Infragistics.Web.UI.Controls.
	///</summary>
	$IG.ControlMain.initializeBase(this, [elem]);
	this._elements = {};
	this._callbackManager = new $IG.ControlCallbackManager(this);
	this._callbackManager.setResponseComplete(this._responseComplete, this);
}
$IG.ControlMain.prototype =
{
	
	initialize: function()
	{
		///<summary>
		/// For Internal Use Only.
		/// Called from the control's constructor, it sets up all information needed by the control.
		///</summary>	    
		this._setupCollections();
		//var now1  = new Date();

		this.__walkThrough(this._element, true);

		this._setupMarkerElements();
		$IG.ControlMain.callBaseMethod(this, 'initialize');
		this.__attachEvents();
		this.__attachOtherEvents();
		this._uniqueID = this._get_clientOnlyValue("uid");
		ig_controls[this._id] = this;

		var clientState = document.getElementById(this._id + "_clientState");
		if (clientState && clientState.value)
		{
			this.__previousClientState = clientState.value;
			clientState.value = "";
		}

		var rm = null;
		try
		{
			rm = Sys.WebForms.PageRequestManager.getInstance();
		} catch (e) { }
		if (rm && !rm._ig_onsubmit)
		{
			rm._ig_onsubmit = rm._onsubmit;
			if (!rm._ig_onsubmit)
				rm._ig_onsubmit = 2;
			var form = rm._form;
			if (form && typeof theForm == 'object')
				form = theForm;
			if (form && !form._ig_submit)
			{
				form._ig_submit = form.submit;
				form.submit = function()
				{
					try
					{
						if (typeof ig_controls == 'object')
							for (var id in ig_controls)
							ig_controls[id]._onIgSubmit();
					} catch (e) { }
					if (this._ig_submit)
						this._ig_submit();
				}
			}
			rm._onsubmit = function()
			{
				if (typeof ig_controls == 'object')
					for (var id in ig_controls)
					ig_controls[id]._onIgSubmit();
				if (typeof this._ig_onsubmit == 'function') try
				{
					if (this._ig_onsubmit() === false)
						return false;
				} catch (id) { }
				return true;
			}
		}
	},

	dispose: function()
	{
		///<summary>
		/// For Internal Use Only.
		/// Disposes of all objects that belong to the control.
		///</summary>
		if (this._objectsManager)
			this._objectsManager.dispose();
		if (this._collectionsManager)
			this._collectionsManager.dispose();
		if (this._callbackManager)
			this._callbackManager.dispose();
		if (this.get_element())
			$clearHandlers(this.get_element());
		this.__clearOtherEvents();

		if (this._flags != null)
			this._flags.dispose();

		this._dataStore = null;
		for (var p in this._elements)
			delete this._elements[p];

		$IG.ControlMain.callBaseMethod(this, 'dispose');
	},
	

	
	__attachEvents: function()
	{
		this._addHandlers();
		if (this._handlers && this._handlers.length > 0)
		{
			var evnts = {};
			for (var i in this._handlers)
			{
				var evnt = this._handlers[i];
				evnts[evnt] = this._onEventHandler;
			}
			$addHandlers(this.get_element(), evnts, this);
		}
	},

	__clearOtherEvents: function()
	{
		for (var array in this._otherHandlers)
		{
			for (var evnt in this._otherHandlers[array])
			{
				var element = this._otherHandlers[array][evnt];
				if (element._events && element._events[evnt] && element._events[evnt].length > 0)
					try
				{
					$removeHandler(element, evnt, this.__otherHandlerDelegate);
				} catch (exc) { }
			}
		}
		this._otherHandlers = null;
	},

	__attachOtherEvents: function()
	{
		this._addOtherHandlers();
		
		this.__otherHandlerDelegate = Function.createDelegate(this, this._onOtherEventHandler);
		if (this._otherHandlers && this._otherHandlers.length > 0)
		{
			for (var array in this._otherHandlers)
			{
				for (var evnt in this._otherHandlers[array])
					$addHandler(this._otherHandlers[array][evnt], evnt, this.__otherHandlerDelegate);
			}
		}
	},

	_handleEvent: function(elem, adrElement, adr, e)
	{
		var func = this["_on" + e.type.substring(0, 1).toUpperCase() + e.type.substring(1) + "Handler"];
		if (func)
			func.apply(this, [e.target, adr, e]);
	},

	__walkThrough: function(elem, topItem)
	{
		if ($util._initAttr(elem))
		
			if (!topItem)
			return;
		var adr = elem.getAttribute("adr");
		var mkr = elem.getAttribute("mkr");
		var obj = elem.getAttribute("obj");

		if (adr)
			this._createItem(elem, adr);
		else if (obj)
			this._createObject(elem, obj);
		else if (mkr)
		{
			
			var mkrAr = mkr.split(',');
			for (var i = 0; i < mkrAr.length; i++)
			{
				mkr = mkrAr[i];
				
				if (typeof (this._elements[mkr]) != "undefined")
				{
					var mkrElem = this._elements[mkr];
					if (typeof (mkrElem.length) == "undefined")
						mkrElem = this._elements[mkr] = [this._elements[mkr]];
					mkrElem[mkrElem.length] = elem;

				}
				else
					this._elements[mkr] = elem;
			}
		}

		// AK - moved down here. The element itself should be counted, but its children should not.
		// donp - added this check to ensure that we don't walk down into other controls using adr tags (as in templates)
		// control must define this attribute on an element that is not meant to be walked.
		var ctl = elem.getAttribute("nw");
		if (ctl)
			return;

		var children = elem.childNodes;
		for (var i = 0; i < children.length; i++)
		{
			var element = children[i];
			if (element.getAttribute)
				this.__walkThrough(element, false);
		}
	},

	__getViewStateEnabled: function()
	{
		var vse = this._get_clientOnlyValue("vse");
		if (vse == null)
			return true;
		else if (vse == 0)
			return false;
		else if (vse == 1)
			return true;
	},

	

	
	_onEventHandler: function(e)
	{
		var obj = $util.resolveMarkedElement(e.target, true);

		if (obj != null)
		{
			
			if (obj[2] == this)
				this._handleEvent(e.target, obj[0], obj[1], e);
		}
	},

	_onIgSubmit: function()
	{
		
		var oldT = this._ig_submit_time, newT = (new Date()).getTime();
		if (oldT && newT < oldT + 99)
			return;
		this._ig_submit_time = newT;
		this._onSubmitOtherHandler();
	},

	_onOtherEventHandler: function(e)
	{
		if (!e)
			return;
		if (e.type == 'submit')
		{
			this._onIgSubmit();
			return;
		}
		if (e.type != null)
		{
			var func = this["_on" + e.type.substring(0, 1).toUpperCase() + e.type.substring(1) + "OtherHandler"];
			if (func)
				func.apply(this, [e.target, e])
		}
	},

	_onSubmitOtherHandler: function(e)
	{
		var clientState = document.getElementById(this._id + "_clientState");
		if (clientState)
		{
			var vse = this.__getViewStateEnabled();
			var state = [[this._clientStateManager.get_serverProps(vse), this._objectsManager.getServerObjects(vse), this._collectionsManager.getServerCollection(vse)]];

			state[1] = [this._clientStateManager.get_transactionList(),
	                     this._collectionsManager.get_allTransactionLists()];

			state[2] = this._saveAdditionalClientState();

			clientState.value = Sys.Serialization.JavaScriptSerializer.serialize(state);
		}

	},

	_onBeforeunloadOtherHandler: function(e)
	{
	},

	

	
	_setupMarkerElements: function()
	{

	},
	_addHandlers: function()
	{
		
	},

	_addOtherHandlers: function()
	{
		this._registerOtherHandlers([{ "submit": theForm, "beforeunload": window}]);
	},

	_createItem: function(element, adr)
	{

	},

	_createObject: function(element, obj)
	{

	},

	_responseComplete: function(callbackObject, responseObject)
	{

	},

	_responseCompleteError: function(callbackObject, responseObject)
	{

	},

	_setupCollections: function()
	{
		this._itemCollection = this._collectionsManager.register_collection(0, $IG.ObjectCollection);
	},

	_saveAdditionalClientState: function()
	{
	},

	


	

	_set_value: function(index, value)
	{
		this._clientStateManager.set_value(index, value);
	},

	_get_value: function(index, isBool)
	{
		return this._clientStateManager.get_value(index, isBool);
	},

	_get_clientOnlyValue: function(propName)
	{
		return this._clientStateManager.get_clientOnlyValue(propName);
	},

	_get_occasionalProperty: function(propName)
	{
		return this._clientStateManager.get_occasionalProperty(propName);
	},

	_set_occasionalProperty: function(propName, val)
	{
		this._clientStateManager.set_occasionalProperty(propName, val);
	},

	_cancelEvent: function(e)
	{
		e.stopPropagation();
		e.preventDefault();
	},

	_registerHandlers: function(handlers)
	{
		if (!this._handlers)
			this._handlers = [];

		this._handlers = this._handlers.concat(handlers);
	},

	_registerOtherHandlers: function(handlers)
	{
		if (!this._otherHandlers)
			this._otherHandlers = [];

		this._otherHandlers = this._otherHandlers.concat(handlers);
	},

	_add_item: function(adr, item)
	{
		this._items[adr] = item;
		this.__itemCount++;
	},

	_remove_item: function(adr)
	{
		if (adr in this._items)
		{
			delete this._items[adr];
			this.__itemCount--;
		}
	},

	_initClientEvents: function(vals)
	{
		this._initClientEventsForObject(this, vals);
	},
	_initClientEventsForObject: function(owner, vals)
	{
		owner._clientEvents = new Object();
		var i = vals ? vals.length : 0;
		while (i-- > 0)
		{
			var evt = vals[i].split(':');
			this.setClientEvent(owner, evt[0], evt[1], evt[2]);
		}
	},
	
	
	
	
	_postAction: function(args, evtName)
	{
		var act = args._props ? args._props[1] : args;
		if (act == 1)
		{
			
			// ??
			
			
			__doPostBack(this._id, evtName + (args._getPostArgs ? args._getPostArgs() : ''));
			this._posted = true;
		}
		if (act == 2)
		{
			
			// ??
			var cb = this._callbackManager.createCallbackObject();
			
			
			cb.serverContext.eventName = evtName;
			
			var i = args._props ? args._props.length : 0;
			while (--i > 1)
				eval('cb.serverContext.props' + (i - 2) + '="' + args._props[i] + '"');
			if (args._context)
			{
				for (var contextProp in args._context)
					cb.serverContext[contextProp] = args._context[contextProp];
			}
			
			if (this._filterAsyncPostBack)
				this._filterAsyncPostBack(cb.serverContext, evtName, args);
			this._callbackManager.execute(cb);
			this._posted = true;
		}
	},

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	_raiseClientEventStart: function(param)
	{
		var params = param; 
		if (params.substring)
			params = arguments;
		return this._raiseCE_0(this, params[0], this.getClientEventPostBack(params[0]), params[1], params);
	},
	_raiseClientEvent: function(param)
	{
		var args = this._raiseClientEventStart(param.substring ? arguments : param);
		return args ? this._raiseClientEventEnd(args, args._name) : null;
	},
	_raiseClientEventEnd: function(args)
	{
		///<summary>Triggers possible post back to end client event processing.</summary>
		///<param name="args">Event arguments.</param>
		///<returns>First parameter</returns>
		if (args && args._props && !(args.get_cancel && args.get_cancel()))
			this._postAction(args, args._name);
		return args;
	},
	_raiseSenderClientEvent: function(sender, clientEvent, eventArgs)
	{
		///<summary>Raises and triggers post back for a notify event.</summary>
		///<param name="sender">Object that raises the event and contains the clientEvents array.</param>
		///<param name="clientEvent">Client event object.</param>
		///<param name="eventArgs">Event arguments. Generally an object derived from Infragistics.Web.UI.CancelEventArgs.</param>
		///<returns>Event arguments object, the same object that is passed as the third parameter.</returns>
		eventArgs = this._raiseSenderClientEventStart(sender, clientEvent, eventArgs);
		return this._raiseClientEventEnd(eventArgs);
	},
	_raiseSenderClientEventStart: function(sender, clientEvent, eventArgs)
	{
		///<summary>Raises a cancelable before event but does not trigger post back.</summary>
		///<param name="sender">Object that raises the event and contains the clientEvents array.</param>
		///<param name="clientEvent">Client event object.</param>
		///<param name="eventArgs">Event arguments. Generally an object derived from Infragistics.Web.UI.CancelEventArgs.</param>
		///<returns>Event arguments object, the same object that is passed as the third parameter.</returns>
		return this._raiseCE_0(sender, clientEvent.name, clientEvent.postBack, eventArgs);
	},
	_raiseCE_0: function(me, evtName, post, args, params)
	{
		var fnc = me.get_events().getHandler(evtName);
		var str = args && args.substring;
		
		if (!fnc && post == null)
			return str ? null : args;
		if (str)
			eval('try{args = new Infragistics.Web.UI.' + args + 'EventArgs();}catch(ex){args = null;}');
		var i = 1, len = params ? params.length : 0;
		if (!args)
			args = (len < 3) ? new Sys.EventArgs() : new $IG.EventArgs();
		
		if (args._props)
			while (++i < len) if (params[i] != null)
			args._props[i - 2] = params[i];
		
		if (post)
		{
			if (!args._props)
				args._props = new Array();
			if (!args._props[1] || args._props[1] == 0)
				args._props[1] = post;
		}
		
		if (fnc)
			fnc(this, args);
		if (args._props)
			delete args._props[0];
		args._name = evtName;
		return args;
	},

	_getFlags: function()
	{
		if (this._flags == null)
		{
			this.__flagHelper = new $IG.FlagsHelper();
			var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
			this._flags = new $IG.FlagsObject(this._get_value(key), this);
		}
		return this._flags;
	},

	_updateFlags: function(flags)
	{
		var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
		this._set_value(key, flags)
	},

	_ensureFlags: function()
	{
		this._ensureFlag($IG.ClientUIFlags.Visible, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Enabled, $IG.DefaultableBoolean.True);
	},

	__getDefaultFlags: function()
	{
		if (this.__defaultFlags == null)
		{
			this._ensureFlags();
			this.__defaultFlags = this.__flagHelper.calculateFlags();
		}
		return this.__defaultFlags;
	},

	_ensureFlag: function(flag, val)
	{
		this.__flagHelper.updateFlag(flag, val);
	},

	

	

	_get_clientStateManager: function() { return this._clientStateManager; },

	_get_item: function(adr)
	{
		return this._itemCollection._getObjectByAdr(adr);
	},

	

	
	set_id: function(id)
	{
		///<summary>Sets id of control.</summary>
		///<param name="id">Id of control.</param>
		this._id = id;
	},
	get_name: function(name)
	{
		///<summary>
		/// Return's the name of the control. 
		///</summary>
		return this.get_element().name;
	},
	set_name: function(value)
	{
		///<summary>Sets name of html element.</summary>
		///<param name="value">Name for element.</param>
		this.get_element().name = value;
	},
	get_uniqueID: function()
	{
		///<summary>
		/// Return's the Unique ID of the control. 
		///</summary>
		return this._uniqueID
	},

	
	
	addClientEventHandler: function(owner, evtName, fnc)
	{
		///<summary>
		/// Adds a function handler to process a ClientEvent.
		///</summary>
		$util.addClientEvent(owner, evtName, fnc);
	},
	removeClientEventHandler: function(owner, evtName, fnc)
	{
		///<summary>
		/// Removes a function handler of a ClientEvent.
		///</summary>
		$util.removeClientEvent(owner, evtName, fnc);
	},

	getClientEventPostBack: function(name)
	{
		/// <summary>For internal use only.</summary>
		/// <param name="name" type="String" mayBeNull="false">Name of ClienEvent.</param>
		/// <returns type="Number">Postback action.</returns>
		return this.getClientEventPostBackForObject(this, name);
	},
	getClientEventPostBackForObject: function(owner, name)
	{
		/// <summary>For internal use only.</summary>
		/// <param name="owner" type="Object">Reference to owner control.</param>
		/// <param name="name" type="String" mayBeNull="false">Name of ClienEvent.</param>
		/// <returns type="Number">Postback action.</returns>
		var ce = owner._clientEvents[name];
		return ce ? ce.postBack : null;
	},
	setClientEvent: function(owner, evtName, fnc, postBack)
	{
		/// <summary>For internal use only.</summary>
		/// <param name="owner" type="Object">Reference to owner control.</param>
		/// <param name="evtName" type="String" mayBeNull="false">Name of ClientEvent.</param>
		/// <param name="fnc" type="Object">Function to call.</param>
		/// <param name="postBack" type="Number">Postback action.</param>
		
		if (postBack)
			postBack = parseInt(postBack, 10);
		else
			postBack = 0;
		owner._clientEvents[evtName] = { name: evtName, fnc: fnc, postBack: postBack };
		if (evtName && fnc)
			this.addClientEventHandler(owner, evtName, fnc);
	},

	get_props: function()
	{
		///<summary>
		/// For Internal Use Only.
		/// Contains ClientState information for the control.
		///</summary>
		return this._props;
	},
	set_props: function(value)
	{
		/// <summary>Internal use only.</summary>
		/// <param name="value">Properties for subobjects.</param>
		this._dataStore = value;
		this._props = value[0];
		this._clientStateManager = new $IG.ObjectClientStateManager(this._props);
		this._objectsManager = new $IG.ObjectsManager(this, value[1]);
		this._collectionsManager = new $IG.CollectionsManager(this, value[2]);
		this._initClientEvents(value[3]);
	}
	
}
$IG.ControlMain.registerClass('Infragistics.Web.UI.ControlMain', Sys.UI.Control);



$IG.NavControlProps = new function()
{
	this.Count = $IG.ControlMainProps.Count + 0;
};




$IG.NavControl = function(elem)
{
	/// <summary>
	/// Represents a control class for hierarchical data controls. 
	/// </summary>
	$IG.NavControl.initializeBase(this, [elem]);
}

$IG.NavControl.prototype =
{
	initialize: function()
	{
		$IG.NavControl.callBaseMethod(this, 'initialize');
	},

	_setupCollections: function()
	{
		this._itemCollection = this._collectionsManager.register_collection(0, $IG.NavItemCollection);
		this._collectionsManager.registerUIBehaviors(this._itemCollection);
	}
}

$IG.NavControl.registerClass('Infragistics.Web.UI.NavControl', $IG.ControlMain);


/* END Infragistics.Web.UI.Scripts.0_igControlMain.js */
/* START Infragistics.Web.UI.Scripts.2_igCollections.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.ObjectCollection = function(control, clientStateManager, index, manager)
{
    ///<summary>
    /// The base collection class for Infragistics.Web.UI.Controls.
    ///</summary> 
    this._control = control; 
    this._csm = clientStateManager;
    this._index = index;
    this._manager = manager;
    this._items = [];
    this._collectionType = $IG.ObjectCollection;
}

$IG.ObjectCollection.prototype =
{
	_addObject: function(objectType, element, adr)
	{
		var object = new objectType(adr, element, null, this._control, this._csm);

		this._items.push(object);
		this._manager.addObject(this._index, adr, object);
		return object;
	},
	_addExistingObject: function(object, adr, props)
	{
		this._items.push(object);
		this._manager.addObject(this._index, adr, object);
		object._csm = this._csm;
		object._address = adr;
		var currentClientState = this._csm.get_clientState();
		currentClientState[adr] = props;
		this._csm._items = currentClientState;
		return object;
	},
	_createObject: function(adr, element)
	{
	},

	_getObjectByAdr: function(adr)
	{
		return this._manager.getObject(this._index, adr);
	},

	_getObjectByIndex: function(index)
	{
		return this._items[index];
	},

	_getUIBehaviorsObj: function()
	{
		return this._manager.getUIBehaviorsObj(this._index);
	},

	get_length: function()
	{
		///<summary>
		/// The amount of objects in the collection.
		///</summary> 
		return this._manager.getItemCount(this._index);
	},

	get_indexOf: function(item)
	{
		///<summary>
		/// Returns the index of the specifed object.
		/// If the object doesn't exist in the collection, -1 will be returned.
		///</summary>         
		for (var i = 0; i < this._items.length; i++)
			if (this._items[i] == item)
			return i;
		return -1;
	},

	dispose: function()
	{
		///<summary>
		/// Disposes of all objects that belong to the collection.
		///</summary>

		this._control = null;
		this._manager = null;
		this._items = null;
		this._csm = null;
	}
};

$IG.ObjectCollection.registerClass('Infragistics.Web.UI.ObjectCollection');



$IG.NavItemCollection = function(control, clientStateManager, index, manager)
{
    ///<summary>
    /// A collection of Navigation Items.
    ///</summary> 
    $IG.NavItemCollection.initializeBase(this, [control, clientStateManager, index, manager]);
}

$IG.NavItemCollection.prototype = 
{
    _createNewCollection:function()
    {
        return new $IG.NavItemCollection(this._control, this._csm, this._index, this._manager);
    },
    
    _addObject:function(navItemType, element, adr)
    {
       var object = null;
       var newCollection = this._createNewCollection();
       var indexes = adr.split('.');
       if(indexes.length == 1)
       {
          var val = parseInt(adr);
          if(val.toString() != "NaN")
                 object = this._items[val] = new navItemType(adr, element,  null, this._control, this._csm, newCollection, null);
       }
       else
       {
           var parent = this._items[indexes[0]];
           for(var i = 1; i < indexes.length - 1; i++)
           {
               if(parent != null)
                   parent = parent.getItems()._getObjectByIndex(indexes[i]);
           }
             
           if(parent != null)
               object = parent.getItems()._items[indexes[indexes.length-1]] = new navItemType(adr, element, null, this._control, this._csm, newCollection, parent);
       }
       this._manager.addObject(this._index, adr, object);
       return object;
    }
};

$IG.NavItemCollection.registerClass('Infragistics.Web.UI.NavItemCollection', $IG.ObjectCollection);

/* END Infragistics.Web.UI.Scripts.2_igCollections.js */
/* START Infragistics.Web.UI.Scripts.3_igUIBehaviors.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.Behavior = function(element)
{
	/// <summary>Base class for behavior.</summary>
	/// <param name="element" type="Object" mayBeNull="false">Reference to html element.</param>
	$IG.Behavior.initializeBase(this, [element]);
	this._props = [];
}

$IG.Behavior.prototype =
{
	initialize: function()
	{
		/// <summary>Initializes instance of Behavior.</summary>
		$IG.Behavior.callBaseMethod(this, 'initialize');
		if (this._addHandlers)
			this._addHandlers();
	},

	get_owner: function()
	{
		/// <summary>Gets owner object of this behavior.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to owner.</returns>
		return this._owner;
	},
	set_owner: function(value)
	{
		/// <summary>Sets owner object for this behavior. Internal use only.</summary>
		/// <param name="value" type="Object">Reference to owner.</param>
		this._owner = value;
	},

	dispose: function()
	{
		/// <summary>Disposes object and event handlers.</summary>
		ig_ui_timer(this, true);
		var elem = this.get_element();
		if (elem)
			$clearHandlers(elem);
		$IG.Behavior.callBaseMethod(this, 'dispose');
	},

	
	get_control: function()
	{
		/// <summary>Gets owner control of this behavior.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to control.</returns>
		return this._control;
	},
	set_control: function(value)
	{
		/// <summary>Sets owner control for this behavior. Internal use only.</summary>
		/// <param name="value" type="Object">Reference to control.</param>
		this._control = value;
	},

	
	_prefix: '',

	
	getTargetElement: function()
	{
		/// <summary>Gets target html element of this behavior.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to html element.</returns>
		var e = this._targetElem;
		if (!e)
			e = this._targetElem = this.get_element();
		return e;
	},
	get_targetHtmlElementID: function()
	{
		/// <summary>Gets id of target html element of this behavior.</summary>
		/// <returns type="String" mayBeNull="true">Id of html element.</returns>
		return this._elemID;
	},
	set_targetHtmlElementID: function(val)
	{
		/// <summary>Sets id of target html element.</summary>
		/// <param name="val" type="String">Id of element.</param>
		if (this._elemID)
			return;
		this._elemID = val;
		this._targetElem = document.getElementById(val);
	},
	get_stateID: function()
	{
		/// <summary>Gets id of html element used to persist state to server. Internal use only.</summary>
		/// <returns type="String" mayBeNull="true">Id of html element.</returns>
		return this._stateID;
	},
	set_stateID: function(val)
	{
		/// <summary>Sets id of html element used to persist state to server. Internal use only.</summary>
		/// <param name="val" type="String">Id of element.</param>
		if (!this._stateID)
			this._stateID = val;
	},
	get_stateValue: function()
	{
		/// <summary>Gets value of persistant state. Internal use only.</summary>
		/// <returns type="String" mayBeNull="true">Value which can be passed to server.</returns>
		return this._stateValue;
	},
	set_stateValue: function(val, save)
	{
		/// <summary>Sets value of persistant state. Internal use only.</summary>
		/// <param name="val" type="String">Value which can be passed to server.</param>
		/// <param name="save" type="Boolean">Request to pass value to server.</param>
		this._stateValue = val;
		if (!this._stateID || !save)
			return;
		var e = document.getElementById(this._stateID);
		if (e)
			e.value = val;
	},
	_get_: function(i)
	{
		return this._props[i];
	},
	_set_: function(i, val, evtName)
	{
		this._props[i] = val;
		if (evtName)
			$util.addClientEvent(this, evtName, val);
	},
	
	
	
	
	
	
	
	_raiseClientEvent: function()
	{
		if (this._control)
			return this._control._raiseClientEvent(arguments);
		var args = arguments[1];
		var fnc = this.get_events().getHandler(arguments[0]); 
		var str = args && args.substring;
		if (!fnc)
			return str ? null : args;
		if (str)
			eval('try{args = new Infragistics.Web.UI.' + args + 'EventArgs();}catch(ex){args = null;}');
		var i = 1, len = arguments.length;
		if (!args)
			args = (len < 3) ? new Sys.EventArgs() : new $IG.EventArgs();
		
		if (args._props) while (++i < len)
			args._props[i - 2] = arguments[i];
		
		fnc(this, args);
		if (args._props)
			delete args._props[0];
		return args;
	}
}
$IG.Behavior.registerClass('Infragistics.Web.UI.Behavior', Sys.UI.Behavior);



$IG.UIBehaviorsObject = function(control, collection)
{
	///<summary>
	/// This class is for Internal Use Only.
	/// A behavior that controls Selection, Hovering, Dragging, and Dropping, for a specified ObjectColection.
	///</summary> 
	this._control = control;
	this._collection = collection;
	this._selectedItems = [];
	this._handlers = { "mousedown": this.handleEvent, "mouseover": this.handleEvent, "mouseout": this.handleEvent };
	var flags = control._getFlags();
	var draggable = flags.getDraggable();
	var droppable = flags.getDroppable();
	if ((draggable || droppable) && $IG.DragDropBehavior)
	{
		var ddb = new $IG.DragDropBehavior();
		var events = ddb.get_events();
		if (draggable)
		{
			ddb.addSourceObject(control);
			events.addDragStartHandler(Function.createDelegate(this, this.dragStart));
		}
		if (droppable)
		{
			ddb.addTargetObject(control, true);
			events.addDropHandler(Function.createDelegate(this, this.drop));
			events.addDragCancelHandler(Function.createDelegate(this, this.dragCancel));
			events.addDragMoveHandler(Function.createDelegate(this, this.dragMove));
			events.addDragEnterHandler(Function.createDelegate(this, this.dragEnter));
			events.addDragLeaveHandler(Function.createDelegate(this, this.dragLeave));
		}
		events.addDragEndHandler(Function.createDelegate(this, this.dragEnd));
		this._ddb = ddb;
	}

	$addHandlers(control.get_element(), this._handlers, this);
}

$IG.UIBehaviorsObject.prototype =
{
	handleEvent: function(e)
	{
		///<summary>
		/// Handles all targeted browser events that are being listened to on the control's root element.
		/// It then determines if it should cause a behavior to occur. It it concludes that a behavior should occur, then
		/// it raises the correct functionality. 
		///</summary> 
		var item = this.getItemFromElem(e.target);
		if (item)
		{
			
			if (item._owner != this._control)
				return;
			else if (e.type == "mouseover")
				this.hover(item, e);
			else if (e.type == "mouseout")
				this.unhover(item, e);
			else if (e.type == "mousedown")
				this.select(item, e);
		}
	},

	getItemFromElem: function(elem)
	{
		///<summary>
		/// If there is an item asociated with the element, or a parent of the element, the item is returned.
		/// Otherwise null is returned.
		///</summary>
		var item = null;
		var adr = null;
		while (elem)
		{
			if (elem.getAttribute)
				adr = elem.getAttribute("adr");
			if (adr != null)
				break;
			elem = elem.parentNode;
		}
		if (elem != null)
		{
			item = elem._object;
			if (item == null)
			{
				item = this._collection._createObject(adr, elem);
				if (item == null)
					item = elem._object;
			}
		}
		return item;
	},

	select: function(item, e)
	{
		///<summary>
		/// If an item is selectable and enabled, it adds the item to it's internal selected items list, and
		/// calls the _selectItem method off of the associated control.
		///</summary>
		var itemFlags = item._getFlags();
		var selectable = itemFlags.getSelectable(this._control);
		var enabled = itemFlags.getEnabled(this._control);

		if (selectable && enabled)
		{
			if (this._control._shouldSelect != null && e)
				if (!this._control._shouldSelect(item, e))
				return;
			var old = this._selectedItems[0];
			if (old != item)
			{
				if (old)
				{
					old._getFlags().setSelected(false);
					this._control._selectItem(old, false);
				}
				this._selectedItems[0] = item;
				itemFlags.setSelected(true);
				this._control._selectItem(item, true);
			}
		}
		if (e)
		{
			this._mouseDown = true;
			$util.cancelEvent(e);
		}
	},

	unSelectAll: function()
	{
		///<summary>
		/// Removes the item from the internal selected items list, and 
		/// calls the _selectItem method off of the associated control, with a parameter of false
		///</summary>
		if (this._selectedItems != null && this._selectedItems.length > 0)
		{
			for (var i in this._selectedItems)
			{
				var item = this._selectedItems[i];
				item._getFlags().setSelected(false);
				this._control._selectItem(item, false);
			}
		}
		this._selectedItems = [];
	},

	getSelectedItems: function()
	{
		///<summary>
		/// Returns an array of all selected items.
		///</summary>
		return this._selectedItems;
	},

	hover: function(item, e)
	{
		///<summary>
		/// Calls the associated control's _shouldHover method first. 
		/// If it returns true, or the control doesn't implement _shouldHover, then
		/// the _hoverItem method is called on the control with a parameter of true.
		///</summary>
		if (this._control._shouldHover != null && e)
			if (!this._control._shouldHover(item, e))
			return;
		this._hover(item, true);
	},

	unhover: function(item, e)
	{
		///<summary>
		/// Calls the associated control's _shouldHover method first. 
		/// If it returns true, or the control doesn't implement _shouldHover, then
		/// the _hoverItem method is called on the control with a parameter of false.
		///</summary>
		if (this._control._shouldHover != null && e)
			if (!this._control._shouldHover(item, e))
			return;
		this._hover(item, false);
	},

	setDragDropNotification: function(notify)
	{
		///<summary>
		/// Sets whether or not the control should be notified for each element that is dragged
		/// over in the control, or if it should just be notified the first time the mouse enters the control.
		///</summary>
		this._controlDDNotification = notify;
	},

	dragStart: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragStart event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragStart method. 
		///</summary> 
		if (this._control.__dragStart)
		{
			var manager = evntArgs.get_manager();
			var elem = manager.get_sourceElement();
			var item = this.getItemFromElem(elem);
			if (item != null)
			{
				manager.set_dataObject(item);
				this._control.__dragStart(this, item, behavior, evntArgs);
			}
			else
				evntArgs.set_cancel(true);
		}
	},

	dragEnter: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragEnter event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragEnter method. 
		///</summary> 
		this._fireDragDropEvnt(this._control.__dragEnter, behavior, evntArgs, true);
	},

	dragLeave: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragLeave event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragLeave method. 
		///</summary> 
		this._fireDragDropEvnt(this._control.__dragLeave, behavior, evntArgs, false);
	},

	dragMove: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragMove event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragMove method. 
		///</summary> 
		this._fireDragDropEvnt(this._control.__dragMove, behavior, evntArgs, false);
	},

	dragCancel: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragCancel event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragCancel method. 
		///</summary> 
		if (this._control.__dragCancel)
			this._control.__dragCancel(this, behavior, evntArgs);
	},

	dragEnd: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the DragEnd event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __dragEnd method. 
		///</summary>
		this._fireDragDropEvnt(this._control.__dragEnd, behavior, evntArgs, false);
	},

	drop: function(behavior, evntArgs)
	{
		///<summary>
		/// Handles the Drop event off the DragDropBehavior and passes the 
		/// information to the control, if the control implements the __drop method. 
		///</summary>
		this._fireDragDropEvnt(this._control.__drop, behavior, evntArgs, false);
	},

	_fireDragDropEvnt: function(method, behavior, evntArgs, cancelable)
	{
		if (method)
		{
			method = Function.createDelegate(this._control, method);
			var item = this.getItemFromElem(evntArgs.get_manager().get_targetElement());
			if (item != null || (item == null && this._controlDDNotification))
				method(this, item, behavior, evntArgs);
			else if (cancelable)
				evntArgs.set_cancel(true);
		}
	},

	_hover: function(item, val)
	{
		var itemFlags = item._getFlags();
		var hoverable = itemFlags.getHoverable(this._control);
		var enabled = itemFlags.getEnabled(this._control);

		if (hoverable == $IG.DefaultableBoolean.True && enabled == $IG.DefaultableBoolean.True)
		{
			this._control._hoverItem(item, val);
			itemFlags.setHovered(val);
		}
	},

	dispose: function()
	{
		///<summary>
		/// Disposes of any objects created by the behavior.
		///</summary>
		if (this._ddb)
			this._ddb.dispose();
		$clearHandlers(this._control.get_element());
	}


};
$IG.UIBehaviorsObject.registerClass("Infragistics.Web.UI.UIBehaviorsObject");





$IG.NotifySizeChangedBehavior = function(element, handler, interval)
{
	this._handlers = [];
	this._element = element;
	if (interval != null)
		this._interval = interval;
	else
		this._interval = 100;

	if (element != null)
	{
		this._prevOffsetHeight = this._element.offsetHeight;
		this._prevOffsetWidth = this._element.offsetWidth;
	}

	if (handler != null)
		this.addResizeHandler(handler);
}

$IG.NotifySizeChangedBehavior.prototype =
{
	addResizeHandler: function(handler)
	{
		if (handler != null)
		{
			if ($util.IsIE)
			{
				this._onResizeHandler = Function.createDelegate(this, this._onTick);
				$addHandler(this._element, "resize", this._onResizeHandler);
			}
			else if (this._intervalId == null)
				this._intervalId = window.setInterval(Function.createDelegate(this, this._onTick), this._interval);
			this._handlers.push(handler);
		}
	},

	removeResizeHandler: function(handler)
	{
		Array.remove(this._handlers, handler);
		if (this._handlers.length == 0)
		{
			window.clearInterval(this._intervalId);
			this._intervalId = null;
		}
	},

	dispose: function()
	{
		if (this._onResizeHandler)
		{
			$removeHandler(this._element, "resize", this._onResizeHandler);
			this._onResizeHandler = null;
		}
		else if (this._intervalId != null)
			window.clearInterval(this._intervalId);

		this._handlers = null;
		this._element = null;
	},

	_onTick: function()
	{		
		var elem = this._element;
		if (!elem || !this._handlers)
			return;
		var height = elem.offsetHeight, width = elem.offsetWidth;
		if ((!height && !width) || (height == 0 && width == 0) || (height == this._prevOffsetHeight && width == this._prevOffsetWidth))
			return;
		var e = { oldOffsetHeight: this._prevOffsetHeight, oldOffsetWidth: this._prevOffsetWidth,
			offsetHeight: height, offsetWidth: width,
			clientHeight: elem.clientHeight, clientWidth: elem.clientWidth, element: elem
		};
		for (var i = 0; i < this._handlers.length; i++)
		{
			this._handlers[i](e);
		}
		this._prevOffsetHeight = elem.offsetHeight;
		this._prevOffsetWidth = elem.offsetWidth;
	}
};
$IG.NotifySizeChangedBehavior.registerClass("Infragistics.Web.UI.NotifySizeChangedBehavior");


/* END Infragistics.Web.UI.Scripts.3_igUIBehaviors.js */
/* START Infragistics.Web.UI.Scripts.4_igEnums.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.Orientation = function () 
{
    ///<summary>
    /// Specifies the type of Orientation that should be applied.
    ///</summary>
}
$IG.Orientation.prototype = 
{
   Horizontal:0, 
   Vertical:1
};
$IG.Orientation.registerEnum("Infragistics.Web.UI.Orientation");



$IG.PostBackAction = function()
{
    /// <summary>
    /// The type of action that should occur when listening to a client event.
    /// </summary>
}
$IG.PostBackAction.prototype =
{
	None:0,
	FullPostBack:1,
	AsyncPostBack:2
};
$IG.PostBackAction.registerEnum("Infragistics.Web.UI.PostBackAction");



$IG.DefaultableBoolean = function()
{
    ///<summary>
    /// Defaultable boolean values allow the user to either directly set the value to control a behavior or inherit from a parent object that 
    /// will be set.
    ///</summary>
}
$IG.DefaultableBoolean.prototype =
{
	NotSet:0,
	True:1,
	False:2
};
$IG.DefaultableBoolean.registerEnum("Infragistics.Web.UI.DefaultableBoolean");



$IG.ClientUIFlags = function()
{
    /// <summary>
    /// Indicates which state flags are set for rendering client state objects.
    /// </summary>
}
$IG.ClientUIFlags.prototype =
{    
	Visible : 0x2,
    Enabled : 0x8,
    Selectable : 0x20,
    Selected : 0x40,
    Hoverable : 0x100,
    Hovered : 0x200, 
    Editable : 0x800,
    Focusable : 0x2000,
    Focused : 0x4000,
    Draggable : 0x10000,
    Droppable : 0x40000,
    KBNavigable : 0x100000
	
};
$IG.ClientUIFlags.registerEnum("Infragistics.Web.UI.ClientUIFlags");



$IG.LayoutControlProps = new function()
{
    this.Count = $IG.ControlMainProps.Count + 0;
};

/* END Infragistics.Web.UI.Scripts.4_igEnums.js */
/* START Infragistics.Web.UI.Scripts.5_igObjects.js */
Type.registerNamespace("Infragistics.Web.UI");



$IG.ObjectBaseProps = new function()
{
	this.Count = 0;
};



$IG.ObjectBase = function(adr, element, props, owner, csm)
{
	/// <summary>
	/// The base object for all Infragistics.Web.UI objects.
	/// </summary>
	this._props = props;
	this._element = element;
	this._owner = owner;
	this._address = adr;
	if (element)
		element._object = this;
	this._csm = csm;
	$IG.ObjectBase.initializeBase(this);
}

$IG.ObjectBase.prototype =
{
	get_element: function()
	{
		/// <summary>
		/// Returns the element assoicated with the item.. 
		/// </summary>
		return this._element;
	},
	set_element: function(val)
	{
		/// <summary>Sets nhtml element associated with object.</summary>
		/// <param name="val" type="Object">Reference to html element.</param>
		this._element = val;
	},

	_get_owner: function() { return this._owner; },
	_set_owner: function(value) { this._owner = value; },

	_get_address: function() { return this._address; },
	_set_address: function(val) { this._address = val; },

	_createObjects: function(objectManager)
	{
	},

	_createCollections: function(collectionsManager)
	{
	},

	_set_value: function(index, value)
	{
		if (this._csm)
			this._csm.set_value(index, value, this._address);
	},

	_get_value: function(index, isBool)
	{
		return this._csm ? this._csm.get_value(index, isBool, this._address) : null;
	},

	_get_clientOnlyValue: function(propName)
	{
		return this._csm ? this._csm.get_clientOnlyValue(propName, this._address) : null;
	},

	_get_occasionalProperty: function(propName)
	{
		return this._csm ? this._csm.get_occasionalProperty(propName, this._address) : null;
	},

	_set_occasionalProperty: function(propName, val)
	{
		return this._csm ? this._csm.set_occasionalProperty(propName, val, this._address) : null;
	},


	_saveAdditionalClientState: function()
	{

	},

	dispose: function()
	{
		/// <summary>
		/// Prepares the object for deletion.
		/// </summary>
		if (this._element)
			this._element._object = null;
		this._element = null;
		this._owner = null;
		if (this._props)
		{
			if (this._props.objectsManager)
				this._props.objectsManager.dispose();

			if (this._props.collectionsManager)
				this._props.collectionsManager.dispose();

			this._props = null;
		}
		this._csm = null;
		$IG.ObjectBase.callBaseMethod(this, "dispose");
	}
}
$IG.ObjectBase.registerClass('Infragistics.Web.UI.ObjectBase', Sys.Component);



$IG.ControlObjectProps = new function()
{
	/// <summary>For internal use only.</summary>
	this.Flags = [$IG.ObjectBaseProps.Count + 0, 0];
	this.Count = $IG.ObjectBaseProps.Count + 1;
};



$IG.UIObject = function(adr, element, props, owner, csm)
{
	/// <summary>
	/// An object that has UIFlags associated with it. 
	/// </summary>
	this._flags = null;
	$IG.UIObject.initializeBase(this, [adr, element, props, owner, csm]);
}

$IG.UIObject.prototype =
{
	_getFlags: function()
	{
		if (this._flags == null)
		{
			this.__flagHelper = new $IG.FlagsHelper();
			var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
			this._flags = new $IG.FlagsObject(this._get_value(key), this);
		}
		return this._flags;
	},

	__getDefaultFlags: function()
	{
		if (this.__defaultFlags == null)
		{
			this._ensureFlags();
			this.__defaultFlags = this.__flagHelper.calculateFlags();
		}
		return this.__defaultFlags;
	},

	_updateFlags: function(flags)
	{
		var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
		this._set_value(key, flags)
	},

	_ensureFlags: function()
	{

	},

	_ensureFlag: function(flag, val)
	{
		this.__flagHelper.updateFlag(flag, val);
	},

	dispose: function()
	{
		if (this._flags != null)
			this._flags.dispose();
		$IG.UIObject.callBaseMethod(this, "dispose");
	}

}
$IG.UIObject.registerClass('Infragistics.Web.UI.UIObject', $IG.ObjectBase);



$IG.ListItemProps = new function()
{
	/// <summary>For internal use only.</summary>
	this.KeyTag = [$IG.ControlObjectProps.Count + 0, ""];
	this.NavigateUrl = [$IG.ControlObjectProps.Count + 1, ""];
	this.Target = [$IG.ControlObjectProps.Count + 2, ""];
	this.Tooltip = [$IG.ControlObjectProps.Count + 3, ""];
	this.Count = $IG.ControlObjectProps.Count + 4;

};



$IG.ListItem = function(adr, element, props, owner, csm, collection, parent)
{
	/// <summary>
	/// Represents an item for flat data controls. 
	/// </summary>
	$IG.ListItem.initializeBase(this, [adr, element, props, owner, csm]);
	this._parent = parent;
	this._itemCollection = collection
}

$IG.ListItem.prototype =
{
	_ensureFlags: function()
	{
		$IG.ListItem.callBaseMethod(this, "_ensureFlag");
		this._ensureFlag($IG.ClientUIFlags.Hoverable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Selectable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Draggable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Droppable, $IG.DefaultableBoolean.True);
	},
	set_key: function(value)
	{
		/// <summary>Sets key for item.</summary>
		/// <param name="value" type="String">Key for item.</param>
		this._set_value($IG.ListItemProps.KeyTag, value);
	},
	get_key: function()
	{
		/// <summary>
		/// Returns/sets a string value that can be used to store extra information on the item.
		/// </summary>
		return this._get_value($IG.ListItemProps.KeyTag);
	},

	set_navigateUrl: function(value)
	{
		/// <summary>Sets url for item.</summary>
		/// <param name="value" type="String">Url for item.</param>
		this._set_value($IG.ListItemProps.NavigateUrl, value);
	},
	get_navigateUrl: function()
	{
		/// <summary>
		/// Returns/sets a url that will be navigated to when an item is clicked.
		/// </summary>
		return this._get_value($IG.ListItemProps.NavigateUrl);
	},

	set_target: function(value)
	{
		/// <summary>Sets NavigateUrl for item.</summary>
		/// <param name="value" type="Object">Url for item.</param>
		this._set_value($IG.ListItemProps.Target, value);
	},
	get_target: function()
	{
		/// <summary>
		/// Returns/sets where the NavigateUrl will be navigated to when an item is clicked.
		/// </summary>         
		return this._get_value($IG.ListItemProps.Target);
	},

	set_tooltip: function(value)
	{
		/// <summary>Sets tooltip for item.</summary>
		/// <param name="value" type="String">Tooltip for item.</param>
		this._set_value($IG.ListItemProps.Tooltip, value);
	},
	get_tooltip: function()
	{
		/// <summary>
		/// Returns/sets the text that will be displayed when the mouse is over the item. 
		/// </summary>         
		return this._get_value($IG.ListItemProps.Tooltip);
	},

	dispose: function()
	{
		$IG.ListItem.callBaseMethod(this, "dispose");

		this._parent = null;
		this._itemCollection = null
	}
}
$IG.ListItem.registerClass('Infragistics.Web.UI.ListItem', $IG.UIObject);



$IG.DataItemProps = new function()
{
	/// <summary>For internal use only.</summary>
	this.DataPath = [$IG.ControlObjectProps.Count + 0, null];
	this.Populated = [$IG.ControlObjectProps.Count + 1, false];
	this.IsEmptyParent = [$IG.ControlObjectProps.Count + 2, false];
	this.Count = $IG.ControlObjectProps.Count + 3;

};



$IG.NavItemProps = new function()
{
	/// <summary>For internal use only.</summary>
	this.Text = [$IG.DataItemProps.Count + 0, ""];
	this.Value = [$IG.DataItemProps.Count + 1, ""];
	this.Key = [$IG.DataItemProps.Count + 2, ""];
	this.Count = $IG.DataItemProps.Count + 3;

};



$IG.NavItem = function(adr, element, props, owner, csm, collection, parent)
{
	/// <summary>
	/// Represents an item for hierarchical data controls. 
	/// </summary>
	$IG.NavItem.initializeBase(this, [adr, element, props, owner, csm]);
	this._parent = parent;
	this._itemCollection = collection

}

$IG.NavItem.prototype =
{

	//NavItem Properties
	_ensureFlags: function()
	{
		$IG.NavItem.callBaseMethod(this, "_ensureFlag");
		this._ensureFlag($IG.ClientUIFlags.Hoverable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Selectable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Draggable, $IG.DefaultableBoolean.True);
		this._ensureFlag($IG.ClientUIFlags.Droppable, $IG.DefaultableBoolean.True);
	},

	//DataItem properties
	set_dataPath: function(value)
	{
		/// <summary>Sets datapath for item.</summary>
		/// <param name="value" type="String">Datapath for item.</param>
		this._set_value($IG.DataItemProps.DataPath, value);
	},
	get_dataPath: function()
	{
		/// <summary>
		/// Sets or gets a string value representing the datapath into the data source used to popuplate the children of this item (if any).
		/// </summary>
		return this._get_value($IG.DataItemProps.DataPath);
	},
	set_populated: function(value)
	{
		/// <summary>Sets item state.</summary>
		/// <param name="value" type="Boolean">True: item was populated.</param>
		this._set_value($IG.DataItemProps.Populated, value);
	},
	get_populated: function()
	{
		/// <summary>
		/// Sets or gets a boolean value that indicates whether or not this item has been populated with children.
		/// </summary>
		return this._get_value($IG.DataItemProps.Populated, true);
	},

	set_isEmptyParent: function(value)
	{
		/// <summary>Sets state of item parent.</summary>
		/// <param name="value" type="Boolean">True: empty parent.</param>
		this._set_value($IG.DataItemProps.IsEmptyParent, value);
	},
	get_isEmptyParent: function()
	{
		/// <summary>
		/// Sets or gets a boolean value that indicates whether or not this item is a parent that has yet to be populated from an Ajax request to expand the node.
		/// </summary>
		return this._get_value($IG.DataItemProps.IsEmptyParent, true);
	},

	set_text: function(value)
	{
		/// <summary>Sets text for item.</summary>
		/// <param name="value" type="String">Text for item.</param>
		this._set_value($IG.NavItemProps.Text, value);
	},
	get_text: function()
	{
		/// <summary>
		/// Gets/Sets the text of the NavItem.
		/// </summary>
		return this._get_value($IG.NavItemProps.Text);
	},
	set_valueString: function(value)
	{
		/// <summary>Sets value for item.</summary>
		/// <param name="value" type="String">Value for item.</param>
		this._set_value($IG.NavItemProps.Value, value);
	},
	get_valueString: function()
	{
		/// <summary>
		/// Gets/Sets the value of the NavItem.
		/// </summary>
		return this._get_value($IG.NavItemProps.Value);
	},
	set_key: function(value)
	{
		/// <summary>Sets key for item.</summary>
		/// <param name="value">Key for item.</param>
		this._set_value($IG.NavItemProps.KeyTag, value);
	},
	get_key: function()
	{
		/// <summary>
		/// Gets/Sets the key of the NavItem.
		/// </summary>
		return this._get_value($IG.NavItemProps.KeyTag);
	},

	getItems: function()
	{
		/// <summary>
		/// Returns the collection of child items of a NavItem.
		/// </summary>
		return this._itemCollection;
	}
}
$IG.NavItem.registerClass('Infragistics.Web.UI.NavItem', $IG.UIObject);



$IG.FlagsHelper = function()
{
	/// <summary>
	/// This class is for internal use only.
	/// Provides helper methods for decoding and coding UIFlags.
	/// </summary>
	this._flagsHT = [];
};

$IG.FlagsHelper.prototype =
{
	updateFlag: function(flag, val)
	{
		/// <summary>
		/// Stores the ClientUIFlag in the private flags Hashtable.
		/// </summary>
		this._flagsHT[flag] = val;
	},
	getBoolFlag: function(flag)
	{
		/// <summary>
		/// Gets the bool value of a flag
		/// </summary>
		var obj = this._flagsHT[flag];
		if (obj == null)
			return false;
		else
			return obj;
	},

	getDBFlag: function(flag)
	{
		/// <summary>
		/// Gets the DefaultableBoolean value of a flag
		/// </summary>
		var obj = this._flagsHT[flag];
		if (obj == null)
			return $IG.DefaultableBoolean.NotSet;
		else
			return obj;
	},

	calcBoolFlag: function(flag)
	{
		/// <summary>
		/// Calculates the integer value for the specified ClientUIFlag based off of the passed in value.
		/// </summary>
		var val = this.getBoolFlag(flag);
		return (val) ? flag : 0;
	},

	calcDBFlag: function(flag)
	{
		/// <summary>
		/// Calculates the integer value for the specified ClientUIFlag based off of the passed in value.
		/// </summary>
		var val = this.getDBFlag(flag);
		return parseInt(flag * .5 * val);
	},

	calculateFlags: function()
	{
		/// <summary>
		/// Calculates the Flags property value of a UIObject based on the values of the list of passed in parameters.
		/// </summary
		var flags = 0;
		flags += this.calcDBFlag($IG.ClientUIFlags.Visible);
		flags += this.calcDBFlag($IG.ClientUIFlags.Enabled);
		flags += this.calcDBFlag($IG.ClientUIFlags.Selectable);
		flags += this.calcBoolFlag($IG.ClientUIFlags.Selected);
		flags += this.calcDBFlag($IG.ClientUIFlags.Hoverable);
		flags += this.calcBoolFlag($IG.ClientUIFlags.Hovered);
		flags += this.calcDBFlag($IG.ClientUIFlags.Editable);
		flags += this.calcDBFlag($IG.ClientUIFlags.Focusable);
		flags += this.calcBoolFlag($IG.ClientUIFlags.Focused);
		flags += this.calcDBFlag($IG.ClientUIFlags.Draggable);
		flags += this.calcDBFlag($IG.ClientUIFlags.Droppable);
		flags += this.calcDBFlag($IG.ClientUIFlags.KBNavigable);
		return flags;
	}
}

$IG.FlagsHelper.registerClass('Infragistics.Web.UI.FlagsHelper');



$IG.FlagsObject = function(flags, object)
{
	/// <summary>
	/// For internal use only.
	/// A helper object that manages UIFlags for a UIObject.
	/// </summary
	this._flags = flags;
	this._object = object
};

$IG.FlagsObject.prototype =
{
	dispose: function()
	{
		this._flags = null;
		this._object = null;
	},

	getVisible: function(parent)
	{
		/// <summary>
		/// Returns the resolved visibility of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Visible, parent);
	},
	setVisible: function(val)
	{
		/// <summary>Sets visibility.</summary>
		/// <param name="value" type="Boolean">True: visible.</param>
		this._setFlagValue($IG.ClientUIFlags.Visible, val);
	},

	getEnabled: function(parent)
	{
		/// <summary>
		/// Returns the resolved enabled state of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Enabled, parent);
	},
	setEnabled: function(val)
	{
		/// <summary>Sets enabled state.</summary>
		/// <param name="value" type="Boolean">True: enabled.</param>
		this._setFlagValue($IG.ClientUIFlags.Enabled, val);
	},

	getSelectable: function(parent)
	{
		/// <summary>
		/// Returns the resolved selectable property of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Selectable, parent);
	},
	setSelectable: function(val)
	{
		/// <summary>Sets ability to select.</summary>
		/// <param name="value" type="Boolean">True: selectable.</param>
		this._setFlagValue($IG.ClientUIFlags.Selectable, val);
	},

	getSelected: function()
	{
		/// <summary>
		/// Returns true if the UIObject is Selected.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Selected, null, true);
	},
	setSelected: function(val)
	{
		/// <summary>Sets selected state.</summary>
		/// <param name="value" type="Boolean">True: selected.</param>
		this._setFlagValue2($IG.ClientUIFlags.Selected, val);
	},

	getHoverable: function(parent)
	{
		/// <summary>
		/// Returns the resolved hoverability of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Hoverable, parent);
	},
	setHoverable: function(val)
	{
		/// <summary>Sets ability to hover.</summary>
		/// <param name="value" type="Boolean">True: hoverable.</param>
		this._setFlagValue($IG.ClientUIFlags.Hoverable, val);
	},

	getHovered: function()
	{
		/// <summary>
		/// Returns true if the UIObject is hovered.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Hovered, null, true);
	},
	setHovered: function(val)
	{
		/// <summary>Sets hover state.</summary>
		/// <param name="value" type="Boolean">True: mouse is over.</param>
		this._setFlagValue2($IG.ClientUIFlags.Hovered, val);
	},

	getEditable: function(parent)
	{
		/// <summary>
		/// Returns the resolved editablility of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Editable, parent);
	},
	setEditable: function(val)
	{
		/// <summary>Sets ability to edit.</summary>
		/// <param name="value" type="Boolean">True: editable.</param>
		this._setFlagValue($IG.ClientUIFlags.Editable, val);
	},

	getFocusable: function(parent)
	{
		/// <summary>
		/// Returns the resolved focuability of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Focusable, parent);
	},
	setFocusable: function(val)
	{
		/// <summary>Sets ability to get focus.</summary>
		/// <param name="value" type="Boolean">True: focusable.</param>
		this._setFlagValue($IG.ClientUIFlags.Focusable, val);
	},

	getFocused: function()
	{
		/// <summary>
		/// Returns true if the UIObject is focused.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Focused, null, true);
	},
	setFocused: function(val)
	{
		/// <summary>Sets focus state.</summary>
		/// <param name="value" type="Boolean">True: has focus.</param>
		this._setFlagValue2($IG.ClientUIFlags.Focused, val);
	},

	getDraggable: function(parent)
	{
		/// <summary>
		/// Returns the resolved dragability of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Draggable, parent);
	},
	setDraggable: function(val)
	{
		/// <summary>Sets ability to drag.</summary>
		/// <param name="value" type="Boolean">True: draggable.</param>
		this._setFlagValue($IG.ClientUIFlags.Draggable, val);
	},

	getDroppable: function(parent)
	{
		/// <summary>
		/// Returns the resolved dropability of a UIObject.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.Droppable, parent);
	},
	setDroppable: function(val)
	{
		/// <summary>Sets ability to drop.</summary>
		/// <param name="value" type="Boolean">True: droppable.</param>
		this._setFlagValue($IG.ClientUIFlags.Droppable, val);
	},

	getKBNavigable: function(parent)
	{
		/// <summary>
		/// Returns true if the UIObject and be navigated with the keyboard.
		/// </summary
		return this._getFlagValue($IG.ClientUIFlags.KBNavigable, parent);
	},
	setKBNavigable: function(val)
	{
		/// <summary>Sets ability to process keyboard.</summary>
		/// <param name="value" type="Boolean">True: process keyboard.</param>
		this._setFlagValue($IG.ClientUIFlags.KBNavigable, val);
	},

	// Returns a Bool
	_getFlagValue: function(flag, parent, isBoolFlag)
	{
		var returnDb = $IG.DefaultableBoolean.NotSet;
		var trueFlag = this._flags & (flag * .5);
		var falseFlag = this._flags & flag;

		if (trueFlag != 0 && falseFlag == 0)
			returnDb = $IG.DefaultableBoolean.True;
		else if (falseFlag != 0)
			returnDb = $IG.DefaultableBoolean.False;

		if (parent != null && returnDb == $IG.DefaultableBoolean.NotSet && parent._getFlags)
			returnDb = parent._getFlags()._getFlagValue(flag);

		if (isBoolFlag)
			return (returnDb == 2)
		else if (returnDb == $IG.DefaultableBoolean.True)
			return true;
		else
			return false;
	},


	// Sets a DefaultableBoolean
	_setFlagValue: function(flag, value)
	{
		if (typeof (value) == "boolean")
			value = (value) ? 1 : 2;

		var trueFlag = this._flags & (flag * .5);
		this._flags -= trueFlag;
		var falseFlag = this._flags & flag;
		this._flags -= falseFlag;

		this._flags += flag * (.5) * value;

		this._object._updateFlags(this._flags);
	},

	// Sets a Bool
	_setFlagValue2: function(flag, value)
	{
		if (typeof (val) == "boolean")
			val = (val) ? 1 : 0;

		this._flags -= this._flags & flag;
		this._flags += (value) ? flag : 0;
		this._object._updateFlags(this._flags);
	},

	_getFlags: function()
	{
		return this._flags;
	}
}

$IG.FlagsObject.registerClass('Infragistics.Web.UI.FlagsObject');




$IG.ImageObject = function(obj, element, props, owner, csm)
{
	///<summary>
	/// An object that has an associated image element and the concept of different states, such as Normal, Hover, Pressed, and Disabled.
	///</summary>
	if (!csm)
		csm = new $IG.ObjectClientStateManager(props[0]);
	$IG.ImageObject.initializeBase(this, [obj, element, props, owner, csm]);

	this._currentState = this._get_clientOnlyValue("s");
}

$IG.ImageObject.prototype =
{
	setState: function(state)
	{
		/// <summary>
		/// Sets the ImageState of the ImageObject.
		/// </summary
		if (this._element == null)
			return;
		var url = this._get_clientOnlyValue(state);
		if (url == null || url.length == 0)
			url = this._get_clientOnlyValue($IG.ImageState.Normal);

		this._element.src = url;
		this._currentState = state;
	},

	getState: function()
	{
		/// <summary>
		/// Returns the ImageState of the ImageObject
		/// </summary
		return this._currentState;
	}
}
$IG.ImageObject.registerClass('Infragistics.Web.UI.ImageObject', $IG.ObjectBase);

$IG.ImageState = new function()
{
	this.Normal = 'i';
	this.Hover = 'h';
	this.Pressed = 'p';
	this.Disabled = 'd';
};




Infragistics._Utility = function() { };

Infragistics._Utility.prototype =
{

	addCompoundClass: function(element, className)
	{
		Sys.UI.DomElement.addCssClass(element, className);
	},

	containsCompoundClass: function(element, className)
	{
		return (element.className.indexOf(className) >= 0);
	},

	removeCompoundClass: function(element, className)
	{
		element.className = element.className.replace(className, "");
		element.className = element.className.replace("  ", " ");
	},

	toggleCompoundClass: function(element, className, apply)
	{
		if (apply)
		{
			if (!this.containsCompoundClass(element, className))
				this.addCompoundClass(element, className);
		}
		else
			this.removeCompoundClass(element, className);
	},

	
	
	addClientEvent: function(obj, evtName, val)
	{
		/// <summary>For internal use. Adds client event.</summary>
		/// <param name="obj" type="Object">Reference to object.</param>
		/// <param name="evtName">Name of client event.</param>
		/// <param name="fnc" type="Object">Reference to function.</param>
		var fnc = this.toFunction(val);
		if (fnc)
			obj.get_events().addHandler(evtName, fnc);
		else
			alert('The "' + val + '" for "' + evtName + '" should be a function, function name, or function text');
	},

	
	
	removeClientEvent: function(obj, evtName, fnc)
	{
		/// <summary>For internal use. Removes client event.</summary>
		/// <param name="obj" type="Object">Reference to object.</param>
		/// <param name="evtName">Name of client event.</param>
		/// <param name="fnc" type="Object">Reference to function.</param>
		obj.get_events().removeHandler(evtName, fnc);
	},

	
	
	getPosition: function(elem)
	{
		/// <summary>For internal use. Gets location of element on page.</summary>
		/// <param name="elem" type="Object">Reference to html element which position should be calculated.</param>
		/// <returns type="Object">Object which contains 4 numeric values: x-left position of elem, y-top position, scrollX-horizontal scroll, scrollY-vertical scroll.</returns>
		var htm, name, style, elem0 = elem;
		var first = true, noTD = true, ieRect = false, end = false;
		var o = { x: 0, y: 0, scrollX: 0, scrollY: 0 };
		var ie = document.all && elem.getBoundingClientRect;
		var body2 = !ie;
		while (elem)
		{
			name = elem.nodeName;
			style = this.getRuntimeStyle(elem);
			htm = name == 'HTML';
			if (end)
			{
				if (htm) break;
				elem = elem.parentNode;
				continue;
			}
			var body = name == 'BODY';
			var bdr = false;
			var pos = this.getStyleValue(style, 'position');
			var abs = pos == 'absolute', rel = pos == 'relative';
			if (ie && rel)
				ieRect = abs = true;
			end = body && !ie;
			if ((abs && body) || name == 'FORM')
				break;
			var v = elem.offsetTop;
			if (v) o.y += v;
			v = elem.offsetLeft;
			if (v) o.x += v;
			if (!first && !htm)
			{
				var td = name == 'TD', tbl = name == 'TABLE';
				if (ie)
				{
					if (!tbl || (noTD && abs))
					{
						if (name != 'DIV' || !rel)
							bdr = true;
						if (td)
							noTD = false;
					}
					if (tbl || (!td && !tbl))
						noTD = true;
				}
				else if ((!tbl && !td) || (td && abs))
					bdr = true;
			}
			if (bdr)
			{
				
				v = body2 && body;
				
				if (!ie && !v && (abs || rel))
					v = this._isScroll(style, name);
				this._addBorder(style, o, false, v);
			}
			if (elem != elem0)
			
				this._addScroll(elem, o);
			if (abs)
				body2 = false;
			first = false;
			var pe = elem.parentNode;
			elem = elem.offsetParent;
			if (!elem && end)
			{
				elem = pe;
				continue;
			}
			
			if (!ie && !abs && elem) while (pe && pe != elem)
			{
				if (this._isScroll(style = this.getRuntimeStyle(pe), pe.nodeName))
				{
					this._addScroll(pe, o);
					this._addBorder(style, o);
				}
				pe = pe.parentNode;
			}
		}
		if (body2 && htm)
			this._addBorder(style, o, true);
		if (ieRect)
		{
			v = elem0.getBoundingClientRect();
			o.x = v.left + o.scrollX;
			o.y = v.top + o.scrollY;
			if (htm && style)
				this._addBorder(style, o, true);
		}
		return o;
	},
	_addScroll: function(elem, o)
	{
		var v = elem.scrollLeft;
		if (v) o.scrollX += v;
		v = elem.scrollTop;
		if (v) o.scrollY += v;
	},
	_addBorder: function(style, o, neg, twice)
	{
		var v = this.toIntPX(style, 'borderLeftWidth', 0);
		if (twice) v += v;
		o.x += neg ? -v : v;
		v = this.toIntPX(style, 'borderTopWidth', 0);
		if (twice) v += v;
		o.y += neg ? -v : v;
	},
	_isScroll: function(style, name)
	{
		var v = name == 'DIV' ? this.getStyleValue(style, 'overflow') : '';
		return v == 'auto' || v == 'scroll';
	},

	
	cancelEvent: function(e, type, raw)
	{
		/// <summary>For internal use. Cancels browser event.</summary>
		/// <param name="e" type="Object">Reference to event.</param>
		/// <param name="type" type="String" mayBeNull="true" optional="true">Name of event.</param>
		/// <param name="raw" type="Boolean" mayBeNull="true" optional="true">Cancel rawEvent.</param>
		if (!e && !raw) e = window.event;
		if (!e) return true;
		if (type && type.substring && e.type != type)
			return true;
		if (e.stopPropagation)
			e.stopPropagation();
		if (e.preventDefault)
			e.preventDefault();
		e.cancelBubble = true;
		e.returnValue = false;
		if (raw)
			return false;
		return this.cancelEvent(e.rawEvent, null, true);
	},

	
	getRuntimeStyle: function(elem)
	{
		/// <summary>For internal use. Gets reference to run time style of element.</summary>
		/// <param name="elem" type="Object">Reference to html element which position should be calculated.</param>
		/// <returns type="Object" mayBeNull="true">Style.</returns>
		if (!elem)
			return null;
		var s = elem.currentStyle;
		if (s)
			return s;
		var win = document.defaultView;
		if (!win)
			win = window;
		if (win.getComputedStyle)
			s = win.getComputedStyle(elem, '');
		return s ? s : elem.style;
	},

	
	
	
	getStyleValue: function(style, prop, elem)
	{
		/// <summary>For internal use. Gets reference to run time style of element.</summary>
		/// <param name="style" type="Object" mayBeNull="true" optional="true">Reference to style.</param>
		/// <param name="prop" type="String" mayBeNull="false" optional="false">Name of property, like borderTopWidth.</param>
		/// <param name="elem" type="Object" mayBeNull="true" optional="true">Reference to html element.</param>
		/// <returns type="String" mayBeNull="true">Value of property.</returns>
		if (!style)
			style = this.getRuntimeStyle(elem);
		if (!style)
			return null;
		var val = style[prop];
		if (!this.isEmpty(val) || !style.getPropertyValue)
			return val;
		return style.getPropertyValue(prop);
	},

	
	toInt: function(val, def)
	{
		/// <summary>For internal use. Gets integer from string.</summary>
		/// <param name="val" type="Object">String or numeric value.</param>
		/// <param name="def" type="Number" mayBeNull="true" optional="true">Value returned in case of failure.</param>
		/// <returns type="Number">Integer.</returns>
		var ok = false;
		var i = -1, len = val ? val.length : 0;
		while (++i < len)
		{
			var ch = val.charCodeAt(i);
			if (ch == 45 && i == 0)
				continue;
			if (ch < 48 || ch > 57)
			{
				val = val.substring(0, i);
				break;
			}
			ok = true;
		}
		return ok ? parseInt(val) : def;
	},

	
	
	
	
	toIntPX: function(style, prop, def, elem)
	{
		/// <summary>For internal use. Gets integer from string with validation for pixel units.</summary>
		/// <param name="style" type="Object" mayBeNull="true" optional="true">Reference to style.</param>
		/// <param name="prop" type="String" mayBeNull="false" optional="false">Name of property, like borderTopWidth.</param>
		/// <param name="def" type="Number" mayBeNull="true" optional="true">Value returned in case of failure.</param>
		/// <param name="elem" type="Object" mayBeNull="true" optional="true">Reference to html element.</param>
		/// <returns type="Number">Integer.</returns>
		var px = this.getStyleValue(style, prop, elem);
		return (px && px.indexOf('px') > 0) ? this.toInt(px, 0) : (def ? def : 0);
	},

	
	toFunction: function(val)
	{
		/// <summary>For internal use. Gets reference to function.</summary>
		/// <param name="val" type="Object">Reference to function, its text, etc.</param>
		/// <returns type="Number" mayBeNull="true">Reference to function.</returns>
		if (val instanceof Function)
			return val;
		if (!val || !val.length || !val.charCodeAt)
			return null;
		var fnc = window[val];
		if (fnc instanceof Function)
			return fnc;
		try { fnc = eval(val); } catch (val) { }
		return (fnc instanceof Function) ? fnc : null;
	},

	
	isEmpty: function(val)
	{
		/// <summary>For internal use. Checks if value is empty.</summary>
		/// <param name="val" type="Object">Object to test.</param>
		/// <returns type="Boolean">True: string or array is empty.</returns>
		if (!val)
			return true;
		val = val.length;
		return !val || val.length < 1;
	},
	
	getOpacity: function(elem)
	{
		/// <summary>For internal use. Gets opacity of element.</summary>
		/// <param name="elem" type="Object">Object to test.</param>
		/// <returns type="Number">Value in range of 0-100.</returns>
		var op = this.getStyleValue(null, 'opacity', elem);
		if (op)
		{
			op = parseFloat(op);
			if (op)
			{
				op = Math.floor(op * 100);
				return (op < 100 && op >= 0) ? op : 100;
			}
		}
		op = this.getStyleValue(null, 'filter', elem);
		if (!op)
			return 100;
		op = this.replace(op.toLowerCase(), ' ', '');
		var i = op.indexOf('opacity=');
		return (i < 0) ? 100 : this.toInt(op.substring(i + 8), 100);
	},

	
	
	
	findControl: function(id, prefix)
	{
		/// <summary>Find Infragistics control from partial match of its id.</summary>
		/// <param name="id" type="String">Trailing part of id (after undescore).</param>
		/// <param name="prefix" type="String" mayBeNull="true" optional="true">Prefix of id.</param>
		/// <returns type="Object" mayBeNull="true">Reference to control.</returns>
		for (var ig in ig_controls)
		{
			var ctl = ig_controls[ig];
			if (!ctl.get_id || (prefix && ig.indexOf(prefix) != 0))
				continue;
			var i = ig.lastIndexOf(id);
			if (i == 0 || (i > 0 && i + id.length == ig.length && ig.charAt(i - 1) == '_'))
				return ctl;
		}
	},

	
	
	
	findChild: function(elem, id)
	{
		/// <summary>Find html element with partial match of its id.</summary>
		/// <param name="elem" type="Object">Parent container.</param>
		/// <param name="id" type="String">Trailing part of id (after undescore).</param>
		/// <returns type="Object" mayBeNull="true">Reference to html element.</returns>
		var id0 = elem.id;
		var i = id0 ? id0.lastIndexOf(id) : -1;
		if (i >= 0 && i + id.length == id0.length && id0.charAt(i - 1) == '_')
			return elem;
		var elems = elem.childNodes;
		i = elems ? elems.length : 0;
		while (i-- > 0)
		{
			elem = this.findChild(elems[i], id);
			if (elem)
				return elem;
		}
	},

	
	addLayoutTarget: function(target)
	{
		/// <summary>For internal use only.</summary>
		
		var index = -1, elem = target._element;
		while ((elem = elem.parentNode) != null)
		{
			if (!elem.getAttribute)
				continue;
			
			var ctl = null, id = elem.getAttribute('mkr');
			if (id && id.length > 1 && id.substring(0, 1) == 'c')
				index = this.toInt(id.substring(1), -1);
			id = elem.getAttribute('CtlMain');
			if (!id)
				continue;
			if (id == 'layout')
			{
				id = elem.id;
				if (id)
					ctl = ig_controls[id];
			}
			if (!ctl || !ctl.getLayoutManager)
			{
				index = -1;
				continue;
			}
			
			ctl = ctl.getLayoutManager(index);
			if (!ctl) continue;
			
			var i = -1, ids = ctl._layoutListeners, id = target._id;
			if (!ids)
				ctl._layoutListeners = ids = new Array();
			
			while (++i < ids.length)
				if (ids[i] == id)
				break;
			ids[i] = id;
			
			target._layoutManager = ctl;
			return true;
		}
		return false;
	},

	
	
	
	raiseLayoutEvent: function(man)
	{
		/// <summary>For internal use only.</summary>
		
		
		var ctl, elem = man._element;
		var lsnrs = elem ? elem._ctlsForLayout : null;
		var i = lsnrs ? lsnrs.length : 0;
		while (i-- > 0)
		{
			ctl = lsnrs[i];
			if (ctl && ctl.layout)
			
				if (ctl.layout(man.getClientWidth ? man.getClientWidth(ctl) : null, man.getClientHeight ? man.getClientHeight(ctl) : null))
				if (!ctl._layoutManager)
			
				this.addLayoutTarget(ctl);
			lsnrs[i] = null;
		}
		if (lsnrs)
		{
			elem._ctlsForLayout = null;
			return;
		}
		lsnrs = man._layoutListeners;
		i = lsnrs ? lsnrs.length : 0;
		while (i-- > 0)
		{
			var ctl = ig_controls[lsnrs[i]];
			if (ctl && ctl.layout)
			{
				var width = man.getClientWidth ? man.getClientWidth(ctl) : null, height = man.getClientHeight ? man.getClientHeight(ctl) : null;
				ctl.layout(width, height);
			}
		}
	},
	
	
	
	
	
	
	
	
	
	checkLayoutManager: function(ctl)
	{
		/// <summary>For internal use only.</summary>
		var i = 0, elem = ctl._element;
		
		
		while (i++ < 10 && elem && (elem = elem.parentNode) != null)
		{
			
			var css = elem.id ? elem.className : null;
			if (css && css.indexOf(':=CtlMain:layout') == css.length - 16)
			{
				
				if ((i = elem._ctlsForLayout) == null)
					i = elem._ctlsForLayout = new Array();
				i[i.length] = ctl;
				return true;
			}
		}
		return false;
	},

	
	
	
	
	
	getOffset: function(style, width, noTrail, noLead)
	{
		/// <summary>For internal use only.</summary>
		var val = 0;
		if (style) while (!noLead || !noTrail)
		{
			var prop = noLead ? (width ? 'Right' : 'Bottom') : (width ? 'Left' : 'Top');
			if (noLead)
				noTrail = true;
			noLead = true;
			val += this.toIntPX(style, 'border' + prop + 'Width') + this.toIntPX(style, 'padding' + prop);
		}
		return val;
	},

	
	
	
	getMargin: function(style, horiz)
	{
		/// <summary>For internal use only.</summary>
		return this.toIntPX(style, 'margin' + (horiz ? 'Left' : 'Top')) + this.toIntPX(style, 'margin' + (horiz ? 'Right' : 'Bottom'));
	},

	
	
	
	display: function(elem, hide)
	{
		/// <summary>For internal use only.</summary>
		var style = elem ? elem.style : null;
		if (!style) return;
		style.display = hide ? 'none' : '';
		style.visibility = hide ? 'hidden' : 'visible';
	},

	
	
	isOut: function(e, elem)
	{
		var to = e.toElement;
		if (!to) to = e.relatedTarget;
		e = e.rawEvent;
		if (!to && e) if ((to = e.toElement) == null)
			to = e.relatedTarget;
		while (to)
		{
			if (to == elem)
				return false;
			to = to.parentNode;
		}
		return true;
	},

	
	
	
	
	
	
	
	
	replace: function(str, oldVal, newVal)
	{
		/// <summary>For internal use only.</summary>
		if (newVal == null)
			for (var i = 0; i < oldVal.length; i += 2)
			str = this.replace(str, oldVal[i], oldVal[i + 1]);
		else while (str.indexOf(oldVal) >= 0)
			str = str.replace(oldVal, newVal);
		return str;
	},

	
	htmlEscapeCharacters: function(str)
	{
		/// <summary>For internal use only.</summary>
		return (typeof (str) === "string") ? str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : str;
	},

	
	htmlUnescapeCharacters: function(str)
	{
		/// <summary>For internal use only.</summary>
		return (typeof (str) === "string") ? str.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">") : str;
	},

	
	getHTML: function(win)
	{
		/// <summary>Find HTML element.</summary>
		/// <param name="win" type="Object" mayBeNull="true" optional="true">Reference to window.</param>
		/// <returns type="Object" mayBeNull="true">Reference to HTML.</returns>
		if (!win)
			win = window;
		var doc = win.document;
		var htm = doc.body;
		while (htm && htm.nodeName != 'HTML')
			htm = htm.parentNode;
		return htm ? htm : doc.body;
	},

	
	getWinRect: function(win)
	{
		/// <summary>For internal use only.</summary>
		if (!win)
			win = window;
		var doc = win.document;
		var body = doc.body, htm = this.getHTML(win), de = doc.documentElement;
		if (!de)
			de = htm;
		var x = de.scrollLeft, y = de.scrollTop, wi = win.innerWidth, hi = win.innerHeight, wd = de.clientWidth, hd = de.clientHeight, w = htm.clientWidth, h = htm.clientHeight;
		var maxWidth = w ? w : 0, maxHeight = h ? h : 0, w2 = htm.scrollWidth, h2 = htm.scrollHeight;
		if (wd)
		{
			maxWidth = Math.max(maxWidth, wd);
			maxHeight = Math.max(maxHeight, hd);
		}
		if (wi)
		{
			maxWidth = Math.max(maxWidth, wi);
			maxHeight = Math.max(maxHeight, hi);
		}
		if (w2 && h2)
		{
			maxWidth = Math.max(maxWidth, w2);
			maxHeight = Math.max(maxHeight, h2);
		}
		w2 = body.scrollWidth;
		if (w2)
			maxWidth = Math.max(maxWidth, w2);
		w2 = body.offsetWidth;
		h2 = body.offsetHeight
		maxWidth = Math.max(maxWidth, w2);
		maxHeight = Math.max(maxHeight, h2);
		var noClientSize = false;
		
		if (!x)
			x = htm.scrollLeft;
		if (!x)
			x = body.scrollLeft;
		if (!y)
			y = htm.scrollTop;
		if (!y)
			y = body.scrollTop;
		
		if (!wi || wi < 50)
			wi = 99999;
		if (!wd || wd < 50)
			wd = 99999;
		if (!w || w < 50)
			w = 99999;
		if (w > wd)
			w = wd;
		if (w > wi)
			w = wi;
		if (w == 99999)
		{
			w = w2;
			noClientSize = true;
		}
		
		if (!hi || hi < 50)
			hi = 99999;
		if (!hd || hd < 50)
			hd = 99999;
		if (!h || h < 50)
			h = 99999;
		if (h > hd)
			h = hd;
		if (h > hi)
			h = hi;
		if (h == 99999)
		{
			h = h2;
			noClientSize = true;
		}
		return { x: x, y: y, width: w, height: h, maxWidth: maxWidth, maxHeight: maxHeight, noClientSize: noClientSize };
	},

	
	setOpacity: function(element, opacity)
	{
		/// <summary>For internal use only.</summary>
		element.style.opacity = opacity / 100;
		if (element.filters)
		{
			if (!element.filters["alpha"] || element.style.filter.indexOf("alpha") == -1)
				element.style.filter += " alpha(opacity=" + opacity + ")";
			else
				element.filters["alpha"].opacity = opacity;
		}
	},

	
	
	_initAttr: function(elem)
	{
		var attr = elem.id;
		var j = 99, i = attr ? attr.length : 0;
		if (i < 1)
		
			return false;
		
		
		
		if (attr.charAt(0) == ':')
		{
			attr = attr.split(':');
			i = attr.length;
			if ((i >= 4 || (i % 2 == 0)) && attr[1].indexOf('.') > 0)
				j = 1;
		}
		
		if (j > 2)
		{
			
			
			
			var css = elem.className;
			j = (css && css.length > 5) ? css.indexOf(' :=') : -1;
			if (j < 0)
			
				return true;
			attr = css.substring(j + 3);
			if (attr.indexOf(' ') >= 0)
			
				return true;
			attr = attr.split(':');
			i = attr.length;
			if (i < 2 || (i & 1) != 0)
			
				return true;
			elem.className = css.substring(0, j);
			j = -1;
		}
		while ((i -= 2) > j)
			elem.setAttribute(attr[i], attr[i + 1]);
		
		return j < 0;
	},

	
	resolveMarkedElement: function(elem, checkControl)
	{
		/// <summary>For internal use only.</summary>
		var adr = null;
		var control = null;
		var secondWalkthrough = false;
		while (elem)
		{
			if (elem.getAttribute)
			{
				adr = elem.getAttribute("adr");
				if (adr == null)
					adr = elem.getAttribute("mkr");
				if (adr == null)
					adr = elem.getAttribute("obj");
				if (adr == null && !secondWalkthrough)
				{
					adr = elem.getAttribute("id");
					if (adr)
					{
						secondWalkthrough = true;
						if (!$util._initAttr(elem))
							continue;
						adr = null;
					}
				}
				else
					secondWalkthrough = false;
			}
			if (typeof (adr) == "string")
			{
				if (adr.length > 0)
					break;
			}
			else
				if (typeof (adr) != "undefined" && adr !== null)
				break;

			elem = elem.parentNode;
		}
		if (elem == null)
			return null;
		else if (checkControl)
		{
			var parent = elem.parentNode;
			while (parent)
			{
				if (parent.control != null)
				{
					control = parent.control;
					break;
				}
				parent = parent.parentNode;
			}
		}
		return [elem, adr, control];
	},

	compare: function(val1, val2)
	{
		/// <summary>For internal use only.</summary>
		if (val1 == val2)
			return true;
		else if (val1 != null && val2 != null)
		{
			var type1 = Object.getType(val1).__typeName;
			var type2 = Object.getType(val2).__typeName;
			if (type1 != type2 || type1 == "String" || type1 == "Number" || type1 == "Boolean")
				return false;

			if (type1 == "Array")
			{
				if (val1.length != val2.length)
					return false;

				for (var i in val1)
				{
					if (!$util.compare(val1[i], val2[i]))
						return false;
				}
				return true;
			}
			else if (type1 == "Date")
			{
				if (val1.getTime() == val2.getTime())
					return true;
			}
			else
			{
				for (var i in val1)
				{
					if (!$util.compare(val1[i], val2[i]))
						return false;
				}
				return true;
			}
		}
		return false;
	},

	ensureBrowserInfo: function()
	{
		/// <summary>For internal use only.</summary>
		try { this.AgentName = navigator.userAgent.toLowerCase(); } catch (e) { this.AgentName = ""; }
		this.MajorVersionNumber = parseInt(navigator.appVersion);
		this.IsSafari = this.AgentName.indexOf("safari") >= 0;
		this.IsFireFox = this.AgentName.indexOf("firefox") >= 0;
		if (this.IsFireFox)
		{
			this.IsFireFox2 = this.AgentName.indexOf("firefox/2") >= 0;
			this.IsFireFox3 = this.AgentName.indexOf("firefox/3") >= 0;
		}
		this.IsOpera = this.AgentName.indexOf("opera") >= 0;
		this.IsMac = this.AgentName.indexOf("mac") >= 0;
		this.IsIE = document.all != null && !this.IsOpera && !this.IsSafari;
	},

	_getWidthMargin: function(element)
	{
		var style = this.getRuntimeStyle(element);
		var borderLeftWidth = 0;
		if (style.borderLeftStyle != "none")
		{
			if (style.borderLeftWidth == "thin")
				borderLeftWidth = 1;
			else if (style.borderLeftWidth == "medium")
				borderLeftWidth = 3;
			else if (style.borderLeftWidth == "thick")
				borderLeftWidth = 5;
			else
			{
				var w = parseInt(style.borderLeftWidth, 10);
				if (isNaN(w))
					w = 0;
				borderLeftWidth = w;
			}
		}

		var borderRightWidth = 0;
		if (style.borderRightStyle != "none")
		{
			if (style.borderRightWidth == "thin")
				borderRightWidth = 1;
			else if (style.borderRightWidth == "medium")
				borderRightWidth = 3;
			else if (style.borderRightWidth == "thick")
				borderRightWidth = 5;
			else
			{
				var w = parseInt(style.borderRightWidth, 10);
				if (isNaN(w))
					w = 0;
				borderRightWidth = w;
			}
		}

		var paddingLeft = parseInt(style.paddingLeft, 10);
		if (isNaN(paddingLeft))
			paddingLeft = 0;

		var paddingRight = parseInt(style.paddingRight, 10);
		if (isNaN(paddingRight))
			paddingRight = 0;

		return borderLeftWidth + borderRightWidth + paddingLeft + paddingRight;
	},

	_getHeightMargin: function(element)
	{
		var style = this.getRuntimeStyle(element);
		var borderTopWidth = 0;
		if (style.borderTopStyle != "none")
		{
			if (style.borderTopWidth == "thin")
				borderTopWidth = 1;
			else if (style.borderTopWidth == "medium")
				borderTopWidth = 3;
			else if (style.borderTopWidth == "thick")
				borderTopWidth = 5;
			else
			{
				var w = parseInt(style.borderTopWidth, 10);
				if (isNaN(w))
					w = 0;
				borderTopWidth = w;
			}
		}

		var borderBottomWidth = 0;
		if (style.borderBottomStyle != "none")
		{
			if (style.borderBottomWidth == "thin")
				borderBottomWidth = 1;
			else if (style.borderBottomWidth == "medium")
				borderBottomWidth = 3;
			else if (style.borderBottomWidth == "thick")
				borderBottomWidth = 5;
			else
			{
				var w = parseInt(style.borderBottomWidth, 10);
				if (isNaN(w))
					w = 0;
				borderBottomWidth = w;
			}
		}

		var paddingTop = parseInt(style.paddingTop, 10);
		if (isNaN(paddingTop))
			paddingTop = 0;

		var paddingBottom = parseInt(style.paddingBottom, 10);
		if (isNaN(paddingBottom))
			paddingBottom = 0;

		return borderTopWidth + borderBottomWidth + paddingTop + paddingBottom;
	},

	setAbsoluteWidth: function(element, width)
	{
		///<summary>
		///Sets the outer width on an element. The width includes in itself the borders
		///and the paddings.
		///</summary>


		width -= this._getWidthMargin(element);

		if (width < 0)
			width = 0;

		element.style.width = width + "px";

		
		var adjustment = width + (width - element.offsetWidth + this._getWidthMargin(element));
		if (adjustment > 0)
			element.style.width = adjustment + "px";

	},

	getAbsoluteWidth: function(element)
	{
		///<summary>
		///Sets the outer width on an element. The width includes in itself the borders
		///and the paddings.
		///</summary>


		var width = element.offsetWidth + this._getWidthMargin(element);

		if (width < 0)
			width = 0;

		return width;
	},

	setAbsoluteHeight: function(element, height)
	{
		///<summary>
		///Sets the outer height on an element. The height includes in itself the borders
		///and the paddings.
		///</summary>

		height -= this._getHeightMargin(element);

		if (height < 0)
			height = 0;

		element.style.height = height + "px";
	},

	getAbsoluteHeight: function(element)
	{
		///<summary>
		///Sets the outer height on an element. The height includes in itself the borders
		///and the paddings.
		///</summary>

		var height = element.offsetHeight - this._getHeightMargin(element);

		if (height < 0)
			height = 0;

		return height;
	},

	addHandler: function(element, eventName, handler)
	{
		/// <summary>For internal use only.</summary>
		if(!handler)
			return;
		var browserHandler;
		if (element.addEventListener)
		{
			browserHandler = function(e)
			{
				return handler.call(element, new Sys.UI.DomEvent(e));
			}
			element.addEventListener(eventName, browserHandler, false);
		}
		else if (element.attachEvent)
		{
			browserHandler = function(e)
			{
				return handler.call(element, new Sys.UI.DomEvent(e));
			}
			element.attachEvent('on' + eventName, browserHandler);
		}
	},

	removeHandler: function(element, eventName, handler)
	{
		if(!handler)
			return;
		if (element.removeEventListener)
			element.removeEventListener(eventName, handler, false);
		else if (element.detachEvent)
			element.detachEvent('on' + eventName, handler);
	},

	isChild: function(parent, child)
	{
		var p = child.parentNode;
		while (p != parent && p != document.body && p != null)
			p = p.parentNode;
		return (p == parent)
	},
	getRows: function(tbl)
	{
		if (!tbl)
			return null;
		try
		{
			if (typeof tbl.rows == 'object')
				return tbl.rows;
		} catch (e) { }
		
		if (tbl.nodeName == 'TABLE')
			tbl = tbl.firstChild;
		return (tbl.nodeName == 'TBODY') ? tbl.childNodes : null;
	},
	
	
	createDelegate: function(instance, method, args)
	{
		return function()
		{
			return method.apply(instance, args);
		}
	},
	
	
	
	
	
	
	_setTranspFrame: function(obj, div, upHandler, moveHandler)
	{
		var frame = this._transFrame;
		if(!obj || (!div && !frame))
			return;
		if(!frame)
		{
			this._transFrame = frame = document.createElement('IFRAME');
			frame.src = 'javascript:new String("<html></html>")';
			var style = frame.style;
			style.zIndex = 100000;
			style.position = 'absolute';
			style.filter = 'alpha(opacity:0)';
			style.opacity = 0.0;
		}
		if(div)
		{
			if(frame._obj != obj)
			{
				this._setTranspFrame(frame._obj);
				frame._obj = obj;
				frame._move = moveHandler;
				frame._up = upHandler;
				div.insertBefore(frame, div.firstChild);
				var doc = frame.contentWindow.document;
				$util.addHandler(doc, 'mousemove', moveHandler);
				$util.addHandler(doc, 'mouseup', upHandler);
			}
			frame.style.width = div.offsetWidth + 'px';
			frame.style.height = div.offsetHeight + 'px';
			return;
		}
		if(!frame._obj)
			return;
		var doc = frame.contentWindow.document;
		$util.removeHandler(doc, 'mousemove', frame._move);
		$util.removeHandler(doc, 'mouseup', frame._up);
		frame._obj = frame._move = frame._up = null;
		frame.parentNode.removeChild(frame);
	}
};
Infragistics._Utility.registerClass("Infragistics._Utility");

Infragistics.Utility = new Infragistics._Utility();
var $util = Infragistics.Utility;
$util.ensureBrowserInfo();



var ig_ui_all = null; 
function ig_ui_timer(o, del)
{
	var all = ig_ui_all;
	var i, fn = all ? all._timerFn : null;
	if (o)
	{
		if (!o._onTimer) return; 
		if (!all) ig_ui_all = all = new Array();
		i = all.length;
		while (i-- > 0) if (all[i] == o) break; 
		if (del)
		{
			if (i < 0) return;
			delete o._onTimer;
			delete all[i];
			o = null; 
			i = all.length;
			while (i-- > 0) if (all[i]) o = true; 
		}
		else
		{
			if (i < 0)
			{
				
				while (all[++i]);
				all[i] = o;
			}
			if (!fn) all._timerFn = fn = window.setInterval(ig_ui_timer, 200); 
		}
	}
	if (o) return;
	
	if (!del && fn) for (i = 0; i < all.length; i++)
	{
		o = all[i]; 
		if (o && o._onTimer)
		{
			if (!o._onTimer())
			{
				fn = null; 
				continue;
			}
			delete o._onTimer; 
			delete all[i];
		}
	}
	if (!fn) return; 
	window.clearInterval(fn); 
	delete all._timerFn;
	ig_ui_all = null;
}




$IG.EventArgs = function()
{
	/// <summary>Base class for object used as parameter while raising client events related to browser action.</summary>
	$IG.EventArgs.initializeBase(this);
	this._props = [null, 0];
}
$IG.EventArgs.prototype =
{
	get_browserEvent: function()
	{
		/// <summary>Gets reference to browser event.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to browser event.</returns>
		return this._props[0];
	},
	dispose: function()
	{
		/// <summary>Disposes object.</summary>
		this._props[0] = null;
	}
}
$IG.EventArgs.registerClass('Infragistics.Web.UI.EventArgs', Sys.EventArgs);


$IG.PostBackEventArgs = function()
{
	/// <summary>Base class for object used as parameter while raising client events related to postback action.</summary>
	$IG.PostBackEventArgs.initializeBase(this);
}
$IG.PostBackEventArgs.prototype =
{
	
	get_postBack: function()
	{
		/// <summary>Gets postback flag.</summary>
		/// <returns type="Number">One of the following: 0 - do not trigger postback, 1 - trigger full postback, 2 - trigger async postback.</returns>
		return this._props[1];
	},
	
	set_postBack: function(val)
	{
		/// <summary>Sets postback flag.</summary>
		/// <param name="val" type="Number">One of the following: 0 - do not trigger postback, 1 - trigger full postback, 2 - trigger async postback.</param>
		this._props[1] = val;
	}
}
$IG.PostBackEventArgs.registerClass('Infragistics.Web.UI.PostBackEventArgs', $IG.EventArgs);


$IG.CancelEventArgs = function()
{
	/// <summary>Base class for object used as parameter while raising cancelable client events related to browser action.</summary>
	$IG.CancelEventArgs.initializeBase(this);
	this._cancel = false;
}
$IG.CancelEventArgs.prototype =
{
	
	get_cancel: function()
	{
		/// <summary>Checks if event was canceled.</summary>
		/// <returns type="Boolean">True: event was canceled.</returns>
		return this._cancel;
	},
	
	set_cancel: function(val)
	{
		/// <summary>Cancel event.</summary>
		/// <param name="val" type="Boolean">True: cancel event.</param>
		this._cancel = val;
	}
}
$IG.CancelEventArgs.registerClass('Infragistics.Web.UI.CancelEventArgs', $IG.EventArgs);


$IG.MoveEventArgs = function()
{
	/// <summary>Class for object used as parameter while raising Move events.</summary>
	$IG.MoveEventArgs.initializeBase(this);
}
$IG.MoveEventArgs.prototype =
{
	
	get_x: function()
	{
		/// <summary>Gets new left position.</summary>
		/// <returns type="Number">Left position in pixels.</returns>
		return this._props[2];
	},
	get_y: function()
	{
		/// <summary>Gets new top position.</summary>
		/// <returns type="Number">Top position in pixels.</returns>
		return this._props[3];
	},
	get_oldX: function()
	{
		/// <summary>Gets old left position.</summary>
		/// <returns type="Number">Left position in pixels.</returns>
		return this._props[4];
	},
	get_oldY: function()
	{
		/// <summary>Gets old top position.</summary>
		/// <returns type="Number">Top position in pixels.</returns>
		return this._props[5];
	},
	set_x: function(val)
	{
		/// <summary>Sets new left position.</summary>
		/// <param name="val" type="Number" integer="true">New left position in pixels.</param>
		this._props[2] = this._x = val;
	},
	set_y: function(val)
	{
		/// <summary>Sets new top position.</summary>
		/// <param name="val" type="Number" integer="true">New top position in pixels.</param>
		this._props[3] = this._y = val;
	}
}
$IG.MoveEventArgs.registerClass('Infragistics.Web.UI.MoveEventArgs', $IG.CancelEventArgs);





var _bugE = null;
function _bug4(v) { _bug3(v); _bugE.style.background = 'yellow'; }
function _bug3(v) { _bug("<br />" + v, true, "400px"); }
function _bug2(v) { _bug(v, true, "400px"); }
function _bug1(v) { _bug(v, false, "400px"); }
function _bug(v, a, l, t)
{
	if (!_bugE)
	{
		_bugE = document.createElement('DIV');
		document.body.insertBefore(_bugE, document.body.firstChild);
		var s = _bugE.style;
		s.position = 'absolute';
		s.zIndex = 10000;
		s.left = s.top = '0px';
		s.border = '1px dotted red';
		s.fontSize = '12px';
		s.fontFamily = 'courier';
	}
	if (l) _bugE.style.left = l;
	if (t) _bugE.style.top = t;
	_bugE.innerHTML = (a ? _bugE.innerHTML : '') + v;
}
//*/

/* END Infragistics.Web.UI.Scripts.5_igObjects.js */
/* START Infragistics.Web.UI.Scripts.7_igClientStateManager.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.ClientStateManagerBase = function(props)
{
    /// <summary>
    /// An object in charge of managing the ClientState of an Object.
    /// </summary>
    this._items = props;
    this._transactionList = null;
}

$IG.ClientStateManagerBase.prototype =
{	
    get_value:function(id)
    {
        /// <summary>
        /// Gets/Sets the value with the specified id.
        /// </summary>
    },
    set_value:function(id, value){},
    get_transactionList:function()
	{
	    /// <summary>
        /// Gets a json representation of the TranascationList
        /// </summary>
	    return this._transactionList.get_list();
	},
	
	get_clientState:function()
	{
	    /// <summary>
        /// Returns the original json ClientState that was passed down from the server.
        /// </summary>
	    return this._items;
	}
}

$IG.ClientStateManagerBase.registerClass('Infragistics.Web.UI.ClientStateManagerBase');



$IG.ObjectClientStateManager = function(props)
{
    /// <summary>
    /// A ClientStateManager that handles any object that derives from ObjectBase.
    /// </summary>
    $IG.ObjectClientStateManager.initializeBase(this, [props]);
    this._transactionList = new $IG.ObjectTransactionList();    
}

$IG.ObjectClientStateManager.prototype =
{	
    get_value:function(id, isBool)
    {
        var index = id[0];
        var defaultVal = id[1];
        
        var val = this._transactionList.get_value(index);
	    if(val == null)
	    {
	        val = this._items[0][index]
	        if(val == null)
	            val = defaultVal;
	    }
	    if(isBool)
	    {
	        if(val == 0)
	            val = false;
	        else if(val == 1)
	            val = true;
	    }
	    
	    return val;
    },
    
    get_clientOnlyValue:function(propName)
    {
        /// <summary>
        /// Returns the ClientOnlyProperty Value with the specified key.
        /// </summary>
        return this.__getExraProp(propName, "c");
    },
    
    get_occasionalProperty:function(propName)
    {
        /// <summary>
        /// Gets/Sets the OccasionalProperty value with the specified key.
        /// </summary>
        return this.__getExraProp(propName, "o");
    },
    
    set_occasionalProperty:function(propName, val)
    {
        var prop = this.__getExraProp(propName, "o");
         if(!$util.compare(prop, val))
            this._transactionList.add_transaction(val, propName);
        else
            this._transactionList.remove_transaction(propName);
    },
    
    __getExraProp:function(propName, key)
    {
        var item = this._items[1];
        if(item != null)
            item = item[key];
        return item ? item[propName] : null;
    },
    
    set_value:function(id, val)
    {
        var index = id[0];
        var defaultVal = id[1];
        
        if(typeof(val) == "boolean")
	        val = (val)?1:0;    
	    
	    var item = this._items[0][index];
        
        if(item == null)
            item =  defaultVal;
	    
        if(!$util.compare(item, val))
            this._transactionList.add_transaction( val, index);
        else
            this._transactionList.remove_transaction( index);
    },
    get_serverProps:function(vse)
	{
	    /// <summary>
        /// Returns a Server friendly array of ClientState.
        /// </summary>
	    if(vse)
	    {
	        var props = [];
	        props.push(this._items[0]);
	        if(this._items[1] != null && this._items[1]["o"] != null)
	            props.push(this._items[1]["o"]);    
	        return props;
	    }
	    else
	        return null;
	}
}

$IG.ObjectClientStateManager.registerClass('Infragistics.Web.UI.ObjectClientStateManager', $IG.ClientStateManagerBase);



$IG.CollectionClientStateManager = function(props)
{
    /// <summary>
    /// A ClientStateManager that handles any ObjectBase that belongs to an ObjectCollection.
    /// </summary>
    $IG.CollectionClientStateManager.initializeBase(this, [props]);   
    this._transactionList = new $IG.CollectionTransactionList(); 
}

$IG.CollectionClientStateManager.prototype =
{	 
    get_value:function(id, isBool, address)
    {
        var index = id[0];
        var defaultVal = id[1];
        
        var val = this._transactionList.get_value(address, index);
	    if(val == null)
	    {
	        val = this._items[address][0][index]
	        if(val == null)
	            val = defaultVal;
	    }
	    
	    if(isBool)
	    {
	        if(val == 0)
	            val = false;
	        else if(val == 1)
	            val = true;
	    }
	    return val;
    },
    
    get_clientOnlyValue:function(propName, adr)
    {
        /// <summary>
        /// Returns the ClientOnlyProperty Value with the specified key.
        /// </summary>
        return this.__getExraProp(propName, adr, "c");
    },
    
    get_occasionalProperty:function(propName, adr)
    {
        /// <summary>
        /// Gets/Sets the OccasionalProperty value with the specified key.
        /// </summary>
        var prop = this._transactionList.get_value(adr, propName);
        if(prop == null)
            prop = this.__getExraProp(propName, adr, "o");
        return prop;
    }, 
    
    set_occasionalProperty:function(propName, val, adr)
    {
        var prop = this.__getExraProp(propName, adr, "o");
         if(!$util.compare(prop, val))
            this._transactionList.add_transaction(adr, val, propName);
        else
            this._transactionList.remove_transaction(adr, propName);
    },
    
    __getExraProp:function(propName, adr, key)
    {
        var item = this._items[adr];
        if(item != null)
        {    item = item[1]
            if(item != null)
            {
                item = item[key];
            }
            if(item != null)
                return item[propName];
        }
        return null;
    },
    
    set_value:function(id, val, address)
    {
        var index = id[0];
        var defaultVal = id[1];
        
        if(typeof(val) == "boolean")
	        val = (val)?1:0;    
	    var item = this._items[address][0][index]
        
        if(item == null)
            item =  defaultVal;
            
        if(!$util.compare(item, val))
            this._transactionList.add_transaction(address, val, index);
        else
            this._transactionList.remove_transaction(address, index);
    }, 
    
    set_itemProps:function(adr, props)
    {
        /// <summary>
        /// Sets the original json ClientState from server to the ClientStateManager
        /// </summary>
        this._items[adr] = props;
    },
    
    get_serverProps:function(address)
	{
	    /// <summary>
        /// Returns a Server friendly array of ClientState.
        /// </summary>
        var props = [];
        var item = this._items[address];
        props.push(item[0]);
        if(item[1] != null && item[1]["o"] != null)
            props.push(item[1]["o"]);    
        return props;
	}
}

$IG.CollectionClientStateManager.registerClass('Infragistics.Web.UI.CollectionClientStateManager', $IG.ClientStateManagerBase);



$IG.TransactionListBase = function()
{
    /// <summary>
    /// An object in charge of managing any Transaction of ClientState.
    /// </summary>
    this._items = {};
    this._orderedList = {};
    this._count = 0; 
}
$IG.TransactionListBase.prototype =
{
    add_transaction:function()
    {
        /// <summary>
        /// Records a transaction in the Transaction list.
        /// </summary>
    },
    remove_transaction:function()
    {
        /// <summary>
        /// Removes a transaction from the Transaction list.
        /// </summary>
    },
    get_value:function()
    {
        /// <summary>
        /// Returns a value at the specified index, from the Transaction list.
        /// </summary>
    },
    get_list:function()
    {
        /// <summary>
        /// Returns a server friendly json object of the Transaction list.
        /// </summary>
        return this._orderedList;
    }  
}

$IG.TransactionListBase.registerClass('Infragistics.Web.UI.TransactionListBase');



$IG.ObjectTransactionList = function()
{
    /// <summary>
    /// A TransactionList targeted for ObjectBase objects.
    /// </summary>
    $IG.ObjectTransactionList.initializeBase(this);    
}
$IG.ObjectTransactionList.prototype =
{
    add_transaction:function(value, propsIndex)
    {
         if(this._items[propsIndex] != null && this._items[propsIndex].length > 0)
                delete this._orderedList[this._items[propsIndex][0]];
        this._items[propsIndex] = [this._count, value];
        this._orderedList[this._count] = [propsIndex, value];
        this._count++;
    },
    remove_transaction:function(propsIndex)
    {
        var item = this._items[propsIndex];
        if(item)
        {
            var index = item[0];
            delete this._orderedList[index];
            delete this._items[propsIndex];
        }
    }, 
    get_value:function(propsIndex)
    {
        var item = this._items[propsIndex];
        if(item != null)
            return item[1];
        return null;
    }
}

$IG.ObjectTransactionList.registerClass('Infragistics.Web.UI.ObjectTransactionList', $IG.TransactionListBase);



$IG.CollectionTransactionList = function()
{
    /// <summary>
    /// A Transaction list targeted for ObjectBase objects that belong to an ObjectCollection.
    /// </summary>
    $IG.CollectionTransactionList.initializeBase(this);    
}
$IG.CollectionTransactionList.prototype =
{
    add_transaction:function(adr, value, propsIndex)
    {
        var item = this._items[adr];
        if(!item)
            item = this._items[adr] = [];
        else
        {
            if(item[propsIndex] != null && item[propsIndex].length > 0)
                delete this._orderedList[item[propsIndex][0]];
        }
        
        item[propsIndex] = [this._count, value];
        this._orderedList[this._count] = [adr, propsIndex, value];
        this._count++;
    },
    
    remove_transaction:function(adr, propsIndex)
    {
        var item = this._items[adr]; 
        if(item != null)
        {
            item = item[propsIndex];
            if(item != null)
            {
                var index = item[0];
                delete this._orderedList[index];
                delete this._items[adr][propsIndex];
            }
        }
    }, 
    
    get_value:function(adr, propsIndex)
    {
        var item = this._items[adr];
        if(item != null)
        {
           item = item[propsIndex]
           if(item != null)
               return item[1];
        }
        return null;
    }
}

$IG.CollectionTransactionList.registerClass('Infragistics.Web.UI.CollectionTransactionList', $IG.TransactionListBase);

/* END Infragistics.Web.UI.Scripts.7_igClientStateManager.js */
/* START Infragistics.Web.UI.Scripts.8_igCallback.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.CallbackRequestHandler = function(manager, callbackObject, async)
{
	/// <summary>
	/// Handles a CallbackObject's request and resposne.
	/// </summary>
	var me = this;
	this._callbackObject = callbackObject;
	this._manager = manager;
	this._async = async;

	this._responseComplete = function()
	{
		if (me._request.readyState === 4 && me._request.status == "200")
		{
			window.clearTimeout(me._timerId);
			var response = me._request.responseText;
			if (response != null && response.length > 0)
			{
				var obj = Sys.Serialization.JavaScriptSerializer.deserialize(response)
				document.getElementById("__VIEWSTATE").value = obj[0];
				var eventValidation = document.getElementById("__EVENTVALIDATION");
				if (eventValidation)
					eventValidation.value = obj[1];
				me._manager._requestCompleted(me, me._callbackObject, obj[2]);
				for (var i in obj[3])
				{
					var id = obj[3][i][0];
					var ctrlObj = $find(id);
					if (ctrlObj && ctrlObj.dispose)
						ctrlObj.dispose();
					var x = eval(obj[3][i][1]);
				}
			}
			else
			{
				me._timedOut();
			}

			me._callbackObject = null;
			me._manager = null;
			me._request = null;
		}
		else if (me._request.readyState === 4)
			me._manager._requestFailed(me, me._callbackObject);		
	}
}

$IG.CallbackRequestHandler.prototype =
{
	execute: function()
	{
		/// <summary>
		/// Executes a XmlHttpRequest to the server
		/// </summary>
		this._request = null;
		if (typeof XMLHttpRequest != "undefined")
			this._request = new XMLHttpRequest();
		else if (typeof ActiveXObject != "undefined")
		{
			try { this._request = ig_createActiveXFromProgIDs(["MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]); } catch (e) { }
		}

		if (this._request)
		{
			this._request.open(this._manager.getHttpVerb(), this._manager.getUrl(), this._async);
			this._request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			this._request.onreadystatechange = this._responseComplete;
			this._timerId = window.setTimeout(Function.createDelegate(this, this._timedOut), this._manager.getTimeout());
			this._request.send(this._getArgs());
		}
	},

	_getArgs: function()
	{
		var form = this._manager._getForm();
		if (!form) return;

		// Ensures that all Infragistics Controls have their PostData set.
		if (typeof ig_controls == 'object')
			for (var id in ig_controls)
			ig_controls[id]._onIgSubmit();

		var count = form.elements.length;
		var element;
		for (var i = 0; i < count; i++)
		{
			element = form.elements[i];
			if (element.tagName.toLowerCase() == "input" && (element.type == "hidden" || element.type == 'password' || element.type == 'text' || ((element.type == "checkbox" || element.type == 'radio') && element.checked)))
				this._addCallbackField(element.name, element.value);
			else if (element.tagName.toLowerCase() == "textarea")
				this._addCallbackField(element.name, element.value);
			else if (element.tagName.toLowerCase() == "select")
			{
				var o = element.options.length;
				while (o-- > 0)
				{
					if (element.options[o].selected)
						this._addCallbackField(element.name, element.options[o].value);
				}
			}
		}

		var args = this._postdata + "__EVENTTARGET=&__EVENTARGUMENT=&__IGCallback_" + this._manager._control._id + "=";
		args += Sys.Serialization.JavaScriptSerializer.serialize(this._callbackObject._getServerData());
		return args;
	},

	_addCallbackField: function(name, value)
	{
		if (!this._postdata)
			this._postdata = "";
		this._postdata += name + "=" + this._encodeValue(value) + "&";
	},

	_encodeValue: function(uri)
	{
		if (encodeURIComponent != null)
			return encodeURIComponent(uri);
		else
			return escape(parameter);
	},

	_timedOut: function()
	{
		this._manager._requestFailed(this, this._callbackObject, true);
	}
};
$IG.CallbackRequestHandler.registerClass("Infragistics.Web.UI.CallbackRequestHandler");



$IG.ControlCallbackManager = function(control)
{
	/// <summary>
	/// An object in charge of managin all Callbacks for an Infragistics.Web.UI.Control.
	/// </summary>
	this._control = control;
	this._httpVerb = "POST"
	this._async = true;
	this._timeout = 20000;
	this._url = this._getForm().action;

	this._currentRequests = 0;
	this._callbackQueue = [];
}

$IG.ControlCallbackManager.prototype =
{
	createCallbackObject: function(control)
	{
		/// <summary>
		/// Creates a new CallbackObject for the control.
		/// </summary>
		if (!control)
			control = this._control;
		return new $IG.CallbackObject(control);
	},

	execute: function(callback, queue, async)
	{
		/// <summary>
		/// Initiates an XmlHTTPRequest for the specified CallbackObject.
		/// </summary>
		if (callback)
		{
			if (async == null)
				async = this.getAsync();
			var requestHandler = new $IG.CallbackRequestHandler(this, callback, async);

			if (queue && this._currentRequests > 0)
				this._pushCallback(requestHandler)
			else
			{
				this._currentRequests++;
				requestHandler.execute();
			}
		}
	},

	_pushCallback: function(callback)
	{
		this._callbackQueue.push(callback);
	},

	_popCallback: function()
	{
		for (var i = 0; i < this._callbackQueue.length; i++)
		{
			var requestHandler = this._callbackQueue[i];
			if (requestHandler != null)
			{
				delete this._callbackQueue[i];
				this._currentRequests++;
				requestHandler.execute();
			}
		}
	},

	getAsync: function()
	{
		/// <summary>
		/// Get/Sets whether or not the Callback should be Async.
		/// The Default is true.
		/// </summary>
		return this._async;
	},
	setAsync: function(val) { return this._async; },

	getHttpVerb: function()
	{
		/// <summary>
		/// Get/Sets the HTTP Verb for the Callback.
		/// The Default is "Post"
		/// </summary>
		return this._httpVerb;
	},
	setHttpVerb: function(verb) { this._httpVerb = verb; },

	getUrl: function()
	{
		/// <summary>
		/// Get/Sets the url for the Callback. 
		/// The default is the current form's action.
		/// </summary>
		return this._url;
	},
	setUrl: function(url) { this._url = url; },

	getTimeout: function()
	{
		/// <summary>
		/// Get/Sets the amount of time (in ms) that is allowed to pass before failing the Callback.
		/// The default is 20000
		/// </summary>
		return this._timeout;
	},
	setTimeout: function(val) { this._timeout = val; },

	_getForm: function()
	{
		if (!this._form)
		{
			if (document.forms.length > 1)
			{
				for (var i = 0; i < document.forms.length; i++)
				{
					if (document.forms[i].method == "post" && document.forms[i].action != "")
					{
						this._form = document.forms[i];
						break;
					}
				}
				if (!this._form)
					this._form = document.forms[0];
			}
			else
				this._form = document.forms[0];
			if (!this._form)
				this._form = document.form1;
		}
		return this._form
	},

	_endRequest: function()
	{
		this._currentRequests--;
		if (this._callbackQueue.length > 0)
			this._popCallback();
	},

	setResponseComplete: function(func, context)
	{
		/// <summary>
		/// Sets the method that should be called when the Callback has returned from the server. 
		/// </summary>
		this._responseCompleteFunction = func;
		if (!context)
			context = this._control;
		this._responseCompleteContext = context;
	},

	_requestFailed: function(requestHandler, callbackObject, timedOut)
	{
		window.clearTimeout(requestHandler._timerId);
		if (requestHandler._request.readyState == 4)
			callbackObject._responseCompleteError(requestHandler._request, timedOut);
		this._endRequest();
		requestHandler._request.abort();
		requestHandler._request = null;
	},

	_requestCompleted: function(requestHandler, callbackObject, responseObject)
	{
		this._endRequest();
		this._recursiveResponseCompleted(callbackObject, responseObject, requestHandler._request);
	},

	_recursiveResponseCompleted: function(callbackObject, responseObject, browserResponseObject)
	{
		this._responseComplete(callbackObject, responseObject, browserResponseObject);
		for (var i = 0; i < callbackObject._childCallbacks.length; i++)
			this._recursiveResponseCompleted(callbackObject._childCallbacks[i], responseObject.children[i], browserResponseObject);
	},

	_responseComplete: function(callbackObject, responseObject, browserResponseObject)
	{
		if (!callbackObject._responseComplete(responseObject, browserResponseObject))
		{
			if (this._responseCompleteFunction)
				this._responseCompleteFunction.apply(this._responseCompleteContext, [callbackObject, responseObject, browserResponseObject]);
		}
		callbackObject.dispose();
	},

	dispose: function()
	{
		this._control = null;
		this._form = null;
		this._responseCompleteContext = null;
	}

};
$IG.ControlCallbackManager.registerClass("Infragistics.Web.UI.ControlCallbackManager");



$IG.CallbackObject = function(control)
{
	/// <summary>
	/// An object that contains information about a Callback that should be made to the server.
	/// </summary>
	this._control = control;
	this.serverContext = {};
	this.clientContext = {};
	this._childCallbacks = [];
}

$IG.CallbackObject.prototype =
{
	createCallbackObject: function(control)
	{
		/// <summary>
		/// Creates a child CallbackObject of the current CallbackObject
		/// </summary>
		if (!control)
			control = this._control;
		var callbackObject = new $IG.CallbackObject(control);
		this._childCallbacks.push(callbackObject);
		return callbackObject;
	},

	getId: function()
	{
		/// <summary>
		/// Returns the id of the control that is attached to the callback.
		/// </summary>
		return this._control._id;
	},

	getServerContext: function()
	{
		/// <summary>
		/// Returns the JSON object that will be used to pass infomration to the server about the specific Callback
		/// </summary>    
		return this.serverContext;
	},
	getClientContext: function()
	{
		/// <summary>
		/// Returns the JSON object that will be used to pass infomration to the ResponseComplete event of the Callback.
		/// </summary>    
		return this.clientContext;
	},

	setResponseComplete: function(func, context, funcError)
	{
		/// <summary>
		/// Sets an event listener for the ResponseComplete event of the CallbackObject
		/// </summary>    
		this._responseCompleteFunction = func;
		this._responseCompleteErrorFunction = funcError;
		if (!context)
			context = this._control;
		this._responseCompleteContext = context;
	},

	_responseComplete: function(responseObj, browserResponseObject)
	{
		if (this._responseCompleteFunction)
		{
			this._responseCompleteFunction.apply(this._responseCompleteContext, [this, responseObj, browserResponseObject]);
			return true;
		}
		else if (typeof (this._control._responseComplete) != "undefined")
		{
			this._control._responseComplete(this, responseObj, browserResponseObject);
			return true;
		}
		return false;
	},

	_responseCompleteError: function(responseObj, timedOut)
	{
		if (this._responseCompleteErrorFunction)
		{
			this._responseCompleteErrorFunction.apply(this._responseCompleteContext, [this, responseObj, timedOut]);
			return true;
		}
		else if (typeof (this._control._responseCompleteError) != "undefined")
		{
			this._control._responseCompleteError(this, responseObj, timedOut);
			return true;
		}
		return false;
	},

	_getServerData: function()
	{
		var data = { id: this._control.get_uniqueID(), context: this.serverContext, children: [] };
		for (var i = 0; i < this._childCallbacks.length; i++)
			data.children[i] = this._childCallbacks[i]._getServerData();
		return data;
	},

	dispose: function()
	{
		this._control = null;
		this.serverContext = null;
		this.clientContext = null;
	}

};
$IG.CallbackObject.registerClass("Infragistics.Web.UI.CallbackObject");

/* END Infragistics.Web.UI.Scripts.8_igCallback.js */
/* START Infragistics.Web.UI.Scripts.9_igPropertyManagers.js */
Type.registerNamespace("Infragistics.Web.UI");


$IG.CollectionsManager = function(control, collections)
{
    ///<summary>
    /// For Internal Use Only.
    /// An object that manages all ObjectCollections of an Infragistics.Web.UI.Control.
    ///</summary>
    this._control = control;
    this._collections = collections;
    if(collections == null)
        this._count = 0; 
    else
        this._count = this._collections.length
    this._itemCollections = [];
    this._clientStateManagers = [];
    this._items = [];
    this._itemCount = [];
    this._uiBehaviors = []; 
    for(var i = 0; i < this._count; i++)
    {
        this._itemCount[i] = 0;
        this._items[i] = {};
        this._clientStateManagers[i] = new $IG.CollectionClientStateManager(collections[i]);       
    }
}

$IG.CollectionsManager.prototype =
{
	get_collection: function(index)
	{
		///<summary>
		/// Gets the ObjectCollection at the specified index.
		///</summary>    
		return this._collections[index];
	},

	get_count: function()
	{
		///<summary>
		/// Gets the amount of Collections that belong to the control.
		///</summary>    
		return this._count;
	},

	get_allTransactionLists: function()
	{
		///<summary>
		/// Returns all json Transaction Lists of all collections in a server friendly format.
		///</summary>    
		var state = [];
		for (var i = 0; i < this._count; i++)
			state[i] = this.get_transactionList(i);
		return state;
	},

	get_transactionList: function(index)
	{
		///<summary>
		/// Returns the json Transaction List of the collection at the specified index.
		///</summary>    
		return this._clientStateManagers[index].get_transactionList()
	},

	register_collection: function(index, collectionType, noBehavior)
	{
		///<summary>
		/// Registers a collection with the CollectionManager.
		///</summary>    
		var collection = this._itemCollections[index] = new collectionType(this._control, this._clientStateManagers[index], index, this);
		return collection;
	},

	registerUIBehaviors: function(collection)
	{
		///<summary>
		/// Creates a UIBehaviors object for the specified collection. 
		///</summary>    
		var index = collection._index;
		this._uiBehaviors[index] = new $IG.UIBehaviorsObject(this._control, collection)
	},

	getItemCount: function(index)
	{
		///<summary>
		/// Retunrs the number of items in the collection at the specified index. 
		///</summary>    
		return this._itemCount[index];
	},

	getUIBehaviorsObj: function(index)
	{
		///<summary>
		/// Returns the UIBehaviors object of the collection at the specified index.
		///</summary>    
		return this._uiBehaviors[index];
	},

	addObject: function(index, adr, object)
	{
		///<summary>
		/// Adds the specified item to the collection at the specified index.
		///</summary>    
		this._items[index][adr] = object;
		var uiBehaviorObj = this._uiBehaviors[index];
		if (uiBehaviorObj)
		{
			if (object._getFlags().getSelected())
				uiBehaviorObj.select(object);
		}
		this._itemCount[index]++;
	},

	getObject: function(index, adr)
	{
		///<summary>
		/// Returns the item at the specified address from the collection at the specified index.
		///</summary>    
		return this._items[index][adr];
	},

	getServerCollection: function(vse)
	{
		///<summary>
		/// Returns a server friendly array of all ClientState for all collections.
		///</summary>    
		if (vse)
		{
			var collections = [];
			for (var index in this._collections)
			{
				collections[index] = {};
				var csm = this._clientStateManagers[index];
				for (var adr in this._collections[index])
					collections[index][adr] = csm.get_serverProps(adr);
			}
			return collections;
		}
		else
			return null;

	},

	dispose: function()
	{
		///<summary>
		/// Disposes of all objects created by the Collection manager.
		///</summary>
		if (!this._itemCollections)
			return;
		var count = this._itemCollections.length;
		for (var i = 0; i < count; i++)
		{
			if (this._uiBehaviors[i])
				this._uiBehaviors[i].dispose();
			this._itemCollections[i].dispose();
			var item = this._items[i]
			for (var adr in item)
			{
				
				
				
				var obj = item[adr];
				if (obj && obj.dispose)
					obj.dispose();
			}
		}
		this._control = null;
		this._collections = null;
		this._itemCollections = null;
		this._clientStateManagers = null;
		this._items = null;
		this._itemCount = null;
		this._uiBehaviors = null;
	}
};

$IG.CollectionsManager.registerClass('Infragistics.Web.UI.CollectionsManager');




$IG.ObjectsManager = function(control, objects)
{
    ///<summary>
    /// Manages all objects for a control. 
    ///</summary>    
    this._objects = objects;
    this._control = control;
    this._clientStateManagers = [];
    this._objectCollection = [];
    if(objects == null)
        this._count = 0; 
    else
        this._count = this._objects.length;
}

$IG.ObjectsManager.prototype =
{
	get_objectProps: function(index)
	{
		///<summary>
		/// Returns the json ClientState from the server of the object at the specified index.
		///</summary>    
		return this._objects[index];
	},

	get_count: function()
	{
		///<summary>
		/// Returns the amount of objects on the control. 
		///</summary>    
		return this._count;
	},

	register_object: function(index, object)
	{
		///<summary>
		/// Registers the object at the specified index with the ObjectManager.
		///</summary>    
		this._clientStateManagers[index] = object._csm;
		this._objectCollection[index] = (object);
		var objectProps = this._objects[index];

		objectProps.objectsManager = new $IG.ObjectsManager(object, objectProps[1]);
		objectProps.collectionsManager = new $IG.CollectionsManager(object, objectProps[2]);
		objectProps.registered = true;

		object._createObjects(objectProps.objectsManager);
		object._createCollections(objectProps.collectionsManager);

		this._objects[index] = objectProps;
	},

	get_object: function(index)
	{
		///<summary>
		/// Returns the object at the specifeid index.
		///</summary>    
		return this._objectCollection[index];
	},

	get_allTransactionLists: function()
	{
		///<summary>
		/// Returns all json Transaction Lists in a Server Friendly format for all objects in the object manager.
		///</summary>    
		var state = [];
		for (var i = 0; i < this._count; i++)
			state[i] = this.get_transactionList(i);
		return state;
	},

	get_csm: function(index)
	{
		///<summary>
		/// Returns the ClientStateManager for the object at the specified index. 
		///</summary>    
		return this._clientStateManagers[index];
	},

	getServerObjects: function(vse)
	{
		///<summary>
		/// Returns the ClientState for all objects in a Server friendly format.
		///</summary>    
		var objects = [];
		for (var index in this._objects)
		{
			var object = this._objects[index];
			if (object.registered)
			{
				var csm = this._clientStateManagers[index];
				var state = [[csm.get_serverProps(vse), object.objectsManager.getServerObjects(vse), object.collectionsManager.getServerCollection(vse)]];
				state[1] = [csm.get_transactionList(), object.collectionsManager.get_allTransactionLists()];
				state[2] = this._objectCollection[index]._saveAdditionalClientState();
				objects[index] = state;
			}
			else
			{
				

				
				objects[index] = this._getUnRegisteredServerObjects(object);
			}

		}
		return objects;

	},

	_getUnRegisteredServerObjects: function(obj)
	{
		var returnObjects = [];
		var objs = obj[1];
		for (var i = 0; objs && i < objs.length; i++)
		{
			returnObjects.push(this._getUnRegisteredServerObjects(objs[i]));
		}
		return [[obj[0], returnObjects, obj[2]], [null, null], [null]];
	},

	get_transactionList: function(index)
	{
		///<summary>
		/// Returns the json TransactionList for the Object at the specified index.
		///</summary>    
		var csm = this._clientStateManagers[index];
		if (csm)
			return csm.get_transactionList();
		else
			return null;
	},

	dispose: function()
	{
		///<summary>
		/// Disposes of all objects created by the ObjectManager.
		///</summary>
		if (!this._objectCollection)
			return;
		var count = this._objectCollection.length;
		for (var i = 0; i < count; i++)
		{
			if (this._objectCollection[i] && (!Sys.Component.isInstanceOfType(this._objectCollection[i]) || !Sys.Application._disposing))
				this._objectCollection[i].dispose();
		}
		this._control = null;
		this._objects = null;
		this._clientStateManagers = null;
		this._objectCollection = null;
	}

};

$IG.ObjectsManager.registerClass('Infragistics.Web.UI.ObjectsManager');

/* END Infragistics.Web.UI.Scripts.9_igPropertyManagers.js */
/* START Infragistics.Web.UI.SharedScripts.igResizeBehavior.js */
Type.registerNamespace('Infragistics.Web.UI');
$IG.ResizeBehavior = function(element)
{
	/// <summary>Class which implements resizing behavior.</summary>
	/// <param name="element" type="Object" mayBeNull="false">Reference to html element.</param>
	$IG.ResizeBehavior.initializeBase(this, [element]);

	this._props = ['', '', '', 0, 0, 2000, 2000, 0, 0, 0, 0, 0, '', '', '', '', '', ''];
}
$IG.ResizeBehavior.prototype =
{
	/// <summary>Internal flag used by WebDialogWindow to temporary disable resize.</summary>
	enabled:true,
	
	get_pairs:function()
	{
		/// <summary>Internal use only.</summary>
		/// <returns type="Object">Returns null.</returns>
	},
	
	set_pairs:function(vals)
	{
		/// <summary>Internal use only.</summary>
		/// <param name="vals" type="Object">Array from server.</param>
		vals = vals.split('|');
		for(var i = 0; i < vals.length; i += 2)
		{
			var id = parseInt(vals[i]), val = vals[i + 1];
			this._props[id] = (id > 2 && id < 12) ? parseInt(val) : $util.replace(val, '&pipe;', '|');
			if(id == 2)
				this._border = parseInt(val.substring(0, 1));
		}
	},
	
	get_handleClass:function()
	{
		/// <summary>Gets name of css class used for handle element.</summary>
		/// <returns type="String" mayBeNull="true">Name of css.</returns>
		return this._get_(0);
	},
	set_handleClass:function(val)
	{
		/// <summary>Sets name of css class used for handle element.</summary>
		/// <param name="val" type="String">Name of css.</param>
		this._set_(0, val);
		if(this._hand) this._hand.className = val;
	},
	
	get_handleImage:function()
	{
		/// <summary>Gets value of src used for IMG displayed on handle element.</summary>
		/// <returns type="String" mayBeNull="true">Value of src.</returns>
		return this._get_(1);
	},
	set_handleImage:function(val)
	{
		/// <summary>Sets value for src used by IMG displayed on handle element.</summary>
		/// <param name="val" type="String">Name of css.</param>
		this._set_(1, val);
		if(this._hand) this._hand.src = val;
	},
	get_resizeBorder:function()
	{
		/// <summary>Gets thickness of border around target element.</summary>
		/// <returns type="Number" mayBeNull="true">Thickness of border in pixels.</returns>
		return this._get_(2);
	},
	set_resizeBorder:function(val)
	{
		/// <summary>Sets thickness of border around target element. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="true">Thickness of border in pixels.</param>
		this._set_(2, val);
		this._border = $util.isEmpty(val) ? null : parseInt(val.substring(0, 1));
	},
	
	get_minimumWidth:function()
	{
		/// <summary>Gets minimum width of target.</summary>
		/// <returns type="Number" mayBeNull="false">Minimum width in pixels.</returns>
		return this._get_(3);
	},
	set_minimumWidth:function(val)
	{
		/// <summary>Sets minimum width of target. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Minimum width in pixels.</param>
		this._set_(3, val);
	},
	
	get_minimumHeight:function()
	{
		/// <summary>Gets minimum height of target.</summary>
		/// <returns type="Number" mayBeNull="false">Minimum height in pixels.</returns>
		return this._get_(4);
	},
	set_minimumHeight:function(val)
	{
		/// <summary>Sets minimum height of target. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Minimum height in pixels.</param>
		this._set_(4, val);
	},
	
	get_maximumWidth:function()
	{
		/// <summary>Gets maximum width of target.</summary>
		/// <returns type="Number" mayBeNull="false">Maximum width in pixels.</returns>
		return this._get_(5);
	},
	set_maximumWidth:function(val)
	{
		/// <summary>Sets maximum width of target. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Maximum width in pixels.</param>
		this._set_(5, val);
	},
	
	get_maximumHeight:function()
	{
		/// <summary>Gets maximum height of target.</summary>
		/// <returns type="Number" mayBeNull="false">Maximum height in pixels.</returns>
		return this._get_(6);
	},
	set_maximumHeight:function(val)
	{
		/// <summary>Sets maximum height of target. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Maximum height in pixels.</param>
		this._set_(6, val);
	},
	
	get_offsetLeft:function()
	{
		/// <summary>Gets offset of left edge of handle.</summary>
		/// <returns type="Number" mayBeNull="false">Left offset in pixels.</returns>
		return this._get_(7);
	},
	set_offsetLeft:function(val)
	{
		/// <summary>Sets offset of left edge of handle. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Left offset in pixels.</param>
		this._set_(7, val);
	},
	
	get_offsetTop:function()
	{
		/// <summary>Gets offset of top edge of handle.</summary>
		/// <returns type="Number" mayBeNull="false">Top offset in pixels.</returns>
		return this._get_(8);
	},
	set_offsetTop:function(val)
	{
		/// <summary>Sets offset of top edge of handle. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Top offset in pixels.</param>
		this._set_(8, val);
	},
	
	get_offsetRight:function()
	{
		/// <summary>Gets offset of right edge of handle.</summary>
		/// <returns type="Number" mayBeNull="false">Right offset in pixels.</returns>
		return this._get_(9);
	},
	set_offsetRight:function(val)
	{
		/// <summary>Sets offset of right edge of handle. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Right offset in pixels.</param>
		this._set_(9, val);
	},
	
	get_offsetBottom:function()
	{
		/// <summary>Gets offset of bottom edge of handle.</summary>
		/// <returns type="Number" mayBeNull="false">Bottom offset in pixels.</returns>
		return this._get_(10);
	},
	set_offsetBottom:function(val)
	{
		/// <summary>Sets offset of bottom edge of handle. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">Bottom offset in pixels.</param>
		this._set_(10, val);
	},
	
	get_parentType:function()
	{
		/// <summary>Gets type of resizing.</summary>
		/// <returns type="Number" mayBeNull="false">2 - internal, 0 - external.</returns>
		return this._get_(11);
	},
	set_parentType:function(val)
	{
		/// <summary>Sets type of resizing. Available only while initialization.</summary>
		/// <param name="val" type="Number" mayBeNull="false">2 - internal, 0 - external.</param>
		this._set_(11, val);
	},
	
	get_toolTip:function()
	{
		/// <summary>Gets tooltip for handle element.</summary>
		/// <returns type="String" mayBeNull="true">Title associated with handle.</returns>
		return this._get_(12);
	},
	set_toolTip:function(val, v)
	{
		/// <summary>Sets tooltip for handle element.</summary>
		/// <param name="val" type="String">Title associated with handle.</param>
		/// <param name="v" type="Boolean" mayBeNull="true" optional="true">True: do not adjust server state.</param>
		if(!v) this._set_(12, val);
		v = this._hand;
		if(v) v.alt = v.title = val;
	},
	
	get_resize:function()
	{
		/// <summary>Gets name of function which is called after resize events.</summary>
		/// <returns type="String" mayBeNull="true">Name of function.</returns>
		return this._get_(13);
	},
	set_resize:function(val)
	{
		/// <summary>Sets name of function which is called after resize events. Available only while initialization.</summary>
		/// <param name="val" type="String">Name of function.</param>
		this._set_(13, val, 'Resize');
	},
	add_resize:function(handler)
	{
		/// <summary>Adds function which is called after resize events.</summary>
		/// <param name="handler">Function.</param>
		$util.addClientEvent(this, 'Resize', handler);
	},
	remove_resize:function(handler)
	{
		/// <summary>Removes function which was called after resize events.</summary>
		/// <param name="handler">Function.</param>
		$util.removeClientEvent(this, 'Resize', handler);
	},
	
	get_resizing:function()
	{
		/// <summary>Gets name of function which is called before resize events.</summary>
		/// <returns type="String" mayBeNull="true">Name of function.</returns>
		return this._get_(14);
	},
	set_resizing:function(val)
	{
		/// <summary>Sets name of function which is called before resize events. Available only while initialization.</summary>
		/// <param name="val" type="String">Name of function.</param>
		this._set_(14, val, 'Resizing');
	},
	add_resizing:function(handler)
	{
		/// <summary>Adds function which is called before resize events.</summary>
		/// <param name="handler">Function.</param>
		$util.addClientEvent(this, 'Resizing', handler);
	},
	remove_resizing:function(handler)
	{
		/// <summary>Removes function which was called before resize events.</summary>
		/// <param name="handler">Function.</param>
		$util.removeClientEvent(this, 'Resizing', handler);
	},
	
	get_mouseover:function()
	{
		/// <summary>Gets name of function which is called on mouseover events.</summary>
		/// <returns type="String" mayBeNull="true">Name of function.</returns>
		return this._get_(15);
	},
	set_mouseover:function(val)
	{
		/// <summary>Sets name of function which is called on mouseover events. Available only while initialization.</summary>
		/// <param name="val" type="String">Name of function.</param>
		this._set_(15, val, 'MouseOver');
	},
	add_mouseover:function(handler)
	{
		/// <summary>Adds function which is called on mouseover events.</summary>
		/// <param name="handler">Function.</param>
		$util.addClientEvent(this, 'MouseOver', handler);
	},
	remove_mouseover:function(handler)
	{
		/// <summary>Removes function which was called on mouseover events.</summary>
		/// <param name="handler">Function.</param>
		$util.removeClientEvent(this, 'MouseOver', handler);
	},
	
	get_mouseout:function()
	{
		/// <summary>Gets name of function which is called on mouseout events.</summary>
		/// <returns type="String" mayBeNull="true">Name of function.</returns>
		return this._get_(16);
	},
	set_mouseout:function(val)
	{
		/// <summary>Sets name of function which is called on mouseout events. Available only while initialization.</summary>
		/// <param name="val" type="String">Name of function.</param>
		this._set_(16, val, 'MouseOut');
	},
	add_mouseout:function(handler)
	{
		/// <summary>Adds function which is called on mouseout events.</summary>
		/// <param name="handler">Function.</param>
		$util.addClientEvent(this, 'MouseOut', handler);
	},
	remove_mouseout:function(handler)
	{
		/// <summary>Removes function which was called on mouseout events.</summary>
		/// <param name="handler">Function.</param>
		$util.removeClientEvent(this, 'MouseOut', handler);
	},
	
	get_initialize:function()
	{
		/// <summary>Gets name of function which is called after initialization.</summary>
		/// <returns type="String" mayBeNull="true">Name of function.</returns>
		return this._get_(17);
	},
	set_initialize:function(val)
	{
		/// <summary>Sets name of function which is called after initialization.</summary>
		/// <param name="val" type="String">Name of function.</param>
		this._set_(17, val, 'Initialize');
	},
	
	getFrameElement:function()
	{
		/// <summary>Gets reference to target-frame html element.</summary>
		/// <returns type="Object">Html element.</returns>
		return this._handDad;
	},
	getHandleElement:function()
	{
		/// <summary>Gets reference to handle html element.</summary>
		/// <returns type="Object">Html element.</returns>
		return this._hand;
	},
	initialize:function()
	{
		/// <summary>Initializes instance of ResizeBehavior.</summary>
		$IG.ResizeBehavior.callBaseMethod(this, 'initialize');
		this._target = this.getTargetElement();
		if(!this._target)
		{
			throw 'Target element for ResizeBehavior not found';
			return;
		}
		if(this._onTimer(true))
			delete this._onTimer;
		else
			ig_ui_timer(this);
	},
	_shift: function()
	{
		this._s.marginLeft = (this._shiftX + this._divX - this._bdr) + 'px';
		this._s.marginTop = (this._shiftY + this._divY - this._bdr) + 'px';
	},
	_onTimer: function(init)
	{
		if(this._width)
			return true;
		var elem = this._target, ctl = this._control;
		var val = elem ? elem.offsetWidth : 0;
		if(!val || val == 0)
			return false;
		if(ctl && ctl.canResize && !ctl.canResize())
			return false;
		this._width = val;
		this._height = elem.offsetHeight;
		var tag = elem.nodeName;
		
		this._bdr = this._divX = this._divY = 0;
		val = this.get_parentType();
		
		this._div = (val == 2) || !(tag == 'DIV' || tag == 'SPAN');
		var td = (tag == 'TABLE' && val != 2) ? elem.rows[0] : null;
		if(td) td = td.cells[0];
		else if(val == 1) this._div = false;
		if(tag == 'TD') td = elem;
		
		var zi = 0, style = $util.getRuntimeStyle(elem);
		if(this._div && !td)
		{
			val = $util.getStyleValue(style, 'position');
			if(elem.type == 'hidden')
				alert('Can not attach resizer to a hidden element ' + elem.id);
		}
		if(val == 'absolute' || val == 'relative')
		{
			zi = $util.getStyleValue(style, 'zIndex');
			if(!zi || zi < 1) zi = 99999;
		}
		
		this._shiftX = $util.getOffset(style, true, true);
		this._shiftY = $util.getOffset(style, false, true);
		this._widthFix = this._shiftX + $util.getOffset(style, true, false, true);
		this._heightFix = this._shiftY + $util.getOffset(style, false, false, true);
		this._shiftHandX = $util.toIntPX(style, 'borderRightWidth');
		this._shiftHandY = $util.toIntPX(style, 'borderBottomWidth');
		
		val = this.get_offsetLeft();
		this._shiftX = -this._shiftX + val;
		this._shiftWidth = val - this.get_offsetRight();
		val = this.get_offsetTop();
		this._shiftY = -this._shiftY + val;
		this._shiftHeight = val - this.get_offsetBottom();
		val = this.get_stateValue();
		if(val)
		{
			val = val.split(',');
			if(!$util.isEmpty(val[0]))
				this._width = $util.toInt(val[0]);
			if(!$util.isEmpty(val[1]))
				this._height = $util.toInt(val[1]);
		}
		
		this._handDad = document.createElement('DIV');
		this._s = style = this._handDad.style;
		
		if(td)
			elem = td;
		if(!td && this._div)
		{
			td = elem;
			elem = elem.parentNode;
			if(zi > 0) style.zIndex = zi + 1;
		}
		else
			td = elem.firstChild;
		
		style.width = style.height = '0px';
		this._shift();
		style.position = 'absolute';
		elem.insertBefore(this._handDad, td);
		
		val = this.get_handleImage();
		if(val && val.length > 0)
		{
			this._im = elem = document.createElement('IMG');
			elem.src = val;
			elem._me = this;
			$addHandlers(elem, {'readystatechange':this._resize, 'load':this._resize}, this);
		}
		else
			elem = document.createElement('DIV');
		elem.className = this.get_handleClass();
		elem.style.position = 'absolute';
		elem.unselectable = 'on';
		
		this._hand = elem;
		this.set_toolTip(this.get_toolTip(), true);
		this._handDad.appendChild(elem);
		val = $util.getStyleValue(null, 'cursor', elem);
		if(!val || val == 'auto')
			elem.style.cursor = val = 'SE-resize';
		this._s.cursor = val;
		$addHandlers(this._hand, {'mousedown':this._onMouseDown, 'mouseover':this._onMouseOver, 'mouseout':this._onMouseOut}, this);
		this._onMouseMoveFn = Function.createDelegate(this, this._onMouseMove);
		this._onMouseUpFn = Function.createDelegate(this, this._onMouseUp);
		this._onSelectFn = Function.createDelegate(this, this._onSelectStart);
		this._resize();
		if(!ctl)
			this._raiseClientEvent('Initialize');
		return true;
	},
	_resize: function(e)
	{
		var im = this._im, hand = this._hand, elem = this._target;
		if(!hand)
			return;
		if(im && (im.complete || im.readyState == 'complete'))
			e = this._im = null;
		var width = this._width, height = this._height;
		if(e)
		{
			var b = e.button;
			if(b == 0 && e.rawEvent)
				b = e.rawEvent.button;
			if(b == 1)
				this._but = 1;
			if(this._but == 1 && this._drag && b != 1)
			{
				this._onMouseUp(e);
				return;
			}
			if(!e.type || e.type.indexOf('m') != 0)
				return;
			var x = e.clientX, y = e.clientY;
			if(this._x == null)
			{
				this._x = x;
				this._y = y;
				this._widthOld = width;
				this._heightOld = height;
			}
			x -= this._x;
			y -= this._y;
			if(x == 0 && y == 0)
				return;
			width = this._widthOld + x;
			height = this._heightOld + y;
			
			var args = this._raiseClientEvent('Resizing', 'Resize', e, null, width, height, this._widthOld, this._heightOld);
			if(args && args.get_cancel())
				return;
		}
		else if(this._im)
			return;
		var handWidth = hand.offsetWidth, handHeight = hand.offsetHeight;
		width = Math.min(Math.max(width, Math.max(this.get_minimumWidth(), handWidth) + this._widthFix), this.get_maximumWidth());
		height = Math.min(Math.max(height, Math.max(this.get_minimumHeight(), handHeight) + this._heightFix), this.get_maximumHeight());
		var style = elem.style;
		var width0 = width - this._widthFix, height0 = height - this._heightFix;
		if(this.enabled)
		{
			style.width = width0 + 'px';
			style.height = height0 + 'px';
			width0 = elem.offsetWidth;
			height0 = elem.offsetHeight;
			if(width0 > width)
			{
				width = width0;
				style.width = (width - this._widthFix) + 'px';
			}
			if(height0 > height)
			{
				height = height0;
				style.height = (height - this._heightFix) + 'px';
			}
			
			if(this._control && this._control.onResize)
				this._control.onResize(e);
		}
		this._width = width;
		this._height = height;
		
		if(this._div)
		{
			var p0 = $util.getPosition(elem), p1 = $util.getPosition(this._handDad);
			this._divY -= (p1.y - p0.y + this._bdr - this.get_offsetTop());
			this._divX -= (p1.x - p0.x + this._bdr - this.get_offsetLeft());
			if(!this._drag)
				this._shift();
		}
		if(this._drag)
			this._onMouseOver(e, true);
		hand.style.left = (elem.offsetWidth - handWidth - this._shiftWidth - this._shiftHandX) + 'px';
		hand.style.top = (elem.offsetHeight - handHeight - this._shiftHeight - this._shiftHandY) + 'px';
	},
	setSize:function(width, height)
	{
		/// <summary>Sets new size for target.</summary>
		/// <param name="width" type="Number">Width of target in pixels.</param>
		/// <param name="height" type="Number">Height of target in pixels.</param>
		this._width = width;
		this._height = height;
		this._resize();
		this.set_stateValue(this._width + ',' + this._height, true);
	},
	dispose: function()
	{
		/// <summary>Disposes object and its event handlers.</summary>
		if(this._hand)
			$clearHandlers(this._hand);
		this._onMouseUp();
		$IG.ResizeBehavior.callBaseMethod(this, 'dispose');
	},
	_onMouseOver: function(e, noEvt)
	{
		if(e && noEvt !== true)
			this._mouseIn = true;
		if(this._drag && noEvt !== true)
			return;
		var elem = this._handDad;
		var width = this._target.offsetWidth - this._shiftWidth, height = this._target.offsetHeight - this._shiftHeight;
		this._s.width = ((width > 0) ? width : 0) + 'px';
		this._s.height = ((height > 0) ? height : 0) + 'px';
		if(this._drag && this._div)
		{
			this._shift();
			return;
		}
		if(noEvt === true)
			return;
		
		this._raiseClientEvent(this._prefix + 'MouseOver', null, e);
		if(!this._border)
			return;
		this._s.border = this.get_resizeBorder();
		this._bdr = this._border;
		this._shift();
	},
	_onMouseOut: function(e, noEvt)
	{
		if(e && noEvt !== true)
			this._mouseIn = false;
		if(this._drag)
			return;
		
		this._raiseClientEvent(this._prefix + 'MouseOut', null, e);
		this._s.border = this._s.width = this._s.height = '0px';
		this._bdr = 0;
		if(!this._border)
			return;
		this._shift();
	},
	_onMouseDown: function(e)
	{
	    if(e.button == 0)
	    {
		    this._x = null;
		    if(!e)if((e = window.event) == null)
			    return;
		    this._drag = true;
		    $util.cancelEvent(e);
		    $addHandler(document, 'mousemove', this._onMouseMoveFn);
		    $addHandler(document, 'mouseup', this._onMouseUpFn);
		    if(Sys.Browser.agent === Sys.Browser.Safari)
			    document.onselectstart = this._onSelectFn;
		    else
			    $addHandler(document, 'selectstart', this._onSelectFn);
		    this._showIframe(true);		
		}
	},
	
	_onFrameMove:function(e)
	{
		var elem = this._control ? this._control._element : null;
		if(!elem)
			return;
		e.clientY += $util.toInt(elem.style.top, 0);
		e.clientX += $util.toInt(elem.style.left, 0);
		this._onMouseMove(e);
	},
	
	_showIframe:function()
	{
		var ctl = this._control;
		if(!ctl || !ctl._get_resizeAreaElem)
			return;
		if(!this._onFrameMouseFn)
			this._onFrameMouseFn = Function.createDelegate(this, this._onFrameMove);
		$util._setTranspFrame(this, ctl._get_resizeAreaElem(), this._onMouseUpFn, this._onFrameMouseFn);
	},
	
	_onMouseMove: function(e)
	{
		if(this._drag)
		{
			this._resize(e ? e : window.event);
			this._showIframe(true);
		}
	},
	
	
	_onMouseUp: function(e)
	{
		$util._setTranspFrame(this);
		this._x = null;
		if(!this._drag)
			return;
		if((this._widthOld == null || this._heightOld == null) || (this._widthOld == this._width && this._heightOld == this._height)) 
		    return;
		this.__dragResized = false; 
		var v, fix = null;
		
		var args = this._raiseClientEvent('Resized', 'Resize', e, null, this._width, this._height, this._widthOld, this._heightOld);
		if(args)
		{
			if(args.get_cancel())
			{
				fix = this._width = this._widthOld;
				this._height = this._heightOld;
			}
			else
			{
				if((v = args._width) != null)
					fix = this._width = v;
				if((v = args._height) != null)
					fix = this._height = v;
			}
		}
		this._drag = false;
		if(fix != null || this._div)
			this._resize();
		
		else if(this._control && this._control.onResize)
			this._control.onResize();
		this.set_stateValue(this._width + ',' + this._height, true);
		$removeHandler(document, 'mousemove', this._onMouseMoveFn);
		$removeHandler(document, 'mouseup', this._onMouseUpFn);
		if(Sys.Browser.agent === Sys.Browser.Safari)
			document.onselectstart = null;
		else
			$removeHandler(document, 'selectstart', this._onSelectFn);
		if(!this._mouseIn)
			this._onMouseOut(e, true);		
	},
	_onSelectStart: function(e)
	{
		return this._drag ? $util.cancelEvent(e) : true;
	}
}
$IG.ResizeBehavior.registerClass('Infragistics.Web.UI.ResizeBehavior', $IG.Behavior);


$IG.ResizeEventArgs = function()
{
	/// <summary>Class used as param in resize events.</summary>
	$IG.ResizeEventArgs.initializeBase(this);
}
$IG.ResizeEventArgs.prototype =
{
	
	get_width:function()
	{
		/// <summary>Gets new width.</summary>
		/// <returns type="Number">Width in pixels.</returns>
		return this._props[2];
	},
	get_height:function()
	{
		/// <summary>Gets new height.</summary>
		/// <returns type="Number">Height in pixels.</returns>
		return this._props[3];
	},
	get_oldWidth:function()
	{
		/// <summary>Gets old width.</summary>
		/// <returns type="Number">Width in pixels.</returns>
		return this._props[4];
	},
	get_oldHeight:function()
	{
		/// <summary>Gets old height.</summary>
		/// <returns type="Number">Height in pixels.</returns>
		return this._props[5];
	},
	set_width:function(val)
	{
		/// <summary>Sets new width.</summary>
		/// <param name="val" type="Number">Width in pixels.</param>
		this._props[2] = this._width = val;
	},
	set_height:function(val)
	{
		/// <summary>Sets new height.</summary>
		/// <param name="val" type="Number">Height in pixels.</param>
		this._props[3] = this._height = val;
	}
}
$IG.ResizeEventArgs.registerClass('Infragistics.Web.UI.ResizeEventArgs', $IG.CancelEventArgs);

/* END Infragistics.Web.UI.SharedScripts.igResizeBehavior.js */
/* START Infragistics.Web.UI.LayoutControls.WebDialogWindow.js.igDialogWindow.js */
Type.registerNamespace('Infragistics.Web.UI');



$IG.DialogWindowProps = new function()
{
    var count = $IG.LayoutControlProps.Count;
    this.WindowState = [count++, 0];
    this.Left = [count++, ''];
    this.Top = [count++, ''];
    this.Width = [count++, ''];
    this.Height = [count++, ''];
    this.InitialLocation = [count++, 0];
    this.Moveable = [count++, 1];
    this.MaintainLocationOnScroll = [count++, 0];
    this.Modal = [count++, 0];
    this.AsyncUpdate = [count++, 1];
    this.LastWindowState = [count++, 0];
    this.Count = count;
};

$IG.HeaderProps = new function()
{
    var count = $IG.ControlObjectProps.Count;
    this.CaptionText = [count++, ''];
    this.ImageUrl = [count++, ''];
    this.MinimizedWidth = [count++, 100];
    this.Count = count;
};



$IG.DialogWindowState = function () {}
$IG.DialogWindowState.prototype = 
{
   Normal:0, 
   Minimized:1,
   Maximized:2,
   Hidden:3
};
$IG.DialogWindowState.registerEnum("Infragistics.Web.UI.DialogWindowState");




$IG.WebDialogWindow = function(elem)
{
	/// <summary>Class which implements client side functionality of WebDialogWindow.</summary>
	/// <param name="elem" type="Object">Reference to html element.</param>
	$IG.WebDialogWindow.initializeBase(this, [elem]);
}

$IG.WebDialogWindow.prototype =
{
	_thisType:'dialog',

	
	_responseComplete:function(cb, response)
	{
		
		var cont = response ? response.context : null;
		if(!cont || cont.length < 2)
			return;
		
		var div = document.createElement('DIV');
		div.innerHTML = cont[1];
		var id = this.get_id(), name = this.get_name(), i = div.childNodes.length;
		while(i-- > 0)
		{
			var node = div.childNodes[i];
			
			if(node.id == id)
			{
				
				var body = this._get_asyncUpdate() ? null : this._findBody(node);
				if(body)
				{
					var elem, old = null, elems = body.childNodes;
					i = elems ? elems.length : 0;
					
					if(i != 1 || elems[0].nodeName != 'IFRAME')
					{
						
						while(i-- > 0)
							body.removeChild(elems[i]);
						elems = this._body2.childNodes;
						i = elems.length;
						
						while(i-- > 0)
						{
							this._body2.removeChild(elem = elems[i]);
							body.insertBefore(elem, old);
							old = elem;
						}
					}
				}
				
				this._element.swapNode(node);
				break;   
			}
		}
		
		this.dispose();
		$create($IG.WebDialogWindow, {'id':id, 'name':name, 'props':eval(cont[0])}, null, null, $get(id));
	},
	
	_findBody:function(elem)
	{
		if(elem.id && elem.id.indexOf(':mkr:16') > 0)
			return elem;
		var elems = elem.childNodes;
		var i = elems ? elems.length : 0;
		while(i-- > 0)
			if((elem = this._findBody(elems[i])) != null)
				return elem;
		return null;
	},
	
	initialize:function()
	{
		/// <summary>Initializes instance of WebDialogWindow.</summary>
		$IG.WebDialogWindow.callBaseMethod(this, 'initialize');
		
		
		
		this._body2 = this._elements[16];
		this._ie = Sys.Browser.agent == Sys.Browser.InternetExplorer;
		this._safari = Sys.Browser.agent === Sys.Browser.Safari;
		
		this._suspendVis = this._isVis();
		this._modalCss = this._get_clientOnlyValue("mbc");
		if(this._contentPane)
			this._contentPane._DIV = this._body2;
		if(this._onTimer(true))
			delete this._onTimer;
		else
			ig_ui_timer(this);				
	},
	
	_get_modal:function(){return this._get_value($IG.DialogWindowProps.Modal);},
	_get_asyncUpdate:function(){return this._get_value($IG.DialogWindowProps.AsyncUpdate);},
	get_enabled:function()
	{
		/// <summary>Checks if control is enabled.</summary>
		/// <returns type="Boolean">Value of true means that dialog is enabled.</returns>
		return this._getFlags().getEnabled();
	},
	
	_isVis:function(){return this._element ? this._element.style.display != 'none' : false;},
	
	_setVis:function(show)
	{
		var elem = this._element;
		
		if(!this._suspendVis || !show || !elem)
			$util.display(elem, !show);
		else
			elem.style.display = '';
	},
	_onTimer:function(init, play)
	{
		if(this._painted)
			return true;		
		var elem = this._element;
		var width = elem ? elem.offsetWidth : 0;
		if(width == 0)
			return false;
		this._painted = true;		
		if(!this._header)
			this._header = new $IG.Header(null, null, null, this);
		
		
		
		
		
		
		
		this._header._init(this._elements, elem);		
		var rp = this._get_clientOnlyValue('rp');
		if(rp && rp.length > 1)
		{
			rp = this._resizer = $create($IG.ResizeBehavior,{'pairs':rp,'id':this.get_id()+'.r','control':this},null,null,elem);
			rp._prefix = 'Resizer';
			if(rp.get_minimumWidth() == 0)
				rp.set_minimumWidth(this._header._minWidth);
			if(rp.get_minimumHeight() == 0)
				rp.set_minimumHeight(this._header.get_height() + (this._elements[15] ? 25 : 15));
		}
		else if(!this._get_isMinimized() && !this._get_isMaximized() && !this._get_isClosed())
			this.onResize(2, null, play);
		//
		this._headerMoveable(true);
		if(!this._get_isClosed())
			this.set_windowState(this.get_windowState())
		
		if(this._suspendVis && this._isVis())
			this._element.style.visibility = 'visible';
		
		this._suspendVis = false;
		this._inModal = false;
		this._ready = true;				
		if(this._thisType == 'dialog')
			this._raiseClientEvent('Initialize');
		return true;			
	},
	_play:function()
	{
		
	},

	_addHandlers:function() 
	{
		$IG.WebDialogWindow.callBaseMethod(this, '_addHandlers');
	},

	_createObject:function(element, obj)
	{
		if(obj == 'header')
		{
			this._header = new $IG.Header(obj, element, this._objectsManager.get_objectProps(0), this);
			this._objectsManager.register_object(0, this._header);
		}
		if(obj == 'body')
		{
			this._body = element;
			this._contentPane = new $IG.LayoutPane(obj, element, this._objectsManager.get_objectProps(1), this);
			this._objectsManager.register_object(1, this._contentPane);
		}
	},
	
	get_contentPane:function()
	{
		/// <summary>Gets reference to content pane.</summary>
		/// <returns type="Infragistics.Web.UI.LayoutPane">Reference to pane.</returns>
		return this._contentPane;
	},
	
	_get_resizeAreaElem:function()
	{
	    var pane = this.get_contentPane();
	    if(pane != null)
	        return pane._DIV;
	
	}, 
	
	get_header:function()
	{
		/// <summary>Gets reference to header.</summary>
		/// <returns type="Infragistics.Web.UI.Header" mayBeNull="true">Reference to header.</returns>
		return this._ready ? this._header : null;
	},

	
	get_resizer:function()
	{
		/// <summary>Gets reference to resizer if resizing is enabled.</summary>
		/// <returns type="Infragistics.Web.UI.ResizeBehavior" mayBeNull="true">Reference to resizer.</returns>
		return this._resizer;
	},
	
	
	canResize:function()
	{
		/// <summary>Checks if control can be resized.</summary>
		/// <returns type="Boolean">True: dialog in normal state and it can be resized.</returns>
		return (this.get_windowState() == $IG.DialogWindowState.Normal)
	},	
	
	set_initialLocation:function(val)
	{
		/// <summary>Sets initial location of WebDialogWindow relative to window of browser.</summary>
		/// <param name="val" type="Number">Value of 0 means manual, value of 1 means centered.</param>
		this._set_value($IG.DialogWindowProps.InitialLocation, val);
		if(val == 1 && this._painted && this._header._mover &&  !this._get_isMaximized())
			this._header._mover.setAbsPos(this.get_left(), this.get_top(), true, this.get_maintainLocationOnScroll(), this._get_modal());
	},
	get_initialLocation:function()
	{ 
		/// <summary>Gets the initial location of WebDialogWindow relative to window of browser.</summary>
		/// <returns type="Number">Value of 0 means manual, value of 1 means centered.</returns>
		return this._get_value($IG.DialogWindowProps.InitialLocation);
	},

	set_moveable:function(value)
	{
		/// <summary>Sets the ability to drag control by mouse.</summary>
		/// <param name="value" type="Boolean">True: dialog can be moved by mouse.</param>
		this._set_value($IG.DialogWindowProps.Moveable, value);
		this._headerMoveable(value);
	},
	get_moveable:function()
	{ 
		/// <summary>Gets/sets the ability to drag control by mouse.</summary>
		/// <returns type="Boolean">True: dialog can be moved by mouse.</returns>
		return this._get_value($IG.DialogWindowProps.Moveable, true) && this.get_enabled();
	},

	set_maintainLocationOnScroll:function(value)
	{
		/// <summary>Sets the ability to keep relative location of dialog while window is resized or scrolled.</summary>
		/// <param name="value" type="Boolean">True: location of dialog is kept relative while scroll.</param>
		this._set_value($IG.DialogWindowProps.MaintainLocationOnScroll, value);
		this._headerMoveable(value);
	},
	get_maintainLocationOnScroll:function()
	{ 
		/// <summary>Gets the ability to keep relative location of dialog while window is resized or scrolled.</summary>
		/// <returns type="Boolean">True: location of dialog is kept relative while scroll.</returns>
		return this._get_value($IG.DialogWindowProps.MaintainLocationOnScroll) == 1;
	},

	get_width:function()
	{
		/// <summary>Gets width of dialog.</summary>
		/// <returns type="String">Width of dialog.</returns>
		return this._get_value($IG.DialogWindowProps.Width);
	},
	set_width:function(val)
	{
		/// <summary>Sets width of dialog.</summary>
		/// <param name="val" type="String">Width of dialog as pixels or percents.</param>
		this.setSize(val);
	},
	get_height:function()
	{
		/// <summary>Gets height of dialog.</summary>
		/// <returns type="String">Height of dialog.</returns>
		return this._get_value($IG.DialogWindowProps.Height);
	},
	set_height:function(val)
	{
		/// <summary>Sets height of dialog.</summary>
		/// <param name="val" type="String">Height of dialog as pixels or percents.</param>
		this.setSize(null, val);
	},
	setSize:function(width, height, evt)
	{
		/// <summary>Sets width and height of dialog.</summary>
		/// <param name="height" type="String" optional="true" mayBeNull="true">Height of dialog as pixels or percents.</param>
		/// <param name="width" type="String" optional="true" mayBeNull="true">Width of dialog as pixels or percents.</param>
		/// <param name="evt" type="Object" optional="true" mayBeNull="true">Request to do not adjust appearance.</param>
		if(width)
			this._set_value($IG.DialogWindowProps.Width, width);
		if(height)
			this._set_value($IG.DialogWindowProps.Height, height);
		if(evt)
			return;
		var elem = this._element;
		if(width)
			elem.style.width = width;
		if(height)
			elem.style.height = height;
		if(!this._painted)
			return;
		if(this._resizer)
			this._resizer.setSize(elem.offsetWidth, elem.offsetHeight);
		else
			this.onResize();
		if(this._header._mover)
			this._header._mover._onScrollSize();
	},
	get_left:function()
	{
		/// <summary>Gets left edge of dialog.</summary>
		/// <returns type="String">Left edge of dialog.</returns>
		return this._get_value($IG.DialogWindowProps.Left);
	},
	set_left:function(val, mouse)
	{
		/// <summary>Sets left edge of dialog.</summary>
		/// <param name="val" type="String">Left edge of dialog.</param>
		/// <param name="mouse" type="Boolean" optional="true" mayBeNull="true">Request to do not adjust appearance.</param>
		this._set_value($IG.DialogWindowProps.Left, val);
		if(!mouse)
			this._element.style.left = val;
	},
	get_top:function()
	{
		/// <summary>Gets top edge of dialog.</summary>
		/// <returns type="String">Top edge of dialog.</returns>
		return this._get_value($IG.DialogWindowProps.Top);
	},
	set_top:function(val, mouse)
	{
		/// <summary>Sets top edge of dialog.</summary>
		/// <param name="val" type="String">Top edge of dialog.</param>
		/// <param name="mouse" type="Boolean" optional="true" mayBeNull="true">Request to do not adjust appearance.</param>
		this._set_value($IG.DialogWindowProps.Top, val);
		if(!mouse)
			this._element.style.top = val;
	},

	
	
	onResize:function(e, height, play)
	{
		/// <summary>Implementation of IResizable. Internal use only.</summary>
		/// <param name="e">Internal use.</param>
		/// <param name="height">Internal use.</param>
		/// <param name="play">Internal use.</param>
		var body = this._body, elem = this._element;
		if(!body || !elem)
			return;
		var v, dif, width, style = elem.style;
		
		
		if(height)
		{
			style.width = e;
			style.height = height;
			e = null;
		}
		if(e == 2 && this._clientWidth != null)
			return;
		height = elem.offsetHeight;
		if(height == 0)
			return;
		
		if(e)
			this.setSize(style.width, style.height, true);
		var fire = this._shift1h == null;
		
		if(fire)
		{
			this._ready = true;
			style = $util.getRuntimeStyle(elem);
			
			this._shift1w = $util.getOffset(style, true);
			this._shift1h = $util.getOffset(style);
			this._shift2h = this._shift2w = 0;
			
			
			var i = 9, elems = this._elements;
			while(++i < 16)
			{
				style = $util.getRuntimeStyle(elem = this._elements[i]);
				
				if(i == 11)
				{
					this._bodyTD = elem;
					continue;
				}
				if(!style)
					continue;
				elem.style.margin = '0px';
				
				if(i == 10 || i == 12)
				{
					v = $util.toIntPX(style, 'width');
					
//					elem.style.width = elems[i + 3].style.width = v + 'px';
					this._shift2w += v;
					this._shift2w += $util.getOffset(style, true);
				}
				
				if(i == 13)
				{
					v = $util.toIntPX(style, 'height');
					if(v < 5 && this._safari)
						v = elem.offsetHeight;
					
//					elem.style.height = elems[i + 1].style.height = elems[i + 2].style.height = v + 'px';
					this._shift2h += v;
					this._shift2h += $util.getOffset(style);
				}
			}
			
			elem = this._body2;
			style = $util.getRuntimeStyle(elem);
			this._shift3h = $util.toIntPX(style, 'marginTop') + $util.toIntPX(style, 'marginBottom');
			this._shift3w = $util.toIntPX(style, 'marginLeft') + $util.toIntPX(style, 'marginRight');
			this._shift4h = $util.getOffset(style);
			this._shift4w = $util.getOffset(style, true);
		}
		
		height -= this._shift1h + this._header.get_height();
		if(height < 0)
			height = 0;
		
		if((width = elem.offsetWidth - this._shift1w) < 0)
			width = 0;
		body.style.height = height + 'px';
		
		elem = this._bodyTD;
		body = this._body2;
		
		if((height -= this._shift2h) < 0)
			height = 0;
		elem.style.height = height + 'px';
		
		if((height -= this._shift3h) < 0)
			height = 0;
		v = this._shift4h;
		var heightS = height - v;
		if(heightS < 0)
			heightS = 0;
		body.style.height = heightS + 'px';
		
		if(v > 0 && body.offsetHeight < height)
		{
			body.style.height = height + 'px';
			if((dif = elem.offsetHeight - body.offsetHeight) > 0)
			{
				body.style.height = (height += dif) + 'px';
			}
		}
		height = body.offsetHeight - v;
		
		if((width -= this._shift2w) < 0)
			width = 0;
		elem.style.width = width + 'px';
		var widthTD = elem.offsetWidth;
		
		v = this._shift4w;
		body.style.width = '';
		if((dif = body.offsetWidth - widthTD) > 0)
		{
			body.style.width = '100%';
			if((dif = body.offsetWidth - widthTD) > 0)
				body.style.width = Math.floor(100 - dif / widthTD * 100) + '%';
		}
		
		if(v > 0 && (body.offsetWidth + this._shift3w) < width)
		{
			body.style.width = width + 'px';
		}
		width = body.offsetWidth - v;
		if(height < 0)
			height = 0;
		if(width < 0)
			width = 0;
		
		if(this._clientWidth === width && this._clientHeight === height)
			return;
		this._clientWidth = width;
		this._clientHeight = height;
		if(fire)
			this._contentPane._onInit();
		if(play)
			this._play();
		
		$util.raiseLayoutEvent(this);
	},

	
	getLayoutManager:function()
	{
		/// <summary>Implementation of LayoutManager. Internal use only.</summary>
		/// <returns type="Object">Reference to this.</returns>
		return this;
	},
	
	getClientWidth:function()
	{
		/// <summary>Implementation of LayoutManager. Internal use only.</summary>
		/// <returns type="Number">Width of client area.</returns>
		return this._clientWidth;
	},
	
	getClientHeight:function()
	{
		/// <summary>Implementation of LayoutManager. Internal use only.</summary>
		/// <returns type="Number">Height of client area.</returns>
		return this._clientHeight;
	},
	
	getBody:function()
	{
		/// <summary>Implementation of LayoutManager. Internal use only.</summary>
		/// <returns type="Object">Reference to div element which used as content pane.</returns>
		var v = this._body2; return v ? v : this._body;
	},
	
	
	findChild:function(id)
	{
		/// <summary>Find html element which id ends-up with "id".</summary>
		/// <param name="id" type="String">The trailing part of id of element to search for.</param>
		/// <returns type="Object" mayBeNull="true">Reference to html element or null.</returns>
		return $util.findChild(this.getBody(), id);
	},
	
	_get_isMinimized:function(){return (this.get_windowState() == $IG.DialogWindowState.Minimized);},
	_get_isMaximized:function(){return (this.get_windowState() == $IG.DialogWindowState.Maximized);},
	_get_isClosed:function(){return (this.get_windowState() == $IG.DialogWindowState.Hidden);},
	get_windowState:function()
	{
		/// <summary>Gets the current state of dialog.</summary>
		/// <returns type="Number">Value which corresponds to WindowState enum on server.</returns>
		return this._get_value($IG.DialogWindowProps.WindowState);
	},	    
	set_windowState:function(state, fire)
	{   
		/// <summary>Sets the current state of dialog.</summary>
		/// <param name="state" type="Number">Window state.</param>
		/// <param name="fire" type="Boolean">Request to raise client event.</param>
	    var lastState = this._get_lastWindowState(), newState = state, restoreMax = restoreMin = false;
	    var currentState = this._get_value($IG.DialogWindowProps.WindowState);	    
	    if(state == $IG.DialogWindowState.Normal)
	    {
	        if(currentState ==  $IG.DialogWindowState.Hidden)
	        {
	            if(lastState == $IG.DialogWindowState.Maximized)
	            {
                    state = $IG.DialogWindowState.Maximized;		        
                    restoreMax = true;
                }
                else if(lastState == $IG.DialogWindowState.Minimized)
                {
                    restoreMin = true;
                    state = $IG.DialogWindowState.Minimized;	
                }
            }
	        else if(currentState == $IG.DialogWindowState.Minimized && lastState == $IG.DialogWindowState.Maximized)
	            state = $IG.DialogWindowState.Maximized;		        
	    }
	    
	    if(state != currentState)   
	    {
	        if(fire)
	        {
	            var args =  this._raiseClientEvent('WindowStateChanging', 'WindowStateCancel', null, null, currentState, state);
	            if(args == null || !args.get_cancel())
	            {
	                this._updateWindowState(state, currentState, lastState, restoreMax, restoreMin);	            
	                this._raiseClientEvent("WindowStateChanged", "PostBack", null, null);
	            }
	            return;
	        }	            
	    }
	    this._updateWindowState(state, currentState, lastState, restoreMax, restoreMin);	            
	},
	
	show:function()
	{
		///<summary>
	    /// Displays the WebDialogWindow by adjusting the WindowState to $IG.DialogWindowState.Normal
	    ///</summary>
	    this.set_windowState($IG.DialogWindowState.Normal);
	},
	hide:function()
	{
		///<summary>
	    /// Hides the WebDialogWindow by adjusting the WindowState to $IG.DialogWindowState.Hidden
	    ///</summary>
	    this.set_windowState($IG.DialogWindowState.Hidden);
	},	
	_updateWindowState:function(state, currentState, lastState, restoreMax, restoreMin)
	{
	    if(restoreMax || restoreMin)
            this._setNormal(state, restoreMax, restoreMin);
        
        this._set_value($IG.DialogWindowProps.WindowState, state);
        
        if(state == $IG.DialogWindowState.Maximized)
            this._setMaximized(currentState);
        else if(state == $IG.DialogWindowState.Minimized)
            this._setMinimized(currentState);
        else if(state == $IG.DialogWindowState.Hidden)
            this._setClosed(); 
        else if(state == $IG.DialogWindowState.Normal)
        {		        
            if(currentState == $IG.DialogWindowState.Maximized)
                this._setRestoreMax();
            else if(currentState == $IG.DialogWindowState.Minimized)
                this._setRestoreMin(lastState);
            else
                this._setNormal(state);
        }
        
        if(state != currentState)
            this._set_lastWindowState(currentState)
	    
        for(var i = 0; i < this._header._buttons.length; i++)
            this._header._buttons[i]._ensureState();
	    
        if(this._resizer)
            this._resizer.enabled = (state == $IG.DialogWindowState.Normal);
	},
	
	_get_lastWindowState:function(){return this._get_value($IG.DialogWindowProps.LastWindowState);},	
	_set_lastWindowState:function(val){this._set_value($IG.DialogWindowProps.LastWindowState, val);},	
	 
	_setRestoreMax:function(isTemp)
	{
	    var max = this._maxOld;
	    if(max)
		{
		    var htm = max.htm;
		    this._header._resizeLsnr(false);
		    var style = this._element.style;
		    style.width = max.w;
		    style.height = max.h;
		    var pos = max.pos;
		    if(pos == null)
			    pos = 'absolute';
		    style.position = pos;
		    style.left = max.x;
		    style.top = max.y;
		    style.zIndex = max.zi;
		    htm.scrollLeft = max.x2;
		    htm.scrollTop = max.y2;
		    if(htm.style)
			    htm.style.overflow = max.over;
			if(!isTemp)
		        this._maxOld = null;
		    this.onResize();
		    this._headerMoveable(true);
		}
		
		this._hideResizer(false);		
	},
	
	_setRestoreMin:function(lastState)	
	{
	    $util.display(this._body);
	    var style = this._element.style;
	    	        
	    if(lastState != $IG.DialogWindowState.Maximized)
	    {
	        style.width = this._header._ownerWidth;
		    style.height = this._header._ownerHeight;		    
		    this._hideResizer(false);	    
		    this.onResize();
	        this._header._ownerSize();	  	        
		    this._headerMoveable(true);
		}
	},
	
	_setMaximized:function(currentState)
	{   
	    if(currentState == $IG.DialogWindowState.Minimized)
	        this._setRestoreMin();
	    var body = this._body;
	    if(!body)
			return;
		var style = this._element.style;
		this._hideResizer(true);

        this._headerMoveable(false);
			
		var htm = $util.getHTML();
		
		if(!this._maxOld)
		{
		    if(currentState == $IG.DialogWindowState.Minimized)
		        this._maxOld = max = {x:this.get_left(), y:this.get_top(), w:this.get_width(), h:this.get_height(), pos:null, zi:style.zIndex, htm:htm, x2:htm.scrollLeft, y2:htm.scrollTop};
		    else
		        this._maxOld = max = {x:style.left, y:style.top, w:style.width, h:style.height, pos:style.position, zi:style.zIndex, htm:htm, x2:htm.scrollLeft, y2:htm.scrollTop};
		 }   
		
		htm.scrollLeft = htm.scrollTop = 0;
		if(htm.style)
		{
			max.over = htm.style.overflow;
			htm.style.overflow = 'hidden';
		}
		style.position = 'absolute';
		style.left = style.top = '0px';
		style.zIndex = 100000;
		var point = $util.getPosition(this._element);
		if(point.x != 0)
			style.left = (-point.x) + 'px';
		if(point.y != 0)
			style.top = (-point.y) + 'px';
		this._header._onResize();
		this._header._resizeLsnr(true);		
	},
	
	_setMinimized:function(currentState)
	{   
		if(currentState == $IG.DialogWindowState.Maximized)
			this._setRestoreMax(true)
		var body = this._body;
		this._header._ownerSize();
		$util.display(body, true);
		var style = this._element.style;
		this._hideResizer(true);
		style.width = this._header._minWidth + 'px';
		style.height = this._header.get_height() + 'px';				
	},
	
	_setClosed:function()
	{
		this._setVis(false);
		this._headerMoveable(false);	
	},
	
	_setNormal:function(newState, restoreMax, restoreMin)
	{
		this._setVis(true);
		this._onTimer(true, true);
		if(restoreMax)
			this._setRestoreMax();
		if(restoreMin)
			this._setRestoreMin();
		if(newState == $IG.DialogWindowState.Normal) 
		{
			this.onResize();
			this._headerMoveable(true);
			this._hideResizer(false);	
		}
		this._play();
	},
	
	_hideResizer:function(hide)
	{   
		if(this._resizer)
			$util.display(this._resizer._handDad, hide);
	},
	
	_headerMoveable:function(moveable)
	{
		this._header._moveable(moveable, this._get_isMaximized());
	},
	
	
	_onSubmitOtherHandler:function(e)
	{
		if(this._contentPane)
			this._contentPane._onSubmit();
		$IG.WebDialogWindow.callBaseMethod(this, '_onSubmitOtherHandler', [e]);
	},

	dispose:function()
	{
		/// <summary>Disposes object and event handlers.</summary>
		$IG.WebDialogWindow.callBaseMethod(this, 'dispose');
		this._header = this._resizer = this._contentPane = null;
	}
}

$IG.WebDialogWindow.registerClass('Infragistics.Web.UI.WebDialogWindow', $IG.ControlMain);


$IG.Header = function(obj, element, props, control)
{
	var csm = obj ? new $IG.ObjectClientStateManager(props[0]) : null;
	$IG.Header.initializeBase(this, [obj, element, props, control, csm]);
	this._elems = this._buttons = [];
}

$IG.Header.prototype =
{
	_height:null,

	get_minimizedWidth:function()
	{
		/// <summary>Gets the width of the header when control is minimized.</summary>
		/// <returns type="Number">Width of control in minimized state.</returns>
		return this._get_value($IG.HeaderProps.MinimizedWidth);
	},
	set_minimizedWidth:function(val)
	{
		/// <summary>Sets the width of the header when control is minimized.</summary>
		/// <param name="val" type="Number">Width of control in minimized state.</param>
		this._set_value($IG.HeaderProps.MinimizedWidth, val);
		this.__updateMinWidth(); 
		if(this._owner._get_isMinimized())
		    this._owner._setMinimized();
	},

	
	_ownerSize:function()
	{
		var ctl = this._owner;
		var elem = ctl._element;
		var v = ctl.get_height();
		if(v == '' && !this._ownerHeight)
		{
			if((v = elem.offsetHeight) == 0)
				v = 300;
			v = v + 'px';
		}
		if(v != '')
			this._ownerHeight = v;
		v = ctl.get_width();
		if(v == '' && !this._ownerWidth)
		{
			if((v = elem.offsetWidth) == 0)
				v = 400;
			v = v + 'px';
		}
		if(v != '')
			this._ownerWidth = v;
	},
	
	get_height:function()
	{
		/// <summary>Gets the height of the header.</summary>
		/// <returns type="Number">Height of header.</returns>
		var height = this._height;
		if(height !== null)
			return height;
		height = this._element;
		if(!height)
			return this._height = 0;
		return ((height = height.offsetHeight) != 0) ? (this._height = height) : 0;
	},
	
	getCaptionText:function()
	{
		/// <summary>Gets the text that will be displayed in the caption area of the header.</summary>
		/// <returns type="String">Text of header.</returns>
		return this._get_value($IG.HeaderProps.CaptionText);
	},
	
	setCaptionText:function(val)
	{
		/// <summary>Sets the text that will be displayed in the caption area of the header.</summary>
		/// <param name="val" type="String">Text of header.</param>
		var elem = this._getElem(1);
		if(!elem)
		{
			if(!val)return;
			this._elems[7].appendChild(this._elems[1] = elem = document.createElement('SPAN'));
		}
		elem.innerHTML = val; 
		this._set_value($IG.HeaderProps.CaptionText, val);
	},
	
	getImageUrl:function()
	{
		/// <summary>Gets the image url that will be displayed in the header.</summary>
		/// <returns type="String">Image url for header.</returns>
		return this._get_value($IG.HeaderProps.ImageUrl);
	},
	
	setImageUrl:function(val)
	{
		/// <summary>Sets the image url that will be displayed in the header.</summary>
		/// <param name="val" type="String">Image url for header.</param>
		var elem = this._getElem(0);
		if(!elem)
		{
			if(!val)return;
			this._elems[7].appendChild(this._elems[0] = elem = document.createElement('IMG'));
		}
		elem.src = val; 
		this._set_value($IG.HeaderProps.ImageUrl, val);
	},
	
	_moveable:function(val, max)
	{
		var move = this._mover, ctl = this._owner;
		if(!move)
		{
			move = this._element;
			if(!val || !move) return;
			move = this._mover = $create($IG.DialogMoveBehavior,{"targetElement":ctl._element, "owner":this, "control":ctl}, null, null, move);
			move._ie = this._ie;
			move._prefix = 'Header';
		    move._img = this._elems[0];
		    move._lbl = this._elems[1];
		}
		move.enabled = val && ctl.get_moveable();
		if(!val)
		{
			move.restore(max);
		}
		if(val)
			move.setAbsPos(ctl.get_left(), ctl.get_top(), ctl.get_initialLocation() > 0, ctl.get_maintainLocationOnScroll(), ctl._get_modal(), max);
	},
	
	_getElem:function(i)
	{
		var elem = this._elems;
		if(elem) elem = elem[i];
		return (elem && elem.nodeName) ? elem : null;
	},
	
	_setupButtons:function()
	{ 
	    this._buttons = [];
	    this._closeButton = new $IG.DialogButton("Close", this._elems["Close"], this._objectManager.get_objectProps(0), this, null, $IG.DialogWindowState.Hidden);
		this._objectManager.register_object(0, this._closeButton);
		this._buttons.push(this._closeButton);
		
		this._maxButton = new $IG.DialogButton("Maximize", this._elems["Maximize"], this._objectManager.get_objectProps(1), this, null,  $IG.DialogWindowState.Maximized);
		this._objectManager.register_object(1, this._maxButton);
		this._buttons.push(this._maxButton);
		
		this._minButton = new $IG.DialogButton("Minimize", this._elems["Minimize"], this._objectManager.get_objectProps(2), this, null,  $IG.DialogWindowState.Minimized);
		this._objectManager.register_object(2, this._minButton);
		this._buttons.push(this._minButton);
	},

	
	
	
	_init:function(elems, elem)
	{
	    this._elems = elems;   
	    if(this._objectManager)
	        this._setupButtons();
	    else
	        return;
		
		var ctl = this._owner;
		this._ownerSize();
				 
		this.__updateMinWidth();
	},
	
	__updateMinWidth:function()
	{
	    var width = 2;
	    var elem = this._element;
	    var elems = this._elems;
	    var td = null;
	    var buttonCount = this._buttons.length;
		for(var i = 0; i < buttonCount; i++)
		{
		    var img = this._buttons[i].get_element();
		    if(!img)continue;
			var ow = img.offsetWidth;
			width += ((ow == 0) ? 15 : ow) + $util.toIntPX(null, 'marginLeft', 0, img) + $util.toIntPX(null, 'marginRight', 0, img);
		    if(!td)
			    td = img.parentNode;
		}
	    
	    var minWidth = this.get_minimizedWidth();
		
		if(td)
		{
			
			td.style.width = width + 'px';
			
			width += $util.getOffset($util.getRuntimeStyle(elem), true);
			width += $util.getOffset($util.getRuntimeStyle(this._element), true) + 1;
			
			if(elems[8])
				width += elems[8].offsetWidth + elems[9].offsetWidth;
			
			if(!minWidth || minWidth < width)
				minWidth = width;
		}
		this._minWidth = minWidth ? minWidth : 0;
	},
	
	
	_onResize:function(e)
	{
		var max = this._maxOld, ctl = this._owner;
		if(!max && !ctl)
			return;
		var win = $util.getWinRect();
		ctl.onResize((win.width - 2) + 'px', (win.height - 2) + 'px');
	},

	
	_resizeLsnr:function(on)
	{
		if(!on && !this._resizeOn)
			return;
		if(!this._onResizeFn)
			this._onResizeFn = Function.createDelegate(this, this._onResize);
		if(on === this._resizeOn)
			return;
		this._resizeOn = on;
		if(on)
			$addHandler(window, 'resize', this._onResizeFn);
		else
			$removeHandler(window, 'resize', this._onResizeFn);
	},

	getImageElement:function()
	{
		/// <summary>Gets the reference to html element which shows image in the header.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to html element or null.</returns>
		return this._getElem(0);
	},
	getCaptionElement:function()
	{
		/// <summary>Gets the reference to html element which shows caption text in the header.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to html element or null.</returns>
		return this._getElem(1);
	},
	getContentElement:function()
	{
		/// <summary>Gets the reference to html element which shows content of header.</summary>
		/// <returns type="Object" mayBeNull="true">Reference to html element or null.</returns>
		return this._getElem(7);
	},
	
	_createObjects:function(objectManager)
    {
        this._objectManager = objectManager;
        if(this._elems)
            this._setupButtons();
    },

	dispose:function()
	{
		/// <summary>Disposes object and event handlers.</summary>
		if(this._resizeLsnr)
			this._resizeLsnr(false);
		$IG.Header.callBaseMethod(this, 'dispose');
		this._mover = null;
	}
}
$IG.Header.registerClass('Infragistics.Web.UI.Header', $IG.UIObject);



$IG.DialogButton = function(obj, element, props, owner, csm, state)
{   
    this._state = state;    
    if(!csm)csm = new $IG.ObjectClientStateManager(props[0]);    
    $IG.DialogButton.initializeBase(this, [obj, element, props, owner, csm]);
    this._control = this._owner._owner;
    if(this._element)
        this._setupImage();   
}

$IG.DialogButton.prototype = 
{
    get_altText:function()
    {
        ///<summary>
	    /// Gets the alt text of the button.
	    ///</summary>
        var alt = this._get_clientOnlyValue("a");
        return (alt == null)? "" : alt;
    },
    
    get_restoreAltText:function()
    {
        ///<summary>
	    /// Gets the restore alt text of the button.
	    ///</summary>
        var alt = this._get_clientOnlyValue("ra");
        return (alt == null)? "" : alt;
    },
    _setupImage:function()
    {
		if(this._element)
        if(this._element.nodeName && this._control.get_enabled())
        {
			$addHandlers(this._element, {'mousedown':this._onMouseDown, 'mouseover':this._onMouseOver, 'mouseout':this._onMouseOut}, this);
			this._onMouseUpFn = Function.createDelegate(this, this._onMouseUp);
		    $addHandler(document, 'mouseup', this._onMouseUpFn);
		}
    },
    
    _ensureState:function()
    {
        this.setState((this._control.get_windowState() == this._state) ? "r" : $IG.ImageState.Normal);
    },
    _updateState:function(val1, val2)
    {
        var state = (this._control.get_windowState() == this._state);
        this._updateAlt(state);
		this.setState(state ? val2 : val1);
    },
    _updateAlt:function(state)
    {
		if(this._element)
        this._element.alt = state ? this.get_restoreAltText(): this.get_altText();
    },
    
    _changeState:function()
    { 
        this._control.set_windowState( (this._control.get_windowState() == this._state) ? $IG.DialogWindowState.Normal :this._state, true);
    },  
    
    _onMouseDown:function(e)
	{
	    if(e.button == 0)
	    {
		    $util.cancelEvent(e);
		    this._updateState($IG.ImageState.Pressed, "rp");
		}
	},
	_onMouseOver:function(e)
	{
	    this._updateState($IG.ImageState.Hover, "rh");
	},
	_onMouseOut:function(e)
	{
	    this._updateState($IG.ImageState.Normal, "r");
	},
	_onMouseUp:function(e)
	{
	    if(e.button == 0)
	    {
		    if(e.target == this._element)
		    {
		        this._changeState();
	            this._updateState($IG.ImageState.Hover, "rh");
	        }
	        else
	            this._updateState($IG.ImageState.Normal, "r");
	    }
	},
	dispose:function()
	{
		if(this._element)
			$clearHandlers(this._element);
		if(this._onMouseUpFn)
			$removeHandler(document, 'mouseup', this._onMouseUpFn);
		$IG.DialogButton.callBaseMethod(this, 'dispose');
		this._onMouseUpFn = null;
	}
}
$IG.DialogButton.registerClass('Infragistics.Web.UI.DialogButton', $IG.ImageObject);





$IG.DialogMoveBehavior = function(elem)
{
	/// <summary>Class which implements move behavior of WebDialogWindow.</summary>
	/// <param name="elem" type="Object">Reference to html element.</param>
	$IG.DialogMoveBehavior.initializeBase(this, [elem]);
}

$IG.DialogMoveBehavior.prototype =
{
	
	enabled:true,
	_fixTabOn:false,
	_scrollOn:false,
	_keyOn:false,
	_isModal:false, 
		
	_addHandlers:function()
	{
		this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);
		this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);
		this._mouseOutHandler = Function.createDelegate(this, this._onDocMouseOut);
		$addHandlers(this.get_element(), {'mousedown':this._onMouseDown, 'mouseover':this._onMouseOver, 'mouseout':this._onMouseOut}, this);
	},

	get_targetElement:function()
	{
		/// <summary>Gets the reference to html element which used as target.</summary>
		/// <returns type="Object">Reference to html element.</returns>
		return this._targetElement;
	},
	set_targetElement:function(val)
	{
		/// <summary>Sets the reference to html element which used as target.</summary>
		/// <param name="val" type="Object">Reference to html element.</param>
		this._targetElement = val;
	},

	_onMouseOver:function(e)
	{
		if(this.enabled)
			
			this._raiseClientEvent(this._prefix + 'MouseOver', null, e);
	},
	_onMouseOut:function(e)
	{
		if(this.enabled)
			
			this._raiseClientEvent(this._prefix + 'MouseOut', null, e);
	},
	
	_onMouseDown:function(e)
	{
	    if(e.button == 0)
	    {
		    if(!this.enabled) return;
		    this._drag = 1;
		    var elem = e.target;
		    if(!elem) return;
		    if(elem != this._element && elem != this._img && elem != this._lbl && elem.nodeName != 'TD')
			    return;
		    e.target.unselectable = 'on';
		    $util.cancelEvent(e);
		    $addHandler(document, 'mousemove', this._mouseMoveHandler); 		    
		    $addHandler(document, 'mouseup', this._mouseUpHandler); 	
		    $addHandler(document, 'mouseout', this._mouseOutHandler);	    
		}
		
		this._raiseClientEvent(this._prefix + 'MouseDown', null, e);
	},
	
	_onDocMouseOut:function(e)
	{
	    var rect = $util.getWinRect(window);
	    var x = e.clientX;
	    var y = e.clientY;
	    if((x < 0 || y < 0) || x > rect.width || y > rect.height)
	        this._onMouseUp(e);
	}, 
	
	
	_onMouseMove:function(e)
	{
		if(!this.enabled || !this._drag) return;
		$util.cancelEvent(e);
		if(this._drag == 2)
		{
		    this.__moved = true;
			this._moveWindow(e);
			return;
		}
		this._drag = 2;
		this.setAbsPos();
		this._mouseX = e.clientX;
		this._mouseY = e.clientY;
	},
	
	
	_onMouseUp:function(e)
	{
		if(!this.enabled || !this._drag) return;
		this._drag = null;
		$removeHandler(document, 'mousemove', this._mouseMoveHandler);
		$removeHandler(document, 'mouseup', this._mouseUpHandler);
		$removeHandler(document, 'mouseout', this._mouseOutHandler);	    
		
		
		this._raiseClientEvent(this._prefix + 'MouseUp', null, e);
		
		var v, fix = null, x = this._x, y = this._y;
		
		
		if(x != null && y != null && (this.__moved))
		{
		    this.__moved =false ;
		    var args = this._raiseClientEvent('Moved', 'Move', e, null, x, y, this._xOld, this._yOld);
		    var cancel = args ? args.get_cancel() : false;
		    if(cancel)
		    {
			    fix = x = this._xOld;
			    y = this._yOld;
		    }
		    else if(args)
		    {
			    if((v = args._x) != null)
				    fix = x = v;
			    if((v = args._y) != null)
				    fix = y = v;
		    }
		    if(fix == null)
		    {
				$util._setTranspFrame(this);
			    return;
		    }
		    this.setLocation(x, y, cancel);						
		}
	},
	
	_onFrameMove:function(e)
	{
		var elem = this._control ? this._control._element : null, head = this._element;
		if(!elem || !head)
			return;
		e.clientY += $util.toInt(elem.style.top, 0) + head.offsetHeight + this._shiftY;
		e.clientX += $util.toInt(elem.style.left, 0);
		this._onMouseMove(e);
	},
	
	
	
	_lsnr:function(scroll, key)
	{
		if(scroll != this._scrollOn)
		{
			this._scrollOn = scroll;
			if(!this._onScrollFn)
			{
				this._onScrollFn = Function.createDelegate(this, this._onScrollSize);
				this._onResizeFn = Function.createDelegate(this, this._onScrollSize);
			}
			if(scroll)
			{
				$addHandler(window, 'scroll', this._onScrollFn);
				$addHandler(window, 'resize', this._onResizeFn);
			}
			else
			{
				$removeHandler(window, 'scroll', this._onScrollFn);
				$removeHandler(window, 'resize', this._onResizeFn);
			}
		}
		if(key == this._keyOn)
			return;
		this._keyOn = key;
		if(!this._onKeyFn)
		{
			this._onKeyFn = Function.createDelegate(this, this._onKey);
			this._onFocusFn = Function.createDelegate(this, this._onFocus);
			this._onDeactFn = Function.createDelegate(this, this._onDeact);
		}
		if(key)
		{
			$addHandler(document, 'keydown', this._onKeyFn);
			$addHandler(document, 'focus', this._onFocusFn);
			$addHandler(document, 'beforedeactivate', this._onDeactFn);
		}
		else
		{
			$removeHandler(document, 'keydown', this._onKeyFn);
			$removeHandler(document, 'focus', this._onFocusFn);
			$removeHandler(document, 'beforedeactivate', this._onDeactFn);
		}
	},
	
	
	
	_onScrollSize:function(flag)
	{
		
		if(this._drag)
			return;
		
		if(this._scroll && flag != 2)
			this.setAbsPos(this._xFixed, this._yFixed, this._center, this._scroll, this._isModal, false);
		var elem = this._targetElement, style = this._lid ? this._lid.style : this._lidStyle;
		if(!style)
			return;
		var rect = $util.getWinRect();
		style.width = Math.max(rect.width + rect.x - 6, rect.maxWidth - 2) + 'px';
		style.height = Math.max(rect.height + rect.y - 6, rect.maxHeight - 2) + 'px';
	},
	
	
	_isChild:function(dad, elem)
	{
		if(!dad || !elem)
			return false;
		if(dad == elem)
			return true;
		var nodes = dad.childNodes;
		if(!nodes)
			return false;
		for(var i = 0; i < nodes.length; i++)
			if(this._isChild(nodes[i], elem))
				return true;
		return false;
	},
	
	
	
	
	_tabFoc:function(e, delay)
	{
		if(e)
			$util.cancelEvent(e);
		
		var elem = this._shiftKey ? this._maxTab2 : this._minTab2;
		
		if(!elem)
			elem = this._shiftKey ? this._maxTabI : this._minTabI;
		
		if(!elem || elem == this._lastTab)
			elem = this._anyTab1;
		
		if(elem == this._lastTab)
			elem = this._anyTab2;
		if(!elem)
			return;
		if(delay)
		{
			$util._tab_foc = elem;
			window.setTimeout('try{$util._tab_foc.focus();}catch(i){}',1);
		}
		else
			try{elem.focus();}catch(elem){}
	},
	
	
	_canTab:function(elem)
	{
		if(parseInt(elem.tabIndex) > 0)
			return true;
		for(var i = 0; i < 5; i++)
			if(elem.nodeName == this._tags[i])
				return true;
		return false;
	},
	
	
	_setTabElem:function(elem, foc)
	{
		var tab = this._lastTab;
		
		if((!tab && !foc) || this._lastTabTime + 100 < (new Date()).getTime())
			return;
		
		if(this._isChild(this._targetElement, elem))
			return;
		
		
		
		if(this._shiftKey)
		{
			
			if(!this._minTab2)
				this._minTab2 = tab;
		}
		
		else if(!this._maxTab2)
			
			this._maxTab2 = tab;
		this._tabFoc(null, foc);
	},
	
	
	_onDeact:function(e)
	{
		var to = e ? e.rawEvent : null;
		if(!to)
			return;
		this._deAct = true;
		
		this._setTabElem(to.toElement);//this._setTabElem(to.toElement, e);
	},
	
	
	_onFocus:function(e)
	{
		var elem = (e && !this._deAct) ? e.target : null;
		if(!elem)
			return;
		this._setTabElem(elem, true);
		this._lastTab = null;
	},
	
	
	_onKey:function(e)
	{
		var div = this._targetElement, elem = e ? e.target : null;
		if(!elem || e.keyCode != 9)
			return;
		this._shiftKey = e.shiftKey;
		this._lastTabTime = (new Date()).getTime();
		if(!this._isChild(div, elem))
			return;
		if(!this._canTab(elem))
		{
			this._tabFoc(e);
			return;
		}
		this._lastTab = null;
		if(e.shiftKey)
		{
			
			if(elem == this._minTab2)
			{
				this._tabFoc(e);
				return;
			}
			
			if(this._isChild(div, elem))
				this._lastTab = elem;
		}
		else
		{
			
			if(elem == this._maxTab2)
			{
				this._tabFoc(e);
				return;
			}
			
			if(this._isChild(div, elem))
				this._lastTab = elem;
		}
	},
	
	
	_onFoc:function(e)
	{
		if(this._me)
			this._me._setTabElem();
	},
	
	
	
	
	_fixTabs:function(on, max, doc)
	{
		var elem, i = -1, stop = this._stop, tabs = this._oldTabs, elem0 = this._targetElement;
		if(on == this._fixTabOn)
			return;
		this._fixTabOn = on;
		if(!on)
		{
			if(!tabs)
				return;
			for(var i = 0; i < tabs.length; i++)
				tabs[i].elem.tabIndex = tabs[i].i;
			if(stop)
				stop.style.display = 'none';
			return;
		}
		if(!tabs)
		{
			tabs = this._oldTabs = new Array();
			this._tags = ['INPUT','SELECT','TEXTAREA','BUTTON','A','IFRAME','AREA','DIV','EMBED','OBJECT'];
		}
		else
			Array.clear(tabs);
		if(!stop && !max)
		{
			this._stop = stop = document.createElement('INPUT');
			var style = stop.style;
			style.padding = style.border = style.width = style.height = '0px';
			style.position = 'absolute';
			stop.tabIndex = 1000;
			elem0.insertBefore(stop, elem0.firstChild);
			stop.onfocus = this._onFoc;
			stop._me = this;
		}
		if(stop)
			stop.style.display = '';
		if(!doc)
			doc = document;
		
		var lenAll, lenMy, ti1 = 0, ti2 = 0, j = i = 0, tags = this._tags;
		
		
		for(var t = 0; t < tags.length; t++)
		{
			var elemsAll = doc.getElementsByTagName(tags[t]);
			if((lenAll = elemsAll ? elemsAll.length : 0) < 1)
				continue;
			var elemsMy = this._targetElement.getElementsByTagName(tags[t]);
			lenMy = elemsMy ? elemsMy.length : 0;
			while(lenAll-- > 0)
			{
				elem = elemsAll[lenAll];
				j = lenMy;
				while(j-- > 0) if(elem == elemsMy[j])
				{
					if(elem == stop || elem.disabled || elem.type == 'hidden')// || !elem.offsetWidth)
						break;
					var ti = elem.tabIndex;
					if(!ti)
						ti = 0;
					else if((ti = parseInt(ti)) < 0)
						break;
					if(t < 5 || ti > 0)
					{
						
						if(!this._anyTab1)
							this._anyTab1 = elem;
						
						
						else if(!this._anyTab2)
							this._anyTab2 = elem;
						
						if(!this._minTabI)
						{
							this._minTabI = elem;
							ti1 = ti;
						}
						if(ti1 > ti) 
						{
							this._minTabI = elem;
							ti1 = ti;
						}
					}
					if(ti < 1)
						break;
					
					if(ti >= ti2)
					{
						ti2 = ti;
						this._maxTabI = elem;
					}
					break;
				}
				
				if(j < 0)
				{
					
					tabs[i++] = {elem:elem,i:elem.tabIndex};
					
					elem.tabIndex = -1;
				}
			}
		}
		
		if(stop && ti2 >= stop.tabIndex)
			stop.tabIndex = ti2 + 1;
	},
	
	_modal:function(on)
	{
		if(!this._isModal)
			return;
		if(this._inModal == on)
			return;
		var style, elem = this._targetElement, lid = this._lid;
		if(!lid)
			lid = $util._modalLid;
		if(this._modalNest(lid, on))
			return;
		var css = this._owner._owner;
		if(css)
			css = css._modalCss;
		var elem2 = null;
		if(on && !lid)
		{
			this._lid = lid = document.createElement($util.IsIE ? 'IFRAME' : 'DIV');
			if(!$util._modalLid)
				$util._modalLid = lid;
			style = lid.style;
			style.position = 'absolute';
			if($util.IsIE)
			{
				lid.frameBorder = 0; 
				lid.scrolling = 'no';
				lid.src = elem2 = 'javascript:new String("<html></html>")';	  	
			}
			else
				lid.innerHTML = '&nbsp;';
			if(css)
				lid.className = css;
			else
			{
				style.filter = 'alpha(opacity:30)';
				style.opacity = 0.3;
			}
			
			lid.unselectable = 'on';
			lid.tabIndex = -1;			
		}
		this._inModal = on;
		var div = elem.parentNode;
		this._fixTabs(on);
		style = lid.style;
		this._lidStyle = on ? style : null;
		lid._first = on ? this : null;
		if(on)
		{
			div.insertBefore(lid, elem);
			if($util.IsIE)
			{
				var doc = lid.contentWindow.document;
				$util.addHandler(doc, 'mousemove', this._mouseMoveHandler);
				$util.addHandler(doc, 'mouseup', this._mouseUpHandler); 	
				if(this._control && this._control._resizer)
				{
					$util.addHandler(doc, 'mousemove', this._control._resizer._onMouseMoveFn);
					$util.addHandler(doc, 'mouseup', this._control._resizer._onMouseUpFn); 	
				}
			}
			lid._z = this._doZ(lid, elem);
			$util.display(lid);
			var pos = $util.getPosition(lid);
			style.marginLeft = -pos.x + 'px';
			style.marginTop = -pos.y + 'px';
			
			this._onScrollSize(2);
			
			if(elem2)
			{
				elem2 = lid.contentWindow.document.createElement('DIV');
				lid.appendChild(elem2);
				
				var style2 = elem2.style;
				style2.width = style2.height = '100%';
				elem2.unselectable = 'on';
				elem2.tabIndex = -1;
				
				
				if(css)
				{
					div = document.createElement('DIV');
					div.style.position = 'absolute';
					div.style.width = div.style.width = '1px';
					div.className = css;
					document.body.appendChild(div);
					css = $util.getStyleValue(null, 'backgroundColor', div);
					document.body.removeChild(div);
					if(css)
						style2.background = css;
				}
			}
		}
		else
		{
			$util.display(lid, false);
			style.marginLeft = style.marginTop = style.width = style.height = '0px';
			div.removeChild(lid);
			elem.style.zIndex = this._oldZ;
		}
	},
	
	
	_doZ:function(lid, elem, lidZ)
	{
		this._newZ = this._oldZ = $util.getStyleValue(null, 'zIndex', elem);
		if(!lidZ)
			lidZ = $util.toInt($util.getStyleValue(null, 'zIndex', lid), 0);
		if(lidZ < 10)
			lid.style.zIndex = lidZ = 99999;
		if($util.toInt(this._oldZ, 0) <= lidZ)
			elem.style.zIndex = this._newZ = lidZ + 1;
		return lidZ;
	},
	
	
	
	
	
	_modalNest:function(lid, on)
	{
		var ctl = lid ? lid._first : null;
		if(!ctl)
			
			return false;
		var nest = lid._nest;
		if(!nest && !on)
			
			return false;
		
		if(!nest)
			lid._nest = nest = [ctl];
		var z, i = nest.length, elem = this._targetElement;
		if(on)
		{
			
			this._doZ(lid, elem, lid._z);
			
			nest[i--] = this;
			z = this._oldZ;
		}
		else
		{
			
			if(--i < 2)
				lid._nest = null;
			
			else
				nest[i] = null;
			
			nest.length = i--;
			z = nest[i]._newZ;
		}
		this._inModal = on;
		
		elem = nest[i]._targetElement;
		
		elem.style.zIndex = z;
		
		
		
		this._fixTabs(on, false, elem);
		
		return true;
	},
	
	
	
	
	
	setAbsPos:function(x, y, center, scroll, modal, max)
	{
		/// <summary>Sets location. Internal use only.</summary>
		var elem = this._targetElement;
		var style = elem.style;
		this._position0 = style.position;
		if(style.position != 'absolute')
			style.position = 'absolute';
		var point = $util.getPosition(elem);
		
		if(!center && scroll && x === '')
		{
			x = point.x + 'px';
			y = point.y + 'px';
		}
		
		this._xFixed = this._leftOld = x;
		this._yFixed = this._topOld = y;
		
		if(center || scroll || modal)
		{
			this._center = center;
			this._scroll = scroll;
			if(modal)
				this._modal(this._isModal = modal);
			else
				this._fixTabs(max, max);
			this._lsnr(scroll || modal, modal);
		}
		else if(max != null)
			this._fixTabs(max, max);
		if(center || (scroll && x && y))
		{
			var win = $util.getWinRect(), len = (x && !center) ? x.length : 0;
			
			var w = win.width, h = win.height;
			
			if(len > 0)
			{
				var perc = x.indexOf('%') > 0;
				x = parseInt(x);
				
				if(perc)
					x = w * x / 100;
			}
			
			else if((x = (w - elem.offsetWidth) / 2) < 0)
				x = 0;
			len = (y && !center) ? y.length : 0;
			
			if(len > 0)
			{
				var perc = y.indexOf('%') > 0;
				y = parseInt(y);
				
				if(perc)
					y = Math.floor(h * y / 100);
			}
			
			else if((y = (h - elem.offsetHeight) / 2) < 0)
				y = 0;
			
			point.x = Math.floor(win.x + x);
			point.y = Math.floor(win.y + y);
		}
		
		if(this._shiftX == null)
		{
			style.left = point.x + 'px';
			style.top = point.y + 'px';
			var p = $util.getPosition(elem);
			
			this._shiftX = p.x - point.x;
			this._shiftY = p.y - point.y;
		}
		this._control.set_left((point.x -= this._shiftX) + 'px', false);
		this._control.set_top((point.y -= this._shiftY) + 'px', false);
		
		this._xOld = point.x;
		this._yOld = point.y;
	},

	restore:function(max)
	{
		/// <summary>Restore location. Internal use only.</summary>
		/// <param name="max" type="Boolean">Maximized flag.</param>
		if(this._isModal)
			this._modal(false);
		else
			this._fixTabs(max, max);
		this._lsnr(false, max && this._isModal);
	},

	
	
	
	setLocation:function(x, y, cancel)
	{
		/// <summary>Sets location. Internal use only.</summary>
		/// <param name="x" type="String">Left edge.</param>
		/// <param name="y" type="String">Top edge.</param>
		/// <param name="cancel" type="Boolean">Request to cancel.</param>
		var style = this._targetElement.style;
		var ctl = this._control;
		style.left = x;
		style.top = y;
		if(ctl && ctl.set_left)
		{
			
			if(cancel)
			{
				x = this._leftOld;
				y = this._topOld;
			}
			
			else if(this._center)
			{
				var win = $util.getWinRect();
				
				x = (parseInt(x) - win.x + this._shiftX) + 'px';
				y = (parseInt(y) - win.y + this._shiftY) + 'px';
			}
			
			ctl.set_left(this._xFixed = x, true);
			ctl.set_top(this._yFixed = y, true);
		}
		if(cancel)
			style.position = this._position0;
	},

	_moveWindow:function(e)
	{
		var x = e.clientX, y = e.clientY;
		if(x < 0 || y < 0)
			return;
		x += this._xOld - this._mouseX;
		y += this._yOld - this._mouseY;
		
		var args = this._raiseClientEvent('Moving', 'Move', e, null, x, y, this._xOld, this._yOld);
		if(args && args.get_cancel())
			return;
		if(!this._onFrameMouseFn)
			this._onFrameMouseFn = Function.createDelegate(this, this._onFrameMove);
		$util._setTranspFrame(this, this._control.get_contentPane()._DIV, this._mouseUpHandler, this._onFrameMouseFn);
		this._center = false;
		this.setLocation((this._x = x) + 'px', (this._y = y) + 'px');
	},

	dispose:function()
	{
		/// <summary>Disposes object and event handlers.</summary>
		if(this._lsnr)
		{
			this._lsnr(false, false);
			this._modal(false);
		}
		$util._setTranspFrame(this);
		$IG.DialogMoveBehavior.callBaseMethod(this, 'dispose');
	}
}
$IG.DialogMoveBehavior.registerClass('Infragistics.Web.UI.DialogMoveBehavior', $IG.Behavior);

$IG.WindowStateCancelEventArgs = function()
{
	/// <summary>Class which used while raising events by WebDialogWindow.</summary>
	$IG.WindowStateCancelEventArgs.initializeBase(this);
}
$IG.WindowStateCancelEventArgs.prototype =
{
	get_currentWindowState: function()
	{
		///<summary>Gets the current window state of the dialog.</summary>
		/// <returns type="Number">Window state.</returns>
		return this._props[2];
	},
	
	get_newWindowState: function()
	{
		///<summary>Gets the new window state of the dialog.</summary>
		/// <returns type="Number">Window state.</returns>
		return this._props[3];
	}
}
$IG.WindowStateCancelEventArgs.registerClass('Infragistics.Web.UI.WindowStateCancelEventArgs', $IG.CancelEventArgs);

/* END Infragistics.Web.UI.LayoutControls.WebDialogWindow.js.igDialogWindow.js */
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ctl00_scm_HiddenField').value += ';;Telerik.Web.UI, Version=2008.1.515.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:6090bf79-f951-4c8a-a99d-8c7654f79907:393f5085:34f9d57d;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:e7f9bc61;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:57245547;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:e2b765d5;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:a20fd505;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:6e5f933d;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:cad18375;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:73cbae88;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:a90613f8;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:c6c3b868;Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb:en-US:d33be8db-f4f5-4559-aff7-2c67b516e293:b2d7dccd';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
