/* 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;
var _20=null;
var _21=null;
while(_1f&&_1f.tagName.toUpperCase()!="BODY"&&_1f.tagName.toUpperCase()!="HTML"){
_1e.x-=_1f.scrollLeft;
_1e.y-=_1f.scrollTop;
if($telerik.isSafari3||$telerik.isSafari2){
if(_1f.tagName.toUpperCase()=="TD"){
_20=_1f;
}else{
if(_1f.tagName.toUpperCase()=="TABLE"){
_21=_1f;
}
}
if(_20&&_21){
_1e.x+=parseInt($telerik.getCurrentStyle(_21,"borderTopWidth"));
_1e.y+=parseInt($telerik.getCurrentStyle(_21,"borderLeftWidth"));
if($telerik.getCurrentStyle(_21,"borderCollapse")!="collapse"){
_1e.x+=parseInt($telerik.getCurrentStyle(_20,"borderTopWidth"));
_1e.y+=parseInt($telerik.getCurrentStyle(_20,"borderLeftWidth"));
}
_20=null;
_21=null;
}else{
if(_21){
if($telerik.getCurrentStyle(_21,"borderCollapse")!="collapse"){
_1e.x+=parseInt($telerik.getCurrentStyle(_21,"borderTopWidth"));
_1e.y+=parseInt($telerik.getCurrentStyle(_21,"borderLeftWidth"));
}
_21=null;
}
}
}
_1f=_1f.parentNode;
}
}
if($telerik.isIE&&$telerik.quirksMode){
_1e.x+=document.body.scrollLeft;
_1e.y+=document.body.scrollTop;
}
return _1e;
},setLocation:function(_22,_23){
Sys.UI.DomElement.setLocation(_22,_23.x,_23.y);
},getContentSize:function(_24){
if(!_24){
throw Error.argumentNull("element");
}
var _25=$telerik.getSize(_24);
var _26=$telerik.getBorderBox(_24);
var _27=$telerik.getPaddingBox(_24);
return {width:_25.width-_26.horizontal-_27.horizontal,height:_25.height-_26.vertical-_27.vertical};
},getSize:function(_28){
if(!_28){
throw Error.argumentNull("element");
}
return {width:_28.offsetWidth,height:_28.offsetHeight};
},setContentSize:function(_29,_2a){
if(!_29){
throw Error.argumentNull("element");
}
if(!_2a){
throw Error.argumentNull("size");
}
if($telerik.getCurrentStyle(_29,"MozBoxSizing")=="border-box"||$telerik.getCurrentStyle(_29,"BoxSizing")=="border-box"){
var _2b=$telerik.getBorderBox(_29);
var _2c=$telerik.getPaddingBox(_29);
_2a={width:_2a.width+_2b.horizontal+_2c.horizontal,height:_2a.height+_2b.vertical+_2c.vertical};
}
_29.style.width=_2a.width.toString()+"px";
_29.style.height=_2a.height.toString()+"px";
},setSize:function(_2d,_2e){
if(!_2d){
throw Error.argumentNull("element");
}
if(!_2e){
throw Error.argumentNull("size");
}
var _2f=$telerik.getBorderBox(_2d);
var _30=$telerik.getPaddingBox(_2d);
var _31={width:_2e.width-_2f.horizontal-_30.horizontal,height:_2e.height-_2f.vertical-_30.vertical};
$telerik.setContentSize(_2d,_31);
},getBounds:function(_32){
var _33=$telerik.getLocation(_32);
return new Sys.UI.Bounds(_33.x,_33.y,_32.offsetWidth||0,_32.offsetHeight||0);
},setBounds:function(_34,_35){
if(!_34){
throw Error.argumentNull("element");
}
if(!_35){
throw Error.argumentNull("bounds");
}
$telerik.setSize(_34,_35);
$telerik.setLocation(_34,_35);
},getClientBounds:function(){
var _36;
var _37;
switch(Sys.Browser.agent){
case Sys.Browser.InternetExplorer:
_36=document.documentElement.clientWidth;
_37=document.documentElement.clientHeight;
if(_36==0&&_37==0){
_36=document.body.clientWidth;
_37=document.body.clientHeight;
}
break;
case Sys.Browser.Safari:
_36=window.innerWidth;
_37=window.innerHeight;
break;
case Sys.Browser.Opera:
_36=Math.min(window.innerWidth,document.body.clientWidth);
_37=Math.min(window.innerHeight,document.body.clientHeight);
break;
default:
_36=Math.min(window.innerWidth,document.documentElement.clientWidth);
_37=Math.min(window.innerHeight,document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0,0,_36,_37);
},getMarginBox:function(_38){
if(!_38){
throw Error.argumentNull("element");
}
var box={top:$telerik.getMargin(_38,Telerik.Web.BoxSide.Top),right:$telerik.getMargin(_38,Telerik.Web.BoxSide.Right),bottom:$telerik.getMargin(_38,Telerik.Web.BoxSide.Bottom),left:$telerik.getMargin(_38,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getPaddingBox:function(_3a){
if(!_3a){
throw Error.argumentNull("element");
}
var box={top:$telerik.getPadding(_3a,Telerik.Web.BoxSide.Top),right:$telerik.getPadding(_3a,Telerik.Web.BoxSide.Right),bottom:$telerik.getPadding(_3a,Telerik.Web.BoxSide.Bottom),left:$telerik.getPadding(_3a,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},getBorderBox:function(_3c){
if(!_3c){
throw Error.argumentNull("element");
}
var box={top:$telerik.getBorderWidth(_3c,Telerik.Web.BoxSide.Top),right:$telerik.getBorderWidth(_3c,Telerik.Web.BoxSide.Right),bottom:$telerik.getBorderWidth(_3c,Telerik.Web.BoxSide.Bottom),left:$telerik.getBorderWidth(_3c,Telerik.Web.BoxSide.Left)};
box.horizontal=box.left+box.right;
box.vertical=box.top+box.bottom;
return box;
},isBorderVisible:function(_3e,_3f){
if(!_3e){
throw Error.argumentNull("element");
}
if(_3f<Telerik.Web.BoxSide.Top||_3f>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_3f,"Telerik.Web.BoxSide"));
}
var _40=$telerik._borderStyleNames[_3f];
var _41=$telerik.getCurrentStyle(_3e,_40);
return _41!="none";
},getMargin:function(_42,_43){
if(!_42){
throw Error.argumentNull("element");
}
if(_43<Telerik.Web.BoxSide.Top||_43>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_43,"Telerik.Web.BoxSide"));
}
var _44=$telerik._marginWidthNames[_43];
var _45=$telerik.getCurrentStyle(_42,_44);
try{
return $telerik.parsePadding(_45);
}
catch(ex){
return 0;
}
},getBorderWidth:function(_46,_47){
if(!_46){
throw Error.argumentNull("element");
}
if(_47<Telerik.Web.BoxSide.Top||_47>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_47,"Telerik.Web.BoxSide"));
}
if(!$telerik.isBorderVisible(_46,_47)){
return 0;
}
var _48=$telerik._borderWidthNames[_47];
var _49=$telerik.getCurrentStyle(_46,_48);
return $telerik.parseBorderWidth(_49);
},getPadding:function(_4a,_4b){
if(!_4a){
throw Error.argumentNull("element");
}
if(_4b<Telerik.Web.BoxSide.Top||_4b>Telerik.Web.BoxSide.Left){
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,_4b,"Telerik.Web.BoxSide"));
}
var _4c=$telerik._paddingWidthNames[_4b];
var _4d=$telerik.getCurrentStyle(_4a,_4c);
return $telerik.parsePadding(_4d);
},parseBorderWidth:function(_4e){
if(_4e){
switch(_4e){
case "thin":
case "medium":
case "thick":
return $telerik._borderThicknesses[_4e];
case "inherit":
return 0;
}
var _4f=$telerik.parseUnit(_4e);
return _4f.size;
}
return 0;
},parsePadding:function(_50){
if(_50){
if(_50=="inherit"){
return 0;
}
var _51=$telerik.parseUnit(_50);
return _51.size;
}
return 0;
},parseUnit:function(_52){
if(!_52){
throw Error.argumentNull("value");
}
_52=_52.trim().toLowerCase();
var l=_52.length;
var s=-1;
for(var i=0;i<l;i++){
var ch=_52.substr(i,1);
if((ch<"0"||ch>"9")&&ch!="-"&&ch!="."&&ch!=","){
break;
}
s=i;
}
if(s==-1){
throw Error.create("No digits");
}
var _57;
var _58;
if(s<(l-1)){
_57=_52.substring(s+1).trim();
}else{
_57="px";
}
_58=parseFloat(_52.substr(0,s+1));
if(_57=="px"){
_58=Math.floor(_58);
}
return {size:_58,type:_57};
},containsPoint:function(_59,x,y){
return x>=_59.x&&x<=(_59.x+_59.width)&&y>=_59.y&&y<=(_59.y+_59.height);
},isDescendant:function(_5c,_5d){
for(var n=_5d.parentNode;n!=null;n=n.parentNode){
if(n==_5c){
return true;
}
}
return false;
},isDescendantOrSelf:function(_5f,_60){
if(_5f===_60){
return true;
}
return $telerik.isDescendant(_5f,_60);
},setOuterHeight:function(_61,_62){
if(_62<=0||_62==""){
_61.style.height="";
}else{
_61.style.height=_62+"px";
var _63=_61.offsetHeight-_62;
var _64=_62-_63;
if(_64>0){
_61.style.height=_64+"px";
}else{
_61.style.height="";
}
}
},setOpacity:function(_65,_66){
if(!_65){
throw Error.argumentNull("element");
}
try{
if(_65.filters){
var _67=_65.filters;
var _68=true;
if(_67.length!==0){
var _69=_67["DXImageTransform.Microsoft.Alpha"];
if(_69){
_68=false;
_69.opacity=_66*100;
}
}
if(_68){
_65.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(_66*100)+")";
}
}else{
_65.style.opacity=_66;
}
}
catch(ex){
}
},getOpacity:function(_6a){
if(!_6a){
throw Error.argumentNull("element");
}
var _6b=false;
var _6c;
try{
if(_6a.filters){
var _6d=_6a.filters;
if(_6d.length!==0){
var _6e=_6d["DXImageTransform.Microsoft.Alpha"];
if(_6e){
_6c=_6e.opacity/100;
_6b=true;
}
}
}else{
_6c=$telerik.getCurrentStyle(_6a,"opacity",1);
_6b=true;
}
}
catch(ex){
}
if(_6b===false){
return 1;
}
return parseFloat(_6c);
},addCssClasses:function(_6f,_70){
for(var i=0;i<_70.length;i++){
Sys.UI.DomElement.addCssClass(_6f,_70[i]);
}
},removeCssClasses:function(_72,_73){
for(var i=0;i<_73.length;i++){
Sys.UI.DomElement.removeCssClass(_72,_73[i]);
}
},setOuterWidth:function(_75,_76){
if(_76<=0||_76==""){
_75.style.width="";
}else{
_75.style.width=_76+"px";
var _77=_75.offsetWidth-_76;
var _78=_76-_77;
if(_78>0){
_75.style.width=_78+"px";
}else{
_75.style.width="";
}
}
},getScrollOffset:function(_79,_7a){
var _7b=0;
var top=0;
var _7d=_79;
while(_7d!=null&&_7d.scrollLeft!=null){
_7b+=_7d.scrollLeft;
top+=_7d.scrollTop;
if(!_7a||(_7d==document.body&&(_7d.scrollLeft!=0||_7d.scrollTop!=0))){
break;
}
_7d=_7d.parentNode;
}
return {x:_7b,y:top};
},getElementByClassName:function(_7e,_7f,_80){
var _81=null;
if(_80){
_81=_7e.getElementsByTagName(_80);
}else{
_81=_7e.getElementsByTagName("*");
}
for(var i=0,_83=_81.length;i<_83;i++){
var _84=_81[i];
if(Sys.UI.DomElement.containsCssClass(_84,_7f)){
return _84;
}
}
return null;
},addExternalHandler:function(_85,_86,_87){
if(_85.addEventListener){
_85.addEventListener(_86,_87,false);
}else{
if(_85.attachEvent){
_85.attachEvent("on"+_86,_87);
}
}
},removeExternalHandler:function(_88,_89,_8a){
if(_88.addEventListener){
_88.removeEventListener(_89,_8a,false);
}else{
if(_88.detachEvent){
_88.detachEvent("on"+_89,_8a);
}
}
},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(_8c){
if(_8c.outerHTML){
return _8c.outerHTML;
}else{
var _8d=_8c.cloneNode(true);
var _8e=_8c.ownerDocument.createElement("DIV");
_8e.appendChild(_8d);
return _8e.innerHTML;
}
},setVisible:function(e,_90){
if(!e){
return;
}
if(_90!=$telerik.getVisible(e)){
if(_90){
if(e.style.removeAttribute){
e.style.removeAttribute("display");
}else{
e.style.removeProperty("display");
}
}else{
e.style.display="none";
}
e.style.visibility=_90?"visible":"hidden";
}
},getVisible:function(e){
if(!e){
return false;
}
return (("none"!=$telerik.getCurrentStyle(e,"display"))&&("hidden"!=$telerik.getCurrentStyle(e,"visibility")));
},getViewPortSize:function(){
var _92=0;
var _93=0;
var _94=document.body;
if(!$telerik.quirksMode&&!$telerik.isSafari){
_94=document.documentElement;
}
if(window.innerWidth){
_92=window.innerWidth;
_93=window.innerHeight;
}else{
_92=_94.clientWidth;
_93=_94.clientHeight;
}
_92+=_94.scrollLeft;
_93+=_94.scrollTop;
return {width:_92-6,height:_93-6};
},elementOverflowsTop:function(_95){
return $telerik.getLocation(_95).y<0;
},elementOverflowsLeft:function(_96){
return $telerik.getLocation(_96).x<0;
},elementOverflowsBottom:function(_97,_98){
var _99=$telerik.getLocation(_98).y+_98.offsetHeight;
return _99>_97.height;
},elementOverflowsRight:function(_9a,_9b){
var _9c=$telerik.getLocation(_9b).x+_9b.offsetWidth;
return _9c>_9a.width;
},getDocumentRelativeCursorPosition:function(e){
var _9e=document.documentElement.scrollLeft||document.body.scrollLeft;
var _9f=document.documentElement.scrollTop||document.body.scrollTop;
var _a0=e.clientX+_9e;
var top=e.clientY+_9f;
return {left:_a0,top:top};
},getFirstChildByTagName:function(_a2,_a3,_a4){
if(!_a2||!_a2.childNodes){
return null;
}
var _a5=_a2.childNodes[_a4]||_a2.firstChild;
while(_a5){
if(_a5.nodeType==1&&_a5.tagName.toLowerCase()==_a3){
return _a5;
}
_a5=_a5.nextSibling;
}
return null;
},getChildByClassName:function(_a6,_a7,_a8){
var _a9=_a6.childNodes[_a8]||_a6.firstChild;
while(_a9){
if(_a9.nodeType==1&&_a9.className.indexOf(_a7)>-1){
return _a9;
}
_a9=_a9.nextSibling;
}
return null;
},getChildrenByTagName:function(_aa,_ab){
var _ac=new Array();
var _ad=_aa.childNodes;
for(var i=0,_af=_ad.length;i<_af;i++){
var _b0=_ad[i];
if(_b0.nodeType==1&&_b0.tagName.toLowerCase()==_ab){
Array.add(_ac,_b0);
}
}
return _ac;
},getChildrenByClassName:function(_b1,_b2){
var _b3=new Array();
var _b4=_b1.childNodes;
for(var i=0,_b6=_b4.length;i<_b6;i++){
var _b7=_b4[i];
if(_b7.nodeType==1&&_b7.className.indexOf(_b2)>-1){
Array.add(_b3,_b7);
}
}
return _b3;
}};
$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(_b8){
Telerik.Web.UI.RadWebControl.initializeBase(this,[_b8]);
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 _b9=$get(this.get_clientStateFieldID());
if(!_b9){
return;
}
_b9.setAttribute("autocomplete","off");
},dispose:function(){
$telerik.unregisterControl(this);
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"dispose");
},raiseEvent:function(_ba,_bb){
var _bc=this.get_events().getHandler(_ba);
if(_bc){
if(!_bb){
_bb=Sys.EventArgs.Empty;
}
_bc(this,_bb);
}
},updateClientState:function(){
this.set_clientState(this.saveClientState());
},saveClientState:function(){
return null;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_bd){
if(this._clientStateFieldID!=_bd){
this._clientStateFieldID=_bd;
this.raisePropertyChanged("ClientStateFieldID");
}
},get_clientState:function(){
if(this._clientStateFieldID){
var _be=document.getElementById(this._clientStateFieldID);
if(_be){
return _be.value;
}
}
return null;
},set_clientState:function(_bf){
if(this._clientStateFieldID){
var _c0=document.getElementById(this._clientStateFieldID);
if(_c0){
_c0.value=_bf;
}
}
},_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(_c3){
if(this._interval!==_c3){
this._interval=_c3;
this.raisePropertyChanged("interval");
if(!this.get_isUpdating()&&(this._timer!==null)){
this._stopTimer();
this._startTimer();
}
}
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_c4){
if(_c4!==this.get_enabled()){
this._enabled=_c4;
this.raisePropertyChanged("enabled");
if(!this.get_isUpdating()){
if(_c4){
this._startTimer();
}else{
this._stopTimer();
}
}
}
},add_tick:function(_c5){
this.get_events().addHandler("tick",_c5);
},remove_tick:function(_c6){
this.get_events().removeHandler("tick",_c6);
},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 _c7=this.get_events().getHandler("tick");
if(_c7){
_c7(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(_c8){
if(!this._upperAbbrMonths){
this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}
return Array.indexOf(this._upperAbbrMonths,this._toUpper(_c8));
};
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(_c9){
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(_ca){
Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context=_ca;
};
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(_cb,_cc){
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this,[_cc]);
this._data=_cb;
};
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(_cd,_ce){
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this,[_ce]);
this._message=_cd;
};
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(_cf){
this._webServiceSettings=_cf;
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(_d0,_d1){
var _d2=this.get_webServiceSettings();
if(_d2.get_isEmpty()){
Error.invalidOperation("Please, specify valid web service and method.");
return;
}
var _d3=_d2.get_path();
var _d4=_d2.get_method();
this._raiseEvent("loadingStarted",new Telerik.Web.UI.WebServiceLoaderEventArgs(_d1));
this._currentWebRequest=Sys.Net.WebServiceProxy.invoke(_d3,_d4,false,_d0,this._onWebServiceSuccessDelegate,this._onWebServiceErrorDelegate,_d1);
},add_loadingStarted:function(_d5){
this.get_events().addHandler("loadingStarted",_d5);
},add_loadingError:function(_d6){
this.get_events().addHandler("loadingError",_d6);
},add_loadingSuccess:function(_d7){
this.get_events().addHandler("loadingSuccess",_d7);
},_onWebServiceSuccess:function(_d8,_d9){
var _da=new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(_d8,_d9);
this._raiseEvent("loadingSuccess",_da);
},_onWebServiceError:function(_db,_dc){
var _dd=new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(_db.get_message(),_dc);
this._raiseEvent("loadingError",_dd);
},_raiseEvent:function(_de,_df){
var _e0=this.get_events().getHandler(_de);
if(_e0){
if(!_df){
_df=Sys.EventArgs.Empty;
}
_e0(this,_df);
}
}};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings=function(_e1){
this._path=null;
this._method=null;
if(!_e1){
_e1={};
}
if(typeof (_e1.path)!="undefined"){
this._path=_e1.path;
}
if(typeof (_e1.method)!="undefined"){
this._method=_e1.method;
}
};
Telerik.Web.UI.WebServiceSettings.prototype={get_path:function(){
return this._path;
},set_path:function(_e2){
this._path=_e2;
},get_method:function(){
return this._method;
},set_method:function(_e3){
this._method=_e3;
},get_isEmpty:function(){
var _e4=this.get_path();
var _e5=this.get_method();
return (!(_e4&&_e5));
}};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");


/* END Telerik.Web.UI.Common.Core.js */
/* START Telerik.Web.UI.Common.Popup.PopupScripts.js */
Type.registerNamespace("Telerik.Web");
Telerik.Web.BehaviorBase=function(_1){
Telerik.Web.BehaviorBase.initializeBase(this,[_1]);
this._clientStateFieldID=null;
this._pageRequestManager=null;
this._partialUpdateBeginRequestHandler=null;
this._partialUpdateEndRequestHandler=null;
};
Telerik.Web.BehaviorBase.prototype={initialize:function(){
Telerik.Web.BehaviorBase.callBaseMethod(this,"initialize");
},dispose:function(){
Telerik.Web.BehaviorBase.callBaseMethod(this,"dispose");
if(this._pageRequestManager){
if(this._partialUpdateBeginRequestHandler){
this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateBeginRequestHandler=null;
}
if(this._partialUpdateEndRequestHandler){
this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
this._partialUpdateEndRequestHandler=null;
}
this._pageRequestManager=null;
}
},get_ClientStateFieldID:function(){
return this._clientStateFieldID;
},set_ClientStateFieldID:function(_2){
if(this._clientStateFieldID!=_2){
this._clientStateFieldID=_2;
this.raisePropertyChanged("ClientStateFieldID");
}
},get_ClientState:function(){
if(this._clientStateFieldID){
var _3=document.getElementById(this._clientStateFieldID);
if(_3){
return _3.value;
}
}
return null;
},set_ClientState:function(_4){
if(this._clientStateFieldID){
var _5=document.getElementById(this._clientStateFieldID);
if(_5){
_5.value=_4;
}
}
},registerPartialUpdateEvents:function(){
if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){
this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();
if(this._pageRequestManager){
this._partialUpdateBeginRequestHandler=Function.createDelegate(this,this._partialUpdateBeginRequest);
this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateEndRequestHandler=Function.createDelegate(this,this._partialUpdateEndRequest);
this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
}
}
},_partialUpdateBeginRequest:function(_6,_7){
},_partialUpdateEndRequest:function(_8,_9){
}};
Telerik.Web.BehaviorBase.registerClass("Telerik.Web.BehaviorBase",Sys.UI.Behavior);
Type.registerNamespace("Telerik.Web");
Telerik.Web.IDragSource=function(){
};
Telerik.Web.IDragSource.prototype={get_dragDataType:function(){
throw Error.notImplemented();
},getDragData:function(){
throw Error.notImplemented();
},get_dragMode:function(){
throw Error.notImplemented();
},onDragStart:function(){
throw Error.notImplemented();
},onDrag:function(){
throw Error.notImplemented();
},onDragEnd:function(){
throw Error.notImplemented();
}};
Telerik.Web.IDragSource.registerInterface("Telerik.Web.IDragSource");
Telerik.Web.IDropTarget=function(){
};
Telerik.Web.IDropTarget.prototype={get_dropTargetElement:function(){
throw Error.notImplemented();
},canDrop:function(){
throw Error.notImplemented();
},drop:function(){
throw Error.notImplemented();
},onDragEnterTarget:function(){
throw Error.notImplemented();
},onDragLeaveTarget:function(){
throw Error.notImplemented();
},onDragInTarget:function(){
throw Error.notImplemented();
}};
Telerik.Web.IDropTarget.registerInterface("Telerik.Web.IDropTarget");
Telerik.Web.DragMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.DragMode.prototype={Copy:0,Move:1};
Telerik.Web.DragMode.registerEnum("Telerik.Web.DragMode");
Telerik.Web.DragDropEventArgs=function(_a,_b,_c){
this._dragMode=_a;
this._dataType=_b;
this._data=_c;
};
Telerik.Web.DragDropEventArgs.prototype={get_dragMode:function(){
return this._dragMode||null;
},get_dragDataType:function(){
return this._dataType||null;
},get_dragData:function(){
return this._data||null;
}};
Telerik.Web.DragDropEventArgs.registerClass("Telerik.Web.DragDropEventArgs");
Telerik.Web._DragDropManager=function(){
this._instance=null;
this._events=null;
};
Telerik.Web._DragDropManager.prototype={add_dragStart:function(_d){
this.get_events().addHandler("dragStart",_d);
},remove_dragStart:function(_e){
this.get_events().removeHandler("dragStart",_e);
},get_events:function(){
if(!this._events){
this._events=new Sys.EventHandlerList();
}
return this._events;
},add_dragStop:function(_f){
this.get_events().addHandler("dragStop",_f);
},remove_dragStop:function(_10){
this.get_events().removeHandler("dragStop",_10);
},_getInstance:function(){
if(!this._instance){
if(Sys.Browser.agent===Sys.Browser.InternetExplorer){
this._instance=new Telerik.Web.IEDragDropManager();
}else{
this._instance=new Telerik.Web.GenericDragDropManager();
}
this._instance.initialize();
this._instance.add_dragStart(Function.createDelegate(this,this._raiseDragStart));
this._instance.add_dragStop(Function.createDelegate(this,this._raiseDragStop));
}
return this._instance;
},startDragDrop:function(_11,_12,_13){
this._getInstance().startDragDrop(_11,_12,_13);
},registerDropTarget:function(_14,_15){
this._getInstance().registerDropTarget(_14,_15);
},unregisterDropTarget:function(_16){
this._getInstance().unregisterDropTarget(_16);
},dispose:function(){
delete this._events;
Sys.Application.unregisterDisposableObject(this);
Sys.Application.removeComponent(this);
},_raiseDragStart:function(_17,_18){
var _19=this.get_events().getHandler("dragStart");
if(_19){
_19(this,_18);
}
},_raiseDragStop:function(_1a,_1b){
var _1c=this.get_events().getHandler("dragStop");
if(_1c){
_1c(this,_1b);
}
}};
Telerik.Web._DragDropManager.registerClass("Telerik.Web._DragDropManager");
Telerik.Web.DragDropManager=new Telerik.Web._DragDropManager();
Telerik.Web.IEDragDropManager=function(){
Telerik.Web.IEDragDropManager.initializeBase(this);
this._dropTargets=null;
this._radius=10;
this._activeDragVisual=null;
this._activeContext=null;
this._activeDragSource=null;
this._underlyingTarget=null;
this._oldOffset=null;
this._potentialTarget=null;
this._isDragging=false;
this._mouseUpHandler=null;
this._documentMouseMoveHandler=null;
this._documentDragOverHandler=null;
this._dragStartHandler=null;
this._mouseMoveHandler=null;
this._dragEnterHandler=null;
this._dragLeaveHandler=null;
this._dragOverHandler=null;
this._dropHandler=null;
this._areEventsWired=false;
};
Telerik.Web.IEDragDropManager.prototype={add_dragStart:function(_1d){
this.get_events().addHandler("dragStart",_1d);
},remove_dragStart:function(_1e){
this.get_events().removeHandler("dragStart",_1e);
},add_dragStop:function(_1f){
this.get_events().addHandler("dragStop",_1f);
},remove_dragStop:function(_20){
this.get_events().removeHandler("dragStop",_20);
},initialize:function(){
Telerik.Web.IEDragDropManager.callBaseMethod(this,"initialize");
this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp);
this._documentMouseMoveHandler=Function.createDelegate(this,this._onDocumentMouseMove);
this._documentDragOverHandler=Function.createDelegate(this,this._onDocumentDragOver);
this._dragStartHandler=Function.createDelegate(this,this._onDragStart);
this._mouseMoveHandler=Function.createDelegate(this,this._onMouseMove);
this._dragEnterHandler=Function.createDelegate(this,this._onDragEnter);
this._dragLeaveHandler=Function.createDelegate(this,this._onDragLeave);
this._dragOverHandler=Function.createDelegate(this,this._onDragOver);
this._dropHandler=Function.createDelegate(this,this._onDrop);
},dispose:function(){
if(this._dropTargets){
for(var i=0;i<this._dropTargets;i++){
this.unregisterDropTarget(this._dropTargets[i]);
}
this._dropTargets=null;
}
Telerik.Web.IEDragDropManager.callBaseMethod(this,"dispose");
},startDragDrop:function(_22,_23,_24){
var ev=window._event;
if(this._isDragging){
return;
}
this._underlyingTarget=null;
this._activeDragSource=_22;
this._activeDragVisual=_23;
this._activeContext=_24;
var _26={x:ev.clientX,y:ev.clientY};
_23.originalPosition=_23.style.position;
var _27=$telerik.getLocation(_23);
_23.style.position="absolute";
document._lastPosition=_26;
_23.startingPoint=_26;
var _28=this.getScrollOffset(_23,true);
_23.startingPoint=this.addPoints(_23.startingPoint,_28);
if(_23.style.position=="absolute"){
_23.startingPoint=this.subtractPoints(_23.startingPoint,_27);
}else{
var _29=parseInt(_23.style.left);
var top=parseInt(_23.style.top);
if(isNaN(_29)){
_29="0";
}
if(isNaN(top)){
top="0";
}
_23.startingPoint=this.subtractPoints(_23.startingPoint,{x:_29,y:top});
}
this._prepareForDomChanges();
_22.onDragStart();
var _2b=new Telerik.Web.DragDropEventArgs(_22.get_dragMode(),_22.get_dragDataType(),_22.getDragData(_24));
var _2c=this.get_events().getHandler("dragStart");
if(_2c){
_2c(this,_2b);
}
this._recoverFromDomChanges();
this._unwireEvents();
this._wireEvents();
this._drag(true);
},_stopDragDrop:function(_2d){
var ev=window._event;
if(this._activeDragSource!=null){
this._unwireEvents();
if(!_2d){
_2d=(this._underlyingTarget==null);
}
if(!_2d&&this._underlyingTarget!=null){
this._underlyingTarget.drop(this._activeDragSource.get_dragMode(),this._activeDragSource.get_dragDataType(),this._activeDragSource.getDragData(this._activeContext));
}
this._activeDragSource.onDragEnd(_2d);
var _2f=this.get_events().getHandler("dragStop");
if(_2f){
_2f(this,Sys.EventArgs.Empty);
}
this._activeDragVisual.style.position=this._activeDragVisual.originalPosition;
this._activeDragSource=null;
this._activeContext=null;
this._activeDragVisual=null;
this._isDragging=false;
this._potentialTarget=null;
ev.preventDefault();
}
},_drag:function(_30){
var ev=window._event;
var _32={x:ev.clientX,y:ev.clientY};
document._lastPosition=_32;
var _33=this.getScrollOffset(this._activeDragVisual,true);
var _34=this.addPoints(this.subtractPoints(_32,this._activeDragVisual.startingPoint),_33);
if(!_30&&parseInt(this._activeDragVisual.style.left)==_34.x&&parseInt(this._activeDragVisual.style.top)==_34.y){
return;
}
$telerik.setLocation(this._activeDragVisual,_34);
this._prepareForDomChanges();
this._activeDragSource.onDrag();
this._recoverFromDomChanges();
this._potentialTarget=this._findPotentialTarget(this._activeDragSource,this._activeDragVisual);
var _35=(this._potentialTarget!=this._underlyingTarget||this._potentialTarget==null);
if(_35&&this._underlyingTarget!=null){
this._leaveTarget(this._activeDragSource,this._underlyingTarget);
}
if(this._potentialTarget!=null){
if(_35){
this._underlyingTarget=this._potentialTarget;
this._enterTarget(this._activeDragSource,this._underlyingTarget);
}else{
this._moveInTarget(this._activeDragSource,this._underlyingTarget);
}
}else{
this._underlyingTarget=null;
}
},_wireEvents:function(){
$addHandler(document,"mouseup",this._mouseUpHandler);
$addHandler(document,"mousemove",this._documentMouseMoveHandler);
$addHandler(document.body,"dragover",this._documentDragOverHandler);
$addHandler(this._activeDragVisual,"dragstart",this._dragStartHandler);
$addHandler(this._activeDragVisual,"dragend",this._mouseUpHandler);
$addHandler(this._activeDragVisual,"drag",this._mouseMoveHandler);
this._areEventsWired=true;
},_unwireEvents:function(){
if(!this._areEventsWired){
return;
}
$removeHandler(this._activeDragVisual,"drag",this._mouseMoveHandler);
$removeHandler(this._activeDragVisual,"dragend",this._mouseUpHandler);
$removeHandler(this._activeDragVisual,"dragstart",this._dragStartHandler);
$removeHandler(document.body,"dragover",this._documentDragOverHandler);
$removeHandler(document,"mousemove",this._documentMouseMoveHandler);
$removeHandler(document,"mouseup",this._mouseUpHandler);
this._areEventsWired=false;
},registerDropTarget:function(_36,_37){
if(this._dropTargets==null){
this._dropTargets=[];
}
if(_37){
Array.add(this._dropTargets,_36);
}else{
Array.insert(this._dropTargets,0,_36);
}
this._wireDropTargetEvents(_36);
},unregisterDropTarget:function(_38){
this._unwireDropTargetEvents(_38);
if(this._dropTargets){
Array.remove(this._dropTargets,_38);
}
},_wireDropTargetEvents:function(_39){
var _3a=_39.get_dropTargetElement();
_3a._dropTarget=_39;
$addHandler(_3a,"dragenter",this._dragEnterHandler);
$addHandler(_3a,"dragleave",this._dragLeaveHandler);
$addHandler(_3a,"dragover",this._dragOverHandler);
$addHandler(_3a,"drop",this._dropHandler);
},_unwireDropTargetEvents:function(_3b){
var _3c=_3b.get_dropTargetElement();
if(_3c._dropTarget){
_3c._dropTarget=null;
$removeHandler(_3c,"dragenter",this._dragEnterHandler);
$removeHandler(_3c,"dragleave",this._dragLeaveHandler);
$removeHandler(_3c,"dragover",this._dragOverHandler);
$removeHandler(_3c,"drop",this._dropHandler);
}
},_onDragStart:function(ev){
window._event=ev;
document.selection.empty();
var dt=ev.dataTransfer;
if(!dt&&ev.rawEvent){
dt=ev.rawEvent.dataTransfer;
}
var _3f=this._activeDragSource.get_dragDataType().toLowerCase();
var _40=this._activeDragSource.getDragData(this._activeContext);
if(_40){
if(_3f!="text"&&_3f!="url"){
_3f="text";
if(_40.innerHTML!=null){
_40=_40.innerHTML;
}
}
dt.effectAllowed="move";
dt.setData(_3f,_40.toString());
}
},_onMouseUp:function(ev){
window._event=ev;
this._stopDragDrop(false);
},_onDocumentMouseMove:function(ev){
window._event=ev;
this._dragDrop();
},_onDocumentDragOver:function(ev){
window._event=ev;
if(this._potentialTarget){
ev.preventDefault();
}
},_onMouseMove:function(ev){
window._event=ev;
this._drag();
},_onDragEnter:function(ev){
window._event=ev;
if(this._isDragging){
ev.preventDefault();
}else{
var _46=Telerik.Web.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
for(var i=0;i<_46.length;i++){
this._dropTarget.onDragEnterTarget(Telerik.Web.DragMode.Copy,_46[i].type,_46[i].value);
}
}
},_onDragLeave:function(ev){
window._event=ev;
if(this._isDragging){
ev.preventDefault();
}else{
var _49=Telerik.Web.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
for(var i=0;i<_49.length;i++){
this._dropTarget.onDragLeaveTarget(Telerik.Web.DragMode.Copy,_49[i].type,_49[i].value);
}
}
},_onDragOver:function(ev){
window._event=ev;
if(this._isDragging){
ev.preventDefault();
}else{
var _4c=Telerik.Web.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
for(var i=0;i<_4c.length;i++){
this._dropTarget.onDragInTarget(Telerik.Web.DragMode.Copy,_4c[i].type,_4c[i].value);
}
}
},_onDrop:function(ev){
window._event=ev;
if(!this._isDragging){
var _4f=Telerik.Web.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
for(var i=0;i<_4f.length;i++){
this._dropTarget.drop(Telerik.Web.DragMode.Copy,_4f[i].type,_4f[i].value);
}
}
ev.preventDefault();
},_getDropTarget:function(_51){
while(_51){
if(_51._dropTarget!=null){
return _51._dropTarget;
}
_51=_51.parentNode;
}
return null;
},_dragDrop:function(){
if(this._isDragging){
return;
}
this._isDragging=true;
this._activeDragVisual.dragDrop();
document.selection.empty();
},_moveInTarget:function(_52,_53){
this._prepareForDomChanges();
_53.onDragInTarget(_52.get_dragMode(),_52.get_dragDataType(),_52.getDragData(this._activeContext));
this._recoverFromDomChanges();
},_enterTarget:function(_54,_55){
this._prepareForDomChanges();
_55.onDragEnterTarget(_54.get_dragMode(),_54.get_dragDataType(),_54.getDragData(this._activeContext));
this._recoverFromDomChanges();
},_leaveTarget:function(_56,_57){
this._prepareForDomChanges();
_57.onDragLeaveTarget(_56.get_dragMode(),_56.get_dragDataType(),_56.getDragData(this._activeContext));
this._recoverFromDomChanges();
},_findPotentialTarget:function(_58,_59){
var ev=window._event;
if(this._dropTargets==null){
return null;
}
var _5b=_58.get_dragDataType();
var _5c=_58.get_dragMode();
var _5d=_58.getDragData(this._activeContext);
var _5e=this.getScrollOffset(document.body,true);
var x=ev.clientX+_5e.x;
var y=ev.clientY+_5e.y;
var _61={x:x-this._radius,y:y-this._radius,width:this._radius*2,height:this._radius*2};
var _62;
for(var i=0;i<this._dropTargets.length;i++){
_62=$telerik.getBounds(this._dropTargets[i].get_dropTargetElement());
if(this._overlaps(_61,_62)&&this._dropTargets[i].canDrop(_5c,_5b,_5d)){
return this._dropTargets[i];
}
}
return null;
},_overlaps:function(r1,r2){
var _66=(r1.x>=r2.x&&r1.x<=(r2.x+r2.width));
var _67=((r1.x+r1.width)>=r2.x&&(r1.x+r1.width)<=r2.x+r2.width);
var _68=((r1.x<r2.x)&&((r1.x+r1.width)>(r2.x+r2.width)));
var _69=(r1.y>=r2.y&&r1.y<=(r2.y+r2.height));
var _6a=((r1.y+r1.height)>=r2.y&&(r1.y+r1.height)<=r2.y+r2.height);
var _6b=((r1.y<r2.y)&&((r1.y+r1.height)>(r2.y+r2.height)));
if((_66||_67||_68)&&(_69||_6a||_6b)){
return true;
}
return false;
},_prepareForDomChanges:function(){
this._oldOffset=$telerik.getLocation(this._activeDragVisual);
},_recoverFromDomChanges:function(){
var _6c=$telerik.getLocation(this._activeDragVisual);
if(this._oldOffset.x!=_6c.x||this._oldOffset.y!=_6c.y){
this._activeDragVisual.startingPoint=this.subtractPoints(this._activeDragVisual.startingPoint,this.subtractPoints(this._oldOffset,_6c));
scrollOffset=this.getScrollOffset(this._activeDragVisual,true);
var _6d=this.addPoints(this.subtractPoints(document._lastPosition,this._activeDragVisual.startingPoint),scrollOffset);
$telerik.setLocation(this._activeDragVisual,_6d);
}
},addPoints:function(p1,p2){
return {x:p1.x+p2.x,y:p1.y+p2.y};
},subtractPoints:function(p1,p2){
return {x:p1.x-p2.x,y:p1.y-p2.y};
},getScrollOffset:function(_72,_73){
var _74=_72.scrollLeft;
var top=_72.scrollTop;
if(_73){
var _76=_72.parentNode;
while(_76!=null&&_76.scrollLeft!=null){
_74+=_76.scrollLeft;
top+=_76.scrollTop;
if(_76==document.body&&(_74!=0&&top!=0)){
break;
}
_76=_76.parentNode;
}
}
return {x:_74,y:top};
},getBrowserRectangle:function(){
var _77=window.innerWidth;
var _78=window.innerHeight;
if(_77==null){
_77=document.body.clientWidth;
}
if(_78==null){
_78=document.body.clientHeight;
}
return {x:0,y:0,width:_77,height:_78};
},getNextSibling:function(_79){
for(_79=_79.nextSibling;_79!=null;_79=_79.nextSibling){
if(_79.innerHTML!=null){
return _79;
}
}
return null;
},hasParent:function(_7a){
return (_7a.parentNode!=null&&_7a.parentNode.tagName!=null);
}};
Telerik.Web.IEDragDropManager.registerClass("Telerik.Web.IEDragDropManager",Sys.Component);
Telerik.Web.IEDragDropManager._getDataObjectsForDropTarget=function(_7b){
if(_7b==null){
return [];
}
var ev=window._event;
var _7d=[];
var _7e=["URL","Text"];
var _7f;
for(var i=0;i<_7e.length;i++){
var dt=ev.dataTransfer;
if(!dt&&ev.rawEvent){
dt=ev.rawEvent.dataTransfer;
}
_7f=dt.getData(_7e[i]);
if(_7b.canDrop(Telerik.Web.DragMode.Copy,_7e[i],_7f)){
if(_7f){
Array.add(_7d,{type:_7e[i],value:_7f});
}
}
}
return _7d;
};
Telerik.Web.GenericDragDropManager=function(){
Telerik.Web.GenericDragDropManager.initializeBase(this);
this._dropTargets=null;
this._scrollEdgeConst=40;
this._scrollByConst=10;
this._scroller=null;
this._scrollDeltaX=0;
this._scrollDeltaY=0;
this._activeDragVisual=null;
this._activeContext=null;
this._activeDragSource=null;
this._oldOffset=null;
this._potentialTarget=null;
this._mouseUpHandler=null;
this._mouseMoveHandler=null;
this._keyPressHandler=null;
this._scrollerTickHandler=null;
this._areEventsWired=false;
};
Telerik.Web.GenericDragDropManager.prototype={initialize:function(){
Telerik.Web.GenericDragDropManager.callBaseMethod(this,"initialize");
this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp);
this._mouseMoveHandler=Function.createDelegate(this,this._onMouseMove);
this._keyPressHandler=Function.createDelegate(this,this._onKeyPress);
this._scrollerTickHandler=Function.createDelegate(this,this._onScrollerTick);
if(Sys.Browser.agent===Sys.Browser.Safari){
Telerik.Web.GenericDragDropManager.__loadSafariCompatLayer(this);
}
this._scroller=new Telerik.Web.Timer();
this._scroller.set_interval(10);
this._scroller.add_tick(this._scrollerTickHandler);
},startDragDrop:function(_82,_83,_84){
this._activeDragSource=_82;
this._activeDragVisual=_83;
this._activeContext=_84;
Telerik.Web.GenericDragDropManager.callBaseMethod(this,"startDragDrop",[_82,_83,_84]);
},_stopDragDrop:function(_85){
this._scroller.set_enabled(false);
Telerik.Web.GenericDragDropManager.callBaseMethod(this,"_stopDragDrop",[_85]);
},_drag:function(_86){
Telerik.Web.GenericDragDropManager.callBaseMethod(this,"_drag",[_86]);
this._autoScroll();
},_wireEvents:function(){
$addHandler(document,"mouseup",this._mouseUpHandler);
$addHandler(document,"mousemove",this._mouseMoveHandler);
$addHandler(document,"keypress",this._keyPressHandler);
this._areEventsWired=true;
},_unwireEvents:function(){
if(!this._areEventsWired){
return;
}
$removeHandler(document,"keypress",this._keyPressHandler);
$removeHandler(document,"mousemove",this._mouseMoveHandler);
$removeHandler(document,"mouseup",this._mouseUpHandler);
this._areEventsWired=false;
},_wireDropTargetEvents:function(_87){
},_unwireDropTargetEvents:function(_88){
},_onMouseUp:function(e){
window._event=e;
this._stopDragDrop(false);
},_onMouseMove:function(e){
window._event=e;
this._drag();
},_onKeyPress:function(e){
window._event=e;
var k=e.keyCode?e.keyCode:e.rawEvent.keyCode;
if(k==27){
this._stopDragDrop(true);
}
},_autoScroll:function(){
var ev=window._event;
var _8e=this.getBrowserRectangle();
if(_8e.width>0){
this._scrollDeltaX=this._scrollDeltaY=0;
if(ev.clientX<_8e.x+this._scrollEdgeConst){
this._scrollDeltaX=-this._scrollByConst;
}else{
if(ev.clientX>_8e.width-this._scrollEdgeConst){
this._scrollDeltaX=this._scrollByConst;
}
}
if(ev.clientY<_8e.y+this._scrollEdgeConst){
this._scrollDeltaY=-this._scrollByConst;
}else{
if(ev.clientY>_8e.height-this._scrollEdgeConst){
this._scrollDeltaY=this._scrollByConst;
}
}
if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){
this._scroller.set_enabled(true);
}else{
this._scroller.set_enabled(false);
}
}
},_onScrollerTick:function(){
var _8f=document.body.scrollLeft;
var _90=document.body.scrollTop;
window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);
var _91=document.body.scrollLeft;
var _92=document.body.scrollTop;
var _93=this._activeDragVisual;
var _94={x:parseInt(_93.style.left)+(_91-_8f),y:parseInt(_93.style.top)+(_92-_90)};
$telerik.setLocation(_93,_94);
}};
Telerik.Web.GenericDragDropManager.registerClass("Telerik.Web.GenericDragDropManager",Telerik.Web.IEDragDropManager);
if(Sys.Browser.agent===Sys.Browser.Safari){
Telerik.Web.GenericDragDropManager.__loadSafariCompatLayer=function(ddm){
ddm._getScrollOffset=ddm.getScrollOffset;
ddm.getScrollOffset=function(_96,_97){
return {x:0,y:0};
};
ddm._getBrowserRectangle=ddm.getBrowserRectangle;
ddm.getBrowserRectangle=function(){
var _98=ddm._getBrowserRectangle();
var _99=ddm._getScrollOffset(document.body,true);
return {x:_98.x+_99.x,y:_98.y+_99.y,width:_98.width+_99.x,height:_98.height+_99.y};
};
};
}
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ModalExtender=function(_9a){
this._windowResizeDelegate=null;
this._windowScrollDelegate=null;
this._xCoordinate=-1;
this._yCoordinate=-1;
this._backgroundElement=null;
this._foregroundElement=_9a;
this._saveTabIndexes=new Array();
this._saveDesableSelect=new Array();
this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME");
};
Telerik.Web.UI.ModalExtender.prototype={dispose:function(){
this.hide();
this._backgroundElement=null;
this._foregroundElement=null;
},show:function(){
this._attachWindowHandlers(true);
var _9b=this._getModalOverlay();
this._foregroundElement.parentNode.appendChild(_9b);
_9b.style.zIndex=$telerik.getCurrentStyle(this._foregroundElement,"zIndex",this._foregroundElement.style.zIndex)-1;
_9b.style.display="";
this._disableTab();
this._updatePageLayout();
this._updatePageLayout();
},_storeBrowserPosition:function(){
var _9c=document.body;
var _9d=document.documentElement;
this._browserTop=_9c.scrollTop>_9d.scrollTop?_9c.scrollTop:_9d.scrollTop;
this._browserLeft=_9c.scrollLeft>_9d.scrollLeft?_9c.scrollTop:_9d.scrollLeft;
},_restoreBrowserPosition:function(_9e,top){
try{
if(null==_9e){
_9e=this._browserLeft;
}
if(null==top){
top=this._browserTop;
}
var _a0=document.body;
var _a1=document.documentElement;
_a0.scrollTop=top;
_a0.scrollLeft=_9e;
_a1.scrollTop=top;
_a1.scrollLeft=_9e;
}
catch(ex){
}
},hide:function(){
this._backgroundElement.style.display="none";
this._restoreTab();
this._attachWindowHandlers(false);
},_enableScroll:function(_a2){
if(_a2){
document.body.style.overflow=null!=this._overflow?this._overflow:"";
document.documentElement.style.overflow=null!=this._documentOverflow?this._documentOverflow:"";
document.body.style.marginRight="";
}else{
this._overflow=document.body.style.overflow;
document.body.style.overflow="hidden";
this._documentOverflow=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
document.body.style.marginRight="18px";
}
},_getModalOverlay:function(){
if(!this._backgroundElement){
var div=document.createElement("div");
div.style.display="none";
div.style.position="absolute";
div.style.left="0px";
div.style.top="0px";
div.style.zIndex=10000;
div.style.backgroundColor="#aaaaaa";
div.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)";
div.style.opacity=".5";
div.style.mozOpacity=".5";
div.className="TelerikModalOverlay";
this._backgroundElement=div;
}
return this._backgroundElement;
},_attachWindowHandlers:function(_a4){
var _a5=window;
if(true==_a4){
this._windowResizeDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(_a5,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(_a5,"scroll",this._windowScrollDelegate);
}else{
if(this._windowResizeDelegate){
$removeHandler(_a5,"resize",this._windowResizeDelegate);
}
this._windowResizeDelegate=null;
if(this._windowScrollDelegate){
$removeHandler(_a5,"scroll",this._windowScrollDelegate);
}
this._windowScrollDelegate=null;
}
},_updatePageLayout:function(){
var _a6=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
var _a7=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
var _a8=$telerik.getClientBounds();
var _a9=_a8.width;
var _aa=_a8.height;
var _ab=this._getModalOverlay();
_ab.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),_a9)+"px";
_ab.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),_aa)+"px";
},_disableTab:function(){
var i=0;
var _ad;
var _ae=new Array();
Array.clear(this._saveTabIndexes);
for(var j=0;j<this._tagWithTabIndex.length;j++){
_ad=this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]);
for(var k=0;k<_ad.length;k++){
_ae[i]=_ad[k];
i++;
}
}
i=0;
for(var j=0;j<this._tagWithTabIndex.length;j++){
_ad=document.getElementsByTagName(this._tagWithTabIndex[j]);
for(var k=0;k<_ad.length;k++){
if(Array.indexOf(_ae,_ad[k])==-1){
this._saveTabIndexes[i]={tag:_ad[k],index:_ad[k].tabIndex};
_ad[k].tabIndex="-1";
i++;
}
}
}
i=0;
if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){
var _b1=new Array();
for(var j=0;j<this._tagWithTabIndex.length;j++){
_ad=this._foregroundElement.getElementsByTagName("SELECT");
for(var k=0;k<_ad.length;k++){
_b1[i]=_ad[k];
i++;
}
}
i=0;
Array.clear(this._saveDesableSelect);
_ad=document.getElementsByTagName("SELECT");
for(var k=0;k<_ad.length;k++){
if(Array.indexOf(_b1,_ad[k])==-1){
this._saveDesableSelect[i]={tag:_ad[k],visib:$telerik.getCurrentStyle(_ad[k],"visibility")};
_ad[k].style.visibility="hidden";
i++;
}
}
}
},_restoreTab:function(){
for(var i=0;i<this._saveTabIndexes.length;i++){
this._saveTabIndexes[i].tag.tabIndex=this._saveTabIndexes[i].index;
}
if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){
for(var k=0;k<this._saveDesableSelect.length;k++){
this._saveDesableSelect[k].tag.style.visibility=this._saveDesableSelect[k].visib;
}
}
}};
Telerik.Web.UI.ModalExtender.registerClass("Telerik.Web.UI.ModalExtender",null);
Type.registerNamespace("Telerik.Web");
Telerik.Web.PositioningMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5};
Telerik.Web.PositioningMode.registerEnum("Telerik.Web.PositioningMode");
Telerik.Web.PopupBehavior=function(_b4){
Telerik.Web.PopupBehavior.initializeBase(this,[_b4]);
this._x=0;
this._y=0;
this._positioningMode=Telerik.Web.PositioningMode.Absolute;
this._parentElement=null;
this._parentElementID=null;
this._moveHandler=null;
this._firstPopup=true;
this._originalParent=null;
this._overlay=false;
this._keepInScreenBounds=true;
this._manageVisibility=true;
};
Telerik.Web.PopupBehavior._ie6pinnedList={};
Telerik.Web.PopupBehavior.prototype={getPageOffset:function(){
var _b5={x:(document.documentElement.scrollLeft||document.body.scrollLeft),y:(document.documentElement.scrollTop||document.body.scrollTop)};
return _b5;
},pin:function(_b6){
var _b7=this.get_element();
var _b8=this.getPageOffset();
if($telerik.isIE6){
var id=this.get_id();
if(_b6){
if(Telerik.Web.PopupBehavior._ie6pinnedList[id]){
return;
}
var _ba=$telerik.getBounds(_b7);
Telerik.Web.PopupBehavior._ie6pinnedList[id]=window.setInterval(Function.createDelegate(this,function(){
var _bb=this.getPageOffset();
var x=_ba.x-_b8.x+_bb.x;
var y=_ba.y-_b8.y+_bb.y;
var _be=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(x);
this.set_y(y);
this.show();
this.set_parentElement(_be);
}),130);
}else{
var _bf=Telerik.Web.PopupBehavior._ie6pinnedList[id];
if(_bf){
window.clearInterval(_bf);
}
delete Telerik.Web.PopupBehavior._ie6pinnedList[id];
}
}else{
var _c0=_b6?"fixed":"absolute";
if(_b7.style.position==_c0){
return;
}
var _ba=$telerik.getBounds(_b7);
if(_b6&&(_b8.x||_b8.y)){
this._x=_ba.x-_b8.x;
this._y=_ba.y-_b8.y;
$telerik.setLocation(_b7,{x:this._x,y:this._y});
}
_b7.style.position=_c0;
}
},center:function(){
var _c1=this.get_element();
if(this._manageVisibility){
$telerik.setVisible(_c1,true);
}
var _c2=$telerik.getClientBounds();
var _c3=$telerik.getBounds(_c1);
var x=parseInt((_c2.width-_c3.width)/2);
var y=parseInt((_c2.height-_c3.height)/2);
var _c6=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(x);
this.set_y(y);
this.show();
this.set_parentElement(_c6);
},get_parentElement:function(){
if(!this._parentElement&&this._parentElementID){
this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement!=null,String.format("Couldn't find parent element \"{0}\"",this._parentElementID));
}
return this._parentElement;
},set_parentElement:function(_c7){
this._parentElement=_c7;
},get_parentElementID:function(){
if(this._parentElement){
return this._parentElement.id;
}
return this._parentElementID;
},set_parentElementID:function(_c8){
this._parentElementID=_c8;
if(this.get_isInitialized()){
this.set_parentElement($get(_c8));
}
},get_positioningMode:function(){
return this._positioningMode;
},set_positioningMode:function(_c9){
this._positioningMode=_c9;
},get_x:function(){
return this._x;
},set_x:function(_ca){
if(_ca!=this._x){
this._x=_ca;
if($telerik.getVisible(this.get_element())&&this._manageVisibility){
this.show();
}
}
},get_y:function(){
return this._y;
},set_y:function(_cb){
if(_cb!=this._y){
this._y=_cb;
if($telerik.getVisible(this.get_element())&&this._manageVisibility){
this.show();
}
}
},get_overlay:function(){
return this._overlay;
},set_overlay:function(_cc){
this._overlay=_cc;
this._attachWindowHandlers(false);
if(this._overlay){
this._attachWindowHandlers(true);
}else{
if(!((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7))){
var elt=this.get_element();
var _ce=elt._hideWindowedElementsIFrame;
if(_ce){
_ce.style.display="none";
}
}
}
},get_manageVisibility:function(){
return this._manageVisibility;
},set_manageVisibility:function(_cf){
this._manageVisibility=_cf;
},get_keepInScreenBounds:function(){
return this._keepInScreenBounds;
},set_keepInScreenBounds:function(_d0){
this._keepInScreenBounds=_d0;
},hide:function(){
var elt=this.get_element();
if(this._manageVisibility){
$telerik.setVisible(elt,false);
}
if(elt.originalWidth){
elt.style.width=elt.originalWidth+"px";
elt.originalWidth=null;
}
if(Sys.Browser.agent===Sys.Browser.InternetExplorer||this._overlay){
var _d2=elt._hideWindowedElementsIFrame;
if(_d2){
_d2.style.display="none";
}
}
},show:function(){
var elt=this.get_element();
if($telerik.isFirefox){
var doc=document.documentElement;
var _d5=$telerik.getCurrentStyle(doc,"overflow");
if("hidden"==_d5){
elt.style.left=doc.scrollLeft+"px";
elt.style.top=doc.scrollLeft+"px";
}
}
if(this._manageVisibility){
$telerik.setVisible(elt,true);
}
var _d6=elt.offsetParent||document.documentElement;
var _d7;
var _d8;
if(this._parentElement){
_d8=$telerik.getBounds(this._parentElement);
_d7={x:_d8.x,y:_d8.y};
}else{
_d8=$telerik.getBounds(_d6);
_d7={x:0,y:0};
}
var _d9=elt.offsetWidth-(elt.clientLeft?elt.clientLeft*2:0);
var _da=elt.offsetHeight-(elt.clientTop?elt.clientTop*2:0);
var _db;
switch(this._positioningMode){
case Telerik.Web.PositioningMode.Center:
_db={x:Math.round(_d8.width/2-_d9/2),y:Math.round(_d8.height/2-_da/2)};
break;
case Telerik.Web.PositioningMode.BottomLeft:
_db={x:0,y:_d8.height};
break;
case Telerik.Web.PositioningMode.BottomRight:
_db={x:_d8.width-_d9,y:_d8.height};
break;
case Telerik.Web.PositioningMode.TopLeft:
_db={x:0,y:-elt.offsetHeight};
break;
case Telerik.Web.PositioningMode.TopRight:
_db={x:_d8.width-_d9,y:-elt.offsetHeight};
break;
default:
_db={x:0,y:0};
}
_db.x+=this._x+_d7.x;
_db.y+=this._y+_d7.y;
$telerik.setLocation(elt,_db);
if(this._firstPopup){
elt.style.width=_d9+"px";
}
this._firstPopup=false;
var _dc=$telerik.getBounds(elt);
var _dd=this._getViewportBounds();
if(this._keepInScreenBounds){
var _de=false;
var _df=self.innerWidth?self.innerWidth:document.documentElement.clientWidth;
if(!_df){
_df=document.body.clientWidth;
}
if(_dc.x+_dc.width-_dd.scrollLeft>_df){
_db.x-=_dc.x+_dc.width-_df+_dd.scrollLeft;
_de=true;
}
if(_dc.x<0){
_db.x-=_dc.x;
_de=true;
}
if(_dc.y<0){
_db.y-=_dc.y;
_de=true;
}
if(_dd.height<_dc.y+_dc.height-_dd.scrollTop){
if(_dd.height-_dc.height>0){
_db.y=_dd.height-_dc.height+_dd.scrollTop;
_de=true;
}
}
if(_de){
$telerik.setLocation(elt,_db);
_dc=$telerik.getBounds(elt);
}
}
elt.zIndex=1000;
if(((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7))||this._overlay){
var _e0=elt._hideWindowedElementsIFrame;
if(!_e0){
_e0=document.createElement("iframe");
_e0.src="javascript:'<html></html>';";
_e0.style.position="absolute";
_e0.style.display="none";
_e0.scrolling="no";
_e0.frameBorder="0";
_e0.tabIndex="-1";
_e0.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
elt.parentNode.insertBefore(_e0,elt);
elt._hideWindowedElementsIFrame=_e0;
this._moveHandler=Function.createDelegate(this,this._onMove);
Sys.UI.DomEvent.addHandler(elt,"move",this._moveHandler);
}
$telerik.setBounds(_e0,_dc);
if(Sys.Browser.agent===Sys.Browser.Firefox){
_e0.style.top=parseInt(_dc.y)-_dd.scrollTop+"px";
_e0.style.left=parseInt(_dc.x)-_dd.scrollLeft+"px";
_e0.style.position="fixed";
}
if($telerik.quirksMode){
return;
}
_e0.style.display=elt.style.display;
if(elt.currentStyle&&elt.currentStyle.zIndex){
_e0.style.zIndex=elt.currentStyle.zIndex;
}else{
if(elt.style.zIndex){
_e0.style.zIndex=elt.style.zIndex;
}
}
}
},_getViewportBounds:function(){
var _e1=$telerik.getClientBounds();
var _e2=document.documentElement.scrollLeft||document.body.scrollLeft;
var _e3=document.documentElement.scrollTop||document.body.scrollTop;
_e1.scrollLeft=_e2;
_e1.scrollTop=_e3;
return _e1;
},_setCoordinates:function(x,y){
var _e6=false;
if(x!=this._x){
this._x=x;
_e6=true;
}
if(y!=this._y){
this._y=y;
_e6=true;
}
if($telerik.getVisible(this.get_element())&&_e6&&this._manageVisibility){
this.show();
}
},initialize:function(){
Telerik.Web.PopupBehavior.callBaseMethod(this,"initialize");
this.hide();
this.get_element().style.position="absolute";
},dispose:function(){
var elt=this.get_element();
if(elt){
if(this._moveHandler){
Sys.UI.DomEvent.removeHandler(elt,"move",this._moveHandler);
this._moveHandler=null;
}
this._attachWindowHandlers(false);
if($telerik.getVisible(elt)&&this._manageVisibility){
this.hide();
}
if(this._originalParent){
elt.parentNode.removeChild(elt);
this._originalParent.appendChild(elt);
this._originalParent=null;
}
}
this._parentElement=null;
Telerik.Web.PopupBehavior.callBaseMethod(this,"dispose");
},_onMove:function(){
var elt=this.get_element();
var _e9=elt._hideWindowedElementsIFrame;
if(_e9){
if(Sys.Browser.agent===Sys.Browser.Firefox){
var _ea=this._getViewportBounds();
_e9.style.top=parseInt(elt.style.top)-_ea.scrollTop+"px";
_e9.style.left=parseInt(elt.style.left)-_ea.scrollLeft+"px";
_e9.style.position="fixed";
}else{
_e9.style.top=elt.style.top;
_e9.style.left=elt.style.left;
}
}
},_handleElementResize:function(){
var elt=this.get_element();
var _ec=elt._hideWindowedElementsIFrame;
if(_ec){
var _ed=$telerik.getBounds(elt);
$telerik.setBounds(_ec,_ed);
}
},_attachWindowHandlers:function(_ee){
if(!Sys.Browser.agent===Sys.Browser.Firefox){
return;
}
var _ef=window;
if(true==_ee){
this._windowResizeDelegate=Function.createDelegate(this,this._onMove);
$addHandler(_ef,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._onMove);
$addHandler(_ef,"scroll",this._windowScrollDelegate);
}else{
if(this._windowResizeDelegate){
$removeHandler(_ef,"resize",this._windowResizeDelegate);
}
this._windowResizeDelegate=null;
if(this._windowScrollDelegate){
$removeHandler(_ef,"scroll",this._windowScrollDelegate);
}
this._windowScrollDelegate=null;
}
}};
Telerik.Web.PopupBehavior.registerClass("Telerik.Web.PopupBehavior",Telerik.Web.BehaviorBase);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ResizeExtender=function(_f0,_f1,_f2,_f3,doc){
this._document=doc?doc:document;
this._documentMouseMoveDelegate=null;
this._documentMouseUpDelegate=null;
this._element=null;
this._tableElement=null;
this._enabled=true;
this._jsOwner=null;
this._saveDelegates={};
this.makeResizable(_f0,_f1,_f2,_f3);
};
Telerik.Web.UI.ResizeExtender.prototype={dispose:function(){
this._attachDocumentHandlers(false);
this._configureHandleElements(false);
this._jsOwner=null;
},enable:function(_f5){
this._enabled=_f5;
},makeResizable:function(_f6,_f7,_f8,_f9){
if(!_f7){
return;
}
if(this._element){
alert("Element "+_f7.getAttribute("id")+" cannot be made resizable, as the resizeExtender already has the element "+this._element.getAttribute("id")+" associated with it. You must create a new extender resizer object");
return;
}
this._jsOwner=_f6;
this._element=_f7;
this._tableElement=_f9;
this._resizeHandles=_f8;
this._startX=0;
this._startY=0;
this._cancelResize=true;
this._configureHandleElements(true);
},_raiseDragEvent:function(_fa,ev){
if(this._jsOwner&&this._jsOwner["on"+_fa]){
return this._jsOwner["on"+_fa](ev);
}
return true;
},_raiseEvent:function(_fc,ev){
if(this._jsOwner&&this._jsOwner["on"+_fc]){
if(!ev){
ev=new Sys.EventArgs();
}else{
if(_fc=="Resize"){
ev=this._resizeDir;
}else{
if(_fc=="Resizing"){
ev=this._getProposedBounds(ev);
}
}
}
return this._jsOwner["on"+_fc](ev);
}
return true;
},_getProposedBounds:function(b1){
var b2=$telerik.getBounds(this._element);
return {x:b1.x||b2.x,y:b1.y||b2.y,width:b1.width||b2.width,height:b1.height||b2.height};
},_resize:function(e){
if(!this._enabled||this._cancelResize){
return false;
}
var _101=0;
var _102=0;
var _103=0;
var nTop=0;
var _105=this._originalBounds;
var _106=this._resizeDir.move;
if(_106){
_103=_105.x+(e.clientX-this._startX);
nTop=_105.y+(e.clientY-this._startY);
}else{
if(this._resizeDir.east){
_101=_105.width+(e.clientX-this._startX);
}else{
if(this._resizeDir.west){
_103=e.clientX;
_101=_105.width-(e.clientX-this._startX);
}
}
if(this._resizeDir.south){
_102=_105.height+(e.clientY-this._startY);
}else{
if(this._resizeDir.north){
nTop=e.clientY;
_102=_105.height-(e.clientY-this._startY);
}
}
}
if(this._offsetLocation){
_103-=this._offsetLocation.x;
nTop-=this._offsetLocation.y;
}
var _107=new Sys.UI.Bounds(_103,nTop,_101,_102);
var _108=_106?this._raiseDragEvent("Drag",_107):this._raiseEvent("Resizing",_107);
if(false==_108){
return true;
}
if(_106||_107.x>0){
this._element.style.left=_107.x+"px";
}
if(_106||_107.y>0){
this._element.style.top=_107.y+"px";
}
if(_107.width>0){
this._element.style.width=_107.width+"px";
}
if(_107.height>0){
this._element.style.height=_107.height+"px";
}
if(!_106){
this._updateInnerTableSize();
}
return true;
},_storeStartCoords:function(e){
if(!this._enabled){
return;
}
this._cancelResize=false;
this._startX=e.clientX;
this._startY=e.clientY;
var _10a=$telerik.getBounds(this._element);
this._originalBounds=_10a;
var _10b=("relative"==$telerik.getCurrentStyle(this._element.parentNode,"position"));
this._offsetLocation=(_10b?$telerik.getLocation(this._element.parentNode):null);
var _10c=e.target?e.target:e.srcElement;
if(_10c&&_10c.type==3){
_10c=_10c.parentNode;
}
this._resizeType=$telerik.getCurrentStyle(_10c,"cursor");
this._resizeDir={north:this._resizeType.match(/n.?-/)?1:0,east:this._resizeType.match(/e-/)?1:0,south:this._resizeType.match(/s.?-/)?1:0,west:this._resizeType.match(/w-/)?1:0,move:this._resizeType.match(/move/)?1:0};
if(this._resizeDir.move){
var _10d=this._raiseDragEvent("DragStart");
this._cancelResize=(_10d==false);
}else{
this._raiseEvent("ResizeStart");
}
if(!this._cancelResize){
this._clearSelection();
this._setIframesVisible(false);
this._attachDocumentHandlers(false);
this._attachDocumentHandlers(true);
}
},_updateInnerTableSize:function(){
var dir=this._resizeDir;
if(dir.south||dir.north){
var _10f=this._element.style.height;
var _110=this._tableElement;
if(_110){
_110.style.height=_10f;
this._fixIeHeight(_110,_10f);
}
}
},_setIframesVisible:function(_111){
var _112=this._document.getElementsByTagName("IFRAME");
for(var i=0;i<_112.length;i++){
_112[i].style.visibility=_111?"":"hidden";
}
},_configureHandleElements:function(_114){
var _115=["nw","n","ne","w","e","sw","s","se","move"];
for(var i=0;i<_115.length;i++){
var _117=_115[i];
var _118=this._resizeHandles[_117];
if(_118){
if(_118 instanceof Array){
for(var j=0;j<_118.length;j++){
this._configureHandle("id"+i+"_"+j,_114,_118[j],_117);
}
}else{
this._configureHandle("id"+i,_114,_118,_117);
}
}
}
if(!_114){
this._saveDelegates={};
}
},_configureHandle:function(_11a,_11b,_11c,_11d){
if(_11b){
var _11e=Function.createDelegate(this,this._onHandleMouseDown);
$telerik.addExternalHandler(_11c,"mousedown",_11e);
this._saveDelegates[_11a]={delegate:_11e,element:_11c};
var _11f=(_11d=="move"?"move":_11d+"-resize");
_11c.style.cursor=_11f;
}else{
$telerik.removeExternalHandler(_11c,"mousedown",this._saveDelegates[_11a].delegate);
_11c.style.cursor="";
}
},_attachDocumentHandlers:function(_120){
var _121=this._document;
if(true==_120){
this._documentMouseMoveDelegate=Function.createDelegate(this,this._onDocumentMouseMove);
$telerik.addExternalHandler(_121,"mousemove",this._documentMouseMoveDelegate);
this._documentMouseUpDelegate=Function.createDelegate(this,this._onDocumentMouseUp);
$telerik.addExternalHandler(_121,"mouseup",this._documentMouseUpDelegate);
}else{
if(this._documentMouseMoveDelegate){
$telerik.removeExternalHandler(_121,"mousemove",this._documentMouseMoveDelegate);
}
this._documentMouseMoveDelegate=null;
if(this._documentMouseUpDelegate){
$telerik.removeExternalHandler(_121,"mouseup",this._documentMouseUpDelegate);
}
this._documentMouseUpDelegate=null;
}
},_onDocumentMouseMove:function(e){
var _123=this._resize(e);
if(_123){
return $telerik.cancelRawEvent(e);
}
},_onDocumentMouseUp:function(e){
var _125=!this._cancelResize;
this._cancelResize=true;
if(_125){
this._clearSelection();
this._setIframesVisible(true);
if(this._resizeDir&&this._resizeDir.move){
this._raiseDragEvent("DragEnd");
}else{
this._raiseEvent("ResizeEnd");
}
this._attachDocumentHandlers(false);
}
},_onHandleMouseDown:function(e){
this._storeStartCoords(e);
return $telerik.cancelRawEvent(e);
},_clearSelection:function(){
if(this._document.selection&&this._document.selection.empty){
this._document.selection.empty();
}
},_fixIeHeight:function(_127,_128){
if("CSS1Compat"==document.compatMode){
var _129=(_127.offsetHeight-parseInt(_128));
if(_129>0){
var _12a=(parseInt(_127.style.height)-_129);
if(_12a>0){
_127.style.height=_12a+"px";
}
}
}
}};
Telerik.Web.UI.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender",null);


