
if(typeof YUI==="undefined"){var YUI=function(){var D=this,B=arguments,C,A=B.length,E=(typeof YUI_config!=="undefined")&&YUI_config;if(!(D instanceof YUI)){D=new YUI();for(C=0;C<A;C++){D._config(B[C]);}return D;}else{D._init();if(E){D._config(E);}for(C=0;C<A;C++){D._config(B[C]);}D._setup();return D;}};}(function(){var L,B,M="3.1.2",K="http://yui.yahooapis.com/",P="yui3-js-enabled",I=function(){},G=Array.prototype.slice,N={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},F=(typeof window!="undefined"),E=(F)?window:null,R=(F)?E.document:null,D=R&&R.documentElement,A=D&&D.className,C={},H=new Date().getTime(),J=function(V,U,T,S){if(V&&V.addEventListener){V.addEventListener(U,T,S);}else{if(V&&V.attachEvent){V.attachEvent("on"+U,T);}}},Q=function(W,V,U,S){if(W&&W.removeEventListener){try{W.removeEventListener(V,U,S);}catch(T){}}else{if(W&&W.detachEvent){W.detachEvent("on"+V,U);}}},O=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;if(F){Q(window,"load",O);}};if(D&&A.indexOf(P)==-1){if(A){A+=" ";}A+=P;D.className=A;}if(M.indexOf("@")>-1){M="3.0.0";}YUI.prototype={_config:function(Y){Y=Y||{};var T,V,W,U=this.config,X=U.modules,S=U.groups;for(V in Y){T=Y[V];if(X&&V=="modules"){for(W in T){X[W]=T[W];}}else{if(S&&V=="groups"){for(W in T){S[W]=T[W];}}else{if(V=="win"){U[V]=T.contentWindow||T;U.doc=U[V].document;}else{U[V]=T;}}}}},_init:function(){var U,V=this,S=YUI.Env,T=V.Env;V.version=M;if(!T){V.Env={mods:{},base:K,cdn:K+M+"/build/",bootstrapped:false,_idx:0,_used:{},_attached:{},_yidx:0,_uidx:0,_guidp:"y",_loaded:{},getBase:function(c,a){var W,X,Z,d,Y;X=(R&&R.getElementsByTagName("script"))||[];for(Z=0;Z<X.length;Z=Z+1){d=X[Z].src;if(d){Y=d.match(c);W=Y&&Y[1];if(W){U=Y[2];Y=d.match(a);if(Y&&Y[3]){W=Y[1]+Y[3];}break;}}}return W||T.cdn;}};T=V.Env;T._loaded[M]={};if(S&&V!==YUI){T._yidx=++S._yidx;T._guidp=("yui_"+M+"_"+T._yidx+"_"+H).replace(/\./g,"_");}V.id=V.stamp(V);C[V.id]=V;}V.constructor=YUI;V.config=V.config||{win:E,doc:R,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,fetchCSS:true};V.config.base=YUI.config.base||V.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/,/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);V.config.loaderPath=YUI.config.loaderPath||"loader/loader"+(U||"-min.")+"js";},_setup:function(X){var T,W=this,S=[],V=YUI.Env.mods,U=W.config.core||["get","intl-base","loader","yui-log","yui-later","yui-throttle"];for(T=0;T<U.length;T++){if(V[U[T]]){S.push(U[T]);}}W.use("yui-base");W.use.apply(W,S);},applyTo:function(Y,X,U){if(!(X in N)){this.log(X+": applyTo not allowed","warn","yui");return null;}var T=C[Y],W,S,V;if(T){W=X.split(".");S=T;for(V=0;V<W.length;V=V+1){S=S[W[V]];if(!S){this.log("applyTo not found: "+X,"warn","yui");}}return S.apply(T,U);}return null;},add:function(T,V,S,U){U=U||{};YUI.Env.mods[T]={name:T,fn:V,version:S,details:U};return this;},_attach:function(S,W){var Y,V,b,T,a,U,c=YUI.Env.mods,X=this.Env._attached,Z=S.length;for(Y=0;Y<Z;Y++){V=S[Y];b=c[V];if(!X[V]&&b){X[V]=true;T=b.details;a=T.requires;U=T.use;if(a&&a.length){this._attach(this.Array(a));}if(b.fn){b.fn(this,V);}if(U&&U.length){this._attach(this.Array(U));}}}},use:function(){if(!this.Array){this._attach(["yui-base"]);}var i,c,j,T=this,k=YUI.Env,U=G.call(arguments,0),V=k.mods,S=T.Env,Z=S._used,g=k._loaderQueue,m=U[0],W=U[U.length-1],b=T.Array,l=T.config,a=l.bootstrap,h=[],e=[],X=l.fetchCSS,f=function(o){e.push(o);if(Z[o]){return;}var Y=V[o],p,n;if(Y){Z[o]=true;p=Y.details.requires;n=Y.details.use;}else{if(!k._loaded[M][o]){h.push(o);}else{Z[o]=true;}}if(p){b.each(b(p),f);}if(n){b.each(b(n),f);}},d=function(q){var o=q||{success:true,msg:"not dynamic"},p,n,Y,r=o.data;T._loading=false;if(r){Y=h.concat();h=[];T.Array.each(r,f);n=h.length;if(n){if(h.sort().join()==Y.sort().join()){n=false;}}}if(n&&r){p=r.concat();p.push(function(){T._attach(r);if(W){W(T,o);}});T._loading=false;T.use.apply(T,p);}else{if(r){T._attach(r);}if(W){W(T,o);}}if(T._useQueue&&T._useQueue.size()&&!T._loading){T.use.apply(T,T._useQueue.next());}};if(T._loading){T._useQueue=T._useQueue||new T.Queue();T._useQueue.add(U);return T;}if(typeof W==="function"){U.pop();}else{W=null;}if(m==="*"){U=T.Object.keys(V);}if(T.Loader){c=new T.Loader(l);c.require(U);c.ignoreRegistered=true;c.calculate(null,(X)?null:"js");U=c.sorted;}b.each(U,f);i=h.length;if(i){h=T.Object.keys(b.hash(h));i=h.length;}if(a&&i&&T.Loader){T._loading=true;c=new T.Loader(l);c.onEnd=d;c.context=T;c.attaching=U;c.data=U;c.require((X)?h:U);c.insert(null,(X)?null:"js");}else{if(a&&i&&T.Get&&!S.bootstrapped){T._loading=true;U=b(arguments,0,true);j=function(){T._loading=false;g.running=false;S.bootstrapped=true;T._attach(["loader"]);T.use.apply(T,U);};if(k._bootstrapping){g.add(j);}else{k._bootstrapping=true;T.Get.script(l.base+l.loaderPath,{onEnd:j});}}else{if(i){T.message("Requirement NOT loaded: "+h,"warn","yui");}T._attach(e);d();}}return T;},namespace:function(){var S=arguments,W=null,U,T,V;for(U=0;U<S.length;U=U+1){V=(""+S[U]).split(".");W=this;for(T=(V[0]=="YAHOO")?1:0;T<V.length;T=T+1){W[V[T]]=W[V[T]]||{};W=W[V[T]];}}return W;},log:I,message:I,error:function(T,S){if(this.config.throwFail){throw (S||new Error(T));}else{this.message(T,"error");}return this;},guid:function(S){var T=this.Env._guidp+(++this.Env._uidx);return(S)?(S+T):T;},stamp:function(U,V){if(!U){return U;}var S=(typeof U==="string")?U:U._yuid;if(!S){S=this.guid();if(!V){try{U._yuid=S;}catch(T){S=null;}}}return S;}};L=YUI.prototype;for(B in L){YUI[B]=L[B];}YUI._init();if(F){J(window,"load",O);}else{O();}YUI.Env.add=J;YUI.Env.remove=Q;if(typeof exports=="object"){exports.YUI=YUI;}})();YUI.add("yui-base",function(B){(function(){B.Lang=B.Lang||{};var R=B.Lang,G="array",I="boolean",D="date",M="error",S="function",H="number",K="null",F="object",O="regexp",N="string",C=Object.prototype.toString,P="undefined",E={"undefined":P,"number":H,"boolean":I,"string":N,"[object Function]":S,"[object RegExp]":O,"[object Array]":G,"[object Date]":D,"[object Error]":M},J=/^\s+|\s+$/g,Q="";R.isArray=function(L){return R.type(L)===G;
};R.isBoolean=function(L){return typeof L===I;};R.isFunction=function(L){return R.type(L)===S;};R.isDate=function(L){return R.type(L)===D&&L.toString()!=="Invalid Date"&&!isNaN(L);};R.isNull=function(L){return L===null;};R.isNumber=function(L){return typeof L===H&&isFinite(L);};R.isObject=function(U,T){var L=typeof U;return(U&&(L===F||(!T&&(L===S||R.isFunction(U)))))||false;};R.isString=function(L){return typeof L===N;};R.isUndefined=function(L){return typeof L===P;};R.trim=function(L){try{return L.replace(J,Q);}catch(T){return L;}};R.isValue=function(T){var L=R.type(T);switch(L){case H:return isFinite(T);case K:case P:return false;default:return !!(L);}};R.type=function(L){return E[typeof L]||E[C.call(L)]||(L?F:K);};})();(function(){var C=B.Lang,D=Array.prototype,E="length",F=function(M,K,I){var J=(I)?2:F.test(M),H,G,N=K||0;if(J){try{return D.slice.call(M,N);}catch(L){G=[];H=M.length;for(;N<H;N++){G.push(M[N]);}return G;}}else{return[M];}};B.Array=F;F.test=function(I){var G=0;if(C.isObject(I)){if(C.isArray(I)){G=1;}else{try{if((E in I)&&!I.tagName&&!I.alert&&!I.apply){G=2;}}catch(H){}}}return G;};F.each=(D.forEach)?function(G,H,I){D.forEach.call(G||[],H,I||B);return B;}:function(H,J,K){var G=(H&&H.length)||0,I;for(I=0;I<G;I=I+1){J.call(K||B,H[I],I,H);}return B;};F.hash=function(I,H){var L={},G=I.length,K=H&&H.length,J;for(J=0;J<G;J=J+1){if(I[J]){L[I[J]]=(K&&K>J)?H[J]:true;}}return L;};F.indexOf=(D.indexOf)?function(G,H){return D.indexOf.call(G,H);}:function(G,I){for(var H=0;H<G.length;H=H+1){if(G[H]===I){return H;}}return -1;};F.numericSort=function(H,G){return(H-G);};F.some=(D.some)?function(G,H,I){return D.some.call(G,H,I);}:function(H,J,K){var G=H.length,I;for(I=0;I<G;I=I+1){if(J.call(K,H[I],I,H)){return true;}}return false;};})();function A(){this._init();this.add.apply(this,arguments);}A.prototype={_init:function(){this._q=[];},next:function(){return this._q.shift();},last:function(){return this._q.pop();},add:function(){B.Array.each(B.Array(arguments,0,true),function(C){this._q.push(C);},this);return this;},size:function(){return this._q.length;}};B.Queue=A;YUI.Env._loaderQueue=YUI.Env._loaderQueue||new A();(function(){var D=B.Lang,C="__",E=function(H,G){var F=G.toString;if(D.isFunction(F)&&F!=Object.prototype.toString){H.toString=F;}};B.merge=function(){var G=arguments,I={},H,F=G.length;for(H=0;H<F;H=H+1){B.mix(I,G[H],true);}return I;};B.mix=function(F,O,H,N,K,M){if(!O||!F){return F||B;}if(K){switch(K){case 1:return B.mix(F.prototype,O.prototype,H,N,0,M);case 2:B.mix(F.prototype,O.prototype,H,N,0,M);break;case 3:return B.mix(F,O.prototype,H,N,0,M);case 4:return B.mix(F.prototype,O,H,N,0,M);default:}}var J,I,G,L;if(N&&N.length){for(J=0,I=N.length;J<I;++J){G=N[J];L=D.type(F[G]);if(O.hasOwnProperty(G)){if(M&&L=="object"){B.mix(F[G],O[G]);}else{if(H||!(G in F)){F[G]=O[G];}}}}}else{for(J in O){if(O.hasOwnProperty(J)){if(M&&D.isObject(F[J],true)){B.mix(F[J],O[J],H,N,0,true);}else{if(H||!(J in F)){F[J]=O[J];}}}}if(B.UA.ie){E(F,O);}}return F;};B.cached=function(H,F,G){F=F||{};return function(K,J){var I=(J)?Array.prototype.join.call(arguments,C):K;if(!(I in F)||(G&&F[I]==G)){F[I]=H.apply(H,arguments);}return F[I];};};})();(function(){B.Object=function(H){var G=function(){};G.prototype=H;return new G();};var E=B.Object,F=function(H,G){return H&&H.hasOwnProperty&&H.hasOwnProperty(G);},D=undefined,C=function(K,J){var I=(J===2),G=(I)?0:[],H;for(H in K){if(F(K,H)){if(I){G++;}else{G.push((J)?K[H]:H);}}}return G;};E.keys=function(G){return C(G);};E.values=function(G){return C(G,1);};E.size=function(G){return C(G,2);};E.hasKey=F;E.hasValue=function(H,G){return(B.Array.indexOf(E.values(H),G)>-1);};E.owns=F;E.each=function(K,J,L,I){var H=L||B,G;for(G in K){if(I||F(K,G)){J.call(H,K[G],G,K);}}return B;};E.some=function(K,J,L,I){var H=L||B,G;for(G in K){if(I||F(K,G)){if(J.call(H,K[G],G,K)){return true;}}}return false;};E.getValue=function(K,J){if(!B.Lang.isObject(K)){return D;}var H,I=B.Array(J),G=I.length;for(H=0;K!==D&&H<G;H++){K=K[I[H]];}return K;};E.setValue=function(M,K,L){var G,J=B.Array(K),I=J.length-1,H=M;if(I>=0){for(G=0;H!==D&&G<I;G++){H=H[J[G]];}if(H!==D){H[J[G]]=L;}else{return D;}}return M;};})();B.UA=function(){var F=function(K){var L=0;return parseFloat(K.replace(/\./g,function(){return(L++==1)?"":".";}));},G=B.config.win,J=G&&G.navigator,I={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,caja:J&&J.cajaVersion,secure:false,os:null},E=J&&J.userAgent,H=G&&G.location,D=H&&H.href,C;I.secure=D&&(D.toLowerCase().indexOf("https")===0);if(E){if((/windows|win32/i).test(E)){I.os="windows";}else{if((/macintosh/i).test(E)){I.os="macintosh";}else{if((/rhino/i).test(E)){I.os="rhino";}}}if((/KHTML/).test(E)){I.webkit=1;}C=E.match(/AppleWebKit\/([^\s]*)/);if(C&&C[1]){I.webkit=F(C[1]);if(/ Mobile\//.test(E)){I.mobile="Apple";}else{C=E.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(C){I.mobile=C[0];}}C=E.match(/Chrome\/([^\s]*)/);if(C&&C[1]){I.chrome=F(C[1]);}else{C=E.match(/AdobeAIR\/([^\s]*)/);if(C){I.air=C[0];}}}if(!I.webkit){C=E.match(/Opera[\s\/]([^\s]*)/);if(C&&C[1]){I.opera=F(C[1]);C=E.match(/Opera Mini[^;]*/);if(C){I.mobile=C[0];}}else{C=E.match(/MSIE\s([^;]*)/);if(C&&C[1]){I.ie=F(C[1]);}else{C=E.match(/Gecko\/([^\s]*)/);if(C){I.gecko=1;C=E.match(/rv:([^\s\)]*)/);if(C&&C[1]){I.gecko=F(C[1]);}}}}}}return I;}();},"3.1.2");YUI.add("get",function(A){(function(){var C=A.UA,B=A.Lang,E="text/javascript",F="text/css",D="stylesheet";A.Get=function(){var M,N,J,L={},K=0,U,W=function(a,X,b){var Y=b||A.config.win,c=Y.document,e=c.createElement(a),Z;for(Z in X){if(X[Z]&&X.hasOwnProperty(Z)){e.setAttribute(Z,X[Z]);}}return e;},T=function(Y,Z,X){var a={id:A.guid(),type:F,rel:D,href:Y};if(X){A.mix(a,X);}return W("link",a,Z);},S=function(Y,Z,X){var a={id:A.guid(),type:E};if(X){A.mix(a,X);}a.src=Y;return W("script",a,Z);},P=function(Y,Z,X){return{tId:Y.tId,win:Y.win,data:Y.data,nodes:Y.nodes,msg:Z,statusText:X,purge:function(){N(this.tId);}};},O=function(b,a,X){var Y=L[b],Z;if(Y&&Y.onEnd){Z=Y.context||Y;
Y.onEnd.call(Z,P(Y,a,X));}},V=function(a,Z){var X=L[a],Y;if(X.timer){clearTimeout(X.timer);}if(X.onFailure){Y=X.context||X;X.onFailure.call(Y,P(X,Z));}O(a,Z,"failure");},I=function(a){var X=L[a],Z,Y;if(X.timer){clearTimeout(X.timer);}X.finished=true;if(X.aborted){Z="transaction "+a+" was aborted";V(a,Z);return;}if(X.onSuccess){Y=X.context||X;X.onSuccess.call(Y,P(X));}O(a,Z,"OK");},Q=function(Z){var X=L[Z],Y;if(X.onTimeout){Y=X.context||X;X.onTimeout.call(Y,P(X));}O(Z,"timeout","timeout");},H=function(Z,c){var Y=L[Z],b,g,f,e,a,X,i;if(Y.timer){clearTimeout(Y.timer);}if(Y.aborted){b="transaction "+Z+" was aborted";V(Z,b);return;}if(c){Y.url.shift();if(Y.varName){Y.varName.shift();}}else{Y.url=(B.isString(Y.url))?[Y.url]:Y.url;if(Y.varName){Y.varName=(B.isString(Y.varName))?[Y.varName]:Y.varName;}}g=Y.win;f=g.document;e=f.getElementsByTagName("head")[0];if(Y.url.length===0){I(Z);return;}X=Y.url[0];if(!X){Y.url.shift();return H(Z);}if(Y.timeout){Y.timer=setTimeout(function(){Q(Z);},Y.timeout);}if(Y.type==="script"){a=S(X,g,Y.attributes);}else{a=T(X,g,Y.attributes);}J(Y.type,a,Z,X,g,Y.url.length);Y.nodes.push(a);if(Y.insertBefore){i=M(Y.insertBefore,Z);if(i){i.parentNode.insertBefore(a,i);}}else{e.appendChild(a);}if((C.webkit||C.gecko)&&Y.type==="css"){H(Z,X);}},G=function(){if(U){return;}U=true;var X,Y;for(X in L){if(L.hasOwnProperty(X)){Y=L[X];if(Y.autopurge&&Y.finished){N(Y.tId);delete L[X];}}}U=false;},R=function(Y,X,Z){Z=Z||{};var c="q"+(K++),a,b=Z.purgethreshold||A.Get.PURGE_THRESH;if(K%b===0){G();}L[c]=A.merge(Z,{tId:c,type:Y,url:X,finished:false,nodes:[]});a=L[c];a.win=a.win||A.config.win;a.context=a.context||a;a.autopurge=("autopurge" in a)?a.autopurge:(Y==="script")?true:false;a.attributes=a.attributes||{};a.attributes.charset=Z.charset||a.attributes.charset||"utf-8";setTimeout(function(){H(c);},0);return{tId:c};};J=function(Z,e,d,Y,c,b,X){var a=X||H;if(C.ie){e.onreadystatechange=function(){var f=this.readyState;if("loaded"===f||"complete"===f){e.onreadystatechange=null;a(d,Y);}};}else{if(C.webkit){if(Z==="script"){e.addEventListener("load",function(){a(d,Y);});}}else{e.onload=function(){a(d,Y);};e.onerror=function(f){V(d,f+": "+Y);};}}};M=function(X,a){var Y=L[a],Z=(B.isString(X))?Y.win.document.getElementById(X):X;if(!Z){V(a,"target node not found: "+X);}return Z;};N=function(c){var Y,a,g,e,j,b,Z,f,X=L[c];if(X){Y=X.nodes;a=Y.length;g=X.win.document;e=g.getElementsByTagName("head")[0];if(X.insertBefore){j=M(X.insertBefore,c);if(j){e=j.parentNode;}}for(b=0;b<a;b=b+1){Z=Y[b];if(Z.clearAttributes){Z.clearAttributes();}else{for(f in Z){if(Z.hasOwnProperty(f)){delete Z[f];}}}e.removeChild(Z);}}X.nodes=[];};return{PURGE_THRESH:20,_finalize:function(X){setTimeout(function(){I(X);},0);},abort:function(Y){var Z=(B.isString(Y))?Y:Y.tId,X=L[Z];if(X){X.aborted=true;}},script:function(X,Y){return R("script",X,Y);},css:function(X,Y){return R("css",X,Y);}};}();})();},"3.1.2");YUI.add("intl-base",function(B){var A=/[, ]/;B.mix(B.namespace("Intl"),{lookupBestLang:function(G,H){var F,I,C,E;function D(K){var J;for(J=0;J<H.length;J+=1){if(K.toLowerCase()===H[J].toLowerCase()){return H[J];}}}if(B.Lang.isString(G)){G=G.split(A);}for(F=0;F<G.length;F+=1){I=G[F];if(!I||I==="*"){continue;}while(I.length>0){C=D(I);if(C){return C;}else{E=I.lastIndexOf("-");if(E>=0){I=I.substring(0,E);if(E>=2&&I.charAt(E-2)==="-"){I=I.substring(0,E-2);}}else{break;}}}}return"";}});},"3.1.2",{requires:["yui-base"]});YUI.add("yui-log",function(A){(function(){var E,D=A,F="yui:log",B="undefined",C={debug:1,info:1,warn:1,error:1};D.log=function(I,Q,G,O){var K,N,L,J,M,H=D,P=H.config;if(P.debug){if(G){N=P.logExclude;L=P.logInclude;if(L&&!(G in L)){K=1;}else{if(N&&(G in N)){K=1;}}}if(!K){if(P.useBrowserConsole){J=(G)?G+": "+I:I;if(H.Lang.isFunction(P.logFn)){P.logFn(I,Q,G);}else{if(typeof console!=B&&console.log){M=(Q&&console[Q]&&(Q in C))?Q:"log";console[M](J);}else{if(typeof opera!=B){opera.postError(J);}}}}if(H.fire&&!O){if(!E){H.publish(F,{broadcast:2});E=1;}H.fire(F,{msg:I,cat:Q,src:G});}}}return H;};D.message=function(){return D.log.apply(D,arguments);};})();},"3.1.2",{requires:["yui-base"]});YUI.add("yui-later",function(A){(function(){var B=A.Lang,C=function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=A.Array(G),I,D;if(B.isString(L)){F=E[L];}if(!F){}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{id:D,interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};};A.later=C;B.later=C;})();},"3.1.2",{requires:["yui-base"]});YUI.add("yui-throttle",function(Y){
var throttle=function(fn,ms){ms=(ms)?ms:(Y.config.throttleTime||150);if(ms===-1){return(function(){fn.apply(null,arguments);});}var last=(new Date()).getTime();return(function(){var now=(new Date()).getTime();if(now-last>ms){last=now;fn.apply(null,arguments);}});};Y.throttle=throttle;},"3.1.2",{requires:["yui-base"]});YUI.add("yui",function(A){},"3.1.2",{use:["yui-base","get","intl-base","yui-log","yui-later","yui-throttle"]});
var YUI3_config = { 'base' : '/extension/ezjscore/design/standard/lib/yui/3.1.2/build/', modules: {} };
YUI( YUI3_config ).add('io-ez', function( Y )
{
var _rootUrl = '/', _serverUrl = _rootUrl + 'ezjscore/', _seperator = '@SEPERATOR$', _configBak;
function _ez( callArgs, c )
{
callArgs = callArgs.join !== undefined ? callArgs.join( _seperator ) : callArgs;
var url = _serverUrl + 'call/';
if ( c === undefined )
c = {on:{}, data: '', headers: {}, method: 'POST'};
else
c = Y.merge( {on:{}, data: '', headers: {}, method: 'POST'}, c );
if ( c.method === 'POST' )
c.data += ( c.data !== '' ? '&' : '' ) + 'ezjscServer_function_arguments=' + callArgs;
else
url += encodeURIComponent( callArgs );
c.headers.Accept = 'application/json,text/javascript,*/*';
if ( c.on.success !== undefined )
c.on.successCallback = c.on.success;
c.on.success = _ioezSuccess;
_configBak = c;
return Y.io( url, c );
}
function _ioezSuccess( id, o )
{
if ( o.responseJSON === undefined )
{
var returnObject = {'responseJSON': Y.JSON.parse( o.responseText ),
'readyState': o.readyState,
'responseText': o.responseText,
'responseXML': o.responseXML,
'status': o.status,
'statusText': o.statusText
};
}
else
{
var returnObject = o;
}
var c = _configBak;
if ( c.on.successCallback !== undefined )
{
if ( c.arguments !== undefined )
c.on.successCallback( id, returnObject, c.arguments );
else
c.on.successCallback( id, returnObject, null );
}
else if ( window.console !== undefined )
{
if ( returnObject.responseJSON.error_text )
window.console.error( 'Y.ez(): ' + returnObject.responseJSON.error_text );
else
window.console.log( 'Y.ez(): ' + returnObject.responseJSON.content );
}
}
_ez.url = _serverUrl;
_ez.root_url = _rootUrl;
_ez.seperator = _seperator;
Y.io.ez = _ez;
}, '3.0.0' ,{requires:['io-base', 'json-parse']});
function handleSelect(type,args,obj) {
var dates = args[0];
var date = dates[0];
var year = date[0], month = date[1], day = date[2];
var objIDArray = obj.id.split( '_' );
var id = objIDArray[3];
var datatype = objIDArray[1];
var base = objIDArray[0];
var txtYear = document.getElementsByName( base + '_' + datatype + '_year_' + id );
txtYear[0].value = year;
var txtMonth = document.getElementsByName( base + '_' + datatype + '_month_' + id );
txtMonth[0].value = month;
var txtDay = document.getElementsByName( base + '_' + datatype + '_day_' + id );
txtDay[0].value = day;
window['cal'+id].hide();
}
function showDatePicker( base, id, datatype ) {
var calIconID = base + '_' + datatype + '_cal_' + id;
var calContainerID = base + '_' + datatype + '_cal_container_' + id;
var calContainer = document.getElementById( calContainerID );
var xy = YAHOO.util.Dom.getXY( calIconID );
calContainer.style.left = ( xy[0] + 26 ) + 'px';
calContainer.style.top = ( xy[1] + 30 ) + 'px';
calContainer.style.display = 'block';
window['cal'+id] = new YAHOO.widget.Calendar( base + '_' + datatype + '_cal_' + id , calContainerID, { close: true,
mindate: "1/1/1970",
LOCALE_WEEKDAYS: "medium" } );
window['cal'+id].render();
window['cal'+id].selectEvent.subscribe( handleSelect, window['cal'+id], true );
}
YUI().use( 'node', function(Y)
{
Y.on( 'domready', function()
{
if ( Y.Node.get( '#country' ) )
{
updateSubdivisions( Y.Node.get( '#country' ) );
}
if ( Y.Node.get( '#shipping-checkbox' ) )
{
if ( Y.Node.get( '#s_country' ) )
{
updateSubdivisions( Y.Node.get( '#s_country' ) );
}
Y.on( 'change', function( e )
{
if ( Y.Node.get( '#shipping-checkbox' ).get( 'checked' ) )
{
updateShipping();
}
updateSubdivisions( e.currentTarget );
}, '#country');
Y.on( 'change', function( e )
{
if ( !Y.Node.get( '#shipping-checkbox' ).get( 'checked' ) )
{
updateShipping();
}
updateSubdivisions( e.currentTarget );
}, '#s_country');
Y.on( 'click', function( e )
{
changeShipping();
updateShipping();
}, '#shipping-checkbox');
}
});
});
YUI().use("node", "event-mouseenter", function(Y) {
if ( Y.Node.get("#AutomaticDeliveryTooltip")) {
var nodeTip = Y.one("#AutomaticDeliveryTooltip")
Y.on("mouseenter", function (e) {
nodeTip.removeClass('hide');
}, "#overlay-text p");
Y.on("mouseleave", function (e) {
nodeTip.addClass('hide');
}, "#overlay-text p");
}
});
function ShowHide(id)
{
YUI().use( 'node', function(Y)
{
var node = Y.one( id );
if ( node.hasClass( 'hide') )
{
node.removeClass('hide');
node.addClass('show');
}
else
{
node.removeClass('show');
node.addClass('hide');
}
});
}
function ezjson(uri, callback, args)
{
YUI().use('node', 'io', 'io-ez', 'dump', 'json-parse', function(Y)
{
function onFailure(transactionid, response)
{
Y.log('Async call failed!');
}
function onComplete(transactionid, response, callback, args)
{
Y.log('RAW JSON DATA: ' + response.responseText);
try
{
var data = null;
data = Y.JSON.parse(response.responseText);
Y.log('PARSED DATA: ' + Y.Lang.dump(data));
}
catch (e)
{
Y.log('JSON Parse failed!');
return;
}
callback(data, args);
}
Y.on('io:failure', onFailure, this);
Y.on('io:complete', onComplete, this, callback, args);
transaction = Y.io('/xrowecommerce/json/' + uri, callback);
});
}
function updateSubdivisions( country_node )
{
YUI().use( 'node', 'io', 'io-ez', function( Y )
{
var country = country_node.get( 'options' ).item( country_node.get( 'selectedIndex' ) ).get( 'value' );
Y.io.ez( 'xrowecommerce::getSubdivisions::' + country,
{
arguments: country_node,
on:
{
success: function( id, r, country_node)
{
YUI().use('node', function(Y)
{
var data = r.responseJSON.content;
if( country_node.get('id') == 'country' )
{
var subdivision_node = Y.Node.get( '#state' );
}
else
{
var subdivision_node = Y.Node.get( '#s_state' );
}
if ( subdivision_node.get( 'selectedIndex' ) > 0 )
{
var stateSelIndex = subdivision_node.get( 'selectedIndex' );
var oldStateValue = subdivision_node.get( 'options' ).item( stateSelIndex ).get( 'value' );
}
if ( !oldStateValue )
{
if( country_node.get('id') == 'country' && Y.Node.get( '#hidden_state' ) )
{
var oldStateValue = Y.Node.get( '#hidden_state' ).get( 'value' );
}
else if ( country_node.get('id') == 's_country' && Y.Node.get( '#hidden_s_state' ) )
{
var oldStateValue = Y.Node.get( '#hidden_s_state' ).get( 'value' );
}
}
var nodes = subdivision_node.all( 'option' );
var deleteNodes = function(n, a, b)
{
n.get( 'parentNode' ).removeChild(n);
};
nodes.each(deleteNodes);
var node = Y.Node.create( '<option>&nbsp;</option>' );
subdivision_node.appendChild(node);
var index = 0;
for (i in data )
{
index++;
if (oldStateValue == i)
{
var stateSelected = index;
}
var node = Y.Node.create( '<option value="' + i + '">' + data[i] + '</option>' );
subdivision_node.appendChild(node);
}
if ( typeof( stateSelected ) != 'undefined' )
{
subdivision_node.set( 'selectedIndex', stateSelected );
}
else
{
subdivision_node.set('selectedIndex', 0);
}
});
}
}
});
});
}
function updateShipping()
{
YUI().use( 'node', 'io', 'io-ez', 'dump', 'json-parse', function( Y )
{
if ( !Y.Node.get('#shippingtype') )
{
return false;
}
if ( Y.Node.get( '#shipping-checkbox' ).get( 'checked' ) )
{
var selectedIndex = Y.Node.get( '#country' ).get( 'selectedIndex' );
var country = Y.Node.get( '#country' ).get( 'options' ).item( selectedIndex ).get( 'value' );
}
else
{
var selectedIndex = Y.Node.get( '#s_country').get( 'selectedIndex' );
var country = Y.Node.get( '#s_country' ).get( 'options' ).item( selectedIndex ).get( 'value' );
}
var doit = function(data)
{
if ( Y.Node.get( '#shippingtype' ).get( 'tagName' ) == 'INPUT' )
{
return false;
}
if ( Y.Node.get( '#shippingtype' ).get( 'selectedIndex' ) > 0 )
{
var oldShippSelIndex = Y.Node.get( '#shippingtype' ).get( 'selectedIndex' );
var oldname = Y.Node.get( '#shippingtype' ).get( 'options' ).item( oldShippSelIndex ).get( 'text' );
var old = Y.Node.get( '#shippingtype' ).get( 'options' ).item( oldShippSelIndex ).get( 'value' );
}
var nodes = Y.all('#shippingtype option');
var deleteNodes = function(n, a, b)
{
n.get('parentNode').removeChild(n);
};
nodes.each(deleteNodes);
var node = Y.Node.create('<option>&nbsp;</option>');
for (i = 0; i < data.length; i++)
{
if ( data[i][2] == false )
{
var node = Y.Node.create('<option value="' + data[i][1] + '" disabled>' + data[i][0] + '</option>');
}
else
{
if ( old == data[i][1] )
{
var selected = i;
}
var node = Y.Node.create('<option value="' + data[i][1] + '">' + data[i][0] + '</option>');
}
Y.Node.get( '#shippingtype' ).appendChild( node );
}
if (typeof (selected) != 'undefined')
{
Y.Node.get('#shippingtype').set('selectedIndex', selected);
}
else if ( oldShippSelIndex )
{
if ( Y.Node.get( '#shippingtype' ).get( 'selectedIndex' ) != -1 )
{
var replace = new Array();
replace['%old%'] = oldname;
var newShippSelIndex = Y.Node.get( '#shippingtype' ).get( 'selectedIndex' );
var newname = Y.Node.get( '#shippingtype' ).get( 'options' ).item( newShippSelIndex ).get( 'text' );
replace['%new%'] = newname;
if ( oldname )
{
ez18nAlert("The shipping method '%old%' is not available for your country of destination and was changed to '%new%'.", replace);
}
}
}
Y.log('INFO2: ' + Y.Lang.dump(Y.Node.get('#shippingtype').get('options')));
};
ezjson('getshipping?country=' + country, doit);
});
}
function ez18nAlert(text, args)
{
YUI().use( 'node', 'io-ez', function(Y)
{
Y.io.ez( 'xrowecommerce::translate::',
{
data: 'text=' + text,
arguments: args,
on:
{
success: function( id, r, args)
{
var data = r.responseJSON.content;
YUI().use('node', function(Y)
{
for ( var x in args)
{
data = data.replace(x, args[x]);
}
alert(data);
});
}
}
});
});
}
function changeShipping()
{
YUI().use( 'node', function(Y)
{
if (Y.Node.get( '#shipping-checkbox' ).get( 'checked' ) )
{
Y.Node.get( '#shippinginfo' ).setStyle( 'display', 'none' );
}
else
{
Y.Node.get( '#shippinginfo' ).setStyle('display', 'block' );
if ( Y.Node.get( '#s_company_name' ) && Y.Node.get( '#company_name' ) && Y.Node.get( '#company_name' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_company_name' ).set( 'value', Y.Node.get( '#company_name' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_company_additional' ) && Y.Node.get( '#company_additional' ) && Y.Node.get( '#company_additional' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_company_additional' ).set( 'value', Y.Node.get( '#company_additional' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_first_name' ) && Y.Node.get( '#first_name' ) && Y.Node.get( '#first_name' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_first_name' ).set( 'value', Y.Node.get( '#first_name' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_mi' ) && Y.Node.get( '#mi' ) && Y.Node.get( '#mi' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_mi' ).set( 'value', Y.Node.get( '#mi' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_last_name' ) && Y.Node.get( '#last_name' ) && Y.Node.get( '#last_name' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_last_name' ).set( 'value', Y.Node.get( '#last_name' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_address1' ) && Y.Node.get( '#address1' ) && Y.Node.get( '#address1' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_address1' ).set( 'value', Y.Node.get( '#address1' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_address2' ) && Y.Node.get( '#address2' ) && Y.Node.get( '#address2' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_address2' ).set( 'value', Y.Node.get( '#address2' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_city' ) && Y.Node.get( '#city' ) && Y.Node.get( '#city' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_city' ).set( 'value', Y.Node.get( '#city' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_zip' ) && Y.Node.get( '#zip' ) && Y.Node.get( '#zip' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_zip' ).set( 'value', Y.Node.get( '#zip' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_country' ) && Y.Node.get( '#country' ) && Y.Node.get( '#country' ).get( 'selectedIndex' ) != '' )
{
Y.Node.get( '#s_country' ).set( 'selectedIndex', Y.Node.get( '#country' ).get( 'selectedIndex' ) );
updateSubdivisions( Y.Node.get( '#s_country' ) );
}
if ( Y.Node.get( '#s_state' ) && Y.Node.get( '#state' ) && Y.Node.get( '#state' ).get( 'selectedIndex' ) != '' )
{
Y.Node.get( '#s_state' ).set( 'selectedIndex', Y.Node.get( '#state' ).get( 'selectedIndex' ) );
}
if ( Y.Node.get( '#s_phone' ) && Y.Node.get( '#phone' ) && Y.Node.get( '#phone' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_phone' ).set( 'value', Y.Node.get( '#phone' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_fax' ) && Y.Node.get( '#fax' ) && Y.Node.get( '#fax' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_fax' ).set( 'value', Y.Node.get( '#fax' ).get( 'value' ) );
}
if ( Y.Node.get( '#s_email' ) && Y.Node.get( '#email' ) && Y.Node.get( '#email' ).get( 'value' ) != '' )
{
Y.Node.get( '#s_email' ).set( 'value', Y.Node.get( '#email' ).get( 'value' ) );
}
}
});
};
function toggleCOS()
{
YUI().use( 'node', function(Y)
{
var container = Y.Node.get('#cos-content');
if ( container )
{
if ( container.getStyle('display') == 'block' )
{
container.setStyle('display', 'none');
}
else
{
container.setStyle('display', 'block');
}
}
});
};
function enlargeImage( imsrc, ww, wh, alttext )
{
alttext = alttext.replace(/\"/ig, '&quot;');
w1=window.open('','ImageEnlarged','width='+ww+',height='+wh+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,dependent=yes,innerHeight='+wh+',innerWidth='+ww+'');
w1.document.open();
w1.document.write("<html><head><\/head>");
w1.document.write("<body style=\"margin: 0px 0px 0px 0px;padding: 0px 0px 0px 0px;\">");
w1.document.write("<a href=\"javascript:window.close()\" title=\"" + alttext + "\" style=\"margin: 0px 0px 0px 0px;border: none;padding: 0px 0px 0px 0px;\"><img name=\"theimg\" style=\"margin: 0px 0px 0px 0px;border: none;padding: 0px 0px 0px 0px;\" src=\"" + imsrc + "\" alt=\"" + alttext + "\" /></a>");
w1.document.write("<\/body><\/html>");
w1.focus();
};
function generatePopup(node, image, imagetext, doubleclick)
{
YUI().use('node', 'overlay', 'imageloader', function(Y)
{
var xy = Y.one(node).getXY();
imageNode = Y.Node.create('<img />');
imageNode.set('id', Y.guid());
var overlay = new Y.Overlay(
{
headerContent : 'Popup: Click to close.',
bodyContent : imageNode,
width : 'auto',
height : 'auto',
centered : node,
visible : false,
xy : [ xy[0] + 10, xy[1] + 35 ]
});
if (imagetext)
{
overlay.set('footerContent', imagetext);
}
var myFirstGroup = new Y.ImgLoadGroup(
{
timeLimit : 2
});
myFirstGroup.registerImage(
{
domId : imageNode.get('id'),
srcUrl : image
});
overlay.render();
Y.on('click', Y.bind(overlay.hide, overlay), overlay.get('contentBox'));
if (doubleclick)
{
Y.on('dblclick', function(e)
{
overlay.show();
}, node);
}
else
{
Y.on('click', function(e) {
overlay.show();
}, node);
}
});
};
function change()
{
if (document.getElementById( 'shipping-checkbox' ).checked)
{
document.getElementById( 'shippinginfo' ).style.display = 'none';
}
else
{
document.getElementById( 'shippinginfo' ).style.display = 'block';
}
};
function insertAfter( newElement, targetElement )
{
var parent = targetElement.parentNode;
if ( parent.lastChild == targetElement )
{
parent.appendChild(newElement);
}
else
{
parent.insertBefore(newElement, targetElement.nextSibling);
}
}
function xrow_move( data )
{
if ( data.direction == 'up' )
x = -1;
else
x = 1;
if ( data.tr )
{
var tbody = data.tr.parentNode;
var i = data.tr.rowIndex + x;
if ( tbody.rows.length > 1 )
{
if ( i < 0 )
i += tbody.rows.length;
if ( i == tbody.rows.length )
i = 0;
tbody.removeChild( data.tr );
var nRow = tbody.insertRow( i );
tbody.replaceChild( data.tr, nRow );
}
}
}
function findAttribute( selectBoxID )
{
var selectBox = document.getElementById( selectBoxID );
if ( selectBox )
{
for ( var i = 0; i < selectBox.options.length; i++ )
{
if ( selectBox.options[i].selected == true )
return selectBox.options[i].value;
}
}
}
function findAttributeName( selectBoxID )
{
var selectBox = document.getElementById( selectBoxID );
if ( selectBox )
{
for ( var i = 0; i < selectBox.options.length; i++ )
{
if ( selectBox.options[i].selected == true )
return selectBox.options[i].text;
}
}
}
function addAttribute( attributeDivIdentifier, tbody_id, selectbox_id, noinfo_id, sortboxid, attributename, addtosortbox )
{
var attributeDiv = document.getElementById( 'xrow_attribute_' + attributeDivIdentifier );
var tbody = document.getElementById( tbody_id );
var selectBox = document.getElementById( selectbox_id );
var noinfo = document.getElementById( noinfo_id );
if ( noinfo )
{
noinfo.style.display = 'none';
}
if ( attributeDiv && tbody && selectBox )
{
var rowcount = tbody.rows.length - 1;
var newRow = document.createElement( 'TR' );
newRow.setAttribute( 'id', 'xrow_tr_attribute_' + attributeDivIdentifier );
var cell1 = document.createElement( "TD" );
cell1.vAlign = 'top';
newRow.appendChild( cell1 );
var newdiv = document.createElement( "DIV" );
cell1.appendChild( newdiv );
newdiv.innerHTML = attributeDiv.innerHTML;
attributeDiv.innerHTML = '';
if ( rowcount > 0 )
insertAfter( newRow, tbody.lastChild );
else
tbody.appendChild( newRow );
if ( selectBox )
{
for ( var i = 0; i < selectBox.options.length; i++ )
{
if ( selectBox.options[i].value == attributeDivIdentifier )
selectBox.options[i] = null;
}
}
if ( addtosortbox )
{
var sortBox = document.getElementById( sortboxid );
if ( sortBox )
{
sortBox.options[sortBox.options.length] = new Option( attributename, attributeDivIdentifier );
}
}
}
}
function xrow_delete_template( divtag, container, identifier, name, msg, selectbox_id, noinfo_id, sortboxid )
{
if ( confirm ( msg ) )
{
var attribute_tr = document.getElementById( divtag );
if ( attribute_tr )
{
var condiv = document.getElementById( container );
if ( condiv )
condiv.innerHTML = attribute_tr.getElementsByTagName( 'TD' )[0].getElementsByTagName( 'DIV' )[0].innerHTML;
var tr_parent = attribute_tr.parentNode;
tr_parent.removeChild( attribute_tr );
}
var selectBox = document.getElementById( selectbox_id );
if ( selectBox )
{
selectBox.options[selectBox.options.length] = new Option( name, identifier );
}
if ( tr_parent && tr_parent.childNodes.length == 0 )
{
var noinfo = document.getElementById( noinfo_id );
if ( noinfo )
noinfo.style.display = 'block';
}
var sortBox = document.getElementById( sortboxid );
if ( sortBox )
{
for ( var i = 0; i < sortBox.options.length; i++ )
{
if ( sortBox.options[i].value == identifier )
sortBox.options[i] = null;
}
}
}
}
function xrow_confirm( msg, id )
{
if ( confirm( msg ) )
{
var formular = document.getElementById( id );
return formular.submit();
}
}
function addVariation( fromid, toid )
{
var fromtr = document.getElementById( fromid );
var to_tbody = document.getElementById( toid );
if ( fromtr && to_tbody )
{
var newindex = to_tbody.rows.length-1;
var temphtml = '';
var pattern1 = /xxxrownumberxxx/gi;
var pattern2 = /DefaultXrowProductVariation/gi;
var newRow = document.createElement( 'TR' );
if ( newindex % 2 == 0 )
newRow.className = 'bgdark';
else
newRow.className = 'bglight';
if ( newindex > 0 )
insertAfter( newRow, to_tbody.lastChild );
else
to_tbody.appendChild( newRow );
var child = false;
var newtd = false;
var tdchildren = fromtr.childNodes;
for ( var i = 0; i < tdchildren.length; i++ )
{
if ( tdchildren[i].nodeName == 'TD' )
{
child = tdchildren[i];
newtd = document.createElement( 'TD' );
if ( newRow.childNodes.length > 0 )
insertAfter( newtd, newRow.lastChild );
else
newRow.appendChild( newtd );
newdiv = document.createElement( 'DIV' );
newtd.className = child.className;
newtd.appendChild( newdiv );
temphtml = child.innerHTML;
temphtml = temphtml.replace( pattern1, newindex);
temphtml = temphtml.replace( pattern2, 'XrowProductVariation' );
newdiv.innerHTML = temphtml;
}
}
newindex++;
}
}
function xrowaddpriceline( fromid, toid, line )
{
var fromtr = document.getElementById( fromid );
var to_tbody = document.getElementById( toid );
if ( fromtr && to_tbody )
{
var temphtml = fromtr.innerHTML;
var pattern1 = /xxxrownumberxxx/gi;
temphtml = temphtml.replace( pattern1, line);
var pattern2 = /DefaultXrowProductVariation/gi;
temphtml = temphtml.replace( pattern2, 'XrowProductVariation' );
var newindex = to_tbody.rows.length;
var newRow = document.createElement( 'TR' );
if ( newindex % 2 == 0 )
newRow.className = 'bgdark';
else
newRow.className = 'bglight';
if ( newindex > 0 )
insertAfter( newRow, to_tbody.lastChild );
else
to_tbody.appendChild( newRow );
var newtd = document.createElement( 'TD' );
newRow.appendChild( newtd );
var newdiv = document.createElement( 'DIV' );
newtd.appendChild( newdiv );
newdiv.innerHTML = temphtml;
}
}

