window.fDomLoaded=false;
document.head=document.getElementsByTagName("head")[0];
if(document.all&&!document.getElementById){
document.getParent=function(el){
return el.parentElement;
};
}else{
document.getParent=function(el){
return el.parentNode;
};
}
function detectBrowser(){
window.ie=(document.all&&!window.opera);
if(navigator&&navigator.userAgent){
var _3=navigator.userAgent;
window.webkit=(_3.indexOf("WebKit/")!=-1);
if(window.webkit){
window.versionMajorWebKit=0;
window.versionMinorWebKit=0;
var re=/WebKit\/(\d)(\d\d)?/;
var _5=re.exec(_3);
if(_5){
window.versionMajorWebKit=parseInt(_5[1]);
if(_5[2]){
window.versionMinorWebKit=parseInt(_5[2]);
}
}
window.chrome=(_3.indexOf("Chrome/")!=-1);
window.safari=!window.chrome&&(_3.indexOf("Safari/")!=-1);
}
if(window.ie){
window.ie7=(_3.indexOf("MSIE 7")!=-1);
window.ie6=(window.ie&&!window.ie7);
}
window.mozilla=(!window.ie&&!window.webkit&&!window.opera&&(_3.indexOf("Mozilla")!=-1));
window.ff3=(window.mozilla&&_3.indexOf("Firefox/3")!=-1);
window.macintosh=(_3.indexOf("Macintosh")!=-1);
}
}
detectBrowser();
function domLoadInit(){
if(arguments.callee.fDone){
return;
}
arguments.callee.fDone=true;
if(g_webkit_timer){
clearInterval(g_webkit_timer);
}
if(typeof (domContentLoad)!="undefined"){
domContentLoad();
}
}
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",domLoadInit,false);
}
var g_webkit_timer=null;
if(window.webkit){
g_webkit_timer=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
domLoadInit();
}
},10);
}
window.onload=function(){
domLoadInit();
bodyLoad();
};


DomBuilder={IE_TRANSLATIONS:{"class":"className","for":"htmlFor"},ieAttrSet:function(a,i,el){
var _4;
if(_4=this.IE_TRANSLATIONS[i]){
el[_4]=a[i];
}else{
if(i=="style"){
el.style.cssText=a[i];
}else{
el.setAttribute(i,a[i]);
}
}
},apply:function(o){
o=o||{};
var _6=("p|div|span|strong|em|i|img|table|tr|td|th|thead|tbody|tfoot|pre|code|"+"h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|"+"select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|"+"script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|"+"label|dfn|kbd|samp|var|nbsp|iframe|nobr").split("|");
var el,i=0;
while(el=_6[i++]){
o[el.toLowerCase()]=DomBuilder.tagFunc(el);
}
return o;
},tagFunc:function(_9){
return function(){
var a=arguments,at,ch;
a.slice=[].slice;
if(a.length>0){
if(a[0].nodeName||typeof a[0]=="string"){
ch=a;
}else{
at=a[0];
ch=a.slice(1);
}
}
return DomBuilder.elem(_9,at,ch);
};
},elem:function(e,a,c){
a=a||{};
c=c||[];
var el;
if(e=="nbsp"){
return DOM.span({},"&nbsp;");
}else{
el=document.createElement((window.ie&&a.name)?"<"+e+" name="+a.name+">":e);
}
for(var i in a){
if(typeof a[i]!="function"){
if(window.ie){
this.ieAttrSet(a,i,el);
}else{
el.setAttribute(i,a[i]);
}
}else{
el[i]=a[i];
}
}
for(var i=0;i<c.length;i++){
if(c[i]){
if(typeof c[i]=="string"){
if(c[i]=="&nbsp;"){
el.innerHTML+="&nbsp;";
}else{
c[i]=document.createTextNode(c[i]);
el.appendChild(c[i]);
}
}else{
el.appendChild(c[i]);
}
}
}
return el;
}};
var DOM=DomBuilder.apply();


function toQueryComponent(_1){
if(!_1.name||_1.disabled){
return "";
}
var n=urlencode(_1.name);
switch(_1.type){
case "text":
case "password":
case "submit":
case "hidden":
return n+"="+urlencode(_1.value);
case "textarea":
var v=_1.value.replace(/(\r\n)|\r|\n/g,"\r\n");
return n+"="+urlencode(v);
case "checkbox":
case "radio":
if(!_1.checked){
return "";
}
var v=getRealValue(_1);
if(v===null){
v="on";
}
return n+"="+urlencode(v);
case "select-one":
case "select-multiple":
var _4=[];
var _5,i=0;
while((_5=_1.options[i++])!=null){
if(_5.selected){
var v=getRealValue(_5);
if(v===null){
v=_5.text;
}
_4[_4.length]=n+"="+urlencode(v);
}
}
return _4.join("&");
default:
return "";
}
}
function urlencode(_7){
var v;
try{
v=encodeURIComponent(_7);
}
catch(e){
v=escape(_7);
}
return v.replace(/%20/g,"+");
}
function getRealValue(_9){
var _a=_9.getAttributeNode("value");
return (_a&&_a.specified)?_9.getAttribute("value"):null;
}


function Array_push(){
var _1=0;
for(_1=0;_1<arguments.length;_1++){
this[this.length]=arguments[_1];
}
return this.length;
}
if(typeof Array.prototype.push=="undefined"){
Array.prototype.push=Array_push;
}
if(document.all&&!document.getElementById){
document.getElementById=function(id){
return document.all[id];
};
}
function elById(id,_4){
if(!id){
return null;
}
if(!_4){
_4=document;
}
if(!_4.getElementById){
return null;
}
try{
var el=_4.getElementById(id);
if(el&&el.id!=id){
el=null;
}
return el;
}
catch(e){
return null;
}
}
function getAbsolutePosition(_6){
var r={x:_6.offsetLeft,y:_6.offsetTop};
if(_6.offsetParent){
var _8=getAbsolutePosition(_6.offsetParent);
r.x+=_8.x;
r.y+=_8.y;
}
return r;
}
function giveFocus(){
if(document.all){
var el=TabManager.getCurrentSEventEl();
if(null!=el){
safeFocus(el);
}
}
}
function redraw(_a){
if(_a&&_a.style){
_a.style.display="none";
_a.style.display="";
}
}
function preCalc(_b){
if(!_b||!_b.style){
return;
}
_b.sDisplayOld=_b.style.display;
_b.sVisibilityOld=_b.style.visibility;
_b.style.visibility="hidden";
_b.style.display="";
}
function postCalc(_c){
if(!_c||!_c.style){
return;
}
_c.style.display=_c.sDisplayOld||"";
_c.style.visibility=_c.sVisibilityOld||"visible";
}
function capitalize(s){
if(!s||!s.length){
return null;
}
return s.substring(0,1).toUpperCase()+s.substring(1);
}
function saveSelection(_e){
if(!_e||null==_e.selectionStart){
return;
}
_e.ixSelStart=_e.selectionStart;
_e.ixSelEnd=_e.selectionEnd;
}
function restoreSelection(_f){
if(!_f||null==_f.ixSelStart||null==_f.selectionStart){
return;
}
_f.selectionStart=_f.ixSelStart;
_f.selectionEnd=_f.ixSelEnd;
}
function adjustRows(_10){
bUserTyped=true;
if(_10.bRowLock){
return;
}
var _11=_10.rows;
if(window.ie){
var _12=false;
while((_10.scrollHeight>_10.clientHeight)&&(_10.rows<30)){
_10.rows+=3;
_12=true;
}
if(_12){
_10.scrollTop=0;
redraw(_10);
setTimeout(function(){
safeFocus(_10);
},1);
}
}else{
var _13=_10.value.split("\n");
var _14=1;
for(var i=0;i<_13.length;i++){
if(_13[i].length>80){
_14+=Math.ceil(_13[i].length/80);
}
}
_14+=_13.length;
if(_14>8){
_10.rows=Math.min(_14,30);
}
}
if(_10.fxnResize&&_10.rows!=_11){
_10.fxnResize.call();
}
}
function getKeyCode(_16){
if(document.all&&!_16){
return event.keyCode;
}else{
if(0!=_16.which&&typeof (_16.which)!="undefined"){
return _16.which;
}else{
return _16.keyCode;
}
}
}
function isKey(_17,_18){
return (getKeyCode(_17)==_18);
}
function trim(s){
if(!s||!s.replace){
return "";
}
if(!trim.re){
trim.re=/^[\s]+|[\s]+$/g;
}
return s.replace(trim.re,"");
}
function moveToHold(_1a){
if(_1a&&_1a.parentNode){
_1a.oldParent=_1a.parentNode;
_1a.oldSibling=_1a.nextSibling;
_1a.parentNode.removeChild(_1a);
}
}
function restoreFromHold(_1b){
if(_1b&&_1b.oldParent){
_1b.oldParent.insertBefore(_1b,_1b.oldSibling);
}
}
function jsToVbNewLines(s){
return s.replace(/(\n)/g,String.fromCharCode((document.all?10:13)));
}
function x(e){
return cancel(e);
}
function cancel(e,_1f){
if(document.all){
if(_1f){
_1f.event.returnValue=false;
}else{
if(event){
event.returnValue=false;
}
}
}else{
if(e){
e.preventDefault();
}
}
return false;
}
function stopFormSubmission(e){
return (getKeyCode(e)==13);
}
function hide(el){
if(!el||!el.style){
return;
}
el.style.display="none";
}
function show(el){
if(!el||!el.style){
return;
}
el.style.display="";
}
function toggleVisible(el){
if(!el){
return;
}
el.style.display=(el.style.display=="none"?"":"none");
}
function toggleVisibleById(id){
var el=elById(id);
if(el){
toggleVisible(el);
}
}
function removeChildren(el){
if(!el||!el.childNodes){
return;
}
while(el.childNodes.length){
el.removeChild(el.childNodes[0]);
}
}
function removeTextSelections(){
if(window.getSelection&&window.getSelection().removeAllRanges){
window.getSelection().removeAllRanges();
}
if(document.selection&&document.selection.empty){
try{
document.selection.empty();
}
catch(e){
}
}
}
function ourAttachEvent(_27,_28,fxn,_2a){
if(!_27.hashEvents){
_27.hashEvents={};
}
if(!_27.hashEvents[_28]){
_27.hashEvents[_28]=[fxn];
}else{
_27.hashEvents[_28].push(fxn);
}
if(_27.addEventListener){
_27.addEventListener(_28,fxn,_2a);
}else{
if(_27.attachEvent){
return _27.attachEvent("on"+_28,fxn);
}else{
_27["on"+_28]=fxn;
}
}
return true;
}
function ourDispatchEvent(_2b,_2c){
if(!_2b||!_2b.hashEvents||!_2b.hashEvents[_2c]){
return;
}
var rg=_2b.hashEvents[_2c];
for(var ix=0;ix<rg.length;ix++){
if(rg[ix].apply){
rg[ix].apply(this);
}
}
}
function ourHasEvent(_2f,_30){
return (_2f&&_2f.hashEvents&&_2f.hashEvents[_30]);
}
function calculateOffset(_31,_32,_33){
var _34=0;
while(_31&&(!_33||(getActualStyle(_31,"position")!="absolute"&&getActualStyle(_31,"position")!="relative"))){
_34+=(_31[_32])?_31[_32]:0;
_31=_31.offsetParent;
}
return _34;
}
function getActualStyle(_35,_36){
var _37="";
if(_35.style[_36]){
_37=_35.style[_36];
}else{
if(document.defaultView&&document.defaultView.getComputedStyle){
_37=document.defaultView.getComputedStyle(_35,"").getPropertyValue(jsToCss(_36));
}else{
if(_35.currentStyle){
try{
_37=_35.currentStyle[_36];
}
catch(e){
}
}else{
_37=_35.style[_36];
}
}
}
return _37;
}
function formToQueryString(_38){
var s="";
if(!_38){
return s;
}
var _3a=_38.elements;
for(var ix=0;ix<_3a.length;ix++){
if(_3a[ix].type!="submit"){
var _3c=toQueryComponent(_3a[ix]);
if(_3c.length>0){
s+=_3c+"&";
}
}
}
return s;
}
function setCookie(_3d,_3e,_3f){
var _40=(_3f?_3f.toString():"Thu, 4 Aug 2011 20:47:11 UTC;");
document.cookie=_3d+"="+escape(_3e)+"; expires="+_40;
}
function getCookie(_41){
var dc=document.cookie;
var _43=_41+"=";
var _44=dc.indexOf("; "+_43);
if(_44==-1){
_44=dc.indexOf(_43);
if(_44!=0){
return null;
}
}else{
_44+=2;
}
var end=document.cookie.indexOf(";",_44);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_44+_43.length,end));
}
function deleteCookie(_46){
if(getCookie(_46)){
document.cookie=_46+"="+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function giveTextBoxFocus(id){
var el=null;
el=elById(id);
if(el!=null){
safeFocus(el);
if(document.selection){
el.value=el.value;
}
return true;
}
return false;
}
function populateTextBox(id,_4a){
var el=null;
el=elById(id);
if(el!=null){
el.value=_4a;
return true;
}
return false;
}
function disableElementById(sId){
var o=elById(sId);
if(o){
o.disabled=true;
}
}
function shortcutCtrlKey(){
return (window.macintosh?"\u2318":FB_CTRL);
}
function swap1(_4e,_4f){
if(!_4e||!_4f){
return "";
}
return _4e.replace(/%1/g,_4f);
}
function swap2(_50,_51,_52){
if(!_50||!_51||!_52){
return "";
}
return swap1(_50,_51).replace(/%2/g,_52);
}
function swap3(_53,_54,_55,_56){
if(!_53||!_54||!_55||!_56){
return "";
}
return swap2(_53,_54,_55).replace(/%3/g,_56);
}
function swappable(_57){
if(!_57||!_57.indexOf){
return false;
}
return (_57.indexOf("%1")>=0);
}
function trailingAmpersand(_58){
if(!_58){
return "";
}
if(_58.substring(_58.length-1)=="&"){
return _58;
}
return _58+"&";
}
function leadingAmpersand(_59){
if(!_59){
return "";
}
if(_59.charAt(0)=="&"){
return _59;
}
return "&"+_59;
}
function isDisplayed(el){
var _5b=el;
if(null==_5b){
return false;
}
while(null!=_5b&&_5b.style){
if("none"==_5b.style.display||"hidden"==_5b.style.visibility){
return false;
}
_5b=_5b.parentNode;
}
return true;
}
function isUnderNode(el,_5d){
var _5e=el;
while(null!=_5e){
if(_5d==_5e){
return true;
}
_5e=_5e.parentNode;
}
return false;
}
function escapeLtGt(s){
return s.replace(/</g,"&lt;").replace(/>/g,"&gt;");
}
function horizontalScrollBarPadding(){
return (scrollWidth()>windowWidth())?18:0;
}
function verticalScrollBarPadding(){
return !(window.ie||window.opera)||(scrollHeight()>windowHeight())?18:0;
}
function documentHeight(){
return Math.max((window.opera?document.documentElement.clientHeight:document.body.offsetHeight),windowHeight());
}
function documentWidth(){
return (window.opera?document.documentElement.clientWidth:document.body.offsetWidth);
}
function windowHeight(){
return (window.innerHeight?window.innerHeight:document.documentElement.clientHeight);
}
function windowWidth(){
return (window.innerWidth?window.innerWidth:document.documentElement.clientWidth);
}
function windowHeightCorrected(){
return windowHeight()-horizontalScrollBarPadding();
}
function windowWidthCorrected(){
return windowWidth()-verticalScrollBarPadding();
}
function windowRight(){
return windowWidthCorrected()+scrollLeft();
}
function setOpacity(_60,_61){
if(_61==null){
_60.style.opacity="";
_60.style.filter="";
}else{
_60.style.opacity=_61;
_60.style.filter="alpha(opacity="+_61*100+")";
}
}
function enableInputsWithin(sId,_63){
setTimeout("doEnableInputsWithin('"+sId+"', "+_63+")",1);
}
function doEnableInputsWithin(sId,_65){
var _66=elById(sId);
if(!_66||!isDisplayed(_66)){
return;
}
if(_66.tagName.toLowerCase()=="input"){
_66.disabled=!_65;
return;
}
var _67=XMLParser.getNodeArrayFrom(_66,"input");
for(var ix=0;ix<_67.length;ix++){
_67[ix].disabled=!_65;
}
}
function coverElement(_69,_6a,pxX,pxY){
if(!_69||!_6a){
return;
}
if(pxX==null){
pxX=calculateOffset(_6a,"offsetLeft");
}
if(pxY==null){
pxY=calculateOffset(_6a,"offsetTop");
}
_69.style.top=pxY+"px";
_69.style.left=pxX+"px";
_69.style.width=_6a.offsetWidth+"px";
_69.style.height=_6a.offsetHeight+"px";
}
function positionElement(_6d,pxX,pxY){
if(!_6d||!_6d.style){
return;
}
if(pxX!=null){
_6d.style.left=pxX+"px";
}
if(pxY!=null){
_6d.style.top=pxY+"px";
}
}
function sizeElement(_70,_71,_72){
if(!_70||!_70.style){
return;
}
if(_71!=null){
_70.style.width=_71+"px";
}
if(_72!=null){
_70.style.height=_72+"px";
}
}
function centerInTarget(_73,_74,_75){
return positionInTarget(_73,_74,_75,0.5,0.5);
}
function positionInTarget(_76,_77,_78,_79,_7a){
if(!_76){
return null;
}
if(!_77||_77.style.display.toLowerCase()=="none"){
return positionInWindow(_76,_79,_7a);
}
var _7b=(_78&&_78.style.display!="none")?_78:_77;
var pxX=calculateOffset(_7b,"offsetLeft")+(_7b.offsetWidth*_79)-(_76.offsetWidth/2);
var pxY=calculateOffset(_77,"offsetTop")+(_77.offsetHeight*_7a)-(_76.offsetHeight/2);
positionElement(_76,pxX,pxY);
return {"x":pxX,"y":pxY};
}
function positionOnTopOf(_7e,_7f){
if(!_7e||!_7f||!_7e.style||!_7f.style){
return;
}
var pxX=calculateOffset(_7f,"offsetTop")+"px";
var pxY=calculateOffset(_7f,"offsetLeft")+"px";
_7e.style.top=pxX+"px";
_7e.style.left=pxY+"px";
return {"x":pxX,"y":pxY};
}
function getRelativeCoordinates(_82,_83,_84,_85){
if(!_82||!_83||!_84||!_85){
return {"x":0,"y":0};
}
var _86=_82.style.display;
var _87=_82.style.visibility;
_82.style.visibility="hidden";
_82.style.display="";
var pxX=_84(_82,_83);
var pxY=_85(_82,_83);
_82.style.visibility=_87;
_82.style.display=_86;
return {"x":pxX,"y":pxY};
}
function getCenteredCoordinates(_8a,_8b){
return getRelativeCoordinates(_8a,_8b,function(oE,oT){
return calculateOffset(oT,"offsetLeft")+(oT.offsetWidth/2)-(oE.offsetWidth/2);
},function(oE,oT){
return calculateOffset(oT,"offsetTop")+(oT.offsetHeight/2)-(oE.offsetHeight/2);
});
}
function getRightCoordinates(_90,_91){
var _92=5;
return getRelativeCoordinates(_90,_91,function(oE,oT){
return calculateOffset(oT,"offsetLeft")+oT.offsetWidth+_92;
},function(oE,oT){
return calculateOffset(oT,"offsetTop");
});
}
function getLeftCoordinates(_97,_98){
var _99=5;
return getRelativeCoordinates(_97,_98,function(oE,oT){
return calculateOffset(oT,"offsetLeft")-_97.offsetWidth-_99;
},function(oE,oT){
return calculateOffset(oT,"offsetTop");
});
}
function getBelowCoordinates(_9e,_9f){
var _a0=5;
return getRelativeCoordinates(_9e,_9f,function(oE,oT){
return calculateOffset(oT,"offsetLeft");
},function(oE,oT){
return calculateOffset(oT,"offsetTop")+oT.offsetHeight+_a0;
});
}
function getUpperCenteredCoordinates(_a5,_a6){
return getRelativeCoordinates(_a5,_a6,function(oE,oT){
return calculateOffset(oT,"offsetLeft")+(oT.offsetWidth/2)-(oE.offsetWidth/2);
},function(oE,oT){
var pxT=calculateOffset(oT,"offsetTop");
return Math.max(pxT,pxT+(oT.offsetHeight/5)-(oE.offsetHeight/2));
});
}
function getInWindowCoordinates(_ac,_ad,_ae,_af,_b0,_b1,_b2){
if(!_ac){
return;
}
var _b3=!isVisible(_ac);
var _b4=_ac.style.visibility;
var _b5=_ac.style.display;
if(_b3){
_ac.style.visibility="hidden";
_ac.style.display="";
}
var _b6=_af?_af.offsetWidth:0;
var _b7=_af?_af.offsetHeight:0;
if(_b0==null){
_b0=0;
}
if(_b1==null){
_b1=0;
}
var _b8=inBounds(_ad,scrollLeft()+_b0,windowWidthCorrected()+scrollLeft()-_ac.offsetWidth-_b0);
var _b9=inBounds((_ae-(2*_b1)),scrollTop()+_b0,windowHeightCorrected()+scrollTop()-_ac.offsetHeight-_b0);
var _ba=_b0+_b1;
if(!_b2&&hasRoom("right",_ac,_ad,_ae,_ba)){
_b8=(_ad+_b6+_ba);
}else{
if(!_b2&&hasRoom("left",_ac,_ad,_ae,_ba)){
_b8=(_ad-_ac.offsetWidth-_ba);
}else{
if(hasRoom("bottom",_ac,_ad,_ae,_ba)){
_b9=(_ae+_b7+_ba);
}else{
if(hasRoom("top",_ac,_ad,_ae,_ba)){
_b9=(_ae-_ac.offsetHeight-_ba);
}else{
if(!_b2){
_b8=_ad;
}
_b9=(_ae+_b7+_ba);
}
}
}
}
if(_b3){
_ac.style.display=_b5;
_ac.style.visibility=_b4;
}
return {x:_b8,y:_b9};
}
function centerInWindow(_bb){
return positionInWindow(_bb,0.5,0.5);
}
function positionInWindow(_bc,_bd,_be){
if(!_bc){
return null;
}
var pxX=scrollLeft()+(windowWidthCorrected()*_bd)-(_bc.offsetWidth/2);
var pxY=scrollTop()+(windowHeightCorrected()*_be)-(_bc.offsetHeight/2);
positionElement(_bc,pxX,pxY);
return {"x":pxX,"y":pxY};
}
function moveWithinWindow(_c1,_c2){
if(!_c1||!_c1.style||_c1.style.display.toLowerCase()=="none"){
return null;
}
if(null==_c2){
_c2=25;
}
var x1=calculateOffset(_c1,"offsetLeft");
var y1=calculateOffset(_c1,"offsetTop");
var x2=x1+_c1.offsetWidth;
var y2=y1+_c1.offsetHeight;
var _c7=scrollLeft()+_c2;
var _c8=scrollLeft()+windowWidthCorrected()-_c2;
var _c9=scrollTop()+_c2;
var _ca=scrollTop()+windowHeightCorrected()-_c2;
if(x1<_c7){
x1=_c7;
}else{
if(x2>_c8){
x1=x1-(x2-_c8);
}
}
if(y1<_c9){
y1=_c9;
}else{
if(y2>_ca){
y1=y1-(y2-_ca);
}
}
_c1.style.left=x1+"px";
_c1.style.top=y1+"px";
return {"x":x1,"y":y1};
}
function snapToBorder(_cb,pxX,pxY,_ce){
var _cf=30;
if(pxX<_cf){
pxX=_ce;
}else{
if(pxX>(windowWidthCorrected()-_cb.offsetWidth-_cf)){
pxX=(windowWidthCorrected()-_cb.offsetWidth-_ce);
}
}
if(pxY<_cf){
pxY=_ce;
}else{
if(pxY>(windowHeightCorrected()-_cb.offsetHeight-_cf)){
pxY=(windowHeightCorrected()-_cb.offsetHeight-_ce);
}
}
positionElement(_cb,pxX,pxY);
}
function addEllipsis(s){
while(s&&s.length>0){
if(s.substring(s.length-1)==" "||s.substring(s.length-6)=="&nbsp;"){
return s+"...";
}else{
if(s.substring(s.length-4).toLowerCase()=="<br>"){
return s.substring(0,s.length-4)+"...";
}else{
if(s.substring(s.length-5).toLowerCase()=="<br/>"){
return s.substring(0,s.length-5)+"...";
}else{
if(s.substring(s.length-6).toLowerCase()=="<br />"){
return s.substring(0,s.length-6)+"...";
}else{
s=s.substring(0,s.length-1);
}
}
}
}
}
return "...";
}
function inBounds(n,_d2,_d3){
return Math.max(_d2,Math.min(_d3,n));
}
function scrollTop(_d4){
if(!_d4){
_d4=window;
}
var _d5=_d4.document.documentElement;
if(_d5.scrollTop){
return _d5.scrollTop;
}else{
if(_d4.pageYOffset){
return _d4.pageYOffset;
}else{
if(_d4.document.body.scrollTop){
return _d4.document.body.scrollTop;
}else{
return 0;
}
}
}
}
function scrollLeft(_d6){
if(!_d6){
_d6=window;
}
var _d7=_d6.document.documentElement;
if(_d7.scrollLeft){
return _d7.scrollLeft;
}else{
if(_d6.pageXOffset){
return _d6.pageXOffset;
}else{
if(_d6.document.body.scrollLeft){
return _d6.document.body.scrollLeft;
}else{
return 0;
}
}
}
}
function scrollWidth(){
if(typeof window.scrollMaxX!="undefined"){
if(document.documentElement&&document.documentElement.clientWidth){
return document.documentElement.clientWidth+window.scrollMaxX;
}
}
return document.body.scrollWidth||0;
}
function scrollHeight(){
if(typeof window.scrollMaxY!="undefined"){
if(document.documentElement&&document.documentElement.clientHeight){
return document.documentElement.clientHeight+window.scrollMaxY;
}
}
return document.body.scrollHeight||0;
}
function safeScrollTo(x,y,_da){
if(!_da){
_da=window;
}
try{
_da.scrollTo(x,y);
}
catch(e){
}
}
function xMouseWindow(){
return xMouse-scrollLeft();
}
function yMouseWindow(){
return yMouse-scrollTop();
}
decodeLTGT.reLT=new RegExp("&lt;","gi");
decodeLTGT.reGT=new RegExp("&gt;","gi");
function decodeLTGT(sIn){
return sIn.replace(decodeLTGT.reLT,"<").replace(decodeLTGT.reGT,">");
}
function encodeLTGT(s){
if(!encodeLTGT.reGT){
encodeLTGT.reGT=new RegExp(">","gi");
encodeLTGT.reLT=new RegExp("<","gi");
}
return s.replace(encodeLTGT.reLT,"&lt;").replace(encodeLTGT.reGT,"&gt;");
}
function encodeAmp(sIn){
if(!encodeAmp.re){
encodeAmp.re=new RegExp("&","gi");
}
return sIn.replace(encodeAmp.re,"&amp;");
}
function decodeAmp(sIn){
if(!decodeAmp.re){
decodeAmp.re=new RegExp("&amp;","gi");
}
return sIn.replace(decodeAmp.re,"&");
}
function paintRow(_df,_e0){
if(!_df||!_df.cells){
return;
}
var _e1=_df.cells;
for(var i=0;i<_e1.length;i++){
_e1[i].style.backgroundColor=_e0;
}
}
function getParentRow(_e3){
if(!_e3||!_e3.tagName){
return null;
}
if(_e3.tagName.toLowerCase()=="span"&&_e3.id=="dlgGrid"){
return null;
}
if(_e3.tagName.toLowerCase()=="tr"){
return _e3;
}
return getParentRow(_e3.parentNode);
}
function getParentNode(_e4,_e5){
if(!_e4||!_e4.tagName){
return null;
}
if(_e4.tagName.toLowerCase()==_e5.toLowerCase()){
return _e4;
}
return getParentNode(_e4.parentNode,_e5);
}
function isVisible(_e6){
return (_e6&&_e6.style&&(_e6.style.display!="none")&&(_e6.style.visibility!="hidden"));
}
function repairFocus(_e7){
try{
safeFocus(_e7);
_e7.blur();
}
catch(e){
}
}
function replacePlaceHolders(s){
if(!isDefined(rgPlaceHolders)){
return s;
}
for(var ix=0;ix<rgPlaceHolders.length;ix++){
var re=new RegExp(rgPlaceHolders[ix].sPlaceHolder,"g");
s=s.replace(re,decodeLTGT(rgPlaceHolders[ix].sValue));
}
return s;
}
function isDefined(o){
return (typeof o!="undefined");
}
function safeFocus(el){
try{
el.focus();
}
catch(e){
}
}
function safeRemove(el){
try{
el.parentNode.removeChild(el);
}
catch(e){
}
}
function safeSubmit(_ee){
try{
_ee.submit();
return true;
}
catch(e){
}
return false;
}
function asc(c){
if(!c){
return null;
}
return c.charCodeAt(0);
}
var g_setInnerHTMLComplete=true;
function setInnerHTML(sID,_f1,_f2){
g_setInnerHTMLComplete=false;
if(sID&&(_f1||_f1=="")){
var elt=sID;
if(typeof (sID)=="string"){
elt=elById(sID);
}
if(elt){
if(_f2){
if(_f1==""){
hide(elt);
}else{
show(elt);
}
}
if(elt.innerHTML||elt.innerHTML==""){
elt.innerHTML=_f1;
DropListControl.refreshWithin(elt);
g_setInnerHTMLComplete=true;
return elt;
}
}
}
g_setInnerHTMLComplete=true;
return undefined;
}
var rg_re_MNHE=[{"re":new RegExp(">","g"),"s":"&~"+asc(">")},{"re":new RegExp("<","g"),"s":"&~"+asc("<")},{"re":new RegExp("'","g"),"s":"&~"+asc("'")},{"re":new RegExp("\"","g"),"s":"&~"+asc("\"")}];
function makeNonHTMLEntities(s){
var _f5=s;
for(var ix=0;ix<rg_re_MNHE.length;ix++){
_f5=_f5.replace(rg_re_MNHE[ix].re,rg_re_MNHE[ix].s);
}
return _f5;
}
function isCtrlOrMeta(e){
return (e&&(e.ctrlKey||e.metaKey));
}
function isCtrlOrMetaOrShift(e){
return (e&&(isCtrlOrMeta(e)||e.shiftKey));
}
function nextSiblingOfType(el,s){
return nextSiblingMatching(el,function(_fb){
return s==_fb.tagName.toLowerCase();
});
}
function nextSiblingMatching(el,fx){
while(el){
el=el.nextSibling;
if(el&&fx(el)){
return el;
}
}
return null;
}
var rgMouseButtonMap=[];
var MOUSE_BUTTON_LEFT=0;
var MOUSE_BUTTON_RIGHT=1;
var MOUSE_BUTTON_MIDDLE=2;
if(window.ie||(window.webkit&&window.versionMajorWebKit<5)){
rgMouseButtonMap[1]=MOUSE_BUTTON_LEFT;
rgMouseButtonMap[2]=MOUSE_BUTTON_RIGHT;
rgMouseButtonMap[4]=MOUSE_BUTTON_MIDDLE;
}else{
if(window.webkit){
rgMouseButtonMap[0]=MOUSE_BUTTON_LEFT;
rgMouseButtonMap[1]=MOUSE_BUTTON_MIDDLE;
rgMouseButtonMap[2]=MOUSE_BUTTON_RIGHT;
}else{
rgMouseButtonMap[0]=MOUSE_BUTTON_LEFT;
rgMouseButtonMap[1]=MOUSE_BUTTON_RIGHT;
rgMouseButtonMap[2]=MOUSE_BUTTON_MIDDLE;
}
}
function getButtonCode(e){
if(e.button==null){
return null;
}
return rgMouseButtonMap[e.button];
}
function addToFxn(_ff,_100,_101){
if(!_ff){
_ff=window;
}
if(!_100||!_101||!_101.call){
return;
}
if(_ff[_100]&&_ff[_100].call){
var i=0;
while(_ff[_100+"_"+i]!=null){
i++;
}
_ff[_100+"_"+i]=_ff[_100];
_ff[_100]=function(){
_ff[_100+"_"+i].apply(_ff,arguments);
_101.apply(_ff);
};
}else{
_ff[_100]=_101;
}
}
function intoArray(o,_104){
if(!o){
return [];
}
if(!o.length){
return [];
}
var rg=[];
var _106=0;
for(var ix=0;ix<o.length;ix++){
if(!_104||_104(o[ix])){
rg[_106]=o[ix];
_106++;
}
}
return rg;
}
function isTextNode(o){
if(!o||!o.nodeName){
return false;
}
return (o.nodeName.toLowerCase()=="#text");
}
function removeNode(o){
if(o&&o.parentNode){
o.parentNode.removeChild(o);
}
}
function getPreviousOffsetNode(o){
if(!o||(!o.previousSibling&&!o.parentNode)){
return null;
}
while(!o.previousSibling&&o.parentNode){
o=o.parentNode;
}
o=o.previousSibling;
if(isTextNode(o)){
if(trim(o.nodeValue).length==0){
return getPreviousOffsetNode(o);
}
var _10b=document.createElement("span");
o.parentNode.insertBefore(_10b,o);
_10b.appendChild(o);
return _10b;
}
if(!o.offsetHeight){
return getPreviousOffsetNode(o);
}
return o;
}
function getNextOffsetNode(o){
if(!o||(!o.nextSibling&&!o.parentNode)){
return null;
}
while(!o.nextSibling&&o.parentNode){
o=o.parentNode;
}
o=o.nextSibling;
if(isTextNode(o)){
if(trim(o.nodeValue).length==0){
return getNextOffsetNode(o);
}
var _10d=document.createElement("span");
o.parentNode.insertBefore(_10d,o);
_10d.appendChild(o);
return _10d;
}
if(o&&!o.offsetHeight){
return getNextOffsetNode(o);
}
return o;
}
function onSameLine(o1,o2){
if(!o1||!o2||!isVisible(o1)||!isVisible(o2)){
return true;
}
var y1=calculateOffset(o1,"offsetTop");
var y2=calculateOffset(o2,"offsetTop");
var h1=o1.offsetHeight;
var h2=o2.offsetHeight;
return ((y2>y1&&y2<(y1+h1))||(y1>y2&&y1<(y2+h2))||(y1==y2));
}
function atSameHeight(o1,o2){
if(!o1||!o2||!isVisible(o1)||!isVisible(o2)){
return true;
}
return (calculateOffset(o1,"offsetTop")==calculateOffset(o2,"offsetTop"));
}
var rgErrorElements=[];
function showErrorElement(sId,_117){
var _118=elById(sId);
if(!_118||!_118.parentNode){
return;
}
var _119=elById(sId+"_containerError");
if(!_119){
_119=DOM.div();
with(_119.style){
color="#FF0000";
fontSize="11px";
fontWeight="bold";
}
_119.id=sId+"_containerError";
var _11a=_118.nextSibling;
while(_11a&&_11a.id==sId+"_clone"){
_11a=_11a.nextSibling;
}
_118.parentNode.insertBefore(_119,_11a);
}
if(_118.tagName.toLowerCase()=="input"&&_118.type.toLowerCase()=="text"){
addClassName(_118,"dlgErrorBorderOnly");
}
_119.innerHTML="";
var _11b=DOM.span();
_11b.innerHTML=_117;
_119.appendChild(_11b);
_119.style.display="";
rgErrorElements.push({"sId":_118.id,"sContainerId":_119.id});
}
function hideAllErrorElements(){
for(var ix=0;ix<rgErrorElements.length;ix++){
var _11d=elById(rgErrorElements[ix].sId);
var _11e=elById(rgErrorElements[ix].sContainerId);
if(_11d&&_11d.tagName.toLowerCase()=="input"&&_11d.type.toLowerCase()=="text"){
removeClassName(_11d,"dlgErrorBorderOnly");
}
if(_11e){
_11e.innerHTML="";
_11e.style.display="none";
}
}
rgErrorElements=[];
}
function applyToSelfAndChildren(o,f){
if(!o||!f||!f.apply){
return;
}
f.apply(o,[o]);
if(!o.childNodes){
return;
}
for(var ix=0;ix<o.childNodes.length;ix++){
applyToSelfAndChildren(o.childNodes[ix],f);
}
}
function insertOnClickUrl(s,sUrl,_124,_125){
if(!s||!sUrl){
return;
}
if(!_125){
_125={};
}
_125["href"]=sUrl;
_125["onclick"]=_124;
var _126=s.substring(0,s.indexOf("["));
var _127=s.substring(s.indexOf("[")+1,s.indexOf("]"));
var _128=s.substring(s.indexOf("]")+1);
return DOM.span({},_126,DOM.a(_125,_127),_128);
}
function replaceWithCopy(oSrc){
if(!oSrc||!oSrc.cloneNode||!oSrc.parentNode){
return null;
}
var _12a=oSrc.cloneNode(true);
oSrc.parentNode.replaceChild(_12a,oSrc);
return _12a;
}
function isTagName(_12b,sTag){
return _12b&&_12b.tagName&&_12b.tagName.toLowerCase&&sTag&&sTag.toLowerCase&&(_12b.tagName.toLowerCase()==sTag.toLowerCase());
}
function matchesTagName(_12d,_12e){
return _12d&&_12d.tagName&&_12e&&(new RegExp(_12e,"i")).test(_12d.tagName);
}
function setWidth(_12f,px){
if(_12f&&_12f.style&&px!=null){
_12f.style.width=px+"px";
}
}
function handleKeydown(elem,e,_133,_134,_135,_136){
_133=(_133&&window.webkit);
if(getKeyCode(e)==13||(_133&&getKeyCode(e)==32)){
if(_134&&_134.call){
return _134.call(this,elem,e);
}
}else{
if(getKeyCode(e)==27){
if(_135&&_135.call){
return _135.call(this,elem,e);
}
}else{
if(_136&&_136.call){
return _136.call(this,elem,e);
}
}
}
return true;
}
function startsAndEndsWith(s,_138,sEnd){
if(!s){
return false;
}
if(!_138&&!sEnd){
return false;
}
s=s.toLowerCase();
if(s.indexOf(_138.toLowerCase())!=0){
return false;
}
if(s.lastIndexOf(sEnd.toLowerCase())!=(s.length-sEnd.length)){
return false;
}
return true;
}
function stripSurroundingTags(s){
if(!s){
return "";
}
var _13b=s.indexOf(">");
var _13c=s.lastIndexOf("<");
return s.substring(_13b+1,_13c);
}
function isOnlyChild(_13d){
return _13d&&_13d.parentNode&&!_13d.nextSibling&&!_13d.previousSibling;
}
function getDescendents(_13e,_13f,rg){
if(!rg){
rg=[];
}
if(!_13e||!_13e.childNodes){
return rg;
}
for(var ix=0;ix<_13e.childNodes.length;ix++){
if(_13e.childNodes[ix].nodeType!=3||_13f){
rg[rg.length]=_13e.childNodes[ix];
getDescendents(_13e.childNodes[ix],_13f,rg);
}
}
return rg;
}
function isWhitespaceOnly(_142){
if(!_142){
return false;
}
var s=(_142.textContent!=null)?_142.textContent:_142.innerText;
if(s==null||s==undefined){
return false;
}
if(_142.nodeType==NODE_TYPE_ELEMENT&&XMLParser.getNodeFrom(_142,"img")){
return false;
}
if(s.length==0){
return true;
}
if(window.webkit){
s=s.replace(String.fromCharCode(160),"");
}
return s.replace(/\s/g,"").length==0;
}
function getEventTarget(e){
return e?(e.target?e.target:e.srcElement):null;
}
function getNodeOffset(_145){
if(!_145||!_145.parentNode){
return -1;
}
var _146=_145.parentNode.childNodes;
for(var ix=0;ix<_146.length;ix++){
if(_146[ix]==_145){
return ix;
}
}
return -1;
}
function genTableMap(_148){
if(!_148||!isTagName(_148,"table")){
return null;
}
return new function(){
var _149=intoArray(_148.rows);
var _14a=[];
_149.foreach(function(oRow,rg,_14d){
intoArray(oRow.cells).foreach(function(_14e,rg,_150){
if(!_14a[_14d]){
_14a[_14d]=[];
}
var _151=_150;
while(_14a[_14d][_151]){
_151++;
}
(_14e.rowSpan).times(function(_152){
if(!_14a[_14d+_152]){
_14a[_14d+_152]=[];
}
(_14e.colSpan).times(function(_153){
_14a[_14d+_152][_151+_153]=_14e;
});
});
});
if(!oRow.cells.length){
_14a[_14d]=_14a[_14d-1];
}
});
this.getRowCount=function(){
return _14a.length;
};
this.getColumnCount=function(){
return _14a[0]?_14a[0].length:0;
};
this.getAdjustedRowCount=function(){
return this.getRowCount()-(this.hasHeadingRow()?1:0);
};
this.getAdjustedColumnCount=function(){
return this.getColumnCount()-(this.hasHeadingColumn()?1:0);
};
this.hasHeadingRow=function(){
return (_14a[0]&&_14a[0][1])?isTagName(_14a[0][1],"th"):false;
};
this.hasHeadingColumn=function(){
return (_14a[1]&&_14a[1][0])?isTagName(_14a[1][0],"th"):false;
};
this.getRow=function(ix){
return _149[ix]?_149[ix]:null;
};
this.getRowCells=function(ix){
return _14a[ix]?_14a[ix]:[];
};
this.getColumnCells=function(ix){
var rg=[];
_14a.foreach(function(_158){
_158.foreach(function(_159,tmp,_15b){
if(_15b==ix){
rg.push(_159);
}
});
});
return rg;
};
this.getCell=function(_15c,_15d){
return (_14a[_15c]&&_14a[_15c][_15d])?_14a[_15c][_15d]:null;
};
this.getCellAbove=function(_15e,_15f){
if(!_14a[_15e]||!_14a[_15e][_15f]){
return;
}
var _160=_15e;
while(_14a[_160]&&(_14a[_160][_15f]==_14a[_15e][_15f])){
_160--;
}
return (_14a[_160]&&_14a[_160][_15f])?_14a[_160][_15f]:null;
};
this.getCellBelow=function(_161,_162){
if(!_14a[_161]||!_14a[_161][_162]){
return;
}
var _163=_161;
while(_14a[_163]&&(_14a[_163][_162]==_14a[_161][_162])){
_163++;
}
return (_14a[_163]&&_14a[_163][_162])?_14a[_163][_162]:null;
};
this.getCellRight=function(_164,_165){
if(!_14a[_164]||!_14a[_164][_165]){
return;
}
var _166=_165;
while(_14a[_164][_166]&&(_14a[_164][_166]==_14a[_164][_165])){
_166++;
}
return (_14a[_164][_166])?_14a[_164][_166]:null;
};
this.getCellLeft=function(_167,_168){
if(!_14a[_167]||!_14a[_167][_168]){
return;
}
var _169=_168;
while(_14a[_167][_169]&&(_14a[_167][_169]==_14a[_167][_168])){
_169--;
}
return (_14a[_167][_169])?_14a[_167][_169]:null;
};
this.getTrueIndex=function(_16a,_16b){
if(!_14a[_16a]||!_16b){
return null;
}
return _14a[_16a].firstMatchIndex(function(_){
return _==_16b;
});
};
this.getTrueNextCell=function(_16d,_16e){
var _16f=_14a[_16d];
if(!_16f){
return null;
}
var _170=_16f.firstMatch(function(_,rg,ix){
return ix>_16e&&_.parentNode==_149[_16d]&&_!=_16f[_16e];
});
return _170?_170:null;
};
this.getTrueNextRow=function(_174){
var _175=this.getColumnCount();
var oRow=_149.firstMatch(function(_,rg,ix){
if(ix>_174){
var _17a=0;
for(var ix=0;ix<_.cells.length;ix++){
_17a+=_.cells[ix].colSpan;
}
return _17a==_175;
}
return false;
});
return oRow?oRow:null;
};
};
}
function hasRoom(_17b,o,_17d,_17e,_17f){
if(_17f==null){
_17f=0;
}
if(!o||!_17b){
return false;
}
if(_17b=="left"){
return (scrollLeft()<(_17d-_17f-o.offsetWidth));
}else{
if(_17b=="right"){
return ((_17d+o.offsetWidth+_17f)<(scrollLeft()+windowWidthCorrected()-o.offsetWidth));
}else{
if(_17b=="top"){
return (scrollTop()<(_17e-_17f-o.offsetHeight));
}else{
if(_17b=="bottom"){
return ((_17e+o.offsetHeight+_17f)<(scrollTop()+windowHeightCorrected()-o.offsetHeight));
}else{
return false;
}
}
}
}
}
function normalizeQuotes(s){
if(!s||!s.replace){
return "";
}
return s.replace(/[\u201C\u201D]/,"\"").replace(/[\u2018\u2019]/,"'");
}
function camelCaseToSpace(s){
if(!s||!s.replace){
return "";
}
if(!camelCaseToSpace.re){
camelCaseToSpace.re=/([a-z]+)([A-Z]{1})/g;
}
return s.replace(camelCaseToSpace.re,"$1 $2");
}
function indentCss(s){
if(!s){
return "";
}
if(!indentCss.re){
indentCss.re=/[\S]+\.([^\s.]+)/;
}
var _183=indentCss.re.exec(s);
if(!_183){
return s;
}
return "\xa0."+_183[1];
}
function jsToCss(s){
if(!s||!s.replace){
return "";
}
if(!jsToCss.re){
jsToCss.re=/([a-z]+)([A-Z]{1})/g;
}
return s.replace(jsToCss.re,"$1-$2").toLowerCase();
}
function cssToJs(s){
if(!s||!s.replace){
return "";
}
if(!cssToJs.re){
cssToJs.re=/-(\w)/g;
}
return s.replace(cssToJs.re,function(_186,_187){
return _187.toUpperCase();
});
}
function addClassName(o,_189){
if(!o){
return;
}
o.className+=" "+_189;
}
function removeClassName(o,_18b){
if(!o||!o.className){
return;
}
o.className=o.className.replace((new RegExp(_18b,"gi")),"");
}
function hasClassName(o,_18d){
if(!o||!o.className){
return false;
}
return o.className.indexOf(_18d)>=0;
}
function hasStyle(el,_18f,_190){
return (el&&el.style&&el.style[_18f]&&el.style[_18f].toLowerCase()==_190.toLowerCase());
}
function getStyle(el,_192){
if(!el||!_192){
return "";
}
var _193=null;
try{
if(window.getComputedStyle){
_193=getComputedStyle(el,"").getPropertyValue(_192);
}else{
if(el.currentStyle){
_193=el.currentStyle[cssToJs(_192)];
}
}
}
catch(e){
}
return _193||"";
}
function sToPx(s){
if(!s||!s.replace){
return 0;
}
s=s.replace(/[^\d]/g,"");
return isNaN(parseInt(s,10))?0:parseInt(s,10);
}
function isInDOM(_195){
while(_195){
if(isTagName(_195,"body")){
return true;
}
_195=_195.parentNode;
}
return false;
}
function isChildOf(_196,_197){
while(_196&&_196.parentNode){
if(_196.parentNode==_197){
return true;
}
_196=_196.parentNode;
}
return false;
}
function isImgLoaded(_198){
if(!_198||!_198.complete){
return false;
}
if(typeof _198.naturalWidth!="undefined"&&_198.naturalWidth==0){
return false;
}
return true;
}
function forAll(_199,_19a,fxn){
if(!_199||!_19a||!fxn){
return;
}
var rg=XMLParser.getArray(_199,_19a);
for(var ix=0;ix<rg.length;ix++){
fxn.apply(this,[rg[ix]]);
}
}
function queueForDom(fxn){
if(!window.fDomLoaded){
setTimeout(function(){
queueForDom(fxn);
},500);
return;
}
fxn();
}
function isSSL(){
return "https:"==document.location.protocol;
}


Array.prototype.map=function(f){
if(!f.apply){
var _2=f;
f=function(_){
return _[_2];
};
}
var _4=[];
for(var i=0;i<this.length;i++){
_4.push(f(this[i],this,i));
}
return _4;
};
Array.prototype.mapc=function(f){
if(!f.apply){
var _7=f;
f=function(_){
return _[_7];
};
}
var _9=[];
var _a;
for(var i=0;i<this.length;i++){
_a=f(this[i],this,i);
if(_a!=undefined){
_9=_9.concat(_a);
}
}
return _9;
};
Array.prototype.grep=function(f){
if(!f.apply){
var _d=f;
f=function(_){
return _[_d];
};
}
var _f=[];
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
_f.push(this[i]);
}
}
return _f;
};
Array.prototype.foreach=function(f){
if(!f.apply){
var _12=f;
f=function(_,x,i){
x[i]=_[_12];
};
}
for(var i=0;i<this.length;i++){
f(this[i],this,i);
}
return;
};
function map(f,_18){
var out=[];
for(var i=0;i<_18.length;i++){
out.push(f(_18[i]));
}
return out;
}
Array.prototype.firstMatch=function(f){
if(!f.apply){
var _1c=f;
f=function(_){
return _[_1c];
};
}
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
return this[i];
}
}
return undefined;
};
Array.prototype.firstMatchIndex=function(f){
if(!f.apply){
var _20=f;
f=function(_){
return _[_20];
};
}
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
return i;
}
}
return undefined;
};
Array.prototype.doToFirstMatch=function(f,_24){
if(!f.apply){
var _25=f;
f=function(_){
return _[_25];
};
}
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
return _24(this[i]);
}
}
return undefined;
};
Array.prototype.doToMatches=function(f,_29){
if(!f.apply){
var _2a=f;
f=function(_){
return _[_2a];
};
}
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
_29(this[i]);
}
}
return undefined;
};
Array.prototype.match=function(f){
for(var i=0;i<this.length;i++){
if(f(this[i],this,i)){
return true;
}
}
return false;
};
Array.prototype.shiftLeft=function(n){
if(n>this.length){
n=this.length;
}
if(n<0){
n=0;
}
for(var i=0;i<this.length-n;i++){
this[i]=this[i+n];
}
this.length=this.length-n;
};
Array.prototype.shiftRight=function(n){
if(n<0){
n=0;
}
this.length=this.length+n;
for(var i=this.length-1;i>=0;i--){
this[i]=this[i-n];
}
};
Array.prototype.pop=function(){
if(!this.length){
return undefined;
}
var o=this[this.length-1];
this.length=this.length-1;
return o;
};
Number.prototype.times=function(f){
if(!f||!f.apply||this<=0){
return;
}
for(var ix=0;ix<this;ix++){
f(ix);
}
};
function foreach(f,_37){
for(var i=0;i<_37.length;i++){
f(_37[i]);
}
}


