/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
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', '', 0, 0));}});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);YAHOO.log("ActiveX Program Id  "+A+" added to _msxml_progid.","info","Connection");},setDefaultPostHeader:function(A) {if(typeof A=="string"){this._default_post_header=A;YAHOO.log("Default POST header set to  "+A,"info","Connection");}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A) {if(typeof A=="string"){this._default_xhr_header=A;YAHOO.log("Default XHR header set to  "+A,"info","Connection");}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A) {if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;YAHOO.log("Default polling interval set to "+A+"ms","info","Connection");}},createXhrObject:function(E) {var D,A;try{A=new (XMLHttpRequest)();D={conn:A,tId:E};YAHOO.log("XHR object created for transaction "+E,"info","Connection");}catch(C){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), 0, 0));D={conn:A,tId:E};YAHOO.log("ActiveX XHR object created for transaction "+E,"info","Connection");break;}catch(C){}}}finally{return D;}},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){YAHOO.log("Unable to create connection object.","error","Connection");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="+ _proxy_jslib_handle(new (Date)().valueOf(), 'toString', '', 1, 0)();} _proxy_jslib_handle(D.conn, 'open', '', 1, 0)(F,C,true);if(this._use_default_xhr_header){if(! _proxy_jslib_handle(this._default_headers, ("X-Requested-With"), 0, 0)){this.initHeader("X-Requested-With",this._default_xhr_header,true);YAHOO.log("Initialize transaction header X-Request-Header to XMLHttpRequest.","info","Connection");}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.","info","Connection");}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");YAHOO.log("Transaction "+D.tId+" sent.","info","Connection");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) {for(var B in C.customevents){if( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[0]){ _proxy_jslib_assign('', A, ( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[0]), '=', (new (YAHOO.util.CustomEvent)( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[1],(C.scope)?C.scope:null)));YAHOO.log("Transaction-specific Custom Event "+ _proxy_jslib_handle(A, ( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[1]), 0, 0)+" created.","info","Connection"); _proxy_jslib_handle(A, ( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[0]), 0, 0).subscribe( _proxy_jslib_handle(C.customevents, (B), 0, 0));YAHOO.log("Transaction-specific Custom Event "+ _proxy_jslib_handle(A, ( _proxy_jslib_handle(this._customEvents, (B), 0, 0)[1]), 0, 0)+" subscribed.","info","Connection");}}},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', '', 1, 0)(function() {B.abort(C,D,true);},D.timeout)));} _proxy_jslib_assign('', this._poll, (C.tId), '=', ( _proxy_jslib_handle(window, 'setInterval', '', 1, 0)(function() {if(C.conn&&C.conn.readyState===4){window.clearInterval( _proxy_jslib_handle(B._poll, (C.tId), 0, 0)); _proxy_jslib_assign('delete', (B._poll), (C.tId), '');if(D&&D.timeout){window.clearTimeout( _proxy_jslib_handle(B._timeOut, (C.tId), 0, 0)); _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);YAHOO.log("Success callback. HTTP code is "+D,"info","Connection");}else{G.success.apply(G.scope,[C]);YAHOO.log("Success callback with scope. HTTP code is "+D,"info","Connection");}}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);
YAHOO.log("Failure callback. Exception detected. Status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. Exception detected. Status code is "+D,"warn","Connection");}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. HTTP status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. HTTP status code is "+D,"warn","Connection");}}}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), 0, 0).indexOf(":");if(B!=-1){ _proxy_jslib_assign('', I, ( _proxy_jslib_handle(F, (E), 0, 0).substring(0,B)), '=', ( _proxy_jslib_handle(F, (E), 0, 0).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) {if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B, _proxy_jslib_handle(this._default_headers, (B), 0, 0));YAHOO.log("Default HTTP header "+B+" set with value of "+ _proxy_jslib_handle(this._default_headers, (B), 0, 0),"info","Connection");}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B, _proxy_jslib_handle(this._http_headers, (B), 0, 0));YAHOO.log("HTTP header "+B+" set with value of "+ _proxy_jslib_handle(this._http_headers, (B), 0, 0),"info","Connection");}} _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(K,E,B) {this.resetFormState();var J;if(typeof K=="string"){J=( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(K)||document.forms[(K)]);}else{if(typeof K=="object"){J=K;}else{YAHOO.log("Unable to create form object "+K,"warn","Connection");return ;}}if(E){var F=this.createFrame(( _proxy_jslib_handle( _proxy_jslib_handle(window, 'location', '', 0, 0), 'href', '', 0, 0).toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A= _proxy_jslib_handle(J.elements, (D), 0, 0);L=A.disabled;I=A.name;G= _proxy_jslib_handle(A, 'value', '', 0, 0);if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if( _proxy_jslib_handle(A.options, (C), 0, 0).selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent( _proxy_jslib_handle( _proxy_jslib_handle(A.options, (C), 0, 0).attributes, ("value"), 0, 0).specified? _proxy_jslib_handle( _proxy_jslib_handle(A.options, (C), 0, 0), 'value', '', 0, 0): _proxy_jslib_handle(A.options, (C), 0, 0).text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent( _proxy_jslib_handle(A.options, (C), 0, 0).hasAttribute("value")? _proxy_jslib_handle( _proxy_jslib_handle(A.options, (C), 0, 0), 'value', '', 0, 0): _proxy_jslib_handle(A.options, (C), 0, 0).text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);YAHOO.log("Form initialized for transaction. HTML form POST message is: "+this._sFormData,"info","Connection");this.initHeader("Content-Type",this._default_form_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.","info","Connection");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(window.ActiveXObject){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', '', 0, 0).appendChild(C);YAHOO.log("File upload iframe created. Id is:"+B,"info","Connection");},appendPostData:function(A) {var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E= _proxy_jslib_handle(B, (C), 0, 0).indexOf("=");if(E!=-1){ _proxy_jslib_assign('', D, (C), '=', (document.createElement("input"))); _proxy_jslib_handle(D, (C), 0, 0).type="hidden"; _proxy_jslib_handle(D, (C), 0, 0).name= _proxy_jslib_handle(B, (C), 0, 0).substring(0,E); _proxy_jslib_assign('',  _proxy_jslib_handle(D, (C), 0, 0), 'value', '=', ( _proxy_jslib_handle(B, (C), 0, 0).substring(E+1)));this._formNode.appendChild( _proxy_jslib_handle(D, (C), 0, 0));}}return D;},uploadFile:function(D,M,E,C) {var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K= _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")}; _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)("action",E); _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)("method","POST"); _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)("target",H);if(YAHOO.env.ua.ie){ _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)("encoding",I);}else{ _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){ _proxy_jslib_assign('', this._timeOut, (D.tId), '=', ( _proxy_jslib_handle(window, 'setTimeout', '', 1, 0)(function() {N.abort(D,M,true);},M.timeout)));}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild( _proxy_jslib_handle(L, (G), 0, 0));}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if( _proxy_jslib_handle(B, (A), 0, 0)){ _proxy_jslib_handle(this._formNode, 'setAttribute', '', 1, 0)(A, _proxy_jslib_handle(B, (A), 0, 0));}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function() {if(M&&M.timeout){window.clearTimeout( _proxy_jslib_handle(N._timeOut, (D.tId), 0, 0));
 _proxy_jslib_assign('delete', (N._timeOut), (D.tId), '');}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText= _proxy_jslib_handle(K.contentWindow.document, 'body', '', 0, 0)? _proxy_jslib_handle( _proxy_jslib_handle(K.contentWindow.document, 'body', '', 0, 0), 'innerHTML', '', 0, 0):K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);YAHOO.log("Upload callback.","info","Connection");}else{M.upload.apply(M.scope,[P]);YAHOO.log("Upload callback with scope.","info","Connection");}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F); _proxy_jslib_handle(null, 'setTimeout', setTimeout, 1, 0)(function() { _proxy_jslib_handle(document, 'body', '', 0, 0).removeChild(K);N.releaseObject(D);YAHOO.log("File upload iframe destroyed. Id is:"+H,"info","Connection");},100);};YAHOO.util.Event.addListener(K,"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), 0, 0)); _proxy_jslib_assign('delete', (this._poll), (E.tId), '');if(A){window.clearTimeout( _proxy_jslib_handle(this._timeOut, (E.tId), 0, 0)); _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', '', 1, 0)(C);if(F){YAHOO.util.Event.removeListener(F,"load"); _proxy_jslib_handle(document, 'body', '', 0, 0).removeChild(F);YAHOO.log("File upload iframe destroyed. Id is:"+C,"info","Connection");if(A){window.clearTimeout( _proxy_jslib_handle(this._timeOut, (E.tId), 0, 0)); _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);YAHOO.log("Transaction "+E.tId+" aborted.","info","Connection");}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', '', 1, 0)(A)?true:false;}else{return false;}}},releaseObject:function(A) {if(A&&A.conn){A.conn=null;YAHOO.log("Connection object for transaction "+A.tId+" destroyed.","info","Connection");A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.2",build:"1076"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A) {var F=YAHOO.lang;var E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expires instanceof Date){E+="; expires="+A.expires.toGMTString();}if(F.isString(A.path)&&A.path!=""){E+="; path="+A.path;}if(F.isString( _proxy_jslib_handle(A, 'domain', '', 0, 0))&& _proxy_jslib_handle(A, 'domain', '', 0, 0)!=""){E+="; domain="+ _proxy_jslib_handle(A, 'domain', '', 0, 0);}if(A.secure===true){E+="; secure";}}return E;},_createCookieHashString:function(B) {var D=YAHOO.lang;if(!D.isObject(B)){throw new (TypeError)("Cookie._createCookieHashString(): Argument must be an object.");}var C=new (Array)();for(var A in B){if(D.hasOwnProperty(B,A)&&!D.isFunction( _proxy_jslib_handle(B, (A), 0, 0))&&!D.isUndefined( _proxy_jslib_handle(B, (A), 0, 0))){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String( _proxy_jslib_handle(B, (A), 0, 0))));}}return C.join("&");},_parseCookieHash:function(E) {var D=E.split("&");var F=null;var C=new (Object)();for(var B=0,A=D.length;B<A;B++){F= _proxy_jslib_handle(D, (B), 0, 0).split("="); _proxy_jslib_assign('', C, (decodeURIComponent(F[0])), '=', (decodeURIComponent(F[1])));}return C;},_parseCookieString:function(I,A) {var J=new (Object)();if(YAHOO.lang.isString(I)&&I.length>0){var B=(A===false?function(K) {return K;}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(I)){var G=I.split(/;\s/g);var H=null;var C=null;var E=null;for(var D=0,F=G.length;D<F;D++){E= _proxy_jslib_handle(G, (D), 0, 0).match(/([^=]+)=/i);if(E instanceof Array){H=decodeURIComponent(E[1]);C=B( _proxy_jslib_handle(G, (D), 0, 0).substring(H.length+1));}else{H=decodeURIComponent( _proxy_jslib_handle(G, (D), 0, 0));C=H;} _proxy_jslib_assign('', J, (H), '=', (C));}}}return J;},get:function(A,B) {var D=YAHOO.lang;var C=this._parseCookieString( _proxy_jslib_handle(document, 'cookie', '', 0, 0));if(!D.isString(A)||A===""){throw new (TypeError)("Cookie.get(): Cookie name must be a non-empty string.");}if(D.isUndefined( _proxy_jslib_handle(C, (A), 0, 0))){return null;}if(!D.isFunction(B)){return  _proxy_jslib_handle(C, (A), 0, 0);}else{return B( _proxy_jslib_handle(C, (A), 0, 0));}},getSub:function(A,C,B) {var E=YAHOO.lang;var D=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){throw new (TypeError)("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(E.isUndefined( _proxy_jslib_handle(D, (C), 0, 0))){return null;}if(!E.isFunction(B)){return  _proxy_jslib_handle(D, (C), 0, 0);}else{return B( _proxy_jslib_handle(D, (C), 0, 0));}}else{return null;}},getSubs:function(A) {if(!YAHOO.lang.isString(A)||A===""){throw new (TypeError)("Cookie.getSubs(): Cookie name must be a non-empty string.");}var B=this._parseCookieString( _proxy_jslib_handle(document, 'cookie', '', 0, 0),false);if(YAHOO.lang.isString( _proxy_jslib_handle(B, (A), 0, 0))){return this._parseCookieHash( _proxy_jslib_handle(B, (A), 0, 0));}return null;},remove:function(B,A) {if(!YAHOO.lang.isString(B)||B===""){throw new (TypeError)("Cookie.remove(): Cookie name must be a non-empty string.");}A=A||{};A.expires=new (Date)(0);return this.set(B,"",A);},set:function(B,C,A) {var E=YAHOO.lang;if(!E.isString(B)){throw new (TypeError)("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){throw new (TypeError)("Cookie.set(): Value cannot be undefined.");}var D=this._createCookieString(B,C,true,A); _proxy_jslib_assign('', document, 'cookie', '=', (D));return D;},setSub:function(B,D,C,A) {var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new (TypeError)("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!F.isString(D)||D===""){throw new (TypeError)("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(F.isUndefined(C)){throw new (TypeError)("Cookie.setSub(): Subcookie value cannot be undefined.");}var E=this.getSubs(B);if(!F.isObject(E)){E=new (Object)();} _proxy_jslib_assign('', E, (D), '=', (C));return this.setSubs(B,E,A);},setSubs:function(B,C,A) {var E=YAHOO.lang;if(!E.isString(B)){throw new (TypeError)("Cookie.setSubs(): Cookie name must be a string.");}if(!E.isObject(C)){throw new (TypeError)("Cookie.setSubs(): Cookie value must be an object.");}var D=this._createCookieString(B,this._createCookieHashString(C),false,A); _proxy_jslib_assign('', document, 'cookie', '=', (D));return D;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.5.2",build:"1076"});YAHOO.namespace("Media.Buzz");YAHOO.Media.Buzz=function(B,A) {this.form=this.D.get(B);if(this.form){this._init(A);return true}else{return false}};YAHOO.Media.Buzz.prototype.C=YAHOO.util.Connect;YAHOO.Media.Buzz.prototype.D=YAHOO.util.Dom;YAHOO.Media.Buzz.prototype.E=YAHOO.util.Event;YAHOO.Media.Buzz.prototype.Ck=YAHOO.util.Cookie;YAHOO.Media.Buzz.prototype._init=function(A) {if(typeof A=="undefined"){A={}}this.button= _proxy_jslib_handle(this.form, 'getElementsByTagName', '', 1, 0)("button")[0];this.fields= _proxy_jslib_handle(this.form, 'getElementsByTagName', '', 1, 0)("input");this.puburn=this._getByName("publisherurn");this.guid=this._getByName("guid");if(this.Ck){this.cookieKey=this._getByName("key")||this.guid+this.Ck.getSub("Y","n")}this.showCount=typeof A.showCount==="undefined"?true:A.showCount;var C=this.Ck?this.Ck.getSub("buzz",this.cookieKey):null;if(C!==null){this._markBuzzed()}if(this.showCount){this.countPosition=A.countPosition||"above";var B=C!==null?C:this._getByName("count");if(B!==""){this._handleCount({votecount:B})}else{this.C.asyncRequest("GET","/buzz-count/"+this.puburn+"/"+this.guid,{success:this._handleCount,failure:this._handleFailure,scope:this})}}if(A.loggedIn){this.submitted=false;this.E.addListener(this.form,"submit",this._buzzUp,this,true)}};YAHOO.Media.Buzz.prototype._buzzUp=function(B) {this.E.preventDefault(B);if(!this.submitted){this.D.addClass(this.form,"buzzing");this.button.disabled=true;var A=this._getByName(".done",false);if( _proxy_jslib_handle(A, 'value', '', 0, 0)){ _proxy_jslib_assign('', A, 'value', '=', (""))}this._addFields({name:"format",value:"json"});this.C.setForm(this.form);this.C.asyncRequest("POST","/buzz-up/",{success:this._handleVote,failure:this._handleFailure,scope:this});this.submitted=true}return false};YAHOO.Media.Buzz.prototype._markBuzzed=function(A) {this.button.disabled=true;this.D.replaceClass(this.form,"buzzing","buzzed"); _proxy_jslib_assign('', this.button, 'innerHTML', '=', ( _proxy_jslib_handle( _proxy_jslib_handle(this.button, 'innerHTML', '', 0, 0), 'replace', '', 1, 0)("Buzz up!","Buzzed!")))};YAHOO.Media.Buzz.prototype._handleCount=function(D,A) {if(D.responseXML){var B= _proxy_jslib_handle(D.responseXML, 'getElementsByTagName', '', 1, 0)("count");if(B.length&&B[0].firstChild){B= _proxy_jslib_handle(B[0].firstChild, 'nodeValue', '', 0, 0)}else{B=false}}else{if(typeof D.votecount!=="undefined"){B=D.votecount}else{B=false}}if(A&&B&&this.Ck){this.Ck.setSub("buzz",this.cookieKey,B,{expires:new (Date)(new (Date)().getTime()+600000)})}if(this.showCount&&B!==false){var C=this.D.getElementsByClassName("buzz-count","span",this.form);if(C.length){ _proxy_jslib_assign('', C[0], 'innerHTML', '=', (B))}else{if(this.countPosition=="above"){C=document.createElement("p");C.className="count-box"; _proxy_jslib_assign('', C, 'innerHTML', '=', (' <span class="buzz-count">'+B+"</span> <em>vote"+(B!=1?"s":"")+"</em>"));this.D.setStyle(this.button,"display","none");this.D.insertBefore(C,this.button);this.D.setStyle(this.button,"display","block")}else{if(this.countPosition=="after"){C=document.createElement("span");C.className="count-after"; _proxy_jslib_assign('', C, 'innerHTML', '=', (' <span class="buzz-count">'+B+"</span> <em>vote"+(B!=1?"s":"")+"</em>"));this.D.insertAfter(C,this.button)}else{ _proxy_jslib_assign('', this.button, 'innerHTML', '+=', (' <span class="buzz-count">'+B+"</span>"))}}}}};YAHOO.Media.Buzz.prototype._handleVote=function(resp) {if(resp.responseText&&resp.responseText.charAt(0)=="{"){var response=eval(_proxy_jslib_proxify_js(("("+resp.responseText+")"), 0, 0) )}else{response=false}if(response.failurecode){this._handleFailure(response)}this._handleCount(response,true);this._markBuzzed()};YAHOO.Media.Buzz.prototype._handleFailure=function(A) {if(A.failurecode){switch(parseInt(A.failurecode)){case 1:case 2:case 3:case 6:case 5:this._markBuzzed();break}}};YAHOO.Media.Buzz.prototype._getByName=function(C,B) {if(typeof B=="undefined"){B=true}for(var A in this.fields){if( _proxy_jslib_handle(this.fields, (A), 0, 0).name==C){return B? _proxy_jslib_handle( _proxy_jslib_handle(this.fields, (A), 0, 0), 'value', '', 0, 0): _proxy_jslib_handle(this.fields, (A), 0, 0)}}return""};YAHOO.Media.Buzz.prototype._addFields=function(A) {if(!YAHOO.lang.isArray(A)){A=[A]}for(var C=0,B=A.length;C<B;C++){if( _proxy_jslib_handle(A, (C), 0, 0).name&&typeof  _proxy_jslib_handle( _proxy_jslib_handle(A, (C), 0, 0), 'value', '', 0, 0)!="undefined"){var D=document.createElement("input");D.name= _proxy_jslib_handle(A, (C), 0, 0).name; _proxy_jslib_assign('', D, 'value', '=', ( _proxy_jslib_handle( _proxy_jslib_handle(A, (C), 0, 0), 'value', '', 0, 0)));D.type=typeof  _proxy_jslib_handle(A, (C), 0, 0).type!="undefined"? _proxy_jslib_handle(A, (C), 0, 0).type:"hidden";this.form.appendChild(D)}}};
YAHOO.namespace('Media.Dtk.ArticleTools');YAHOO.Media.Dtk.ArticleTools.Email=function() {var emailRegEx=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;function trim(txt) {return  _proxy_jslib_handle(txt, 'replace', '', 1, 0)(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");}
function isValidEmail(s) {s=trim(s);if(s&&!emailRegEx.test(s)){return false;}
return true;}
return{isValidEmail:isValidEmail,checkEmails:function(idTo,idFrom) {var isOk=true;var emails=trim( _proxy_jslib_handle( _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idTo), 'value', '', 0, 0), 'replace', '', 1, 0)(/;/g,","));if(emails===""){isOk=false;}else{emails=emails.split(",");for(var i=0;i<emails.length;i++){if(!isValidEmail( _proxy_jslib_handle(emails, (i), 0, 0))){isOk=false;break;}}}
if(!isOk){ _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('dtk-err-to').style.display="block";}else{ _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('dtk-err-to').style.display="none";}
var from=trim( _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(idFrom), 'value', '', 0, 0));if((from==="")||!isValidEmail(from)){ _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('dtk-err-from').style.display="block";isOk=false;}else{ _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('dtk-err-from').style.display="none";}
return isOk;},addressBook:function() { _proxy_jslib_assign('', document, 'domain', '=', ("yahoo.com"));var myPropertyName="yfood";var addURL="http://mix200.address.yahoo.com/?A=e&VPC=kiosk&yprop="+myPropertyName;addRemote= _proxy_jslib_handle(window, 'open', '', 1, 0)(addURL,"AddressBook","width=480,height=480,resizable=yes,scrollbars=yes,toolbar=no,status=0");if(addRemote!=null){if( _proxy_jslib_handle(addRemote, 'opener', '', 0, 0)==null){ _proxy_jslib_assign('', addRemote, 'opener', '=', (self));}}
addRemote.focus();return addRemote;}}}();YAHOO.Media.Dtk.ArticleTools.IM=function() {var imMsg="Check out this story on Yahoo!:";var msgr_installed;var msgr_version="";var msgr_platform="";function init(imMsgAlt) {if(imMsgAlt){imMsg=imMsgAlt;}
var w,v;if(document.all){v=document.all.not_Ymsgr;}else{v= _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("not_Ymsgr");}
if(v){w= _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("Ymsgr");if(w&&w.offsetHeight){msgr_installed=1;msgr_version="5";msgr_platform="w32";}else{msgr_installed=1;}}else{msgr_installed=1;msgr_version="5";msgr_platform="w32";}
if(navigator.mimeTypes&&navigator.mimeTypes.length){for(var i=0;i<navigator.mimeTypes.length;i++){if( _proxy_jslib_handle(navigator.mimeTypes, (i), 0, 0).suffixes.indexOf("yps")>-1){msgr_installed=1;msgr_version="";msgr_platform="";break;}}}}
init();return{init:init,hasMsgr:function() {var a= _proxy_jslib_handle(document, 'cookie', '', 0, 0);var b=a.split("; ");for(var c=0;c<b.length;c++){var d= _proxy_jslib_handle(b, (c), 0, 0).indexOf("=");var e= _proxy_jslib_handle(b, (c), 0, 0).substring(0,d);var f= _proxy_jslib_handle(b, (c), 0, 0).substring(d+1);if(e=="C"){alert(f);var g=f.split("& ");for(h=0;h<g.length;h++){var i= _proxy_jslib_handle(g, (h), 0, 0).indexOf("=");var j= _proxy_jslib_handle(g, (h), 0, 0).substring(0,i);var k= _proxy_jslib_handle(g, (h), 0, 0).substring(i+1);if(j=="mg"&&k=="1"){return true;}}}}
return false;},setIntroMsg:function(s) {if(s){imMsg=s;}},imStory:function(hdline,lnk) {if(msgr_installed){ _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'location', location, 0, 0), 'href', '=', ("ymsgr:im?msg="+imMsg+"+"+hdline+"+"+lnk));}else{openas('get-messenger');}
return false;}}}(); ;
_proxy_jslib_flush_write_buffers() ;