(function(){if(!window.btc){var A=String.prototype;if(!A.trim)A.trim=function(){for(var b=this.replace(/^\s\s*/,""),c=b.length;/\s/.test(b.charAt(--c)););return b.slice(0,c+1)};A.sanitize=function(){return this.replace(/&/g,"&amp;").replace(/&amp;amp;/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};A.unescapeHTML=function(){var b=document.createElement("textarea");b.innerHTML=this;return b.value};var f=window.btc={},C=/\.parentweb\.com$/i.test(location.host)?
"https://user.parentweb.com/":"https://user.brillkids.com/",G=C=="https://user.parentweb.com/"?"https://user.brillkids.com/":"https://user.parentweb.com/",D=document.getElementsByTagName("head")[0]||document.documentElement.insertBefore(document.createElement("head"),document.documentElement.firstChild),u=document.body||document.documentElement.insertBefore(document.createElement("body"),document.documentElement.firstChild);(f.config=function(b){_conf=f.conf||{requiredMember:document.getElementById("requiredMember"),
URL_JS_SSO:"//brillkids.appspot.com/js/sso-0303.js",URL_JS_FRAMETALK:"//brillkids.appspot.com/js/frametalk-0119.js",URL_JS_VALIDATE:"//brillkids.appspot.com/js/validation-02171.js",URL_JS_LOC:"//brillkids.appspot.com/js/loc-1226.js",URL_SSO_CORE:G+"sso-core.php",URL_MIGRATE:G+"migrate.php",URL_REGISTER:C+"register.php",URL_SIGNIN:C+"sso-index.php"};for(var c in b)_conf[c]=b[c];f.conf=_conf})();f.browser={ie:document.all,safari:window.devicePixelRatio&&window.getMatchedCSSRules&&!window.Opera&&!!window.getMatchedCSSRules(document.documentElement,
""),firefox:/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)};f.support={postMessage:window.postMessage!==undefined};f.throwErr=function(b){f._status.showError(b)};f.el=function(b,c){if(!b)return b;var a=b.nodeType?b:document.getElementById(b);if(c)return a;if(a&&!a.btcInit){a.btcInit=1;if(!a.addEventListener&&a.attachEvent)a.addEventListener=function(d,e){a.attachEvent("on"+d,e)};a.show=function(d){d=d||{};if(d.immediate){a.style.display="";d.onCompletion&&d.onCompletion.call(a);return a}return a.fade(0,
d.opacity||1,d.millisec,function(){d.onCompletion&&d.onCompletion.call(a);a.style.display=""})};a.hide=function(d){d=d||{};if(d.immediate){a.style.display="none";d.onCompletion&&d.onCompletion.call(a);return a}return a.fade(1,d.opacity||0,d.millisec,null,function(){d.onCompletion&&d.onCompletion.call(a);a.style.display="none"})};a.toggle=function(d){d=d||{};if(a.style.display=="none"){d.onShow&&d.onShow();a.show(d)}else{d.onHide&&d.onHide();a.hide(d)}return a};a.empty=function(d){if(d)a.parentNode.removeChild(a);
else for(;a.firstChild;)a.removeChild(a.firstChild);return a};a.setInnerText=function(d){a.innerHTML=d.sanitize();return a};a.setOpacity=function(d){var e=a.style;e.opacity=d;e.MozOpacity=d;e.KhtmlOpacity=d;e.filter="alpha(opacity="+d*100+");";return a};a.fade=function(d,e,g,h,k){if(0===g){h&&h(a);a.setOpacity(e);k&&k.call(a)}else{g=300;var j=a.style,i=(e-d)/(0.025*g);j.opacity=d;h&&h.call(a);for(d=0;d<g;d+=40)setTimeout(function(){a.setOpacity(parseFloat(j.opacity)+i)},d);setTimeout(function(){a.setOpacity(e);
k&&k.call(a)},g+20)}return a};a.getClassNames=function(){var d=a.className;return d?d.split(" "):[]};a.addClass=function(d){if(!d)return a;d=d.trim();if(RegExp("\\b"+d+"\\b").test(a.className))return a;a.className+=" "+d;return a};a.removeClass=function(d){if(!d)return a;d=d.trim();a.className=a.className.split(RegExp("\\b"+d+"\\b")).join(" ");return a}}return a};f.ce=function(b,c,a){b=document.createElement(b);var d;if(c)if(typeof c=="string")b.innerHTML=c;else(function(g,h){if(typeof h!="object")return h;
for(var k in h)if(k=="onload"&&f.browser.ie)g.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete")h.onload.call(this)};else try{d=arguments.callee(g[k],h[k]);k=="name"&&g.setAttribute(k,h[k]);if(k!="style")g[k]=d}catch(j){}})(b,c);if(a){if(a.nodeType)a=d=[a];for(var e in a)if(d=a[parseInt(e)])b.appendChild(d)}return b};f.css=function(b){var c=f.browser,a=f.ce("style",{type:"text/css"});if(c.ie)a.styleSheet.cssText=b;else try{try{a.innerText=b;a.innerHTML=b}catch(d){a.innerHTML=
b}}catch(e){}return D.appendChild(a)};f._jsrun=function(b,c,a,d){var e=function(i){if(c)if(document.all){if(!i.onCompletion)i.onCompletion=[];if(!i._ready)i._ready=function(){return this.readyState=="loaded"||this.readyState=="complete"};if(i._ready())window.setTimeout(c,1);else{i.onCompletion.push(c);if(i.onreadystatechange===null)i.onreadystatechange=function(){if(this._ready()){for(;c=i.onCompletion.shift();)window.setTimeout(c,1);this.onreadystatechange=null}}}}else if(i._loaded)window.setTimeout(c,
1);else{var l=i.onload;i.onload=function(){this._loaded=1;l&&window.setTimeout(l,1);window.setTimeout(c,2)}}};if(!a){a=D;if(b&&b.id)for(var g=b.id,h=a.getElementsByTagName("script"),k=0,j;j=h[k];k++)if(j.id==g){e(j);return}}b=b||{};if(!b.type)b.type="text/javascript";j=f.ce("script",b);e(j);if(d)return j;return a.appendChild(j)};f.jseval=function(b,c,a,d,e){return this._jsrun({text:b,id:a},c,d,e)};f.jsload=function(b,c,a,d,e){return this._jsrun({src:b,id:a||b},c,d,e)};f.queryEncode=function(b,c,a){var d=
a||[],e,g;for(g in b){e=b[g];g=encodeURIComponent(g);if(e)if(typeof e=="object"){d.push(g+"=1");f.queryEncode(e,c,d)}else d.push(g+"="+encodeURIComponent(e))}return a?true:d.join(c||"&")};f.queryDecode=function(b,c){for(var a={},d=b.replace(/^#|\?/,"").split(c||"&"),e=null,g=0;e=d[g];g++){e=e.split("=");a[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return a};f.getCookie=function(b){if(b=document.cookie.match(RegExp(".*;?"+b+"=([^;]+).*"))){b=b[1];for(var c,a,d,e=[],g=b.length,h=0;c=b.charAt(h);++h){if(c==
"+")c=" ";else if(c=="%"&&h+2<g){a=parseInt(b.charAt(h+1),16);d=parseInt(b.charAt(h+2),16);if(a>=0&&d>=0){c="&#"+(a*16+d)+";";h+=2}}e.push(c)}return e.join("")}else return""};f.setHash=function(b){var c=document.documentElement,a=b.substring(1);c=f.ce("a",{id:a,name:a,style:{position:"absolute",left:(u.scrollLeft||c.scrollLeft)+"px",top:(u.scrollTop||c.scrollTop)+"px",width:0,height:0}});u.insertBefore(c,u.firstChild);location.hash=b;u.removeChild(c)};f.ajax=function(b,c,a){a||(a={});b=b||"";c=c||
{};var d=(a.method||"GET").toUpperCase(),e=a.onCompletion,g=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest,h=false!==a.async;this.send=function(){if(!a.noNonce)c.rnd=(new Date).getTime();var k=b,j=f.queryEncode(c);if(d=="GET"){if(b.indexOf("?")!==-1)k+="&"+j;else if(j)k+="?"+j;j=null}g.open(d,k,h);if(d=="POST")try{g.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(i){}h&&(g.onreadystatechange=function(){if(g.readyState==4){var l=f.el(a.target),
m=g.status,q=g.responseText.substr(0,9)=="while(1);"?g.responseText.substring(9):g.responseText;if(m>=200&&m<300||m==304||m==1223){var o=function(){e&&e.call(g,q,g)};if(l){l.innerHTML=q;window.setTimeout(function(){var n=l.getElementsByTagName("style"),r=0;n=l.getElementsByTagName("style");for(var s;s=n[r];r++)D.appendChild(s);n=l.getElementsByTagName("script");r=null;var w=function(p,t){return{_old:p,_new:p.src?f.jsload(p.src,t,p.id,p.parentNode,true):f.jseval(p.innerHTML,t,p.id,p.parentNode,true),
_isEval:!p.src}},y=function(p){if(p){var t=p._old,x=p._new;t.parentNode?t.parentNode.replaceChild(x,t):u.appendChild(x);if(p._isEval)if(x.onload)x.onload();else x.onreadystatechange&&x.onreadystatechange()}},z=function(p,t){if(p[t]&&p[t+1]){var x=z(p,t+1);return w(p[t],function(){y(x)})}else if(p[t]&&!p[t+1])return w(p[t],o);return null};(r=z(n,0))?y(r):o.call(g);g=null},1);return}else o.call(g)}else m!=0&&f.throwErr("Ajax Error: ["+g.status+"]");g=null}});g.send(j);g&&!h&&e&&e.call(g,g.responseText.substr(0,
9)=="while(1);"?g.responseText.substring(9):g.responseText,g)}};f.get=function(b,c,a,d,e){a=a||{};a["class"]=b;a["function"]=c;e=e||{};if(e.returnType=="json")a.returnType="json";e.onCompletion=a.returnType=="json"?function(g,h){d&&d.call(h,f.parseJSON(g),h)}:d;(new this.ajax(f.conf.URL_EXEC||"/execute.php",a,e)).send()};f.getForm=function(b,c,a,d,e){e=e||{};e.target=b;var g=e.status||f._status;e.onCompletion=function(h,k){d&&d.call(k,h,k);g.hide()};if(c.indexOf("/")!=0&&c.indexOf("http://")!=0&&
c.indexOf("https://")!=0){a=a||{};a.form=c;c=f.conf.URL_GETFORM||"/getform.php"}g.showLoading();(new this.ajax(c,a,e)).send()};f.parseJSON=function(b,c){var a=window.JSON;if(a&&a.parse)try{return a.parse(b,c)}catch(d){return{failed:"json-parse-err"}}else{a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;a.lastIndex=0;if(a.test(b))b=b.replace(a,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+b+")");return{failed:"json-parse-err"}}};f.getJSON=function(b,c,a,d,e){a=a||{};a.returnType="json";f.get(b,c,a,d,e)};f.sso={isGuest:function(){return(this.user=f.getCookie("u"))==""},login:function(b,c){c=c||{};if(!b&&!this.isGuest()){f._status.show("You have already logged in!");if(f.sso.forceRefresh)return location.reload();this.init();this.onLogin&&this.onLogin.call(this);
return this}this.popup?this.popup.show():(this.popup=new f.popup({id:"sso_signinup"})).destroy().showForm("/user/sso-signinup.php",c.param||{},c.email?function(){el("login_username",1).value=c.email}:null,null,400)},logout:function(){var b=this,c=f._status,a=function(){f.get("sso","logout",null,function(){b.init();b.onLogout&&b.onLogout();if(f.sso.forceRefresh)return location.reload();c.hide()})};c.showLoading();f.getCookie("m")&&!window.opera?f.jsload(f.conf.URL_JS_FRAMETALK,function(){(new f.frameTalk(f.conf.URL_SSO_CORE)).connect(function(){this.post("logout",
{"class":"sso","function":"logout"},a)})}):a()},verify:function(){this.isGuest()&&location.replace(f.conf.URL_SIGNIN+"?HTTP_REFERER="+encodeURIComponent(location.href))},init:function(b){b=b||{};f.conf.requiredMember&&this.verify();var c=this,a=f.el,d=a("sso_guest"),e=a("sso_member");doInit=function(){var g;if(c.user=f.getCookie("u")){if(d&&e){d.className="";e.className="display"}if(g=a("sso_nickname"))g.innerHTML=c.user;if(!c._iM){c._iM=1;if(g=a("sso_logout"))g.onclick=function(){f.sso.logout();
return false}}}else{if(d&&e){e.className="";d.className="display"}if(!c._iG){c._iG=1;if(g=a("sso_popup"))g.onclick=function(){window.opera?top.location.replace(f.conf.URL_SIGNIN+"?HTTP_REFERER="+encodeURIComponent(window.location.href)):c.login();return false}}}};if(b.defer&&!d)window.onload=function(){doInit()};else doInit();return this}};f.sso.init({defer:1});f.validation=function(b,c,a){b=f.el(b);if(!b)return f.throwErr("Validation Error: Cannot reference form.");if(c){if(false!==c.onlyOnSubmit)c.onlyOnSubmit=
true;if(c.onFormValidate)b.onsubmit=function(){return c.onFormValidate.call(b,true,this)};if(c.onElementValidate){c.onValid=function(){c.onElementValidate(true,this)};c.onInvalid=function(){c.onElementValidate(false,this)}}}else c={onlyOnSubmit:true};var d=function(){var e=LiveValidationForm.getInstance(b);e.automate(c);a&&a.call(e,e)};if(window.LiveValidationForm)d();else{f.css(c.styles||".btc_vld_pass{display:none;background:#093}.btc_vld_fail{background:#C36}.btc_vld_msg{color:#FFF;padding:3px;font-size:10px}");
f.jsload(f.conf.URL_JS_VALIDATE,d,"btc_validation")}};f.validation.add=function(b,c,a){var d=function(){c=c||{};if(!c.onlyOnce||c.ruleClassName)c.ruleClassName="rule"+parseInt(Math.random()*1E6);if(c.onlyOnce||false===c.onlyOnSubmit)c.onlyOnSubmit=true;var e=(new LiveValidation(b,c)).add(Validate.Custom,c);e.validate();a&&a.call(e,e)};typeof LiveValidation=="undefined"?f.jsload(f.conf.URL_JS_VALIDATE,d,"btc_validation"):d()};f.validation.addMany=function(b,c){var a=function(){LiveValidationForm.getInstance(f.el(b)).addAutoRules(c)};
typeof LiveValidation=="undefined"?f.jsload(f.conf.URL_JS_VALIDATE,a,"btc_validation"):a()};f.validation.addJSON=function(b,c,a,d,e){d=d||{};var g=f.el(b);b=g.form;var h=new LiveValidation(g,{onlyOnSubmit:true}),k=h.validate;h.validate=function(){if(k.call(this)){var i={},l=d.param||{},m=g.value.trim(),q,o=d.whitelist,n=d.validMessage,r=d.failureMessage;g.value=m;h.validations=[];if(n)i.validMessage=typeof n=="function"?n(m):n;if(r)i.failureMessage=typeof r=="function"?r(m):r;var s=function(w){i.against=
function(y){return y!=m?true:true===w.success};f.validation.add(g,i,function(y){e&&e.call(y,y,m,w)})};if(m==""&&g.className.indexOf("required")===-1||o&&(o[m]||typeof o=="function"&&o()[m])){s({success:true});return true}l[g.id||g.name]=m;f.getJSON(c,a,l,function(w){s(q=w)},{async:false});return q.success===true}return false};if(b){var j=b.onsubmit;b.onsubmit=function(i){return h.validate()&&j.call(this,i||event)}}return h};f.submitForm=function(b,c,a,d,e,g){g=g||{};g.method="POST";var h=g.status||
f._status,k=g.param||{};a=f.el(a);h.showLoading();if(a){var j=function(i,l){for(var m=0,q=0,o,n,r=a.getElementsByTagName(i);n=r[m];m++){o=n.name;if(!(o==""||l&&l(n))){if(o.indexOf("[")>1&&o.lastIndexOf("]")==o.length-1)o=o.replace(/\[\]/g,"["+q++ +"]");k[o]=n.value}}};j("input",function(i){return(i.type=="radio"||i.type=="checkbox")&&!i.checked});j("select");j("textarea")}f.get(b,c,k,function(i,l){h.showResponse(i,d);e&&e.call(l,i,l)},g)};var H=function(b,c){var a=(b.type=="checkbox"?b.name.replace("[]",
""):b.name).toLowerCase();if(a=c[a])if(b.type=="radio"||b.type=="checkbox"){b.checked=false;if(typeof a==="object")for(var d=0,e;e=a[d];d++){if(e==b.value){b.checked=true;b.onchange&&b.onchange();break}}else if((b.checked=a==b.value)&&b.onchange)b.onchange()}else{b.value=a;b.onchange&&b.onchange()}},I=function(b,c){var a=c[b.name];if(a){if(1>=b.size)b.value=a;else if(typeof a=="object"){for(var d={},e=0,g;g=a[e];e++)d[g]=true;for(e=0;a=b.options[e];e++)if(a=d[a.value])sfo.selected=a}b.onchange&&b.onchange()}};
f._autoFillLast={};f.autoFill=function(b,c,a){a=a||{};var d=f.el;b=d(b);var e;if(b){if(a.field){if(!(e=d(a.field)))return this;c=this._autoFillLast[b.id]}else this._autoFillLast[b.id]=c;if(c&&typeof c=="object")if(e)switch(e.tagName.toLowerCase()){case "input":H(e,c);break;case "select":I(e,c)}else{a=b.getElementsByTagName("input");d=b.getElementsByTagName("select");for(b=0;e=a[b];b++)H(e,c);for(b=0;e=d[b];b++)I(e,c)}}return this};f.autoFillField=function(b){b=f.el(b);return f.autoFill(b.form,null,
{field:b})};var E=".btc_pp_cover{position:absolute;top:0;left:0;width:100%;height:100%;background:#AAA;z-index:199;opacity:0.6;filter:alpha(opacity=60)} .btc_pp{margin:10px 0;position:absolute;top:10px;left:50%;width:360px;z-index:200} .btc_pp table{width:100%;height:100%;border-spacing:0;border-collapse:collapse} .btc_pp table table{height:auto;border-spacing:3px;border-collapse:separate} .btc_pp tr,.btc_pp td, .btc_pp .body iframe{border:0;padding:0;margin:0} .btc_pp .tl,.btc_pp .tm,.btc_pp .tr,.btc_pp .bl,.btc_pp .bm,.btc_pp .br{height:35px} .btc_pp .tl,.btc_pp .tr,.btc_pp .bl,.btc_pp .br,.btc_pp .ml,.btc_pp .mr{width:35px;background:transparent url(//brillkids.appspot.com/i/popup1.png) no-repeat 0 0} .btc_pp .tm,.btc_pp .bm{background:transparent url(//brillkids.appspot.com/i/popup0.png) repeat-x 0 0} .btc_pp .ml,.btc_pp .mr{background-repeat:repeat-y} .btc_pp .tl{background-position:-4px -3px} .btc_pp .tm{background-position:0 0} .btc_pp .tr{background-position:-65px -3px;cursor:pointer} .btc_pp .ml{background-position:-103px 0} .btc_pp .mr{background-position:-124px 0} .btc_pp .bl{background-position:-4px -63px} .btc_pp .bm{background-position:0 -36px} .btc_pp .br{background-position:-65px -63px} .btc_pp .body{vertical-align:top;background:#FFF}";
f.popup=function(b){b=b||{};b.immediate=b.immediate||(document.all?1:0);var c=f.el,a=this,d=b.placeHolder||u;this.setInnerText=function(e){return this._setInnerHTML(e.sanitize())};this._setInnerHTML=function(e){var g=c(this.body);if(g)typeof e=="function"?e(g):g.innerHTML=e;return this};this.destroy=function(){var e=c(b.id||this._elm);if(e){e.parentNode.removeChild(e);if(e=f.el(e.id+"_cover"))e.parentNode.removeChild(e)}return this};this.show=function(e,g,h,k){var j=a._elm=c(b.id||a._elm);if(!d)return a;
k=k||{};if(j){j.show({immediate:b.immediate});if(!b.noAutoPosition)j.style.top=(document.documentElement.scrollTop||u.scrollTop)+"px";(g=f.el(this._cover||j.id+"_cover"))&&g.show({opacity:0.6,immediate:true});return this}if(b.styles)f.css(b.styles);else if(E){f.css(E);E=""}j=f.ce;var i=b.id||"btc_pp"+(new Date).getTime();e=this.body=e&&e.nodeType?j("td",{className:"body"},e):j("td",{className:"body",innerHTML:e});k.display="none";if(g)k.width=isNaN(g)&&g.indexOf("%")>0?g:g+70+"px";if(h)k.height=isNaN(h)&&
h.indexOf("%")>0?h:h+70+"px";if(!b.noAutoPosition){k.top=(document.documentElement.scrollTop||u.scrollTop)+"px";if(g)k.marginLeft=parseInt(parseInt(k.width)/-2)+"px"}a._elm=d.appendChild(j("div",{id:i,className:b.className||"btc_pp",style:k},j("table",null,j("tbody",null,[j("tr",null,[j("td",{className:"tl"}),j("td",{className:"tm"}),j("td",{className:"tr",onclick:a.hide})]),j("tr",null,[j("td",{className:"ml"}),e,j("td",{className:"mr"})]),j("tr",null,[j("td",{className:"bl"}),j("td",{className:"bm"}),
j("td",{className:"br"})])]))));if(!b.noCover)this._cover=u.appendChild(j("div",{id:i+"_cover",className:"btc_pp_cover",style:{display:"none",height:Math.max(document.documentElement.clientHeight,u.scrollHeight)+"px"}}));if(b.hide)b.hide=false;else this.show();return this};this.hide=function(e){var g=this._elm=c(b.id||this._elm),h;if(g){(h=b.onHide)&&h.call(a,e);g.hide({immediate:b.immediate});if(h=f.el(g.id+"_cover"))h.hide({immediate:1})}return this};this.showForm=function(e,g,h,k,j,i){if(this._elm=
c(b.id||this._elm))return this.show();if(g&&!isNaN(g)){j=g;g=null;if(!isNaN(h)){i=h;h=null}}this.show('<div class="btc_loading">Loading...</div>',j,i);f.getForm(this.body,e,g,h,k);return this}};f.status=function(b){b=b||{};var c=[],a=b.id,d=b.immediate||false,e=f.el(a);if(!e){e=u.insertBefore(f.ce("div"),u.firstChild);e=(new f.popup({id:a,placeHolder:e,styles:b.styles||".btc_status{position:absolute;width:100%;z-index:201}.btc_status table{border:0;border-collapse:collapse;margin:0 auto}.btc_status .body{background:#FFF1A8;font-size:small;text-align:center;padding:3px 10px;-moz-border-radius:2px}.btc_status .close{cursor:pointer;padding-left:10px;color:#999}",
noCover:true,hide:true,immediate:d,className:"btc_status"})).show()}this.show=function(g,h){clearTimeout(this.t1);clearTimeout(this.t2);e.setInnerText(g.trim());c.length==0&&e.show({immediate:d});c.push(1);if(!h){var k=this;this.t2=setTimeout(function(){k.hide(1)},7500)}return this};this.showLoading=function(){this.show("Loading...");var g=this;this.t1=setTimeout(function(){e._setInnerHTML(function(h){h.innerHTML="Please wait a little bit longer...";h.appendChild(f.ce("span",{className:"close",innerHTML:"x",
onclick:function(){g.hide(1)}}))})},3500);return this};this.showError=function(g){this.show("Oops! Error Occurred. Please try again later.");f.debug&&this.show(location.host+": "+g,1)};this.showResponse=function(g,h){if(h)this.show(g.success||g=="SUCCESSFUL"?h:"Sorry, error occurred!");return this};this.hide=function(g){clearTimeout(this.t2);if(!g&&c.length>1){c.pop();return this}c=[];clearTimeout(this.t1);e&&e.hide();return this}};if(f.__defineGetter__){var J;f.__defineGetter__("_status",function(){f.__defineGetter__("_status",
function(){return J});return J=new f.status({id:"btc_status"})})}else f._status=new f.status({id:"btc_status"});f.tabs=function(b,c){var a=f.el,d=a(b),e,g=this;if(d&&(e=d.getElementsByTagName("ul")[0])){if(d._tabs)return d._tabs.select(d._tabs._selected,true);else d._tabs=this;this.options=c=c||{};c.level=parseInt(c.level)||1;for(var h=e.getElementsByTagName("li"),k=0,j;j=h[k];k++)if(j=j.getElementsByTagName("a")[0])if(!j.href.match("^#|javascript:")){j._oldOnClick=j.onclick||function(){};j.onclick=
function(i){i&&i.preventDefault();this._oldOnClick.call(this);var l=this.getAttribute("href",2),m=location,q=l.indexOf("#");if(l.indexOf(m.protocol+"//")===0){l=q>0&&l.substring(0,q)==m.href.substring(0,m.href.indexOf("#"))?l.substring(q):l.replace(RegExp("^"+m.protocol+"//"+m.host,"i"),"");if(l.indexOf("/#")===0)l=l.substring(1);q=l.indexOf("#")}var o=this,n=l.substring(q+1);i=n.split("/")[c.level-1];var r=o.parentNode,s=a(n)||a(i);i=a(o.title||e.title,1)||d;if(!this._forceReload&&r&&/\bselected\b/.test(r.className))return this._forceReload=
false;var w=function(){var z=r.parentNode._selTab,p={immediate:1,onCompletion:function(){this.removeClass("selected")}};if(z){a(z.parentNode).removeClass("selected");a(z).removeClass("selected")}a(r).addClass("selected");a(o).addClass("selected");r.parentNode._selTab=o;if(s){z=s.parentNode;if(z._selContent)a(z._selContent).hide(p);else for(var t=0,x=s.parentNode.childNodes,B;B=x[t];t++)B.tagName&&"div"==B.tagName.toLowerCase()&&a(B).hide(p);s.show({immediate:1,onCompletion:function(){s.addClass("selected")}});
if(q>=0&&c.setHash&&m.hash.indexOf(n+"/")!==1){f.tabs_hash=g._selected="#"+n;if(m.hash.substring(1).indexOf("#")&&m.hash.indexOf(f.tabs_hash)===0)m.hash=m.hash;else f.setHash(f.tabs_hash)}z._selContent=s;c.show&&c.show(s)}},y=function(){f.getForm(s,l.substring(0,q),null,function(){w();c.load&&c.load(s)})};if(q===0)w();else if(s)c.cache||y();else{s=i.appendChild(f.ce("div",{id:n,className:"tabL"+c.level+" selected"}));y()}return false}}(this.select=function(i,l){f.tabs_hash=location.hash;var m=e.getElementsByTagName("li"),
q=typeof i=="string"&&i.indexOf("#")===0?i:location.hash,o=q.split("/").length||1;if(c.level<=o&&q.length>1&&(!i||typeof i=="string"&&i.indexOf("#")===0)){o=0;for(var n,r;n=m[o];o++)if((n=n.getElementsByTagName("a")[0])&&(r=n.getAttribute("href",2))&&q.indexOf(r.substring(r.indexOf("#")))===0){n._forceReload=l;n.onclick.call(n);if(q.substring(1).indexOf("#"))location.hash=q;return this}}i=parseInt(i)||0;if(m[i]&&(i=m[i].getElementsByTagName("a")[0])){i._forceReload=l;i.onclick.call(i)}return this})(c.selected,
false)}};var F="div.btc_pp{cursor:default;top:auto;left:auto;font-size:11px;font-weight:normal;margin-top:-70px}.btc_info div.btc_pp .body{text-align:left}";f.info=function(b,c){c=c||{};if(F){f.css(F);F=""}var a=f.el(this),d;d=a._btc_info_id||(a._btc_info_id="btc_info"+(new Date).getTime());(new f.popup({id:d,noCover:1,noAutoPosition:1,placeHolder:a,onHide:function(e){(e||window.event).cancelBubble=true}})).show((c.noInnerHTML?"":"<h3>"+a.innerHTML.sanitize()+"</h3>")+(c.desc||a.title),b||300,c.height)}}})();
var el=btc.el,v=function(A){return(A=document.getElementById(A))?A.value:A};