var KeyManager=new function(){
this.nHotKeysLevel=0;
this.nHotKeysLevelMax=2;
this.nHelperOffsetX=8;
this.nHelperOffsetY=-11;
this.nHelperOffsetBelowY=16;
this.nHelperOffsetLeftX=-30;
this.nHelperOffsetLeftY=4;
this.rgReleaseKeys=["textarea","input","select-one","select","text","file"];
this.sSnippetKey="";
this.oPopupBrowser=null;
this.oMenuBrowser=null;
this.oGridBrowser=null;
this.bBrowsingGrid=false;
this.fxActivationKey=function(e,s,_3){
if(!_3){
_3=window;
}
return ((e.altKey||e.ctrlKey)&&!(_3.event&&_3.event.altKey&&!window.webkit)&&!(e.altKey&&e.ctrlKey)&&(";"==s||","==s));
};
this.rgHotKeyPopups=[];
this.rgHotKeys=[{cKey:this.sSnippetKey,id:"Menu_Snippets",bBrowse:true,nLevel:1},{cKey:"a",id:"assign",nLevel:1},{cKey:"a",id:"assign0",pos:"below",nLevel:1},{cKey:"a",id:"assign1",nLevel:1},{cKey:"a",id:"idApproveThread",nLevel:1},{cKey:"b",id:"idBugFromThread",nLevel:1},{cKey:"c",id:"Button_CancelEdit",nLevel:1},{cKey:"c",id:"Button_CancelEmail",nLevel:1},{cKey:"c",id:"Button_Cancel",nLevel:1},{cKey:"c",id:"Button_CancelResolve",nLevel:1},{cKey:"c",id:"idTimesheetConfirmCancel",nLevel:1},{cKey:"d",id:"Menu_Discuss",bBrowse:true,bMenu:true,nLevel:1},{cKey:"e",id:"editClosed",nLevel:1},{cKey:"e",id:"editClosed0",pos:"below",nLevel:1},{cKey:"e",id:"editClosed1",nLevel:1},{cKey:"e",id:"edit",nLevel:1},{cKey:"e",id:"edit0",pos:"below",nLevel:1},{cKey:"e",id:"edit1",nLevel:1},{cKey:"e",id:"idEditArticle",nLevel:1},{cKey:"e",id:"idThisDiscussionGroup",nLevel:1},{cKey:"f",id:"Menu_Filter",bBrowse:true,bMenu:true,nLevel:1},{cKey:"g",id:"Menu_LogInOut",bBrowse:true,nLevel:1},{cKey:"h",id:"FBHome",pos:"homelogo",nLevel:1},{cKey:"i",id:"email",nLevel:1},{cKey:"i",id:"email0",pos:"below",nLevel:1},{cKey:"i",id:"email1",nLevel:1},{cKey:"i",id:"email1",nLevel:1},{cKey:"i",id:"idThreadInfo",nLevel:1},{cKey:"i",id:"idViewHistory",nLevel:1},{cKey:"j",id:"browseGrid",pos:"center",nLevel:1,bNeverFocus:true},{cKey:"k",id:"Menu_Wiki",bBrowse:true,bMenu:true,nLevel:1},{cKey:"l",id:"Menu_List",nLevelAnchor:1,levelAnchorPos:"center",idLevelContainer:"tb4",bBrowse:true,nLevel:1},{cKey:"m",id:"Menu_Email",bBrowse:true,nLevel:1},{cKey:"n",id:"Menu_New",bBrowse:true,nLevel:1},{cKey:"o",id:"Button_SendEmail",nLevel:1},{cKey:"o",id:"Button_OKEdit",nLevel:1},{cKey:"o",id:"Button_OK",nLevel:1},{cKey:"o",id:"Button_Save",nLevel:1},{cKey:"o",id:"Button_Resolve",nLevel:1},{cKey:"p",id:"Menu_Reports",bBrowse:true,bMenu:true,nLevel:1},{cKey:"q",id:"Button_SendAndCloseEmail",nLevel:1},{cKey:"q",id:"Button_ResolveAndClose",nLevel:1},{cKey:"q",id:"Button_SaveAndClose",nLevel:1},{cKey:"r",id:"resolve",nLevel:1},{cKey:"r",id:"resolve0",pos:"below",nLevel:1},{cKey:"r",id:"resolve1",nLevel:1},{cKey:"r",id:"Menu_Register",bBrowse:true,nLevel:1},{cKey:"s",id:"idDropList_searchFor_oText",pos:"center",nLevel:1},{cKey:"s",id:"searchFor",pos:"center",nLevel:1},{cKey:"t",id:"reactivate",nLevel:1},{cKey:"t",id:"reactivate0",pos:"below",nLevel:1},{cKey:"t",id:"reactivate1",nLevel:1},{cKey:"t",id:"idNewTopic",nLevel:1},{cKey:"u",id:"reopen",nLevel:1},{cKey:"u",id:"reopen0",pos:"below",nLevel:1},{cKey:"u",id:"reopen1",nLevel:1},{cKey:"u",id:"idUndeleteThread",nLevel:1},{cKey:"v",id:"move",nLevel:1},{cKey:"v",id:"idReviewHeldThreads",nLevel:1},{cKey:"v",id:"idEditReleaseNotes",nLevel:1},{cKey:"v",id:"idViewArticle",nLevel:1},{cKey:"w",id:"forward",nLevel:1},{cKey:"w",id:"forward0",pos:"below",nLevel:1},{cKey:"w",id:"forward1",nLevel:1},{cKey:"w",id:"idReviewDeletedThreads",nLevel:1},{cKey:"w",id:"idNewArticle",nLevel:1},{cKey:"x",id:"close",nLevel:1},{cKey:"x",id:"close0",pos:"below",nLevel:1},{cKey:"x",id:"close1",nLevel:1},{cKey:"x",id:"idDeleteThread",nLevel:1},{cKey:"x",id:"idKeepThreadDeleted",nLevel:1},{cKey:"y",id:"reply",nLevel:1},{cKey:"y",id:"reply0",pos:"below",nLevel:1},{cKey:"y",id:"reply1",nLevel:1},{cKey:"y",id:"idReplyToTopic",nLevel:1},{cKey:"z",id:"remind",nLevel:1},{cKey:"z",id:"linkSubscribe",pos:"below",nLevel:1},{cKey:"z",id:"linkUnsubscribe",pos:"below",nLevel:1},{cKey:"?",id:"Menu_Help",nLevel:1},{cKey:"!",id:"spam",nLevel:1},{cKey:"!",id:"spam0",pos:"below",nLevel:1},{cKey:"!",id:"spam1",nLevel:1},{cKey:"/",id:"discussSearchFor",nLevel:1},{cKey:"[",id:"viewPreviousTop",pos:"below",nLevel:1},{cKey:"[",id:"viewPreviousBottom",nLevel:1},{cKey:"]",id:"viewNextTop",pos:"below",nLevel:1},{cKey:"]",id:"viewNextBottom",nLevel:1},{cKey:"+",id:"idAttachFile",nLevel:1},{cKey:"+",id:"idOlderTopics",nLevel:1},{cKey:"+",id:"idOtherTopics",nLevel:1},{cKey:"-",id:"Menu_Prefs",bBrowse:true,nLevel:1},{cKey:".",id:"Menu_Favorites",bBrowse:true,bMenu:true,nLevel:1},{cKey:"@",id:"Menu_Extras",bBrowse:true,bMenu:true,nLevel:1},{cKey:"*",id:"star",nLevel:1},{cKey:"*",id:"star0",pos:"below",nLevel:1},{cKey:"*",id:"star1",nLevel:1},{cKey:"=",id:"Menu_Settings",nLevel:1},{cKey:"\\",id:"Menu_Working_On",nLevel:1},{cKey:"a",id:"idFilterLinkPopPersonAssignedTo",bBrowse:true,bMenu:true,nLevel:2},{cKey:"b",id:"idFilterLinkPopOpenClosed",bBrowse:true,bMenu:true,nLevel:2},{cKey:"c",id:"mainColumnPopupLink",bBrowse:true,bMenu:true,nLevel:2},{cKey:"d",id:"idFilterLinkPopResolvedInLast",bBrowse:true,bMenu:true,nLevel:2},{cKey:"e",id:"idFilterLinkPopDueInNext",bBrowse:true,bMenu:true,nLevel:2},{cKey:"f",id:"idFilterOptFieldsPop",bBrowse:true,bMenu:true,nLevelAnchor:2,idLevelContainer:"idFilterDescription",levelanchorpos:"left",nLevel:2},{cKey:"f",id:"idFilterLinkPopRefine",bBrowse:true,bMenu:true,nLevelAnchor:2,idLevelContainer:"idFilterDescription",nLevel:2},{cKey:"g",id:"idSwitchGridListLink",bBrowse:true,bMenu:true,nLevel:2},{cKey:"h",id:"idFilterLinkPopSubscribedBugs",bBrowse:true,bMenu:true,nLevel:2},{cKey:"i",id:"idFilterLinkPopOpenInLast",bBrowse:true,bMenu:true,nLevel:2},{cKey:"k",id:"idFilterLinkPopClosedInLast",bBrowse:true,bMenu:true,nLevel:2},{cKey:"l",id:"idFilterLinkPopClient",bBrowse:true,bMenu:true,nLevel:2},{cKey:"l",id:"idFilterLinkPopDepartment",bBrowse:true,bMenu:true,nLevel:2},{cKey:"m",id:"idFilterLinkPopMissingEstimate",bBrowse:true,bMenu:true,nLevel:2},{cKey:"n",id:"idFilterLinkPopMaxrecords",bBrowse:true,bMenu:true,bMenu:true,nLevel:2},{cKey:"o",id:"idFilterLinkPopPersonOpenedBy",bBrowse:true,bMenu:true,nLevel:2},{cKey:"o",id:"idFilterOptOpenAllPop",bBrowse:true,bMenu:true,nLevel:2},{cKey:"p",id:"idFilterLinkPopProject",bBrowse:true,bMenu:true,nLevel:2},{cKey:"q",id:"idFilterLinkPopPriority",bBrowse:true,bMenu:true,nLevel:2},{cKey:"r",id:"idFilterLinkPopArea",bBrowse:true,bMenu:true,nLevel:2},{cKey:"s",id:"idFilterLinkPopStatus",bBrowse:true,bMenu:true,nLevel:2},{cKey:"s",id:"idFilterOptTermPop",bBrowse:true,bMenu:true,nLevel:2},{cKey:"t",id:"idFilterLinkPopCategory",bBrowse:true,bMenu:true,nLevel:2},{cKey:"u",id:"idFilterLinkPopCustom1",bBrowse:true,bMenu:true,nLevel:2},{cKey:"v",id:"idFilterLinkPopCustom2",bBrowse:true,bMenu:true,nLevel:2},{cKey:"w",id:"idFilterSaveCurrentAs",bBrowse:true,bMenu:true,nLevel:2},{cKey:"x",id:"idFilterLinkPopFixFor",bBrowse:true,bMenu:true,nLevel:2},{cKey:"y",id:"idRssLink",bBrowse:true,bMenu:true,nLevel:2},{cKey:"z",id:"idFilterLinkPopSentBy",bBrowse:true,bMenu:true,nLevel:2}];
var _4={};
this.hkMap=_4;
this.rgHotKeys.foreach(function(_){
if(_.bBrowse){
_4[_.id]=_;
}
});
this.setSnippetKey=function(_6){
this.sSnippetKey=_6;
this.rgHotKeys[0].cKey=this.sSnippetKey;
};
this.registerElPopupKeys=function(_7){
if(!_7){
return;
}
function registerNodes(rg){
for(var ix=0;ix<rg.length;ix++){
var el=rg[ix];
var _b=el.getAttribute("cHotKey");
if(_b){
KeyManager.registerPopupKey(_b,el.id,_7);
}
if(isTagName(el,"input")&&el.type.toLowerCase()=="text"){
el.setAttribute("autocomplete","off");
}
}
}
registerNodes(_7.getElementsByTagName("input"));
registerNodes(_7.getElementsByTagName("button"));
registerNodes(_7.getElementsByTagName("a"));
};
this.registerPopupKey=function(_c,_d,_e){
this.rgHotKeys.push({cKey:_c,id:_d,nLevel:1,oPopup:_e});
this.rgHotKeyPopups[_e.id]=true;
};
this.removePopupKeys=function(_f){
while(this.rgHotKeys[this.rgHotKeys.length-1].oPopup==_f){
this.rgHotKeys.pop();
}
};
this.activateHotKeys=function(){
if(0==this.nHotKeysLevel){
return true;
}
var _10=false;
var _11="";
var _12=theMgr.getTopmostObject();
if(!_12||!_12.id||!this.rgHotKeyPopups[_12.id]){
_12=null;
}
var _13=document.createElement("SPAN");
_13.id="keyHelpers";
for(var i=0;i<this.rgHotKeys.length;i++){
var _15=this.rgHotKeys[i];
if(_15.nLevel==this.nHotKeysLevel&&_15.oPopup==_12){
var _16=elById(_15.id);
var _17=null;
if(null!=_16&&(!_16.getAttribute("keydisabled"))&&isDisplayed(_16)&&(null==_16.className||("actionButtonDisabled"!=_16.className))){
var pt=getAbsolutePosition(_16);
_17=document.createElement("DIV");
_17.id="keyHelper_"+i;
_17.className="hotkeyHelper";
_17.style.zIndex=10;
var _19=_15.cKey.toUpperCase();
if("<"==_19){
_19="&lt;";
}else{
if(">"==_19){
_19="&gt;";
}
}
_17.innerHTML=_19;
this.positionKeyHelper(_17,pt,_16,_15.pos);
_13.appendChild(_17);
_10=true;
}
}
if(null!=_15.nLevelAnchor&&this.nHotKeysLevel!=_15.nLevelAnchor&&_12==null){
var _16=elById(_15.id);
var _17=null;
if(null!=_16&&isDisplayed(_16)&&(!_16.getAttribute("keydisabled"))&&(null==_16.className||("actionButtonDisabled"!=_16.className))){
var pt=getAbsolutePosition(_16);
_17=document.createElement("DIV");
_17.id="keyHelper_"+i;
_17.className="hotkeyHelper";
var _19=_15.nLevelAnchor;
_17.innerHTML=_19;
this.positionKeyHelper(_17,pt,_16,_15.levelAnchorPos);
_13.appendChild(_17);
}
}
if(null!=_15.nLevelAnchor&&this.nHotKeysLevel==_15.nLevelAnchor&&isDisplayed(_15.id)){
_11=_15.idLevelContainer;
}
}
if(_10){
document.body.appendChild(_13);
this.browseMenus(_11);
}
if(window.opera){
safeFocus(window);
}
if(typeof (oWysiwyg)!="undefined"){
oWysiwyg.blur();
}
return _10;
};
this.positionKeyHelper=function(_1a,pt,_1c,pos){
if(_1a){
if(pos&&"center"==pos){
x=pt.x+_1c.offsetWidth/2-5;
y=pt.y+2;
}else{
if(pos&&"homelogo"==pos){
if(_1c.firstChild==_1c.lastChild&&isTagName(_1c.firstChild,"img")){
_1c=_1c.firstChild;
pt=getAbsolutePosition(_1c);
}
x=pt.x+_1c.offsetWidth/2-5;
y=pt.y-_1c.offsetHeight/4;
}else{
if(pos&&"below"==pos){
x=pt.x+this.nHelperOffsetX;
y=pt.y+this.nHelperOffsetBelowY;
}else{
if(pos&&"left"==pos){
x=pt.x+this.nHelperOffsetLeftX;
y=pt.y+this.nHelperOffsetLeftY;
}else{
x=pt.x+this.nHelperOffsetX;
y=pt.y+this.nHelperOffsetY;
}
}
}
}
if(x<1){
x=1;
}
if(y<1){
y=1;
}
_1a.style.left=x+"px";
_1a.style.top=y+"px";
}
};
this.deactivateHotKeys=function(){
this.nHotKeysLevel=0;
this.hideHotKeys();
};
this.cleanupOnClick=function(){
this.deactivateHotKeys();
this.oMenuBrowser=null;
this.bBrowsingGrid=false;
if(this.oGridBrowser){
this.oGridBrowser.cleanup();
}
var _1e=this.getElCursor();
if(_1e){
_1e.style.display="none";
}
return true;
};
this.hideHotKeys=function(){
var _1f=elById("keyHelpers");
if(_1f!=null&&_1f.parentNode!=null){
_1f.parentNode.removeChild(_1f);
}
};
this.giveFocus=function(el){
if(null==el){
return false;
}
if(true==this.hkMap[el.id].bMenu&&el.onclick){
this.simulateClick(el);
safeFocus(el);
}else{
theMgr.maskClicks();
safeFocus(el);
}
return true;
};
this.keystroke=function(e,_22){
if(!_22){
_22=window;
}
var _23=getKeyCode(e);
if(_23>=16&&_23<=18){
return true;
}
if(_23==191&&!document.all&&this.nHotKeysLevel&&e.shiftKey){
return false;
}
var _24=String.fromCharCode(KeyboardMap.fix(_23,false,_22));
var _25="";
var _26=null;
var _27=this.nHotKeysLevel;
if(e&&e.target&&e.target.type){
_25=e.target.type.toLowerCase();
_26=e.target;
}else{
if(_22.event&&_22.event.srcElement&&_22.event.srcElement.tagName){
_26=_22.event.srcElement;
_25=_26.tagName.toLowerCase();
if(_26.type){
_25=_26.type.toLowerCase();
}
e=_22.event;
}
}
if(0==_24.length&&(e.altKey||e.ctrlKey)){
return true;
}
if(this.nHotKeysLevel>0){
this.hideHotKeys();
}
if(this.fxActivationKey(e,String.fromCharCode(KeyboardMap.fix(_23,true,_22)))){
IdPop.hideNow();
do{
this.nHotKeysLevel=(this.nHotKeysLevel+1)%(this.nHotKeysLevelMax+1);
}while(!this.activateHotKeys());
return cancel(e);
}
this.nHotKeysLevel=0;
if(27==_23){
Info.hide();
if(null!=_26&&null!=_26.id&&"idSnippet"==_26.id.substring(0,9)){
hideSnippetHelper();
return cancel(e);
}else{
theMgr.hideAllPopups();
if(theMgr.getTopmostPopup()!=null){
return;
}
if(_27==0){
EditableTableManager.hideAllPanes();
ShadowManager.hideAllShadows();
}
if(this.oMenuBrowser){
this.oMenuBrowser.cleanup();
this.oMenuBrowser=null;
}
if(this.bBrowsingGrid){
this.oGridBrowser.cleanup();
this.bBrowsingGrid=false;
this.getElCursor().style.display="none";
}
return cancel(e);
}
}
if(0==_27){
if(e.ctrlKey&&!e.altKey&&typeof (oWysiwyg)!="undefined"){
if(!oWysiwyg.ctrlKeyDownEvent(_24.toLowerCase())){
return cancel(e);
}
}
if(this.rgReleaseKeys.firstMatch(function(_){
return _==_25;
})){
if(27==_23&&_26!=null&&_26.blur){
_26.blur();
return cancel(e);
}
return true;
}
}
if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&((!window.opera&&(33<=_23&&40>=_23))||106==_23||107==_23||74==_23||75==_23||45==_23||43==_23)){
if(0!=_27&&this.oGridBrowser&&(33==_23||34==_23||35==_23||36==_23||38==_23||40==_23)){
var _29=false;
if(this.oGridBrowser.elCurrent){
_29=true;
}
this.browseGridRows();
if(40==_23&&!_29){
return cancel(e);
}
}
var _2a=null;
if(null!=this.oPopupBrowser&&isDisplayed(this.oPopupBrowser.elContainer)){
_2a=this.oPopupBrowser;
}else{
if(this.bBrowsingGrid&&null==this.oMenuBrowser&&null!=this.oGridBrowser&&null!=this.oGridBrowser.elContainer){
_2a=this.oGridBrowser;
}
}
if((33==_23&&this.oGridBrowser&&_2a==this.oGridBrowser&&this.oGridBrowser.goNPrevious(this.getGridScrollNum()))||(34==_23&&this.oGridBrowser&&_2a==this.oGridBrowser&&this.oGridBrowser.goNNext(this.getGridScrollNum()))||(35==_23&&_2a&&_2a.goToLast())||(36==_23&&_2a&&_2a.goToFirst())||(37==_23&&this.oMenuBrowser&&this.oMenuBrowser.goToPrevious())||((38==_23||107==_23||75==_23)&&_2a&&_2a.goToPrevious())||(39==_23&&this.oMenuBrowser&&this.oMenuBrowser.goToNext())||((40==_23||106==_23||74==_23)&&_2a&&_2a.goToNext())||((38==_23||40==_23)&&this.oMenuBrowser&&this.oMenuBrowser.elCurrent&&this.oMenuBrowser.elCurrent.onclick&&this.oMenuBrowser.elCurrent.onclick())){
return cancel(e);
}else{
if(this.oMenuBrowser){
if(this.oPopupBrowser&&this.oPopupBrowser.elCurrent&&(45==_23||43==_23)){
var _2b=null;
var _2c=null;
_2b=this.oPopupBrowser.elCurrent.getAttribute("sNameRefine");
if(_2b){
_2c=elById("idRefineFilter"+_2b);
}
if(_2c&&(43==_23)&&_2c.style.display=="none"){
this.simulateClick(this.oPopupBrowser.elCurrent);
}else{
if(_2c&&(45==_23)&&_2c.style.display!="none"){
this.simulateClick(this.oPopupBrowser.elCurrent);
}
}
}
if(0==_27){
return cancel(e);
}else{
this.oMenuBrowser.cleanup();
this.oMenuBrowser=null;
}
}
}
}
if(!e.metaKey&&0!=_27){
if(_23>48&&_23<=48+this.nHotKeysLevelMax&&!e.shiftKey){
this.nHotKeysLevel=_23-48;
if(this.activateHotKeys()){
return cancel(e);
}
}
this.oMenuBrowser=null;
var _2d=theMgr.getTopmostObject();
if(!_2d||!_2d.id||!this.rgHotKeyPopups[_2d.id]){
_2d=null;
}
var _2e=_24.toLowerCase();
var _2f=_24.toUpperCase();
var key=this.rgHotKeys.firstMatch(function(_){
return _27==_.nLevel&&(_2d==_.oPopup)&&(_.cKey==_2e||_.cKey==_2f)&&isDisplayed(elById(_.id))&&!(elById(_.id)).getAttribute("keydisabled");
});
if(key){
var _32=elById(key.id);
if(!key.bNeverFocus){
try{
if(isDisplayed(_32)){
safeFocus(_32);
}
}
catch(err){
}
}
if(this.simulateClick(_32)){
return cancel(e);
}
}
return cancel(e);
}
return true;
};
this.simulateClick=function(_33){
if(_33!=null){
if(isDisplayed(_33)){
if(document.selection&&_33.click){
try{
_33.click();
}
catch(err){
}
return true;
}else{
var _34=false;
try{
_33.click();
_34=true;
}
catch(err){
}
if(!_34){
try{
if(((!_33.onclick||_33.onclick())&&(!ourHasEvent(_33,"click")||ourDispatchEvent(_33,"click")))&&_33.href){
document.location=_33.href;
}
}
catch(err){
}
}
return true;
}
}
}
return false;
};
this.browseMenus=function(_35){
this.oMenuBrowser=new ListBrowser(elById(_35),function(el){
return el.id&&KeyManager.hkMap[el.id];
},function(el){
KeyManager.giveFocus(el);
},function(el){
theMgr.hideAllPopups();
},null,null,null);
return false;
};
this.browsePopup=function(_39){
this.oPopupBrowser=new ListBrowser(elById(_39),function(el){
return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&!(1==el.getAttribute("fKbSkip"));
},function(el){
if(el&&el.focus){
safeFocus(el);
}
},function(el){
},null,function(el){
el.onfocus=function(){
null!=KeyManager.oPopupBrowser&&KeyManager.oPopupBrowser.setElCurrent(this);
};
el.onmouseover=function(){
var _3e=this.getAttribute("onmouseover");
if(_3e&&typeof (_3e)=="string"){
this.onmouseoverOld=function(){
return eval(_3e);
};
}
if(this.onmouseoverOld&&this.onmouseoverOld.apply){
this.onmouseoverOld.apply(this);
}
if(!window.opera){
safeFocus(this);
}
};
},null);
return false;
};
this.browseCheckboxPopup=function(_3f){
this.oPopupBrowser=new ListBrowser(elById(_3f),function(el){
return null!=el.type&&"checkbox"==el.type();
},function(el){
safeFocus(el);
},function(el){
},null,function(el){
el.onfocus=function(){
null!=KeyManager.oPopupBrowser&&KeyManager.oPopupBrowser.setElCurrent(this);
};
el.onmouseover=function(){
if(!window.opera){
safeFocus(this);
}
};
},null);
return false;
};
this.browseTimesheetGrid=function(_44){
this.oPopupBrowser=new ListBrowser(elById(_44),function(el){
return null!=el.tagName&&"img"==el.tagName.toLowerCase()&&"a"==el.parentNode.tagName.toLowerCase();
},function(el){
safeFocus(el.parentNode);
KeyManager.gridBrowserPositionCursor(el);
},function(el){
return;
},function(el){
return false;
},null,function(el){
return;
});
if(!this.oPopupBrowser.elCurrent){
this.oPopupBrowser.goToNext();
}
return false;
};
this.browseGridRows=function(){
if(!this.oGridBrowser){
this.setupGridBrowser();
}
if(this.oGridBrowser){
this.oMenuBrowser=null;
theMgr.maskClicks();
this.bBrowsingGrid=true;
if(this.oGridBrowser.elCurrent){
setTimeout("KeyManager.oGridBrowser.fxEnter(KeyManager.oGridBrowser.elCurrent);",1);
}else{
this.oGridBrowser.goToNext();
}
return false;
}else{
return true;
}
};
this.getElCursor=function(){
return elById("kbCursor");
};
this.gridBrowserGetElPos=function(el){
if(el.parentNode&&el.parentNode.parentNode&&el.parentNode.parentNode.tagName&&"tr"==el.parentNode.parentNode.tagName.toLowerCase()){
el=el.parentNode.parentNode;
while(window.webkit&&!el.offsetWidth&&el.firstChild){
el=el.firstChild;
}
return el;
}else{
return el;
}
};
this.gridBrowserPositionCursor=function(el){
var _4c=this.gridBrowserGetElPos(el);
var _4d=KeyManager.getElCursor();
var pt=getAbsolutePosition(_4c);
_4d.style.display="block";
_4d.style.zIndex=10;
_4d.style.left=(pt.x-_4d.offsetWidth-3)+"px";
_4d.style.top=(pt.y+(_4c.offsetHeight-_4d.offsetHeight)/2)+"px";
};
this.getGridScrollNum=function(){
var _4f=this.gridBrowserGetElPos(this.oGridBrowser.elCurrent);
return ((window.innerHeight?window.innerHeight:document.documentElement.clientHeight)/_4f.offsetHeight)-4;
};
this.setupGridBrowser=function(){
var _50=elById("bugGrid");
if(_50){
this.oGridBrowser=new ListBrowser(_50,function(el){
return (null!=el.type&&"checkbox"==el.type)||(isTagName(el,"a")&&isTagName(el.firstChild,"img")&&el.firstChild.alt==FB_ICON_NEW);
},function(el){
ourDispatchEvent(getParentRow(el),"mouseover");
safeFocus(el);
KeyManager.gridBrowserPositionCursor(el);
},function(el){
ourDispatchEvent(getParentRow(el),"mouseout");
},function(el){
return false;
},null,function(el){
});
}else{
if(elById("dlgGrid")){
this.oGridBrowser=new ListBrowser(elById("dlgGrid"),function(el){
return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&((el.title&&FB_ICON_EDIT==el.title||FB_ICON_NEW==el.title)||(el.className&&el.className.indexOf("discuss")==0));
},function(el){
safeFocus(el);
KeyManager.gridBrowserPositionCursor(el.parentNode);
},function(el){
return;
},function(el){
return false;
},function(el){
ourAttachEvent(el,"keypress",function(e){
keypressDiscussList(e,el);
});
},function(el){
return;
});
}
}
return false;
};
};
function ListBrowser(_5d,_5e,_5f,_60,_61,_62,_63){
this.fxTest=_5e;
this.fxEnter=_5f;
this.fxLeave=_60;
this.fxDoToEach=_62;
this.fxDeadEnd=_61;
this.fxOnClean=_63;
this.fxOnLeave=null;
this.elContainer=_5d;
this.elCurrent=null;
this.debug=false;
this.setElCurrent=function(el){
if(isUnderNode(el,this.elContainer)){
this.elCurrent=el;
}
};
this.doFxToEach=function(){
if(null==this.fxDoToEach){
return;
}
var _65=this.findNextUnder(null);
var _66=null;
while(null!=_65){
this.fxDoToEach(_65);
_66=this.findNextUnder(_65);
if(_65==_66){
_65=null;
}else{
_65=_66;
}
}
};
this.traverse=function(_67,n){
var _69=this.elCurrent;
var _6a;
for(var i=0;i<n;i++){
_6a=(_67?this.findNextUnder(this.elCurrent):this.findPreviousUnder(this.elCurrent));
if(_6a==this.elCurrent){
if(null==this.fxDeadEnd){
_6a=(_67?this.findNextUnder(null):this.findPreviousUnder(null));
}else{
if(null!=_69){
this.fxLeave(_69);
}
this.fxEnter(this.elCurrent);
return this.fxDeadEnd();
}
}
this.elCurrent=_6a;
}
if(null!=_69){
this.fxLeave(_69);
}
this.fxEnter(this.elCurrent);
return true;
};
this.goToNext=function(){
return this.traverse(true,1);
};
this.goToPrevious=function(){
return this.traverse(false,1);
};
this.goNNext=function(n){
return this.traverse(true,n);
};
this.goNPrevious=function(n){
return this.traverse(false,n);
};
this.goToFirst=function(){
this.dropCurrent();
return this.traverse(true,1);
};
this.goToLast=function(){
this.dropCurrent();
return this.traverse(false,1);
};
this.dropCurrent=function(){
if(this.elCurrent){
this.fxLeave(this.elCurrent);
this.elCurrent=null;
}
};
this.findNextUnder=function(_6e){
return this.findUnder(_6e,function(el){
return el.nextSibling;
},function(el){
return el.firstChild;
});
};
this.findPreviousUnder=function(_71){
return this.findUnder(_71,function(el){
return el.previousSibling;
},function(el){
return (document.selection?el.childNodes[el.childNodes.length-1]:el.lastChild);
});
};
this.findUnder=function(_74,_75,_76){
if(null==this.elContainer){
return null;
}
var el=null;
var _78=false;
var _79=false;
if(null!=_74){
el=_74;
}else{
if(null!=_76(this.elContainer)){
el=_76(this.elContainer);
_78=true;
}else{
return null;
}
}
while(null!=el){
if(null!=el&&this.fxTest(el)&&_78&&!_79){
if(this.debug){
alert("found");
}
return el;
}else{
if(null!=el.tagName&&null!=el.style&&"none"!=el.style.display&&null!=_76(el)&&!_79){
if(this.debug){
alert("descend");
}
el=_76(el);
_78=true;
_79=false;
}else{
if(null!=_75(el)){
if(this.debug){
alert("next");
}
el=_75(el);
_78=true;
_79=false;
}else{
if(document.getParent(el)!=this.elContainer){
if(this.debug){
alert("ascend");
}
el=document.getParent(el);
if(this.fxOnLeave&&this.fxTest(el)){
this.fxOnLeave(el);
}
_78=true;
_79=true;
}else{
if(this.debug){
alert("dead end");
}
el=null;
}
}
}
}
}
return _74;
};
this.cleanup=function(){
if(this.elCurrent&&this.elCurrent.blur){
try{
this.elCurrent.blur();
}
catch(err){
}
}
if(this.fxOnClean){
this.fxOnClean(this.elCurrent);
}
};
this.doFxToEach();
}
var KeyboardMap=new function(){
this.fix=function(n,_7b,_7c){
if(!_7c){
_7c=window;
}
var _7d=window.ie||(window.webkit&&(window.versionMajorWebKit>5||(window.versionMajorWebKit==5&&window.versionMinorWebKit>=25)));
if(!_7d){
return n;
}
var _7e=navigator.userLanguage||navigator.language;
if(!_7e){
return n;
}
var _7f=this.map[_7e];
if(!_7f){
_7f=this.map["en-us"];
}
var _80=0;
if(_7c.event.shiftKey){
_80+=1;
}
if(!_7b&&(_7c.event.ctrlKey)){
_80+=2;
}
if(_7c.event.altKey){
_80+=4;
}
var _81="n"+n+"s"+_80;
if(_7f[_81]){
return _7f[_81];
}else{
return n;
}
};
};
KeyboardMap.map={};
KeyboardMap.map["en-us"]={n49s1:33,n222s1:34,n51s1:35,n52s1:36,n53s1:37,n55s1:38,n222s0:39,n57s1:40,n48s1:41,n56s1:42,n187s1:43,n188s0:44,n189s0:45,n190s0:46,n191s0:47,n186s1:58,n186s0:59,n188s1:60,n187s0:61,n190s1:62,n191s1:63,n50s1:64,n219s0:91,n220s0:92,n221s0:93,n54s1:94,n189s1:95,n192s0:96,n65s0:97,n66s0:98,n67s0:99,n68s0:100,n69s0:101,n70s0:102,n71s0:103,n72s0:104,n73s0:105,n74s0:106,n75s0:107,n76s0:108,n77s0:109,n78s0:110,n79s0:111,n80s0:112,n81s0:113,n82s0:114,n83s0:115,n84s0:116,n85s0:117,n86s0:118,n87s0:119,n88s0:120,n89s0:121,n90s0:122,n219s1:123,n220s1:124,n221s1:125,n192s1:126,n8s2:127,n0s0:0};