/* END Telerik.Web.UI.Common.Popup.PopupScripts.js */
/* START Telerik.Web.UI.Window.RadWindow.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadWindowControllerClass=function(){
this._activeWindow=null;
this._historyStack=[];
this._registerGlobalBodyEventHandlers();
};
Telerik.Web.UI.RadWindowControllerClass.prototype={getInstance:function(){
return this;
},_registerGlobalBodyEventHandlers:function(){
var _1=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.RadWindowController.hideCurrentWindowIfNonModal();
}
});
$addHandler(document.documentElement,"keydown",_1);
Sys.Application.add_unload(function(){
$removeHandler(document.documentElement,"keydown",_1);
});
},hideCurrentWindowIfNonModal:function(){
if(this._activeWindow!=null&&this._activeWindow.isModal&&!this._activeWindow.isModal()){
this._activeWindow.close();
}
this._activeWindow=null;
},inactivateCurrentWindow:function(){
if(this._activeWindow!=null){
this._activeWindow.setActive(false);
}
this._activeWindow=null;
},set_activeWindow:function(_3){
if(_3==this._activeWindow){
return;
}
this.inactivateCurrentWindow();
this._activeWindow=_3;
Array.remove(this._historyStack,_3);
Array.add(this._historyStack,_3);
},notifyWindowClosed:function(_4){
if(this._activeWindow==_4){
this._activeWindow=null;
}
Array.remove(this._historyStack,_4);
this._activatePreviousWindow();
},_activatePreviousWindow:function(){
var _5=this._historyStack;
var i=_5.length-1;
for(;i>=0;i--){
var _7=_5[i];
if(!_7){
return;
}
if(_7.isCreated()&&!_7.isClosed()&&!_7.isMinimized()){
_7.setActive(true);
break;
}else{
Array.removeAt(_5,i);
}
}
},get_activeWindow:function(){
return this._activeWindow;
}};
Telerik.Web.UI.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass",null);
if(!Telerik.Web.UI.RadWindowController){
Telerik.Web.UI.RadWindowController=new Telerik.Web.UI.RadWindowControllerClass();
}
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.RadWindowUtils");
Telerik.Web.UI.RadWindowUtils.Localization={"Close":"Close","Minimize":"Minimize","Maximize":"Maximize","Reload":"Reload","PinOn":"Pin on","PinOff":"Pin off","Restore":"Restore","OK":"OK","Cancel":"Cancel","Yes":"Yes","No":"No"};
Telerik.Web.UI.RadWindow=function(_8){
Telerik.Web.UI.RadWindow.initializeBase(this,[_8]);
this._eventNames=["resize","activate","dragStart","dragEnd","show","pageLoad","close","command"];
this._bodyElement=($telerik.standardsMode)?document.documentElement:document.body;
this._openerElement=null;
this._offsetElement=null;
this._popupElement=null;
this._tableElement=null;
this._contentElement=null;
this._contentCell=null;
this._titleElement=null;
this._titleCell=null;
this._titlebarElement=null;
this._statusCell=null;
this._statusMessageElement=null;
this._iframe=null;
this._buttonsElement=null;
this._buttonsArray=[];
this.isIE=($telerik.isIE);
this._openerElementID=null;
this._offsetElementID=null;
this._behaviors=Telerik.Web.UI.WindowBehaviors.Default;
this._initialBehaviors=Telerik.Web.UI.WindowBehaviors.None;
this._navigateUrl=null;
this._left="";
this._top="";
this._formID=null;
this._skin="Default";
this._title="";
this._width="300px";
this._height="300px";
this._minimizeZoneID=null;
this._restrictionZoneID="";
this._clientCallBackFunction=null;
this._reloadOnShow=false;
this._visibleOnPageLoad=false;
this._destroyOnClose=false;
this._visibleTitlebar=true;
this._visibleStatusbar=true;
this._showContentDuringLoad=true;
this._modal=false;
this._overlay=false;
this._keepInScreenBounds=false;
this._iconUrl=null;
this._minimizeIconUrl=null;
this._animation=Telerik.Web.UI.WindowAnimation.None;
this._windowAnimation=null;
this._onMouseDownDelegate=null;
this._onClickDelegate=null;
this._onTitlebarDblclickDelegate=null;
this._onTitlebarClickDelegate=null;
this._onWindowResizeDelegate=null;
this._onIframeLoadDelegate=null;
this._onChildPageUnloadDelegate=null;
this._onChildPageClickDelegate=null;
this._onModalShowHandler=null;
this._onModalCloseHandler=null;
this._loaded=false;
this._isCloned=false;
this._restoreRect=null;
this._popupBehavior=null;
this._popupVisible=false;
this._windowManager;
this.GetWindowManager=this.get_windowManager;
this.BrowserWindow=window;
this.GetContentFrame=this.get_contentFrame;
this.GetLeftPosition=function(){
this.getWindowBounds().x;
};
this.GetTopPosition=function(){
this.getWindowBounds().y;
};
this.GetTitlebar=function(){
return this._titleCell;
};
this.GetStatusbar=function(){
return this._statusCell;
};
this.SetOpenerElementId=this.set_openerElementID;
this.SetStatus=this.set_status;
this.GetStatus=this.get_status;
this.SetModal=this.set_modal;
this.SetWidth=this.set_width;
this.SetHeight=this.set_height;
this.GetWidth=this.get_width;
this.GetHeight=this.get_height;
this.SetOffsetElementId=this.set_offsetElementID;
this.SetTitle=this.set_title;
this.MoveTo=this.moveTo;
this.Center=this.center;
this.SetVisible=this.setVisible;
this.SetSize=this.setSize;
this.Show=this.show;
this.Hide=this.hide;
this.GetUrl=this.get_navigateUrl;
this.SetUrl=this.setUrl;
this.Reload=this.reload;
this.SetActive=this.setActive;
this.Minimize=this.minimize;
this.Restore=this.restore;
this.Maximize=this.maximize;
this.Close=this.close;
this.TogglePin=this.togglePin;
this.IsMaximized=this.isMaximized;
this.IsMinimized=this.isMinimized;
this.IsModal=this.isModal;
this.IsClosed=this.isClosed;
this.IsPinned=this.isPinned;
this.IsVisible=this.isVisible;
this.IsActive=this.isActive;
this.IsBehaviorEnabled=this.isBehaviorEnabled;
};
Telerik.Web.UI.RadWindow.prototype={_getLocalization:function(){
return Telerik.Web.UI.RadWindowUtils.Localization;
},_registerIframeLoadHandler:function(_9){
if(!this._iframe){
return;
}
if(_9){
this._onIframeLoadDelegate=Function.createDelegate(this,this._onIframeLoad);
$addHandler(this._iframe,"load",this._onIframeLoadDelegate);
}else{
if(this._onIframeLoadDelegate){
$removeHandler(this._iframe,"load",this._onIframeLoadDelegate);
this._onIframeLoadDelegate=null;
}
}
},_registerWindowResizeHandler:function(_a){
if(_a){
this._onWindowResizeDelegate=Function.createDelegate(this,this._maintainMaximizedSize);
$addHandler(window,"resize",this._onWindowResizeDelegate);
}else{
if(this._onWindowResizeDelegate){
$removeHandler(window,"resize",this._onWindowResizeDelegate);
this._onWindowResizeDelegate=null;
}
}
},_registerOpenerElementHandler:function(_b,_c){
if(!_b){
return;
}
if(true==_c){
this._onClickDelegate=Function.createDelegate(this,this._onClick);
$addHandler(_b,"click",this._onClickDelegate);
}else{
var _d=$removeHandler(_b,"click",this._onClickDelegate);
this._onClickDelegate=null;
}
},_registerTitlebarHandlers:function(_e){
var _f=this._titleCell;
if(_e){
this._onTitlebarDblclickDelegate=Function.createDelegate(this,function(){
if(this.isMinimized()||this.isMaximized()){
this.restore();
}else{
this.maximize();
}
});
this._onTitlebarClickDelegate=Function.createDelegate(this,function(){
this.setActive(true);
});
$addHandler(_f,"dblclick",this._onTitlebarDblclickDelegate);
$addHandler(_f,"click",this._onTitlebarClickDelegate);
}else{
if(this._titleCell){
if(this._onTitlebarDblclickDelegate){
$removeHandler(_f,"dblclick",this._onTitlebarDblclickDelegate);
this._onTitlebarDblclickDelegate=null;
}
if(this._onTitlebarClickDelegate){
$removeHandler(_f,"click",this._onTitlebarClickDelegate);
this._onTitlebarClickDelegate=null;
}
}
}
},_makeModal:function(_10){
if(this._onModalShowHandler){
this.remove_show(this._onModalShowHandler);
this._onModalShowHandler=null;
}
if(this._onModalCloseHandler){
this.remove_close(this._onModalCloseHandler);
this._onModalCloseHandler=null;
}
if(this._modalExtender){
this._modalExtender.dispose();
this._modalExtender=null;
}
if(!_10){
return;
}
if(typeof (Telerik.Web.UI.RadWindowManager)!="undefined"&&Telerik.Web.UI.RadWindowManager.isInstanceOfType(this)){
return;
}
this._onModalShowHandler=function(_11){
if(!_11._modalExtender){
_11._modalExtender=new Telerik.Web.UI.ModalExtender(_11._popupElement);
}
_11._modalExtender.show();
_11.center();
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler=function(_12){
window.setTimeout(function(){
if(_12._modalExtender){
_12._modalExtender.hide();
}
},10);
};
this.add_close(this._onModalCloseHandler);
},_enableMoveResize:function(_13){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_13){
return;
}
if(!this._popupElement){
return;
}
var _14=this._tableElement.rows;
var _15={};
if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)){
_15={nw:_14[0].cells[0],n:this._topResizer,ne:_14[0].cells[2],w:[_14[1].cells[0],_14[2].cells[0]],e:[_14[1].cells[2],_14[2].cells[2]],sw:_14[3].cells[0],s:_14[3].cells[1],se:[_14[3].cells[2],this._bottomResizer]};
}
if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Move)){
_15["move"]=this._titleCell;
}
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._popupElement,_15,this._tableElement);
},onResizeStart:function(){
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
},onResizing:function(_16){
if(!this._cachedDragZoneBounds){
return true;
}
return this._containsBounds(this._cachedDragZoneBounds,_16);
},onResizeEnd:function(){
this._cachedDragWindowBounds=null;
var _17=this._getCurrentBounds();
this.moveTo(_17.x,_17.y);
if(this._overlay&&$telerik.isFirefox){
this._popupBehavior._onMove();
}
this.raiseEvent("resize",new Sys.EventArgs());
},onDragStart:function(){
this.setActive(true);
if(this.isPinned()){
return false;
}
if(this.isMinimized()&&this.get_minimizeZoneID()){
return false;
}
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
this._cachedDragWindowBounds=$telerik.getBounds(this._popupElement);
this.raiseEvent("dragStart",new Sys.EventArgs());
return true;
},onDragEnd:function(_18){
this._cachedDragZoneBounds=null;
this._cachedDragWindowBounds=null;
if(this._overlay&&$telerik.isFirefox){
this._popupBehavior._onMove();
}
this.raiseEvent("dragEnd",new Sys.EventArgs());
this._storeBounds();
this.setActive(true);
},onDrag:function(_19){
if(!this._cachedDragZoneBounds){
return true;
}
var _1a=this._cachedDragWindowBounds;
var _1b=this._cachedDragZoneBounds;
_19.width=_1a.width;
_19.height=_1a.height;
var _1c=this._containsBounds(_1b,_19);
if(!_1c){
if(_19.x<=_1b.x){
_19.x=_1b.x;
}else{
if(_1b.x+_1b.width<=_19.x+_1a.width){
_19.x=_1b.x+_1b.width-_1a.width;
}
}
if(_19.y<=_1b.y){
_19.y=_1b.y;
}else{
if(_1b.y+_1b.height<=_19.y+_1a.height){
_19.y=_1b.y+_1b.height-_1a.height;
}
}
_1c=true;
}
return _1c;
},_isInBounds:function(_1d,_1e,_1f){
var _20=$telerik.containsPoint(_1e,_1d.x,_1d.y);
if(_20){
var x=_1d.x+_1f.width;
var y=_1d.y+_1f.height;
_20=$telerik.containsPoint(_1e,x,y);
}
return _20;
},initialize:function(){
Telerik.Web.UI.RadWindow.callBaseMethod(this,"initialize");
if(this._visibleOnPageLoad){
this.show();
}
this._registerWindowResizeHandler(true);
},dispose:function(){
var _23=this.get_windowManager();
if(_23){
if(_23.get_preserveClientState()){
_23.saveWindowState(this);
}
if(this._destroyOnClose){
_23.removeWindow(this);
}
}
if(this._windowAnimation){
this._windowAnimation.dispose();
}
if(this._popupBehavior){
this._popupBehavior.dispose();
this._popupBehavior=null;
}
this._enableMoveResize(false);
this._makeModal(false);
this._registerTitlebarHandlers(false);
this._registerWindowResizeHandler(false);
this._registerIframeLoadHandler(false);
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,false);
}
this.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
if(this._iframe){
this._iframe.src="javascript:'<html></html>';";
var _24=this._iframe;
_24.name="";
_24.removeAttribute("name");
_24.removeAttribute("NAME");
}
if(this._contentElement){
this._contentElement.innerHTML="";
}
Telerik.Web.UI.RadWindow.callBaseMethod(this,"dispose");
},hide:function(){
this._hide();
return true;
},clone:function(_25,_26){
if(!_25){
alert("Telerik.Web.UI.RadWindow.clone called without providing a name argument");
return;
}
var evs=(_26!=false)?this._getEventsParameter():null;
var _28=this._getPropertiesParameter();
var _29=document.createElement("SPAN");
_29.setAttribute("id",_25);
var wnd=$create(Telerik.Web.UI.RadWindow,_28,evs,null,_29);
wnd.set_name(_25);
wnd._isCloned=true;
return wnd;
},set_contentElement:function(_2b){
this._createUI();
if(this._iframe){
this._iframe.style.display="none";
}
if(_2b.parentNode&&_2b.parentNode.removeChild){
_2b.parentNode.removeChild(_2b);
}
this._contentCell.appendChild(_2b);
_2b.style.display="";
this._contentElement=_2b;
},get_contentElement:function(){
return this._contentElement;
},isCreated:function(){
return this._popupElement!=null;
},show:function(){
var _2c=this.isCreated();
this._createUI();
if(this._navigateUrl&&(!_2c||this._reloadOnShow)){
this.setUrl(this._navigateUrl);
}
if(!_2c&&(this._initialBehaviors!=Telerik.Web.UI.WindowBehaviors.None)){
this._show();
this._afterShow();
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Minimize)){
this.minimize();
}
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){
this.maximize();
}
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Pin)){
this.togglePin();
}
return;
}
if(this._animation==Telerik.Web.UI.WindowAnimation.None){
this._show();
this._afterShow();
}else{
this._playAnimation();
}
},_show:function(){
this.raiseEvent("beforeShow",new Sys.EventArgs());
if(this.get_offsetElementID()&&!this._offsetElement){
var _2d=$get(this.get_offsetElementID());
if(_2d){
this._offsetElement=_2d;
}
}
this._popupBehavior.set_parentElement(this._bodyElement);
if(this._offsetElement&&!this._offsetSet){
this._popupBehavior.set_parentElement(this._offsetElement);
this._offsetSet=true;
}
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
this._reSetWindowPosition();
this._popupBehavior.set_parentElement(this._bodyElement);
this._popupVisible=true;
},_hide:function(){
if(this._windowAnimation){
this._windowAnimation.stop();
}
if(this._windowAnimation){
this._windowAnimation.play(true);
}else{
this._afterHide();
}
},_afterHide:function(){
if(!this._popupBehavior){
return;
}
if(this.isMaximized()){
this._restoreBounds();
}
this._popupBehavior.hide(true);
this._popupVisible=false;
this._getWindowController().notifyWindowClosed(this);
this.raiseEvent("close",new Sys.EventArgs());
},_afterShow:function(){
this.setActive(true);
this._storeBounds();
this.raiseEvent("show",new Sys.EventArgs());
},_playAnimation:function(){
var _2e=function(){
var wnd=this.controller;
var _30=wnd._getCalculatedPopupBounds();
wnd._setPopupVisible(_30.x,_30.y);
var _31=$telerik.getBounds(wnd._popupElement);
wnd._popupBehavior.hide();
this.set_endBounds(_31);
};
if(!this._windowAnimation){
if(this._animation==Telerik.Web.UI.WindowAnimation.Fade){
this._windowAnimation=new Telerik.Web.UI.Animations.FadeAnimation(this,0.4,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=function(){
this.controller._show();
};
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.Slide){
this._windowAnimation=new Telerik.Web.UI.Animations.SlideAnimation(this,0.2,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2e;
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.FlyIn){
this._windowAnimation=new Telerik.Web.UI.Animations.FlyInAnimation(this,null,null,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2e;
}else{
if(this._animation==Telerik.Web.UI.WindowAnimation.Resize){
this._windowAnimation=new Telerik.Web.UI.Animations.ResizeAnimation(this,0.2,50,this._popupElement,null,this._openerElement);
this._windowAnimation.onShowStart=_2e;
}
}
}
}
}
if(this._windowAnimation){
this._windowAnimation.onShowEnd=function(){
this.controller._show();
this.controller._afterShow();
};
this._windowAnimation.onHideEnd=function(){
this.controller._afterHide();
};
this._windowAnimation.play();
}
},_onClick:function(e){
this.show();
return this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.returnValue=false;
e.cancelBubble=true;
e.preventDefault();
e.stopPropagation();
}
return false;
},_getWindowController:function(){
return Telerik.Web.UI.RadWindowController.getInstance();
},_getReloadOnShowUrl:function(_34){
var str="rwndrnd="+Math.random();
if(_34.indexOf("?")>-1){
str="&"+str;
}else{
str="?"+str;
}
_34+=str;
return _34;
},_getPropertiesParameter:function(){
if(!this._propertiesParameter){
var _36={};
for(var _37 in Telerik.Web.UI.RadWindow.prototype){
var _38=this[_37];
if(typeof (_38)=="function"&&_37.indexOf("get_")==0){
var _39=_37.substring(4);
if(null==this["set_"+_39]){
continue;
}
var _3a=_38.call(this);
if(null==_3a){
continue;
}
_36[_39]=_3a;
if(_39=="skin"){
break;
}
}
}
this._propertiesParameter=_36;
}
var _3b=this._cloneObject(this._propertiesParameter);
return _3b;
},_getEventsParameter:function(){
if(!this._eventsParameter){
var _3c={};
var _3d=this.get_events();
var _3e=this._eventNames;
for(var i=0;i<_3e.length;i++){
var _40=_3e[i];
var _41=_3d.getHandler(_40);
if(_41&&typeof (eval(_41))=="function"){
_3c[_40]=eval(_41);
}
}
this._eventsParameter=_3c;
}
return this._eventsParameter;
},_cloneObject:function(_42){
var _43={};
for(var _44 in _42){
_43[_44]=_42[_44];
}
return _43;
},getWindowBounds:function(){
return this._getCalculatedPopupBounds();
},toString:function(){
return "[RadWindow id="+this.get_id()+"]";
},center:function(){
var _45=this._getCentralBounds();
this.moveTo(_45.x,_45.y);
},moveTo:function(x,y){
x=parseInt(x);
y=parseInt(y);
this._createUI();
this._setPopupVisible(x,y);
this._storeBounds();
},setSize:function(_48,_49){
this._firstShow=false;
this.set_width(_48);
this.set_height(_49);
this._storeBounds();
},_maintainMaximizedSize:function(){
if(!this.isMaximized()){
return;
}
var _4a=this._popupElement;
if(!_4a){
return;
}
var _4b=this._getViewportBounds();
_4a.style.top=(_4b.scrollTop+_4b.y)+"px";
_4a.style.left=(_4b.scrollLeft+_4b.x)+"px";
_4a.style.width=_4b.width+"px";
_4a.style.height=_4b.height+"px";
var _4c=this._getRestrictionZoneBounds();
if(!_4c){
this._enablePageScrolling(false);
}
var _4d=this._tableElement;
_4b=this._getViewportBounds();
_4d.style.height=_4b.height+"px";
this._fixIeHeight(_4d,_4b.height);
},_enablePageScrolling:function(_4e){
if(_4e){
var _4f=this._documentOverflowX;
if(null!=_4f){
this._documentOverflowX=null;
document.documentElement.style.overflowX=_4f?_4f:"";
}
_4f=this._documentOverflowY;
if(null!=_4f){
this._documentOverflowY=null;
document.documentElement.style.overflowY=_4f?_4f:"";
}
_4f=this._bodyOverflowX;
if(null!=_4f){
this._bodyOverflowX=null;
document.body.style.overflowX=_4f?_4f:"";
}
_4f=this._bodyOverflowY;
if(null!=_4f){
this._bodyOverflowY=null;
document.body.style.overflowY=_4f?_4f:"";
}
}else{
if(!this._documentOverflowX){
this._documentOverflowX=$telerik.getCurrentStyle(document.documentElement,"overflowX");
}
if(!this._documentOverflowY){
this._documentOverflowY=$telerik.getCurrentStyle(document.documentElement,"overflowY");
}
if(!this._bodyOverflowX){
this._bodyOverflowX=$telerik.getCurrentStyle(document.body,"overflowX");
}
if(!this._bodyOverflowY){
this._bodyOverflowY=$telerik.getCurrentStyle(document.body,"overflowY");
}
document.body.style.overflow="hidden";
document.documentElement.style.overflow="hidden";
}
},_containsBounds:function(_50,_51){
if(!_50||!_51){
return false;
}
var _52=$telerik.containsPoint(_50,_51.x,_51.y);
if(_52){
var x=_51.x+_51.width;
var y=_51.y+_51.height;
_52=$telerik.containsPoint(_50,x,y);
}
return _52;
},_getRestrictionZoneBounds:function(){
var _55=null;
if(this.get_restrictionZoneID()){
var _56=$get(this.get_restrictionZoneID());
if(_56){
_55=$telerik.getBounds(_56);
_55.scrollLeft=0;
_55.scrollTop=0;
}
}
return _55;
},_storeBounds:function(){
if(!this.isCreated()){
return;
}
var _57=this._getCurrentBounds();
if(this.isMaximized()){
return false;
}
if(this.isMinimized()){
if(this._restoreRect){
_57.width=this._restoreRect.width;
_57.height=this._restoreRect.height;
}else{
_57.width=this.get_width();
_57.height=this.get_height();
}
}
this._restoreRect=_57;
},_restoreBounds:function(){
if(!this._restoreRect){
return;
}
var _58=this._restoreRect;
this.setSize(_58.width,_58.height);
this.moveTo(_58.x,_58.y);
},_getStoredBounds:function(){
if(this._restoreRect){
return this._restoreRect;
}
},_deleteStoredBounds:function(){
this._restoreRect=null;
},_getCurrentBounds:function(){
var _59=(this._popupElement.style.display=="none")?true:false;
this._popupElement.style.display="";
if(this._firstShow!=true){
this._updateWindowSize(this._height);
this._firstShow=true;
}
var _5a=$telerik.getBounds(this._popupElement);
if(_59){
this._popupElement.style.display="none";
}
var _5b=this._getRestrictionZoneBounds();
if(_5b){
_5a.x-=_5b.x;
_5a.y-=_5b.y;
}
return _5a;
},_getCentralBounds:function(){
var _5c=this._getCurrentBounds();
var _5d=this._getViewportBounds();
var x=parseInt((_5d.width-_5c.width)/2);
var y=parseInt((_5d.height-_5c.height)/2);
_5c.x=x+_5d.scrollLeft;
_5c.y=y+_5d.scrollTop;
return _5c;
},_getViewportBounds:function(){
var _60=this._getRestrictionZoneBounds();
if(_60){
return _60;
}
var _61=$telerik.getClientBounds();
var _62=document.documentElement.scrollLeft||document.body.scrollLeft;
var _63=document.documentElement.scrollTop||document.body.scrollTop;
_61.scrollLeft=_62;
_61.scrollTop=_63;
if(this.isIE){
if(_61.width==0){
_61.width=document.body.clientWidth;
}
if(_61.height==0){
_61.height=document.body.clientHeight;
}
}
return _61;
},_getCalculatedPopupBounds:function(){
var _64=this._getStoredBounds();
if(_64){
return _64;
}
var _65=this._getCurrentBounds();
var _66=this._offsetElement;
if(!this._top&&!this._left&&!_66){
_65=this._getCentralBounds();
}else{
if(_66){
_65.y=0;
_65.x=0;
}else{
var _67=this._getViewportBounds();
_65.x=_67.scrollLeft;
_65.y=_67.scrollTop;
}
var _68=this._left?this._left:0;
_65.x+=_68;
var top=this._top?this._top:0;
_65.y+=top;
}
return _65;
},_reSetWindowPosition:function(){
var _6a=this._getCalculatedPopupBounds();
this._setPopupVisible(_6a.x,_6a.y);
},_fixIeHeight:function(_6b,_6c){
if("CSS1Compat"==document.compatMode){
var _6d=(_6b.offsetHeight-parseInt(_6c));
if(_6d>0){
var _6e=(parseInt(_6b.style.height)-_6d);
if(_6e>0){
_6b.style.height=_6e+"px";
}
}
}
},_setPopupVisible:function(x,y){
var _71=this._getRestrictionZoneBounds();
if(_71){
x+=_71.x;
y+=_71.y;
}
this._popupBehavior._setCoordinates(x,y);
this._popupBehavior.show();
if(!this.get_width()){
this._popupElement.style.width="";
}
this._updateTitleWidth();
},_createDefaultTable:function(){
var _72=document.createElement("TABLE");
_72.align="left";
_72.cellSpacing=0;
_72.cellPadding=0;
_72.insertRow(-1);
return _72;
},_createUI:function(){
if(!this._popupElement){
var _73=this.get_id();
var _74="RadWindowWrapper_"+_73;
var _75=document.createElement("DIV");
_75.id=_74;
_75.className=this._getFullSkinName();
_75.style.width=this._width;
_75.style.height=this._height;
_75.setAttribute("unselectable","on");
this._popupElement=_75;
var _76=document.createElement("TABLE");
_76.cellSpacing=0;
_76.cellPadding=0;
this._tableElement=_76;
var _77=["corner topleft","titlebar","corner topright","corner bodyleft","windowcontent","corner bodyright","corner bodyleft","statusbar","corner bodyright","corner footerleft","footercenter","corner footerright"];
var _78=["titlerow","contentrow","statusbarrow","footerrow"];
var _79=0;
for(var i=0;i<4;i++){
var row=_76.insertRow(-1);
row.className=_78[i];
for(var j=1;j<=3;j++){
var _7d=row.insertCell(-1);
_7d.innerHTML="&nbsp;";
_7d.className=_77[_79];
_79++;
}
}
var _7e=_76.rows[0].cells[1];
_7e.innerHTML="";
this._titleCell=_7e;
var _7f=document.createElement("DIV");
_7f.className="topresize";
_7f.innerHTML="<!-- / -->";
this._topResizer=_7f;
this._titleCell.appendChild(this._topResizer);
var _80=this._createDefaultTable();
_80.className="titlebarcontrols";
this._titlebarElement=_80;
this._titleCell.appendChild(this._titlebarElement);
var _81=this._getTitleIcon();
var _82=this._titlebarElement.rows[0].insertCell(-1);
_82.appendChild(_81);
var _83=this._getTitleElement();
var _7e=this._titlebarElement.rows[0].insertCell(-1);
_7e.appendChild(_83);
this.set_title(this._title);
var _84=this._titlebarElement.rows[0].insertCell(-1);
_84.noWrap=true;
_84.style.whiteSpace="nowrap";
_84.appendChild(this._getTitleCommandButtonsHolder());
var _85=_76.rows[1].cells[1];
_85.vAlign="top";
_85.innerHTML="";
this._contentCell=_85;
var _86=this.get_name();
var _87=($telerik.isIE)?document.createElement("<iframe name='"+_86+"'>"):document.createElement("iframe");
_87.name=_86;
_87.src="javascript:'<html></html>';";
_87.style.width="100%";
_87.style.height="100%";
_87.style.border="0px";
_87.frameBorder="0";
this._iframe=_87;
this._contentCell.appendChild(this._iframe);
var _88=this._createDefaultTable();
_88.style.width="100%";
this._statusCell=_76.rows[2].cells[1];
this._statusCell.innerHTML="";
this._statusCell.appendChild(_88);
var _89=_88.rows[0].insertCell(-1);
_89.style.width="100%";
var _8a=this._getStatusMessageElement();
_89.appendChild(_8a);
var _8b=_88.rows[0].insertCell(-1);
_8b.style.width="15px";
var _8c=document.createElement("DIV");
_8b.appendChild(_8c);
this._bottomResizer=_8c;
this._createBackReference();
this._popupElement.appendChild(this._tableElement);
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
this._addWindowToDocument();
this.set_behaviors(this._behaviors);
this._registerTitlebarHandlers(true);
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
}
if(!this._popupBehavior){
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{"id":(new Date()-100)+"PopupBehavior","parentElement":null,"overlay":this._overlay,"keepInScreenBounds":this._keepInScreenBounds},null,null,this._popupElement);
}
},_getStatusMessageElement:function(){
if(null==this._statusMessageElement){
var el=document.createElement("INPUT");
el.readOnly="readonly";
el.setAttribute("unselectable","on");
this._statusMessageElement=el;
}
return this._statusMessageElement;
},_getTitleCommandButtonsHolder:function(){
if(null==this._buttonsElement){
var ul=document.createElement("UL");
ul.className="controlbuttons";
this._buttonsElement=ul;
}
return this._buttonsElement;
},_getTitleElement:function(){
if(!this._titleElement){
this._titleElement=document.createElement("EM");
this._titleElement.setAttribute("unselectable","on");
}
return this._titleElement;
},_getTitleIcon:function(){
if(null==this._titleIconElement){
var _8f=document.createElement("A");
this._titleIconElement=_8f;
_8f.className="windowicon";
if(this.get_iconUrl()){
_8f.style.background="transparent url("+this.get_iconUrl()+") no-repeat scroll 0px 0px";
}
}
return this._titleIconElement;
},_getTitleCommandButton:function(_90){
if(!_90||!this._buttonsArray){
return null;
}
_90=_90.toLowerCase()+"button";
var _91=this._buttonsArray.length;
for(var i=0;i<_91;i++){
var _93=this._buttonsArray[i];
if(_93&&Sys.UI.DomElement.containsCssClass(_93,_90)){
return _93;
}
}
return null;
},_updateTitleWidth:function(){
if(this._visibleTitlebar){
var _94=this._getTitleElement();
if(!_94){
return;
}
var _95=this._getTitleCommandButtonsHolder();
var _96=_95.offsetWidth;
if(_96>0){
var lis=_95.getElementsByTagName("LI");
if(lis[0]&&lis[0].offsetWidth>0){
_96=lis.length*lis[0].offsetWidth;
}
_95.style.width=_96+"px";
}
var _98=this._getTitleIcon();
var _99=_98.offsetWidth;
if(_99>0&&_98.parentNode.tagName=="TD"){
_98.parentNode.style.width=_99+"px";
}
}
},_addWindowToDocument:function(){
var _9a=document.getElementById(this._formID);
if(!_9a){
_9a=document.forms[0];
}
_9a.insertBefore(this._popupElement,_9a.firstChild);
},_invokeDialogCallBackFunction:function(_9b,_9c){
if(true!=_9c){
this.close();
}
var _9d=this.get_clientCallBackFunction();
if(_9d){
if("string"==typeof (_9d)){
_9d=eval(_9d);
}
if("function"==typeof (_9d)){
_9d(this,_9b);
}
}
},_createBackReference:function(){
var _9e=this;
if(!_9e.Argument){
_9e.Argument={};
}
var _9f=this._iframe;
try{
_9f.radWindow=_9e;
if(_9f.contentWindow!=null){
_9f.contentWindow.radWindow=_9e;
}
}
catch(e){
}
},_getFullSkinName:function(){
return "radwindow radwindow_"+this._skin+" normalwindow transparentwindow";
},_configureMinimizeButton:function(_a0){
var loc=this._getLocalization();
var _a2=(true==_a0)?loc["Restore"]:loc["Minimize"];
var _a3=(true==_a0)?this.restore:this.minimize;
this._registerTitlebarHandlersButton("Minimize",_a2,_a3);
},_configureMaximizeButton:function(_a4){
var loc=this._getLocalization();
var _a6=(true==_a4)?loc["Restore"]:loc["Maximize"];
var _a7=(true==_a4)?this.restore:this.maximize;
this._registerTitlebarHandlersButton("Maximize",_a6,_a7);
},_registerTitlebarHandlersButton:function(_a8,_a9,_aa){
var _ab=this._getTitleCommandButton(_a8);
if(_ab){
var loc=this._getLocalization();
_ab.setAttribute("title",_a9);
_ab.innerHTML=_a9;
$clearHandlers(_ab);
$addHandlers(_ab,{"click":_aa},this);
$addHandler(_ab,"dblclick",this._cancelEvent);
$addHandler(_ab,"mousedown",this._cancelEvent);
}
},isCloned:function(){
return this._isCloned;
},isBehaviorEnabled:function(_ad){
return _ad&this._behaviors?true:false;
},isInitialBehaviorEnabled:function(_ae){
return _ae&this._initialBehaviors?true:false;
},setVisible:function(_af){
if(this._popupBehavior){
if(_af){
this._popupBehavior.show();
}else{
this._popupBehavior.hide();
}
}
},isVisible:function(){
return this._popupVisible;
},isModal:function(){
return this._modal;
},isActive:function(){
return (this._popupElement&&!Sys.UI.DomElement.containsCssClass(this._popupElement,"inactivewindow"));
},isPinned:function(){
var _b0=this._getTitleCommandButton("Pin");
return (_b0&&Sys.UI.DomElement.containsCssClass(_b0,"on"));
},isClosed:function(){
return (!this.isVisible());
},isMinimized:function(){
return (this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"minimizedwindow"));
},isMaximized:function(){
return (this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"maximizedwindow"));
},setActive:function(_b1){
var _b2=this._popupElement;
if(!_b1){
Sys.UI.DomElement.addCssClass(_b2,"inactivewindow");
}else{
var _b3=parseInt(_b2.style.zIndex);
var _b4=Telerik.Web.UI.RadWindowUtils.get_newZindex(_b3);
_b2.style.zIndex=""+_b4;
this._getWindowController().set_activeWindow(this);
if(this.isActive()){
return;
}
$telerik.removeCssClasses(_b2,["inactivewindow"]);
this.raiseEvent("activate",new Sys.EventArgs());
}
},_moveToMinimizeZone:function(){
var _b5=$get(this.get_minimizeZoneID());
if(_b5){
if(this.isPinned()){
this._isPinned=true;
this.togglePin();
}
var _b6=this._popupElement;
if(_b6.parentNode!=_b5){
_b6.parentNode.removeChild(_b6);
_b5.appendChild(_b6);
this.setVisible(true);
_b6.style.position="static";
if(this.isIE){
_b6.style.display="inline";
}else{
_b6.style.cssFloat="left";
}
}
}
},_moveToDocument:function(){
var _b7=this._popupElement;
_b7.parentNode.removeChild(_b7);
_b7.style.position="absolute";
if(this.isIE){
_b7.style.display="";
}else{
_b7.style.cssFloat="";
}
this._addWindowToDocument();
if(this._isPinned){
this._isPinned=false;
this.togglePin();
}
},minimize:function(){
if(!this.isCreated()){
return;
}
var _b8=this.onCommand("Minimize");
if(!_b8){
return;
}
var _b9=this._popupElement;
$telerik.removeCssClasses(_b9,["normalwindow","maximizedwindow"]);
Sys.UI.DomElement.addCssClass(_b9,"minimizedwindow");
var _ba=_b9._hideWindowedElementsIFrame;
if(_ba){
Sys.UI.DomElement.addCssClass(_ba,"minimizedwindowoverlay_"+this._skin);
}
this._configureMinimizeButton(true);
this._enablePageScrolling(true);
if(this.get_minimizeZoneID()){
this._moveToMinimizeZone();
}
},restore:function(){
if(!this.isCreated()){
return;
}
var _bb=this.onCommand("Restore");
if(!_bb){
return;
}
this._configureMinimizeButton();
this._configureMaximizeButton();
if(this.isMinimized()&&this.get_minimizeZoneID()){
this._moveToDocument();
}
this._normalizeWindowRootCss();
this._enablePageScrolling(true);
this.setVisible(true);
this._restoreBounds();
this.setVisible(true);
this.setActive(true);
},maximize:function(){
if(!this.isCreated()){
return;
}
var _bc=this.onCommand("Maximize");
if(!_bc){
return;
}
if(!this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){
return;
}
this._storeBounds();
if(this.isMinimized()&&this.get_minimizeZoneID()){
this._moveToDocument();
}
var _bd=this._popupElement;
$telerik.removeCssClasses(_bd,["normalwindow","minimizedwindow"]);
Sys.UI.DomElement.addCssClass(_bd,"maximizedwindow");
this._configureMaximizeButton(true);
this._configureMinimizeButton();
this._maintainMaximizedSize();
this._maintainMaximizedSize();
var _be=_bd._hideWindowedElementsIFrame;
if(_be){
$telerik.removeCssClasses(_be,["minimizedwindowoverlay_"+this._skin]);
this._popupBehavior._handleElementResize();
}
if(!this.isActive()){
this.setActive(true);
}
},togglePin:function(){
if(!this.isCreated()){
return;
}
var _bf=this.onCommand("Pin");
if(!_bf){
return;
}
var _c0=this._getTitleCommandButton("Pin");
var loc=this._getLocalization();
var _c2=this.isPinned();
var _c3=_c2?loc["PinOn"]:loc["PinOff"];
if(_c0){
Sys.UI.DomElement.toggleCssClass(_c0,"on");
}
this._registerTitlebarHandlersButton("Pin",_c3,this.togglePin);
Telerik.Web.UI.RadWindowUtils.setPinned(!_c2,this);
},reload:function(){
if(!this.isCreated()){
return;
}
var _c4=this.onCommand("Reload");
if(!_c4){
return;
}
if(!this._iframe){
return;
}
this._onWindowUrlChanging();
try{
this._iframe.contentWindow.location.reload();
}
catch(e){
this._onWindowUrlChanged();
}
},_normalizeWindowRootCss:function(){
var _c5=this._popupElement;
if(_c5){
$telerik.removeCssClasses(_c5,["minimizedwindow","maximizedwindow"]);
Sys.UI.DomElement.addCssClass(_c5,"normalwindow");
var _c6=_c5._hideWindowedElementsIFrame;
if(_c6){
$telerik.removeCssClasses(_c6,["minimizedwindowoverlay_"+this._skin]);
}
}
},close:function(_c7){
if(this.isClosed()){
return;
}
this.hide();
this._enablePageScrolling(true);
this._normalizeWindowRootCss();
if(null!=_c7&&!(_c7 instanceof Sys.UI.DomEvent)){
this._invokeDialogCallBackFunction(_c7);
}
if(this._destroyOnClose){
this.dispose();
}
},onCommand:function(_c8){
var _c9=new Sys.CancelEventArgs();
_c9._commandName=_c8;
_c9.get_commandName=function(){
return this._commandName;
};
this.raise_command(_c9);
if(_c9.get_cancel()){
return false;
}
return true;
},setUrl:function(url){
this._createUI();
this._navigateUrl=url;
var _cb=url;
if(this._reloadOnShow){
_cb=this._getReloadOnShowUrl(_cb);
}
this._iframe.src=_cb;
this._onWindowUrlChanging();
if(!this._loaded){
this._registerIframeLoadHandler(true);
}
this._loaded=true;
},_registerChildPageHandlers:function(_cc){
var _cd=null;
try{
_cd=this._iframe.contentWindow.document;
if(_cd.domain!=document.domain){
return;
}
}
catch(e){
return;
}
if(null==_cd){
return;
}
if(_cc){
this._onChildPageUnloadDelegate=Function.createDelegate(this,this._onChildPageUnload);
if(this.isIE){
_cd.onunload=this._onChildPageUnloadDelegate;
}else{
this._iframe.contentWindow.onunload=this._onChildPageUnloadDelegate;
}
this._onChildPageClickDelegate=Function.createDelegate(this,this._onChildPageClick);
$telerik.addExternalHandler(_cd,"click",this._onChildPageClickDelegate);
}else{
if(this._onChildPageClickDelegate){
$telerik.removeExternalHandler(_cd,"click",this._onChildPageClickDelegate);
this._onChildPageClickDelegate=null;
}
}
},_onChildPageUnload:function(e){
this._registerChildPageHandlers(false);
},_onChildPageClick:function(e){
if(!this.isVisible()||this.isClosed()){
return;
}
var src=e.target?e.target:e.srcElement;
if(src){
if(src.tagName=="INPUT"&&src.type=="button"){
return;
}else{
if(src.tagName=="BUTTON"||src.tagName=="A"){
return;
}
}
}
this.setActive(true);
},_onIframeLoad:function(){
this._onWindowUrlChanged();
this._registerChildPageHandlers(true);
this.raiseEvent("pageLoad",new Sys.EventArgs());
},_onWindowUrlChanging:function(){
var _d1=this._getStatusMessageElement();
if(_d1){
Sys.UI.DomElement.addCssClass(_d1,"loading");
}
if(!this._showContentDuringLoad){
this._iframe.style.width="0px";
this._iframe.style.height="0px";
}
},_onWindowUrlChanged:function(){
var _d2=this._getStatusMessageElement();
if(_d2){
Sys.UI.DomElement.removeCssClass(_d2,"loading");
this.set_status(this._navigateUrl);
}
if(!this._showContentDuringLoad){
this._iframe.style.width="100%";
this._iframe.style.height="100%";
}
try{
if(this._iframe.contentWindow.document.title){
this.set_title(this._iframe.contentWindow.document.title);
}
}
catch(e){
}
},_updatePopupZindex:function(){
if(this._popupBehavior){
if(this.isVisible()){
this._popupBehavior.show();
}
}
},get_zindex:function(){
if(this._popupElement){
return this._popupElement.style.zIndex;
}else{
return -1;
}
},get_contentFrame:function(){
return this._iframe;
},get_minimizeZoneID:function(){
return this._minimizeZoneID;
},set_minimizeZoneID:function(_d3){
if(this._minimizeZoneID!=_d3){
this._minimizeZoneID=_d3;
}
},get_restrictionZoneID:function(){
return this._restrictionZoneID;
},set_restrictionZoneID:function(_d4){
if(this._restrictionZoneID!=_d4){
this._restrictionZoneID=_d4;
}
},get_minimizeIconUrl:function(){
return this._minimizeIconUrl;
},set_minimizeIconUrl:function(_d5){
if(this._minimizeIconUrl!=_d5){
this._minimizeIconUrl=_d5;
}
},get_iconUrl:function(){
return this._iconUrl;
},set_iconUrl:function(_d6){
if(this._iconUrl!=_d6){
this._iconUrl=_d6;
}
},get_clientCallBackFunction:function(){
return this._clientCallBackFunction;
},set_clientCallBackFunction:function(_d7){
if(this._clientCallBackFunction!=_d7){
this._clientCallBackFunction=_d7;
}
},get_navigateUrl:function(){
return this._navigateUrl;
},set_navigateUrl:function(_d8){
if(this._navigateUrl!=_d8){
this._navigateUrl=_d8;
}
},get_targetControl:function(){
return this._openerElement;
},set_targetControl:function(_d9){
if(this._openerElement!=_d9){
this._openerElement=_d9;
}
},get_name:function(){
return this._name;
},set_name:function(_da){
if(this._name!=_da){
this._name=_da;
}
},get_formID:function(){
return this._formID;
},set_formID:function(_db){
if(this._formID!=_db){
this._formID=_db;
}
},get_offsetElementID:function(){
return this._offsetElementID;
},set_offsetElementID:function(_dc){
if(this._offsetElementID!=_dc){
this._offsetElementID=_dc;
}
if(this.isVisible()){
this._deleteStoredBounds();
this._offsetSet=false;
this._show();
}
},get_openerElementID:function(){
return this._openerElementID;
},set_openerElementID:function(_dd){
if(this._openerElementID!=_dd){
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,false);
this._openerElement=null;
}
this._openerElementID=_dd;
if(this._openerElementID){
this._openerElement=$get(this._openerElementID);
}
if(this._openerElement){
this._registerOpenerElementHandler(this._openerElement,true);
}
}
},get_left:function(){
return this._left;
},set_left:function(_de){
if(this._left!=_de){
this._left=parseInt(_de);
}
},get_top:function(){
return this._top;
},set_top:function(_df){
if(this._top!=_df){
this._top=parseInt(_df);
}
},get_title:function(){
return this._title;
},set_title:function(_e0){
if(this._title!=_e0){
this._title=_e0;
}
if(null==this._titleElement){
return;
}
this._titleElement.innerHTML=this._title;
this._updateTitleWidth();
},get_width:function(){
return parseInt(this._width);
},_fixSizeValue:function(_e1){
_e1=""+_e1;
if(-1==_e1.indexOf("px")){
_e1=parseInt(_e1);
if(!isNaN(_e1)){
_e1=_e1+"px";
}else{
_e1="";
}
}
return _e1;
},set_width:function(_e2){
if(null==_e2){
return;
}
_e2=this._fixSizeValue(_e2);
if(this._width!=_e2){
this._width=_e2;
}
if(this._popupElement){
this._deleteStoredBounds();
this._popupElement.style.width=this._width;
this._updatePopupZindex();
}
},get_height:function(){
return parseInt(this._height);
},set_height:function(_e3){
if(null==_e3){
return;
}
_e3=this._fixSizeValue(_e3);
if(this._height!=_e3){
this._height=_e3;
}
if(this._popupElement){
this._deleteStoredBounds();
this._updateWindowSize(this._height);
this._updatePopupZindex();
}
},_updateWindowSize:function(_e4,_e5){
var _e6=this._tableElement;
var _e7=_e4?_e4:_e6.style.height;
if(true==_e5){
_e7=_e6.offsetHeight+"px";
}
if(parseInt(_e7)==0){
return;
}
_e6.style.height=_e7;
this._fixIeHeight(_e6,_e7);
_e6.parentNode.style.height=_e7;
},get_initialBehaviors:function(){
return this._initialBehaviors;
},set_initialBehaviors:function(_e8){
if(this._initialBehaviors!=_e8){
this._initialBehaviors=_e8;
}
},get_behaviors:function(){
return this._behaviors;
},set_behaviors:function(_e9){
if(this._behaviors!=_e9){
this._behaviors=_e9;
}
if(null==this._titlebarElement){
return;
}
this._enableMoveResize(false);
this._enableMoveResize(true);
if(this._buttonsArray&&this._buttonsArray.length>0){
var len=this._buttonsArray.length;
for(var i=0;i<len;i++){
var _ec=this._buttonsArray[i];
$clearHandlers(_ec);
}
this._buttonsArray=[];
var _ed=this._getTitleCommandButtonsHolder();
_ed.innerHTML="";
}
if(Telerik.Web.UI.WindowBehaviors.None==this._behaviors){
return;
}else{
var loc=this._getLocalization();
var _ef=Telerik.Web.UI.WindowBehaviors;
var _f0=[[this.isBehaviorEnabled(_ef.Pin),"pinbutton",loc["PinOn"],this.togglePin],[this.isBehaviorEnabled(_ef.Reload),"reloadbutton",loc["Reload"],this.reload],[this.isBehaviorEnabled(_ef.Minimize),"minimizebutton",loc["Minimize"],this.minimize],[this.isBehaviorEnabled(_ef.Maximize),"maximizebutton",loc["Maximize"],this.maximize],[this.isBehaviorEnabled(_ef.Close),"closebutton",loc["Close"],this.close]];
for(var i=0;i<_f0.length;i++){
var _f1=_f0[i];
if(!_f1[0]){
continue;
}
var li=document.createElement("LI");
var _f3=document.createElement("A");
_f3.href="javascript:void(0);";
_f3.className=_f1[1];
_f3.setAttribute("title",_f1[2]);
var _f4=document.createElement("SPAN");
_f4.innerHTML=_f1[2];
_f3.appendChild(_f4);
$addHandlers(_f3,{"click":_f1[3],"dblclick":this._cancelEvent,"mousedown":this._cancelEvent},this);
$addHandler(_f3,"click",this._cancelEvent);
li.appendChild(_f3);
this._buttonsElement.appendChild(li);
this._buttonsArray[this._buttonsArray.length]=_f3;
}
}
},get_modal:function(){
return this._modal;
},set_modal:function(_f5){
if(this._modal!=_f5){
this._modal=_f5;
}
this._makeModal(this._modal);
if(this.isVisible()){
this._afterShow();
}
},get_destroyOnClose:function(){
return this._destroyOnClose;
},set_destroyOnClose:function(_f6){
if(this._destroyOnClose!=_f6){
this._destroyOnClose=_f6;
}
},get_reloadOnShow:function(){
return this._reloadOnShow;
},set_reloadOnShow:function(_f7){
if(this._reloadOnShow!=_f7){
this._reloadOnShow=_f7;
}
},get_showContentDuringLoad:function(){
return this._showContentDuringLoad;
},set_showContentDuringLoad:function(_f8){
if(this._showContentDuringLoad!=_f8){
this._showContentDuringLoad=_f8;
}
},get_visibleOnPageLoad:function(){
return this._visibleOnPageLoad;
},set_visibleOnPageLoad:function(_f9){
if(this._visibleOnPageLoad!=_f9){
this._visibleOnPageLoad=_f9;
}
},get_visibleTitlebar:function(){
return this._visibleTitlebar;
},set_visibleTitlebar:function(_fa){
if(this._visibleTitlebar!=_fa){
this._visibleTitlebar=_fa;
}
if(this._titlebarElement){
this._titlebarElement.style.display=_fa?"":"none";
}
},get_visibleStatusbar:function(){
return this._visibleStatusbar;
},set_visibleStatusbar:function(_fb){
if(this._visibleStatusbar!=_fb){
this._visibleStatusbar=_fb;
}
if(this._statusCell){
this._statusCell.parentNode.style.display=_fb?"":"none";
}
},get_animation:function(){
return this._animation;
},set_animation:function(_fc){
if(this._animation!=_fc){
this._animation=_fc;
}
},get_overlay:function(){
return this._overlay;
},set_overlay:function(_fd){
this._overlay=_fd;
if(this._popupBehavior){
this._popupBehavior.set_overlay(this._overlay);
}
if(this.isVisible()){
this._reSetWindowPosition();
}
},get_keepInScreenBounds:function(){
return this._keepInScreenBounds;
},set_keepInScreenBounds:function(_fe){
this._keepInScreenBounds=_fe;
if(this._popupBehavior){
this._popupBehavior.set_keepInScreenBounds(this._keepInScreenBounds);
}
if(this.isVisible()){
this._reSetWindowPosition();
}
},get_skin:function(){
return this._skin;
},set_skin:function(_ff){
if(_ff&&this._skin!=_ff){
this._skin=_ff;
}
},get_popupElement:function(){
return this._popupElement;
},get_windowManager:function(){
return this._windowManager;
},set_windowManager:function(_100){
this._windowManager=_100;
},set_status:function(_101){
var _102=this._getStatusMessageElement();
if(_102){
window.setTimeout(function(){
_102.value=_101;
},0);
}
},get_status:function(){
var _103=this._getStatusMessageElement();
if(_103){
return _103.value;
}
},add_command:function(_104){
this.get_events().addHandler("command",_104);
},remove_command:function(_105){
this.get_events().removeHandler("command",_105);
},raise_command:function(args){
this.raiseEvent("command",args);
},add_dragStart:function(_107){
this.get_events().addHandler("dragStart",_107);
},remove_dragStart:function(_108){
this.get_events().removeHandler("dragStart",_108);
},add_dragEnd:function(_109){
this.get_events().addHandler("dragEnd",_109);
},remove_dragEnd:function(_10a){
this.get_events().removeHandler("dragEnd",_10a);
},add_activate:function(_10b){
this.get_events().addHandler("activate",_10b);
},remove_activate:function(_10c){
this.get_events().removeHandler("activate",_10c);
},add_beforeShow:function(_10d){
this.get_events().addHandler("beforeShow",_10d);
},remove_beforeShow:function(_10e){
this.get_events().removeHandler("beforeShow",_10e);
},add_show:function(_10f){
this.get_events().addHandler("show",_10f);
},remove_show:function(_110){
this.get_events().removeHandler("show",_110);
},add_pageLoad:function(_111){
this.get_events().addHandler("pageLoad",_111);
},remove_pageLoad:function(_112){
this.get_events().removeHandler("pageLoad",_112);
},add_close:function(_113){
this.get_events().addHandler("close",_113);
},remove_close:function(_114){
this.get_events().removeHandler("close",_114);
},add_resize:function(_115){
this.get_events().addHandler("resize",_115);
},remove_resize:function(_116){
this.get_events().removeHandler("resize",_116);
},saveClientState:function(){
var _117=["position"];
var _118={};
for(var i=0;i<_117.length;i++){
_118[_117[i]]=this["get_"+_117[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_118);
}};
Telerik.Web.UI.RadWindow.registerClass("Telerik.Web.UI.RadWindow",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.WindowAnimation=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowAnimation.prototype={None:0,Resize:1,Fade:2,Slide:4,FlyIn:8};
Telerik.Web.UI.WindowAnimation.registerEnum("Telerik.Web.UI.WindowAnimation",false);
Telerik.Web.UI.WindowMinimizeMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowMinimizeMode.prototype={SameLocation:1,MinimizeZone:2,Default:1};
Telerik.Web.UI.WindowMinimizeMode.registerEnum("Telerik.Web.UI.WindowMinimizeMode",false);
Telerik.Web.UI.WindowBehaviors=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.WindowBehaviors.prototype={None:0,Resize:1,Minimize:2,Close:4,Pin:8,Maximize:16,Move:32,Reload:64,Default:(1+2+4+8+16+32+64)};
Telerik.Web.UI.WindowBehaviors.registerEnum("Telerik.Web.UI.WindowBehaviors",false);
Telerik.Web.UI.RadWindowUtils._zIndex=3000;
Telerik.Web.UI.RadWindowUtils.get_newZindex=function(_11a){
_11a=parseInt(_11a);
if(null==_11a||isNaN(_11a)){
_11a=0;
}
if(Telerik.Web.UI.RadWindowUtils._zIndex<_11a){
Telerik.Web.UI.RadWindowUtils._zIndex=_11a;
}
Telerik.Web.UI.RadWindowUtils._zIndex++;
return Telerik.Web.UI.RadWindowUtils._zIndex;
};
Telerik.Web.UI.RadWindowUtils._pinnedList={};
Telerik.Web.UI.RadWindowUtils.setPinned=function(_11b,oWnd){
if(_11b){
var _11d=oWnd._getViewportBounds();
var _11e=oWnd._getCurrentBounds();
oWnd.LeftOffset=_11e.x-_11d.scrollLeft;
oWnd.TopOffset=_11e.y-_11d.scrollTop;
var _11f=window.setInterval(function(){
Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition(oWnd);
},100);
Telerik.Web.UI.RadWindowUtils._pinnedList[_11f]=oWnd;
}else{
var _120=null;
var _121=Telerik.Web.UI.RadWindowUtils._pinnedList;
for(var name in _121){
if(_121[name]==oWnd){
_120=name;
break;
}
}
if(null!=_120){
window.clearInterval(_120);
Telerik.Web.UI.RadWindowUtils._pinnedList[_120]=null;
}
oWnd.TopOffset=null;
oWnd.LeftOffset=null;
}
};
Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition=function(oWnd){
if(oWnd.isMaximized()||!oWnd.isVisible()){
return;
}
var _124=oWnd._getViewportBounds();
var _125=oWnd._getCurrentBounds();
var left=(oWnd.LeftOffset!=null)?oWnd.LeftOffset+_124.scrollLeft:_125.x;
var top=(oWnd.TopOffset!=null)?oWnd.TopOffset+_124.scrollTop:_125.y;
oWnd.moveTo(left,top);
};


/* END Telerik.Web.UI.Window.RadWindow.js */
/* START Telerik.Web.UI.Window.RadWindowManager.js */
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.WindowManager");
function GetRadWindowManager(){
return Telerik.Web.UI.WindowManager.Manager;
}
window.radalert=function(_1,_2,_3,_4){
var _5=GetRadWindowManager();
var _6=_5._getStandardPopup("alert",_1);
if(typeof (_4)!="undefined"){
_6.set_title(_4);
}
_6.setSize(_2?_2:280,_3?_3:200);
_6.show();
_6.center();
return _6;
};
window.radconfirm=function(_7,_8,_9,_a,_b,_c){
var _d=GetRadWindowManager();
var _e=_d._getStandardPopup("confirm",_7);
if(typeof (_c)!="undefined"){
_e.set_title(_c);
}
_e.setSize(_9?_9:280,_a?_a:200);
_e.callBack=function(_f){
if(_8){
_8(_f);
}
_e.close();
_e.callBack=null;
};
_e.show();
_e.center();
return _e;
};
window.radprompt=function(_10,_11,_12,_13,_14,_15,_16){
var _17=GetRadWindowManager();
var _18=_17._getStandardPopup("prompt",_10,_16);
if(typeof (_15)!="undefined"){
_18.set_title(_15);
}
_18.setSize(_12?_12:280,_13?_13:200);
_18.callBack=function(_19){
if(_11){
_11(_19);
}
_18.close();
_18.callBack=null;
};
_18.show();
_18.center();
return _18;
};
window.radopen=function(url,_1b){
var _1c=GetRadWindowManager();
return _1c.open(url,_1b);
};
Telerik.Web.UI.RadWindowManager=function(_1d){
Telerik.Web.UI.RadWindowManager.initializeBase(this,[_1d]);
this._windowIDs=[];
this._windows=[];
this._preserveClientState=false;
this.Open=this.open;
this.GetWindowByName=this.getWindowByName;
this.GetWindowById=this.getWindowById;
this.GetActiveWindow=this.getActiveWindow;
this.GetWindowObjects=this.get_windows;
this.GetWindows=this.get_windows;
this.Cascade=this.cascade;
this.Tile=this.tile;
this.RestoreAll=this.restoreAll;
this.MaximizeAll=this.maximizeAll;
this.MinimizeAll=this.minimizeAll;
this.ShowAll=this.showAll;
this.CloseAll=this.closeAll;
this.CloseActiveWindow=this.closeActiveWindow;
this.MinimizeActiveWindow=this.minimizeActiveWindow;
this.RestoreActiveWindow=this.restoreActiveWindow;
};
Telerik.Web.UI.RadWindowManager.prototype={get_zIndex:function(){
return Telerik.Web.UI.RadWindowUtils._zIndex;
},set_zIndex:function(_1e){
var _1f=parseInt(_1e);
if(isNaN(_1e)){
return;
}
Telerik.Web.UI.RadWindowUtils._zIndex=_1e;
},initialize:function(_20){
try{
var _21=this.get_element().style.zIndex;
if(_21){
this.set_zIndex(_21);
}
}
catch(e){
}
this._initialize();
this._registerAsPageManager();
if(this.get_preserveClientState()){
this.restoreState();
}
},dispose:function(){
var _22=this.get_preserveClientState();
if(_22){
this.saveState();
}
this._disposeWindows();
this._windows=null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this,"dispose");
},open:function(url,_24){
var _25=this.getWindowByName(_24);
if(!_25){
if(!_24){
_24=this.get_id()+this._getUniqueId();
}
_25=this._createWindow(_24);
}
if(url){
_25.setUrl(url);
}
_25.show();
return _25;
},getActiveWindow:function(){
return Telerik.Web.UI.RadWindowController.get_activeWindow();
},getWindowById:function(id){
var _27=this.get_windows();
for(var i=0;i<_27.length;i++){
var _29=_27[i];
if(id==_29.get_id()){
return _29;
}
}
return null;
},getWindowByName:function(_2a){
var _2b=this.get_windows();
if(!_2b){
return null;
}
for(var i=0;i<_2b.length;i++){
var _2d=_2b[i];
if(_2a==_2d.get_name()){
return _2d;
}
}
return null;
},removeWindow:function(_2e){
if(!_2e){
return;
}
var w=this.getWindowByName(_2e.get_name());
var _30=this.get_windows();
if(w){
Array.remove(_30,w);
}
},_getUniqueId:function(){
return ""+(new Date()-100);
},_initialize:function(){
var _31=this._windowIDs;
for(var i=0;i<_31.length;i++){
var _33=_31[i];
var _34=$find(_33);
if(!_34){
continue;
}
_34.set_windowManager(this);
this._windows[this._windows.length]=_34;
}
},_disposeWindows:function(){
for(var i=0;i<this._windows.length;i++){
var t=this._windows[i];
if(t.isCloned()){
t.dispose();
}
}
this._windows=[];
},_createWindow:function(_37,_38){
var wnd=this.clone(_37,_38);
this._windows[this._windows.length]=wnd;
wnd.set_windowManager(this);
return wnd;
},_replaceLocalization:function(_3a,_3b){
var _3c=/##LOC\[(.*?)\]##/;
while(_3a.match(_3c)){
var _3d=_3b[RegExp.$1]?_3b[RegExp.$1]:"";
_3a=_3a.replace(_3c,_3d);
}
return _3a;
},_getStandardPopup:function(_3e,_3f,_40){
var _41=this._createWindow(_3e+this._getUniqueId(),false);
_41.set_destroyOnClose(true);
_41.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_3e.toLowerCase()+"template");
var _43=this._stringFormat(div.innerHTML,_41.get_id(),_3f,_40?_40:"");
_43=this._replaceLocalization(_43,Telerik.Web.UI.RadWindowUtils.Localization);
var _44=document.createElement("DIV");
_44.innerHTML=_43;
_41.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_41.set_visibleStatusbar(false);
_41.set_contentElement(_44);
return _41;
},_stringFormat:function(_45){
for(var i=1;i<arguments.length;i++){
_45=_45.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _45;
},_registerAsPageManager:function(){
var _47=Telerik.Web.UI.WindowManager.Manager;
var _48=this.get_id();
if(_47&&_47.get_id()==_48){
_47.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_49){
if(!_49||!_49.isCreated()){
return;
}
var _4a=_49.getWindowBounds();
var _4b=(_49.isVisible()||_49.isMinimized())+"@"+_4a.width+"@"+_4a.height+"@"+_4a.x+"@"+_4a.y+"@"+_49.isMinimized();
this._setRadWindowCookie(_49.get_id(),_4b);
},saveState:function(){
var _4c=this.get_windows();
for(i=0;i<_4c.length;i++){
var _4d=_4c[i];
if(_4d.isCloned()){
this.saveWindowState(_4d);
}
}
},restoreState:function(){
function restoreWindow(_4e,_4f){
var _50=_4f.split("@");
if(_50.length>1){
if("true"==_50[0]&&!_4e.isVisible()){
_4e.show();
}
window.setTimeout(function(){
if(parseInt(_50[1])>0){
_4e.set_width(_50[1]);
}
if(parseInt(_50[2])>0){
_4e.set_height(_50[2]);
}
if("true"==_50[0]){
_4e.moveTo(parseInt(_50[3]),parseInt(_50[4]));
}
if("true"==_50[5]){
_4e.minimize();
}
},1);
}
}
var _51=this.get_windows();
for(i=0;i<_51.length;i++){
var _52=_51[i];
var _53=this._getRadWindowCookie(_52.get_id());
if(_53){
restoreWindow(_52,_53);
}
}
},_getOnlyCookie:function(){
var _54="RadWindowCookie";
var _55=document.cookie.split("; ");
for(var i=0;i<_55.length;i++){
var _57=_55[i].split("=");
if(_54==_57[0]){
return _57[1];
}
}
return null;
},_setRadWindowCookie:function(_58,_59){
_58="["+_58+"]";
var _5a=this._getOnlyCookie();
var _5b="";
var _5c="";
if(_5a){
var _5d=_5a.split(_58);
if(_5d&&_5d.length>1){
_5b=_5d[0];
_5c=_5d[1].substr(_5d[1].indexOf("#")+1);
}else{
_5c=_5a;
}
}
var _5e=new Date();
_5e.setFullYear(_5e.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_5b+_58+"-"+_59+"#"+_5c)+";path=/;expires="+_5e.toUTCString()+";";
},_getRadWindowCookie:function(_5f){
var _60=this._getOnlyCookie();
if(!_60){
return;
}
var _61=null;
_5f="["+_5f+"]";
var _62=_60.indexOf(_5f);
if(_62>=0){
var _63=_62+_5f.length+1;
_61=_60.substring(_63,_60.indexOf("#",_63));
}
return _61;
},cascade:function(){
var _64=40;
var _65=40;
var _66=this._getWindowsSortedByZindex();
for(var i=0;i<_66.length;i++){
var _68=_66[i];
if(!_68.isClosed()&&_68.isVisible()){
var _69=_68.restore();
_68.moveTo(_64,_65);
_68.setActive(true);
_64+=25;
_65+=25;
}
}
},tile:function(){
var _6a=this._getWindowsSortedByZindex();
var _6b=0;
for(var i=0;i<_6a.length;i++){
var _6d=_6a[i];
if(!_6d.isClosed()&&_6d.isVisible()){
_6b++;
}
}
var _6e=5;
var _6f=0;
var _70=1;
if(_6b<=_6e){
_6f=_6b;
}else{
var i=2;
while((_6b*i)<(_6e*(i+1))){
i++;
if(i>6){
break;
}
}
_70=i;
_6f=Math.ceil(_6b/_70);
}
var _71=$telerik.getClientBounds();
var _72=Math.floor(_71.width/_6f);
var _73=Math.floor(_71.height/_70);
var _74=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _76=0;
for(var i=0;i<_6a.length;i++){
var _6d=_6a[i];
if(!_6d.isClosed()&&_6d.isVisible()){
_76++;
if((_76-1)%(_6f)==0&&_76>_6f){
top+=_73;
_74=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_6d.restore();
_6d.moveTo(_74,top);
_6d.setSize(_72,_73);
_74+=_72;
}
}
},closeActiveWindow:function(){
this._executeActiveWindow("close");
},minimizeActiveWindow:function(){
this._executeActiveWindow("minimize");
},restoreActiveWindow:function(){
this._executeActiveWindow("restore");
},closeAll:function(){
this._executeAll("close");
},showAll:function(){
this._executeAll("show");
},minimizeAll:function(){
this._executeAll("minimize");
},maximizeAll:function(){
this._executeAll("maximize");
},restoreAll:function(){
this._executeAll("restore");
},_getWindowsSortedByZindex:function(){
var _77=this._windows.concat([]);
var _78=function(_79,_7a){
var z1=_79.get_zindex();
var z2=_7a.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _77.sort(_78);
},_executeAll:function(_7d){
if(!this._windows){
return;
}
var _7e=this._windows.concat([]);
for(var i=0;i<_7e.length;i++){
_7e[i][_7d]();
}
},_executeActiveWindow:function(_80){
var _81=this.getActiveWindow();
if(_81&&"function"==typeof (_81[_80])){
_81[_80]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_82){
if(this._preserveClientState!=_82){
this._preserveClientState=_82;
}
},set_windowControls:function(_83){
this._windowIDs=eval(_83);
this._disposeWindows();
},get_windowControls:function(){
},get_windows:function(){
return this._windows;
}};
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager",Telerik.Web.UI.RadWindow);


/* END Telerik.Web.UI.Window.RadWindowManager.js */
/* START AjaxControlToolkit.Common.Common.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


// Add common toolkit scripts here.  To consume the scripts on a control add
// 
//      [RequiredScript(typeof(CommonToolkitScripts))] 
//      public class SomeExtender : ...
// 
// to the controls extender class declaration.


Type.registerNamespace('AjaxControlToolkit');


AjaxControlToolkit.BoxSide = function() {
    /// <summary>
    /// The BoxSide enumeration describes the sides of a DOM element
    /// </summary>
    /// <field name="Top" type="Number" integer="true" static="true" />
    /// <field name="Right" type="Number" integer="true" static="true" />
    /// <field name="Bottom" type="Number" integer="true" static="true" />
    /// <field name="Left" type="Number" integer="true" static="true" />
}
AjaxControlToolkit.BoxSide.prototype = {
    Top : 0,
    Right : 1,
    Bottom : 2,
    Left : 3
}
AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false);


AjaxControlToolkit._CommonToolkitScripts = function() {
    /// <summary>
    /// The _CommonToolkitScripts class contains functionality utilized across a number
    /// of controls (but not universally)
    /// </summary>
    /// <remarks>
    /// You should not create new instances of _CommonToolkitScripts.  Instead you should use the shared instance CommonToolkitScripts (or AjaxControlToolkit.CommonToolkitScripts).
    /// </remarks>
    
    // Populate the borderThicknesses lookup table
    this._borderThicknesses = { };

    var div0 = document.createElement('div');
    var div1 = document.createElement('div');

    div0.style.visibility = 'hidden';
    div0.style.position = 'absolute';
    div0.style.fontSize = '1px';
    
    div1.style.height = '0px';
    div1.style.overflow = 'hidden';
    
    document.body.appendChild(div0).appendChild(div1);
                    
    var base = div0.offsetHeight;
    div1.style.borderTop = 'solid black';        

    div1.style.borderTopWidth = 'thin';
    this._borderThicknesses['thin'] = div0.offsetHeight - base;
    
    div1.style.borderTopWidth = 'medium';
    this._borderThicknesses['medium'] = div0.offsetHeight - base;
    
    div1.style.borderTopWidth = 'thick';
    this._borderThicknesses['thick'] = div0.offsetHeight - base;
    
    div0.removeChild(div1);
    document.body.removeChild(div0);
    div0 = null;
    div1 = null;
}
AjaxControlToolkit._CommonToolkitScripts.prototype = {
    // The order of these lookup tables is directly linked to the BoxSide enum defined above
    _borderStyleNames : ['borderTopStyle','borderRightStyle','borderBottomStyle','borderLeftStyle'],
    _borderWidthNames : ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],
    _paddingWidthNames : ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],

        getCurrentStyle : function(element, attribute, defaultValue) {
        /// <summary>
        /// CommonToolkitScripts.getCurrentStyle is used to compute the value of a style attribute on an
        /// element that is currently being displayed.  This is especially useful for scenarios where
        /// several CSS classes and style attributes are merged, or when you need information about the
        /// size of an element (such as its padding or margins) that is not exposed in any other fashion.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Live DOM element to check style of
        /// </param>
        /// <param name="attribute" type="String">
        /// The style attribute's name is expected to be in a camel-cased form that you would use when
        /// accessing a JavaScript property instead of the hyphenated form you would use in a CSS
        /// stylesheet (i.e. it should be "backgroundColor" and not "background-color").
        /// </param>
        /// <param name="defaultValue" type="Object" mayBeNull="true" optional="true">
        /// In the event of a problem (i.e. a null element or an attribute that cannot be found) we
        /// return this object (or null if none if not specified).
        /// </param>
        /// <returns type="Object">
        /// Current style of the element's attribute
        /// </returns>

        var currentValue = null;
        if (element) {
            if (element.currentStyle) {
                currentValue = element.currentStyle[attribute];
            } else if (document.defaultView && document.defaultView.getComputedStyle) {
                var style = document.defaultView.getComputedStyle(element, null);
                if (style) {
                    currentValue = style[attribute];
                }
            }
            
            if (!currentValue && element.style.getPropertyValue) {
                currentValue = element.style.getPropertyValue(attribute);
            }
            else if (!currentValue && element.style.getAttribute) {
                currentValue = element.style.getAttribute(attribute);
            }       
        }
        
        if ((!currentValue || currentValue == "" || typeof(currentValue) === 'undefined')) {
            if (typeof(defaultValue) != 'undefined') {
                currentValue = defaultValue;
            }
            else {
                currentValue = null;
            }
        }   
        return currentValue;  
    },

    getInheritedBackgroundColor : function(element) {
        /// <summary>
        /// CommonToolkitScripts.getInheritedBackgroundColor provides the ability to get the displayed
        /// background-color of an element.  In most cases calling CommonToolkitScripts.getCurrentStyle
        /// won't do the job because it will return "transparent" unless the element has been given a
        /// specific background color.  This function will walk up the element's parents until it finds
        /// a non-transparent color.  If we get all the way to the top of the document or have any other
        /// problem finding a color, we will return the default value '#FFFFFF'.  This function is
        /// especially important when we're using opacity in IE (because ClearType will make text look
        /// horrendous if you fade it with a transparent background color).
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Live DOM element to get the background color of
        /// </param>
        /// <returns type="String">
        /// Background color of the element
        /// </returns>
        
        if (!element) return '#FFFFFF';
        var background = this.getCurrentStyle(element, 'backgroundColor');
        try {
            while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
                element = element.parentNode;
                if (!element) {
                    background = '#FFFFFF';
                } else {
                    background = this.getCurrentStyle(element, 'backgroundColor');
                }
            }
        } catch(ex) {
            background = '#FFFFFF';
        }
        return background;
    },

    getLocation : function(element) {
        /// <summary>Gets the coordinates of a DOM element.</summary>
        /// <param name="element" domElement="true"/>
        /// <returns type="Sys.UI.Point">
        ///   A Point object with two fields, x and y, which contain the pixel coordinates of the element.
        /// </returns>
        
        // workaround for an issue in getLocation where it will compute the location of the document element.
        // this will return an offset if scrolled.
        //
        if (element === document.documentElement) {
            return new Sys.UI.Point(0,0);
        }
        
        // Workaround for IE6 bug in getLocation (also required patching getBounds - remove that fix when this is removed)
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
            if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0,0);
            
            // Get the first bounding rectangle in screen coordinates
            var screenRects = element.getClientRects();
            if (!screenRects || !screenRects.length) {
                return new Sys.UI.Point(0,0);
            }
            var first = screenRects[0];
            
            // Delta between client coords and screen coords
            var dLeft = 0;
            var dTop = 0;
            
            // If we're in an iframe, get client coordinates too so we can compute the delta
            if (element.ownerDocument.parentWindow.frameElement) {
            
                // Get the bounding rectangle in client coords
                var clientRect = element.getBoundingClientRect();
                if (!clientRect) {
                    return new Sys.UI.Point(0,0);
                }
                
                // Find the minima in screen coords
                var minLeft = first.left;
                var minTop = first.top;
                for (var i = 1; i < screenRects.length; i++) {
                    var r = screenRects[i];
                    if (r.left < minLeft) {
                        minLeft = r.left;
                    }
                    if (r.top < minTop) {
                        minTop = r.top;
                    }
                }
                
                // Compute the delta between screen and client coords
                dLeft = minLeft - clientRect.left;
                dTop = minTop - clientRect.top;
            }
            
            // Subtract 2px, the border of the viewport (It can be changed in IE6 by applying a border style to the HTML element,
            // but this is not supported by ASP.NET AJAX, and it cannot be changed in IE7.), and also subtract the delta between
            // screen coords and client coords
            var ownerDocument = element.document.documentElement;
            return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);
        }
        
        return Sys.UI.DomElement.getLocation(element);
    },

    setLocation : function(element, point) {
        /// <summary>
        /// Sets the current location for an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="point" type="Object">
        /// Point object (of the form {x,y})
        /// </param>
        /// <remarks>
        /// This method does not attempt to set the positioning mode of an element.
        /// The position is relative from the elements nearest position:relative or
        /// position:absolute element.
        /// </remarks>
        Sys.UI.DomElement.setLocation(element, point.x, point.y);
    },
    
    getContentSize : function(element) {
        /// <summary>
        /// Gets the "content-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Size of the element (in the form {width,height})
        /// </returns>
        /// <remarks>
        /// The "content-box" is the size of the content area *inside* of the borders and
        /// padding of an element. The "content-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var size = this.getSize(element);
        var borderBox = this.getBorderBox(element);
        var paddingBox = this.getPaddingBox(element);
        return {
            width :  size.width - borderBox.horizontal - paddingBox.horizontal,
            height : size.height - borderBox.vertical - paddingBox.vertical
        }
    },

    getSize : function(element) {
        /// <summary>
        /// Gets the "border-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Size of the element (in the form {width,height})
        /// </returns>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        return {
            width:  element.offsetWidth,
            height: element.offsetHeight
        };
    },
    
    setContentSize : function(element, size) {
        /// <summary>
        /// Sets the "content-box" size of an element.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="size" type="Object">
        /// Size of the element (in the form {width,height})
        /// </param>
        /// <remarks>
        /// The "content-box" is the size of the content area *inside* of the borders and
        /// padding of an element. The "content-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!size) {
            throw Error.argumentNull('size');
        }
        // FF respects -moz-box-sizing css extension, so adjust the box size for the border-box
        if(this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
            var borderBox = this.getBorderBox(element);
            var paddingBox = this.getPaddingBox(element);
            size = {
                width: size.width + borderBox.horizontal + paddingBox.horizontal,
                height: size.height + borderBox.vertical + paddingBox.vertical
            };
        }
        element.style.width = size.width.toString() + 'px';
        element.style.height = size.height.toString() + 'px';
    },
    
    setSize : function(element, size) {
        /// <summary>
        /// Sets the "border-box" size of an element.
        /// </summary>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and 
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        /// <param name="element" type="Sys.UI.DomElement">DOM element</param>
        /// <param name="size" type="Object">Size of the element (in the form {width,height})</param>
        /// <returns />
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!size) {
            throw Error.argumentNull('size');
        }
        var borderBox = this.getBorderBox(element);
        var paddingBox = this.getPaddingBox(element);
        var contentSize = {
            width:  size.width - borderBox.horizontal - paddingBox.horizontal,
            height: size.height - borderBox.vertical - paddingBox.vertical
        };
        this.setContentSize(element, contentSize);
    },
    
    getBounds : function(element) {
        /// <summary>Gets the coordinates, width and height of an element.</summary>
        /// <param name="element" domElement="true"/>
        /// <returns type="Sys.UI.Bounds">
        ///   A Bounds object with four fields, x, y, width and height, which contain the pixel coordinates,
        ///   width and height of the element.
        /// </returns>
        /// <remarks>
        ///   Use the CommonToolkitScripts version of getLocation to handle the workaround for IE6.  We can
        ///   remove the below implementation and just call Sys.UI.DomElement.getBounds when the other bug
        ///   is fixed.
        /// </remarks>
        
        var offset = CommonToolkitScripts.getLocation(element);
        return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
    }, 
    
    setBounds : function(element, bounds) {
        /// <summary>
        /// Sets the "border-box" bounds of an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="bounds" type="Object">
        /// Bounds of the element (of the form {x,y,width,height})
        /// </param>
        /// <remarks>
        /// The "border-box" is the size of the content area *outside* of the borders and
        /// padding of an element.  The "border-box" size does not include the margins around
        /// the element.
        /// </remarks>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if (!bounds) {
            throw Error.argumentNull('bounds');
        }
        this.setSize(element, bounds);
        CommonToolkitScripts.setLocation(element, bounds);
    },
    
    getClientBounds : function() {
        /// <summary>
        /// Gets the width and height of the browser client window (excluding scrollbars)
        /// </summary>
        /// <returns type="Sys.UI.Bounds">
        /// Browser's client width and height
        /// </returns>

        var clientWidth;
        var clientHeight;
        switch(Sys.Browser.agent) {
            case Sys.Browser.InternetExplorer:
                clientWidth = document.documentElement.clientWidth;
                clientHeight = document.documentElement.clientHeight;
                break;
            case Sys.Browser.Safari:
                clientWidth = window.innerWidth;
                clientHeight = window.innerHeight;
                break;
            case Sys.Browser.Opera:
                clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
                break;
            default:  // Sys.Browser.Firefox, etc.
                clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
                clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
                break;
        }
        return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
    },
    
    getBorderBox : function(element) {
        /// <summary>
        /// Gets the entire border box sizes.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Element's border box sizes (of the form {top,left,bottom,right,horizontal,vertical})
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var box = {
            top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
            right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
            bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
            left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
        }
        box.horizontal = box.left + box.right;
        box.vertical = box.top + box.bottom;
        return box;
    },
    
    getPaddingBox : function(element) {
        /// <summary>
        /// Gets the entire padding box sizes.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <returns type="Object">
        /// Element's padding box sizes (of the form {top,left,bottom,right,horizontal,vertical})
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        var box = {
            top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
            right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
            bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
            left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
        }
        box.horizontal = box.left + box.right;
        box.vertical = box.top + box.bottom;
        return box;
    },
    
    isBorderVisible : function(element, boxSide) {
        /// <summary>
        /// Gets whether the current border style for an element on a specific boxSide is not 'none'.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Boolean">
        /// Whether the current border style for an element on a specific boxSide is not 'none'.
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange("Argument 'boxSide' out of the range of expected values");
        }
        var styleName = this._borderStyleNames[boxSide];
        var styleValue = this.getCurrentStyle(element, styleName);
        return styleValue != "none";
    },

    getBorderWidth : function(element, boxSide) {
        /// <summary>
        /// Gets the border thickness of an element on a specific boxSide.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Number" integer="true">
        /// Border thickness on the element's specified side
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange("Argument 'boxSide' out of the range of expected values");
        }
        if(!this.isBorderVisible(element, boxSide)) {
            return 0;
        }        
        var styleName = this._borderWidthNames[boxSide];    
        var styleValue = this.getCurrentStyle(element, styleName);
        return this.parseBorderWidth(styleValue);
    },
    
    getPadding : function(element, boxSide) {
        /// <summary>
        /// Gets the padding thickness of an element on a specific boxSide.
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// DOM element
        /// </param>
        /// <param name="boxSide" type="AjaxControlToolkit.BoxSide">
        /// Side of the element
        /// </param>
        /// <returns type="Number" integer="true">
        /// Padding on the element's specified side
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
            throw Error.argumentOutOfRange("Argument 'boxSide' out of the range of expected values");
        }
        var styleName = this._paddingWidthNames[boxSide];
        var styleValue = this.getCurrentStyle(element, styleName);
        return this.parsePadding(styleValue);
    },
    
    parseBorderWidth : function(borderWidth) {
        /// <summary>
        /// Parses a border-width string into a pixel size
        /// </summary>
        /// <param name="borderWidth" type="String" mayBeNull="true">
        /// Type of border ('thin','medium','thick','inherit',px unit,null,'')
        /// </param>
        /// <returns type="Number" integer="true">
        /// Number of pixels in the border-width
        /// </returns>
        
        if(borderWidth) {
            switch(borderWidth) {
                case 'thin':
                case 'medium':
                case 'thick':
                    return this._borderThicknesses[borderWidth];
                case 'inherit':
                    return 0;
            }
            var unit = this.parseUnit(borderWidth);
            Sys.Debug.assert(unit.type == 'px', 'A unit type of ' + unit.type + ' is invalid for parseBorderWidth');
            return unit.size;
        }
        return 0;
    },
    
    parsePadding : function(padding) {
        /// <summary>
        /// Parses a padding string into a pixel size
        /// </summary>
        /// <param name="padding" type="String" mayBeNull="true">
        /// Padding to parse ('inherit',px unit,null,'')
        /// </param>
        /// <returns type="Number" integer="true">
        /// Number of pixels in the padding
        /// </returns>
        
        if(padding) {
            if(padding == 'inherit') {
                return 0;
            }
            var unit = this.parseUnit(padding);
            Sys.Debug.assert(unit.type == 'px', 'A unit type of ' + unit.type + ' is invalid for parsePadding');
            return unit.size;
        }
        return 0;
    },
    
    parseUnit : function(value) {
        /// <summary>
        /// Parses a unit string into a unit object
        /// </summary>
        /// <param name="value" type="String" mayBeNull="true">
        /// Value to parse (of the form px unit,% unit,em unit,...)
        /// </param>
        /// <returns type="Object">
        /// Parsed unit (of the form {size,type})
        /// </returns>
        
        if (!value) {
            throw Error.argumentNull('value');
        }
        
        value = value.trim().toLowerCase();
        var l = value.length;
        var s = -1;
        for(var i = 0; i < l; i++) {
            var ch = value.substr(i, 1);
            if((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
                break;
            }
            s = i;
        }
        if(s == -1) {
            throw Error.create("No digits.");
        }
        var type;
        var size;
        if(s < (l - 1)) {
            type = value.substring(s + 1).trim();
        } else {
            type = 'px';
        }
        size = parseFloat(value.substr(0, s + 1));
        if(type == 'px') {
            size = Math.floor(size);
        }
        return { 
            size: size,
            type: type
        };
    },
    
    getElementOpacity : function(element) {
        /// <summary>
        /// Get the element's opacity
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <returns type="Number">
        /// Opacity of the element
        /// </returns>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        
        var hasOpacity = false;
        var opacity;
        
        if (element.filters) {
            var filters = element.filters;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    opacity = alphaFilter.opacity / 100.0;
                    hasOpacity = true;
                }
            }
        }
        else {
            opacity = this.getCurrentStyle(element, 'opacity', 1);
//            var computedStyle = document.defaultView.getComputedStyle;
//            opacity = computedStyle(element, null).getPropertyValue('opacity');
            hasOpacity = true;
        }
        
        if (hasOpacity === false) {
            return 1.0;
        }
        return parseFloat(opacity);
    },

    setElementOpacity : function(element, value) {
        /// <summary>
        /// Set the element's opacity
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// Element
        /// </param>
        /// <param name="value" type="Number">
        /// Opacity of the element
        /// </param>
        
        if (!element) {
            throw Error.argumentNull('element');
        }
        
        if (element.filters) {
            var filters = element.filters;
            var createFilter = true;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    createFilter = false;
                    alphaFilter.opacity = value * 100;
                }
            }
            if (createFilter) {
                element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';
            }
        }
        else {
            element.style.opacity = value;
        }
    },
    
    resolveFunction : function(value) {
        /// <summary>
        /// Returns a function reference that corresponds to the provided value
        /// </summary>
        /// <param name="value" type="Object">
        /// The value can either be a Function, the name of a function (that can be found using window['name']),
        /// or an expression that evaluates to a function.
        /// </param>
        /// <returns type="Function">
        /// Reference to the function, or null if not found
        /// </returns>
        
        if (value) {
            if (value instanceof Function) {
                return value;
            } else if (String.isInstanceOfType(value) && value.length > 0) {
                var func;
                if ((func = window[value]) instanceof Function) {
                    return func;
                } else if ((func = eval(value)) instanceof Function) {
                    return func;
                }
            }
        }
        return null;
    },

    addCssClasses : function(element, classNames) {
        /// <summary>
        /// Adds multiple css classes to a DomElement
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="classNames" type="Array">The class names to add</param>
        
        for(var i = 0; i < classNames.length; i++) {
            Sys.UI.DomElement.addCssClass(element, classNames[i]);
        }
    },
    removeCssClasses : function(element, classNames) {
        /// <summary>
        /// Removes multiple css classes to a DomElement
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="classNames" type="Array">The class names to remove</param>
        
        for(var i = 0; i < classNames.length; i++) {
            Sys.UI.DomElement.removeCssClass(element, classNames[i]);
        }
    },
    setStyle : function(element, style) {
        /// <summary>
        /// Sets the style of the element using the supplied style template object
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="style" type="Object">The template</param>

        $common.applyProperties(element.style, style);
    },
    removeHandlers : function(element, events) {
        /// <summary>
        /// Removes a set of event handlers from an element
        /// </summary>
        /// <param name="element" type="Sys.UI.DomElement">The element to modify</param>
        /// <param name="events" type="Object">The template object that contains event names and delegates</param>
        /// <remarks>
        /// This is NOT the same as $clearHandlers which removes all delegates from a DomElement.  This rather removes select delegates 
        /// from a specified element and has a matching signature as $addHandlers
        /// </remarks>
        for (var name in events) {
            $removeHandler(element, name, events[name]);
        }
    },
    
    containsPoint : function(rect, x, y) {
        /// <summary>
        /// Tests whether a point (x,y) is contained within a rectangle
        /// </summary>
        /// <param name="rect" type="Object">The rectangle</param>
        /// <param name="x" type="Number">The x coordinate of the point</param>
        /// <param name="y" type="Number">The y coordinate of the point</param>
        
        return x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.width);
    },

    isKeyDigit : function(keyCode) { 
        /// <summary>
        /// Gets whether the supplied key-code is a digit
        /// </summary>
        /// <param name="keyCode" type="Number" integer="true">The key code of the event (from Sys.UI.DomEvent)</param>
        /// <returns type="Boolean" />

        return (0x30 <= keyCode && keyCode <= 0x39); 
    },
    
    isKeyNavigation : function(keyCode) { 
        /// <summary>
        /// Gets whether the supplied key-code is a navigation key
        /// </summary>
        /// <param name="keyCode" type="Number" integer="true">The key code of the event (from Sys.UI.DomEvent)</param>
        /// <returns type="Boolean" />

        return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down); 
    },
    
    padLeft : function(text, size, ch, truncate) { 
        /// <summary>
        /// Pads the left hand side of the supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true" optional="true">The size to pad the text (default is 2)</param>
        /// <param name="ch" type="String" optional="true">The single character to use as the pad character (default is ' ')</param>
        /// <param name="truncate" type="Boolean" optional="true">Whether to truncate the text to size (default is false)</param>
        
        return AjaxControlToolkit.CommonToolkitScripts._pad(text, size || 2, ch || ' ', 'l', truncate || false); 
    },
    
    padRight : function(text, size, ch, truncate) { 
        /// <summary>
        /// Pads the right hand side of the supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true" optional="true">The size to pad the text (default is 2)</param>
        /// <param name="ch" type="String" optional="true">The single character to use as the pad character (default is ' ')</param>
        /// <param name="truncate" type="Boolean" optional="true">Whether to truncate the text to size (default is false)</param>

        return AjaxControlToolkit.CommonToolkitScripts._pad(text, size || 2, ch || ' ', 'r', truncate || false); 
    },
    
    _pad : function(text, size, ch, side, truncate) {
        /// <summary>
        /// Pads supplied text with the specified pad character up to the requested size
        /// </summary>
        /// <param name="text" type="String">The text to pad</param>
        /// <param name="size" type="Number" integer="true">The size to pad the text</param>
        /// <param name="ch" type="String">The single character to use as the pad character</param>
        /// <param name="side" type="String">Either 'l' or 'r' to siginfy whether to pad the Left or Right side respectively</param>
        /// <param name="truncate" type="Boolean">Whether to truncate the text to size</param>

        text = text.toString();
        var length = text.length;
        var builder = new Sys.StringBuilder();
        if (side == 'r') {
            builder.append(text);
        } 
        while (length < size) {
            builder.append(ch);
            length++;
        }
        if (side == 'l') {
            builder.append(text);
        }
        var result = builder.toString();
        if (truncate && result.length > size) {
            if (side == 'l') {
                result = result.substr(result.length - size, size);
            } else {
                result = result.substr(0, size);
            }
        }
        return result;
    },
 
    applyProperties : function(target, properties) {
        /// <summary>
        /// Quick utility method to copy properties from a template object to a target object
        /// </summary>
        /// <param name="target" type="Object">The object to apply to</param>
        /// <param name="properties" type="Object">The template to copy values from</param>
        
        for (var p in properties) {
            var pv = properties[p];
            if (Object.getType(pv)===Object) {
                var tv = target[p];
                AjaxControlToolkit.CommonToolkitScripts.applyProperties(tv, pv);
            } else {
                target[p] = pv;
            }
        }
    },
    
    createElementFromTemplate : function(template, appendToParent) {
        /// <summary>
        /// Creates an element for the current document based on a template object
        /// </summary>
        /// <param name="template" type="Object">The template from which to create the element</param>
        /// <param name="appendToParent" type="Sys.UI.DomElement" optional="true" mayBeNull="true">A DomElement under which to append this element</param>
        /// <returns type="Sys.UI.DomElement" />
        /// <remarks>
        /// This method is useful if you find yourself using the same or similar DomElement constructions throughout a class.  You can even set the templates
        /// as static properties for a type to cut down on overhead.  This method is often called with a JSON style template:
        /// <code>
        /// var elt = $common.createElementFromTemplate({
        ///     nodeName : "div",
        ///     properties : {
        ///         style : {
        ///             height : "100px",
        ///             width : "100px",
        ///             backgroundColor : "white"
        ///         },
        ///         expandoAttribute : "foo"
        ///     },
        ///     events : {
        ///         click : function() { alert("foo"); },
        ///         mouseover : function() { elt.backgroundColor = "silver"; },
        ///         mouseout : function() { elt.backgroundColor = "white"; }
        ///     },
        ///     cssClasses : [ "class0", "class1" ],
        ///     visible : true,
        ///     opacity : .5
        /// }, someParent);
        /// </code>
        /// </remarks>
        
        var elt = document.createElement(template.nodeName);
        if (typeof(template.properties)!=='undefined') AjaxControlToolkit.CommonToolkitScripts.applyProperties(elt, template.properties);
        if (typeof(template.cssClasses)!=='undefined') AjaxControlToolkit.CommonToolkitScripts.addCssClasses(elt, template.cssClasses);
        if (typeof(template.events)!=='undefined') $addHandlers(elt, template.events);
        if (typeof(template.visible)!=='undefined') Sys.UI.DomElement.setVisible(elt, template.visible);
        if (appendToParent) appendToParent.appendChild(elt);
        if (typeof(template.opacity)!=='undefined') AjaxControlToolkit.CommonToolkitScripts.setElementOpacity(elt, template.opacity);
        return elt;
    }
}

// Create the singleton instance of the CommonToolkitScripts
var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();
var $common = CommonToolkitScripts;

AjaxControlToolkit._DomUtility = function() {
    /// <summary>
    /// Utility functions for manipulating the DOM
    /// </summary>
}
AjaxControlToolkit._DomUtility.prototype = {
    isDescendant : function(ancestor, descendant) {
        /// <summary>
        /// Whether the specified element is a descendant of the ancestor
        /// </summary>
        /// <param name="ancestor" type="Sys.UI.DomElement">Ancestor node</param>
        /// <param name="descendant" type="Sys.UI.DomElement">Possible descendant node</param>
        /// <returns type="Boolean" />
        
        for (var n = descendant.parentNode; n != null; n = n.parentNode) {
            if (n == ancestor) return true;
        }
        return false;
    },
    isDescendantOrSelf : function(ancestor, descendant) {
        /// <summary>
        /// Whether the specified element is a descendant of the ancestor or the same as the ancestor
        /// </summary>
        /// <param name="ancestor" type="Sys.UI.DomElement">Ancestor node</param>
        /// <param name="descendant" type="Sys.UI.DomElement">Possible descendant node</param>
        /// <returns type="Boolean" />

        if (ancestor === descendant) 
            return true;
        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isAncestor : function(descendant, ancestor) {
        /// <summary>
        /// Whether the specified element is an ancestor of the descendant
        /// </summary>
        /// <param name="descendant" type="Sys.UI.DomElement">Descendant node</param>
        /// <param name="ancestor" type="Sys.UI.DomElement">Possible ancestor node</param>
        /// <returns type="Boolean" />

        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isAncestorOrSelf : function(descendant, ancestor) {
        /// <summary>
        /// Whether the specified element is an ancestor of the descendant or the same as the descendant
        /// </summary>
        /// <param name="descendant" type="Sys.UI.DomElement">Descendant node</param>
        /// <param name="ancestor" type="Sys.UI.DomElement">Possible ancestor node</param>
        /// <returns type="Boolean" />
        
        if (descendant === ancestor)
            return true;
            
        return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
    },
    isSibling : function(self, sibling) {
        /// <summary>
        /// Whether the specified element is a sibling of the self element
        /// </summary>
        /// <param name="self" type="Sys.UI.DomElement">Self node</param>
        /// <param name="sibling" type="Sys.UI.DomElement">Possible sibling node</param>
        /// <returns type="Boolean" />
        
        var parent = self.parentNode;
        for (var i = 0; i < parent.childNodes.length; i++) {
            if (parent.childNodes[i] == sibling) return true;
        }
        return false;
    }
}
AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");
AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility();
/* END AjaxControlToolkit.Common.Common.js */
/* START AjaxControlToolkit.Compat.Blocking.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


// Repository of old "Atlas" code that we're waiting to have integrated into the new Microsoft Ajax Library


///////////////////////////
/// Sys.UI.DomElement

// DELTA - not present in codebase but called from PopupBehavior
Sys.UI.DomElement.setVisible = function(e, value) {

    if (!e) return;

    if (value != Sys.UI.DomElement.getVisible(e)) {
        
        if (value) {
            if (e.style.removeAttribute) {
                e.style.removeAttribute("display");
            } else {
               e.style.removeProperty("display");
            }
        }
        else {
            e.style.display = 'none';
        }
        
        e.style.visibility = value ? 'visible' : 'hidden';
    }
}

Sys.UI.DomElement.getVisible = function(e) {

    if (!e) return false;

    return (("none" != AjaxControlToolkit.CommonToolkitScripts.getCurrentStyle(e, "display")) &&
        ("hidden" != AjaxControlToolkit.CommonToolkitScripts.getCurrentStyle(e, "visibility")));
}


//////////////////////////////////////
// Sys.UI.Control.overlaps
//

Sys.UI.Control.overlaps = function overlaps(r1, r2) {
    var xLeft = (r1.x >= r2.x && r1.x <= (r2.x + r2.width));
    var xRight = ((r1.x + r1.width) >= r2.x && (r1.x + r1.width) <= r2.x + r2.width);
    var xComplete = ((r1.x < r2.x) && ((r1.x + r1.height) > (r2.x + r2.height)));
    
    var yLeft = (r1.y >= r2.y && r1.y <= (r2.y + r2.height));
    var yRight = ((r1.y + r1.height) >= r2.y && (r1.y + r1.height) <= r2.y + r2.height);
    var yComplete = ((r1.y < r2.y) && ((r1.y + r1.height) > (r2.y + r2.height)));
    if ((xLeft || xRight || xComplete) && (yLeft || yRight || yComplete)) {
        return true;
    }
    
    return false;
}

/* END AjaxControlToolkit.Compat.Blocking.js */
/* START AjaxControlToolkit.ExtenderBase.BaseScripts.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


Type.registerNamespace('AjaxControlToolkit');

// This is the base behavior for all extender behaviors
AjaxControlToolkit.BehaviorBase = function(element) {
    /// <summary>
    /// Base behavior for all extender behaviors
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.BehaviorBase.initializeBase(this,[element]);
    
    this._clientStateFieldID = null;
    this._pageRequestManager = null;
    this._partialUpdateBeginRequestHandler = null;
    this._partialUpdateEndRequestHandler = null;
}
AjaxControlToolkit.BehaviorBase.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>

        // TODO: Evaluate necessity
        AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'initialize');
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'dispose');

        if (this._pageRequestManager) {
            if (this._partialUpdateBeginRequestHandler) {
                this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
                this._partialUpdateBeginRequestHandler = null;
            }
            if (this._partialUpdateEndRequestHandler) {
                this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
                this._partialUpdateEndRequestHandler = null;
            }
            this._pageRequestManager = null;
        }
    },

    get_ClientStateFieldID : function() {
        /// <value type="String">
        /// ID of the hidden field used to store client state
        /// </value>
        return this._clientStateFieldID;
    },
    set_ClientStateFieldID : function(value) {
        if (this._clientStateFieldID != value) {
            this._clientStateFieldID = value;
            this.raisePropertyChanged('ClientStateFieldID');
        }
    },

    get_ClientState : function() {
        /// <value type="String">
        /// Client state
        /// </value>
        if (this._clientStateFieldID) {
            var input = document.getElementById(this._clientStateFieldID);
            if (input) {
                return input.value;
            }
        }
        return null;
    },
    set_ClientState : function(value) {
        if (this._clientStateFieldID) {
            var input = document.getElementById(this._clientStateFieldID);
            if (input) {
                input.value = value;
            }
        }
    },

    registerPartialUpdateEvents : function() {
        /// <summary>
        /// Register for beginRequest and endRequest events on the PageRequestManager,
        /// (which cause _partialUpdateBeginRequest and _partialUpdateEndRequest to be
        /// called when an UpdatePanel refreshes)
        /// </summary>

        if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager){
            this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
            if (this._pageRequestManager) {
                this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);
                this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
                this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);
                this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
            }
        }
    },

    _partialUpdateBeginRequest : function(sender, beginRequestEventArgs) {
        /// <summary>
        /// Method that will be called when a partial update (via an UpdatePanel) begins,
        /// if registerPartialUpdateEvents() has been called.
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="beginRequestEventArgs" type="Sys.WebForms.BeginRequestEventArgs">
        /// Event arguments
        /// </param>

        // Nothing done here; override this method in a child class
    },
    
    _partialUpdateEndRequest : function(sender, endRequestEventArgs) {
        /// <summary>
        /// Method that will be called when a partial update (via an UpdatePanel) finishes,
        /// if registerPartialUpdateEvents() has been called.
        /// </summary>
        /// <param name="sender" type="Object">
        /// Sender
        /// </param>
        /// <param name="endRequestEventArgs" type="Sys.WebForms.EndRequestEventArgs">
        /// Event arguments
        /// </param>

        // Nothing done here; override this method in a child class
    }
}
AjaxControlToolkit.BehaviorBase.registerClass('AjaxControlToolkit.BehaviorBase', Sys.UI.Behavior);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'getDescriptor');
//        td.addProperty('ClientStateFieldID', String);
//        return td;
//    },


// Dynamically populates content when the populate method is called
AjaxControlToolkit.DynamicPopulateBehaviorBase = function(element) {
    /// <summary>
    /// DynamicPopulateBehaviorBase is used to add DynamicPopulateBehavior funcitonality
    /// to other extenders.  It will dynamically populate the contents of the target element
    /// when its populate method is called.
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM Element the behavior is associated with
    /// </param>

    AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this, [element]);
    
    this._DynamicControlID = null;
    this._DynamicContextKey = null;
    this._DynamicServicePath = null;
    this._DynamicServiceMethod = null;
    this._dynamicPopulateBehavior = null;
    this._populatingHandler = null;
    this._populatedHandler = null;
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>

        AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize');

        // Create event handlers
        this._populatingHandler = Function.createDelegate(this, this._onPopulating);
        this._populatedHandler = Function.createDelegate(this, this._onPopulated);
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>

        // Dispose of event handlers
        if (this._populatedHandler) {
            if (this._dynamicPopulateBehavior) {
                this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);
            }
            this._populatedHandler = null;
        }
        if (this._populatingHandler) {
            if (this._dynamicPopulateBehavior) {
                this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);
            }
            this._populatingHandler = null;
        }

        // Dispose of the placeholder control and behavior
        if (this._dynamicPopulateBehavior) {
            this._dynamicPopulateBehavior.dispose();
            this._dynamicPopulateBehavior = null;
        }
        AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose');
    },

    populate : function(contextKeyOverride) {
        /// <summary>
        /// Demand-create the DynamicPopulateBehavior and use it to populate the target element
        /// </summary>
        /// <param name="contextKeyOverride" type="String" mayBeNull="true" optional="true">
        /// An arbitrary string value to be passed to the web method. For example, if the element to be populated is within a data-bound repeater, this could be the ID of the current row.
        /// </param>

        // If the DynamicPopulateBehavior's element is out of date, dispose of it
        if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) {
            this._dynamicPopulateBehavior.dispose();
            this._dynamicPopulateBehavior = null;
        }
        // If a DynamicPopulateBehavior is not available and the necessary information is, create one
        if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) {
            this._dynamicPopulateBehavior = $create(AjaxControlToolkit.DynamicPopulateBehavior, {"id":this.get_id()+"_DynamicPopulateBehavior", "ContextKey":this._DynamicContextKey, "ServicePath":this._DynamicServicePath, "ServiceMethod":this._DynamicServiceMethod }, null, null, $get(this._DynamicControlID));

            // Attach event handlers
            this._dynamicPopulateBehavior.add_populating(this._populatingHandler);
            this._dynamicPopulateBehavior.add_populated(this._populatedHandler);
        }
        // If a DynamicPopulateBehavior is available, use it to populate the dynamic content
        if(this._dynamicPopulateBehavior) {
            this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey);
        }
    },

    _onPopulating : function(sender, eventArgs) {
        // Event handler called automatically when dynamic populating begins
    },

    _onPopulated : function(sender, eventArgs) {
        // Event handler called automatically when dynamic populating ends
    },

    get_DynamicControlID : function() {
        /// <value type="String">
        /// ID of the element to populate with dynamic content
        /// </value>

        return this._DynamicControlID;
    },
    set_DynamicControlID : function(value) {
        if (this._DynamicControlID != value) {
            this._DynamicControlID = value;
            this.raisePropertyChanged('DynamicControlID');
        }
    },

    get_DynamicContextKey : function() {
        /// <value type="String">
        /// An arbitrary string value to be passed to the web method.
        /// For example, if the element to be populated is within a
        /// data-bound repeater, this could be the ID of the current row.
        /// </value>

        return this._DynamicContextKey;
    },
    set_DynamicContextKey : function(value) {
        if (this._DynamicContextKey != value) {
            this._DynamicContextKey = value;
            this.raisePropertyChanged('DynamicContextKey');
        }
    },

    get_DynamicServicePath : function() {
        /// <value type="String" mayBeNull="true" optional="true">
        /// The URL of the web service to call.  If the ServicePath is not defined, then we will invoke a PageMethod instead of a web service.
        /// </value>

        return this._DynamicServicePath;
    },
    set_DynamicServicePath : function(value) {
        if (this._DynamicServicePath != value) {
            this._DynamicServicePath = value;
            this.raisePropertyChanged('DynamicServicePath');
        }
    },

    get_DynamicServiceMethod : function() {
        /// <value type="String">
        /// The name of the method to call on the page or web service
        /// </value>
        /// <remarks>
        /// The signature of the method must exactly match the following:
        ///     [WebMethod]
        ///     string DynamicPopulateMethod(string contextKey)
        ///     {
        ///         ...
        ///     }
        /// </remarks>

        return this._DynamicServiceMethod;
    },
    set_DynamicServiceMethod : function(value) {
        if (this._DynamicServiceMethod != value) {
            this._DynamicServiceMethod = value;
            this.raisePropertyChanged('DynamicServiceMethod');
        }
    }
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass('AjaxControlToolkit.DynamicPopulateBehaviorBase', AjaxControlToolkit.BehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'getDescriptor');
//        td.addProperty('DynamicControlID', String);
//        td.addProperty('DynamicContextKey', String);
//        td.addProperty('DynamicServicePath', String);
//        td.addProperty('DynamicServiceMethod', String);
//        return td;
//    },


AjaxControlToolkit.ControlBase = function(element) {
    AjaxControlToolkit.ControlBase.initializeBase(this, [element]);
    this._clientStateField = null;
    this._callbackTarget = null;
    this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit);
    this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete);
    this._onerror$delegate = Function.createDelegate(this, this._onerror);
}
AjaxControlToolkit.ControlBase.prototype = {
    initialize : function() {
        AjaxControlToolkit.ControlBase.callBaseMethod(this, "initialize");
        // load the client state if possible
        if (this._clientStateField) {
            this.loadClientState(this._clientStateField.value);
        }
        // attach an event to save the client state before a postback or updatepanel partial postback
        if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
            Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
        } else {
            $addHandler(document.forms[0], "submit", this._onsubmit$delegate);
        }
    },
    dispose : function() {
        if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
            Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
        } else {
            $removeHandler(document.forms[0], "submit", this._onsubmit$delegate);
        }
        AjaxControlToolkit.ControlBase.callBaseMethod(this, "dispose");
    },
    findElement : function(id) {
        // <summary>Finds an element within this control (ScriptControl/ScriptUserControl are NamingContainers);
        return $get(this.get_id() + '_' + id.split(':').join('_'));
    },
    get_clientStateField : function() {
        return this._clientStateField;
    },
    set_clientStateField : function(value) {
        if (this.get_isInitialized()) throw Error.invalidOperation("clientStateField can only be set before initialization");
        this._clientStateField = value;
    },
    loadClientState : function(value) {
        /// <remarks>override this method to intercept client state loading after a callback</remarks>
    },
    saveClientState : function() {
        /// <remarks>override this method to intercept client state acquisition before a callback</remarks>
        return null;
    },
    _invoke : function(name, args, cb) {
        /// <summary>invokes a callback method on the server control</summary>        
        if (!this._callbackTarget) {
            throw Error.invalidOperation("This Control has not been registered for callbacks.");
        }
        if (typeof(WebForm_DoCallback)==="undefined") {
            throw Error.invalidOperation("This Page has not been registered for callbacks.");
        }
        var ar = [];
        for (var i = 0; i < args.length; i++) 
            ar[i] = args[i];
        var clientState = this.saveClientState();
        if (clientState != null && !String.isInstanceOfType(clientState)) {
            throw Error.invalidOperation("saveClientState must return a value of type String");
        }
        var payload = Sys.Serialization.JavaScriptSerializer.serialize({name:name,args:ar,state:this.saveClientState()});
        WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true);
    },
    _oncomplete : function(result, context) {
        result = Sys.Serialization.JavaScriptSerializer.deserialize(result);
        if (result.error) {
            throw Error.create(result.error);
        }
        this.loadClientState(result.state);
        context(result.result);
    },
    _onerror : function(message, context) {
        throw Error.create(message);
    },
    _onsubmit : function() {
        if (this._clientStateField) {
            this._clientStateField.value = this.saveClientState();
        }
        return true;
    }    
   
}
AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase", Sys.UI.Control);

/* END AjaxControlToolkit.ExtenderBase.BaseScripts.js */
/* START AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.DynamicPopulateBehavior = function(element) {
    /// <summary>
    /// The DynamicPopulateBehavior replaces the contents of an element with the result of a web service or page method call.  The method call returns a string of HTML that is inserted as the children of the target element.
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.DynamicPopulateBehavior.initializeBase(this, [element]);
    
    this._servicePath = null;
    this._serviceMethod = null;
    this._contextKey = null;
    this._populateTriggerID = null;
    this._setUpdatingCssClass = null;
    this._clearDuringUpdate = true;
    this._customScript = null;
    
    this._clickHandler = null;
    
    this._callID = 0;
    this._currentCallID = -1;
}
AjaxControlToolkit.DynamicPopulateBehavior.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>
        AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this, 'initialize');
    
        // hook up the trigger if we have one.
        if (this._populateTriggerID) {
            var populateTrigger = $get(this._populateTriggerID);
            if (populateTrigger) {
                this._clickHandler = Function.createDelegate(this, this._onPopulateTriggerClick);
                $addHandler(populateTrigger, "click", this._clickHandler);
            }
        }
    },
    
    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>

        // clean up the trigger event.
        if (this._populateTriggerID && this._clickHandler) {
            var populateTrigger = $get(this._populateTriggerID);
            if (populateTrigger) {
                $removeHandler(populateTrigger, "click", this._clickHandler);
            }
            this._populateTriggerID = null;
            this._clickHandler = null;
        }
       
        AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this, 'dispose');
    },
    
    add_populated : function(handler) {
        /// <summary>
        /// Add a handler on the populated event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().addHandler("populated", handler);
    },
    remove_populated : function(handler) {
        /// <summary>
        /// Remove a handler from the populated event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().removeHandler("populated", handler);
    },
    raisePopulated : function(arg) {
        /// <summary>
        /// Raise the populated event
        /// </summary>
        /// <param name="arg" type="Sys.EventArgs">
        /// Event arguments
        /// </param>
        var handler = this.get_events().getHandler("populated");  
        if (handler) handler(this, arg);
    },
    
    add_populating : function(handler) {
        /// <summary>
        /// Add a handler on the populating event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().addHandler("populating", handler);
    },
    remove_populating : function(handler) {
        /// <summary>
        /// Remove a handler from the populating event
        /// </summary>
        /// <param name="handler" type="Function">
        /// Handler
        /// </param>
        this.get_events().removeHandler("populating", handler);
    },
    raisePopulating : function(arg) {
        /// <summary>
        /// Raise the populating event
        /// </summary>
        /// <param name="arg" type="Sys.EventArgs">
        /// Event arguments
        /// </param>
        var handler = this.get_events().getHandler("populating");
        if (handler) handler(this, arg);
    },
    
    populate : function(contextKey) {
        /// <summary>
        /// Get the dymanic content and use it to populate the target element
        /// </summary>
        /// <param name="contextKey" type="String" mayBeNull="true" optional="true">
        /// An arbitrary string value to be passed to the web method. For example, if the element to be
        /// populated is within a data-bound repeater, this could be the ID of the current row.
        /// </param>

        if (this._currentCallID == -1) {
            this._setUpdating(true);   
        }        
        if (this._customScript) {
            // Call custom javascript call to populate control
            var scriptResult = eval(this._customScript);
            this.get_element().innerHTML = scriptResult; 
            this._setUpdating(false);
         } else {
             this._currentCallID = ++this._callID;
             if (this._servicePath && this._serviceMethod) {

                Sys.Net.WebServiceProxy.invoke(this._servicePath, this._serviceMethod, false,
                    { contextKey:(contextKey ? contextKey : this._contextKey) },
                    Function.createDelegate(this, this._onMethodComplete), Function.createDelegate(this, this._onMethodError),
                    this._currentCallID);
             }
        }
    },

    _onMethodComplete : function (result, userContext, methodName) {

        // ignore if it's not the current call.
        if (userContext != this._currentCallID) return;

        // Time has passed; make sure the element is still accessible
        var e = this.get_element();
        if (e) {
            e.innerHTML = result;
        }

        this._setUpdating(false);
    },

    _onMethodError : function(webServiceError, userContext, methodName) {

        // ignore if it's not the current call.
        if (userContext != this._currentCallID) return;

        var e = this.get_element();
        if (e) {
            if (webServiceError.get_timedOut()) {
                e.innerHTML = "Web Service call timed out.";
            } else {
                e.innerHTML = "Web Service call failed: " + (webServiceError.get_statusCode());
            }
        }

        this._setUpdating(false);
    },

    _onPopulateTriggerClick : function() {
        /// <summary>
        /// Handler for the element described by PopulateTriggerID's click event
        /// </summary>

        // just call through to the trigger.
        this.populate(this._contextKey);
    },
    
    _setUpdating : function(updating) {
        /// <summary>
        /// Toggle the display elements to indicate if they are being updated or not
        /// </summary>
        /// <param name="updating" type="Boolean">
        /// Whether or not the display should indicated it is being updated
        /// </param>

        var e = this.get_element();
        if (this._setUpdatingCssClass) {               
            if (!updating) {
                e.className = this._oldCss;              
                this._oldCss = null;
            } else {
                this._oldCss = e.className;                
                e.className = this._setUpdatingCssClass;      
            }
        }
        
        if (updating && this._clearDuringUpdate) {
            e.innerHTML = "";
        }
        
        if (updating) {
            this.raisePopulating(this, Sys.EventArgs.Empty);
        } else {
            this._currentCallID = -1;
            this.raisePopulated(this, Sys.EventArgs.Empty);
        }
    },
    
    get_ClearContentsDuringUpdate : function() {
        /// <value type="Boolean">
        /// Whether the contents of the target should be cleared when an update begins
        /// </value>
        return this._clearDuringUpdate;
    },
    set_ClearContentsDuringUpdate : function(value) {
        if (this._clearDuringUpdate != value) {
            this._clearDuringUpdate = value;
            this.raisePropertyChanged('ClearContentsDuringUpdate');
        }
    },
    
    get_ContextKey : function() {
        /// <value type="String">
        /// An arbitrary string value to be passed to the web method.
        /// For example, if the element to be populated is within a
        /// data-bound repeater, this could be the ID of the current row.
        /// </value>
        return this._contextKey;
    },
    set_ContextKey : function(value) {
        if (this._contextKey != value) {
            this._contextKey = value;
            this.raisePropertyChanged('ContextKey');
        }
    },
    
    get_PopulateTriggerID : function() {
        /// <value type="String" mayBeNull="true" optional="true">
        /// Name of an element that triggers the population of the target when clicked
        /// </value>
        return this._populateTriggerID;
    },
    set_PopulateTriggerID : function(value) {
        if (this._populateTriggerID != value) {
            this._populateTriggerID = value;
            this.raisePropertyChanged('PopulateTriggerID');
        }
    },
    
    get_ServicePath : function() {
        /// <value type="String" mayBeNull="true" optional="true">
        /// The URL of the web service to call.  If the ServicePath is not defined, then we will invoke a PageMethod instead of a web service.
        /// </value>
        return this._servicePath;
    },
    set_ServicePath : function(value) {
        if (this._servicePath != value) {
            this._servicePath = value;
            this.raisePropertyChanged('ServicePath');
        }
    },
    
    get_ServiceMethod : function() {
        /// <value type="String">
        /// The name of the method to call on the page or web service
        /// </value>
        /// <remarks>
        /// The signature of the method must exactly match the following:
        ///    [WebMethod]
        ///    string DynamicPopulateMethod(string contextKey)
        ///    {
        ///        ...
        ///    }
        /// </remarks>
        return this._serviceMethod;
    },
    set_ServiceMethod : function(value) {
        if (this._serviceMethod != value) {
            this._serviceMethod = value;
            this.raisePropertyChanged('ServiceMethod');
        }
    },
    
    get_UpdatingCssClass : function() {
        /// <value type="String">
        /// The CSS class to apply to the target during asynchronous calls
        /// </value>
        return this._setUpdatingCssClass;
    },
    set_UpdatingCssClass : function(value) {
        if (this._setUpdatingCssClass != value) {
            this._setUpdatingCssClass = value;
            this.raisePropertyChanged('UpdatingCssClass');
        }
    },
    
    get_CustomScript : function() {
        /// <value type="String">
        /// The script to invoke instead of calling a Web or Page method. This script must evaluate to a string value.
        /// </value>
        return this._customScript;
    },   
    set_CustomScript : function(value) {
        if (this._customScript != value) {
            this._customScript = value;
            this.raisePropertyChanged('CustomScript');
        }
    }
}
AjaxControlToolkit.DynamicPopulateBehavior.registerClass('AjaxControlToolkit.DynamicPopulateBehavior', AjaxControlToolkit.BehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this, 'getDescriptor');
//        td.addProperty('ServicePath', String);        
//        td.addProperty('ServiceMethod', String);        
//        td.addProperty('ContextKey', String);        
//        td.addProperty('PopulateTriggerID', String);        
//        td.addProperty('UpdatingCssClass', String);        
//        td.addProperty('ClearContentsDuringUpdate', Boolean);   
//        td.addProperty('CustomScript', String);       
//        return td;
//    },

/* END AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js */
/* START AjaxControlToolkit.Compat.Timer.Timer.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

///////////////////////////////////////////////////////////////////////////////
// Sys.Timer

Sys.Timer = function() {
    Sys.Timer.initializeBase(this);
    
    this._interval = 1000;
    this._enabled = false;
    this._timer = null;
}

Sys.Timer.prototype = {
    get_interval: function() {
        
        return this._interval;
    },
    set_interval: function(value) {
        
        if (this._interval !== value) {
            this._interval = value;
            this.raisePropertyChanged('interval');
            
            if (!this.get_isUpdating() && (this._timer !== null)) {
                this._stopTimer();
                this._startTimer();
            }
        }
    },
    
    get_enabled: function() {
        
        return this._enabled;
    },
    set_enabled: function(value) {
        
        if (value !== this.get_enabled()) {
            this._enabled = value;
            this.raisePropertyChanged('enabled');
            if (!this.get_isUpdating()) {
                if (value) {
                    this._startTimer();
                }
                else {
                    this._stopTimer();
                }
            }
        }
    },

    
    add_tick: function(handler) {
        
        
        this.get_events().addHandler("tick", handler);
    },

    remove_tick: function(handler) {
        
        
        this.get_events().removeHandler("tick", handler);
    },

    dispose: function() {
        this.set_enabled(false);
        this._stopTimer();
        
        Sys.Timer.callBaseMethod(this, 'dispose');
    },
    
    updated: function() {
        Sys.Timer.callBaseMethod(this, 'updated');

        if (this._enabled) {
            this._stopTimer();
            this._startTimer();
        }
    },

    _timerCallback: function() {
        var handler = this.get_events().getHandler("tick");
        if (handler) {
            handler(this, Sys.EventArgs.Empty);
        }
    },

    _startTimer: function() {
        this._timer = window.setInterval(Function.createDelegate(this, this._timerCallback), this._interval);
    },

    _stopTimer: function() {
        window.clearInterval(this._timer);
        this._timer = null;
    }
}

Sys.Timer.descriptor = {
    properties: [   {name: 'interval', type: Number},
                    {name: 'enabled', type: Boolean} ],
    events: [ {name: 'tick'} ]
}

Sys.Timer.registerClass('Sys.Timer', Sys.Component);

/* END AjaxControlToolkit.Compat.Timer.Timer.js */
/* START AjaxControlToolkit.Compat.DragDrop.DragDropScripts.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


///////////////////////////////////////////////////////////////////////////////
// IDropSource

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.IDragSource = function() {
}
AjaxControlToolkit.IDragSource.prototype = {
    // Type get_dragDataType()
    get_dragDataType: function() { throw Error.notImplemented(); },
    // Object getDragData(Context)
    getDragData: function() { throw Error.notImplemented(); },
    // DragMode get_dragMode()
    get_dragMode: function() { throw Error.notImplemented(); },
    // void onDragStart()
    onDragStart: function() { throw Error.notImplemented(); },
    // void onDrag()
    onDrag: function() { throw Error.notImplemented(); },
    // void onDragEnd(Cancelled)
    onDragEnd: function() { throw Error.notImplemented(); }
}
AjaxControlToolkit.IDragSource.registerInterface('AjaxControlToolkit.IDragSource');

///////////////////////////////////////////////////////////////////////////////
// IDropTarget
AjaxControlToolkit.IDropTarget = function() {
}
AjaxControlToolkit.IDropTarget.prototype = {
    get_dropTargetElement: function() { throw Error.notImplemented(); },
    // bool canDrop(DragMode, DataType, Data)
    canDrop: function() { throw Error.notImplemented(); },
    // void drop(DragMode, DataType, Data)
    drop: function() { throw Error.notImplemented(); },
    // void onDragEnterTarget(DragMode, DataType, Data)
    onDragEnterTarget: function() { throw Error.notImplemented(); },
    // void onDragLeaveTarget(DragMode, DataType, Data)
    onDragLeaveTarget: function() { throw Error.notImplemented(); },
    // void onDragInTarget(DragMode, DataType, Data)
    onDragInTarget: function() { throw Error.notImplemented(); }
}
AjaxControlToolkit.IDropTarget.registerInterface('AjaxControlToolkit.IDropTarget');

///////////////////////////////////////////////
// DragMode
//

AjaxControlToolkit.DragMode = function() {
    throw Error.invalidOperation();
}
AjaxControlToolkit.DragMode.prototype = {
    Copy: 0,
    Move: 1
}
AjaxControlToolkit.DragMode.registerEnum('AjaxControlToolkit.DragMode');

////////////////////////////////////////////////////////////////////
// DragDropEventArgs
//

AjaxControlToolkit.DragDropEventArgs = function(dragMode, dragDataType, dragData) {
    this._dragMode = dragMode;
    this._dataType = dragDataType;
    this._data = dragData;
}
AjaxControlToolkit.DragDropEventArgs.prototype = {
    get_dragMode: function() {
        return this._dragMode || null;
    },
    get_dragDataType: function() {
        return this._dataType || null;
    },
    get_dragData: function() {
        return this._data || null;
    }
}
AjaxControlToolkit.DragDropEventArgs.registerClass('AjaxControlToolkit.DragDropEventArgs');


AjaxControlToolkit._DragDropManager = function() {
    this._instance = null;
    this._events =  null;
}
AjaxControlToolkit._DragDropManager.prototype = {

    add_dragStart: function(handler) {
        this.get_events().addHandler('dragStart', handler);
    },
    remove_dragStart: function(handler) {
        this.get_events().removeHandler('dragStart', handler);
    },
    
    get_events: function() {
    // todo: doc comments. this one is commented out (two //) due to a bug with the preprocessor.
        // <value type="Sys.EventHandlerList">
        // </value>
        if (!this._events) {
            this._events = new Sys.EventHandlerList();
        }
        return this._events;
    },
    
    add_dragStop: function(handler) {
        this.get_events().addHandler('dragStop', handler);
    },
    remove_dragStop: function(handler) {
        this.get_events().removeHandler('dragStop', handler);
    },
    
    _getInstance: function() {
        if (!this._instance) {
            if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
                this._instance = new AjaxControlToolkit.IEDragDropManager();
            }
            else {
                this._instance = new AjaxControlToolkit.GenericDragDropManager();
            }
            this._instance.initialize();
            this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart));
            this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop));
        }
        return this._instance;
    },
    
    startDragDrop: function(dragSource, dragVisual, context) {
        this._getInstance().startDragDrop(dragSource, dragVisual, context);
    },
    
    registerDropTarget: function(target) {
        this._getInstance().registerDropTarget(target);
    },
    
    unregisterDropTarget: function(target) {
        this._getInstance().unregisterDropTarget(target);
    },
    
    dispose: function() {
        delete this._events;
        Sys.Application.unregisterDisposableObject(this);
        Sys.Application.removeComponent(this);
    },
    
    _raiseDragStart: function(sender, eventArgs) {
        var handler = this.get_events().getHandler('dragStart');
        if(handler) {
            handler(this, eventArgs);
        }
    },
    
    _raiseDragStop: function(sender, eventArgs) {
        var handler = this.get_events().getHandler('dragStop');
        if(handler) {
            handler(this, eventArgs);
        }
    }
}
AjaxControlToolkit._DragDropManager.registerClass('AjaxControlToolkit._DragDropManager');
AjaxControlToolkit.DragDropManager = new AjaxControlToolkit._DragDropManager();


AjaxControlToolkit.IEDragDropManager = function() {
    AjaxControlToolkit.IEDragDropManager.initializeBase(this);
    
    this._dropTargets = null;
    // Radius of the cursor used to determine what drop target we 
    // are hovering. Anything below the cursor's zone may be a 
    // potential drop target.
    this._radius = 10;
    this._activeDragVisual = null;
    this._activeContext = null;
    this._activeDragSource = null;
    this._underlyingTarget = null;
    this._oldOffset = null;
    this._potentialTarget = null;
    this._isDragging = false;
    this._mouseUpHandler = null;
    this._documentMouseMoveHandler = null;
    this._documentDragOverHandler = null;
    this._dragStartHandler = null;
    this._mouseMoveHandler = null;
    this._dragEnterHandler = null;
    this._dragLeaveHandler = null;
    this._dragOverHandler = null;
    this._dropHandler = null;
}
AjaxControlToolkit.IEDragDropManager.prototype = {

    add_dragStart : function(handler) {
        this.get_events().addHandler("dragStart", handler);
    },
    
    remove_dragStart : function(handler) {
        this.get_events().removeHandler("dragStart", handler);
    },
    
    add_dragStop : function(handler) {
        this.get_events().addHandler("dragStop", handler);
    },
    
    remove_dragStop : function(handler) {
        this.get_events().removeHandler("dragStop", handler);
    },
    
    initialize : function() {
        AjaxControlToolkit.IEDragDropManager.callBaseMethod(this, 'initialize');
        this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);
        this._documentMouseMoveHandler = Function.createDelegate(this, this._onDocumentMouseMove);
        this._documentDragOverHandler = Function.createDelegate(this, this._onDocumentDragOver);
        this._dragStartHandler = Function.createDelegate(this, this._onDragStart);
        this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);
        this._dragEnterHandler = Function.createDelegate(this, this._onDragEnter);
        this._dragLeaveHandler = Function.createDelegate(this, this._onDragLeave);
        this._dragOverHandler = Function.createDelegate(this, this._onDragOver);
        this._dropHandler = Function.createDelegate(this, this._onDrop);
    },
    
    
    dispose : function() {
        if(this._dropTargets) {
            for (var i = 0; i < this._dropTargets; i++) {
                this.unregisterDropTarget(this._dropTargets[i]);
            }
            this._dropTargets = null;
        }
        
        AjaxControlToolkit.IEDragDropManager.callBaseMethod(this, 'dispose');
    },
    

    startDragDrop : function(dragSource, dragVisual, context) {
        var ev = window._event;
        
        // Don't allow drag and drop if there is another active drag operation going on.
        if (this._isDragging) {
            return;
        }
        
        this._underlyingTarget = null;
        this._activeDragSource = dragSource;
        this._activeDragVisual = dragVisual;
        this._activeContext = context;
        
        var mousePosition = { x: ev.clientX, y: ev.clientY };
        
        // By default we use absolute positioning, unless a different type 
        // of positioning is set explicitly.
        dragVisual.originalPosition = dragVisual.style.position;
        dragVisual.style.position = "absolute";
        
        document._lastPosition = mousePosition;
        dragVisual.startingPoint = mousePosition;
        var scrollOffset = this.getScrollOffset(dragVisual, /* recursive */ true);
        
        dragVisual.startingPoint = this.addPoints(dragVisual.startingPoint, scrollOffset);
        
        if (dragVisual.style.position == "absolute") {
            dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, CommonToolkitScripts.getLocation(dragVisual));
        }
        else {
            var left = parseInt(dragVisual.style.left);
            var top = parseInt(dragVisual.style.top);
            if (isNaN(left)) left = "0";
            if (isNaN(top)) top = "0";
            
            dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, { x: left, y: top });
        }
        
        // Monitor DOM changes.
        this._prepareForDomChanges();
        dragSource.onDragStart();
        var eventArgs = new AjaxControlToolkit.DragDropEventArgs(
            dragSource.get_dragMode(),
            dragSource.get_dragDataType(),
            dragSource.getDragData(context));
        var handler = this.get_events().getHandler('dragStart');
        if(handler) handler(this,eventArgs);
        this._recoverFromDomChanges();
        
        this._wireEvents();
        
        this._drag(/* isInitialDrag */ true);
    },
    
    
    _stopDragDrop : function(cancelled) {
        var ev = window._event;
        if (this._activeDragSource != null) {
            this._unwireEvents();
        
            if (!cancelled) {
                // The drag operation is cancelled if there 
                // is no drop target.
                cancelled = (this._underlyingTarget == null);
            }

            if (!cancelled && this._underlyingTarget != null) {
                this._underlyingTarget.drop(this._activeDragSource.get_dragMode(), this._activeDragSource.get_dragDataType(),
                    this._activeDragSource.getDragData(this._activeContext));
            }

            this._activeDragSource.onDragEnd(cancelled);
            var handler = this.get_events().getHandler('dragStop');
            if(handler) handler(this,Sys.EventArgs.Empty);
            
            this._activeDragVisual.style.position = this._activeDragVisual.originalPosition;
        
            this._activeDragSource = null;
            this._activeContext = null;
            this._activeDragVisual = null;
            this._isDragging = false;
            this._potentialTarget = null;
            ev.preventDefault();
        }
    },
    
    _drag : function(isInitialDrag) {
        var ev = window._event;
        var mousePosition = { x: ev.clientX, y: ev.clientY };
        
        // NOTE: We store the event object to be able to determine the current 
        // mouse position in Mozilla in other event handlers such as keydown.
        document._lastPosition = mousePosition;
        
        var scrollOffset = this.getScrollOffset(this._activeDragVisual, /* recursive */ true);
        var position = this.addPoints(this.subtractPoints(mousePosition, this._activeDragVisual.startingPoint), scrollOffset);
        
        // Check if the visual moved at all.
        if (!isInitialDrag && parseInt(this._activeDragVisual.style.left) == position.x && parseInt(this._activeDragVisual.style.top) == position.y) {
            return;
        }
        
        CommonToolkitScripts.setLocation(this._activeDragVisual, position);
        
        // Monitor DOM changes.
        this._prepareForDomChanges();
        this._activeDragSource.onDrag();
        this._recoverFromDomChanges();
        
        // Find a potential target.
        this._potentialTarget = this._findPotentialTarget(this._activeDragSource, this._activeDragVisual);
        
        var movedToOtherTarget = (this._potentialTarget != this._underlyingTarget || this._potentialTarget == null);
        // Check if we are leaving an underlying target.
        if (movedToOtherTarget && this._underlyingTarget != null) {
            this._leaveTarget(this._activeDragSource, this._underlyingTarget);
        }
        
        if (this._potentialTarget != null) {
            // Check if we are entering a new target.
            if (movedToOtherTarget) {
                this._underlyingTarget = this._potentialTarget;
                
                // Enter the new target.
                this._enterTarget(this._activeDragSource, this._underlyingTarget);
            }
            else {
                this._moveInTarget(this._activeDragSource, this._underlyingTarget);
            }
        }
        else {
            this._underlyingTarget = null;
        }
    },
    
    
    _wireEvents : function() {
        $addHandler(document, "mouseup", this._mouseUpHandler);
        $addHandler(document, "mousemove", this._documentMouseMoveHandler);
        $addHandler(document.body, "dragover", this._documentDragOverHandler);
        
        $addHandler(this._activeDragVisual, "dragstart", this._dragStartHandler);
        $addHandler(this._activeDragVisual, "dragend", this._mouseUpHandler);
        $addHandler(this._activeDragVisual, "drag", this._mouseMoveHandler);
    },
    
    
    _unwireEvents : function() {
        $removeHandler(this._activeDragVisual, "drag", this._mouseMoveHandler);
        $removeHandler(this._activeDragVisual, "dragend", this._mouseUpHandler);
        $removeHandler(this._activeDragVisual, "dragstart", this._dragStartHandler);

        $removeHandler(document.body, "dragover", this._documentDragOverHandler);
        $removeHandler(document, "mousemove", this._documentMouseMoveHandler);
        $removeHandler(document, "mouseup", this._mouseUpHandler);
    },
    
    
    registerDropTarget : function(dropTarget) {
        if (this._dropTargets == null) {
            this._dropTargets = [];
        }
        Array.add(this._dropTargets, dropTarget);
        
        this._wireDropTargetEvents(dropTarget);
    },
    
    
    unregisterDropTarget : function(dropTarget) {
        this._unwireDropTargetEvents(dropTarget);
        if (this._dropTargets) {
            Array.remove(this._dropTargets, dropTarget);
        }
    },
    
    
    _wireDropTargetEvents : function(dropTarget) {
        var associatedElement = dropTarget.get_dropTargetElement();
        associatedElement._dropTarget = dropTarget;
        $addHandler(associatedElement, "dragenter",  this._dragEnterHandler);
        $addHandler(associatedElement, "dragleave",  this._dragLeaveHandler);
        $addHandler(associatedElement, "dragover", this._dragOverHandler);
        $addHandler(associatedElement, "drop", this._dropHandler);
    },
    
    
    _unwireDropTargetEvents : function(dropTarget) {
        var associatedElement = dropTarget.get_dropTargetElement();
        // make sure that the handlers are not removed twice
        if(associatedElement._dropTarget)
        {
            associatedElement._dropTarget = null;
            $removeHandler(associatedElement, "dragenter",  this._dragEnterHandler);
            $removeHandler(associatedElement, "dragleave",  this._dragLeaveHandler);
            $removeHandler(associatedElement, "dragover", this._dragOverHandler);
            $removeHandler(associatedElement, "drop", this._dropHandler);
        }
    },
    
    
    _onDragStart : function(ev) {
        window._event = ev;
        document.selection.empty();
        
        var dt = ev.dataTransfer;
        if(!dt && ev.rawEvent) dt = ev.rawEvent.dataTransfer;
        
        var dataType = this._activeDragSource.get_dragDataType().toLowerCase();
        var data = this._activeDragSource.getDragData(this._activeContext);
        
        if (data) {
            // TODO: How do we want to deal with 'non-compatible types'?
            if (dataType != "text" && dataType != "url") {
                dataType = "text";
                
                if (data.innerHTML != null) {
                    data = data.innerHTML;
                }
            }
            
            dt.effectAllowed = "move";
            dt.setData(dataType, data.toString());
        }
    },
    
    _onMouseUp : function(ev) {
        window._event = ev;
        this._stopDragDrop(false);
    },
    
    _onDocumentMouseMove : function(ev) {
        window._event = ev;
        this._dragDrop();
    },

    _onDocumentDragOver : function(ev) {
        window._event = ev;
        if(this._potentialTarget) ev.preventDefault();
        //ev.returnValue = (_potentialTarget == null);
    },
    
    _onMouseMove : function(ev) {
        window._event = ev;
        this._drag();
    },
    
    _onDragEnter : function(ev) {
        window._event = ev;
        if (this._isDragging) {
            ev.preventDefault();
            //ev.returnValue = false;
        }
        else {
            // An external object is dragged to the drop target.
            var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
            for (var i = 0; i < dataObjects.length; i++) {
                this._dropTarget.onDragEnterTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);
            }
        }
    },
    
    _onDragLeave : function(ev) {
        window._event = ev;
        if (this._isDragging) {
            ev.preventDefault();
            //ev.returnValue = false;
        }
        else {
            // An external object is dragged to the drop target.
            var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
            for (var i = 0; i < dataObjects.length; i++) {
                this._dropTarget.onDragLeaveTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);
            }
        }
    },
    
    _onDragOver : function(ev) {
        window._event = ev;
        if (this._isDragging) {
            ev.preventDefault();
            //ev.returnValue = false;
        }
        else {
            // An external object is dragged over the drop target.
            var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
            for (var i = 0; i < dataObjects.length; i++) {
                this._dropTarget.onDragInTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);
            }
        }
    },
    
    _onDrop : function(ev) {
        window._event = ev;
        if (!this._isDragging) {
            // An external object is dropped on the drop target.
            var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));
            for (var i = 0; i < dataObjects.length; i++) {
                this._dropTarget.drop(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);
            }
        }
        ev.preventDefault();
        //ev.returnValue = false;
    },
    
    _getDropTarget : function(element) {
        while (element) {
            if (element._dropTarget != null) {
                return element._dropTarget;
            }
            element = element.parentNode;
        }
        return null;
    },
    
    _dragDrop : function() {
        if (this._isDragging) {
            return;
        }
        
        this._isDragging = true;
        this._activeDragVisual.dragDrop();
        document.selection.empty();
    },
    
    _moveInTarget : function(dragSource, dropTarget) {
        // Monitor DOM changes.
        this._prepareForDomChanges();
        dropTarget.onDragInTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));
        this._recoverFromDomChanges();
    },
    
    _enterTarget : function(dragSource, dropTarget) {
        // Monitor DOM changes.
        this._prepareForDomChanges();
        dropTarget.onDragEnterTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));
        this._recoverFromDomChanges();
    },
    
    _leaveTarget : function(dragSource, dropTarget) {
        // Monitor DOM changes.
        this._prepareForDomChanges();
        dropTarget.onDragLeaveTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));
        this._recoverFromDomChanges();
    },
    
    _findPotentialTarget : function(dragSource, dragVisual) {
        var ev = window._event;

        if (this._dropTargets == null) {
            return null;
        }
        
        var type = dragSource.get_dragDataType();
        var mode = dragSource.get_dragMode();
        var data = dragSource.getDragData(this._activeContext);

        // Get the current cursor location.
        var scrollOffset = this.getScrollOffset(document.body, /* recursive */ true);
        var x = ev.clientX + scrollOffset.x;
        var y = ev.clientY + scrollOffset.y;
        var cursorRect = { x: x - this._radius, y: y - this._radius, width: this._radius * 2, height: this._radius * 2 };
        
        // Find any targets near the current cursor location.
        var targetRect;
        for (var i = 0; i < this._dropTargets.length; i++) {
            targetRect = CommonToolkitScripts.getBounds(this._dropTargets[i].get_dropTargetElement());
            if (Sys.UI.Control.overlaps(cursorRect, targetRect) && this._dropTargets[i].canDrop(mode, type, data)) {
                return this._dropTargets[i];
            }
        }
        
        return null;
    },
    
    _prepareForDomChanges : function() {
        this._oldOffset = CommonToolkitScripts.getLocation(this._activeDragVisual);
    },
    
    _recoverFromDomChanges : function() {
        var newOffset = CommonToolkitScripts.getLocation(this._activeDragVisual);
        if (this._oldOffset.x != newOffset.x || this._oldOffset.y != newOffset.y) {
            this._activeDragVisual.startingPoint = this.subtractPoints(this._activeDragVisual.startingPoint, this.subtractPoints(this._oldOffset, newOffset));
            scrollOffset = this.getScrollOffset(this._activeDragVisual, /* recursive */ true);
            var position = this.addPoints(this.subtractPoints(document._lastPosition, this._activeDragVisual.startingPoint), scrollOffset);
            CommonToolkitScripts.setLocation(this._activeDragVisual, position);
        }
    },
    
    addPoints : function(p1, p2) {
        return { x: p1.x + p2.x, y: p1.y + p2.y };
    },
    
    subtractPoints : function(p1, p2) {
        return { x: p1.x - p2.x, y: p1.y - p2.y };
    },
    
    // -- Drag and drop helper methods.
    getScrollOffset : function(element, recursive) {
        var left = element.scrollLeft;
        var top = element.scrollTop;
        if (recursive) {
            var parent = element.parentNode;
            while (parent != null && parent.scrollLeft != null) {
                left += parent.scrollLeft;
                top += parent.scrollTop;
                // Don't include anything below the body.
                if (parent == document.body && (left != 0 && top != 0))
                    break;
                parent = parent.parentNode;
            }
        }
        return { x: left, y: top };
    },
    
    getBrowserRectangle : function() {
        var width = window.innerWidth;
        var height = window.innerHeight;
        if (width == null) {
            width = document.body.clientWidth;
        }
        if (height == null) {
            height = document.body.clientHeight;
        }
        
        return { x: 0, y: 0, width: width, height: height };
    },
    
    getNextSibling : function(item) {
        for (item = item.nextSibling; item != null; item = item.nextSibling) {
            if (item.innerHTML != null) {
                return item;
            }
        }
        return null;
    },
    
    hasParent : function(element) {
        return (element.parentNode != null && element.parentNode.tagName != null);
    }
}
AjaxControlToolkit.IEDragDropManager.registerClass('AjaxControlToolkit.IEDragDropManager', Sys.Component);

AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget = function(dropTarget) {
    if (dropTarget == null) {
        return [];
    }
    var ev = window._event;
    var dataObjects = [];
    var dataTypes = [ "URL", "Text" ];
    var data;
    for (var i = 0; i < dataTypes.length; i++) {
        var dt = ev.dataTransfer;
        if(!dt && ev.rawEvent) dt = ev.rawEvent.dataTransfer;
        data = dt.getData(dataTypes[i]);
        if (dropTarget.canDrop(AjaxControlToolkit.DragMode.Copy, dataTypes[i], data)) {
            if (data) {
                Array.add(dataObjects, { type : dataTypes[i], value : data });
            }
        }
    }

    return dataObjects;
}


AjaxControlToolkit.GenericDragDropManager = function() {
    AjaxControlToolkit.GenericDragDropManager.initializeBase(this);
    
    this._dropTargets = null;
    // Radius of the cursor used to determine what drop target we 
    // are hovering. Anything below the cursor's zone may be a 
    // potential drop target.
    this._scrollEdgeConst = 40;
    this._scrollByConst = 10;
    this._scroller = null;
    this._scrollDeltaX = 0;
    this._scrollDeltaY = 0;
    this._activeDragVisual = null;
    this._activeContext = null;
    this._activeDragSource = null;
    this._oldOffset = null;
    this._potentialTarget = null;
    this._mouseUpHandler = null;
    this._mouseMoveHandler = null;
    this._keyPressHandler = null;
    this._scrollerTickHandler = null;
}
AjaxControlToolkit.GenericDragDropManager.prototype = {
   
    initialize : function() {
        AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "initialize");
        this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);
        this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);
        this._keyPressHandler = Function.createDelegate(this, this._onKeyPress);
        this._scrollerTickHandler = Function.createDelegate(this, this._onScrollerTick);
        if (Sys.Browser.agent === Sys.Browser.Safari) {
            AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer(this);
        }
        this._scroller = new Sys.Timer();
        this._scroller.set_interval(10);
        this._scroller.add_tick(this._scrollerTickHandler);
    },

    startDragDrop : function(dragSource, dragVisual, context) {
        this._activeDragSource = dragSource;
        this._activeDragVisual = dragVisual;
        this._activeContext = context;
        
        AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "startDragDrop", [dragSource, dragVisual, context]);
    },
    
    _stopDragDrop : function(cancelled) {
        this._scroller.set_enabled(false);
        
        AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "_stopDragDrop", [cancelled]);
    },
    
    _drag : function(isInitialDrag) {
        AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "_drag", [isInitialDrag]);
        
        this._autoScroll();
    },
    
    _wireEvents : function() {
        $addHandler(document, "mouseup", this._mouseUpHandler);
        $addHandler(document, "mousemove", this._mouseMoveHandler);
        $addHandler(document, "keypress", this._keyPressHandler);
    },
    
    _unwireEvents : function() {
        $removeHandler(document, "keypress", this._keyPressHandler);
        $removeHandler(document, "mousemove", this._mouseMoveHandler);
        $removeHandler(document, "mouseup", this._mouseUpHandler);
    },
    
    _wireDropTargetEvents : function(dropTarget) {
        //
    },
    
    _unwireDropTargetEvents : function(dropTarget) {
        //
    },
    
    _onMouseUp : function(e) {
        window._event = e;
        this._stopDragDrop(false);
    },
    
    _onMouseMove : function(e) {
        window._event = e;
        this._drag();
    },
    
    _onKeyPress : function(e) {
        window._event = e;
        // Escape.
        var k = e.keyCode ? e.keyCode : e.rawEvent.keyCode;
        if (k == 27) {
            this._stopDragDrop(/* cancel */ true);
        }
    },
    
    _autoScroll : function() {
        var ev = window._event;
        var browserRect = this.getBrowserRectangle();
        if (browserRect.width > 0) {
            this._scrollDeltaX = this._scrollDeltaY = 0;
            if (ev.clientX < browserRect.x + this._scrollEdgeConst) this._scrollDeltaX = -this._scrollByConst;
            else if (ev.clientX > browserRect.width - this._scrollEdgeConst) this._scrollDeltaX = this._scrollByConst;
            if (ev.clientY < browserRect.y + this._scrollEdgeConst) this._scrollDeltaY = -this._scrollByConst;
            else if (ev.clientY > browserRect.height - this._scrollEdgeConst) this._scrollDeltaY = this._scrollByConst;
            if (this._scrollDeltaX != 0 || this._scrollDeltaY != 0) {
                this._scroller.set_enabled(true);
            }
            else {
                this._scroller.set_enabled(false);
            }
        }
    },
    
    _onScrollerTick : function() {
        var oldLeft = document.body.scrollLeft;
        var oldTop = document.body.scrollTop;
        window.scrollBy(this._scrollDeltaX, this._scrollDeltaY);
        var newLeft = document.body.scrollLeft;
        var newTop = document.body.scrollTop;
        
        var dragVisual = this._activeDragVisual;
        var position = { x: parseInt(dragVisual.style.left) + (newLeft - oldLeft), y: parseInt(dragVisual.style.top) + (newTop - oldTop) };
        CommonToolkitScripts.setLocation(dragVisual, position);
    }
}
AjaxControlToolkit.GenericDragDropManager.registerClass('AjaxControlToolkit.GenericDragDropManager', AjaxControlToolkit.IEDragDropManager);


