/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function() {if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B) {var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(_proxy_jslib_handle(A, 'value'));}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A) {this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A) {if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A) {if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A) {if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(F) {var E,A;try{A=new XMLHttpRequest();E={conn:A,tId:F};}catch(D){for(var B=0;B<this._msxml_progid.length;(B= _proxy_jslib_assign_rval('++', 'B', '', '', B))){try{A=new ActiveXObject(_proxy_jslib_handle(this._msxml_progid, (B)));E={conn:A,tId:F};break;}catch(C){}}}finally{return E;}},getConnectionObject:function(A) {var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A) {var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new _proxy_jslib_handle(Date().valueOf(), 'toString')();}_proxy_jslib_handle(D.conn, 'open')(F,C,true);if(this._use_default_xhr_header){if(!_proxy_jslib_handle(this._default_headers, ("X-Requested-With"))){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C) {var B;for(B in C.customevents){if(_proxy_jslib_handle(this._customEvents, (B))[0]){_proxy_jslib_assign('', A, (_proxy_jslib_handle(this._customEvents, (B))[0]), '=', (new YAHOO.util.CustomEvent(_proxy_jslib_handle(this._customEvents, (B))[1],(C.scope)?C.scope:null)));_proxy_jslib_handle(A, (_proxy_jslib_handle(this._customEvents, (B))[0])).subscribe(_proxy_jslib_handle(C.customevents, (B)));}}},handleReadyState:function(C,D) {var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){_proxy_jslib_assign('', this._timeOut, (C.tId), '=', (_proxy_jslib_handle(window, 'setTimeout')(function() {B.abort(C,D,true);},D.timeout)));}_proxy_jslib_assign('', this._poll, (C.tId), '=', (_proxy_jslib_handle(window, 'setInterval')(function() {if(C.conn&&C.conn.readyState===4){window.clearInterval(_proxy_jslib_handle(B._poll, (C.tId)));_proxy_jslib_assign('delete', (B._poll), (C.tId), '');if(D&&D.timeout){window.clearTimeout(_proxy_jslib_handle(B._timeOut, (C.tId)));_proxy_jslib_assign('delete', (B._timeOut), (C.tId), '');}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval)));},handleTransactionResponse:function(F,G,A) {var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G) {var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=_proxy_jslib_handle(F, (E)).indexOf(":");if(B!=-1){_proxy_jslib_assign('', I, (_proxy_jslib_handle(F, (E)).substring(0,B)), '=', (_proxy_jslib_handle(F, (E)).substring(B+2)));}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A) {var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C) {var B=(C)?this._default_headers:this._http_headers;_proxy_jslib_assign('', B, (A), '=', (D));if(C){this._has_default_headers=true;}else{this._has_http_headers=true;
}},setHeader:function(A) {var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,_proxy_jslib_handle(this._default_headers, (B)));}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,_proxy_jslib_handle(this._http_headers, (B)));}}_proxy_jslib_assign('delete', (this), ('_http_headers'), '');this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function() {_proxy_jslib_assign('delete', (this), ('_default_headers'), '');this._default_headers={};this._has_default_headers=false;},setForm:function(M,H,C) {var L,B,K,I,P,J=false,F=[],O=0,E,G,D,N,A;this.resetFormState();if(typeof M=="string"){L=(_proxy_jslib_handle(document, 'getElementById')(M)||document.forms[(M)]);}else{if(typeof M=="object"){L=M;}else{return ;}}if(H){this.createFrame(C?C:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=L;return ;}for(E=0,G=L.elements.length;E<G;(E= _proxy_jslib_assign_rval('++', 'E', '', '', E))){B=_proxy_jslib_handle(L.elements, (E));P=B.disabled;K=B.name;if(!P&&K){K=encodeURIComponent(K)+"=";I=encodeURIComponent(_proxy_jslib_handle(B, 'value'));switch(B.type){case"select-one":if(B.selectedIndex>-1){A=_proxy_jslib_handle(B.options, (B.selectedIndex));_proxy_jslib_assign('', F, (O++), '=', (K+encodeURIComponent((_proxy_jslib_handle(A.attributes, 'value')&&_proxy_jslib_handle(A.attributes, 'value').specified)?_proxy_jslib_handle(A, 'value'):A.text)));}break;case"select-multiple":if(B.selectedIndex>-1){for(D=B.selectedIndex,N=B.options.length;D<N;(D= _proxy_jslib_assign_rval('++', 'D', '', '', D))){A=_proxy_jslib_handle(B.options, (D));if(A.selected){_proxy_jslib_assign('', F, (O++), '=', (K+encodeURIComponent((_proxy_jslib_handle(A.attributes, 'value')&&_proxy_jslib_handle(A.attributes, 'value').specified)?_proxy_jslib_handle(A, 'value'):A.text)));}}}break;case"radio":case"checkbox":if(B.checked){_proxy_jslib_assign('', F, (O++), '=', (K+I));}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(J===false){if(this._hasSubmitListener&&this._submitElementValue){_proxy_jslib_assign('', F, (O++), '=', (this._submitElementValue));}else{_proxy_jslib_assign('', F, (O++), '=', (K+I));}J=true;}break;default:_proxy_jslib_assign('', F, (O++), '=', (K+I));}}}this._isFormSubmit=true;this._sFormData=F.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function() {this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A) {var B="yuiIO"+this._transaction_id;var C;if(YAHOO.env.ua.ie){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){_proxy_jslib_assign('', C, 'src', '=', ("javascript:false"));}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";_proxy_jslib_assign('', C.style, 'top', '=', ("-1000px"));C.style.left="-1000px";_proxy_jslib_handle(document.body, 'appendChild')(C);},appendPostData:function(A) {var D=[],B=A.split("&"),C,E;for(C=0;C<B.length;C++){E=_proxy_jslib_handle(B, (C)).indexOf("=");if(E!=-1){_proxy_jslib_assign('', D, (C), '=', (document.createElement("input")));_proxy_jslib_handle(D, (C)).type="hidden";_proxy_jslib_handle(D, (C)).name=decodeURIComponent(_proxy_jslib_handle(B, (C)).substring(0,E));_proxy_jslib_assign('', _proxy_jslib_handle(D, (C)), 'value', '=', (decodeURIComponent(_proxy_jslib_handle(B, (C)).substring(E+1))));_proxy_jslib_handle(this._formNode, 'appendChild')(_proxy_jslib_handle(D, (C)));}}return D;},uploadFile:function(D,N,E,C) {var I="yuiIO"+D.tId,J="multipart/form-data",L=_proxy_jslib_handle(document, 'getElementById')(I),O=this,K=(N&&N.argument)?N.argument:null,M,H,B,G;var A={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};_proxy_jslib_handle(this._formNode, 'setAttribute')("action",E);_proxy_jslib_handle(this._formNode, 'setAttribute')("method","POST");_proxy_jslib_handle(this._formNode, 'setAttribute')("target",I);if(YAHOO.env.ua.ie){_proxy_jslib_handle(this._formNode, 'setAttribute')("encoding",J);}else{_proxy_jslib_handle(this._formNode, 'setAttribute')("enctype",J);}if(C){M=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,K);if(D.startEvent){D.startEvent.fire(D,K);}if(N&&N.timeout){_proxy_jslib_assign('', this._timeOut, (D.tId), '=', (_proxy_jslib_handle(window, 'setTimeout')(function() {O.abort(D,N,true);},N.timeout)));}if(M&&M.length>0){for(H=0;H<M.length;H++){this._formNode.removeChild(_proxy_jslib_handle(M, (H)));}}for(B in A){if(YAHOO.lang.hasOwnProperty(A,B)){if(_proxy_jslib_handle(A, (B))){_proxy_jslib_handle(this._formNode, 'setAttribute')(B,_proxy_jslib_handle(A, (B)));}else{this._formNode.removeAttribute(B);}}}this.resetFormState();var F=function() {if(N&&N.timeout){window.clearTimeout(_proxy_jslib_handle(O._timeOut, (D.tId)));_proxy_jslib_assign('delete', (O._timeOut), (D.tId), '');}O.completeEvent.fire(D,K);if(D.completeEvent){D.completeEvent.fire(D,K);}G={tId:D.tId,argument:N.argument};try{G.responseText=L.contentWindow.document.body?_proxy_jslib_handle(L.contentWindow.document.body, 'innerHTML'):L.contentWindow.document.documentElement.textContent;G.responseXML=L.contentWindow.document.XMLDocument?L.contentWindow.document.XMLDocument:L.contentWindow.document;}catch(P){}if(N&&N.upload){if(!N.scope){N.upload(G);}else{N.upload.apply(N.scope,[G]);}}O.uploadEvent.fire(G);if(D.uploadEvent){D.uploadEvent.fire(G);}YAHOO.util.Event.removeListener(L,"load",F);_proxy_jslib_handle(null, 'setTimeout', setTimeout)(function() {document.body.removeChild(L);O.releaseObject(D);},100);};YAHOO.util.Event.addListener(L,"load",F);},abort:function(E,G,A) {var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(_proxy_jslib_handle(this._poll, (E.tId)));_proxy_jslib_assign('delete', (this._poll), (E.tId), '');if(A){window.clearTimeout(_proxy_jslib_handle(this._timeOut, (E.tId)));_proxy_jslib_assign('delete', (this._timeOut), (E.tId), '');}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=_proxy_jslib_handle(document, 'getElementById')(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(_proxy_jslib_handle(this._timeOut, (E.tId)));_proxy_jslib_assign('delete', (this._timeOut), (E.tId), '');}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B) {if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return _proxy_jslib_handle(document, 'getElementById')(A)?true:false;}else{return false;}}},releaseObject:function(A) {if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.6.0",build:"1321"}); ;
_proxy_jslib_flush_write_buffers() ;