var g_ActionTokens=new function(){
this.dictToken={};
this.setTokens=function(_1){
this.dictToken=_1;
};
this.getToken=function(_2){
return this.dictToken[_2];
};
this.injectURLToken=function(_3){
if("string"==typeof (_3)){
var _4=_3.match(/[?&]sActionToken=[^&]+/i);
if(null==_4||0==_4.length){
var _5=_3.match(/[?&]pre=[^&]+/i);
if(null!=_5&&_5.length>0){
var _6=_5[_5.length-1];
var _7=this.getToken(_6.slice(5));
if(_7){
return _3.replace(_6,_6+"&"+ACTION_TOKEN_NAME+"="+_7);
}
}
}
}
return _3;
};
};


var oAjaxRequest;
var g_rgAjaxRequests=[];
function unloadAjax(){
if(!window.ie6){
return;
}
for(var ix=0;ix<g_rgAjaxRequests.length;ix++){
g_rgAjaxRequests[ix].unload();
}
}
function AjaxRequest(){
var _2;
var _3;
var _4;
var _5;
this.id=null;
this.msTimeout=60000*5;
this.bDefaultFailureBehavior=true;
this.bNoCache=true;
this.bShowErrorsEncountered=true;
var _6;
var _7=this;
this.initialize=function(){
this.msTimeout=60000*5;
this.bDefaultFailureBehavior=true;
this.bNoCache=true;
this.bShowErrorsEncountered=true;
_4=new Date().valueOf();
_3=false;
_6=null;
_2=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
_2.onreadystatechange=function(){
_7.isHealthy();
};
if(window.ie6&&null==this.id){
this.id=g_rgAjaxRequests.length;
g_rgAjaxRequests[this.id]=this;
}
};
this.unload=function(){
_2=null;
};
this.abort=function(){
if(!_2){
return;
}
if(_2.readyState!=0&&_2.readyState!=4){
_2.onreadystatechange=function(){
return false;
};
_2.abort();
_6=null;
_4=null;
}
};
this.status=function(){
if(!_2){
return -1;
}
try{
return _2.status;
}
catch(e){
return 0;
}
};
this.onreadystatechange=function(_8){
if(!_2){
this.initialize();
}
var _9=this;
_2.onreadystatechange=function(){
if(_9.isHealthy()){
_8.call();
var _a=XMLParser.getCDataFrom(_9.responseXML(),"FBTiming");
if(_a){
var _b=elById("idTimingAjax");
if(_b){
_b.innerHTML=_a;
}
}
}
};
};
this.onfailure=function(_c){
_6=_c;
};
this.timeoutExpired=function(id){
if(_4!=id){
return;
}
if(_3){
return;
}
if(((new Date())-_5)<(this.msTimeout-1000)){
var _e=this;
setTimeout(function(){
_e.timeoutExpired(id);
},this.msTimeout);
return;
}
if(this.bDefaultFailureBehavior){
this.doDefaultFailureBehavior();
}
var _f=((_6&&_6.call)?_6:null);
this.abort();
if(_f){
_f.call();
}
};
this.doDefaultFailureBehavior=function(){
Info.showBriefly(FB_NO_RESPONSE);
EditableTableManager.hideAllPanes();
};
this.isHealthy=function(){
if(this.readyState()==4){
_3=true;
if(this.status()!=0&&this.status()!=200&&this.responseText().length&&this.bShowErrorsEncountered){
this.showError();
this.abort();
return false;
}
}
return this.isReady()||(!this.bShowErrorsEncountered&&!this.isBusy());
};
this.showError=function(){
var s=this.responseText();
var _11=document.createElement("form");
var _12=document.createElement("textarea");
_11.appendChild(_12);
_11.name="formWithError";
_11.action=FB_DEFAULT_URL;
_11.method="POST";
_12.name="sAjaxError";
_12.style.display="none";
_12.value=s;
document.body.appendChild(_11);
_11.submit();
};
this.send=function(_13){
if(!_2){
this.initialize();
}
_3=false;
var _14=this;
var id=_4;
try{
_2.send(this.noCache(g_ActionTokens.injectURLToken(_13)));
}
catch(e){
}
_5=new Date();
if(this.msTimeout>0){
setTimeout(function(){
_14.timeoutExpired(id);
},this.msTimeout);
}
};
this.open=function(_16,_17,_18){
if(!_2){
this.initialize();
}
if(_17.indexOf("undefined?")==0){
_17=_17.substring("undefined?".length-1);
}
var _19=g_ActionTokens.injectURLToken(_17);
var _1a=(_16.toUpperCase()=="POST"||!this.bNoCache)?_19:this.noCache(_19);
try{
_2.open(_16,_1a,_18);
}
catch(e){
return false;
}
if(_16.toUpperCase()=="POST"){
_2.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
return true;
};
this.readyState=function(){
if(!_2){
return -1;
}
return _2.readyState;
};
this.responseText=function(){
if(!_2){
return null;
}
return _2.responseText;
};
this.responseXML=function(_1b){
if(!_2){
return null;
}
if(_1b&&!XMLParser.getNodeFrom(_2.responseXML,"FogBugzXML")){
Process.haltAll();
Info.showBriefly(FB_BAD_RESPONSE);
return null;
}
return _2.responseXML;
};
this.isBusy=function(){
if(!_2){
return false;
}
return ((_2.readyState!=4)&&(_2.readyState!=0));
};
this.isReady=function(){
if(!_2){
return false;
}
if(_2.readyState!=4){
return false;
}
try{
return (_2.status==200);
}
catch(e){
return false;
}
};
this.noCache=function(_1c){
if(!_1c){
return null;
}
return trailingAmpersand(_1c)+"nocache="+new Date().valueOf();
};
this.initialize();
}
var XMLParser=new function(){
this.getNodeFrom=function(_1d,_1e){
if(!_1d){
return null;
}
var e=_1d.getElementsByTagName(_1e);
if(e){
e=e[0];
}
if(e){
return e;
}
return null;
};
this.getNodeUsingIdFrom=function(_20,_21,sId){
if(!_20){
return null;
}
var _23=_20.getElementsByTagName(_21);
for(var ix=0;ix<_23.length;ix++){
if(_23[ix].id==sId){
return _23[ix];
}
}
return null;
};
this.getNodeMatchingIdFrom=function(_25,_26,_27){
if(!_25){
return null;
}
var _28=_25.getElementsByTagName(_26);
var re=new RegExp(_27,"");
for(var ix=0;ix<_28.length;ix++){
if(re.test(_28[ix].id)){
return _28[ix];
}
}
return null;
};
this.getArrayMatchingId=function(_2b,_2c,_2d){
if(!_2b){
return [];
}
var _2e=_2b.getElementsByTagName(_2c);
var rg=[];
var re=new RegExp(_2d,"");
for(var ix=0;ix<_2e.length;ix++){
if(re.test(_2e[ix].id)){
rg[rg.length]=_2e[ix];
}
}
return rg;
};
this.getNodeArrayUsingIdFrom=function(_32,_33,sId){
if(!_32){
return [];
}
var _35=[];
var _36=0;
var _37=_32.getElementsByTagName(_33);
for(var ix=0;ix<_37.length;ix++){
if(_37[ix].id==sId){
_35[_36++]=_37[ix];
}
}
return _35;
};
this.getNodeArrayUsingAttributeFrom=function(_39,_3a,_3b,_3c){
if(!_39){
return [];
}
var _3d=[];
var _3e=_39.getElementsByTagName(_3a);
for(var ix=0;ix<_3e.length;ix++){
if(_3e[ix].getAttribute&&_3e[ix].getAttribute(_3b)==_3c){
_3d[_3d.length]=_3e[ix];
}
}
return _3d;
};
this.getNodeArrayFrom=function(_40,_41){
return this.getArray(_40,_41);
};
this.getArray=function(_42){
if(!_42){
return [];
}
if(arguments.length==1){
return [];
}
if(arguments.length==2){
return intoArray(_42.getElementsByTagName(arguments[1]));
}
var _43=[];
for(var _44=1;_44<arguments.length;_44++){
var rg=_42.getElementsByTagName(arguments[_44]);
if(rg){
for(var ix=0;ix<rg.length;ix++){
_43[_43.length]=rg[ix];
}
}
}
return _43;
};
this.getTextFrom=function(_47,_48){
return this.getNthTextFrom(_47,_48,0);
};
this.getTextOf=function(e){
if(e){
e=e.childNodes;
}
if(e){
e=e[0];
}
if(e){
e=e.nodeValue;
}
if(e){
return e;
}
return null;
};
this.getNthTextFrom=function(_4a,_4b,n){
if(!_4a){
return null;
}
var e=_4a.getElementsByTagName(_4b);
if(e){
e=e[n];
}
if(e){
e=e.childNodes;
}
if(e){
var s="";
for(var ix=0;ix<e.length;ix++){
s+=e[ix].nodeValue;
}
return s;
}
return null;
};
this.getCustomTagValueFrom=function(_50,_51){
return this.getNthCustomTagValueFrom(_50,_51,0);
};
this.setCustomTagValue=function(_52,_53,_54){
var e=this.getNodeFrom(_52,_53);
if(!e){
var ix=_53.indexOf(":");
if(ix>=0){
_53=_53.substring(ix+1);
e=this.getNodeFrom(_52,_53);
}
}
if(e){
e=e.childNodes;
}
if(e){
e=e[0];
}
if(e){
e.nodeValue=_54;
}
};
this.getNthCustomTagValueFrom=function(_57,_58,n){
var e=this.getNthTextFrom(_57,_58,n);
if(!e){
var ix=_58.indexOf(":");
if(ix>=0){
_58=_58.substring(ix+1);
e=this.getNthTextFrom(_57,_58,n);
}
}
if(e){
return e;
}
return null;
};
this.getCDataOf=function(_5c){
var e=_5c;
if(e){
e=e.childNodes;
}
if(e){
var e0=e[0];
var e1=e[1];
if(e0&&e1&&e0.nodeType==4&&e1.nodeType==4){
var s=e0.nodeValue+e1.nodeValue;
var i=2;
var ex=e[i];
while(ex&&ex.nodeType==4){
s+=ex.nodeValue;
i++;
ex=e[i];
}
return s;
}
if(e0&&e0.nodeType==4){
return e0.nodeValue;
}
if(e1&&e1.nodeType==4){
return e1.nodeValue;
}
}
return null;
};
this.getCDataFrom=function(_63,_64){
if(!_63){
return null;
}
var e=_63.getElementsByTagName(_64);
if(e){
e=e[0];
}
return this.getCDataOf(e);
};
this.getInnerTextFrom=function(_66,_67){
if(!_66){
return null;
}
var e=_66.getElementsByTagName(_67);
if(e){
e=e[0];
}
if(e){
return e.innerText;
}
return null;
};
};
var Process=new function(){
var _69=[];
var _6a="";
this.start=function(_6b,_6c,_6d,_6e){
_69[_6c]={"fxnCleanup":_6d,"fInfo":(_6e!=null)};
if(!_6b){
_6b=window;
}
if(_6b[_6c]&&_6b[_6c].call){
if(!_6b[_6c+"_original"]){
_6b[_6c+"_original"]=_6b[_6c];
}
_6b[_6c]=function(){
var _6f=_6a;
_6a=_6c;
try{
_6b[_6c+"_original"].apply(_6b,arguments);
}
finally{
_6a=_6f;
Process.stop(_6c);
}
};
}
if(_6e){
Info.show(_6e);
}
};
this.cancelInfoHide=function(){
if(!_69[_6a]){
return;
}
_69[_6a].fInfo=false;
};
this.stop=function(_70){
if(!_69[_70]){
return;
}
if(_69[_70].fInfo){
Info.hide();
_69[_70].fInfo=false;
}
_69[_70]=null;
};
this.haltAll=function(){
for(var _71 in _69){
if(!_69[_71]){
continue;
}
if(_69[_71].fxnCleanup&&_69[_71].fxnCleanup.call){
_69[_71].fxnCleanup.call();
}
if(_69[_71].fInfo){
Info.hide();
_69[_71].fInfo=false;
}
if(!(window.ie||window.opera||window.webkit)){
_69[_71]=null;
}
}
};
};


var ClockCalBinding=new function(){
this.rgPairs=[];
this.add=function(_1,_2){
if(!_1||!_2){
return;
}
this.rgPairs.push({"idCal":_1,"idClock":_2});
};
this.init=function(){
for(var ix=0;ix<this.rgPairs.length;ix++){
this.associate(ix);
}
};
this.associate=function(_4){
if(!this.rgPairs||!this.rgPairs[_4]){
return;
}
var _5=elById(this.rgPairs[_4].idCal);
var _6=elById(this.rgPairs[_4].idClock);
if(!_5||!_6){
return;
}
_5.onchange=this.getOnChange(_5,_6,true);
_6.onchange=this.getOnChange(_5,_6,false);
};
this.getOnChange=function(_7,_8,_9){
var _a=_9?_8:_7;
var _b=_9?_7:_8;
var _c=_9?GetLocaleTime():GetLocaleDate();
return function(){
if(_a.value.length==0&&_b.value.length==0){
return;
}
if(_a.value.length==0||_a.value==_c){
_a.value=_9?CTZGetWorkdayStart():CTZGetToday();
}
};
};
};
function Clock(){
this.txtID="";
this.localeTime=GetLocaleTime();
this.f12HourTime=false;
var _d=this.localeTime.toLowerCase();
this.f12HourTime=(_d.indexOf("a")!=-1)||(_d.indexOf("p")!=-1);
this.dt=new UTCDate();
}
Clock.prototype.show=function(id){
if(!(elById("tblTime"))){
var el=document.createElement("DIV");
el.innerHTML=pictureOf(CalendarTimeTable);
document.body.appendChild(el);
theMgr.add("tblTime");
}
this.txtID=id;
elById("timeTableSelect").size=20;
var _10=elById("timeTableSelect");
_10.size=20;
var _11=UTCFromCTZ(this.guessTime(elById(id).value));
if(_11.getMinutes()<30){
_11.setMinutes(0);
}
if(_11.getMinutes()>30){
_11.setMinutes(30);
}
var _12=this.getPrintableTime(CTZFromUTC(_11));
for(var i=0;i<_10.options.length;i++){
if(_10.options[i].value==_12){
_10.selectedIndex=i;
}
}
theMgr.showPopup("tblTime",elById(id),-2,elById(id).offsetHeight-2,false);
};
Clock.prototype.focus=function(_14){
if(_14){
safeFocus(elById(this.txtID));
}else{
safeFocus(elById("timeTableSelect"));
}
};
Clock.prototype.setTime=function(_15){
this.dt=new UTCDate(_15);
};
Clock.prototype.getPrintableTime=function(_16){
var _17=CTZFromUTC(_16?_16:this.dt);
var _18=this.localeTime;
var _19=_17.getHours();
var _1a=_17.getMinutes()+"";
var _1b="";
var _1c="";
var _1d=(_18.toLowerCase().lastIndexOf("a")!=-1)?_18.toLowerCase().lastIndexOf("a"):_18.toLowerCase().lastIndexOf("p");
if(_1d>0){
_1c=_18.substr(_1d);
_1c=trim(_1c);
}
if(_1c.length>0){
if(_17.getHours()==0){
_19="12";
}
if(_17.getHours()>12){
_19=_17.getHours()-12;
}
_1b=_1c;
if(_17.getHours()>11){
_1b=_1c.replace(/a/,"p");
_1b=_1b.replace(/A/,"P");
}
}
_18=_18.replace(new RegExp(FB_HOUR_CODE),(_19.length==1&&!this.f12HourTime?"0":"")+_19);
_18=_18.replace(new RegExp(FB_MINUTE_CODE),_1a.length==1?"0"+_1a:_1a);
_18=_18.replace(_1c,_1b);
return _18;
};
Clock.prototype.hide=function(){
var o=elById(this.txtID);
if(o){
o.value=this.getPrintableTime();
if(o.onchange&&o.onchange.call){
o.onchange.call();
}
}
theMgr.hidePopup("tblTime");
};
Clock.prototype.guessAMPM=function(_1f,_20){
if(typeof (_20)=="undefined"){
_20=this.f12HourTime;
}
if(_20&&_1f>0&&_1f<8){
return _1f+12;
}else{
return _1f;
}
};
Clock.prototype.guessTime=function(_21){
return UTCFromCTZ(this.CTZguessTime(_21));
};
Clock.prototype.CTZguessTime=function(_22){
var dt=CTZNow();
dt.setSeconds(0);
dt.setMinutes(0);
var re=/^\s*([012]?\d)[:\.]?([012345]\d)[:\.]?([012345]?\d?)\s*$/;
var _25=re.exec(_22);
if(_25){
if(typeof (_25[1])!="undefined"){
dt.setHours(this.guessAMPM(parseInt(_25[1],10)));
}
if(typeof (_25[2])!="undefined"){
dt.setMinutes(_25[2]);
}
if(typeof (_25[3])!="undefined"){
if(!isNaN(parseInt(_25[3],10))){
dt.setSeconds(parseInt(_25[3],10));
}
}
return dt;
}
re=/^\s*([012]?\d)[:\.]?(\d\d)?[:\.]?(\d\d)?\s?([ap])\.?m?\.?\s*$/i;
_25=re.exec(_22);
if(_25){
if(_25[4].toLowerCase()=="p"&&parseInt(_25[1],10)<12){
var hrs=_25[1];
if(hrs.length>1&&hrs.substr(0,1)=="0"){
hrs=hrs.substr(1);
}
dt.setHours(parseInt(hrs,10)+12);
}else{
if(_25[4].toLowerCase()=="a"&&parseInt(_25[1],10)==12){
dt.setHours(0);
}else{
dt.setHours(_25[1]);
}
}
if(!isNaN(parseInt(_25[2],10))){
dt.setMinutes(_25[2]);
}
return dt;
}
_22=trim(_22.toLowerCase());
if(_22=="noon"){
dt.setHours(12);
return dt;
}
if(_22=="midnight"){
dt.setHours(0);
return dt;
}
if(_22=="now"){
return CTZNow();
}
re=/^\s*(\d+)\s*$/;
_25=re.exec(_22);
if(_25!=null&&typeof (_25[1])!="undefined"){
dt.setHours(this.guessAMPM(parseInt(_25[1],10)));
return dt;
}
dt=CTZNow();
if(_22.indexOf("minute")!=-1||_22.indexOf("hour")!=-1){
re=/(\d+)/;
_25=re.exec(_22);
if(_25!=null&&typeof (_25[1])!="undefined"){
n=parseInt(_25[1],10);
}else{
for(var i=0;i<this.rgNumbers.length;i++){
if(_22.indexOf(this.rgNumbers[i])!=-1){
n=i;
}
}
}
if(_22.indexOf("minute")!=-1){
dt.setMinutes(dt.getMinutes()+n);
}else{
dt.setHours(dt.getHours()+n);
}
return dt;
}
dt.setHours(12);
dt.setMinutes(0);
dt.setSeconds(0);
return dt;
};
function Calendar(){
this.rgMonths=FB_MONTHS;
this.rgDays=GetWeekdays();
this.rgNumbers=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","twentyone","twentytwo","twentythree","twentyfour","twentyfive","twentysix","twentyseven","twentyeight","twentynine","thirty"];
this.iFirstDayOfWeek=parseInt(FB_FIRST_DAY_OF_WEEK,10);
this.dt=new UTCDate();
this.dtShowing=new UTCDate(this.dt);
this.layout=[[1,2,3,4,5,6,7],[8,9,10,11,12,13,14],[15,16,17,18,19,20,21],[22,23,24,25,26,27,28],[29,30,31,1,2,3,4],[5,6,7,8,9,10,11]];
this.bPastOK=false;
this.bFutureOK=true;
this.txtID="";
this.txtTimeID="";
this.localeDate=GetLocaleDate();
}
Calendar.prototype.drawMe=function(){
if(!(elById("tblCalendar"))){
var el=document.createElement("DIV");
el.innerHTML=pictureOf(CalendarTable);
document.body.appendChild(el);
theMgr.add("tblCalendar");
}
var i;
for(i=0;i<this.rgDays.length;i++){
elById("weekday"+i.toString()).innerHTML=this.rgDays[(i+this.iFirstDayOfWeek)%(this.rgDays.length)].toString().substr(0,1);
}
var _2a=CTZFromUTC(this.dtShowing);
_2a.setDate(1);
_2a.setHours(12,0,1);
var _2b=0;
if(_2a.getDay()>this.iFirstDayOfWeek){
_2b=_2a.getDay()-this.iFirstDayOfWeek;
}else{
if(_2a.getDay()<this.iFirstDayOfWeek){
_2b=_2a.getDay()+(6-this.iFirstDayOfWeek)+1;
}else{
_2b=7;
}
}
_2a.setDate(_2a.getDate()-_2b);
var _2c=UTCFromCTZNoon();
for(i=0;i<6;i++){
for(var j=0;j<=6;j++){
this.layout[i][j]=UTCFromCTZ(_2a);
var el=elById(i.toString()+","+j.toString());
el.innerHTML=CTZFromUTC(this.layout[i][j]).getDate();
if(_2a.getMonth()==CTZFromUTC(this.dtShowing).getMonth()){
if(this.dateInRange(UTCFromCTZ(_2a))){
el.style.color="#000000";
}else{
el.style.color="#777777";
}
}else{
el.style.color="#777777";
}
if(this.sameDate(UTCFromCTZ(_2a),_2c)){
el.style.border="1px solid black";
}else{
el.style.border="";
}
if(this.sameDate(UTCFromCTZ(_2a),this.dt)){
el.style.backgroundColor="#cccccc";
}else{
el.style.backgroundColor="#ffffff";
}
_2a.setDate(_2a.getDate()+1);
}
}
elById("MonthTitle").innerHTML=this.rgMonths[CTZFromUTC(this.dtShowing).getMonth()]+"&nbsp;"+(CTZFromUTC(this.dtShowing).getFullYear());
return true;
};
Calendar.prototype.focus=function(){
safeFocus(elById("0,0"));
};
Calendar.prototype.dateInRange=function(dt){
var _2f=CTZNoon();
var _30=CTZFromUTC(dt);
return this.sameDate(_30,_2f)||(this.bPastOK&&_30<_2f)||(this.bFutureOK&&_30>_2f);
};
Calendar.prototype.sameDate=function(dt1,dt2){
return dt1.getYear()==dt2.getYear()&&dt1.getMonth()==dt2.getMonth()&&dt1.getDate()==dt2.getDate();
};
Calendar.prototype.fwdMonth=function(){
if(this.dtShowing.getDate()>28){
this.dtShowing.setDate(1);
}
this.dtShowing.setMonth(this.dtShowing.getMonth()+1);
this.drawMe();
};
Calendar.prototype.backMonth=function(){
if(this.dtShowing.getDate()>28){
this.dtShowing.setDate(1);
}
this.dtShowing.setMonth(this.dtShowing.getMonth()-1);
this.drawMe();
};
Calendar.prototype.setDay=function(id){
elById(id).blur();
var rg=id.split(",",2);
var dt=this.layout[rg[0]][rg[1]];
if(!this.dateInRange(dt)){
return;
}
this.dt=dt;
this.dtShowing=CTZFromUTC(this.dt);
this.drawMe();
this.hide();
};
Calendar.prototype.show=function(id,_37,_38){
this.txtID=id;
this.txtTimeID=_37;
this.dtToday=new UTCDate();
this.drawMe();
if(_38!=null){
id=_38;
}
var _39=elById("idCalendarTextBar");
if(_39){
_39.style.display=(this.fTextBar?"":"none");
}
theMgr.showPopup("tblCalendar",elById(id),-2,elById(id).offsetHeight-2,false);
};
Calendar.prototype.showTips=function(){
if(trim(elById("calTips").innerHTML)==""){
elById("calTips").innerHTML=GetCalendarTip();
}else{
elById("calTips").innerHTML="";
}
};
Calendar.prototype.hide=function(){
var o=elById(this.txtID);
if(o){
o.value=CTZsDateRawFromUTC(this.dt);
if(o.onchange&&o.onchange.call){
o.onchange.call();
}
}
o=elById("calTips");
if(o){
o.innerHTML="";
}
theMgr.hidePopup("tblCalendar");
};
Calendar.prototype.setDate=function(_3b){
this.dt=new UTCDate(_3b);
this.dtShowing=new UTCDate(this.dt);
};
Calendar.prototype.guessDate=function(_3c){
return UTCFromCTZ(this.CTZguessDate(_3c));
};
Calendar.prototype.CTZguessDate=function(_3d){
var dt=new BrowserDate(_3d);
dt.setHours(12);
var _3f=CTZNoon();
var re,_41,_42;
if(_3d.match(/^\d?\d$/)){
var _43=parseInt(_3d,10);
var _44=_3f.getMonth();
_42=_3f.getFullYear();
if(_43<_3f.getDate()){
_44++;
if(_44>=12){
_44-=12;
_42++;
}
}
dt=new BrowserDate(_42,_44,_43,12,0,0);
if(!isNaN(dt)){
return dt;
}
}
if(_3d.match(/^\d\d\d\d[\:\-\.\/]\d?\d[\:\-\.\/]\d?\d$/)){
re=/^(\d\d\d\d)[\:\-\.\/](\d?\d)[\:\-\.\/](\d?\d)$/;
_41=re.exec(_3d);
dt=new BrowserDate(parseInt(_41[1],10),parseInt(_41[2],10)-1,parseInt(_41[3],10),12,0,0);
if(!this.bPastOK&&dt<_3f&&!(dt.getYear()==_3f.getYear()&&dt.getMonth()==_3f.getMonth()&&dt.getDate()==_3f.getDate())){
dt=new BrowserDate(_3f);
dt.setHours(12);
alert(FB_CALENDAR_FUTURE_DATE);
}
if(!isNaN(dt)){
return dt;
}
}
if(_3d.match(/^\d?\d[\:\-\.\/]\d?\d[\:\-\.\/]?\d?\d?\d?\d?$/)){
re=/^\s*(\d?\d)[\:\-\.\/](\d?\d)[\:\-\.\/]?((\d\d)?\d\d)?\s*$/;
_41=re.exec(_3d);
if(_41){
_42=_3f.getFullYear();
if(typeof (_41[3])!="undefined"){
if(_41[3].length==2){
_42="20"+_41[3];
}else{
if(_41[3].length==4){
_42=_41[3];
}
}
}
if(this.localeDate.indexOf(FB_MONTH_CODE)==0){
dt=new BrowserDate(_42,parseInt(_41[1],10)-1,parseInt(_41[2],10),12,0,0);
}else{
dt=new BrowserDate(_42,parseInt(_41[2],10)-1,parseInt(_41[1],10),12,0,0);
}
if(!this.bPastOK&&dt<_3f&&!(dt.getYear()==_3f.getYear()&&dt.getMonth()==_3f.getMonth()&&dt.getDate()==_3f.getDate())){
dt=new BrowserDate(_3f);
dt.setHours(12);
alert(FB_CALENDAR_FUTURE_DATE);
}
if(!isNaN(dt)){
return dt;
}
}
}
var _45=CTZNoon();
_3d=trim(_3d.toLowerCase());
if(_3d==FB_TODAY){
return CTZNoon();
}
if(_3d==FB_TOMORROW){
_45.setDate(_45.getDate()+1);
return _45;
}
if(_3d==FB_DAY_AFTER_TOMORROW||_3d==FB_THE_DAY_AFTER_TOMORROW){
_45.setDate(_45.getDate()+2);
return _45;
}
if(_3d==FB_YESTERDAY){
_45.setDate(_45.getDate()-1);
return _45;
}
var i,n;
for(i=0;i<this.rgDays.length;i++){
if(_3d.indexOf(this.rgDays[i].toLowerCase().substr(0,3))!=-1&&_3d.indexOf(FB_MONTH_STEM)==-1){
var _48=_45.getDay();
if(i>_48){
_45.setDate(_45.getDate()+(i-_48));
}else{
if(i<_48){
_45.setDate(_45.getDate()+(i+1+(6-_48)));
}else{
if(_3d.indexOf(FB_NEXT_STEM)!=-1){
_45.setDate(_45.getDate()+7);
}
}
}
return _45;
}
}
for(i=0;i<this.rgMonths.length;i++){
re=/(\d+)/;
n=0;
_41=re.exec(_3d);
if(_41&&typeof (_41[1])!="undefined"){
n=parseInt(_41[1],10);
}
if(_3d.indexOf(this.rgMonths[i].toLowerCase().substr(0,3))!=-1){
if(n!=0){
_45.setMonth(i);
_45.setDate(n);
if(_45<_3f){
_45.setFullYear(_45.getFullYear()+1);
}
}else{
var _49=_45.getMonth();
if(i>_49){
_45.setMonth(_45.getMonth()+(i-_49));
}else{
if(i<_49){
_45.setMonth(_45.getMonth()+(i+1+(11-_49)));
}else{
_45.setMonth(_45.getMonth()+12);
}
}
_45.setDate(1);
}
return _45;
}
}
if(_3d.indexOf(FB_DAY_STEM)!=-1||_3d.indexOf(FB_WEEK_STEM)!=-1||_3d.indexOf(FB_MONTH_STEM)!=-1||_3d.indexOf(FB_YEAR_STEM)!=-1){
re=/(\d+)/;
n=0;
_41=re.exec(_3d);
if(_41==null){
n=1;
}else{
if(typeof (_41[1])!="undefined"){
n=parseInt(_41[1],10);
}
}
if(_3d.indexOf(FB_DAY_STEM)!=-1){
_45.setDate(_45.getDate()+n);
}else{
if(_3d.indexOf(FB_WEEK_STEM)!=-1){
_45.setDate(_45.getDate()+(7*n));
}else{
if(_3d.indexOf(FB_MONTH_STEM)!=-1){
_45.setMonth(_45.getMonth()+n);
}else{
if(_3d.indexOf(FB_YEAR_STEM)!=-1){
_45.setFullYear(_45.getFullYear()+n);
}
}
}
}
return _45;
}
_45=new BrowserDate(_3d);
_45.setHours(12);
if(isNaN(_45.getDate())||_45.getYear()==1||_45.getYear()==69){
return CTZNoon();
}
return _45;
};


this.IdPop=new function(){
var _1;
var _2;
var _3;
var _4;
var _5;
var _6=[];
var _7=[];
var _8=null;
var _9;
var _a;
var _b;
var _c;
var _d;
var _e;
var _f;
var _10;
var _11=18;
var _12=4;
var _13=false;
this.init=function(){
if(!_13){
theMgr.addWithHandler("caseIdPopup",function(){
ShadowManager.hideShadow("idPop");
return true;
});
if(!_1){
_1=elById("caseIdPopup");
}
if(!_2){
_2=elById("caseIdContent");
}
if(_1){
_1.style.zIndex=4;
}
_13=true;
}
};
this.hide=function(){
_9=null;
setTimeout(this.doHide,200);
};
this.hideNow=function(){
_9=null;
this.doHide();
};
this.doHide=function(){
if(_9!=null){
return;
}
IdPop.init();
if(_8&&_8.isBusy()){
_8.abort();
}
_c=false;
ShadowManager.hideShadow("idPop");
FadeManager.startFadeOut("idPop",_1,null);
if(window.ie){
theMgr.showSelects();
}
};
this.stopHide=function(){
if(_c){
_9=_a;
}
};
this.show=function(){
if(_c){
return;
}
this.init();
_b=false;
ShadowManager.hideShadow("idPop");
positionElement(_1,(xMouse+_12),(yMouse+_12));
FadeManager.startFadeIn("idPop",_1,IdPop.setPosition,true,IdPop.setShadow);
_c=true;
if(window.ie){
theMgr.hideSelects();
}
};
this.setShadow=function(){
ShadowManager.applyShadow("idPop",_f,_10,_1);
};
this.setPosition=function(){
if(_b||_1.style.display=="none"){
return;
}
IdPop.setSize();
var _14=getInWindowCoordinates(_1,_4,_5,_3,_11,_12);
positionElement(_1,_14.x,_14.y);
_f=_14.x;
_10=_14.y;
_b=true;
};
this.setSize=function(){
sizeElement(_1,null,_2.offsetHeight);
};
this.startTimer=function(_15,_16,_17){
var _18=_17?_17:500;
this.init();
_3=_16;
_4=calculateOffset(_3,"offsetLeft");
_5=calculateOffset(_3,"offsetTop");
_9=_15;
_c=false;
if(_7[_15]){
return;
}
if(!_6[_15]){
setTimeout("IdPop.sendIdPopRequest("+_15+")",150);
}
setTimeout("IdPop.fill("+_15+")",_18);
};
this.fill=function(_19){
if(_19!=_9){
return;
}
if(_7[_19]){
return;
}
if(!_6[_19]){
setTimeout("IdPop.fill("+_19+")",200);
return;
}
_2.innerHTML=_6[_19];
_a=_19;
this.show();
};
this.sendIdPopRequest=function(_1a){
if(_1a!=_9){
return;
}
if(!_8){
_8=new AjaxRequest();
}
if(_8&&_8.isBusy()){
_8.abort();
}
_8.initialize();
_8.bDefaultFailureBehavior=false;
_8.onreadystatechange(this.resultIdPopRequest);
_8.open("GET",sDefaultURI+"?fAlaCarte=1&pg=pgAlaCarteBugDetails&ixBug="+_1a,true);
_8.send(null);
};
this.resultIdPopRequest=function(){
if(typeof XMLParser=="undefined"){
return;
}
if(!_8||!_8.isReady()){
return;
}
var _1b=XMLParser.getTextFrom(_8.responseXML(),"ixBug");
if(_1b!=_9){
return;
}
var _1c=XMLParser.getCDataFrom(_8.responseXML(),"sHTML");
if(!_1c||!_1c.length){
_7[_1b]=true;
return;
}
_6[_1b]=_1c;
};
};


var xMouse=0;
var yMouse=0;
var bCancelEvents=false;
var sDefaultURI;
var bUserTyped=false;
var bSelectBoxChanged=0;
function domContentLoad(){
if(typeof (g_fPageHasLoaded)=="undefined"||!g_fPageHasLoaded){
return;
}
window.fDomLoaded=true;
sDefaultURI=FB_DEFAULT_URL;
if(typeof (dhtmlHistory)!="undefined"){
dhtmlHistory.initialize();
dhtmlHistory.addListener(handleHistoryChange);
}
ClockCalBinding.init();
hideMiniReports();
restoreSubscriptionState();
if(window.ie||(window.webkit&&window.versionMajorWebKit>=5)){
window.document.onkeydown=handleDocumentKeydown;
}else{
window.document.onkeypress=handleDocumentKeydown;
}
window.document.onkeyup=handleDocumentKeyup;
window.document.onmouseup=mouseupDocument;
window.document.onmousemove=mousemoveDocument;
window.onunload=bodyUnload;
window.document.onselectstart=function(){
return !bCancelEvents;
};
window.onresize=resizeWindow;
setFocusToWindow();
if(window.TabManager){
TabManager.setWindowTitle();
}
setTimeout(function(){
initializeListView();
if(window.TabManager){
TabManager.addBugEditToolTips();
}
updateStarsOnLoad();
loadPopupContent();
ShadowManager.preload();
firebugWarning();
},1);
}
function bodyLoad(){
if(typeof (window.oProxy)!="undefined"){
oProxy.ping();
}
shrinkImagesToFit();
}
function bodyUnload(){
if(window.ie6){
cleanupIE6MemoryLeaks();
}
if(oAjaxRequest){
oAjaxRequest.abort();
}
if(window.SelectionManager){
SelectionManager.reset();
}
if(typeof (oWysiwyg)!="undefined"&&oWysiwyg&&typeof (oWysiwyg.oSpellChecker)!="undefined"&&oWysiwyg.oSpellChecker&&typeof (oWysiwyg.oSpellChecker.oDict)!="undefined"){
oWysiwyg.oSpellChecker.oDict.cancel();
}
}
function cleanupIE6MemoryLeaks(){
unloadAjax();
DropListControl.unload();
}
function loadPopupContent(){
if(!window.IsLoggedIn||!IsLoggedIn()){
return;
}
if(typeof (g_ixBugSelectedInit)!="undefined"&&!g_ixBugSelected){
g_ixBugSelected=g_ixBugSelectedInit;
}
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("loadPopupContent",100);
}else{
var _1=sDefaultURI+"?fAlaCarte=1&pg=pgAlaCartePopupContent"+(g_ixBugSelected?"&ixBug="+g_ixBugSelected:"");
if(elById("pgFavorites")){
_1+="&fPgFavorites=1";
}
if(window.ListControl){
_1+="&fList=1";
}
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultPopupContent);
oAjaxRequest.open("GET",_1,true);
oAjaxRequest.send(null);
}
}
function firebugWarning(){
if(window.console&&window.console.firebug&&IsLoggedIn()){
var _2=(getCookie("fb_fb_warn")=="1");
if(!_2){
Info.show(InsertPropURL(InsertPropURL(FB_FIREBUG_SLOW,"http://www.fogcreek.com/FogBugz/KB/howto/DisableFirebug.html","target=\"_blank\""),"javascript: void 0;","onclick=\"Info.hide();return false;\""));
var dt=new UTCDate();
dt.setDate(dt.getDate()+3);
setCookie("fb_fb_warn",1,dt);
}
}
}
function resultPopupContent(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
var _4=oAjaxRequest.responseXML();
if(!_4){
return;
}
setFavoritesContent(_4);
setPopupContent("workingOnPopup",XMLParser.getCDataFrom(_4,"sHTML_workingOnPopup"));
if(typeof (ListControl)!="undefined"){
ListControl.setFilterRefinePopupContent(XMLParser.getCDataFrom(_4,"sHTML_filterRefinePopup"),_4);
}
}
function setPageTitle(){
var _5=elById("idFilterNameHidden");
var _6=elById("idPageTitleHidden");
if(!_5||!_6){
return;
}
var _7=_6.value;
var _8=_5.value;
if(_7){
if(window.ListControl){
ListControl.titlePrototype(_7);
ListControl.filterName(_8);
}
if(_8){
document.title=swap1(_7,_8);
}
}
}
function getInnerHTML(_9){
var o=elById(_9);
if(!o){
return null;
}
return o.innerHTML;
}
function resizeWindow(e){
if(window.oWysiwyg&&oWysiwyg.oMainChild){
oWysiwyg.setWysSize();
}
if(window.ie6){
if(!resizeWindow.elTB){
resizeWindow.elTB=elById("tbFull");
}
if(!resizeWindow.elTB){
return;
}
resizeWindow.elTB.style.width=Math.max(windowWidth(),800)+"px";
}
}
function mouseupDocument(e){
if(window.SelectionManager){
SelectionManager.stopDragging();
}
if(window.GridControl){
GridControl.stopActions();
}
EditableTableManager.stopDragging();
FavoritesList.stopDrag();
Sliders.stopDrag();
}
function mousemoveDocument(e){
if(window.Event){
xMouse=e.pageX;
yMouse=e.pageY;
notifyMouseMovement();
return;
}
xMouse=event.clientX;
yMouse=event.clientY;
if(document.documentElement.scrollLeft){
xMouse+=document.documentElement.scrollLeft;
}else{
if(document.body.scrollLeft){
xMouse+=document.body.scrollLeft;
}
}
if(document.documentElement.scrollTop){
yMouse+=document.documentElement.scrollTop;
}else{
if(document.body.scrollTop){
yMouse+=document.body.scrollTop;
}
}
notifyMouseMovement();
}
function notifyMouseMovement(){
if(window.GridControl){
GridControl.notifyMovement();
}
if(window.SelectionManager){
SelectionManager.notifyMovement();
}
EditableTableManager.notifyMovement();
FavoritesList.notifyMovement();
Sliders.notifyMovement();
}
function hideMiniReports(){
if(!window.g_fMiniReports){
return;
}
var _e=XMLParser.getArrayMatchingId(document,"a","^link_");
if(_e.length<2){
return;
}
for(var i=0;i<_e.length;i++){
toggleReport(_e[i]);
}
}
function toggleReport(el){
if(!el){
return;
}
var id=el.id.substring(5);
var _12=(getCookie("fb_"+id)!="0");
var _13=el.getElementsByTagName("img")[0];
if(_12){
show(elById(id));
_13.setAttribute("alt","-");
_13.src="minus.gif";
}else{
hide(elById(id));
_13.setAttribute("alt","+");
_13.src="plus.gif";
}
}
function handleFormKeyup(_14){
if(!isTagName(_14,"form")){
return false;
}
if(_14.getAttribute("disableCtrlEnter")){
return false;
}
var rg=XMLParser.getNodeArrayUsingAttributeFrom(_14,"input","type","submit");
for(var ix=0;ix<rg.length;ix++){
if(isDisplayed(rg[ix])&&rg[ix].click){
rg[ix].click();
return true;
}
}
_14.submit();
return true;
}
function handleDocumentKeydown(e,_18){
if(!e&&_18){
e=_18.event;
}
if(!e){
e=window.event;
}
if(!e){
return;
}
var _19=getKeyCode(e);
if(window.SelectionManager){
SelectionManager.checkboxDown(_19);
}
KeyManager.keystroke(e,_18);
if(_19==27){
Process.haltAll();
if(window.GridControl){
GridControl.cancelActions();
}
}
if(e.ctrlKey&&_19==13){
var _1a=getEventTarget(e);
if(_1a&&_1a.form){
_1a=_1a.form;
}
if(handleFormKeyup(_1a,e)){
return false;
}
}
return true;
}
function isTab(_1b){
var _1c=getKeyCode(_1b);
return (_1c==9||(window.webkit&&_1c==25));
}
function handleDocumentKeyup(e){
if(!e){
e=window.event;
}
if(!e){
return;
}
var _1e=getKeyCode(e);
if(window.SelectionManager){
SelectionManager.checkboxUp(null,e);
}
return true;
}
function handleHistoryChange(_1f,_20){
if(window.ViewHistoryManager){
ViewHistoryManager.addViewHistory(true);
ViewHistoryManager.handleHistoryChange(_1f,_20);
}
if(window.GraphHistory){
GraphHistory.handleHistoryChange(_1f,_20);
}
}
function getOverflowAbove(o){
var _22=o.parentNode;
while(_22){
if(_22.scrollWidth>_22.offsetWidth){
return _22;
}else{
_22=_22.parentNode;
}
}
return null;
}
function shrinkImagesToFit(_23){
if(window.GridControl){
return;
}
var _24=document.getElementsByTagName("img");
var i;
var _26=_23?300:720;
var _27=_23?300:1000;
for(i=0;i<_24.length;i++){
if(_23||(_24[i].getAttribute("inline")!=null&&_24[i].getAttribute("noshrink")==null)){
var img=_24[i];
var _29=getOverflowAbove(img);
img.xwidth=img.offsetWidth;
img.xheight=img.offsetHeight;
var _2a=false;
if(_29&&!isTagName(_29,"html")){
var _2b=calculateOffset(_29,"offsetLeft")+_29.offsetWidth;
var _2c=calculateOffset(img,"offsetLeft")+img.offsetWidth;
var _2d=(!window.ie6?10:25);
if(_2c+_2d>_2b){
_2a=true;
img.style.width=(img.offsetWidth-(_2c-_2b)-_2d)+"px";
}
}
if(!_2a&&img.offsetWidth>_26){
_2a=true;
img.style.width=_26+"px";
}
if(img.offsetHeight>_27){
if(_2a){
img.style.width=(img.xwidth/(img.xheight/_27))+"px";
}
img.style.height=_27+"px";
}
}
}
}
function showSearchingInfo(e,_2f){
if(e&&e.metaKey){
return;
}
if(_2f&&_2f.form&&_2f.form.searchFor){
if(_2f.form.searchFor.value.length>0){
Info.show(FB_SEARCHING);
}
}
}
function showError(_30){
var el=elById("helpbox");
if(el){
el.innerHTML="<font color='red'>"+_30+"</font>";
if(el.style.display=="none"){
toggleVisible(el);
}
}
}
function showHelp(id){
var el=elById(id+"_help");
var _34=elById("helpbox");
if(_34!=null&&el!=null){
_34.innerHTML=el.innerHTML;
_34.style.display="";
}else{
if(_34!=null){
_34.style.display="none";
}
}
}
function hideHelp(id){
var el=elById("helpbox");
if(el){
el.style.display="none";
}
}
function restoreSubscriptionState(){
var _37=elById("idSubscriptionState");
if(_37){
updateSubscriptionState(parseInt(_37.value,10));
}
}
function updateSubscriptionState(_38){
var _39=elById("containerSubscribe");
if(_39){
var _3a=XMLParser.getNodeUsingIdFrom(_39,"span","subscribe");
var _3b=XMLParser.getNodeUsingIdFrom(_39,"span","unsubscribe");
if(_3a&&_3b){
_3a.style.display=(_38?"none":"");
_3b.style.display=(_38?"":"none");
}
var _3c=XMLParser.getNodeUsingIdFrom(_39,"input","idSubscriptionState");
if(_3c){
_3c.value=_38?1:0;
}
}
}
function quickSubscription(_3d,_3e){
updateSubscriptionState(_3e);
sendNewSubscriptionRequest(_3d.href.replace("?","?fAlaCarte=1&"));
}
function sendNewSubscriptionRequest(_3f){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("sendNewSubscriptionRequest(\""+_3f+"\")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.open("GET",_3f,true);
oAjaxRequest.send(null);
}
}
function quickDiscussModerate(_40,_41,_42){
var _43=elById("containerDiscussAdmin"+_41);
if(_43){
var _44=XMLParser.getNodeArrayFrom(_43,"span");
for(var ix=0;ix<_44.length;ix++){
if(_44[ix].id){
if(_44[ix].id==(_42?"adminDeleting":"adminApproving")){
_44[ix].style.display="";
}else{
_44[ix].style.display="none";
}
}
}
}
sendNewDiscussModerateRequest(_40.href.replace("?","?fAlaCarte=1&"));
}
function sendNewDiscussModerateRequest(_46){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("sendNewDiscussModerateRequest(\""+_46+"\")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeDiscussModeration);
oAjaxRequest.open("GET",_46,true);
oAjaxRequest.send(null);
}
}
function resultChangeDiscussModeration(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
var _47=XMLParser.getTextFrom(oAjaxRequest.responseXML(),"ixDiscussTopic");
if(_47==null){
return;
}
var _48=elById("containerDiscussTopic"+_47);
var _49=XMLParser.getCDataFrom(oAjaxRequest.responseXML(),"sHTML");
if(!_48||!_49||!_49.length){
return;
}
_48.innerHTML=_49;
}
var oElemQueued;
function quickEditFixFor(_4a,_4b,_4c){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
oElemQueued=_4c;
setTimeout("quickEditFixFor(\""+_4a+"\","+_4b+",null)",500);
}else{
if(!_4c){
_4c=oElemQueued;
}
if(!_4c){
return;
}
var _4d=_4c.form["preFixFor"+_4a].value;
var _4e=_4c.form["fAnyProjectToEdit"+_4a].value;
var _4f=_4c.form["ixFixForToEdit"+_4a].value;
var _50=encodeURIComponent(_4c.form["sFixForToEdit"+_4a].value);
var _51=_4c.form["sDateToEdit"+_4a].value;
var _52=_4c.form["fDeletedToEdit"+_4a][0];
var _53=_4c.form["fDeletedToEdit"+_4a][1];
var _54=_52.checked?_52.value:_53.value;
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(function(){
resultChangeFixFor("FixForTable"+_4a);
});
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pre="+_4d+"&ixProject="+_4b+"&ixFixFor="+_4f+"&sFixFor="+_50+"&sDate="+_51+"&fDeleted="+_54+"&fAnyProject="+_4e);
}
}
function quickEditArea(_55,_56){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
oElemQueued=_56;
setTimeout("quickEditArea("+_55+",null)",500);
}else{
if(!_56){
_56=oElemQueued;
}
if(!_56){
return;
}
var _57=_56.form.preToEdit?_56.form.preToEdit.value:"";
var _58=_56.form.ixToEdit?_56.form.ixToEdit.value:"";
var _59=_56.form.sToEdit?encodeURIComponent(_56.form.sToEdit.value):"";
var _5a=_56.form.ixPersonOwnerToEdit?_56.form.ixPersonOwnerToEdit.value:-1;
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeArea);
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pre="+_57+"&ixProject="+_55+"&sArea="+_59+"&ixArea="+_58+"&ixPersonOwner="+_5a);
}
}
function quickEditSnippets(_5b){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
oElemQueued=_5b;
setTimeout("quickEditSnippets(null)",500);
}else{
if(!_5b){
_5b=oElemQueued;
}
if(!_5b){
return;
}
var _5c=_5b.form.preToEdit?_5b.form.preToEdit.value:"";
var _5d=_5b.form.ixToEdit?_5b.form.ixToEdit.value:"";
var _5e=_5b.form.ixPersonToEdit?_5b.form.ixPersonToEdit.value:"";
var _5f=_5b.form.fGlobalToEdit?_5b.form.fGlobalToEdit.value:"";
var _60=_5b.form.sNameToEdit?encodeURIComponent(_5b.form.sNameToEdit.value):"";
var _61=_5b.form.sToEdit?encodeURIComponent(jsToVbNewLines(_5b.form.sToEdit.value)):"";
var _62=_5b.form.sCommentToEdit?encodeURIComponent(_5b.form.sCommentToEdit.value):"";
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeSnippet);
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pre="+_5c+"&ixSnippet="+_5d+"&sName="+_60+"&ixPerson="+_5e+"&fGlobal="+_5f+"&s="+_61+"&sComment="+_62);
}
}
function quickDeleteSnippet(_63){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("quickDeleteSnippet("+_63+")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeSnippet);
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pre=preDeleteSnippet&ixSnippet="+_63,true);
oAjaxRequest.send(null);
}
}
function quickDeleteAttachment(_64){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("quickDeleteAttachment("+_65+")",500);
}else{
var _65=_64.form.ixToDelete?_64.form.ixToDelete.value:"";
var _66=_64.form.ixOwner.value;
var _67=_64.form.sOwner.value;
var _68="?fAlaCarte=1&pre=preDeleteFile&pg=pgAlaCarteAttachmentList&ixAttachment="+_65;
var _69=null;
if(_67=="Bug"){
_69=_64.form.ixBugEventToEdit.value;
_68+="&ixBugEvent="+_69+"&ixBug="+_66+"&command=edit";
}else{
_68+="&sOwner="+encodeURIComponent(_67)+"&ixOwner="+_66;
}
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(function(){
resultChangeAttachment(_69);
});
oAjaxRequest.open("GET",sDefaultURI+_68,true);
oAjaxRequest.send(null);
}
}
function quickEditHoliday(_6a){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
oElemQueued=_6a;
setTimeout("quickEditHoliday(null)",500);
}else{
if(!_6a){
_6a=oElemQueued;
}
if(!_6a){
return;
}
var _6b=_6a.form.preHolidayToEdit?_6a.form.preHolidayToEdit.value:"";
var _6c=_6a.form.ixHolidayToEdit?_6a.form.ixHolidayToEdit.value:"";
var _6d=_6a.form.ixPersonToEdit?_6a.form.ixPersonToEdit.value:"";
var _6e=_6a.form.sHolidayToEdit?encodeURIComponent(_6a.form.sHolidayToEdit.value):"";
var _6f=_6a.form.dtHolidayToEdit?_6a.form.dtHolidayToEdit.value:"";
var _70=_6a.form.dtHolidayEndToEdit?_6a.form.dtHolidayEndToEdit.value:"";
var _71=_6a.form.chkAllDay.checked?"on":"off";
var _72=_6a.form.chkAllDay.checked?"12:00 AM":_6a.form.dtTimeToEdit.value;
var _73=_6a.form.chkAllDay.checked?"11:59 PM":_6a.form.dtEndTimeToEdit.value;
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeHoliday);
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pre="+_6b+"&pg=pgAlaCarteHolidayList&ixHoliday="+_6c+"&sHoliday="+_6e+"&dtHoliday="+_6f+"&dtHolidayTime="+_72+"&dtHolidayEnd="+_70+"&dtHolidayEndTime="+_73+"&ixPerson="+_6d+"&chkAllDay="+_71);
}
}
function setAllDayCB(_74){
document.getElementById("idChkAllDay").checked=_74;
showHideTimeFields(!_74);
}
function clickAllDayCheckbox(){
showHideTimeFields(!document.getElementById("idChkAllDay").checked);
return true;
}
function showHideTimeFields(_75){
document.getElementById("timeField1").style.display=document.getElementById("timeField2").style.display=_75?"inline":"none";
}
function quickEditReleaseNotes(_76){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout(function(){
quickEditReleaseNotes(_76);
},500);
}else{
if(!_76){
return;
}
var _77=_76.form.preToEdit?_76.form.preToEdit.value:"";
var sPg=_76.form.pgToEdit?_76.form.pgToEdit.value:"";
var _79=_76.form.ixToEdit?_76.form.ixToEdit.value:"";
var _7a=_76.form.sReleaseNotesToEdit?encodeURIComponent(jsToVbNewLines(_76.form.sReleaseNotesToEdit.value)):"";
var _7b=_76.form.sContainerId?_76.form.sContainerId.value:"";
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(function(){
resultChangeReleaseNotes(_7a,_7b);
});
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pg="+sPg+"&pre="+_77+"&ixBug="+_79+"&sReleaseNotes="+_7a);
}
}
function quickDeleteHoliday(_7c,_7d){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("quickDeleteHoliday("+_7c+")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeHoliday);
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pre=preDeleteHoliday&pg=pgAlaCarteHolidayList&ixHoliday="+_7c+"&ixPerson="+_7d,true);
oAjaxRequest.send(null);
}
}
function quickDeleteArea(_7e,_7f){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("quickDeleteArea("+_7e+","+_7f+")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeArea);
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pre=preDeleteArea&ixProject="+_7e+"&ixArea="+_7f,true);
oAjaxRequest.send(null);
}
}
function quickDeleteFilter(_80){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("quickDeleteFilter("+_80+")",500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeFilter);
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pre=preDeleteFilter&ixFilter="+_80,true);
oAjaxRequest.send(null);
}
}
function changeFilterName(_81){
g_sFilterName=_81;
if(!window.ListControl){
return;
}
elById("idFilterNameHidden").value=_81;
setPageTitle();
}
function quickFilterSaveAs(_82){
if((!window.ListControl)||(!ListControl.getListDiv())||(!_82.form.sFilterName)){
return false;
}
var _83=trim(_82.form.sFilterName.value);
if(!_83.length){
return true;
}
Info.showBriefly(swap1(FB_CURRENT_FILTER_SAVED_AS,encodeLTGT(_83)));
sendFilterSaveAsRequest(_82);
changeFilterName(_83);
Icons.changeIcons(Icons.CONFIRMED,null,null,Icons.ENABLED);
theMgr.hideAllPopups();
return true;
}
var oFilterSaveRequest;
function sendFilterSaveAsRequest(_84){
if(!oFilterSaveRequest){
oFilterSaveRequest=new AjaxRequest();
}
if(oFilterSaveRequest.isBusy()){
setTimeout(function(){
sendFilterSaveAsRequest(_84);
},500);
}else{
var _85=_84.form.searchFor?_84.form.searchFor.value:"";
oFilterSaveRequest.initialize();
oFilterSaveRequest.onreadystatechange(resultFilterSaveAs);
oFilterSaveRequest.open("GET","?pg=pgAlaCarteFilterMenu&pre="+_84.form.pre.value+"&sFilterName="+encodeURIComponent(_84.form.sFilterName.value)+"&searchFor="+encodeURIComponent(_85),true);
oFilterSaveRequest.send(null);
}
}
function resultFilterSaveAs(){
if(!oFilterSaveRequest||!oFilterSaveRequest.isReady()){
return;
}
var _86=ListControl.getFilterMenuContainer();
if(!_86){
return;
}
var _87=XMLParser.getCDataFrom(oFilterSaveRequest.responseXML(),"sHTML");
if(_87&&_87.length){
_86.innerHTML=_87;
}
preFilterPopup.fDone=false;
preFilterPopup();
var _88=XMLParser.getTextFrom(oFilterSaveRequest.responseXML(),"ixPerson");
var _89=XMLParser.getTextFrom(oFilterSaveRequest.responseXML(),"ixFilter");
var _8a=XMLParser.getTextFrom(oFilterSaveRequest.responseXML(),"sFilter");
if(_88!=null&&_89!=null){
setFilterRssHref(_88,_89,_8a);
}
}
function resultChangeAttachment(_8b){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
var _8c=oAjaxRequest.responseXML();
var sId="containerAttachmentList";
if(null!=_8b){
sId+="_"+_8b;
var _8e=XMLParser.getCDataFrom(_8c,"BugEventsHTML");
if(_8e){
doReplaceBugEvents(_8e);
}
var _8f=XMLParser.getTextFrom(_8c,"ixBugEventLatestPre");
var _90=XMLParser.getTextFrom(_8c,"ixBugEventLatestPost");
if(updateBugEventLatest(_8f,_90)){
updateActionButtons(_8c);
}
if(window.goBug){
goBug.rgCachedViews={};
}
}
EditableTableManager.result("DeleteAttachment",oAjaxRequest.responseXML(),sId);
shrinkImagesToFit();
}
function resultChangeArea(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
EditableTableManager.result("AreaTable",oAjaxRequest.responseXML());
}
function resultChangeFilter(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
EditableTableManager.result("FilterTable",oAjaxRequest.responseXML());
}
function resultChangeSnippet(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
var _91=XMLParser.getCDataFrom(oAjaxRequest.responseXML(),"sSnippetJS");
if(_91){
rgSnippet=eval(_91);
populateSnippetSelect();
refreshSnippetHelper();
}
EditableTableManager.result("SnippetTable",oAjaxRequest.responseXML());
}
function resultChangeHoliday(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
EditableTableManager.result("HolidayTable",oAjaxRequest.responseXML());
}
function resultChangeReleaseNotes(_92,_93){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
var _94=oAjaxRequest.responseXML();
if(_93){
EditableTableManager.result("ReleaseNotes",XMLParser.getNodeFrom(_94,"NoteLink"),_93+"Link");
EditableTableManager.result("ReleaseNotes",XMLParser.getNodeFrom(_94,"Note"),_93);
}else{
var _95=XMLParser.getCDataFrom(_94,"BugEventsHTML");
if(_95){
doReplaceBugEvents(_95);
}
var _96=XMLParser.getTextFrom(_94,"ixBugEventLatestPre");
var _97=XMLParser.getTextFrom(_94,"ixBugEventLatestPost");
if(updateBugEventLatest(_96,_97)){
updateActionButtons(_94);
}
if(window.goBug){
goBug.sReleaseNotes=_92;
goBug.rgCachedViews={};
}
EditableTableManager.result("ReleaseNotes",oAjaxRequest.responseXML());
}
}
function resultChangeFixFor(_98){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
EditableTableManager.result(_98,oAjaxRequest.responseXML());
}
function showDeleteAttachment(_99,_9a,_9b,_9c,_9d,_9e){
if(!showDeleteAttachment.oPop){
showDeleteAttachment.oPop=FancyPopupManager.create("DeleteAttachment");
}
showDeleteAttachment.oPop.oDiv.innerHTML=pictureOf(EditableAttachmentPane,_9a,_9b,_9c,_9d,_9e);
showDeleteAttachment.oPop.show(_99.id,POPUP_POSITION_CENTER);
}
function quickSortChange(el,_a0){
if(!window.GridControl){
return;
}
if(!GridControl.isReady()){
return false;
}
Info.show(FB_SORTING);
if(GridControl.isOverflowing()){
return false;
}
setTimeout(function(){
GridControl.sortBy(el,sendNewSortChangeRequest,_a0);
},1);
return true;
}
function sendNewSortChangeRequest(_a1,_a2){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout(function(){
sendNewSortChangeRequest(_a1,_a2);
},500);
}else{
var _a3=Join(_a2,",");
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultChangeSort);
oAjaxRequest.bDefaultFailureBehavior=false;
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pre=preSaveFilterChangeSort&sortID="+_a1+"&sSortedBugs="+_a3,true);
oAjaxRequest.send(null);
}
}
function resultChangeSort(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
Icons.changeIcons(Icons.ENABLED,null,null,Icons.DISABLED);
GridControl.synchServerSort(oAjaxRequest.responseXML());
}
function mousedownColHeader(_a4){
GridControl.startDragOrResize(_a4);
}
function mousemoveColHeader(_a5){
_a5.style.cursor=GridControl.getHeaderCursor(_a5);
}
function dblclickColHeader(_a6){
GridControl.autoResize(_a6);
}
function mousedownGridRow(_a7,e){
if(bCancelEvents||(getButtonCode(e)!=MOUSE_BUTTON_LEFT)){
return;
}
var _a9=GridControl.rowFromBug(_a7);
if(_a9<0){
return;
}
SelectionManager.gridClick(_a9,e.shiftKey,isCtrlOrMeta(e));
SelectionManager.startDragging();
}
function mouseupGridRow(){
removeTextSelections();
}
function dblclickGridRow(_aa,_ab){
if(bCancelEvents||SelectionManager.lastClickFromCheckbox()||SelectionManager.blockClick()){
return;
}
var _ac=GridControl.rowFromBug(_aa);
if(_ac<0){
return;
}
if(!SelectionManager.isChecked(_ac)){
SelectionManager.gridClick(_ac,false,false);
}
document.location=_ab;
}
function mouseoverGridRow(_ad,e){
if(bCancelEvents||internalRowEvent(e)){
return;
}
var _af=GridControl.rowFromBug(_ad);
if(_af<0){
return;
}
if(SelectionManager.isDragging()){
SelectionManager.gridClick(_af,false,false);
removeTextSelections();
}
var _b0=document.bulkForm["ixBulkBug"][_af];
if(null!=_b0&&null!=KeyManager&&null!=KeyManager.oGridBrowser){
if(_b0!=KeyManager.oGridBrowser.elCurrent&&null!=KeyManager.oGridBrowser.elCurrent){
KeyManager.oGridBrowser.fxLeave(KeyManager.oGridBrowser.elCurrent);
}
KeyManager.oGridBrowser.setElCurrent(_b0);
}
}
function mouseoutGridRow(_b1,e){
if(bCancelEvents||internalRowEvent(e)){
return;
}
var _b3=GridControl.rowFromBug(_b1);
if(_b3<0){
return;
}
var _b4=SelectionManager.highlightRow(_b3);
if(KeyManager.oGridBrowser){
KeyManager.oGridBrowser.setElCurrent(null);
}
}
function mouseoverCaseId(_b5,_b6,_b7){
_b7=_b7||500;
IdPop.startTimer(_b5,_b6,_b7);
if(!_b6.fAttached){
ourAttachEvent(_b6,"mouseout",mouseoutCaseId);
_b6.fAttached=true;
}
}
function mouseoutCaseId(){
IdPop.hide();
}
function keypressGridCheckbox(e,_b9,_ba){
if(32==getKeyCode(e)){
SelectionManager.gridClick(GridControl.rowFromBug(_b9),e.shiftKey,true);
return cancel(e);
}else{
if(13==getKeyCode(e)){
if(dblclickGridRow){
dblclickGridRow(_b9,_ba);
}
return cancel(e);
}else{
if("*"==String.fromCharCode(KeyboardMap.fix(getKeyCode(e),false)).toLowerCase()){
if(FavoritesIcons){
FavoritesIcons.toggle("Bug",_b9);
}
return cancel(e);
}
}
}
return true;
}
function keypressDiscussList(e,el){
if("*"==String.fromCharCode(KeyboardMap.fix(getKeyCode(e),false)).toLowerCase()){
new ListBrowser(el.parentNode,function(el){
return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&("starEmpty"==el.className||"starFull"==el.className);
},null,null,null,function(el){
KeyManager.simulateClick(el);
},null);
return cancel(e);
}
}
function internalRowEvent(e){
var _c0;
var _c1;
if(document.all){
if(window.event&&window.event.fromElement&&window.event.toElement){
_c0=getidParentRow(window.event.fromElement);
_c1=getidParentRow(window.event.toElement);
}
}else{
if(e&&e.target&&e.relatedTarget){
_c0=getidParentRow(e.target);
_c1=getidParentRow(e.relatedTarget);
}
}
return (_c0&&_c1&&(_c0==_c1));
}
function getidParentRow(_c2){
try{
_c2.parentNode;
}
catch(e){
return "";
}
if(isTagName(_c2,"tr")&&_c2.id&&_c2.id!="row_spam"){
return _c2.id;
}
if(_c2.parentNode){
_c2=_c2.parentNode;
}else{
return null;
}
return getidParentRow(_c2);
}
function initializeListView(){
if(!elById("pgListContainer")||!window.ListControl){
return;
}
window.onscroll=ListControl.scrollWindow;
ListControl.storeOriginalScrollState();
if(ListControl.fixCacheState()){
return;
}
ListControl.init();
Icons.init();
setPageTitle();
theHoverTipMgr.reset();
if(SelectionManager.isIxBugConflict()){
SelectionManager.doUnselectAll();
}
if(window.GridControl){
NewCaseRows.init();
GridControl.init();
}
setTimeout(updateBulkActions,1);
}
function setFocusToWindow(){
if(bUserTyped){
return;
}
if(!bUserTyped&&typeof (oFocusStart)!="undefined"&&oFocusStart){
safeFocus(oFocusStart);
return;
}
if(window.TabManager&&TabManager.focusCorrectFormElement()){
return;
}
if(elById("bugerror")!=null){
return;
}
var _c3=elById("mainArea");
if(!_c3){
return;
}
var _c4=_c3.getElementsByTagName("table");
var _c5=false;
var el;
for(var ix=0;ix<_c4.length;ix++){
if(_c4[ix].className=="biglist"){
_c5=true;
var _c8=_c4[ix].getElementsByTagName("input");
for(var _c9=0;_c9<_c8.length;_c9++){
var _ca=_c8[_c9];
if(_ca.type.toLowerCase()!="hidden"&&_ca.type.toLowerCase()!="checkbox"&&_ca.style.display!="none"){
el=_c8[_c9];
break;
}
}
if(el){
break;
}
}
}
if(el&&el.style.display!="none"){
safeFocus(el);
}
}
function showAssignSpan(el,e){
if(!el){
return;
}
if(!el.id){
if(isTagName(el.nextSibling,"a")&&el.href==el.nextSibling.href){
el=el.nextSibling;
}
}
var _cd=window.ListControl;
if(!_cd&&window.opera){
return true;
}
var o=elById("spanTo_"+el.id);
if(!o.getElementsByTagName("select").length){
var _cf;
if(_cd){
_cf="var elF = document.bulkForm; elF.command.value='assign'; elF.ixPersonAssignedToOverride.value=this.value; setBugValues(false); elF.submit(); return false;";
}else{
if(window.safari||window.opera){
_cf="window.location = '"+elById("assign0").href+"&ixPersonAssignedToOverride=' + this.value;";
if(window.webkit){
o.parentNode.parentNode.style.height="1.8em";
}
}else{
_cf="clickAssignDropdown(this.value);";
}
if(window.mozilla||window.ie||window.chrome){
o.style.verticalAlign=window.chrome?"middle":"top";
if(window.mozilla){
o.style.position="relative";
o.style.top="3px";
}
}
}
if(!_cd){
o.style.paddingLeft="4px";
}
o.innerHTML=pictureOf(DlgUnlinkedListOfNames,"ixPersonAssignedToOverrideDropDown_"+el.id,-1,FB_CHOOSE_A_PERSON,false,false,true,false,"actionButton",180,_cf);
}
DropListControl.refreshWithin(o);
toggleVisible(o);
var el=XMLParser.getNodeFrom(o,"select");
if(el){
safeFocus(el);
}
return cancel(e);
}
function hideAssignSpan(){
hide(elById("spanTo"));
}
function showMoveSpan(){
var o=elById("moveTo");
if(!o.getElementsByTagName("select").length){
o.innerHTML=pictureOf(DlgUnlinkedListOfAreas,GetFilterProject(),"ixAreaMovedToDropDown",-1,FB_CHOOSE_AN_AREA,"actionButton",180,"var elF = document.bulkForm; elF.command.value='move'; elF.ixAreaMovedTo.value=this.value; elF.pre.value='preMove'; setBugValues(false); elF.submit(); return false;");
}
DropListControl.refreshWithin(o);
o.style.display=(o.style.display=="none")?"":"none";
var _d1=XMLParser.getNodeFrom(o,"select");
if(_d1){
safeFocus(_d1);
}
return false;
}
function hideMoveSpan(){
hide(elById("moveTo"));
}
function clickDoesNothing(){
return false;
}
function clickSubmitsForm(){
document.body.style.cursor="wait";
if(this.id=="spam"){
document.bulkForm.pre.value="preSpam";
}else{
if(this.id=="markviewed"){
document.bulkForm.pre.value="preMarkViewed";
}
}
document.bulkForm.command.value=this.getAttribute("command");
setBugValues(false);
document.bulkForm.submit();
return false;
}
function setBugValues(_d2,_d3){
var s=getBugValues(_d2);
if(_d3){
_d3.value=s;
}else{
document.bulkForm.ixBug.value=s;
}
}
function getBugValues(_d5){
var s="";
var i=0;
if(!document.bulkForm){
return s;
}
var bf=document.bulkForm["ixBulkBug"];
if(bf){
if(bf.length){
for(i=0;i<bf.length;i++){
if(bf[i].checked||_d5){
s+=bf[i].value+",";
}
}
}else{
s+=bf.value+",";
}
}
if(s.length>0){
s=s.slice(0,-1);
}
return s;
}
function setIxBugHref(o){
if(!window.ListControl){
return;
}
if(!o||!o.href||!o.href.replace){
return;
}
var _da=o.getAttribute("hrefEnabled");
if(_da&&_da!=o.href){
o.href=_da;
}
o.href=o.href.replace(/ixBug=[,0-9]*[&|$]/i,"ixBug="+getBugValues(false)+"&");
}
function updateBulkActions(){
var i=0;
var _dc=68719476735;
var _dd=false;
if(!document.bulkForm){
return;
}
var bf=document.bulkForm["ixBulkBug"];
if(bf){
if(!bf.length){
if(bf.checked==true){
_dc=(_dc&bf.getAttribute("bulk"));
_dd=true;
}
}else{
for(i=0;i<bf.length;i++){
if(bf[i].checked==true){
_dc=(_dc&bf[i].getAttribute("bulk"));
_dd=true;
}
}
}
}
if(!_dd){
_dc=0;
hideAssignSpan();
hideMoveSpan();
}
if(!updateBulkActions.hashEls){
updateBulkActions.hashEls={};
var elP=elById("idActionP");
if(!elP){
return;
}
var rgA=elP.getElementsByTagName("a");
for(var ix=0;ix<rgA.length;ix++){
var elA=rgA[ix];
if(elA.id){
updateBulkActions.hashEls[elA.id]=elA;
}
}
}
activate(_dc&1,updateBulkActions.hashEls["edit"]);
activate(_dc&2,updateBulkActions.hashEls["assign"]);
activate(_dc&4,updateBulkActions.hashEls["resolve"]);
activate(_dc&8,updateBulkActions.hashEls["reactivate"]);
activate(_dc&16,updateBulkActions.hashEls["close"]);
activate(_dc&32,updateBulkActions.hashEls["reopen"]);
activate(_dc&64,updateBulkActions.hashEls["spam"]);
activate(_dc&128,updateBulkActions.hashEls["move"]);
activate(_dc&256,updateBulkActions.hashEls["remind"]);
activate(_dc&256,updateBulkActions.hashEls["markviewed"]);
}
function activate(_e3,el){
if(!el){
return;
}
if(_e3){
if(el.id=="assign"){
el.onclick=function(e){
showAssignSpan(el,e);
};
}else{
if(el.id=="move"){
el.onclick=showMoveSpan;
}else{
el.onclick=clickSubmitsForm;
}
}
el.className="actionButton";
}else{
el.onclick=clickDoesNothing;
el.className="actionButtonDisabled";
}
}
function enableBulk(){
if(window.opera){
return;
}
var i;
if(document.bulkForm){
var bf=document.bulkForm["ixBulkBug"];
if(bf){
if(bf.length){
for(i=0;i<bf.length;i++){
bf[i].disabled=false;
}
}else{
bf.disabled=false;
}
}
}
}
function Book(){
this.idVisible=null;
this.ids=[];
this.hashTies={};
this.addPage=function(id){
this.ids.push(id);
};
this.addTie=function(_e9,_ea){
if(!this.hashTies[_ea]){
this.hashTies[_ea]=[];
}
var rg=_e9.split(",");
for(var ix=0;ix<rg.length;ix++){
this.hashTies[_ea].push(rg[ix]);
}
this.showTies();
};
this.showTies=function(){
for(var sID in this.hashTies){
var rg=this.hashTies[sID];
var el=elById(sID);
var _f0=this.idVisible;
if(el){
el.style.display=(rg.match(function(_){
return _==_f0;
})?"":"none");
}
}
};
}
function showTab(_f2,id){
var _f4=elById("rdo_"+id);
if(_f4&&_f4.disabled&&!_f4.checked){
return;
}
_f2.idVisible=id;
for(var i=0;i<_f2.ids.length;i++){
var _f6=elById("tab_"+_f2.ids[i]);
var _f7=elById("blk_"+_f2.ids[i]);
var _f8=elById("rdo_"+_f2.ids[i]);
if(_f2.ids[i]==id){
_f7.style.display="";
_f6.style.backgroundColor="#f3f6f9";
_f4.checked=true;
if(!_f4.disabled){
_f6.style.color="#000000";
}
DropListControl.refreshWithin(_f7);
}else{
_f7.style.display="none";
_f6.style.backgroundColor="";
_f8.checked=false;
if(!_f8.disabled){
_f6.style.color="#444444";
}
}
if(window.opera){
_f6.style.position="relative";
_f6.style.top="4px";
_f8.style.position="relative";
_f8.style.top="-4px";
}
}
_f2.showTies();
KeyManager.deactivateHotKeys();
}
function HoverTipMgr(_f9,_fa){
this.varName=_f9;
this.divId=_fa;
this.reset();
}
HoverTipMgr.prototype.reset=function(){
this.fadeIn=false;
this.instantFade=false;
this.contents="";
this.theTip=null;
this.delayFade=950;
this.keepInMode=3000;
this.xOffset=10;
this.yOffset=15;
this.num=0;
};
HoverTipMgr.prototype.initTip=function(){
if(this.theTip==null){
this.theTip=elById(this.divId);
}
};
HoverTipMgr.prototype.fadeInTip=function(_fb,_fc){
this.initTip();
if(this.theTip!=null){
++this.num;
if(this.num>10000){
this.num=0;
}
var _fd=elById(_fb);
if(!_fd){
return;
}
this.contents=_fd.innerHTML;
if(document.all){
this.theTip.style.left=(_fc.clientX+document.documentElement.scrollLeft+document.body.scrollLeft+this.xOffset)+"px";
this.theTip.style.top=(_fc.clientY+document.documentElement.scrollTop+document.body.scrollTop+this.yOffset)+"px";
}else{
this.theTip.style.left=(_fc.pageX+this.xOffset)+"px";
this.theTip.style.top=(_fc.pageY+this.yOffset)+"px";
}
this.fadeIn=true;
if(this.instantFade){
this.doFade(true,this.num);
}else{
setTimeout(this.varName+".doFade(true, "+this.num+")",this.delayFade);
}
}
};
HoverTipMgr.prototype.fadeOutTip=function(){
this.initTip();
if(this.theTip!=null){
this.fadeIn=false;
this.theTip.style.display="none";
this.theTip.innerHTML=this.contents="";
++this.num;
if(this.num>10000){
this.num=0;
}
setTimeout(this.varName+".doFade(false, "+this.num+")",this.keepInMode);
}
};
HoverTipMgr.prototype.doFade=function(_fe,_ff){
if(_fe==this.fadeIn&&_ff==this.num){
if(this.fadeIn){
this.theTip.innerHTML=this.contents;
this.theTip.style.display="";
this.instantFade=true;
}else{
this.instantFade=false;
}
}
};
function mouseoverTip(_100,_101,_102){
if(window.theHoverTipMgr){
theHoverTipMgr.fadeInTip(_100,_101);
if(!_102.fAttached){
ourAttachEvent(_102,"mouseout",mouseoutTip);
_102.fAttached=true;
}
}
}
function mouseoutTip(){
if(window.theHoverTipMgr){
theHoverTipMgr.fadeOutTip();
}
}
function PopupMgr(){
this.ids=[];
this.noHideIds=[];
this.rgVisiblePopups=[];
this.hashOnHideHandlers={};
this.hashVisible={};
this.add=function(id){
this.ids.push(id);
return true;
};
this.addWithHandler=function(id,fxn){
this.ids.push(id);
this.hashOnHideHandlers[id]=fxn;
};
this.addNoHide=function(id){
this.noHideIds.push(id);
return true;
};
this.exists=function(id){
var _108=function(_){
return (_==id);
};
return (this.noHideIds.grep(_108).length>0)||(this.ids.grep(_108).length>0);
};
}
PopupMgr.prototype.isNoHideId=function(id){
for(var i=0;i<theMgr.noHideIds.length;i++){
if(id==theMgr.noHideIds[i]){
return true;
}
}
return false;
};
PopupMgr.prototype.showShadowPopup=function(id,_10d,_10e,_10f,_110){
return this.showPopup(id,_10d,_10e,_10f,_110,true);
};
PopupMgr.prototype.showTopSmallMask=function(){
if(this.rgVisiblePopups.length>0){
this.showSmallMask(this.rgVisiblePopups[this.rgVisiblePopups.length-1]);
}
};
PopupMgr.prototype.fixLayout=function(_111){
if(window.ie){
forAll(_111,"hr",function(_){
_.style.display="none";
});
}
var _113=_111.offsetWidth;
if(null!=_111.scrollWidth){
var _114=getStyle(_111,"overflow");
var _115=getStyle(_111,"overflow-x");
var _116=getStyle(_111,"overflow-y");
_111.style.overflow="hidden";
if(window.ie6||window.webkit){
_111.style.width="1px";
}
_113=inBounds(_111.scrollWidth,150,1000);
_111.style.width=_113+"px";
_111.style.overflow=_114;
if(_115){
_111.style.overflowX=_115;
}
if(_116){
_111.style.overflowY=_116;
}
}
if(window.ie){
forAll(_111,"hr",function(_){
_.style.width=(_113-sToPx(getStyle(_,"margin-right"))-sToPx(getStyle(_,"margin-left")))+"px";
_.style.display="";
});
}
ShadowManager.fixShadow(_111.id);
};
PopupMgr.prototype.populateDelayedContent=function(_118){
if(_118&&typeof (_118.newContent)!="undefined"){
setInnerHTML(_118,_118.newContent);
_118.newContent=undefined;
}
};
PopupMgr.prototype.showPopup=function(id,_11a,_11b,_11c,_11d,_11e,_11f){
var _120=elById(id);
this.populateDelayedContent(_120);
KeyManager.registerElPopupKeys(_120);
if(_11d||_11d==null){
this.hideAllPopups(true);
}
this.showTopSmallMask();
this.rgVisiblePopups.push(id);
this.hashVisible[id]=true;
_120.fChildOfPane=EditableTableManager.isVisible();
if(window.ie6){
var _121=_120.getElementsByTagName("select");
for(var i=0;i<_121.length;++i){
_121[i].idOwner=id;
}
}
var _123=documentWidth();
if(_120&&((_120.style.display=="none")||_120.style.visibility=="hidden")){
this.hideSelects();
_120.style.visibility="hidden";
_120.style.display="";
if(!_11f){
this.fixLayout(_120);
}
var pt={x:_11b,y:_11c};
if(_11a!=null){
pt=getAbsolutePosition(_11a);
pt.y=pt.y+_11c;
if((pt.x+_11b+_120.offsetWidth)>windowRight()){
pt.x=(pt.x-_11b-_120.offsetWidth+_11a.offsetWidth);
}else{
pt.x=(pt.x+_11b);
}
}
_120.style.left=pt.x+"px";
_120.style.top=pt.y+"px";
_120.style.visibility="visible";
if(_11e){
ShadowManager.applySmallShadow(id,pt.x,pt.y,_120);
}
if(_11a!=null){
var y1=calculateOffset(_120,"offsetTop");
var y2=calculateOffset(_11a,"offsetTop");
var x1=calculateOffset(_120,"offsetLeft");
var x2=calculateOffset(_11a,"offsetLeft");
var _129=(y1-(y2+_11c));
var _12a=(x1-(x2+_11b));
if(_129>0){
_120.style.top=((y2+_11c)-_129)+"px";
}
if(_12a>0){
_120.style.left=((x2+_11b)-_12a)+"px";
}
}
this.maskClicks(_123);
}
return false;
};
PopupMgr.prototype.showSmallMask=function(id){
var _12c=elById(this.getMaskId(id));
var _12d=elById(id);
if(!_12c){
if(!_12d){
return;
}
if(window.ie){
_12c=DOM.img({"src":"spacer.gif","id":this.getMaskId(id),"style":this.getMaskStyle(),"alt":"","galleryimg":"no"});
}else{
_12c=DOM.div({"id":this.getMaskId(id),"style":this.getMaskStyle()},DOM.nbsp());
}
_12c.onmousedown=function(){
theMgr.hideAllHigherPopups(id);
};
_12d.appendChild(_12c);
}
if(!_12c){
return;
}
coverElement(_12c,_12d,0,0);
_12c.style.display="";
};
PopupMgr.prototype.hidePopup=function(id){
if(!this.hashVisible[id]){
return false;
}
var _12f=elById(id);
if(!_12f||_12f.style.display=="none"){
this.hashVisible[id]=false;
return false;
}
if(this.hashOnHideHandlers[id]&&this.hashOnHideHandlers[id].call){
if(!this.hashOnHideHandlers[id].call()){
return true;
}
}
if(_12f.fShadowed){
ShadowManager.hideShadow(id);
}
if(_12f.style.display==""){
_12f.style.display="none";
}
this.hashVisible[id]=false;
KeyManager.removePopupKeys(_12f);
var _130=[];
for(var ix=0;ix<this.rgVisiblePopups.length;ix++){
if(this.rgVisiblePopups[ix]==id){
_130=this.rgVisiblePopups.splice(ix,this.rgVisiblePopups.length-ix);
break;
}
}
this.unmaskClicks(id);
this.showSelects(this.getTopmostPopup());
_130.foreach(function(_){
if(_!=id){
if(theMgr.hidePopup(_)){
return true;
}
}
});
var _133=elById(this.getTopmostPopup());
if(_133&&!_133.childOfPane&&EditableTableManager.isVisible()){
EditableTableManager.unmaskPanes();
}
this.unmaskTopmostPopup();
return false;
};
PopupMgr.prototype.hideAllHigherPopups=function(id){
for(var ix=0;ix<this.rgVisiblePopups.length;ix++){
if(id==this.rgVisiblePopups[ix]&&this.rgVisiblePopups[ix+1]){
this.hidePopup(this.rgVisiblePopups[ix+1]);
if(this.rgVisiblePopups[ix].fChildOfPane||!EditableTableManager.isVisible()){
this.unmaskClicks(id);
}
break;
}
}
};
PopupMgr.prototype.hideAllPanePopups=function(){
for(var i=0;i<theMgr.rgVisiblePopups.length;i++){
var _137=elById(this.rgVisiblePopups[i]);
if(_137&&_137.fChildOfPane){
theMgr.hidePopup(theMgr.rgVisiblePopups[i]);
break;
}
}
EditableTableManager.unmaskPanes();
return false;
};
PopupMgr.prototype.hideAllPopups=function(_138){
var _139=true;
for(var i=theMgr.ids.length-1;i>=0;i--){
var sId=this.ids[i];
if(!this.hashVisible[sId]){
continue;
}
if(theMgr.hidePopup(sId)){
_139=false;
}
}
if(_139){
if((_138==null||!_138)&&!EditableTableManager.isVisible()){
this.showSelects();
this.unmaskClicks();
}
}else{
this.unmaskTopmostPopup();
}
return false;
};
PopupMgr.prototype.hideSelects=function(){
if(!window.ie6){
return;
}
var rgEl=document.getElementsByTagName("select");
var _13d=theMgr.getTopmostPopup();
var _13e=elById(_13d);
var _13f=EditableTableManager.isVisible()&&(_13e!=null)&&!_13e.fChildOfPane;
var _140={};
var pt;
for(var i=0;i<rgEl.length;i++){
var _143=(_13d!=undefined&&rgEl[i].idOwner==_13d);
if(isVisible(rgEl[i])&&!this.isNoHideId(rgEl[i].id)&&(!_143||_13f)){
if(_140[rgEl[i].idOwner]==null){
_140[rgEl[i].idOwner]=0;
}
var _144=_140[rgEl[i].idOwner]++;
var _145=elById(rgEl[i].idOwner);
var _146=elById("input_"+rgEl[i].idOwner+_144);
if(_146&&_146.style.display!="none"){
continue;
}
pt=getAbsolutePosition(rgEl[i]);
var el;
if(_146){
el=_146;
}else{
el=document.createElement("INPUT");
el.type="text";
el.id="input_"+rgEl[i].idOwner+_144;
el.style.position="absolute";
}
el.style.left=(calculateOffset(rgEl[i],"offsetLeft")-calculateOffset(_145,"offsetLeft"))+"px";
el.style.top=(calculateOffset(rgEl[i],"offsetTop")-calculateOffset(_145,"offsetTop"))+"px";
el.style.display="";
if(rgEl[i].selectedIndex>=0){
el.value=" "+trim(rgEl[i].options[rgEl[i].selectedIndex].innerHTML);
}else{
if(rgEl[i].options.length>0){
el.value=" "+trim(rgEl[i].options[0].innerHTML);
}
}
el.value=decodeLTGT(el.value);
el.className=rgEl[i].className+"_pseudo";
if(rgEl[i].style.width.length){
el.style.width=rgEl[i].style.width;
}
if(rgEl[i].style.fontSize.length){
el.style.fontSize=rgEl[i].style.fontSize;
}
if(rgEl[i].style.fontFamily.length){
el.style.fontFamily=rgEl[i].style.fontFamily;
}
if(el.style.width!=""){
el.style.width=(parseInt(el.style.width,10)-6)+"px";
}
if(rgEl[i].offsetHeight){
el.style.height=rgEl[i].offsetHeight-4+"px";
}
if(!_146){
rgEl[i].parentNode.insertBefore(el,rgEl[i]);
}
rgEl[i].style.visibility="hidden";
}
}
};
PopupMgr.prototype.showSelects=function(id){
if(!window.ie6){
return;
}
var _149=elById(id);
if(EditableTableManager.isVisible()&&_149&&!_149.fChildOfPane){
return;
}
var rgEl;
if(id){
rgEl=elById(id).getElementsByTagName("select");
}else{
rgEl=document.getElementsByTagName("select");
}
for(var i=0;i<rgEl.length;i++){
var el=elById("input_"+id+i);
if(el){
el.style.display="none";
}
rgEl[i].style.visibility="visible";
}
};
PopupMgr.prototype.maskClicks=function(_14d){
var _14e;
if(null==_14d){
_14e=documentWidth();
}else{
_14e=_14d;
}
var o=elById("menuDisappearingMask"+maskType());
if(o){
o.style.display="";
o.style.height=documentHeight()-horizontalScrollBarPadding()+"px";
o.style.overflow="hidden";
o.style.width=_14e+"px";
if(window.ie&&typeof (oWysiwyg)!="undefined"&&oWysiwyg.oWindow.event){
o.oncontextmenu=function(){
return false;
};
}else{
o.oncontextmenu=function(){
return true;
};
}
}
EditableTableManager.maskPanes();
};
PopupMgr.prototype.getTopmostPopup=function(){
if(this.rgVisiblePopups.length==0){
return null;
}
return this.rgVisiblePopups[this.rgVisiblePopups.length-1];
};
PopupMgr.prototype.getTopmostObject=function(){
var _150=this.getTopmostPopup();
var _151=null;
if(_150){
_151=elById(_150);
}
var _152=EditableTableManager.getVisiblePane();
if(!_151||(_152&&!_151.fChildOfPane)){
return _152;
}
return _151;
};
PopupMgr.prototype.unmaskTopmostPopup=function(){
var _153=this.getTopmostPopup();
if(_153){
this.unmaskClicks(_153);
}else{
this.unmaskClicks();
}
};
PopupMgr.prototype.unmaskClicks=function(id){
if(id){
var o=elById(this.getMaskId(id));
if(o){
o.style.display="none";
}
}else{
var o=elById("menuDisappearingMask"+maskType());
if(o){
o.style.display="none";
}
EditableTableManager.unmaskPanes();
for(var ix=0;ix<this.rgVisiblePopups.length;ix++){
o=elById(theMgr.getMaskId(this.rgVisiblePopups[ix]));
if(o){
o.style.display="none";
}
}
}
};
PopupMgr.prototype.getMaskId=function(id){
return "clickmask_"+id+maskType();
};
PopupMgr.prototype.getMaskStyle=function(){
return "display:none;position:absolute;height:0px;width:0px;z-index:1;";
};
function maskType(){
return (window.ie)?"Img":"Div";
}
function popHelpWin(e,url){
var _15a=window.open("help/"+url,"fbHelp","width=800, height=600, scrollbars=yes, toolbar=yes, location=yes, status=yes, menubar=yes, copyhistory=no, resizable=yes");
safeFocus(_15a);
return cancel(e);
}
function preFilterPopup(){
if(preFilterPopup.fDone){
return;
}
if(!window.ListControl){
return;
}
var el=elById("filterPopup");
if(!el){
return;
}
var _15c,_15d;
if(SearchString()){
_15d=elById("searchFor").value;
_15c=true;
}else{
_15d=(g_sFilterName!=FB_FILTER)?g_sFilterName:"";
_15c=false;
}
var _15e=pictureOf(NavBarFilterMenuSaveAs,_15c,_15d);
var _15f=DOM.span();
_15f.innerHTML=_15e;
var elF=XMLParser.getNodeFrom(el,"form");
elF.insertBefore(_15f,elF.firstChild);
preFilterPopup.fDone=true;
}
function doPopupClick(){
theMgr.hideAllPopups();
return true;
}
function popFilterPopup(_161,_162,e,_164){
if(popFilterPopup.fxnInit){
popFilterPopup.fxnInit();
}
if(!KeyManager.oMenuBrowser){
KeyManager.browseMenus("idFilterDescription");
KeyManager.oMenuBrowser.setElCurrent(_162);
}
var el=elById("idFilterOpt"+_161);
popFilterPopup.id=_162.id;
if(el!=null){
theMgr.showPopup("idFilterOpt"+_161,_162,0,_162.offsetHeight+2,null,true);
if(el.id!="idFilterOptRefine"){
DropListControl.refreshWithin(el);
ShadowManager.fixShadow(el.id);
}
}else{
theMgr.showPopup("idFilterOptLoading",_162,0,_162.offsetHeight+2,null,true);
return cancel(e);
}
if(null!=elById("idPopText"+_161)){
if(_161!="SaveFilterAs"){
populateTextBox("idPopText"+_161,_164);
}
setTimeout(function(){
giveTextBoxFocus("idPopText"+_161);
},1);
}else{
if(null!=elById("idPopix"+_161)){
setTimeout(function(){
safeFocus(elById("idPopix"+_161));
},1);
}else{
KeyManager.browsePopup("idFilterOptInner"+_161);
}
}
return cancel(e);
}
function setFilterRssHref(_166,_167,_168){
var o=elById("imgRssStatus");
if(!o||!o.parentNode||!o.parentNode.getAttribute("sURLPrototype")){
return;
}
var _16a=swap2(o.parentNode.getAttribute("sURLPrototype"),_166,_167);
o.parentNode.href=_16a;
o=elById("idRssFeed");
if(!o){
return;
}
var _16b=o.cloneNode(true);
_16b.title=_168;
_16b.href=_16a;
document.head.appendChild(_16b);
}
function toggleFilterRefine(_16c){
var _16d=toggleCollapsible("idRefineFilter"+_16c,function(){
theMgr.fixLayout(elById("idFilterOptRefine"));
});
if(_16d){
DropListControl.refreshWithin(elById("idRefineFilter"+_16c));
}
ShadowManager.fixShadow("idFilterOptRefine");
ShadowManager.fixShadow("idFilterOptPriority");
return _16d;
}
function toggleWorkingOnCollapsible(sId){
return toggleCollapsible(sId,function(){
ShadowManager.fixShadow("workingOnPopup");
});
}
function toggleCollapsible(sId,_170){
return toggleCollapsibleByElem(elById(sId),elById(sId+"Icon"),_170);
}
function toggleCollapsibleByElem(_171,_172,_173){
if(_171.style.display=="none"){
_171.style.display="block";
_172.src="minus.gif";
}else{
_171.style.display="none";
_172.src="plus.gif";
}
if(_173){
_173();
}
return "none"!=_171.style.display;
}
function handleListOfHoursKeydown(elem,e){
var key=getKeyCode(e);
if(isTab(e)){
setTimeout("theMgr.hideAllPopups()",1);
}else{
if(key==13||key==32){
if(elem.onclick){
elem.onclick.apply(elem,[]);
}
return cancel(e);
}
}
return true;
}
function handleFilterChangeKeydown(elem,e){
if(getKeyCode(e)==13){
theMgr.hideAllPopups();
elem.form.submit();
if(e){
e.returnValue=false;
}
return false;
}else{
if(getKeyCode(e)==27){
theMgr.hideAllPopups();
}
}
return true;
}
function handleFilterChangeClick(elem){
theMgr.hideAllPopups();
elem.form.submit();
}
function handleFilterSaveAsClick(elem){
if(!quickFilterSaveAs(elem)){
theMgr.hideAllPopups();
elem.form.submit();
}
return false;
}
function handleFilterSaveAsKeydown(elem,e,_17d){
_17d=(_17d&&window.webkit);
if(getKeyCode(e)==13||(_17d&&getKeyCode(e)==32)){
if(!quickFilterSaveAs(elem)){
theMgr.hideAllPopups();
elem.form.submit();
}
if(e){
e.returnValue=false;
}
repairFocus(elem);
return false;
}else{
if(getKeyCode(e)==27){
theMgr.hideAllPopups();
}
}
return true;
}
function showWorkingOnPopup(a){
resetWorkingOnMenu();
return refreshWorkingOnPopup(a);
}
function refreshWorkingOnPopup(a){
if(!a){
a=elById("Menu_Working_On");
}
return theMgr.showPopup("workingOnPopup",a,0,a.offsetHeight+2,null,true)||KeyManager.browseMenus("tb4")||KeyManager.oMenuBrowser.setElCurrent(a)||KeyManager.browsePopup("workingOnPopup");
}
function loadWorkingOnPopup(){
if(typeof (g_ixBugSelectedInit)!="undefined"&&!g_ixBugSelected){
g_ixBugSelected=g_ixBugSelectedInit;
}
if(!elById("workingOnPopup")){
return;
}
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout("loadWorkingOnPopup",100);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(resultWorkingOnPopup);
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&pg=pgAlaCarteWorkingOnMenu"+(g_ixBugSelected?"&ixBug="+g_ixBugSelected:""),true);
oAjaxRequest.send(null);
}
}
function resultWorkingOnPopup(){
var _180=oAjaxRequest.responseXML();
if(!_180){
return;
}
setInnerHTML("Working_On",XMLParser.getTextFrom(_180,"Working_On"));
setPopupContent("workingOnPopup",XMLParser.getCDataFrom(_180,"sHTML"));
}
function setFavoritesContent(_181){
setPopupContent("favoritesPopup",XMLParser.getCDataFrom(_181,"sHTML_favoritesPopup"));
FavoritesIcons.setAllFavorites(XMLParser.getCDataFrom(_181,"sAllFavorites"));
var elt=elById("pgFavorites");
if(elt){
setInnerHTML(elt,XMLParser.getCDataFrom(_181,"sHTML_pgFavorites"));
}
}
function updateStarsOnLoad(){
var _183=elById("span_stars");
var _184=elById("input_stars");
if(_183&&_184){
if(_183.innerHTML!=_184.value){
FavoritesIcons.setAllFavorites(_184.value);
}
}
}
function setPopupContent(_185,_186){
var elt=elById(_185);
if(!elt){
return;
}
if(isVisible(elt)){
setInnerHTML(elt,_186);
ShadowManager.fixShadow(_185);
}else{
if(elt){
elt.newContent=_186;
}
}
}
function handleWorkOnOtherSubmit(){
var sID="idWorkOnOtherInput";
var elt=elById(sID);
if(!elt||!elt.value){
return false;
}
var _18a=elt.value;
changeIxWorkingOn(_18a);
return false;
}
function handleWorkOnScheduleItemSubmit(){
var sID="idWorkOnScheduleItemInput";
var elt=elById(sID);
if(!elt||!elt.value){
return false;
}
var _18d=elt.value;
changeIxWorkingOn(_18d);
return false;
}
function preserveOnMouseover(elt){
var _18f=null;
if(elt){
_18f=XMLParser.getNodeFrom(elt,"a");
if(_18f&&_18f.onmouseover&&typeof (_18f.onmouseoverOld)=="undefined"){
_18f.onmouseoverOld=_18f.onmouseover;
}
}
}
function autoScrollDiv(el,_191){
if(el&&el.lastChild){
var _192=el.lastChild.offsetTop+el.lastChild.offsetHeight;
if(el.offsetParent==el.lastChild.offsetParent){
_192-=el.offsetTop;
}
if(_192<=_191){
el.style.height=_192+"px";
el.style.overflow="";
}else{
el.style.height=_191+"px";
el.style.overflow="scroll";
}
}
}
function changeIxWorkingOn(_193){
changeIxWorkingOnImpl(_193,function(){
theMgr.hideAllPopups();
});
}
function setIxWorkingOnNothing(){
changeIxWorkingOnImpl(0);
}
var g_changeIxWorkingOnCallback;
function changeIxWorkingOnImpl(_194,_195){
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout(function(){
changeIxWorkingOn(_194);
},500);
}else{
g_changeIxWorkingOnCallback=undefined;
if(_195){
g_changeIxWorkingOnCallback=_195;
}
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(changeIxWorkingOnCallback);
var _196="pre=preChangeWorkOnAlaCarte&ixBug="+_194;
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&"+_196,true);
oAjaxRequest.send(null);
}
}
function changeIxWorkingOnCallback(){
var _197=oAjaxRequest.responseXML();
if(!_197){
return;
}
setInnerHTML("Working_On",XMLParser.getTextFrom(_197,"Working_On"));
var id="idViewCaseLinkSpan";
var _199=XMLParser.getTextFrom(_197,id);
if(_199.length<=2){
_199="";
}
var _19a=setInnerHTML(id,_199,true);
if(_19a){
preserveOnMouseover(_19a);
}
var _19b=function(sErr){
var elt=setInnerHTML("idWorkOnError","<nobr>"+sErr+"&nbsp;&nbsp;</nobr>");
if(elt){
show(elt);
}
refreshWorkingOnPopup();
};
KeyManager.browsePopup("workingOnPopup");
switch(XMLParser.getTextFrom(_197,"nCanWorkOn")){
case "1":
if(g_changeIxWorkingOnCallback&&g_changeIxWorkingOnCallback.call){
g_changeIxWorkingOnCallback.call();
}
loadWorkingOnPopup();
break;
case "-1":
var _19e=XMLParser.getTextFrom(_197,"ixBugIn");
if(!_19e){
return;
}
_19b(swap1(FB_INVALID_CASE,_19e));
break;
case "-2":
_19b(FB_CLOSED);
break;
case "-3":
var _19e=XMLParser.getTextFrom(_197,"ixBugIn");
if(!_19e){
return;
}
_19b(swap1(FB_CASE_HAS_NO_ESTIMATE_SHORT,_19e));
EstimatePopup.show("workingOnPopup",_19e,changeIxWorkingOn,changeIxWorkingOn,null);
break;
case "-4":
_19b(FB_NO_PERMISSION);
break;
}
ShadowManager.fixShadow("workingOnPopup");
}
var g_ixBugSelected;
function setWorkOnLink(_19f){
if(_19f==g_ixBugSelected){
return;
}
if(0==_19f){
setInnerHTML("idThisCaseSpan","",true);
g_ixBugSelected=0;
return;
}
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout(function(){
setWorkOnLink(_19f);
},500);
}else{
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(setWorkOnLinkCallback);
var _1a0="pg=pgWorkOnThisLink&ixBug="+_19f+"&fSelected=1";
oAjaxRequest.open("GET",sDefaultURI+"?fAlaCarte=1&"+_1a0,true);
oAjaxRequest.send(null);
}
}
function setWorkOnLinkCallback(){
var _1a1=oAjaxRequest.responseXML();
if(!_1a1){
return;
}
var _1a2=XMLParser.getCDataFrom(_1a1,"sHTMLWorkOnThis");
if(!_1a2||_1a2&&_1a2.length==1){
_1a2="";
}
theMgr.populateDelayedContent(elById("workingOnPopup"));
var _1a3=setInnerHTML("idThisCaseSpan",_1a2,true);
if(_1a3){
preserveOnMouseover(_1a3);
ShadowManager.fixShadow("workingOnPopup");
KeyManager.browsePopup("workingOnPopup");
var _1a4=XMLParser.getTextFrom(_1a1,"ixBugSelected");
if(_1a4&&_1a4!=""){
g_ixBugSelected=Number(_1a4);
}
}
}
function resetWorkingOnMenu(){
hideWorkingOnError();
var el=elById("idWorkOnScheduleItemDiv");
if(el){
hide(el);
}
el=elById("idWorkOnOtherDiv");
if(el){
hide(el);
}
}
function hideWorkingOnError(){
var elt=elById("idWorkOnError");
if(elt){
hide(elt);
}
}
function doDlgConfirmation(ix){
enableInputsWithin("dlgConfirmation_"+ix,false);
Info.show(FB_SUBMITTING);
}
function resetFilterForm(_1a8){
if(!_1a8){
return;
}
var el=_1a8.form;
if(!el){
return;
}
el.fOpenBugs.checked=1;
el.fClosedBugs.checked=0;
if(el.ixGroupClient){
el.ixGroupClient.selectedIndex=0;
}
if(el.ixGroupDepartment){
el.ixGroupDepartment.selectedIndex=0;
}
groupClientChanged();
el.ixProject.selectedIndex=0;
projectChanged(0);
el.ixCategory.selectedIndex=0;
el.ixArea.selectedIndex=0;
el.ixPersonOpenedBy.selectedIndex=0;
el.ixPersonAssignedTo.selectedIndex=0;
el.ixPersonResolvedBy.selectedIndex=0;
el.ixPersonClosedBy.selectedIndex=0;
el.ixPersonLastEditedBy.selectedIndex=0;
el.ixStatus.selectedIndex=0;
el.ixFixFor.selectedIndex=0;
el.ixPriority.selectedIndex=0;
el.maxrecords.value="0";
el.openInLast.selectedIndex=0;
el.resolvedInLast.selectedIndex=0;
el.closedInLast.selectedIndex=0;
el.dueInNext.selectedIndex=0;
el.sort1.selectedIndex=0;
el.sort2.selectedIndex=0;
el.sort3.selectedIndex=0;
el.priorityRange.selectedIndex=1;
el.idMissingEstimate.checked=0;
el.idSubscribedBugs.checked=0;
el.idSeenByMe.checked=0;
el.sentBy.value="";
el.sVersion.value="";
el.sComputer.value="";
DropListControl.refreshWithin(el);
}
function addColumnDropdown(){
var i=0;
var o;
for(i=0;true;i++){
o=elById("gridCol_"+i);
if(!o){
disableElementById("addColumnButton");
return;
}
if(o.style.display=="none"){
break;
}
}
o.style.display="";
o=elById("gridCol_"+(i+1));
if(!o){
disableElementById("addColumnButton");
}
}
function statusChange(_1ac){
if(!document.formWithProject||!document.formWithProject.command){
return;
}
var _1ad=document.formWithProject.command.value;
var _1ae=elById("ixStatus");
var _1af=elById("spanDuplicatesEdit");
var _1b0=elById("sDuplicatesEdit");
if(!_1ae||!_1af||_1ad!="resolve"){
return;
}
if(_1ae.options[_1ae.selectedIndex].value==4){
_1af.style.display="";
if(_1ac){
setTimeout(function(){
_1b0.focus();
},1);
}
var el=elById("bugviewContainerSide");
if(el){
el.style.display="none";
setTimeout(function(){
el.style.display="";
},1);
}
}else{
var _1b2=elById("sEventEdit");
if(_1af.style.display!="none"){
_1b0.blur();
}
if(_1ac){
_1b2.focus();
setTimeout(function(){
_1b2.focus();
},1);
}
if(typeof (goDup)=="undefined"||goDup.ixBug==-1){
_1af.style.display="none";
}
}
return false;
}
function toggleReply(el){
var _1b4=nextSiblingOfType(el,"span");
if(!_1b4){
return;
}
if(_1b4.style.display=="none"){
_1b4.style.display="";
el.firstChild.innerHTML=FB_HIDE_QUOTED_TEXT;
}else{
_1b4.style.display="none";
el.firstChild.innerHTML=FB_SHOW_QUOTED_TEXT;
}
}
function toggleSnippetPlaceholderTip(){
var o=elById("snippetPlaceholdersTip");
if(o){
toggleVisible(o);
}
}
function flipCheckbox(oBox){
if(oBox){
oBox.checked=!oBox.checked;
}
}
function verifyPermissions(_1b7){
var _1b8=[elById("fReadCommunity"),elById("fReadPublic"),elById("fWriteCommunity"),elById("fWritePublic")];
var _1b9=[elById("nPermissionTypeNormal"),elById("nPermissionTypeGroup")];
var ix;
if(_1b9[0].checked){
elById("ixGroup").disabled=true;
for(ix=0;ix<_1b8.length;ix++){
if(!_1b8[ix]){
continue;
}
_1b8[ix].disabled=false;
}
if(_1b7){
if(_1b7.checked){
for(ix=0;ix<_1b8.length;ix++){
if(!_1b8[ix]){
continue;
}
if(_1b8[ix].id==_1b7.id){
break;
}
if(ix==1&&_1b8[2]&&_1b8[2].id==_1b7.id){
continue;
}
_1b8[ix].checked=true;
}
}else{
for(ix=(_1b8.length-1);ix>=0;ix--){
if(!_1b8[ix]){
continue;
}
if(_1b8[ix].id==_1b7.id){
break;
}
if(ix==2&&_1b8[1]&&_1b8[1].id==_1b7.id){
continue;
}
_1b8[ix].checked=false;
}
}
}
}else{
elById("ixGroup").disabled=false;
for(ix=0;ix<_1b8.length;ix++){
if(!_1b8[ix]){
continue;
}
_1b8[ix].checked=false;
_1b8[ix].disabled=true;
}
}
DropListControl.refreshWithin(elById("idTblPerms"));
}
function bumpCaseTotal(){
bumpInnerCount(elById("idCaseTotal"));
bumpInnerCount(elById("idCaseTotalNoEst"));
}
function bumpInnerCount(el){
adjustInnerCount(el,1);
}
function decrInnerCount(el){
adjustInnerCount(el,-1);
}
function adjustInnerCount(el,_1be){
if(!el){
return;
}
var n=parseInt(el.innerHTML,10);
if(null==n||isNaN(n)){
return;
}
el.innerHTML=(n+_1be);
}
function toggleCheckins(){
var _1c0=elById("containerCheckins");
var _1c1=elById("linkToggleCheckins");
if(!_1c0||!_1c1){
return;
}
toggleVisible(_1c0);
if(isVisible(_1c0)){
if(!_1c1.sHTMLOld){
_1c1.sHTMLOld=_1c1.innerHTML;
}
_1c1.innerHTML=FB_HIDE_CHECKINS;
}else{
_1c1.innerHTML=_1c1.sHTMLOld;
}
}
function initLogonControlTab(){
var _1c2=elById("tab_fogbugz");
var _1c3=elById("tab_ldap");
if(!_1c2||!_1c3){
return;
}
ourAttachEvent(_1c2,"click",function(){
setTimeout(updateNewUserControl,1);
});
ourAttachEvent(_1c3,"click",function(){
setTimeout(updateNewUserControl,1);
});
}
function initCommunityTab(){
var elOn=elById("tab_on");
var _1c5=elById("tab_off");
if(!elOn||!_1c5){
return;
}
ourAttachEvent(elOn,"click",function(){
setTimeout(updateNewUserControl,1);
});
ourAttachEvent(_1c5,"click",function(){
setTimeout(updateNewUserControl,1);
});
}
function updateNewUserControl(){
var elOn=elById("rdo_on");
var _1c7=elById("rdo_fogbugz");
var _1c8=elById("idNewUserControlSpan");
var _1c9=elById("idNewUserControl");
if(!elOn||!_1c7||!_1c9||!_1c8){
return;
}
var _1ca=elOn.checked;
var _1cb=_1c7.checked;
var _1cc=_1c9.options[_1c9.selectedIndex].value;
_1c8.innerHTML=pictureOf(NewUserControlSelect,_1cb,NEW_USER_CONTROL_ANYBODY==_1cc,_1ca,NEW_USER_CONTROL_COMMUNITY==_1cc);
DropListControl.refreshWithin(_1c8);
}
function initPeopleSearchUI(){
var _1cd=elById("dlgGrid");
var _1ce=elById("sPeopleName");
var _1cf=elById("fPeopleActive");
var _1d0=elById("fPeopleInactive");
var _1d1=elById("fPeopleBoth");
var _1d2=elById("fPeopleNormal");
var _1d3=elById("fPeopleCommunity");
var _1d4=elById("fPeopleVirtual");
if(!_1cd||!_1ce||!_1cf||!_1d0||!_1d1||!_1d3||!_1d2||!_1d4){
return;
}
var _1d5=function(){
return "pg=pgAlaCartePeople&fRefine=1&"+queryParamCheckbox(_1d2)+queryParamCheckbox(_1d3)+queryParamCheckbox(_1d4)+queryParamRadiobutton(_1cf)+queryParamRadiobutton(_1d0)+queryParamRadiobutton(_1d1)+"sPeopleName="+encodeURIComponent(trim(_1ce.value));
};
var _1d6=new DynamicUpdate(_1cd,_1d5);
function fxnUpdateDelayed(){
_1d6.update();
}
var _1d7=function(e){
setTimeout(fxnUpdateDelayed,1);
};
ourAttachEvent(_1ce,"keyup",function(){
_1d6.queueUpdate();
});
ourAttachEvent(_1cf.parentNode,"click",_1d7);
ourAttachEvent(_1d0.parentNode,"click",_1d7);
ourAttachEvent(_1d1.parentNode,"click",_1d7);
ourAttachEvent(_1d2.parentNode,"click",_1d7);
ourAttachEvent(_1d3.parentNode,"click",_1d7);
ourAttachEvent(_1d4.parentNode,"click",_1d7);
var _1d9=function(e){
if(stopFormSubmission(e)){
return cancel(e);
}
};
ourAttachEvent(_1ce,"keypress",_1d9);
ourAttachEvent(_1cf.parentNode,"keypress",_1d9);
ourAttachEvent(_1d0.parentNode,"keypress",_1d9);
ourAttachEvent(_1d1.parentNode,"keypress",_1d9);
ourAttachEvent(_1d2.parentNode,"keypress",_1d9);
ourAttachEvent(_1d3.parentNode,"keypress",_1d9);
ourAttachEvent(_1d4.parentNode,"keypress",_1d9);
}
function queryParamCheckbox(el){
if(!el||!el.checked){
return "";
}
return el.name+"=1&";
}
function queryParamRadiobutton(el){
if(!el||!el.checked){
return "";
}
return el.name+"="+el.value+"&";
}
function clickWorkOnOther(){
hideWorkingOnError();
hide(elById("idWorkOnScheduleItemDiv"));
toggleVisible(elById("idWorkOnOtherDiv"));
giveTextBoxFocus("idWorkOnOtherInput");
ShadowManager.fixShadow("workingOnPopup");
}
function dlgInstructions(o){
return DOM.div({"class":"editInstructions"},o);
}
function dlgInstructionsSpan(o){
return DOM.span({"class":"editInstructions"},o);
}
function dlgHiddenInstructions(o,id){
return DOM.div({"class":"editInstructions","id":id,"style":"display:none;"},o);
}
function dlgHeader(o){
return DOM.h1({},o);
}
function hiddenInput(_1e2,_1e3){
return DOM.input({"name":_1e2,"value":_1e3,"type":"hidden"});
}
function bugTip(_1e4,_1e5,_1e6){
var _1e7=DOM.span();
_1e7.innerHTML=_1e5;
return DOM.div({"class":"bugTip","style":"width:300px","align":"left"},DOM.strong({"style":(_1e6?"color:red;":"")},_1e4),DOM.hr(),_1e7);
}
var Permissions=new function(){
var _1e8=false;
var _1e9=null;
var _1ea=null;
this.init=function(){
if(!_1e8){
_1e9=elById("sSectionPermission");
_1ea=elById("ixSectionPermission");
}
_1e8=true;
};
this.quickGrant=function(_1eb,_1ec){
this.init();
if(!oAjaxRequest){
oAjaxRequest=new AjaxRequest();
}
if(oAjaxRequest.isBusy()){
setTimeout(function(){
Permissions.quickGrant(_1eb,_1ec);
},500);
}else{
var _1ed=_1ea?_1ea.value:0;
var _1ee=_1e9?encodeURIComponent(_1e9.value):"";
oAjaxRequest.initialize();
oAjaxRequest.onreadystatechange(Permissions.resultGrant);
oAjaxRequest.open("POST",sDefaultURI,true);
oAjaxRequest.send("fAlaCarte=1&pre=preGrantPermission&sSection="+_1ee+"&ixSection="+_1ed+"&ixPerson="+_1eb+"&iPermission="+_1ec);
}
};
this.resultGrant=function(){
if(!oAjaxRequest||!oAjaxRequest.isReady()){
return;
}
EditableTableManager.result("AdminTable",oAjaxRequest.responseXML());
};
};
var grgHTML=[];
function pictureOf(func){
var _1f0=grgHTML;
grgHTML=[];
var args=[];
for(var i=1;i<arguments.length;i++){
args[i-1]=arguments[i];
}
func.apply(this,args);
var _=grgHTML.join("");
grgHTML=_1f0;
return _;
}
function Weekday(dt){
return dt.getDay()+1;
}
function DateAdd(_1f5,c,dtIn){
var dt=new UTCDate(dtIn);
switch(_1f5){
case "yyyy":
dt.setFullYear(dt.getFullYear()+c);
break;
case "m":
dt.setMonth(dt.getMonth()+c);
break;
case "d":
dt.setDate(dt.getDate()+c);
break;
case "h":
dt.setHours(dt.getHours()+c);
break;
case "n":
dt.setMinutes(dt.getMinutes()+c);
break;
case "s":
dt.setSeconds(dt.getSeconds()+c);
break;
}
return dt;
}
function checkCCDate(o,_1fa){
if((o!=null)&&(o.value!="")){
var s=new String(o.value);
var _1fc="";
if(_1fa=="m"){
if(s.length<2){
_1fc="0";
}
}
if(_1fa=="y"){
if(s.length==1){
_1fc="200";
}
if(s.length==2){
_1fc="20";
}
}
o.value=_1fc+o.value;
}
}
function resizeTimeZoneSelectBox(o){
o.options[0].style.width=""+(o.clientWidth+30)+"px";
}


