/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.2.0
build: nightly
*/
YUI.add("io-form",function(b){var a=encodeURIComponent;b.mix(b.io,{_serialize:function(w,B){var q=[],x=w.useDisabled||false,A=0,g=(typeof w.id==="string")?w.id:w.id.getAttribute("id"),t,r,k,z,u,p,y,l,m,h;if(!g){g=b.guid("io:");w.id.setAttribute("id",g);}r=b.config.doc.getElementById(g);for(p=0,y=r.elements.length;p<y;++p){t=r.elements[p];u=t.disabled;k=t.name;if(x?k:k&&!u){k=a(k)+"=";z=a(t.value);switch(t.type){case"select-one":if(t.selectedIndex>-1){h=t.options[t.selectedIndex];q[A++]=k+a(h.attributes.value&&h.attributes.value.specified?h.value:h.text);}break;case"select-multiple":if(t.selectedIndex>-1){for(l=t.selectedIndex,m=t.options.length;l<m;++l){h=t.options[l];if(h.selected){q[A++]=k+a(h.attributes.value&&h.attributes.value.specified?h.value:h.text);}}}break;case"radio":case"checkbox":if(t.checked){q[A++]=k+z;}break;case"file":case undefined:case"reset":case"button":break;case"submit":default:q[A++]=k+z;}}}return B?q.join("&")+"&"+B:q.join("&");}},true);},"3.2.0",{requires:["io-base","node-base"]});