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:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),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(B){this._msxml_progid.unshift(B)
},setDefaultPostHeader:function(B){if(typeof B=="string"){this._default_post_header=B
}else{if(typeof B=="boolean"){this._use_default_post_header=B
}}},setDefaultXhrHeader:function(B){if(typeof B=="string"){this._default_xhr_header=B
}else{this._use_default_xhr_header=B
}},setPollingInterval:function(B){if(typeof B=="number"&&isFinite(B)){this._polling_interval=B
}},createXhrObject:function(H){var J,G,L;
try{G=new XMLHttpRequest();
J={conn:G,tId:H,xhr:true}
}catch(K){for(L=0;
L<this._msxml_progid.length;
++L){try{G=new ActiveXObject(this._msxml_progid[L]);
J={conn:G,tId:H,xhr:true};
break
}catch(I){}}}finally{return J
}},getConnectionObject:function(E){var G,F=this._transaction_id;
try{if(!E){G=this.createXhrObject(F)
}else{G={tId:F};
if(E==="xdr"){G.conn=this._transport;
G.xdr=true
}else{if(E==="upload"){G.upload=true
}}}if(G){this._transaction_id++
}}catch(H){}return G
},asyncRequest:function(I,L,J,H){var K,M,N=(J&&J.argument)?J.argument:null;
if(this._isFileUpload){M="upload"
}else{if(J.xdr){M="xdr"
}}K=this.getConnectionObject(M);
if(!K){return null
}else{if(J&&J.customevents){this.initCustomEvents(K,J)
}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(K,J,L,H);
return K
}if(I.toUpperCase()=="GET"){if(this._sFormData.length!==0){L+=((L.indexOf("?")==-1)?"?":"&")+this._sFormData
}}else{if(I.toUpperCase()=="POST"){H=H?this._sFormData+"&"+H:this._sFormData
}}}if(I.toUpperCase()=="GET"&&(J&&J.cache===false)){L+=((L.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString()
}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true)
}}if((I.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header)
}if(K.xdr){this.xdr(K,I,L,J,H);
return K
}K.conn.open(I,L,true);
if(this._has_default_headers||this._has_http_headers){this.setHeader(K)
}this.handleReadyState(K,J);
K.conn.send(H||"");
if(this._isFormSubmit===true){this.resetFormState()
}this.startEvent.fire(K,N);
if(K.startEvent){K.startEvent.fire(K,N)
}return K
}},initCustomEvents:function(D,E){var F;
for(F in E.customevents){if(this._customEvents[F][0]){D[this._customEvents[F][0]]=new YAHOO.util.CustomEvent(this._customEvents[F][1],(E.scope)?E.scope:null);
D[this._customEvents[F][0]].subscribe(E.customevents[F])
}}},handleReadyState:function(G,F){var H=this,E=(F&&F.argument)?F.argument:null;
if(F&&F.timeout){this._timeOut[G.tId]=window.setTimeout(function(){H.abort(G,F,true)
},F.timeout)
}this._poll[G.tId]=window.setInterval(function(){if(G.conn&&G.conn.readyState===4){window.clearInterval(H._poll[G.tId]);
delete H._poll[G.tId];
if(F&&F.timeout){window.clearTimeout(H._timeOut[G.tId]);
delete H._timeOut[G.tId]
}H.completeEvent.fire(G,E);
if(G.completeEvent){G.completeEvent.fire(G,E)
}H.handleTransactionResponse(G,F)
}},this._polling_interval)
},handleTransactionResponse:function(M,P,K){var T,N,R=(P&&P.argument)?P.argument:null,L=(M.r&&M.r.statusText==="xdr:success")?true:false,Q=(M.r&&M.r.statusText==="xdr:failure")?true:false,O=K;
try{if((M.conn.status!==undefined&&M.conn.status!==0)||L){T=M.conn.status
}else{if(Q&&!O){T=0
}else{T=13030
}}}catch(S){T=13030
}if((T>=200&&T<300)||T===1223||L){N=M.xdr?M.r:this.createResponseObject(M,R);
if(P&&P.success){if(!P.scope){P.success(N)
}else{P.success.apply(P.scope,[N])
}}this.successEvent.fire(N);
if(M.successEvent){M.successEvent.fire(N)
}}else{switch(T){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:N=this.createExceptionObject(M.tId,R,(K?K:false));
if(P&&P.failure){if(!P.scope){P.failure(N)
}else{P.failure.apply(P.scope,[N])
}}break;
default:N=(M.xdr)?M.response:this.createResponseObject(M,R);
if(P&&P.failure){if(!P.scope){P.failure(N)
}else{P.failure.apply(P.scope,[N])
}}}this.failureEvent.fire(N);
if(M.failureEvent){M.failureEvent.fire(N)
}}this.releaseObject(M);
N=null
},createResponseObject:function(M,P){var J={},N={},R,K,Q,L;
try{K=M.conn.getAllResponseHeaders();
Q=K.split("\n");
for(R=0;
R<Q.length;
R++){L=Q[R].indexOf(":");
if(L!=-1){N[Q[R].substring(0,L)]=YAHOO.lang.trim(Q[R].substring(L+2))
}}}catch(O){}J.tId=M.tId;
J.status=(M.conn.status==1223)?204:M.conn.status;
J.statusText=(M.conn.status==1223)?"No Content":M.conn.statusText;
J.getResponseHeader=N;
J.getAllResponseHeaders=K;
J.responseText=M.conn.responseText;
J.responseXML=M.conn.responseXML;
if(P){J.argument=P
}return J
},createExceptionObject:function(J,N,I){var L=0,K="communication failure",O=-1,P="transaction aborted",M={};
M.tId=J;
if(I){M.status=O;
M.statusText=P
}else{M.status=L;
M.statusText=K
}if(N){M.argument=N
}return M
},initHeader:function(E,F,G){var H=(G)?this._default_headers:this._http_headers;
H[E]=F;
if(G){this._has_default_headers=true
}else{this._has_http_headers=true
}},setHeader:function(C){var D;
if(this._has_default_headers){for(D in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,D)){C.conn.setRequestHeader(D,this._default_headers[D])
}}}if(this._has_http_headers){for(D in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,D)){C.conn.setRequestHeader(D,this._http_headers[D])
}}this._http_headers={};
this._has_http_headers=false
}},resetDefaultHeaders:function(){this._default_headers={};
this._has_default_headers=false
},abort:function(K,I,H){var L,N=(I&&I.argument)?I.argument:null;
K=K||{};
if(K.conn){if(K.xhr){if(this.isCallInProgress(K)){K.conn.abort();
window.clearInterval(this._poll[K.tId]);
delete this._poll[K.tId];
if(H){window.clearTimeout(this._timeOut[K.tId]);
delete this._timeOut[K.tId]
}L=true
}}else{if(K.xdr){K.conn.abort(K.tId);
L=true
}}}else{if(K.upload){var M="yuiIO"+K.tId;
var J=document.getElementById(M);
if(J){YAHOO.util.Event.removeListener(J,"load");
document.body.removeChild(J);
if(H){window.clearTimeout(this._timeOut[K.tId]);
delete this._timeOut[K.tId]
}L=true
}}else{L=false
}}if(L===true){this.abortEvent.fire(K,N);
if(K.abortEvent){K.abortEvent.fire(K,N)
}this.handleTransactionResponse(K,I,true)
}return L
},isCallInProgress:function(B){B=B||{};
if(B.xhr&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0
}else{if(B.xdr&&B.conn){return B.conn.isCallInProgress(B.tId)
}else{if(B.upload===true){return document.getElementById("yuiIO"+B.tId)?true:false
}else{return false
}}}},releaseObject:function(B){if(B&&B.conn){B.conn=null;
B=null
}}};
(function(){var K=YAHOO.util.Connect,J={};
function N(C){var B='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+C+'" width="0" height="0"><param name="movie" value="'+C+'"><param name="allowScriptAccess" value="always"></object>',A=document.createElement("div");
document.body.appendChild(A);
A.innerHTML=B
}function P(A,D,C,E,B){J[parseInt(A.tId)]={o:A,c:E};
if(B){E.method=D;
E.data=B
}A.conn.send(C,E,A.tId)
}function M(A){N(A);
K._transport=document.getElementById("YUIConnectionSwf")
}function O(){K.xdrReadyEvent.fire()
}function I(A,B){if(A){K.startEvent.fire(A,B.argument);
if(A.startEvent){A.startEvent.fire(A,B.argument)
}}}function L(B){var A=J[B.tId].o,C=J[B.tId].c;
if(B.statusText==="xdr:start"){I(A,C);
return 
}B.responseText=decodeURI(B.responseText);
A.r=B;
if(C.argument){A.r.argument=C.argument
}this.handleTransactionResponse(A,C,B.statusText==="xdr:abort"?true:false);
delete J[B.tId]
}K.xdr=P;
K.swf=N;
K.transport=M;
K.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");
K.xdrReady=O;
K.handleXdrResponse=L
})();
(function(){var L=YAHOO.util.Connect,J=YAHOO.util.Event;
L._isFormSubmit=false;
L._isFileUpload=false;
L._formNode=null;
L._sFormData=null;
L._submitElementValue=null;
L.uploadEvent=new YAHOO.util.CustomEvent("upload"),L._hasSubmitListener=function(){if(J){J.addListener(document,"click",function(A){var B=J.getTarget(A),C=B.nodeName.toLowerCase();
if((C==="input"||C==="button")&&(B.type&&B.type.toLowerCase()=="submit")){L._submitElementValue=encodeURIComponent(B.name)+"="+encodeURIComponent(B.value)
}});
return true
}return false
}();
function I(D,Y,d){var E,e,F,X,A,G=false,a=[],B=0,b,Z,c,C,f;
this.resetFormState();
if(typeof D=="string"){E=(document.getElementById(D)||document.forms[D])
}else{if(typeof D=="object"){E=D
}else{return 
}}if(Y){this.createFrame(d?d:null);
this._isFormSubmit=true;
this._isFileUpload=true;
this._formNode=E;
return 
}for(b=0,Z=E.elements.length;
b<Z;
++b){e=E.elements[b];
A=e.disabled;
F=e.name;
if(!A&&F){F=encodeURIComponent(F)+"=";
X=encodeURIComponent(e.value);
switch(e.type){case"select-one":if(e.selectedIndex>-1){f=e.options[e.selectedIndex];
a[B++]=F+encodeURIComponent((f.attributes.value&&f.attributes.value.specified)?f.value:f.text)
}break;
case"select-multiple":if(e.selectedIndex>-1){for(c=e.selectedIndex,C=e.options.length;
c<C;
++c){f=e.options[c];
if(f.selected){a[B++]=F+encodeURIComponent((f.attributes.value&&f.attributes.value.specified)?f.value:f.text)
}}}break;
case"radio":case"checkbox":if(e.checked){a[B++]=F+X
}break;
case"file":case undefined:case"reset":case"button":break;
case"submit":if(G===false){if(this._hasSubmitListener&&this._submitElementValue){a[B++]=this._submitElementValue
}G=true
}break;
default:a[B++]=F+X
}}}this._isFormSubmit=true;
this._sFormData=a.join("&");
this.initHeader("Content-Type",this._default_form_header);
return this._sFormData
}function M(){this._isFormSubmit=false;
this._isFileUpload=false;
this._formNode=null;
this._sFormData=""
}function N(C){var B="yuiIO"+this._transaction_id,A;
if(YAHOO.env.ua.ie){A=document.createElement('<iframe id="'+B+'" name="'+B+'" />');
if(typeof C=="boolean"){A.src="javascript:false"
}}else{A=document.createElement("iframe");
A.id=B;
A.name=B
}A.style.position="absolute";
A.style.top="-1000px";
A.style.left="-1000px";
document.body.appendChild(A)
}function K(E){var B=[],D=E.split("&"),C,A;
for(C=0;
C<D.length;
C++){A=D[C].indexOf("=");
if(A!=-1){B[C]=document.createElement("input");
B[C].type="hidden";
B[C].name=decodeURIComponent(D[C].substring(0,A));
B[C].value=decodeURIComponent(D[C].substring(A+1));
this._formNode.appendChild(B[C])
}}return B
}function H(c,B,b,d){var G="yuiIO"+c.tId,F="multipart/form-data",D=document.getElementById(G),a=(document.documentMode&&document.documentMode===8)?true:false,A=this,E=(B&&B.argument)?B.argument:null,C,X,e,Y,f,Z;
f={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};
this._formNode.setAttribute("action",b);
this._formNode.setAttribute("method","POST");
this._formNode.setAttribute("target",G);
if(YAHOO.env.ua.ie&&!a){this._formNode.setAttribute("encoding",F)
}else{this._formNode.setAttribute("enctype",F)
}if(d){C=this.appendPostData(d)
}this._formNode.submit();
this.startEvent.fire(c,E);
if(c.startEvent){c.startEvent.fire(c,E)
}if(B&&B.timeout){this._timeOut[c.tId]=window.setTimeout(function(){A.abort(c,B,true)
},B.timeout)
}if(C&&C.length>0){for(X=0;
X<C.length;
X++){this._formNode.removeChild(C[X])
}}for(e in f){if(YAHOO.lang.hasOwnProperty(f,e)){if(f[e]){this._formNode.setAttribute(e,f[e])
}else{this._formNode.removeAttribute(e)
}}}this.resetFormState();
Z=function(){if(B&&B.timeout){window.clearTimeout(A._timeOut[c.tId]);
delete A._timeOut[c.tId]
}A.completeEvent.fire(c,E);
if(c.completeEvent){c.completeEvent.fire(c,E)
}Y={tId:c.tId,argument:B.argument};
try{Y.responseText=D.contentWindow.document.body?D.contentWindow.document.body.innerHTML:D.contentWindow.document.documentElement.textContent;
Y.responseXML=D.contentWindow.document.XMLDocument?D.contentWindow.document.XMLDocument:D.contentWindow.document
}catch(O){}if(B&&B.upload){if(!B.scope){B.upload(Y)
}else{B.upload.apply(B.scope,[Y])
}}A.uploadEvent.fire(Y);
if(c.uploadEvent){c.uploadEvent.fire(Y)
}J.removeListener(D,"load",Z);
setTimeout(function(){document.body.removeChild(D);
A.releaseObject(c)
},100)
};
J.addListener(D,"load",Z)
}L.setForm=I;
L.resetFormState=M;
L.createFrame=N;
L.appendPostData=K;
L.uploadFile=H
})();
YAHOO.register("connection",YAHOO.util.Connect,{version:"2.8.0r4",build:"2449"});