var POPUP_POSITION_CENTER=0;
var POPUP_POSITION_RIGHT=1;
var POPUP_POSITION_BELOW=2;
var POPUP_POSITION_UPPER_CENTER=3;
var POPUP_POSITION_LEFT=4;
var POPUP_POSITION_CENTER_SCREEN=5;
var EditableTableManager=new function(){
var _1=[];
var _2="";
this.hideAllPanes=function(){
for(var _3 in _1){
if(_1[_3]&&_1[_3].hidePane){
_1[_3].hidePane();
}
}
};
this.hidePane=function(_4){
this.create(_4);
_1[_4].hidePane();
};
this.unmaskPanes=function(){
for(var _5 in _1){
if(_1[_5]&&_1[_5].isVisible&&_1[_5].isVisible()){
_1[_5].unmaskSmall();
}
}
};
this.maskPanes=function(){
for(var _6 in _1){
if(_1[_6]&&_1[_6].isVisible&&_1[_6].isVisible()){
_1[_6].maskSmall();
}
}
};
this.fixShadow=function(_7){
this.doSetShadow(_7);
};
this.doSetShadow=function(_8){
this.create(_8);
_1[_8].doSetShadow();
};
this.getVisiblePane=function(){
for(var _9 in _1){
if(_1[_9]&&_1[_9].isVisible&&_1[_9].isVisible()){
return _1[_9].getVisiblePane();
}
}
return null;
};
this.isVisible=function(){
for(var _a in _1){
if(_1[_a]&&_1[_a].isVisible&&_1[_a].isVisible()){
return true;
}
}
return false;
};
this.getMaxZIndex=function(){
var _b=0;
for(var _c in _1){
if(_1[_c]&&_1[_c].isVisible&&_1[_c].isVisible()){
var nZ=_1[_c].getZIndex();
if(nZ>_b){
_b=nZ;
}
}
}
return _b;
};
this.setShadow=function(_e){
this.create(_e);
_1[_e].setShadow();
};
this.setWidth=function(_f,_10){
this.create(_f);
_1[_f].setWidth(_10);
};
this.showDeletePane=function(_11,_12,_13,_14,_15,_16){
this.create(_11);
_1[_11].showDeletePane(_12,_13,_14,_15?_15:_12,_16);
};
this.showDetailedDeletePane=function(_17,_18,_19,_1a,_1b,_1c){
this.create(_17);
_1[_17].showDetailedDeletePane(_18,_19,_1a,_1b,_1c);
};
this.showEditPane=function(_1d,_1e,_1f,_20,_21,_22,_23){
if(typeof (_21)=="string"){
_21=elById(_21);
}
this.create(_1d);
_1[_1d].showEditPane(_1e,_1f,_20,_21,_22,_23);
};
this.showNormalPane=function(_24,_25,_26,_27){
this.create(_24);
_1[_24].showNormalPane(_25,_26,_27);
};
this.repairCaret=function(_28){
this.create(_28);
_1[_28].repairCaret();
};
this.disablePaneForSubmit=function(_29){
this.create(_29);
_1[_29].startSubmit();
_1[_29].enablePane(false);
};
this.result=function(_2a,_2b,_2c){
this.create(_2a);
_1[_2a].result(_2b,_2c);
};
this.mousedownTopBar=function(_2d){
var _2e=_2d.id.replace(/topbar/,"");
this.create(_2e);
_1[_2e].startDragging();
_2=_2e;
};
this.stopDragging=function(){
if(_2&&_2.length){
this.create(_2);
_1[_2].stopDragging();
_2="";
}
};
this.notifyMovement=function(){
if(!_2||!_2.length){
return;
}
this.create(_2);
_1[_2].notifyMovement();
};
this.setFocus=function(_2f){
this.create(_2f);
_1[_2f].setFocus();
};
this.enablePane=function(_30,_31){
this.create(_30);
_1[_30].enablePane(_31);
};
this.create=function(_32){
if(!_1[_32]){
_1[_32]=new EditableTable(_32);
}
_1[_32].init();
};
};
function EditableTable(_33){
var _34=elById("static"+_33);
var _35=elById("edit"+_33);
var _36=elById("panemask"+_33+maskType());
var _37=elById("panemaskSmall"+_33+maskType());
var _38=XMLParser.getNodeUsingIdFrom(_35,"div","delete");
var _39=XMLParser.getNodeUsingIdFrom(_35,"div","editable");
var _3a=XMLParser.getNodeUsingIdFrom(_35,"div","error");
var _3b=[];
var _3c=null;
var _3d;
var _3e;
var _3f=false;
var _40=false;
var _41=false;
var _42=false;
var _43;
var _44;
var _45=false;
this.init=function(){
_35=elById("edit"+_33);
if(_35&&!_35.bInitialized){
_34=elById("static"+_33);
_36=elById("panemask"+_33+maskType());
_38=XMLParser.getNodeUsingIdFrom(_35,"div","delete");
_39=XMLParser.getNodeUsingIdFrom(_35,"div","editable");
_3a=XMLParser.getNodeUsingIdFrom(_35,"div","error");
_3b=[];
if(_35){
var _46=XMLParser.getNodeFrom(_35,"textarea");
var _47=_46?450:350;
var _48;
var _49=XMLParser.getNodeUsingIdFrom(_35,"span","pxWidthTable");
if(_49){
_48=_49.innerHTML;
}
if(_48!=null){
if(_48!=0){
_35.style.width=_48+"px";
}else{
_35.style.width=_47+"px";
}
}else{
_35.style.width=(_34?Math.max(_34.offsetWidth,_47):_47)+"px";
}
if(window.opera){
_35.style.border="1px solid #333333";
}
}
this.disableAllAutoComplete();
_35.bInitialized=true;
}
};
this.getZIndex=function(){
if(_35&&_35.style){
var nZ=Number(_35.style.zIndex);
return isNaN(nZ)?0:nZ;
}
return 0;
};
this.repairCaret=function(){
if(window.ie||window.webkit||window.opera){
return;
}
if(typeof (oWysiwyg)=="undefined"){
return;
}
preCalc(_35);
preCalc(_39);
var _4b=XMLParser.getArray(_35,"input");
for(var ix=0;ix<_4b.length;ix++){
var _4d=_4b[ix];
if(_4d.type.toLowerCase()=="text"){
var oD=DOM.div({"style":"overflow:auto;"});
_4d.parentNode.insertBefore(oD,_4d);
var _4f=_4d.nextSibling;
oD.appendChild(_4d);
while(_4f){
if(isTagName(_4d.nextSibling,"br")){
_4d.parentNode.removeChild(_4d.nextSibling);
break;
}
var _50=_4f.nextSibling;
oD.appendChild(_4f);
_4f=_50;
}
if(oD.scrollWidth&&oD.scrollWidth>oD.offsetWidth){
_4d.style.width=(oD.offsetWidth-10)+"px";
}
}
}
postCalc(_35);
postCalc(_39);
};
this.setWidth=function(_51){
_35.style.width=_51+"px";
};
this.disableAllAutoComplete=function(){
var _52=XMLParser.getNodeArrayFrom(_35,"input");
for(var ix=0;ix<_52.length;ix++){
if(_52[ix]&&_52[ix].setAttribute){
_52[ix].setAttribute("autocomplete","off");
}
}
};
this.result=function(_54,_55){
Info.hide();
this.enablePane(true);
if(!this.parseAndShowErrors(_54)){
var _56=elById(_55?_55:"container"+_33);
var _57=XMLParser.getCDataFrom(_54,"sHTML");
if(_56&&_57){
_56.innerHTML=_57;
}
_34=elById("static"+_33);
if(!this.parseAndShowWarning(_54)){
this.hidePane();
}else{
this.doSetShadow();
}
this.yellowFade(XMLParser.getTextFrom(_54,"idEditableRow"));
_58=null;
KeyManager.cleanupOnClick();
KeyManager.setupGridBrowser();
}else{
this.doSetShadow();
}
};
this.isVisible=function(){
return _45;
};
this.maskSmall=function(){
_37.style.height="100%";
_37.style.width="100%";
_37.style.display="";
};
this.unmaskSmall=function(){
_37.style.display="none";
};
this.unmask=function(){
_36.style.display="none";
};
this.yellowFade=function(_59){
YFTManager.hideYellow(_33);
var sId=_33+"_"+_59;
var _5b=elById(sId);
if(_5b){
YFTManager.showYellow(_33,_5b);
}
};
this.parseAndShowWarning=function(_5c){
var _5d=XMLParser.getTextFrom(_5c,"sWarning");
if(_5d&&_5d.length){
this.showErrorPane(_5d);
this.setFocus();
return true;
}
return false;
};
this.parseAndShowErrors=function(_5e){
this.hideAllErrors();
var _5f=XMLParser.getNodeArrayFrom(_5e,"Error");
var _60,sId,_62,_63;
_62=false;
_63=false;
for(var ix=0;ix<_5f.length;ix++){
_60=XMLParser.getTextFrom(_5f[ix],"sError");
sId=XMLParser.getTextFrom(_5f[ix],"sId");
if(_60&&sId){
this.showErrorElement(_60,sId);
_62=true;
if(!_63){
var _65=XMLParser.getNodeUsingIdFrom(_35,"input",sId);
if(_65){
try{
safeFocus(_65);
_63=true;
}
catch(err){
}
}
}
}
}
if(!_63){
this.setFocus();
}
return _62;
};
this.showErrorElement=function(_66,sId){
var _68=XMLParser.getNodeUsingIdFrom(_35,"input",sId);
var _69=XMLParser.getNodeUsingIdFrom(_35,"div","error_"+sId);
if(_68&&_68.className=="dlg"){
_68.className="dlgError";
}
if(_69){
_69.innerHTML=_66;
_69.style.display="";
}
_3b[_3b.length]=sId;
};
this.hideErrorElement=function(sId){
var _6b=XMLParser.getNodeUsingIdFrom(_35,"input",sId);
var _6c=XMLParser.getNodeUsingIdFrom(_35,"div","error_"+sId);
if(_6b&&_6b.className=="dlgError"){
_6b.className="dlg";
}
if(_6c){
_6c.style.display="none";
}
};
this.hideAllErrors=function(sId){
if(!_3b){
return;
}
for(var ix=0;ix<_3b.length;ix++){
this.hideErrorElement(_3b[ix]);
}
_3b=[];
};
this.enablePane=function(_6f){
if(!_35){
return;
}
var _70=XMLParser.getNodeArrayFrom(_35,"input");
for(var ix=0;ix<_70.length;ix++){
if(_70[ix].type.toLowerCase()!="file"){
_70[ix].disabled=!_6f;
}
}
_70=XMLParser.getNodeArrayFrom(_35,"textarea");
for(var ix=0;ix<_70.length;ix++){
_70[ix].disabled=!_6f;
}
};
this.startSubmit=function(){
Process.start(this,"result",null,FB_SUBMITTING);
};
this.hidePane=function(){
_45=false;
if(!_35){
return;
}
this.hideAllErrors();
this.stopDragging(true);
theMgr.hideAllPanePopups();
theMgr.unmaskTopmostPopup();
this.unmask();
this.repairPageFocus();
KeyManager.removePopupKeys(this.getVisiblePane());
FadeManager.startFadeOut(_33,_35,this.hideShadow);
theMgr.showSelects(theMgr.getTopmostPopup());
if(FancyPopupManager.fxnOnCloseHandler&&FancyPopupManager.fxnOnCloseHandler.call){
FancyPopupManager.fxnOnCloseHandler.call();
}
if(window.ie&&_39){
_39.style.position="relative";
}
};
this.repairPageFocus=function(){
if(window.ie){
return;
}
var _72=XMLParser.getNodeArrayFrom(_35,"input");
var _73=null;
for(var ix=0;ix<_72.length;ix++){
if(_72[ix].type.toLowerCase()!="hidden"){
_73=_72[ix];
break;
}
}
if(_73&&_73.focus){
try{
safeFocus(_73);
_73.blur();
}
catch(err){
}
}
};
this.setPaneState=function(_75){
if(_38){
_38.style.display=(_75=="delete")?"":"none";
}
if(_3a){
_3a.style.display=(_75=="error")?"":"none";
}
if(_39){
if(window.ie&&_75=="editable"){
_39.style.position="";
}
_39.style.display=(_75=="editable")?"":"none";
}
if(!_36){
return;
}
if(_75=="delete"||_75=="editable"||_75=="error"){
_36.style.top="0px";
_36.style.left="0px";
_36.style.width=documentWidth()+"px";
_36.style.height=documentHeight()+"px";
_36.style.display="";
}else{
_36.style.display="none";
}
};
this.getVisiblePane=function(){
return _35;
};
this.showErrorPane=function(_76){
_3c=null;
if(!_35){
return;
}
var _77=XMLParser.getNodeUsingIdFrom(_35,"span","mainErrorContainer");
if(_77){
_77.innerHTML=_76;
}
this.setPaneState("error");
this.setFocus();
};
this.showDeletePane=function(_78,_79,_7a,_7b,_7c){
_3c=null;
if(!_35){
return;
}
this.fadeIn(false);
this.setPaneState("delete");
this.postPaneDimensions(_7b,_7c);
var _7d=XMLParser.getNodeUsingIdFrom(_35,"div","delete");
var _7e=XMLParser.getNodeUsingIdFrom(_35,"span","sToDelete");
if(_7e){
_7e.innerHTML=encodeLTGT(_7a);
}
var _7f=XMLParser.getNodeMatchingIdFrom(_35,"input","ixToDelete.*");
if(_7f){
_7f.value=_79;
}
this.setFocus();
theMgr.hideSelects();
};
this.fadeIn=function(_80){
_40=false;
_3f=false;
_45=true;
KeyManager.cleanupOnClick();
this.registerHotKeys();
if(_80){
FadeManager.startFadeIn(_33,_35,null,true,function(){
EditableTableManager.enablePane(_33,true);
EditableTableManager.setShadow(_33);
EditableTableManager.setFocus(_33);
if(_3c){
_3c();
}
});
}else{
FadeManager.startFadeIn(_33,_35,null,true,function(){
EditableTableManager.setShadow(_33);
if(_3c){
_3c();
}
});
}
theMgr.showTopSmallMask();
};
this.registerHotKeys=function(){
var _81=this.getVisiblePane();
var _82=XMLParser.getNodeArrayFrom(_35,"input");
for(var ix=0;ix<_82.length;ix++){
var _84=_82[ix].getAttribute("cHotKey");
if(_84){
KeyManager.registerPopupKey(_84,_82[ix].id,_35);
}
}
};
this.setShadow=function(){
if(!_3f||_40||_35.style.display=="none"){
return;
}
ShadowManager.applyShadow(_33,_3d,_3e,_35);
_40=true;
};
this.doSetShadow=function(){
ShadowManager.applyShadow(_33,_3d,_3e,_35);
};
this.hideShadow=function(){
ShadowManager.hideShadow(_33);
};
this.showDetailedDeletePane=function(_85,_86,_87,_88,_89){
_3c=null;
if(!_35){
return;
}
this.fadeIn(false);
this.setPaneState("delete");
this.postPaneDimensions(_85,null);
var _8a=XMLParser.getNodeUsingIdFrom(_35,"div","delete");
var _8b=XMLParser.getNodeUsingIdFrom(_8a,"span","sToDelete");
if(_8b){
_8b.innerHTML=encodeLTGT(_87);
}
_8b=XMLParser.getNodeUsingIdFrom(_8a,"span","sToDelete2");
if(_8b){
_8b.innerHTML=encodeLTGT(_88);
}
_8b=XMLParser.getNodeUsingIdFrom(_8a,"span","sToDelete3");
if(_8b){
_8b.innerHTML=encodeLTGT(_89);
}
var _8c=XMLParser.getNodeUsingIdFrom(_35,"input","ixToDelete");
_8c.value=_86;
this.setFocus();
theMgr.hideSelects();
};
this.showNormalPane=function(_8d,_8e,_8f){
if(_8f==undefined){
_8f=true;
}
_3c=null;
if(_8e==null){
_8e=POPUP_POSITION_CENTER;
}
this.fadeIn(_8f);
_35.style.visibility="hidden";
this.setPaneState("editable");
this.postPaneDimensions(_8d,_8e);
_35.style.visibility="visible";
theMgr.hideSelects();
};
var _58;
this.showEditPane=function(_90,_91,_92,_93,_94,_95){
if(_93==null){
_93=_90;
}
_3c=_92;
if(!_35){
return;
}
this.fadeIn(true);
_35.style.visibility="hidden";
this.setPaneState("editable");
var _96=XMLParser.getNodeUsingIdFrom(_35,"div","editable");
var _97=_95||_90;
for(var ix=0;_91&&_58!=_97&&ix<_91.length;ix++){
if(_91[ix].sTag.indexOf("fb:")==0){
XMLParser.setCustomTagValue(_96,encodeLTGT(_91[ix].sTag),_91[ix].value);
}else{
if(_91[ix].sTag=="a"||_91[ix].sTag=="span"){
var o=XMLParser.getNodeUsingIdFrom(_35,_91[ix].sTag,_91[ix].sId);
if(o){
if(_91[ix].value.length){
if(_91[ix].sTag=="a"){
o.href=_91[ix].value;
}else{
if(_91[ix].fIsHtml){
o.innerHTML=_91[ix].value;
}else{
o.innerHTML=encodeLTGT(_91[ix].value);
}
}
o.style.display="";
}else{
o.style.display="none";
}
}
}else{
var o=XMLParser.getNodeUsingIdFrom(_35,_91[ix].sTag,_91[ix].sId);
if(o){
if(o.type.toLowerCase()=="radio"||o.type.toLowerCase()=="checkbox"){
o.checked=_91[ix].value;
}else{
o.value=_91[ix].value;
}
if(o.tagName.toLowerCase()=="textarea"){
o.fxnResize=this.doSetShadow;
if(!o.nRowsOriginal){
o.nRowsOriginal=o.rows;
}else{
o.rows=o.nRowsOriginal;
}
adjustRows(o);
}
}
}
}
}
this.postPaneDimensions(_93,_94);
_35.style.visibility="visible";
this.doSetShadow();
_58=_95||_90;
this.enablePane(false);
theMgr.hideSelects();
};
this.postPaneDimensions=function(_9a,_9b){
this.setPaneLoc(_9a,_9b);
DropListControl.refreshWithin(_35);
};
this.setPaneLoc=function(_9c,_9d){
if(!_35){
return;
}
if(_35.offsetHeight>windowHeight()){
this.shrinkPane();
}else{
if(_41){
this.unShrinkPane();
}
}
if(_9d!=null){
var pt;
if(_9d==POPUP_POSITION_RIGHT){
pt=getRightCoordinates(_35,_9c);
}else{
if(_9d==POPUP_POSITION_BELOW){
pt=getBelowCoordinates(_35,_9c);
}else{
if(_9d==POPUP_POSITION_UPPER_CENTER){
pt=getUpperCenteredCoordinates(_35,_9c);
}else{
if(_9d==POPUP_POSITION_LEFT){
pt=getLeftCoordinates(_35,_9c);
}else{
if(_9d==POPUP_POSITION_CENTER_SCREEN){
pt=centerInWindow(_35);
}else{
pt=getCenteredCoordinates(_35,_9c);
}
}
}
}
}
_3e=pt.y;
_3d=pt.x;
}else{
var _9f=(calculateOffset(_9c,"offsetTop")-25);
if((_9f+_35.offsetHeight)>(scrollTop()+windowHeight())){
_9f=Math.max(2,(scrollTop()+windowHeight()-_35.offsetHeight-25));
}
_3e=_9f;
_3d=(calculateOffset(_34,"offsetLeft")+15);
}
if(_35.scrollWidth&&_35.scrollWidth>_35.offsetWidth){
_35.style.width=(_35.scrollWidth+10)+"px";
}
_35.style.top=_3e+"px";
_35.style.left=_3d+"px";
var pt=moveWithinWindow(_35);
_3e=pt.y;
_3d=pt.x;
_3f=true;
_35.style.zIndex=4;
_35.style.zIndex=EditableTableManager.getMaxZIndex()+1;
};
this.shrinkPane=function(){
var _a0=XMLParser.getNodeArrayFrom(_35,"textarea");
for(var ix=0;ix<_a0.length;ix++){
if(_a0[ix]&&_a0[ix].rows){
while(_35.offsetHeight>windowHeight()&&_a0[ix].rows>4){
_a0[ix].rows--;
}
_a0[ix].bRowLock=true;
}
}
_41=true;
};
this.unShrinkPane=function(){
var _a2=XMLParser.getNodeArrayFrom(_35,"textarea");
for(var ix=0;ix<_a2.length;ix++){
if(_a2[ix]){
_a2[ix].bRowLock=false;
adjustRows(_a2[ix]);
}
}
_41=false;
};
this.setFocus=function(){
var _a4;
var _a5=isVisible(_38)?_38:isVisible(_39)?_39:_3a;
if(_a5){
_a4=XMLParser.getNodeFrom(_a5,"button");
var rg=XMLParser.getNodeArrayFrom(_a5,"input");
for(var ix=0;ix<rg.length;ix++){
if(rg[ix].type!="hidden"){
_a4=rg[ix];
break;
}
}
if(_a4&&!(_a4.tagName.toLowerCase()=="input"&&_a4.value.length==0)&&XMLParser.getNodeFrom(_a5,"textarea")){
_a4=XMLParser.getNodeFrom(_a5,"textarea");
}
}
if(!_a4){
return;
}
if((_a4.tagName.toLowerCase()=="textarea"||_a4.type.toLowerCase()=="text")&&_a4.id){
giveTextBoxFocus(_a4.id);
adjustRows(_a4);
}else{
safeFocus(_a4);
}
};
this.startDragging=function(){
_43=xMouse-calculateOffset(_35,"offsetLeft");
_44=yMouse-calculateOffset(_35,"offsetTop");
_42=true;
bCancelEvents=true;
};
this.stopDragging=function(_a8){
_42=false;
_43=0;
_44=0;
bCancelEvents=false;
if(!_a8){
this.setFocus();
}
};
this.notifyMovement=function(){
if(_42){
_3d=xMouse-_43;
_3e=yMouse-_44;
ShadowManager.positionShadow(_33,_3d,_3e,_35);
_35.style.left=_3d+"px";
_35.style.top=_3e+"px";
removeTextSelections();
}
};
}
var FancyPopupManager=new function(){
this.oPrototype=null;
this.hashRepairCaret={};
this.fxnOnCloseHandler=null;
this.create=function(sId){
if(!this.oPrototype){
this.oPrototype=elById("containerPopupWikiPrototype");
}
if(!this.oPrototype){
return;
}
var _aa=this.oPrototype.cloneNode(true);
applyToSelfAndChildren(_aa,function(_){
if(_&&_.id){
_.id=_.id.replace(/popupWikiPrototype/i,sId);
}
});
var _ac=elById("mainAreaContinued");
if(!_ac){
_ac=elById("mainArea");
}
if(_ac){
_ac.appendChild(_aa);
return new FancyPopup(sId,XMLParser.getNodeUsingIdFrom(_aa,"div","editable"));
}else{
return null;
}
};
this.disableForSubmit=function(sId){
EditableTableManager.disablePaneForSubmit(sId);
};
this.enable=function(sId){
EditableTableManager.enablePane(sId,true);
Info.hide();
this.fixShadow(sId);
};
this.show=function(sId,_b0,_b1,_b2){
if(!_b0){
_b1=null;
}
if(theMgr.exists(sId)){
theMgr.showPopup(sId);
}else{
if(!this.hashRepairCaret[sId]){
EditableTableManager.repairCaret(sId);
this.hashRepairCaret[sId]=true;
}
var _b3=typeof (oWysiwyg)!="undefined";
var _b4=_b0?elById(_b0):_b3?oWysiwyg.oEditable:document.body;
if(_b3&&_b4==oWysiwyg.oEditable){
_b1=POPUP_POSITION_UPPER_CENTER;
}
EditableTableManager.showNormalPane(sId,_b4,_b1,_b2);
}
};
this.hide=function(){
theMgr.hideAllPopups();
EditableTableManager.hideAllPanes();
};
this.hidePane=function(_b5){
EditableTableManager.hidePane(_b5);
};
this.fixShadow=function(sId){
EditableTableManager.doSetShadow(sId);
};
this.setWidth=function(sId,_b8){
EditableTableManager.setWidth(sId,_b8);
};
};
function FancyPopup(_b9,_ba){
this.oDiv=_ba;
this.id=_b9;
this.show=function(_bb,_bc,_bd){
FancyPopupManager.show(this.id,_bb,_bc,_bd);
};
this.hide=function(){
FancyPopupManager.hidePane(this.id);
};
this.enable=function(){
FancyPopupManager.enable(this.id);
};
this.disableForSubmit=function(){
FancyPopupManager.disableForSubmit(this.id);
};
this.fixShadow=function(){
EditableTableManager.doSetShadow(this.id);
};
this.setWidth=function(_be){
EditableTableManager.setWidth(this.id,_be);
};
this.noHideSelects=function(){
if(!window.ie6||!this.oDiv){
return;
}
var rg=XMLParser.getArray(this.oDiv,"select");
rg.foreach(function(_){
theMgr.addNoHide(_.id);
});
};
}