if (Sys.Browser.agent === Sys.Browser.Safari) {
    AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer = function(ddm) {
        ddm._getScrollOffset = ddm.getScrollOffset;

        ddm.getScrollOffset = function(element, recursive) {
            return { x: 0, y: 0 };
        }

        ddm._getBrowserRectangle = ddm.getBrowserRectangle;

        ddm.getBrowserRectangle = function() {
            var browserRect = ddm._getBrowserRectangle();
            
            var offset = ddm._getScrollOffset(document.body, true);
            return { x: browserRect.x + offset.x, y: browserRect.y + offset.y,
                width: browserRect.width + offset.x, height: browserRect.height + offset.y };
        }
    }
}

/* END AjaxControlToolkit.Compat.DragDrop.DragDropScripts.js */
/* START AjaxControlToolkit.DragPanel.FloatingBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


AjaxControlToolkit.FloatingBehavior = function(element) {
    AjaxControlToolkit.FloatingBehavior.initializeBase(this,[element]);
    
    var _handle;
    var _location;
    var _dragStartLocation;
    var _profileProperty;
    var _profileComponent;
    
    var _mouseDownHandler = Function.createDelegate(this, mouseDownHandler);
    
    this.add_move = function(handler) {
        this.get_events().addHandler('move', handler);
    }
    this.remove_move = function(handler) {
        this.get_events().removeHandler('move', handler);
    }
    
    this.get_handle = function() {
        return _handle;
    }
    this.set_handle = function(value) {
        if (_handle != null) {
            $removeHandler(_handle, "mousedown", _mouseDownHandler);            
        }
    
        _handle = value;
        $addHandler(_handle, "mousedown", _mouseDownHandler);        
    }
    
    this.get_profileProperty = function() {
        return _profileProperty;
    }
    this.set_profileProperty = function(value) {
        //##DEBUG Sys.Debug.assert(!this.get_isInitialized() || _profileProperty === value, "You cannot change the profile property after initialization.");
        _profileProperty = value;
    }
    
    this.get_profileComponent = function() {
        return _profileComponent;
    }
    this.set_profileComponent = function(value) {
        _profileComponent = value;
    }
    
    this.get_location = function() {
        return _location;
    }
    this.set_location = function(value) {
        if (_location != value) {
            _location = value;
            if (this.get_isInitialized()) {                
                CommonToolkitScripts.setLocation(this.get_element(), _location);
            }
            this.raisePropertyChanged('location');
        }
    }
    
    this.initialize = function() {
        AjaxControlToolkit.FloatingBehavior.callBaseMethod(this, 'initialize');
        AjaxControlToolkit.DragDropManager.registerDropTarget(this);

        var el = this.get_element();

        
        if (!_location) {                       
            _location = CommonToolkitScripts.getLocation(el);
        }
        
        el.style.position = "fixed";
        CommonToolkitScripts.setLocation(el, _location);

//        var p = this.get_profileProperty();
//        if(p) {
//            var b = new Sys.Preview.Binding();
//            b.beginUpdate();
//            b.set_target(this);
//            b.set_property("location");
//            var profile = this.get_profileComponent();
//            if(!profile) profile = Sys.Preview.Services.Components.Profile.instance;
//            b.set_dataContext(profile);
//            b.set_dataPath(p);
//            b.set_direction(Sys.Preview.BindingDirection.InOut);            
//                      
//            // we must hook into the loaded event since the profile may be loaded and the location property
//            // will be different. But profile doesnt raise a change notificaiton for every property after a load
//            var a = new Sys.Preview.InvokeMethodAction();
//            a.beginUpdate();
//            a.set_eventSource(profile);
//            a.set_eventName("loadComplete");
//            a.set_target(b);
//            a.set_method("evaluateIn");

//            a.endUpdate();
//            b.endUpdate();

//            this._binding = b;
//            this._action = a;
//        }
    }
    
    this.dispose = function() {
        AjaxControlToolkit.DragDropManager.unregisterDropTarget(this);
        if (_handle && _mouseDownHandler) {
            $removeHandler(_handle, "mousedown", _mouseDownHandler);
            //_handle.detachEvent("onmousedown", _mouseDownHandler);
        }
        _mouseDownHandler = null;
        AjaxControlToolkit.FloatingBehavior.callBaseMethod(this, 'dispose');
    }
    
    this.checkCanDrag = function(element) {
        var undraggableTagNames = ["input", "button", "select", "textarea", "label"];
        var tagName = element.tagName;
        
        if ((tagName.toLowerCase() == "a") && (element.href != null) && (element.href.length > 0)) {
            return false;
        }
        if (Array.indexOf(undraggableTagNames, tagName.toLowerCase()) > -1) {
            return false;
        }
        return true;
    }
    
    function mouseDownHandler(ev) {
        window._event = ev;
        var el = this.get_element();
        
        if (this.checkCanDrag(ev.target)) {
            _dragStartLocation = CommonToolkitScripts.getLocation(el);
            
            ev.preventDefault();
            
            this.startDragDrop(el);
        }
    }

    // Type get_dataType()
    this.get_dragDataType = function() {
        return "_floatingObject";
    }
    
    // Object get_data(Context)
    this.getDragData = function(context) {
        return null;
    }
    
    // DragMode get_dragMode()
    this.get_dragMode = function() {
        return AjaxControlToolkit.DragMode.Move;
    }
    
    // void onDragStart()
    this.onDragStart = function() { }
    
    // void onDrag()
    this.onDrag = function() { }
    
    // void onDragEnd(Canceled)
    this.onDragEnd = function(canceled) {
        if (!canceled) {
            var handler = this.get_events().getHandler('move');
            if(handler) {
                var cancelArgs = new Sys.CancelEventArgs();
                handler(this, cancelArgs);
                canceled = cancelArgs.get_cancel();
            }            
        }
        
        var el = this.get_element();
        if (canceled) {
            // Restore the position of the control.
            CommonToolkitScripts.setLocation(el, _dragStartLocation);
        }
        else {
            var location = CommonToolkitScripts.getLocation(el);
            _location = location.x + ',' + location.y;
            this.raisePropertyChanged('location');
        }
    }
    
    this.startDragDrop = function(dragVisual) {
        AjaxControlToolkit.DragDropManager.startDragDrop(this, dragVisual, null);
    }
    
    this.get_dropTargetElement = function() {
        return document.body;
    }
    
    // bool canDrop(DragMode, DataType, Data)
    this.canDrop = function(dragMode, dataType, data) {
        return (dataType == "_floatingObject");
    }
    
    // void drop(DragMode, DataType, Data)
    this.drop = function(dragMode, dataType, data) {}
    
    // void onDragEnterTarget(DragMode, DataType, Data)
    this.onDragEnterTarget = function(dragMode, dataType, data) {}
    
    // void onDragLeaveTarget(DragMode, DataType, Data)
    this.onDragLeaveTarget = function(dragMode, dataType, data) {}
    
    // void onDragInTarget(DragMode, DataType, Data)
    this.onDragInTarget = function(dragMode, dataType, data) {}
}
//AjaxControlToolkit.FloatingBehavior.descriptor = {
//    properties: [   {name: "profileProperty", type: String},
//                    {name: "profileComponent", type: Object},
//                    {name: "dragData", type: Object, readOnly: true},
//                    {name: "dragDataType", type: String, readOnly: true},
//                    {name: "dragMode", type: AjaxControlToolkit.DragMode, readOnly: true},
//                    {name: "dropTargetElement", type: Object, readOnly: true},
//                    {name: "handle", type: Sys.UI.DomElement},
//                    {name: "location", type: String} ],
//    events: [   {name: "move"} ]
//}
AjaxControlToolkit.FloatingBehavior.registerClass('AjaxControlToolkit.FloatingBehavior', AjaxControlToolkit.BehaviorBase, AjaxControlToolkit.IDragSource, AjaxControlToolkit.IDropTarget, Sys.IDisposable);

/* END AjaxControlToolkit.DragPanel.FloatingBehavior.js */
/* START AjaxControlToolkit.RoundedCorners.RoundedCornersBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.BoxCorners = function() {
    /// <summary>
    /// Corners of an element
    /// </summary>
    /// <field name="None" type="Number" integer="true" />
    /// <field name="TopLeft" type="Number" integer="true" />
    /// <field name="TopRight" type="Number" integer="true" />
    /// <field name="BottomRight" type="Number" integer="true" />
    /// <field name="BottomLeft" type="Number" integer="true" />
    /// <field name="Top" type="Number" integer="true" />
    /// <field name="Right" type="Number" integer="true" />
    /// <field name="Bottom" type="Number" integer="true" />
    /// <field name="Left" type="Number" integer="true" />
    /// <field name="All" type="Number" integer="true" />
    throw Error.invalidOperation();
}
AjaxControlToolkit.BoxCorners.prototype = {
    None        : 0x00,

    TopLeft     : 0x01,
    TopRight    : 0x02,
    BottomRight : 0x04,
    BottomLeft  : 0x08,
    
    Top         : 0x01 | 0x02,
    Right       : 0x02 | 0x04,
    Bottom      : 0x04 | 0x08,
    Left        : 0x08 | 0x01,
    All         : 0x01 | 0x02 | 0x04 | 0x08
}
AjaxControlToolkit.BoxCorners.registerEnum("AjaxControlToolkit.BoxCorners", true);


AjaxControlToolkit.RoundedCornersBehavior = function(element) {
    /// <summary>
    /// The RoundedCornersBehavior rounds the corners of its target element
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM element associated with the behavior
    /// </param>
    AjaxControlToolkit.RoundedCornersBehavior.initializeBase(this, [element]);
    
    this._corners = AjaxControlToolkit.BoxCorners.All;
    this._radius = 5;
    this._color = null;
    this._parentDiv = null;
    this._originalStyle = null;
    this._borderColor = null;
}
AjaxControlToolkit.RoundedCornersBehavior.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>
        AjaxControlToolkit.RoundedCornersBehavior.callBaseMethod(this, 'initialize');
        this.buildParentDiv();
    },
    
    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>

        this.disposeParentDiv();
        AjaxControlToolkit.RoundedCornersBehavior.callBaseMethod(this, 'dispose');
    },

    buildParentDiv : function() {
        /// <summary>
        /// Create the surrounding div that will have rounded corners
        /// </summary>
        var e = this.get_element();

        if (!e) return;

        this.disposeParentDiv();
        
        var color = this.getBackgroundColor();
        var originalWidth = e.offsetWidth;
        var newParent = e.cloneNode(false);

        // move all children into the new div.
        this.moveChildren(e, newParent);

        // modify the target element to be transparent
        // and set up the new parent
        this._originalStyle = e.style.cssText;
        e.style.backgroundColor = "transparent";
        e.style.verticalAlign = "top";
        e.style.padding = "0";
        e.style.overflow = "";
        e.style.className = "";
        if (e.style.height) {
            // Increase the height to account for the rounded corners
            e.style.height = parseInt(CommonToolkitScripts.getCurrentStyle(e, 'height')) + (this._radius * 2) + "px";
        } else {
            // Note: Do NOT use CommonToolkitScripts.getCurrentStyle in the check below
            // because that breaks the work-around
            if (!e.style.width && (0 < originalWidth)) {
                // The following line works around a problem where IE renders the first
                // rounded DIV about 6 pixels too high if e doesn't have a width or height
                e.style.width = originalWidth + "px";
            }
        }

        // these are properties we don't want cloned down to the new parent
        newParent.style.position = "";
        newParent.style.border   = "";
        newParent.style.margin   = "";
        newParent.style.width    = "100%";
        newParent.id             = "";
        newParent.removeAttribute("control");

        if (this._borderColor) {
            newParent.style.borderTopStyle = "none";
            newParent.style.borderBottomStyle = "none";
            newParent.style.borderLeftStyle = "solid";
            newParent.style.borderRightStyle = "solid";
            newParent.style.borderLeftColor = this._borderColor;
            newParent.style.borderRightColor = this._borderColor;
            newParent.style.borderLeftWidth = "1px";
            newParent.style.borderRightWidth = "1px";
            if (this._radius == 0) {
                newParent.style.borderTopStyle = "solid";
                newParent.style.borderBottomStyle = "solid";
                newParent.style.borderTopColor = this._borderColor;
                newParent.style.borderBottomColor = this._borderColor;
                newParent.style.borderTopWidth = "1px";
                newParent.style.borderBottomWidth = "1px";
            }
        } else {
            newParent.style.borderTopStyle = "none";
            newParent.style.borderBottomStyle = "none";
            newParent.style.borderLeftStyle = "none";
            newParent.style.borderRightStyle = "none";
        }

        // build a set of steps on each end to fake the corners.
        //  ------- (step 0)
        //  -------- (step n-1)
        //  --------- (step n)
        //  XXXXXXXXX (inner div)
        //  XXXXXXXXX
        //  --------- (bottom step n)
        //  --------  (bottom step n-1)
        //  ------    (bottom step 0)

        var lastDiv = null;
        var radius = this._radius;
        var lines = this._radius;
        var lastDelta = 0;
        
        for (var i = lines; i > 0; i--) {

            // figure out how much we'll need to subtract from each item
            var angle = Math.acos(i / radius);
            var delta = radius - Math.round(Math.sin(angle) * radius);

            // build a 1 pixel tall div
            // that's delta pixels shorter on each end.

            // add the top one
            var newDiv = document.createElement("DIV");
            newDiv.__roundedDiv = true;
            newDiv.style.backgroundColor = color;
            newDiv.style.marginLeft = delta + "px";
            newDiv.style.marginRight = (delta - (this._borderColor ? 2 : 0)) + "px";
            newDiv.style.height = "1px";
            newDiv.style.fontSize = "1px"; // workaround for IE wierdness with 1px divs.
            newDiv.style.overflow = "hidden";

            if (this._borderColor) {
                newDiv.style.borderLeftStyle = "solid";
                newDiv.style.borderRightStyle = "solid";
                newDiv.style.borderLeftColor = this._borderColor;
                newDiv.style.borderRightColor = this._borderColor;
                
                var offset = Math.max(0, lastDelta - delta - 1);
                newDiv.style.borderLeftWidth = (offset + 1) + "px";
                newDiv.style.borderRightWidth = (offset + 1) + "px";
                
                if (i == lines) {
                    newDiv.__roundedDivNoBorder = true;
                    newDiv.style.backgroundColor = this._borderColor;
                }
            }

            e.insertBefore(newDiv, lastDiv);

            var topDiv = newDiv;

            // add the bottom one one
            newDiv = newDiv.cloneNode(true);
            newDiv.__roundedDiv = true;

            e.insertBefore(newDiv, lastDiv);

            var bottomDiv = newDiv;

            lastDiv = newDiv;
            lastDelta = delta;
            
            if (!this.isCornerSet(AjaxControlToolkit.BoxCorners.TopLeft)) {
                topDiv.style.marginLeft = "0";
                if (this._borderColor) {
                    topDiv.style.borderLeftWidth = "1px";
                }
            }
            if (!this.isCornerSet(AjaxControlToolkit.BoxCorners.TopRight)) {
                topDiv.style.marginRight = "0";
                if (this._borderColor) {
                    topDiv.style.borderRightWidth = "1px";
                    topDiv.style.marginRight = "-2px";
                }
            }
            if (!this.isCornerSet(AjaxControlToolkit.BoxCorners.BottomLeft)) {
                bottomDiv.style.marginLeft = "0";
                if (this._borderColor) {
                    bottomDiv.style.borderLeftWidth = "1px";
                }
            }
            if (!this.isCornerSet(AjaxControlToolkit.BoxCorners.BottomRight)) {
                bottomDiv.style.marginRight = "0";
                if (this._borderColor) {
                    bottomDiv.style.borderRightWidth = "1px";
                    bottomDiv.style.marginRight = "-2px";
                }
            }
        }

        // finally, add the newParent (which has all the original content)
        // into the div.
        e.insertBefore(newParent, lastDiv);
        this._parentDiv = newParent;
    },

    disposeParentDiv : function() {
        /// <summary>
        /// Dispose the surrounding div with rounded corners
        /// </summary>

        if (this._parentDiv) {
            // clean up the divs we added.
            var e = this.get_element();
            var children = e.childNodes;
            for (var i = children.length - 1; i >=0; i--) {
                var child = children[i];
                if (child) {
                    if (child == this._parentDiv) {
                        this.moveChildren(child, e);
                    }
                    try {
                        e.removeChild(child);
                    } catch(e) {
                        // Safari likes to throw NOT_FOUND_ERR (DOMException 8)
                        // but it seems to work fine anyway.
                    }
                }
            }

            // restore the original style
            if (this._originalStyle) {
                e.style.cssText = this._originalStyle;
                this._originalStyle = null;
            }
            this._parentDiv = null;
        }
    },

    getBackgroundColor : function() {
        /// <summary>
        /// Get the background color of the target element
        /// </summary>
        if (this._color) {
            return this._color;
        }
        return CommonToolkitScripts.getCurrentStyle(this.get_element(), 'backgroundColor');
    },

    moveChildren : function(src, dest) {
        /// <summary>
        /// Move the child nodes from one element to another
        /// </summary>
        /// <param name="src" type="Sys.UI.DomElement" domElement="true">
        /// DOM Element
        /// </param>
        /// <param name="dest" type="Sys.UI.DomElement" domElement="true">
        /// DOM Element
        /// </param>

        var moveCount = 0;
        while (src.hasChildNodes()) {
            var child = src.childNodes[0];
            child = src.removeChild(child);
            dest.appendChild(child);
            moveCount++;
        }
        return moveCount;
    },
    
    isCornerSet : function(corner) {
        /// <summary>
        /// Check whether the a flag for this corner has been set
        /// </summary>
        /// <param name="corner" type="AjaxControlTooolkit.BoxCorners">
        /// Corner to check
        /// </param>
        /// <returns type="Boolean">
        /// True if it is included in the flags, false otherwise
        /// </returns>
        return (this._corners & corner) != AjaxControlToolkit.BoxCorners.None;
    },
    
    setCorner : function(corner, value) {
        /// <summary>
        /// Set a corner as one that should be rounded
        /// </summary>
        /// <param name="corner" type="AjaxControlToolkit.BoxCorners">
        /// Corner to set
        /// </param>
        /// <param name="value" type="Boolean">
        /// True to set the value, False to clear it
        /// </param>
        if (value) {
            this.set_Corners(this._corners | corner);
        } else {
            this.set_Corners(this._corners & ~corner);
        }
    },
    
    get_Color : function() {
        /// <value type="String">
        /// The background color of the rounded area an corners.  By default this picks up the background color of the panel that it is attached to.
        /// </value>
        return this._color;
    },
    set_Color : function(value) {
        if (value != this._color) {
            this._color = value;
            this.buildParentDiv();
            this.raisePropertyChanged('Color');
        }
    },

    get_Radius : function() {
        /// <value type="Number" integer="true">
        /// The radius of the corners (and height of the added area).  Default is 5.
        /// </value>
        return this._radius;
    },
    set_Radius : function(value) {
        if (value != this._radius) {
            this._radius = value;
            this.buildParentDiv();
            this.raisePropertyChanged('Radius');
        }
    },
    
    get_Corners : function() {
        /// <value type="AjaxControlToolkit.BoxCorners">
        /// Corners that should be rounded
        /// </value>
        return this._corners;
    },
    set_Corners : function(value) {
        if (value != this._corners) {
            this._corners = value;
            this.buildParentDiv();
            this.raisePropertyChanged("Corners");
        }
    },
    
    get_BorderColor : function() {
        /// <value type="String">
        /// Color of the border (and hence the rounded corners)
        /// </value>
        return this._borderColor;
    },
    set_BorderColor : function(value) {
        if (value != this._borderColor) {
            this._borderColor = value;
            this.buildParentDiv();
            this.raisePropertyChanged("BorderColor");
        }
    }
}
AjaxControlToolkit.RoundedCornersBehavior.registerClass('AjaxControlToolkit.RoundedCornersBehavior', AjaxControlToolkit.BehaviorBase);
/* END AjaxControlToolkit.RoundedCorners.RoundedCornersBehavior.js */
/* START AjaxControlToolkit.DropShadow.DropShadowBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.DropShadowBehavior = function(element) {
    /// <summary>
    /// The DropShadowBehavior is used to attach a drop shadow to the element
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.DropShadowBehavior.initializeBase(this, [element]);

    // our property values
    this._opacity = 1.0;
    this._width = 5;

    // the div we create for the shadow.
    this._shadowDiv = null;

    // our timer for tracking position
    this._trackPosition = null;
    this._trackPositionDelay = 50;
    this._timer = null;
    this._tickHandler = null;
    this._roundedBehavior = null;
    this._shadowRoundedBehavior = null;

    this._rounded = false;
    this._radius = 5;

    // our cache of our last size and position for tracking
    this._lastX = null;
    this._lastY = null;
    this._lastW = null;
    this._lastH = null;
}
AjaxControlToolkit.DropShadowBehavior.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>
        AjaxControlToolkit.DropShadowBehavior.callBaseMethod(this, 'initialize');
        
        var e = this.get_element();

        // flip the styles position to relative so that we z-order properly.
        if (CommonToolkitScripts.getCurrentStyle(e, 'position', e.style.position) != "absolute") {
            e.style.position = "relative";
        }

        // set up our initial state
        if (this._rounded) {
            this.setupRounded();
        }
        if (this._trackPosition) {
            this.startTimer();
        }
        this.setShadow();
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        this.stopTimer();
        this.disposeShadowDiv();
        AjaxControlToolkit.DropShadowBehavior.callBaseMethod(this, 'dispose');
    },

    buildShadowDiv : function() {
        /// <summary>
        /// Create the div that we'll use as the shadow
        /// </summary>
        
        var e = this.get_element();

        if (!this.get_isInitialized() || !e || !this._width) return;

        var div = document.createElement("DIV");
        div.style.backgroundColor = "black";
        div.style.position= "absolute";
                
        if (e.id) {
            div.id = e.id + "_DropShadow";
        }

        // initialize a control around it, and
        // set up the opacity behavior and rounding
        this._shadowDiv = div;

       e.parentNode.appendChild(div);

       if (this._rounded ) {
            this._shadowDiv.style.height = Math.max(0, e.offsetHeight - (2*this._radius)) + "px";
            if (!this._shadowRoundedBehavior) {
                this._shadowRoundedBehavior = $create(AjaxControlToolkit.RoundedCornersBehavior, {"Radius": this._radius}, null, null, this._shadowDiv);
            } else {
                this._shadowRoundedBehavior.set_Radius(this._radius);
            }
        } else if (this._shadowRoundedBehavior) {
            this._shadowRoundedBehavior.set_Radius(0);
        }

        if (this._opacity != 1.0) {
            this.setupOpacity();
        }

        this.setShadow(false, true);
        this.updateZIndex();
    },

    disposeShadowDiv : function() {
        /// <summary>
        /// Dispose of the div we use as the shadow
        /// </summary>

        if (this._shadowDiv) {
            // on page teardown (or in an update panel, this may already
            // be gone)
            //
            if (this._shadowDiv.parentNode) {
                this._shadowDiv.parentNode.removeChild(this._shadowDiv);
            }            
            this._shadowDiv = null;
        }
        
        if (this._shadowRoundedBehavior) {
            this._shadowRoundedBehavior.dispose();
            this._shadowRoundedBehavior = null;            
        }
    },

    onTimerTick : function() {
        /// <summary>
        /// Timer's tick handler that is used to position the shadow when its target moves
        /// </summary>
        this.setShadow();
    },

    startTimer : function() {
        /// <summary>
        /// Start the timer (and hence start tracking the bounds of the target element)
        /// </summary>

        if (!this._timer) {
            if (!this._tickHandler) {
                this._tickHandler = Function.createDelegate(this, this.onTimerTick);
            }
            this._timer = new Sys.Timer();
            this._timer.set_interval(this._trackPositionDelay);
            this._timer.add_tick(this._tickHandler);
            this._timer.set_enabled(true);
        }
    },

    stopTimer : function() {
        /// <summary>
        /// Stop the timer (and hence stop tracking the bounds of the target element)
        /// </summary>

        // on stop, just clean the thing up completely
        if (this._timer) {
            this._timer.remove_tick(this._tickHandler);
            this._timer.set_enabled(false);
            this._timer.dispose();
            this._timer = null;
        }
    },

    setShadow : function(force, norecurse) {
        /// <summary>
        /// This function does the heavy lifting of positioning and sizing the shadow.
        /// It caches values to avoid extra work - it's called on a timer so we need to
        /// keep it light weight.
        /// </summary>
        /// <param name="force" type="Boolean">
        /// Whether to force the bounds change
        /// </param>
        /// <param name="norecurse" type="Boolean">
        /// Whether to recurse if we need to recreate the shadow div
        /// </param>

        var e = this.get_element();
        if (!this.get_isInitialized() || !e || (!this._width && !force)) return;

        var existingShadow = this._shadowDiv;
        if (!existingShadow) {
            this.buildShadowDiv();
        }

        // Consider calling offsetLeft first to avoid recursive math of location?                
        var location = AjaxControlToolkit.CommonToolkitScripts.getLocation(e);
        
        if (force || this._lastX != location.x || this._lastY != location.y || !existingShadow) {
            this._lastX = location.x;
            this._lastY = location.y;

            var w = this.get_Width();
            
            // to work around setlocation bug because elements embedded within fixed\absolute
            // elements are set relative to their parent instead of the window
            if((e.parentNode.style.position == "absolute") || (e.parentNode.style.position == "fixed") )
            {
                location.x = w;
                location.y = w;
            }
            else
            {
                location.x += w;
                location.y += w;
            }
            AjaxControlToolkit.CommonToolkitScripts.setLocation(this._shadowDiv, location);
        }

        var h = e.offsetHeight;
        var w = e.offsetWidth;
        if (force || h != this._lastH || w != this._lastW || !existingShadow) {
            this._lastW = w;
            this._lastH = h;
            if (!this._rounded || !existingShadow || norecurse) {
               this._shadowDiv.style.width = w + "px";
               this._shadowDiv.style.height = h + "px";
            } else {
                // recurse if we need to redo the div
                this.disposeShadowDiv();
                this.setShadow();
            }
        }

        if (this._shadowDiv) {
            this._shadowDiv.style.visibility = CommonToolkitScripts.getCurrentStyle(e, 'visibility');
        }
    },

    setupOpacity : function() {
        /// <summary>
        /// Set the opacity of the shadow div
        /// </summary>
        if (this.get_isInitialized() && this._shadowDiv) {
            CommonToolkitScripts.setElementOpacity(this._shadowDiv, this._opacity);
        }
    },

    setupRounded : function() {
        /// <summary>
        /// Demand create and initialize the RoundedCornersBehavior
        /// </summary>
        
        if (!this._roundedBehavior && this._rounded) {
            this._roundedBehavior = $create(AjaxControlToolkit.RoundedCornersBehavior, null, null, null, this.get_element());            
        }
        if (this._roundedBehavior) {
            this._roundedBehavior.set_Radius(this._rounded ? this._radius : 0);
        }
    },

    updateZIndex : function() {
        /// <summary>
        /// Update the z-Index so the shadow div remains behind the target element
        /// </summary>

        if (!this._shadowDiv) return;
        
        var e = this.get_element();
        var targetZIndex = e.style.zIndex;
        var shadowZIndex = this._shadowDiv.style.zIndex;

        if (shadowZIndex && targetZIndex && targetZIndex > shadowZIndex) {
            return;
        } else {
           targetZIndex = Math.max(2, targetZIndex);
           shadowZIndex = targetZIndex - 1;
        }
        e.style.zIndex = targetZIndex;
        this._shadowDiv.style.zIndex = shadowZIndex;
    },

    updateRoundedCorners : function() {
        /// <summary>
        /// Update the RoundedCorndersBehavior and recreate the shadow div so its corners are rounded as well
        /// </summary>
        if (this.get_isInitialized()) {
            this.setupRounded();
            this.disposeShadowDiv();
            this.setShadow();
        }
    },

    get_Opacity : function() {
        /// <value type="Number">
        /// The opacity of the drop shadow, from 0 (fully transparent) to 1.0 (fully opaque). The default value is .5.
        /// </value>
        return this._opacity;
    },
    set_Opacity : function(value) {
        if (this._opacity != value) {
            this._opacity = value;
            this.setupOpacity();
            this.raisePropertyChanged('Opacity');
        }
    },

    get_Rounded : function() {
        /// <value type="Boolean">
        /// Whether or not the corners of the target and drop shadow should be rounded
        /// </value>
        return this._rounded;
    },
    set_Rounded : function(value) {
        if (value != this._rounded) {
            this._rounded = value;
            this.updateRoundedCorners();
            this.raisePropertyChanged('Rounded');
        }
    },

    get_Radius : function() {
        /// <value type="Number" integer="true">
        /// Radius, in pixels, of the rounded corners
        /// </value>
        return this._radius;
    },
    set_Radius : function(value) {
        if (value != this._radius) {
            this._radius = value;
            this.updateRoundedCorners();
            this.raisePropertyChanged('Radius');
        }
    },

    get_Width : function() {
        /// <value type="Number" integer="true">
        /// Width in pixels of the drop shadow.  The default value is 5 pixels.
        /// </value>
        return this._width;
    },
    set_Width : function(value) {
        if (value != this._width) {
            this._width = value;
            
            if (this._shadowDiv) {
                Sys.UI.DomElement.setVisible(this._shadowDiv, value > 0);
            }
            
            this.setShadow(true);
            this.raisePropertyChanged('Width');
        }
    },

    get_TrackPositionDelay : function() {
        /// <value type="Number">
        /// Length of the timer interval used when tracking the position of the target
        /// </value>
        return this._trackPositionDelay;
    },
    set_TrackPositionDelay : function(value) {
        if (value != this._trackPositionDelay) {
            this._trackPositionDelay = value;
            if (this._trackPosition) {
                this.stopTimer();
                this.startTimer();
            }
            this.raisePropertyChanged('TrackPositionDelay');
        }
    },

    get_TrackPosition : function() {
        /// <value type="Boolean">
        /// Whether the drop shadow should track the position of the panel it is attached to. Use this if the panel is absolutely positioned or will otherwise move.
        /// </value>
        return this._trackPosition;
    },
    set_TrackPosition : function(value) {
        if (value != this._trackPosition) {
            this._trackPosition = value;
            if (this.get_element()) {
                if (value) {
                    this.startTimer();
                } else {
                    this.stopTimer();
                }
            }
            this.raisePropertyChanged('TrackPosition');
        }
    }
}
AjaxControlToolkit.DropShadowBehavior.registerClass('AjaxControlToolkit.DropShadowBehavior', AjaxControlToolkit.BehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.DropShadowBehavior.callBaseMethod(this, 'getDescriptor');
//        td.addProperty('Opacity', Number);
//        td.addProperty('Width', Number);
//        td.addProperty('TrackPosition', Boolean);
//        td.addProperty('TrackPositionDelay', Number);
//        td.addProperty('Rounded', Boolean);
//        td.addProperty('Radius', Number);
//        return td;
//    },
/* END AjaxControlToolkit.DropShadow.DropShadowBehavior.js */
/* START AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js */
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.ModalPopupBehavior = function(element) {
    /// <summary>
    /// The ModalPopupBehavior is used to display the target element as a modal dialog
    /// </summary>
    /// <param name="element" type="Sys.UI.DomElement" domElement="true">
    /// DOM Element the behavior is associated with
    /// </param>
    AjaxControlToolkit.ModalPopupBehavior.initializeBase(this, [element]);
    
    // Properties
    this._PopupControlID = null;
    this._PopupDragHandleControlID = null;
    this._BackgroundCssClass = null;
    this._DropShadow = false;
    this._Drag = false;
    this._OkControlID = null;
    this._CancelControlID = null;
    this._OnOkScript = null;
    this._OnCancelScript = null;
    this._xCoordinate = -1;
    this._yCoordinate = -1;

    // Variables
    this._backgroundElement = null;
    this._foregroundElement = null;
    this._dragHandleElement = null;
    this._showHandler = null;
    this._okHandler = null;
    this._cancelHandler = null;
    this._scrollHandler = null;
    this._resizeHandler = null;
    this._windowHandlersAttached = false;

    this._dropShadowBehavior = null;
    this._dragBehavior = null;

    this._saveTabIndexes = new Array();
    this._saveDesableSelect = new Array();
    this._tagWithTabIndex = new Array('A','AREA','BUTTON','INPUT','OBJECT','SELECT','TEXTAREA','IFRAME');
}
AjaxControlToolkit.ModalPopupBehavior.prototype = {
    initialize : function() {
        /// <summary>
        /// Initialize the behavior
        /// </summary>
        
        /*
            <div superpopup - drag container resizable><div -- drag handle\dropshadow foreground></div></div>
        */
        AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, 'initialize');
        if(this._PopupDragHandleControlID)
            this._dragHandleElement = $get(this._PopupDragHandleControlID);
        this._foregroundElement = $get(this._PopupControlID);
        this._backgroundElement = document.createElement('div');
        this._backgroundElement.style.display = 'none';
        this._backgroundElement.style.position = 'absolute';
        this._backgroundElement.style.left = '0px';
        this._backgroundElement.style.top = '0px';
        // Want zIndex to big enough that the background sits above everything else
        // CSS 2.1 defines no bounds for the <integer> type, so pick arbitrarily
        this._backgroundElement.style.zIndex = 10000;
        if (this._BackgroundCssClass) {
            this._backgroundElement.className = this._BackgroundCssClass;
        }
        this._foregroundElement.parentNode.appendChild(this._backgroundElement);

        this._foregroundElement.style.display = 'none';
        this._foregroundElement.style.position = 'absolute';
        this._foregroundElement.style.zIndex = CommonToolkitScripts.getCurrentStyle(this._backgroundElement, 'zIndex', this._backgroundElement.style.zIndex) + 1;
        
        if(!this._dragHandleElement)
            this._dragHandleElement = this._foregroundElement;

        this._showHandler = Function.createDelegate(this, this._onShow);
        $addHandler(this.get_element(), 'click', this._showHandler);

        if (this._OkControlID) {
            this._okHandler = Function.createDelegate(this, this._onOk);
            $addHandler($get(this._OkControlID), 'click', this._okHandler);
        }

        if (this._CancelControlID) {
            this._cancelHandler = Function.createDelegate(this, this._onCancel);
            $addHandler($get(this._CancelControlID), 'click', this._cancelHandler);
        }

        this._scrollHandler = Function.createDelegate(this, this._onLayout);
        this._resizeHandler = Function.createDelegate(this, this._onLayout);

        // Need to know when partial updates complete
        this.registerPartialUpdateEvents();
    },

    dispose : function() {
        /// <summary>
        /// Dispose the behavior
        /// </summary>
        this._detachPopup();
        
        this._scrollHandler = null;
        this._resizeHandler = null;
        if (this._cancelHandler && $get(this._CancelControlID)) {
            $removeHandler($get(this._CancelControlID), 'click', this._cancelHandler);
            this._cancelHandler = null;
        }
        if (this._okHandler && $get(this._OkControlID)) {
            $removeHandler($get(this._OkControlID), 'click', this._okHandler);
            this._okHandler = null;
        }
        if (this._showHandler) {
            $removeHandler(this.get_element(), 'click', this._showHandler);
            this._showHandler = null;
        }
        
        AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, 'dispose');
    },

    _attachPopup : function() {
        /// <summary>
        /// Attach the event handlers for the popup
        /// </summary>

        if (this._DropShadow && !this._dropShadowBehavior) {
            this._dropShadowBehavior = $create(AjaxControlToolkit.DropShadowBehavior, {}, null, null, this._dragHandleElement);
        }
        if (this._Drag && !this._dragBehavior) {
            this._dragBehavior = $create(AjaxControlToolkit.FloatingBehavior, {"handle" : this._dragHandleElement}, null, null, this._foregroundElement);
        }

        $addHandler(window, 'resize', this._resizeHandler);
        $addHandler(window, 'scroll', this._scrollHandler);
        this._windowHandlersAttached = true;
    },

    _detachPopup : function() {
        /// <summary>
        /// Detach the event handlers for the popup
        /// </summary>

        if (this._windowHandlersAttached) {
            if (this._scrollHandler) {
                $removeHandler(window, 'scroll', this._scrollHandler);
            }

            if (this._resizeHandler) {
                $removeHandler(window, 'resize', this._resizeHandler);
            }
            this._windowHandlersAttached = false;
        }
        
        if (this._dragBehavior) {
            this._dragBehavior.dispose();
            this._dragBehavior = null;
        }       
        
        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.dispose();
            this._dropShadowBehavior = null;
        }

    },

    _onShow : function(e) {
        /// <summary>
        /// Handler for the target's click event
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        if (!this.get_element().disabled) {
            this.show();
            e.preventDefault();
            return false;
        }
    },

    _onOk : function(e) {
        /// <summary>
        /// Handler for the modal dialog's OK button click
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        var element = $get(this._OkControlID);
        if (element && !element.disabled) {
            this.hide();
            e.preventDefault();
            if (this._OnOkScript) {
                window.setTimeout(this._OnOkScript, 0);
            }
            return false;
        }
    },

    _onCancel : function(e) {
        /// <summary>
        /// Handler for the modal dialog's Cancel button click
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        var element = $get(this._CancelControlID);
        if (element && !element.disabled) {
            this.hide();
            e.preventDefault();
            if (this._OnCancelScript) {
                window.setTimeout(this._OnCancelScript, 0);
            }
            return false;
        }
    },

    _onLayout : function() {
        /// <summary>
        /// Handler for scrolling and resizing events that would require a repositioning of the modal dialog
        /// </summary>
        this._layout();
    },

    show : function() {
        /// <summary>
        /// Display the element referenced by PopupControlID as a modal dialog
        /// </summary>
        AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, 'populate');

        this.raiseShowing();

        this._attachPopup();

        this._backgroundElement.style.display = '';
        this._foregroundElement.style.display = '';

        // Disable TAB
        this.disableTab();

        this._layout();
        // On pages that don't need scrollbars, Firefox and Safari act like
        // one or both are present the first time the layout code runs which
        // obviously leads to display issues - run the layout code a second
        // time to work around this problem
        this._layout();
        
        this.raiseShown();
    },

    disableTab : function() {
        /// <summary>
        /// Change the tab indices so we only tab through the modal popup
        /// (and hide SELECT tags in IE6)
        /// </summary>

        var i = 0;
        var tagElements;
        var tagElementsInPopUp = new Array();
        Array.clear(this._saveTabIndexes);

        //Save all popup's tag in tagElementsInPopUp
        for (var j = 0; j < this._tagWithTabIndex.length; j++) {
            tagElements = this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]);
            for (var k = 0 ; k < tagElements.length; k++) {
                tagElementsInPopUp[i] = tagElements[k];
                i++;
            }
        }

        i = 0;
        for (var j = 0; j < this._tagWithTabIndex.length; j++) {
            tagElements = document.getElementsByTagName(this._tagWithTabIndex[j]);
            for (var k = 0 ; k < tagElements.length; k++) {
                if (Array.indexOf(tagElementsInPopUp, tagElements[k]) == -1)  {
                    this._saveTabIndexes[i] = {tag: tagElements[k], index: tagElements[k].tabIndex};
                    tagElements[k].tabIndex="-1";
                    i++;
                }
            }
        }

        //IE6 Bug with SELECT element always showing up on top
        i = 0;
        if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
            //Save SELECT in PopUp
            var tagSelectInPopUp = new Array();
            for (var j = 0; j < this._tagWithTabIndex.length; j++) {
                tagElements = this._foregroundElement.getElementsByTagName('SELECT');
                for (var k = 0 ; k < tagElements.length; k++) {
                    tagSelectInPopUp[i] = tagElements[k];
                    i++;
                }
            }

            i = 0;
            Array.clear(this._saveDesableSelect);
            tagElements = document.getElementsByTagName('SELECT');
            for (var k = 0 ; k < tagElements.length; k++) {
                if (Array.indexOf(tagSelectInPopUp, tagElements[k]) == -1)  {
                    this._saveDesableSelect[i] = {tag: tagElements[k], visib: CommonToolkitScripts.getCurrentStyle(tagElements[k], 'visibility')} ;
                    tagElements[k].style.visibility = 'hidden';
                    i++;
                }
            }
        }
    },

    restoreTab : function() {
        /// <summary>
        /// Restore the tab indices so we tab through the page like normal
        /// (and restore SELECT tags in IE6)
        /// </summary>

        for (var i = 0; i < this._saveTabIndexes.length; i++) {
            this._saveTabIndexes[i].tag.tabIndex = this._saveTabIndexes[i].index;
        }

        //IE6 Bug with SELECT element always showing up on top
        if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
            for (var k = 0 ; k < this._saveDesableSelect.length; k++) {
                this._saveDesableSelect[k].tag.style.visibility = this._saveDesableSelect[k].visib;
            }
        }
    },

    hide : function() {
        /// <summary>
        /// Hide the modal dialog
        /// </summary>

        this.raiseHiding();
        
        this._backgroundElement.style.display = 'none';
        this._foregroundElement.style.display = 'none';

        this.restoreTab();

        this._detachPopup();
        
        this.raiseHidden();
    },

    _layout : function() {
        /// <summary>
        /// Position the modal dialog in the center of the screen
        /// </summary>

        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        var clientBounds = CommonToolkitScripts.getClientBounds();
        var clientWidth = clientBounds.width;
        var clientHeight = clientBounds.height;
        this._backgroundElement.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth)+'px';
        this._backgroundElement.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight)+'px';

        var isIE6 = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7);
        if(this._xCoordinate < 0)
        {
            this._foregroundElement.style.left = scrollLeft+((clientWidth-this._foregroundElement.offsetWidth)/2)+'px';
        }
        else
        {
            if(isIE6)
            {
                this._foregroundElement.style.position = 'absolute';
                this._foregroundElement.style.left = (this._xCoordinate + scrollLeft) + 'px';
            }
            else
            {
                this._foregroundElement.style.position = 'fixed';
                this._foregroundElement.style.left = this._xCoordinate + 'px';
            }
        }
        if(this._yCoordinate < 0)
        {
            this._foregroundElement.style.top = scrollTop+((clientHeight-this._foregroundElement.offsetHeight)/2)+'px';
        }
        else
        {
            if(isIE6)
            {
                this._foregroundElement.style.position = 'absolute';
                this._foregroundElement.style.top = (this._yCoordinate + scrollTop) + 'px';
            }
            else
            {
                this._foregroundElement.style.position = 'fixed';
                this._foregroundElement.style.top = this._yCoordinate + 'px';
            }
        }
        
        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.setShadow();
            window.setTimeout(Function.createDelegate(this, this._fixupDropShadowBehavior), 0);
        }
    },

    _fixupDropShadowBehavior : function() {
        /// <summary>
        /// Some browsers don't update the location values immediately, so
        /// the location of the drop shadow would always be a step behind
        /// without this method
        /// </summary>

        if (this._dropShadowBehavior) {
            this._dropShadowBehavior.setShadow();
        }
    },

    // Show the popup if asked to
    _partialUpdateEndRequest : function(sender, endRequestEventArgs) {
        AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]);

        if (this.get_element()) {
            // Look up result by element's ID
            var action = endRequestEventArgs.get_dataItems()[this.get_element().id];
            if ("show" == action) {
                this.show();
            } else if ("hide" == action) {
                this.hide();
            }
        }

        // Async postback may have added content; re-layout to accomodate it
        this._layout();
    },

    _onPopulated : function(sender, eventArgs) {
        AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]);

        // Dynamic populate may have added content; re-layout to accomodate it
        this._layout();
    },
    
    raiseShowing : function() {
        /// <summary>
        /// Raise the <code>showing</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('showing');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_showing : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>showiwng</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("showing", handler);
    },
    
    remove_showing : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>showing</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("showing", handler);
    },
    
    raiseShown : function() {
        /// <summary>
        /// Raise the <code>shown</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('shown');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_shown : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>shown</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("shown", handler);
    },
    
    remove_shown : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>shown</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("shown", handler);
    },
    
    raiseHiding : function() {
        /// <summary>
        /// Raise the <code>hiding</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('hiding');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_hiding : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>hiding</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("hiding", handler);
    },
    
    remove_hiding : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>hiding</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("hiding", handler);
    },
    
    raiseHidden : function() {
        /// <summary>
        /// Raise the <code>hidden</code> event
        /// </summary>
        /// <returns />
        var handlers = this.get_events().getHandler('hidden');
        if (handlers) {
            handlers(this, Sys.EventArgs.Empty);
        }
    },
    
    add_hidden : function(handler) {
        /// <summary>
        /// Adds an event handler for the <code>hidden</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to add to the event.
        /// </param>
        /// <returns />
        this.get_events().addHandler("hidden", handler);
    },
    
    remove_hidden : function(handler) {
        /// <summary>
        /// Removes an event handler for the <code>hidden</code> event.
        /// </summary>
        /// <param name="handler" type="Function">
        /// The handler to remove from the event.
        /// </param>
        /// <returns />
        this.get_events().removeHandler("hidden", handler);
    },

    get_PopupControlID : function() {
        /// <value type="String">
        /// The ID of the element to display as a modal popup
        /// </value>
        return this._PopupControlID;
    },
    set_PopupControlID : function(value) {
        if (this._PopupControlID != value) {
            this._PopupControlID = value;
            this.raisePropertyChanged('PopupControlID');
        }
    },

    get_X: function() {
        /// <value type="Number" integer="true">
        /// The number of pixels from the left of the browser to position the modal popup.
        /// </value>
        return this._xCoordinate;
    },
    set_X: function(value) {
        if (this._xCoordinate != value) {
            this._xCoordinate = value;
            this.raisePropertyChanged('X');
        }
    },

    get_Y: function() {
        /// <value type="Number" integer="true">
        /// The number of pixels from the top of the browser to position the modal popup.
        /// </value>
        return this._yCoordinate;
    },
    set_Y: function(value) {
        if (this._yCoordinate != value) {
            this._yCoordinate = value;
            this.raisePropertyChanged('Y');
        }
    },
       
    get_PopupDragHandleControlID : function() {
        /// <value type="String">
        /// The ID of the element to display as the drag handle for the modal popup
        /// </value>
        return this._PopupDragHandleControlID;
    },
    set_PopupDragHandleControlID : function(value) {
        if (this._PopupDragHandleControlID != value) {
            this._PopupDragHandleControlID = value;
            this.raisePropertyChanged('PopupDragHandleControlID');
        }
    },
        
    get_BackgroundCssClass : function() {
        /// <value type="String">
        /// The CSS class to apply to the background when the modal popup is displayed
        /// </value>
        return this._BackgroundCssClass;
    },
    set_BackgroundCssClass : function(value) {
        if (this._BackgroundCssClass != value) {
            this._BackgroundCssClass = value;
            this.raisePropertyChanged('BackgroundCssClass');
        }
    },

    get_DropShadow : function() {
        /// <value type="Boolean">
        /// Whether or not a drop-shadow should be added to the modal popup
        /// </value>
        return this._DropShadow;
    },
    set_DropShadow : function(value) {
        if (this._DropShadow != value) {
            this._DropShadow = value;
            this.raisePropertyChanged('DropShadow');
        }
    },

    get_Drag : function() {
        /// <value type="Boolean">
        /// Whether or not to make the modal popup draggable
        /// </value>
        return this._Drag;
    },
    set_Drag : function(value) {
        if (this._Drag != value) {
            this._Drag = value;
            this.raisePropertyChanged('Drag');
        }
    },

    get_OkControlID : function() {
        /// <value type="String">
        /// The ID of the element that dismisses the modal popup
        /// </value>
        return this._OkControlID;
    },
    set_OkControlID : function(value) {
        if (this._OkControlID != value) {
            this._OkControlID = value;
            this.raisePropertyChanged('OkControlID');
        }
    },

    get_CancelControlID : function() {
        /// <value type="String">
        /// The ID of the element that cancels the modal popup
        /// </value>
        return this._CancelControlID;
    },
    set_CancelControlID : function(value) {
        if (this._CancelControlID != value) {
            this._CancelControlID = value;
            this.raisePropertyChanged('CancelControlID');
        }
    },

    get_OnOkScript : function() {
        /// <value type="String">
        /// Script to run when the modal popup is dismissed with the OkControlID
        /// </value>
        return this._OnOkScript;
    },
    set_OnOkScript : function(value) {
        if (this._OnOkScript != value) {
            this._OnOkScript = value;
            this.raisePropertyChanged('OnOkScript');
        }
    },

    get_OnCancelScript : function() {
        /// <value type="String">
        /// Script to run when the modal popup is dismissed with the CancelControlID
        /// </value>
        return this._OnCancelScript;
    },
    set_OnCancelScript : function(value) {
        if (this._OnCancelScript != value) {
            this._OnCancelScript = value;
            this.raisePropertyChanged('OnCancelScript');
        }
    }
}
AjaxControlToolkit.ModalPopupBehavior.registerClass('AjaxControlToolkit.ModalPopupBehavior', AjaxControlToolkit.DynamicPopulateBehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this, 'getDescriptor');
//        //  Add property declarations
//        td.addProperty('PopupControlID', String);
//        td.addProperty('BackgroundCssClass', String);
//        td.addProperty('DropShadow', Boolean);
//        td.addProperty('OkControlID', String);
//        td.addProperty('CancelControlID', String);
//        td.addProperty('OnOkScript', String);
//        td.addProperty('OnCancelScript', String);
//        return td;
//    },
AjaxControlToolkit.ModalPopupBehavior.invokeViaServer = function(behaviorID, show) {
    /// <summary>
    /// This static function (that is intended to be called from script emitted
    /// on the server) will show or hide the behavior associated with behaviorID
    /// (i.e. to use this, the ModalPopupExtender must have an ID or BehaviorID) and
    /// will either show or hide depending on the show parameter.
    /// </summary>
    /// <param name="behaviorID" type="String">
    /// ID of the modal popup behavior
    /// </param>
    /// <param name="show" type="Boolean">
    /// Whether to show or hide the modal popup
    /// </param>
    var behavior = $find(behaviorID);
    if (behavior) {
        if (show) {
            behavior.show();
        } else {
            behavior.hide();
        }
    }
}

/* END AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js */
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ctl00_ScriptManager_HiddenField').value += ';;Telerik.Web.UI, Version=2008.1.619.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-GB:16ee7c61-0c72-4885-ba3b-3c21a3307fa9:393f5085:526d426:80c4ad6d:527acb41;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:e2e86ef9;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:c59c074c;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:1df13a87;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:c4c00916;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:9ea3f0e2;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:c7c04611;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:cd120801;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:3858419b;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:96741c43;AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-GB:ce5fa2cf-4622-4b7d-91b3-5830868ae1b0:38ec41c0';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