var g_fDropListsEnabled=!window.opera&&!window.safari;
function DropList(_1){
if(!_1||!_1.options){
return null;
}
this.oSel=_1;
this.id="idDropList_"+this.oSel.id+"_";
this.rgOpts=null;
this.oText=null;
this.oDropButton=null;
this.oDropList=null;
this.dtLastTyped=null;
this.dtLastKeyboardScroll=null;
this.sLastKeydown=null;
this.ixSelected=-1;
this.reMatch=null;
this.reQuote=null;
this.fAboveText=false;
this.fOffsetText=false;
this.pxWidthLast=0;
this.sHTMLLast="";
this.fTextFocused=false;
this.fInitialRestore=true;
this.fDisabled=false;
this.pxTopText=null;
this.fTextBox=this.oSel.fTextBox;
this.fDeferred=false;
var _2=this;
this.init=function _init(){
this.createSkeleton();
this.createBehaviors();
this.refresh();
theMgr.addWithHandler(this.oDropList.id,function(){
_2.preHide();
_2.showChosenValue();
return true;
});
};
this.isLegit=function _isLegit(){
return isInDOM(this.oText)&&isInDOM(this.oSel)&&isInDOM(this.oDropList);
};
this.destroy=function _destroy(){
if(!isInDOM(this.oText)){
this.oText=elById(this.oText.id);
}
if(this.oText&&this.oText.parentNode){
this.oText.parentNode.removeChild(this.oText);
}
if(!isInDOM(this.oDropList)){
this.oDropList=elById(this.oDropList.id);
}
if(this.oDropList&&this.oDropList.parentNode){
this.oDropList.parentNode.removeChild(this.oDropList);
}
if(!isInDOM(this.oDropButton)){
this.oDropButton=elById(this.oDropButton.id);
}
if(this.oDropButton&&this.oDropButton.parentNode){
this.oDropButton.parentNode.removeChild(this.oDropButton);
}
this.oText=null;
this.oDropList=null;
this.oDropButton=null;
};
this.refresh=function _refresh(){
if(this.oSel.getAttribute("fDeferDrop")){
if(!this.fDeferred&&(!window.fDomLoaded||!g_setInnerHTMLComplete)){
this.fDeferred=true;
return;
}
}
if(!this.needsRefresh()){
this.restoreLastValue();
this.refreshDropButton();
return;
}
this.setEnabled(!this.oSel.disabled);
this.createRgOpts();
this.restoreLastValue();
this.refreshDropButton();
};
this.refreshDropButton=function _refreshDropButton(_3){
var _4=this.oDropButton;
var _5=this.oText;
if(!_4||!_5){
return;
}
if(window.ie&&_4.parentNode.parentNode&&_4.parentNode.parentNode.style.verticalAlign=="top"){
_4.style.top="0px";
return;
}
var _6=_5.offsetHeight;
if(!_6){
_3=_3||0;
if(_3<5){
setTimeout(function(){
_2.refreshDropButton(_3+1);
},50);
return;
}else{
_6=20;
}
}
var _7=_4.style;
if(this.fTextBox){
_7.display="none";
}else{
if(_6!=_4.offsetHeight){
_7.height=_6+"px";
}
}
var _8=_5.offsetTop;
var _9=_4.offsetTop-sToPx(_4.style.top);
if(_8!=_9){
_7.top=(_8-_9)+"px";
}
};
this.needsRefresh=function _needsRefresh(){
if(!this.oSel||!this.oSel.options){
return false;
}
if(this.rgOpts==null){
return true;
}
return (this.oSel.options.length!=this.rgOpts.length)||(this.oSel.innerHTML!=this.sHTMLLast)||(this.fDisabled!=(this.oSel.disabled?true:false));
};
this.handleKeydown=function(e){
if(!e){
e=window.event;
}
var _b=getKeyCode(e);
this.sLastKeydown=this.oText.value;
this.fIgnoreNextBlur=false;
if(_b==13||_b==9){
var _c=isVisible(this.oDropList);
if(_c){
this.chooseValue(this.ixSelected);
}
if(_b==13&&this.fTextBox&&(!_c||this.ixSelected==0)){
return this.oSel.form.submit();
}
return (_b==13)?cancel(e):true;
}
if(_b==8&&(window.ie||window.opera||window.webkit)){
this.handleKeypress(e);
return true;
}
if(_b>=16&&_b<=18){
return true;
}
var _d=getArrowKeyCode(e);
var _e=isVisible(this.oDropList);
if(!_e&&_b!=27){
setTimeout(function(){
if(_2.fTextFocused){
if(_d!=null){
_2.unFilterList();
}
_2.showList();
_2.refreshSize();
_2.selectOpt(_2.trueSelection());
if(window.ie6){
_2.repairFocus();
}
}
},1);
}
if(_d!=null){
if(e.altKey){
return true;
}
if(this.fTextBox&&(_d==KEY_ARROW_LEFT||_d==KEY_ARROW_RIGHT)){
return true;
}
if(_e){
if(_d==KEY_ARROW_UP||_d==KEY_ARROW_LEFT){
this.selectNeighborVisibleOpt(false);
}else{
if(_d==KEY_ARROW_DOWN||_d==KEY_ARROW_RIGHT){
this.selectNeighborVisibleOpt(true);
}else{
if(_d==KEY_PG_UP){
this.selectPgVisibleOpt(false);
}else{
if(_d==KEY_PG_DOWN){
this.selectPgVisibleOpt(true);
}
}
}
}
this.scrollIntoView(this.rgOpts[this.ixSelected].oOpt);
}
this.dtLastKeyboardScroll=new BrowserDate();
return cancel(e);
}
return true;
};
this.handleKeypress=function _handleKeypress(e){
if(getKeyCode(e)==13){
return cancel(e);
}
var _10;
this.dtLastTyped=_10=new BrowserDate();
setTimeout(function(){
if(_2.oText.value!=_2.sLastKeydown){
_2.filterList(_10);
}
},35);
};
this.createRgOpts=function _createRgOpts(){
this.rgOpts=[];
var rg=this.oSel.options;
if(!rg.length){
var o=this.rgOpts[0]={};
o.s="",o.sText="";
o.val="";
o.ixLoc=-1;
o.ixOriginal=0;
o.sImg="";
}else{
var _13=this.oSel.getAttribute("img");
for(var ix=0;ix<rg.length;ix++){
var el=rg[ix];
var o=this.rgOpts[ix]={};
o.s=trim(el.innerHTML);
o.sText=trim((el.textContent||el.innerText||DecodeHTMLEnt(el.innerHTML)));
o.val=el.value;
o.ixLoc=-1;
o.ixOriginal=ix;
if(_13){
o.sImg=el.getAttribute("img");
}
}
}
this.sHTMLLast=this.oSel.innerHTML;
};
this.createBehaviors=function _createBehaviors(){
this.oDropButton.onmouseover=this.fxnIfEnabled(function(){
this.src="images/dropHover.png";
});
this.oDropButton.onmouseout=this.fxnIfEnabled(function(){
this.src="images/dropNormal.png";
});
this.oDropButton.onmousedown=this.fxnIfEnabled(function(e){
_2.fIgnoreNextBlur=true;
if(isVisible(_2.oDropList)){
_2.hideList();
return cancel(e);
}
_2.unFilterList();
_2.showList();
safeFocus(_2.oText);
return cancel(e);
});
this.oText.onmouseover=this.fxnIfEnabled(function(){
_2.oDropButton.onmouseover.apply(_2.oDropButton);
});
this.oText.onmouseout=this.fxnIfEnabled(function(){
_2.oDropButton.onmouseout.apply(_2.oDropButton);
});
this.oText.onmousedown=this.fxnIfEnabled(function(e){
if(!isVisible(_2.oDropList)){
_2.unFilterList();
_2.showList();
}
});
if(!this.fTextBox){
this.oText.onblur=this.fxnIfEnabled(function(){
if(!_2.fIgnoreNextBlur){
_2.hideList();
_2.showChosenValue();
}
_2.fIgnoreNextBlur=false;
_2.fTextFocused=false;
});
}else{
this.oText.onblur=this.fxnIfEnabled(function(){
_2.fTextFocused=false;
});
}
if(window.opera){
this.oText.onkeypress=this.fxnIfEnabled(function(e){
if(_2.handleKeydown(e)){
_2.handleKeypress(e);
}
});
}else{
this.oText.onkeydown=this.fxnIfEnabled(function(e){
_2.handleKeydown(e);
});
this.oText.onkeypress=this.fxnIfEnabled(function(e){
_2.handleKeypress(e);
});
}
this.oText.onfocus=this.fxnIfEnabled(function(e){
_2.refreshDropButton();
if(!_2.fIgnoreNextFocus){
if(!isVisible(_2.oDropList)){
_2.unFilterList();
}
_2.fTextFocused=true;
if(!_2.fTextBox){
setTimeout(function(){
if(_2.fTextFocused){
selectContents(_2.oText);
}
},1);
}
if(_2.oSel.onfocus&&_2.oSel.onfocus.apply){
_2.oSel.onfocus.apply(_2.oSel);
}
}
_2.fIgnoreNextFocus=false;
});
this.oDropList.onmousedown=this.fxnIfEnabled(function(e){
_2.fIgnoreNextBlur=true;
if(window.webkit){
return false;
}
return cancel(e);
});
this.associateLabel();
};
this.associateLabel=function _associateLabel(){
var _1d=document.getElementsByTagName("label");
if(!_1d||!_1d.length){
return;
}
var _1e=_1d[_1d.length-1];
var _1f=_1e.getAttribute("for")||_1e.getAttribute("htmlFor");
if(_1f==this.oSel.id){
_1e.onclick=this.oDropButton.onmousedown;
}
};
this.fxnIfEnabled=function _fxnIfEnabled(fxn){
return function(e){
if(_2.rgOpts&&!_2.fDisabled){
fxn.apply(this,[e]);
}
};
};
this.disable=function _disable(){
this.setEnabled(false);
};
this.enable=function _enable(){
this.setEnabled(true);
};
this.setEnabled=function _setEnabled(_22){
this.fDisabled=!_22;
this.oText.disabled=!_22;
this.oDropButton.src=_22?"images/dropNormal.png":"images/dropDisabled.png";
};
this.createSkeleton=function _createSkeleton(){
var _23=DOM.nobr();
this.oSel.parentNode.insertBefore(_23,this.oSel);
var _24,_25,_26;
var _24=document.createElement("input");
_24.type="text";
_24.className="dlgText";
_24.style.margin="0";
_24.style.padding="1px 0 2px 4px";
_24.style.position="relative";
_24.style.top="-2px";
_24.style.fontSize="11px";
_24.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif";
_24.setAttribute("autocomplete","off");
_24.id=this.id+"oText";
_24.tabIndex=this.oSel.tabIndex;
var _27=this.getSelWidth();
if(_27>26){
if(!this.fTextBox){
_24.style.width=(_27-26)+"px";
}else{
_24.style.width=_27+"px";
}
}
if(this.fTextBox){
_24.className=this.oSel.className;
}
this.oText=_24;
_23.appendChild(this.oText);
if(DropList.oDropButtonProto){
_25=DropList.oDropButtonProto.cloneNode(false);
}else{
_25=document.createElement("img");
_25.src="images/dropNormal.png";
_25.style.width="18px";
_25.style.height="18px";
_25.style.top=window.ie?"2px":"3px";
_25.style.position="relative";
DropList.oDropButtonProto=_25.cloneNode(false);
}
_25.id=this.id+"oButton";
_25.titleId=this.oText.id;
this.oDropButton=_25;
_23.appendChild(this.oDropButton);
if(DropList.oDropListProto){
_26=DropList.oDropListProto.cloneNode(false);
}else{
_26=document.createElement("div");
_26.style.position="absolute";
_26.style.borderLeft="1px solid rgb(181,178,181)";
_26.style.borderTop="1px solid rgb(181,178,181)";
_26.style.borderRight="1px solid rgb(0,0,0)";
_26.style.borderBottom="1px solid rgb(0,0,0)";
_26.style.backgroundColor="rgb(255,255,255)";
_26.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif";
_26.style.fontSize="11px";
_26.style.textAlign="left";
DropList.oDropListProto=_26.cloneNode(false);
}
_26.id=this.id+"oDropList";
if(this.fTextBox){
this.oText.value=this.oSel.value;
this.oText.style.margin="";
this.oText.style.padding="";
this.oText.style.top="";
this.oText.style.fontSize=this.oSel.style.fontSize;
this.oDropButton.style.display="none";
}
if(window.ie7){
_26.style.overflowY="auto";
_26.style.overflowX="hidden";
}else{
if(window.webkit){
_26.className="autoscroll";
_26.style.maxHeight="260px";
}else{
_26.style.overflow=(window.ie||window.opera||window.webkit)?"auto":"-moz-scrollbars-vertical";
}
}
_26.style.display="none";
_26.tabIndex=-1;
this.oDropList=_26;
document.body.insertBefore(this.oDropList,document.body.lastChild);
this.oSel.style.display="none";
this.oSel.focus=_2.focus;
this.fDisabled=this.oSel.disabled;
if(this.fDisabled){
this.disable();
}
};
this.getSelWidth=function _getSelWidth(){
var o=this.oSel;
if(!o){
return 300;
}
var _29=o.style.width;
var ix=_29?_29.indexOf("px"):-1;
if(ix>0){
return Number(_29.substring(0,ix));
}else{
return o.offsetWidth||300;
}
};
this.fxnMouseoverOpt=function(){
if((new BrowserDate()-_2.dtLastKeyboardScroll)>20){
_2.selectOpt(this.ix);
}
};
this.fxnMouseupOpt=function(){
_2.chooseValue(this.ix);
};
this.createOpt=function _createOpt(){
var _2b;
if(!this.createOpt.oProto){
_2b=document.createElement("div");
var _2c=_2b.style;
_2c.padding="0 0 0 4px";
_2c.margin="0";
_2c.cursor="default";
_2c.zIndex="2";
this.createOpt.oProto=_2b.cloneNode(false);
}else{
_2b=this.createOpt.oProto.cloneNode(false);
}
_2b.onmouseover=this.fxnMouseoverOpt;
_2b.onmouseup=this.fxnMouseupOpt;
return _2b;
};
this.setOptInnerHTML=function _setOptInnerHTML(ix){
var s=this.rgOpts[ix].s;
if(!this.fTextBox){
if(!this.reQuote){
this.reQuote=new RegExp("\"","g");
}
s=s.replace(this.reQuote,"&quot;");
}
this.rgOpts[ix].oOpt.innerHTML="<nobr>"+(this.rgOpts[ix].sImg?"<img src=\""+this.rgOpts[ix].sImg+"\" class=\"dropicon\"/>":"")+((this.reMatch!=null)?s.replace(this.reMatch,"<b>$1</b>"):s)+"</nobr>";
};
this.restoreLastValue=function _restoreLastValue(){
if(this.fTextBox&&!this.fInitialRestore){
return;
}
if(!(this.fInitialRestore&&this.oText.value.length)){
var _2f=0;
for(var ix=0;ix<this.rgOpts.length;ix++){
if(this.rgOpts[ix].ixOriginal==this.oSel.selectedIndex){
_2f=ix;
break;
}
}
this.chooseValue(_2f,true);
}
this.fInitialRestore=false;
};
this.chooseValue=function _chooseValue(ix,_32){
if(!this.fTextBox&&(ix==null||ix<0)){
this.restoreLastValue();
return;
}
if(ix&&!this.rgOpts[ix].fVisible){
ix=this.trueSelection();
}
if(this.fTextBox){
this.oSel.value=this.rgOpts[ix].s;
}else{
this.oSel.selectedIndex=this.rgOpts[ix].ixOriginal;
}
if(!_32){
this.deselectOpt(this.ixSelected);
this.hideList();
this.selectOpt(ix);
}
this.showChosenValue((ix?this.rgOpts[ix].sText:null));
if(!_32&&this.oSel.onchange&&this.oSel.onchange.apply){
this.oSel.onchange.apply(this.oSel);
if(this.oSel.onclick&&this.oSel.onclick.apply){
this.oSel.onclick.apply(this.oSel);
}
}
};
this.showChosenValue=function _showChosenValue(_33){
setTimeout(function(){
if(_2.oText){
if(!_33){
if(_2.fTextBox){
_33=_2.oSel.value;
}else{
_33=_2.rgOpts[_2.trueSelection()].sText;
}
}else{
if(_2.fTextBox){
_2.oSel.value=_33;
}
}
_2.oText.value=_33;
}
},1);
};
this.selectNeighborVisibleOpt=function _selectNeighborVisibleOpt(_34){
for(var ix=_34?(this.ixSelected+1):(this.ixSelected-1);_34?(ix<this.rgOpts.length):(ix>=0);_34?(ix++):(ix--)){
if(this.rgOpts[ix].fVisible){
this.selectOpt(ix);
return;
}
}
};
this.selectPgVisibleOpt=function _selectPgVisibleOpt(_36){
var _37=this.rgOpts[this.ixSelected].oOpt.offsetTop+(_36?(this.oDropList.offsetHeight-20):((-1*this.oDropList.offsetHeight)+20));
for(var ix=this.ixSelected;_36?(ix<this.rgOpts.length):(ix>=0);_36?(ix++):(ix--)){
if(_36&&((this.rgOpts[ix].oOpt.offsetTop>=_37)||(ix==(this.rgOpts.length-1)))||(!_36&&((this.rgOpts[ix].oOpt.offsetTop<=_37)||(ix==0)))){
this.selectOpt(ix);
return;
}
}
};
this.selectOpt=function _selectOpt(ix){
if(!this.rgOpts[ix]){
return;
}
if(!this.rgOpts[ix].fVisible){
this.selectNeighborVisibleOpt(true);
return;
}
this.deselectOpt(this.ixSelected);
this.styleOptSelected(ix);
this.ixSelected=ix;
if(!window.ie&&!window.webkit){
removeTextSelections();
}
};
this.deselectOpt=function _deselectOpt(ix){
if(!this.rgOpts[ix]){
return;
}
this.styleOptNormal(ix);
};
this.styleOptSelected=function _styleOptSelected(ix){
var o=this.rgOpts[ix].oOpt;
if(!o){
return;
}
o.style.backgroundColor="rgb(49,105,198)";
o.style.color="rgb(255,255,255)";
};
this.styleOptNormal=function _styleOptNormal(ix){
var o=this.rgOpts[ix].oOpt;
if(!o){
return;
}
o.style.backgroundColor="rgb(255,255,255)";
o.style.color="rgb(0,0,0)";
};
this.filterList=function _filterList(dt){
if(!this.oText){
return;
}
if(dt!=this.dtLastTyped){
return;
}
var s=this.oText.value.toLowerCase();
for(var ix=0;ix<this.rgOpts.length;ix++){
var o=this.rgOpts[ix];
if(!o.sLower){
o.sLower=o.sText.toLowerCase();
}
o.ixLoc=o.sLower.indexOf(s);
o.fVisible=(o.ixLoc!=-1);
}
if(this.fTextBox){
var o=this.rgOpts[0];
o.sText=this.oText.value;
o.s=o.val=UnicodeClean(o.sText);
o.ixLoc=0;
o.fVisible=o.s.length>0;
}
this.updateList(true);
};
this.unFilterList=function _unFilterList(){
for(var ix=0;ix<this.rgOpts.length;ix++){
this.rgOpts[ix].ixLoc=-1;
this.rgOpts[ix].fVisible=true;
}
this.deselectOpt(this.ixSelected);
this.ixSelected=this.trueSelection();
this.updateList();
};
this.sortHelper=function(a,b){
return (a.ixLoc<0&&b.ixLoc>=0)?1:(b.ixLoc<0&&a.ixLoc>=0)?-1:(a.ixLoc<b.ixLoc)?-1:(b.ixLoc<a.ixLoc)?1:(a.ixOriginal<b.ixOriginal)?-1:(b.ixOriginal<a.ixOriginal)?1:0;
};
this.getZIndex=function _getZIndex(){
var el=this.oSel;
var cz=0;
while(el&&el.style){
cz=Math.max(cz,el.style.zIndex);
el=el.parentNode;
}
return cz;
};
this.showList=function _showList(){
var _48=this.getZIndex()+1;
this.oText.style.zIndex=_48;
this.oDropButton.style.zIndex=_48;
this.oDropList.style.zIndex=_48;
this.getPosition();
theMgr.showPopup(this.oDropList.id,null,this.x,this.y,false);
if(this.ixSelected>=0){
this.scrollIntoView(this.rgOpts[this.ixSelected].oOpt,true);
}
};
this.getPosition=function _getPosition(){
var _49=calculateOffset(this.oText,"offsetLeft");
this.pxTopText=calculateOffset(this.oText,"offsetTop");
var pt=getInWindowCoordinates(this.oDropList,_49,this.pxTopText,this.oText,0,0,true);
this.fAboveText=(pt.y<this.pxTopText);
this.fOffsetText=this.fOffsetText||(pt.x!=_49);
this.x=pt.x;
this.y=pt.y;
};
this.hideList=function _hideList(){
if(!isVisible(this.oDropList)){
return;
}
this.preHide();
theMgr.hidePopup(this.oDropList.id);
};
this.preHide=function _preHide(){
this.deselectOpt(this.ixSelected);
this.oText.style.zIndex=0;
this.oDropButton.style.zIndex=0;
this.oDropList.style.zIndex=0;
if(this.fTextBox){
this.oSel.value=this.oText.value;
}
};
this.scrollIntoView=function _scrollIntoView(o,_4c){
if(!o){
return;
}
if(_4c||o.offsetTop<this.oDropList.scrollTop){
this.oDropList.scrollTop=o.offsetTop+1;
}else{
if((o.offsetTop+o.offsetHeight)>(this.oDropList.scrollTop+this.oDropList.offsetHeight-4)){
this.oDropList.scrollTop=(o.offsetTop-this.oDropList.offsetHeight+o.offsetHeight+4);
}
}
};
this.repairFocus=function _repairFocus(){
if(!window.ie6){
return;
}
var oR=this.oText.createTextRange();
var _4e=oR.moveEnd("character",-1*this.oText.value.length);
this.fIgnoreNextBlur=true;
this.fIgnoreNextFocus=true;
this.oText.blur();
this.oText.focus();
oR=this.oText.createTextRange();
oR.moveEnd("character",-1*_4e);
oR.moveStart("character",-1*_4e);
oR.collapse();
oR.select();
};
this.focus=function _focus(){
safeFocus(_2.oText);
};
this.refreshSize=function _refreshSize(){
var _4f=false;
if(!isVisible(this.oDropList)){
_4f=true;
this.oDropList.style.visibility="hidden";
this.oDropList.style.display="";
}
var _50=0;
var _51=(this.oText.offsetWidth+this.oDropButton.offsetWidth-3);
var _52=0;
var c=this.rgOpts.length;
this.oDropList.style.width="1px";
if(this.oDropList.scrollWidth+18>_51){
_51=this.oDropList.scrollWidth+18;
}
for(var ix=0;ix<c;ix++){
var _55=this.rgOpts[ix];
if(_55.fVisible){
_50++;
if(!_52&&_55.oOpt){
_52=_55.oOpt.offsetHeight;
}
}
}
_51=Math.min(_51,windowWidthCorrected()-50);
this.oDropList.style.width=_51+"px";
if(this.fOffsetText&&this.pxWidthLast!=_51){
this.getPosition();
positionElement(this.oDropList,this.x,this.y);
}
this.pxWidthLast=_51;
_52*=_50;
if(!window.webkit){
this.oDropList.style.height=Math.min(_52,260)+"px";
}
if(this.fAboveText){
positionElement(this.oDropList,null,(this.pxTopText-this.oDropList.offsetHeight));
}
this.oDropList.scrollTop=0;
this.oDropList.scrollLeft=0;
if(_4f){
this.oDropList.style.display="none";
this.oDropList.style.visibility="visible";
}else{
this.scrollIntoView(this.rgOpts[this.ixSelected].oOpt);
}
};
this.updateList=function _updateList(_56){
this.deselectOpt(this.ixSelected);
this.oDropList.innerHTML="";
if(_56){
try{
this.reMatch=new RegExp("("+EscapeForRegExp(UnicodeClean(this.oText.value))+")","i");
}
catch(e){
this.reMatch=null;
}
}else{
this.reMatch=null;
}
var _57=this.rgOpts[this.ixSelected]?this.rgOpts[this.ixSelected].ixOriginal:null;
this.rgOpts.sort(this.sortHelper);
for(var ix=0;ix<this.rgOpts.length;ix++){
if(!this.rgOpts[ix].oOpt){
this.rgOpts[ix].oOpt=this.createOpt(this.rgOpts[ix]);
}
this.rgOpts[ix].oOpt.ix=ix;
if(this.rgOpts[ix].fVisible){
this.setOptInnerHTML(ix);
this.oDropList.appendChild(this.rgOpts[ix].oOpt);
}
if(_57!=null&&this.rgOpts[ix].ixOriginal==_57){
this.ixSelected=ix;
}
}
if(!_56&&this.rgOpts[this.ixSelected].fVisible){
this.selectOpt(this.ixSelected);
}else{
this.selectOpt(0);
}
this.refreshSize();
};
this.trueSelection=function _trueSelection(){
for(var ix=0;ix<this.rgOpts.length;ix++){
if(this.rgOpts[ix].ixOriginal==this.oSel.selectedIndex){
return ix;
}
}
return 0;
};
this.init();
}
var KEY_ARROW_LEFT=0;
var KEY_ARROW_RIGHT=1;
var KEY_ARROW_UP=2;
var KEY_ARROW_DOWN=3;
var KEY_ARROW_DOWN=4;
var KEY_PG_UP=5;
var KEY_PG_DOWN=6;
var rgArrowKeyMap={37:KEY_ARROW_LEFT,39:KEY_ARROW_RIGHT,38:KEY_ARROW_UP,40:KEY_ARROW_DOWN,34:KEY_PG_DOWN,33:KEY_PG_UP};
function getArrowKeyCode(e){
if(rgArrowKeyMap[getKeyCode(e)]!=null){
return rgArrowKeyMap[getKeyCode(e)];
}
return null;
}
function selectContents(o){
if(o.select){
o.select();
}else{
if(o.setSelectionRange){
o.setSelectionRange(0,o.value.length);
}
}
}
var DropListControl=new function(){
var _5c={};
var _5d=0;
this.initialize=function(){
this.refreshWithin(document.body);
};
this.refreshWithin=function _refreshWithin(_5e,_5f){
if(!_5e){
return;
}
var _60=XMLParser.getNodeArrayFrom(_5e,"select");
var _61=null;
for(var ix=0;ix<_60.length;ix++){
_61=this.refresh(_60[ix]);
}
if(_5f&&_61){
_61.focus();
}
};
this.refreshLast=function(){
var rg=document.getElementsByTagName("select");
if(rg.length){
DropListControl.refresh(rg[rg.length-1]);
}
};
this.refresh=function(_64){
if(!g_fDropListsEnabled){
return;
}
if(!_64){
return null;
}
if(!isTagName(_64,"select")&&!isTagName(_64,"input")){
return null;
}
if(isTagName(_64,"input")){
var _65=function(s){
this.value=s;
this.innerHTML=s;
this.textContent=DecodeHTMLEnt(s);
this.getAttribute=function(s){
return this[s];
};
};
if(_64.type!="text"){
return null;
}
if(arguments.length!=2){
return null;
}
var _68=arguments[1];
_64.fTextBox=true;
_64.options=[];
_64.selectedIndex=0;
_64.options[0]=new _65(UnicodeClean(_64.value));
for(var ix=0;ix<_68.length;ix++){
_64.options[ix+1]=new _65(_68[ix]);
}
}
if(hasClassName(_64,"nodroplist")){
_64.style.visibility="visible";
return null;
}
if(!_64.id){
_64.id="idSelectTemp_"+_5d++;
}
if(_5c[_64.id]&&!_5c[_64.id].isLegit){
return null;
}
if(_5c[_64.id]&&_5c[_64.id].isLegit()){
_5c[_64.id].refresh();
}else{
if(_5c[_64.id]){
_5c[_64.id].destroy();
this.unloadSingle(_5c[_64.id]);
}
_5c[_64.id]=new DropList(_64);
if(!_5c[_64.id].init){
_5c[_64.id]=null;
}
}
return _5c[_64.id];
};
this.restoreLastValue=function(_6a){
if(!_6a||!_6a.id||!_5c[_6a.id]){
return;
}
_5c[_6a.id].restoreLastValue();
};
this.unload=function(){
if(!window.ie6){
return;
}
for(var _6b in _5c){
this.unloadSingle(_5c[_6b]);
}
};
this.unloadSingle=function(o){
if(!window.ie6){
return;
}
if(!o||!o.oSel){
return;
}
o.oSel.focus=null;
o.oSel=null;
};
};
function DLCL(){
DropListControl.refreshLast();
}

