/* * jQuery JavaScript Library v1.3.2 * http://jquery.com/ * * Copyright (c) 2009 John Resig * Dual licensed under the MIT and GPL licenses. * http://docs.jquery.com/License * * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) * Revision: 6246 */ (function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); /* * Sizzle CSS Selector Engine - v0.9.3 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();var err; function getposOffset(overlay, offsettype) { var totaloffset = (offsettype=="left") ? overlay.offsetLeft : overlay.offsetTop; var parentEl = overlay.offsetParent; while (parentEl!=null) { totaloffset = (offsettype=="left") ? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl = parentEl.offsetParent; } return totaloffset; } function SwitchWidgetEdit(sender, id, act, hid1, hid2, hid3, btn) { if (id == 'ID') { return; } var d = document.getElementById('EditVidget'); var f = document.getElementById('EditVidgetForm'); var e = document.getElementById('EditVidgetEdit'); var h = document.getElementById('EditVidgetID'); var h1 = document.getElementById('EditVidgetH1'); var h2 = document.getElementById('EditVidgetH2'); var h3 = document.getElementById('EditVidgetH3'); var b = document.getElementById('EditVidgetBtn'); if(d.style.display == "none") { xpos = getposOffset(sender, "left"); ypos = getposOffset(sender, "top") + 20; d.style.position = 'absolute'; d.style.left = xpos + 'px'; d.style.top = ypos + 'px'; e.value = sender.innerHTML; h.value = id; h1.value = hid1; h2.value = hid2; h3.value = hid3; if(btn) { b.value = btn; } else { b.value = 'Set'; } document.getElementById('EditVidget').style.display = "block"; b.onclick = function(){ edit_entity_field_value_editControl(id); document.getElementById('EditVidget').style.display = "none"; } } else { document.getElementById('EditVidget').style.display = "none"; } } edit_entity_field_value_editControl = function(id) { tinyMCE.triggerSave(); var url = './exec/edit_entity_field_value.php'; var pars = 'ajax=1&'+Form.serialize('EditVidgetForm'); var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } function SwitchWidgetText(sender, id, act, hid1, hid2, hid3, btn) { if (id == 'ID') { return; } var d = document.getElementById('TextVidget'); var f = document.getElementById('TextVidgetForm'); var e = document.getElementById('TextVidgetEdit'); var h = document.getElementById('TextVidgetID'); var h1 = document.getElementById('TextVidgetH1'); var h2 = document.getElementById('TextVidgetH2'); var h3 = document.getElementById('TextVidgetH3'); var b = document.getElementById('TextVidgetBtn'); if(d.style.display == "none") { xpos = getposOffset(sender, "left"); ypos = getposOffset(sender, "top") + 20; d.style.position = 'absolute'; d.style.left = xpos + 'px'; d.style.top = ypos + 'px'; e.value = sender.innerHTML; h.value = id; h1.value = hid1; h2.value = hid2; h3.value = hid3; if(btn) { b.value = btn; } else { b.value = 'Set'; } document.getElementById('TextVidget').style.display = "block"; b.onclick = function(){ edit_entity_field_value_textControl(id); document.getElementById('TextVidget').style.display = "none"; } } else { document.getElementById('TextVidget').style.display = "none"; } tinyMCE.updateContent('TextVidgetEdit'); } edit_entity_field_value_textControl = function(id) { tinyMCE.triggerSave(); var url = './exec/edit_entity_field_value.php'; var pars = 'ajax=1&'+Form.serialize('TextVidgetForm'); var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } edit_banned_user = function(id, uid) { var url = './exec/ajax_edit_banned.php'; var pars = 'ajax=1&uid='+uid+'&ban=1'; var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } edit_unbanned_user = function(id, uid) { var url = './exec/ajax_edit_banned.php'; var pars = 'ajax=1&uid='+uid+'&ban=0'; var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } UpdateComboControl = function(id, id_form) { tinyMCE.triggerSave(); var url = './exec/ajax_edit_entity_field_value.php'; var pars = 'ajax=1&combo=1&'+Form.serialize(id_form); var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } UpdateAgesControl = function(id) { tinyMCE.triggerSave(); var url = './exec/edit_banner_ages_value.php'; var pars = 'ajax=1&'+Form.serialize(id); var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } UpdateCountriesControl = function(id) { tinyMCE.triggerSave(); var url = './exec/edit_banner_countries_value.php'; var pars = 'ajax=1&'+Form.serialize(id); var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: loaderLedShower(0)} ); } loaderLedShower = function(b) { if(b==1) { new Effect.Appear($('loaderLed'), {duration: 1}); //Element.show('loaderLed'); } else if(b==0) { //Element.hide('loaderLed'); new Effect.Fade($('loaderLed'), {duration: 1}); } } hide_tr_question = function(id, status) { if (status == 3) { document.getElementById(id).style.display = 'none'; } loaderLedShower(0); } change_status = function(id, qid, status, tr_question) { var url = './exec/ajax_change_status.php'; var pars = 'ajax=1&'+'qid='+qid+'&status='+status; var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: hide_tr_question(tr_question, status)} ); } hide_tr_banner = function(id) { document.getElementById(id).style.display = 'none'; loaderLedShower(0); } delete_banner = function(id, bid, tr_ban) { var url = './exec/ajax_delete_banner.php'; var pars = 'ajax=1&'+'bid='+bid; var myAjax = new Ajax.Updater(id, url, {method: 'post', parameters: pars, evalScripts:true, onLoading: loaderLedShower(1), onComplete: hide_tr_banner(tr_ban)} ); } function addOption (oListbox, text, value, isDefaultSelected, isSelected) { var oOption = document.createElement("option"); oOption.appendChild(document.createTextNode(text)); oOption.setAttribute("value", value); if (isDefaultSelected) oOption.defaultSelected = true; else if (isSelected) oOption.selected = true; oListbox.appendChild(oOption); }if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i= MAX_WIDTH) { NORMAL_WIDTH = MAX_WIDTH - 1; } if (NORMAL_HEIGHT >= MAX_HEIGHT) { NORMAL_HEIGHT = MAX_HEIGHT - 1; } TMP_HEIGHT = ROW_COUNT * NORMAL_HEIGHT; curObj = null; bigObj = null; toDefault(); render(); } function toDefault() { for (var i = 0; i < COL_COUNT; i++) { x_axe[i] = NORMAL_WIDTH; } for (var i = 0; i < ROW_COUNT; i++) { y_axe[i] = NORMAL_HEIGHT; } } function toRoundAll() { var count = 0; for (var i = 0; i < COL_COUNT; i++) { x_axe[i] = Math.floor(x_axe[i]); if (0 != i) count += x_axe[i]; } if (curObj != null) x_axe[0] = current_width - count; count = 0; for (var i = 0; i < ROW_COUNT; i++) { y_axe[i] = Math.floor(y_axe[i]); if (0 != i) count += y_axe[i]; } if (curObj != null) y_axe[0] = TMP_HEIGHT - count; } function render() { var x_axe_tmp = new Array(); var y_axe_tmp = new Array(); if (curCol == null) { var count = 0; for (var i = 0; i < COL_COUNT; i++) { x_axe_tmp[i] = Math.round(x_axe[i]); if (0 != i) count += x_axe_tmp[i]; } x_axe_tmp[0] = current_width - count; } else { var count = 0; for (var i = 0; i < COL_COUNT; i++) { x_axe_tmp[i] = Math.round(x_axe[i]); if (curCol != i) count += x_axe_tmp[i]; } x_axe_tmp[curCol] = current_width - count; } if (curRow == null) { count = 0; for (var i = 0; i < ROW_COUNT; i++) { y_axe_tmp[i] = Math.round(y_axe[i]); if (0 != i) count += y_axe_tmp[i]; } y_axe_tmp[0] = TMP_HEIGHT - count; } else { count = 0; for (var i = 0; i < ROW_COUNT; i++) { y_axe_tmp[i] = Math.round(y_axe[i]); if (curRow != i) count += y_axe_tmp[i]; } y_axe_tmp[curRow] = TMP_HEIGHT - count; } for (var i = 0; i < COL_COUNT; i++) { for (var j = 0; j < ROW_COUNT; j++) { m = j * COL_COUNT + i; var obj = document.getElementById('cell_' + m); if (obj != undefined) { obj.style.width = Math.round(x_axe_tmp[i]) - 2 + 'px'; obj.style.height = Math.round(y_axe_tmp[j]) - 2 + 'px'; obj.style.float = 'left'; } } } } var delay_obj; var delay_event; function mMove(obj, event) { var col = parseInt(obj.id.substr(5)) % COL_COUNT; var row = Math.ceil(parseInt((obj.id.substr(5) - col) / COL_COUNT)); var m = row * COL_COUNT + col; if (curObj == obj) return; delay_obj = obj; delay_event = event; clearInterval(t_delay); t_delay = setInterval('delay_call()', DELAY * 3); return; } function delay_call() { clearInterval(t_delay); var obj = delay_obj; var event = delay_event; if (zooming) return; zooming = true; resizeX = true; resizeY = true; if (delay_obj != null) { bigObj = curObj; bigSt = curSt; bigRow = curRow; bigCol = curCol; curObj = obj; curSt = obj.style; curCol = parseInt(obj.id.substr(5)) % COL_COUNT; curRow = Math.ceil(parseInt((obj.id.substr(5) - curCol) / COL_COUNT)); var count = 0; farCurRow = getCountFarRow(); farCurCol = getCountFarCol(); partCol = ((COL_COUNT - farCurCol - 1) + (farCurCol * KOEF)); partRow = ((ROW_COUNT - farCurRow - 1) + (farCurRow * KOEF)); var delta_width = current_width - MAX_WIDTH; var delta_height = TMP_HEIGHT - MAX_HEIGHT; if (NORMAL_WIDTH + 7 <= MAX_WIDTH) { for (var i = 0; i < COL_COUNT; i++) { if (i != curCol) { m = isColFar(i); if (m == 1) // near { x_axe_step[i] = (delta_width / partCol * KOEF - x_axe[i]) / spec; } else if (m == 3) //far { x_axe_step[i] = (delta_width / partCol - x_axe[i]) / spec; } count += x_axe_step[i]; } } x_axe_step[curCol] = - count; } else { resizeX = false; for (var i = 0; i < COL_COUNT; i++) x_axe_step[i] = 0; } if (NORMAL_HEIGHT + 7 <= MAX_HEIGHT) { count = 0; for (var i = 0; i < ROW_COUNT; i++) { if (i != curRow) { m = isRowFar(i); if (m == 1) // near { y_axe_step[i] = (delta_height / partRow * KOEF - y_axe[i]) / spec; } else if (m == 3) //far { y_axe_step[i] = (delta_height / partRow - y_axe[i]) / spec; } count += y_axe_step[i]; } } y_axe_step[curRow] = - count; } else { resizeY = false; for (var i = 0; i < ROW_COUNT; i++) y_axe_step[i] = 0; } } else { for (var i = 0; i < COL_COUNT; i++) { x_axe_step[i] = (NORMAL_WIDTH - x_axe[i]) / spec; } for (var i = 0; i < ROW_COUNT; i++) { y_axe_step[i] = (NORMAL_HEIGHT - y_axe[i]) / spec; } } loop = spec; if (resizeX || resizeY) { clearInterval(t_resizing); t_resizing = setInterval('zoom()', 1); } else { zooming = false; } return; } var spec = 15; var loop; var farCurRow; var farCurCol; var partCol; var partRow; var KOEF = 1; var c = 0; function zoom() { for (var i = 0; i < COL_COUNT; i++) { x_axe[i] += x_axe_step[i]; } for (var i = 0; i < ROW_COUNT; i++) { y_axe[i] += y_axe_step[i]; } if (!--loop) { if (curObj == null) toDefault(); $(".cellInfo").hide(); if (delay_obj != null) $("#" + delay_obj.id + " .cellInfo").show(); clearInterval(t_resizing); zooming = false; } render(); } //----------------------------------------------------------- function isRowFar(row) { if (row == curRow) return 2; else if ( (row + 1 == curRow) || (row - 1 == curRow) ) return 1; return 3; } function isColFar(col) { if (col == curCol) return 2; else if ( (col + 1 == curCol) || (col - 1 == curCol) ) return 1; return 3; } //----------------------------------------------------------- function getCountFarCol() { if (curObj != null) { if (curCol == 0 || curCol == COL_COUNT - 1) return 1; else return 2; } return 0; } function getCountFarRow() { if (curObj != null) { if (curRow == 0 || curRow == ROW_COUNT - 1) return 1; else return 2; } return 0; } function control_move(e) { if (document.getElementById('container') == undefined) return; if (ROW_COUNT == 0) return; if (zooming) return; e = e || event; var o = e.target || e.srcElement; if (o.getAttribute('name') == 'img') return; var lx = undefined == e.pageX ? e.clientX : e.pageX; var ly = undefined == e.pageY ? e.clientY : e.pageY; var obj = $('#container'); var mx = obj.offset().left; var my = obj.offset().top; if (!((lx > mx && ly > my) && ((mx + current_width) > lx && (my + TMP_HEIGHT) > ly))) { bigObj = null; bigSt = null; bigRow = null; bigCol = null; curObj = null; curSt = null; curRow = null; curCol = null; delay_obj = null; clearInterval(t_delay); t_delay = setInterval('delay_call()', DELAY); } } function pr(mes, flag, br) { if (mes == undefined) mes = ''; if (flag) if (!br) document.getElementById('displ').innerHTML += mes + '
'; else document.getElementById('displ').innerHTML += mes; else document.getElementById('displ').innerHTML = mes; } function ahrefSignActive(flag) { if (flag == 1) document.getElementById('ahref_sign').style.color = '#A45CF2'; else document.getElementById('ahref_sign').style.color = '#616265'; } var drag = false; var dragingObj; var oldX; var x; var points1 = new Array(40, 60, 80, 100, 120, 140, 160, 180); var points2 = new Array(60, 80, 90, 100, 110, 120, 130, 140); var coords = new Array(10, 37, 64, 91, 118, 145, 172, 195); //for first scroll var fFirstElemItem = 0; var fSecondElemItem = 7; //for second scroll var sFirstElemItem = 0; var sSecondElemItem = 7; function reset_draging(event) { var x = event.clientX; var y = event.clientY; /*if (!((x > f_left && x < f_left + 210) && (y > f_top && y < f_top + 60))) drag = false; */ } function dragObj(obj, state, event) { if (state && (jqueryWork == undefined || jqueryWork)) { return; } if (document.getElementById('fn_price') == undefined) return; drag = state; if (!drag && dragingObj != null) { var elem = 0; if (dragingObj.id == 'fsecond' || dragingObj.id == 'ssecond') elem = 7; var min; for (var i = 0; i < 8; i++) { if (Math.abs(coords[i] - parseInt(dragingObj.style.left)) <= Math.abs(coords[i] - coords[i + 1]) / 2) { elem = i; if (dragingObj.id == 'ffirst' && fSecondElemItem <= i) { elem = fSecondElemItem - 1; break; } if(dragingObj.id == 'fsecond' && fFirstElemItem >= i) { elem = fFirstElemItem + 1; break; } if (dragingObj.id == 'sfirst' && sSecondElemItem <= i) { elem = sSecondElemItem - 1; break; } if(dragingObj.id == 'ssecond' && sFirstElemItem >= i) { elem = sFirstElemItem + 1; break; } } } dragingObj.style.left = coords[elem] + 'px'; dragingObj.name = elem; switch (dragingObj.id) { case 'ffirst': fFirstElemItem = elem; break; case 'fsecond': fSecondElemItem = elem; break; case 'sfirst': sFirstElemItem = elem; break; case 'ssecond': sSecondElemItem = elem; break; } if (dragingObj.id.substr(0,1) == 'f') { document.getElementById('fn_price').innerHTML = '$' + points1[Math.min(fFirstElemItem, fSecondElemItem)] + ' - ' + '$' + points1[Math.max(fFirstElemItem, fSecondElemItem)]; } else if (dragingObj.id.substr(0,1) == 's') { document.getElementById('fn_count').innerHTML = points2[Math.min(sFirstElemItem, sSecondElemItem)] + ' - ' + points2[Math.max(sFirstElemItem, sSecondElemItem)]; } getFilters(); } if (obj != null && drag) { dragingObj = obj; oldX = event.clientX; } } function move(event) { if (drag) { x = event.clientX; var g = parseInt(dragingObj.style.left) + x - oldX; if (dragingObj.id == 'ffirst' && g >= 10 && g <= coords[fSecondElemItem]) dragingObj.style.left = g + 'px'; if (dragingObj.id == 'fsecond' && g >= coords[fFirstElemItem] && g <= 195) dragingObj.style.left = g + 'px'; if (dragingObj.id == 'sfirst' && g >= 10 && g <= coords[sSecondElemItem]) dragingObj.style.left = g + 'px'; if (dragingObj.id == 'ssecond' && g >= coords[sFirstElemItem] && g <= 195) dragingObj.style.left = g + 'px'; oldX = x; } }function preventSelection(c){var d=false;function e(f,h,g){if(f.attachEvent){f.attachEvent("on"+h,g)}else{if(f.addEventListener){f.addEventListener(h,g,false)}}}function b(){if(window.getSelection){window.getSelection().removeAllRanges()}else{if(document.selection&&document.selection.clear){document.selection.clear()}}}function a(h){var h=h||window.event;var g=h.target||h.srcElement;if(g.tagName.match(/INPUT|TEXTAREA/i)){return}var f=h.keyCode||h.which;if(h.ctrlKey&&f=="A".charCodeAt(0)){b();if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}}}e(c,"mousemove",function(){if(d){b()}});e(c,"mousedown",function(g){var g=g||window.event;var f=g.target||g.srcElement;d=!f.tagName.match(/INPUT|TEXTAREA/i)});e(c,"mouseup",function(){if(d){b()}d=false});e(c,"keydown",a);e(c,"keyup",a)}preventSelection(document);/* * jQuery UI 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ ;jQuery.ui || (function($) { var _remove = $.fn.remove, isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); //Helper functions and ui object $.ui = { version: "1.7.2", // $.ui.plugin is deprecated. Use the proxy pattern instead. plugin: { add: function(module, option, set) { var proto = $.ui[module].prototype; for(var i in set) { proto.plugins[i] = proto.plugins[i] || []; proto.plugins[i].push([option, set[i]]); } }, call: function(instance, name, args) { var set = instance.plugins[name]; if(!set || !instance.element[0].parentNode) { return; } for (var i = 0; i < set.length; i++) { if (instance.options[set[i][0]]) { set[i][1].apply(instance.element, args); } } } }, contains: function(a, b) { return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b); }, hasScroll: function(el, a) { //If overflow is hidden, the element might have extra content, but the user wants to hide it if ($(el).css('overflow') == 'hidden') { return false; } var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', has = false; if (el[scroll] > 0) { return true; } // TODO: determine which cases actually cause this to happen // if the element doesn't have the scroll set, see if it's possible to // set the scroll el[scroll] = 1; has = (el[scroll] > 0); el[scroll] = 0; return has; }, isOverAxis: function(x, reference, size) { //Determines when x coordinate is over "b" element axis return (x > reference) && (x < (reference + size)); }, isOver: function(y, x, top, left, height, width) { //Determines when x, y coordinates is over "b" element return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); }, keyCode: { BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 } }; // WAI-ARIA normalization if (isFF2) { var attr = $.attr, removeAttr = $.fn.removeAttr, ariaNS = "http://www.w3.org/2005/07/aaa", ariaState = /^aria-/, ariaRole = /^wairole:/; $.attr = function(elem, name, value) { var set = value !== undefined; return (name == 'role' ? (set ? attr.call(this, elem, name, "wairole:" + value) : (attr.apply(this, arguments) || "").replace(ariaRole, "")) : (ariaState.test(name) ? (set ? elem.setAttributeNS(ariaNS, name.replace(ariaState, "aaa:"), value) : attr.call(this, elem, name.replace(ariaState, "aaa:"))) : attr.apply(this, arguments))); }; $.fn.removeAttr = function(name) { return (ariaState.test(name) ? this.each(function() { this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); }) : removeAttr.call(this, name)); }; } //jQuery plugins $.fn.extend({ remove: function() { // Safari has a native remove event which actually removes DOM elements, // so we have to use triggerHandler instead of trigger (#3037). $("*", this).add(this).each(function() { $(this).triggerHandler("remove"); }); return _remove.apply(this, arguments ); }, enableSelection: function() { return this .attr('unselectable', 'off') .css('MozUserSelect', '') .unbind('selectstart.ui'); }, disableSelection: function() { return this .attr('unselectable', 'on') .css('MozUserSelect', 'none') .bind('selectstart.ui', function() { return false; }); }, scrollParent: function() { var scrollParent; if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { scrollParent = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); }).eq(0); } else { scrollParent = this.parents().filter(function() { return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); }).eq(0); } return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; } }); //Additional selectors $.extend($.expr[':'], { data: function(elem, i, match) { return !!$.data(elem, match[3]); }, focusable: function(element) { var nodeName = element.nodeName.toLowerCase(), tabIndex = $.attr(element, 'tabindex'); return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : 'a' == nodeName || 'area' == nodeName ? element.href || !isNaN(tabIndex) : !isNaN(tabIndex)) // the element and all of its ancestors must be visible // the browser may report that the area is hidden && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; }, tabbable: function(element) { var tabIndex = $.attr(element, 'tabindex'); return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); } }); // $.widget is a factory to create jQuery plugins // taking some boilerplate code out of the plugin code function getter(namespace, plugin, method, args) { function getMethods(type) { var methods = $[namespace][plugin][type] || []; return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); } var methods = getMethods('getter'); if (args.length == 1 && typeof args[0] == 'string') { methods = methods.concat(getMethods('getterSetter')); } return ($.inArray(method, methods) != -1); } $.widget = function(name, prototype) { var namespace = name.split(".")[0]; name = name.split(".")[1]; // create plugin method $.fn[name] = function(options) { var isMethodCall = (typeof options == 'string'), args = Array.prototype.slice.call(arguments, 1); // prevent calls to internal methods if (isMethodCall && options.substring(0, 1) == '_') { return this; } // handle getter methods if (isMethodCall && getter(namespace, name, options, args)) { var instance = $.data(this[0], name); return (instance ? instance[options].apply(instance, args) : undefined); } // handle initialization and non-getter methods return this.each(function() { var instance = $.data(this, name); // constructor (!instance && !isMethodCall && $.data(this, name, new $[namespace][name](this, options))._init()); // method call (instance && isMethodCall && $.isFunction(instance[options]) && instance[options].apply(instance, args)); }); }; // create widget constructor $[namespace] = $[namespace] || {}; $[namespace][name] = function(element, options) { var self = this; this.namespace = namespace; this.widgetName = name; this.widgetEventPrefix = $[namespace][name].eventPrefix || name; this.widgetBaseClass = namespace + '-' + name; this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, $.metadata && $.metadata.get(element)[name], options); this.element = $(element) .bind('setData.' + name, function(event, key, value) { if (event.target == element) { return self._setData(key, value); } }) .bind('getData.' + name, function(event, key) { if (event.target == element) { return self._getData(key); } }) .bind('remove', function() { return self.destroy(); }); }; // add widget prototype $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); // TODO: merge getter and getterSetter properties from widget prototype // and plugin prototype $[namespace][name].getterSetter = 'option'; }; $.widget.prototype = { _init: function() {}, destroy: function() { this.element.removeData(this.widgetName) .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') .removeAttr('aria-disabled'); }, option: function(key, value) { var options = key, self = this; if (typeof key == "string") { if (value === undefined) { return this._getData(key); } options = {}; options[key] = value; } $.each(options, function(key, value) { self._setData(key, value); }); }, _getData: function(key) { return this.options[key]; }, _setData: function(key, value) { this.options[key] = value; if (key == 'disabled') { this.element [value ? 'addClass' : 'removeClass']( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') .attr("aria-disabled", value); } }, enable: function() { this._setData('disabled', false); }, disable: function() { this._setData('disabled', true); }, _trigger: function(type, event, data) { var callback = this.options[type], eventName = (type == this.widgetEventPrefix ? type : this.widgetEventPrefix + type); event = $.Event(event); event.type = eventName; // copy original event properties over to the new event // this would happen if we could call $.event.fix instead of $.Event // but we don't have a way to force an event to be fixed multiple times if (event.originalEvent) { for (var i = $.event.props.length, prop; i;) { prop = $.event.props[--i]; event[prop] = event.originalEvent[prop]; } } this.element.trigger(event, data); return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false || event.isDefaultPrevented()); } }; $.widget.defaults = { disabled: false }; /** Mouse Interaction Plugin **/ $.ui.mouse = { _mouseInit: function() { var self = this; this.element .bind('mousedown.'+this.widgetName, function(event) { return self._mouseDown(event); }) .bind('click.'+this.widgetName, function(event) { if(self._preventClickEvent) { self._preventClickEvent = false; event.stopImmediatePropagation(); return false; } }); // Prevent text selection in IE if ($.browser.msie) { this._mouseUnselectable = this.element.attr('unselectable'); this.element.attr('unselectable', 'on'); } this.started = false; }, // TODO: make sure destroying one instance of mouse doesn't mess with // other instances of mouse _mouseDestroy: function() { this.element.unbind('.'+this.widgetName); // Restore text selection in IE ($.browser.msie && this.element.attr('unselectable', this._mouseUnselectable)); }, _mouseDown: function(event) { // don't let more than one widget handle mouseStart // TODO: figure out why we have to use originalEvent event.originalEvent = event.originalEvent || {}; if (event.originalEvent.mouseHandled) { return; } // we may have missed mouseup (out of window) (this._mouseStarted && this._mouseUp(event)); this._mouseDownEvent = event; var self = this, btnIsLeft = (event.which == 1), elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function() { self.mouseDelayMet = true; }, this.options.delay); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(event) !== false); if (!this._mouseStarted) { event.preventDefault(); return true; } } // these delegates are required to keep context this._mouseMoveDelegate = function(event) { return self._mouseMove(event); }; this._mouseUpDelegate = function(event) { return self._mouseUp(event); }; $(document) .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); // preventDefault() is used to prevent the selection of text here - // however, in Safari, this causes select boxes not to be selectable // anymore, so this fix is needed ($.browser.safari || event.preventDefault()); event.originalEvent.mouseHandled = true; return true; }, _mouseMove: function(event) { // IE mouseup check - mouseup happened when mouse was out of window if ($.browser.msie && !event.button) { return this._mouseUp(event); } if (this._mouseStarted) { this._mouseDrag(event); return event.preventDefault(); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, event) !== false); (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); } return !this._mouseStarted; }, _mouseUp: function(event) { $(document) .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; this._preventClickEvent = (event.target == this._mouseDownEvent.target); this._mouseStop(event); } return false; }, _mouseDistanceMet: function(event) { return (Math.max( Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY) ) >= this.options.distance ); }, _mouseDelayMet: function(event) { return this.mouseDelayMet; }, // These are placeholder methods, to be overriden by extending plugin _mouseStart: function(event) {}, _mouseDrag: function(event) {}, _mouseStop: function(event) {}, _mouseCapture: function(event) { return true; } }; $.ui.mouse.defaults = { cancel: null, distance: 1, delay: 0 }; })(jQuery); /* * jQuery UI Slider 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Slider * * Depends: * ui.core.js */ (function($) { $.widget("ui.slider", $.extend({}, $.ui.mouse, { _init: function() { var self = this, o = this.options; this._keySliding = false; this._handleIndex = null; this._detectOrientation(); this._mouseInit(); this.element .addClass("ui-slider" + " ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all"); this.range = $([]); if (o.range) { if (o.range === true) { this.range = $('
'); if (!o.values) o.values = [this._valueMin(), this._valueMin()]; if (o.values.length && o.values.length != 2) { o.values = [o.values[0], o.values[0]]; } } else { this.range = $('
'); } this.range .appendTo(this.element) .addClass("ui-slider-range"); if (o.range == "min" || o.range == "max") { this.range.addClass("ui-slider-range-" + o.range); } // note: this isn't the most fittingly semantic framework class for this element, // but worked best visually with a variety of themes this.range.addClass("ui-widget-header"); } if ($(".ui-slider-handle", this.element).length == 0) $('') .appendTo(this.element) .addClass("ui-slider-handle"); if (o.values && o.values.length) { while ($(".ui-slider-handle", this.element).length < o.values.length) $('') .appendTo(this.element) .addClass("ui-slider-handle"); } this.handles = $(".ui-slider-handle", this.element) .addClass("ui-state-default" + " ui-corner-all"); this.handle = this.handles.eq(0); this.handles.add(this.range).filter("a") .click(function(event) { event.preventDefault(); }) .hover(function() { if (!o.disabled) { // $(this).addClass('ui-state-hover'); } }, function() { // $(this).removeClass('ui-state-hover'); }) .focus(function() { if (!o.disabled) { // $(".ui-slider .ui-state-focus").removeClass('ui-state-focus'); $(this).addClass('ui-state-focus'); } else { $(this).blur(); } }) .blur(function() { // $(this).removeClass('ui-state-focus'); }); this.handles.each(function(i) { $(this).data("index.ui-slider-handle", i); }); this.handles.keydown(function(event) { var ret = true; var index = $(this).data("index.ui-slider-handle"); if (self.options.disabled) return; switch (event.keyCode) { case $.ui.keyCode.HOME: case $.ui.keyCode.END: case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: ret = false; if (!self._keySliding) { self._keySliding = true; $(this).addClass("ui-state-active"); self._start(event, index); } break; } var curVal, newVal, step = self._step(); if (self.options.values && self.options.values.length) { curVal = newVal = self.values(index); } else { curVal = newVal = self.value(); } switch (event.keyCode) { case $.ui.keyCode.HOME: newVal = self._valueMin(); break; case $.ui.keyCode.END: newVal = self._valueMax(); break; case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: if(curVal == self._valueMax()) return; newVal = curVal + step; break; case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: if(curVal == self._valueMin()) return; newVal = curVal - step; break; } self._slide(event, index, newVal); return ret; }).keyup(function(event) { var index = $(this).data("index.ui-slider-handle"); if (self._keySliding) { self._stop(event, index); self._change(event, index); self._keySliding = false; $(this).removeClass("ui-state-active"); } }); this._refreshValue(); }, destroy: function() { this.handles.remove(); this.range.remove(); this.element .removeClass("ui-slider" + " ui-slider-horizontal" + " ui-slider-vertical" + " ui-slider-disabled" + " ui-widget" + " ui-widget-content" + " ui-corner-all") .removeData("slider") .unbind(".slider"); this._mouseDestroy(); }, _mouseCapture: function(event) { var o = this.options; if (o.disabled) return false; this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); var position = { x: event.pageX, y: event.pageY }; var normValue = this._normValueFromMouse(position); var distance = this._valueMax() - this._valueMin() + 1, closestHandle; var self = this, index; this.handles.each(function(i) { var thisDistance = Math.abs(normValue - self.values(i)); if (distance > thisDistance) { distance = thisDistance; closestHandle = $(this); index = i; } }); // workaround for bug #3736 (if both handles of a range are at 0, // the first is always used as the one with least distance, // and moving it is obviously prevented by preventing negative ranges) if(o.range == true && this.values(1) == o.min) { closestHandle = $(this.handles[++index]); } this._start(event, index); self._handleIndex = index; closestHandle .addClass("ui-state-active") .focus(); var offset = closestHandle.offset(); var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle'); this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { left: event.pageX - offset.left - (closestHandle.width() / 2), top: event.pageY - offset.top - (closestHandle.height() / 2) - (parseInt(closestHandle.css('borderTopWidth'),10) || 0) - (parseInt(closestHandle.css('borderBottomWidth'),10) || 0) + (parseInt(closestHandle.css('marginTop'),10) || 0) }; normValue = this._normValueFromMouse(position); this._slide(event, index, normValue); return true; }, _mouseStart: function(event) { return true; }, _mouseDrag: function(event) { var position = { x: event.pageX, y: event.pageY }; var normValue = this._normValueFromMouse(position); this._slide(event, this._handleIndex, normValue); return false; }, _mouseStop: function(event) { this.handles.removeClass("ui-state-active"); this._stop(event, this._handleIndex); this._change(event, this._handleIndex); this._handleIndex = null; this._clickOffset = null; return false; }, _detectOrientation: function() { this.orientation = this.options.orientation == 'vertical' ? 'vertical' : 'horizontal'; }, _normValueFromMouse: function(position) { var pixelTotal, pixelMouse; if ('horizontal' == this.orientation) { pixelTotal = this.elementSize.width; pixelMouse = position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0); } else { pixelTotal = this.elementSize.height; pixelMouse = position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0); } var percentMouse = (pixelMouse / pixelTotal); if (percentMouse > 1) percentMouse = 1; if (percentMouse < 0) percentMouse = 0; if ('vertical' == this.orientation) percentMouse = 1 - percentMouse; var valueTotal = this._valueMax() - this._valueMin(), valueMouse = percentMouse * valueTotal, valueMouseModStep = valueMouse % this.options.step, normValue = this._valueMin() + valueMouse - valueMouseModStep; if (valueMouseModStep > (this.options.step / 2)) normValue += this.options.step; // Since JavaScript has problems with large floats, round // the final value to 5 digits after the decimal point (see #4124) return parseFloat(normValue.toFixed(5)); }, _start: function(event, index) { var uiHash = { handle: this.handles[index], value: this.value() }; if (this.options.values && this.options.values.length) { uiHash.value = this.values(index); uiHash.values = this.values(); } this._trigger("start", event, uiHash); }, _slide: function(event, index, newVal) { var handle = this.handles[index]; if (this.options.values && this.options.values.length) { var otherVal = this.values(index ? 0 : 1); if ((this.options.values.length == 2 && this.options.range === true) && ((index == 0 && newVal > otherVal) || (index == 1 && newVal < otherVal))){ newVal = otherVal; } if (newVal != this.values(index)) { var newValues = this.values(); newValues[index] = newVal; // A slide can be canceled by returning false from the slide callback var allowed = this._trigger("slide", event, { handle: this.handles[index], value: newVal, values: newValues }); var otherVal = this.values(index ? 0 : 1); if (allowed !== false) { this.values(index, newVal, ( event.type == 'mousedown' && this.options.animate ), true); } } } else { if (newVal != this.value()) { // A slide can be canceled by returning false from the slide callback var allowed = this._trigger("slide", event, { handle: this.handles[index], value: newVal }); if (allowed !== false) { this._setData('value', newVal, ( event.type == 'mousedown' && this.options.animate )); } } } }, _stop: function(event, index) { var uiHash = { handle: this.handles[index], value: this.value() }; if (this.options.values && this.options.values.length) { uiHash.value = this.values(index); uiHash.values = this.values(); } this._trigger("stop", event, uiHash); }, _change: function(event, index) { var uiHash = { handle: this.handles[index], value: this.value() }; if (this.options.values && this.options.values.length) { uiHash.value = this.values(index); uiHash.values = this.values(); } this._trigger("change", event, uiHash); }, value: function(newValue) { if (arguments.length) { this._setData("value", newValue); this._change(null, 0); } return this._value(); }, values: function(index, newValue, animated, noPropagation) { if (arguments.length > 1) { this.options.values[index] = newValue; this._refreshValue(animated); if(!noPropagation) this._change(null, index); } if (arguments.length) { if (this.options.values && this.options.values.length) { return this._values(index); } else { return this.value(); } } else { return this._values(); } }, _setData: function(key, value, animated) { $.widget.prototype._setData.apply(this, arguments); switch (key) { case 'disabled': if (value) { // this.handles.filter(".ui-state-focus").blur(); // this.handles.removeClass("ui-state-hover"); this.handles.attr("disabled", "disabled"); } else { this.handles.removeAttr("disabled"); } case 'orientation': this._detectOrientation(); this.element .removeClass("ui-slider-horizontal ui-slider-vertical") .addClass("ui-slider-" + this.orientation); this._refreshValue(animated); break; case 'value': this._refreshValue(animated); break; } }, _step: function() { var step = this.options.step; return step; }, _value: function() { var val = this.options.value; if (val < this._valueMin()) val = this._valueMin(); if (val > this._valueMax()) val = this._valueMax(); return val; }, _values: function(index) { if (arguments.length) { var val = this.options.values[index]; if (val < this._valueMin()) val = this._valueMin(); if (val > this._valueMax()) val = this._valueMax(); return val; } else { return this.options.values; } }, _valueMin: function() { var valueMin = this.options.min; return valueMin; }, _valueMax: function() { var valueMax = this.options.max; return valueMax; }, _refreshValue: function(animate) { var oRange = this.options.range, o = this.options, self = this; if (this.options.values && this.options.values.length) { var vp0, vp1; this.handles.each(function(i, j) { var valPercent = (self.values(i) - self._valueMin()) / (self._valueMax() - self._valueMin()) * 100; var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%'; $(this).stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate); if (self.options.range === true) { if (self.orientation == 'horizontal') { (i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ left: valPercent + '%' }, o.animate); (i == 1) && self.range[animate ? 'animate' : 'css']({ width: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate }); } else { (i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ bottom: (valPercent) + '%' }, o.animate); (i == 1) && self.range[animate ? 'animate' : 'css']({ height: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate }); } } lastValPercent = valPercent; }); } else { var value = this.value(), valueMin = this._valueMin(), valueMax = this._valueMax(), valPercent = valueMax != valueMin ? (value - valueMin) / (valueMax - valueMin) * 100 : 0; var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%'; this.handle.stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate); (oRange == "min") && (this.orientation == "horizontal") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ width: valPercent + '%' }, o.animate); (oRange == "max") && (this.orientation == "horizontal") && this.range[animate ? 'animate' : 'css']({ width: (100 - valPercent) + '%' }, { queue: false, duration: o.animate }); (oRange == "min") && (this.orientation == "vertical") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ height: valPercent + '%' }, o.animate); (oRange == "max") && (this.orientation == "vertical") && this.range[animate ? 'animate' : 'css']({ height: (100 - valPercent) + '%' }, { queue: false, duration: o.animate }); } } })); $.extend($.ui.slider, { getter: "value values", version: "1.7.2", eventPrefix: "slide", defaults: { animate: false, delay: 0, distance: 0, max: 100, min: 0, orientation: 'horizontal', range: false, step: 1, value: 0, values: null } }); })(jQuery); function getElementsByName_iefix(tag, name) { var elem = document.getElementsByTagName(tag); var arr = new Array(); for(i = 0,iarr = 0; i < elem.length; i++) { att = elem[i].getAttribute("name"); if(att == name) { arr[iarr] = elem[i]; iarr++; } } return arr; } function isFloat(value) { return !isNaN(parseFloat(value)); } function isInt(value) { return !isNaN(parseFloat(value)); } function roundTo(num, accuracy) { num = parseFloat(num); var add = num % accuracy; num -= add; if (add > accuracy / 2) add = accuracy; else add = 0; num = num + add; return num; } function getActiveValueForSelect(id) { var selObj = document.getElementById(id); if (selObj != null && selObj != undefined && selObj.options != undefined) for (i = 0; i < selObj.options.length; i++) { if (selObj.options[i].selected) return selObj.options[i].text; } else return false; } function str_replace(search, replace, subject) { return subject.split(search).join(replace); } function isEmail(x){ return x.search(/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,}$/ig) != -1; } function simulateClick(idObj) { if (typeof Shadowbox != 'undefined') { var W = navigator.userAgent.toLowerCase(); if (W.indexOf("msie") != -1) { var cb = document.getElementById( idObj ); for (var i=0; i < cb.childNodes.length; i++) { if (cb.childNodes[i].nodeType == 1) { cb = cb.childNodes[i]; break; } } cb.click(); } else { var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); var cb = document.getElementById(idObj); for (var i=0;i < cb.childNodes.length;i++) { if (cb.childNodes[i].nodeType == 1) { cb = cb.childNodes[i]; break; } } cb.dispatchEvent(evt); } } }// BODY STYLE CONSTANTS var BODY_STYLE_CLASSIC = 1; var BODY_STYLE_SLIM = 0; var BODY_STYLE_SUPER_SLIM = 2; /* STANDART SIZES sizes: small s medium m large l x-large xl xx-large xxl fit type: super slim fit ssf slim fit sf classic fit cf */ // collar | sleeve | chest | shoulder | back len | middle | sleeve width | cuff standart_size_s_ssf = new Array(14.5, 33, 20.25, 17, 31.5, 16.5, 7.5, 8.5); standart_size_s_sf = new Array(14.5, 33, 21.25, 17, 31.5, 18, 8.375, 8.5); standart_size_s_cf = new Array(14.5, 33, 21.25, 17, 31.5, 19.5, 8.875, 8.5); standart_size_m_ssf = new Array(15.5, 34, 21.25, 18, 32.5, 18.5, 6.875, 9); standart_size_m_sf = new Array(15.5, 34, 22.25, 18, 32.5, 20, 8.75, 9); standart_size_m_cf = new Array(15.5, 34, 23.25, 18, 32.5, 21.5, 9.625, 9); standart_size_l_ssf = new Array(16.5, 35, 23.25, 19, 33.5, 20.5, 8.625, 9.25); standart_size_l_sf = new Array(16.5, 35, 24.25, 19, 33.5, 22, 9.5, 9.25); standart_size_l_cf = new Array(16.5, 35, 25.25, 19, 33.5, 23.5, 10.375, 9.25); standart_size_xl_ssf = new Array(17.5, 36, 25.25, 20, 34.5, 22.5, 9.375, 9.5); standart_size_xl_sf = new Array(17.5, 36, 26.25, 20, 34.5, 24, 10.25, 9.5); standart_size_xl_cf = new Array(17.5, 36, 27.25, 20, 34.5, 25.5, 11.125, 9.5); standart_size_xxl_ssf = new Array(18.5, 37, 27.25, 21, 35.5, 24.5, 10.125, 10); standart_size_xxl_sf = new Array(18.5, 37, 28.25, 21, 35.5, 26, 11, 10); standart_size_xxl_cf = new Array(18.5, 37, 29.25, 21, 35.5, 27.5, 11.875, 10); // special functions function excelCeil(value) { if (value > 0) return Math.ceil(value); else return Math.floor(value); } function excelFloor(value) { if (value > 0) return Math.floor(value); else return Math.ceil(value); } function excelRound(value) { if (value % 1 == -0.5) return Math.floor(value); return Math.round(value); } // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- //-- - -- - - -- - -- - -- - -- - - TABLE CONTAINING SPECIAL VALUES (CLASS) -- -- - -- - -- - - -- - -- - -- -- // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- function ChestWidthTable() { this.table; this.init = function() { this.table = new Array(); // id chest 2chest pleats fit mid-eqn 4chest body size this.table[0] = new Array(1, 37.25, 74.5, 1, 0, 71, 149, 22.5); this.table[1] = new Array(2, 36.75, 73.5, 0, 1, 71, 147, 22); this.table[2] = new Array(3, 36.5, 73, 0, 0, 70, 146, 22.5); this.table[3] = new Array(4, 36.25, 72.5, 1, 0, 69, 145, 22); this.table[4] = new Array(5, 35.75, 71.5, 0, 1, 69, 143, 21.5); this.table[5] = new Array(6, 35.5, 71, 0, 0, 68, 142, 22); this.table[6] = new Array(7, 35.25, 70.5, 1, 0, 67, 141, 21.5); this.table[7] = new Array(8, 34.75, 69.5, 0, 1, 67, 139, 21); this.table[8] = new Array(9, 34.5, 69, 0, 0, 66, 138, 21.5); this.table[9] = new Array(10, 34.25, 68.5, 1, 0, 65, 137, 21); this.table[10] = new Array(11, 33.75, 67.5, 0, 1, 65, 135, 20.5); this.table[11] = new Array(12, 33.5, 67, 0, 0, 64, 134, 21); this.table[12] = new Array(13, 33.25, 66.5, 1, 0, 63, 133, 20.5); this.table[13] = new Array(14, 32.75, 65.5, 0, 1, 63, 131, 20); this.table[14] = new Array(15, 32.5, 65, 0, 0, 62, 130, 20.5); this.table[15] = new Array(16, 32.25, 64.5, 1, 0, 61, 129, 20); this.table[16] = new Array(17, 31.75, 63.5, 0, 1, 61, 127, 19.5); this.table[17] = new Array(18, 31.5, 63, 0, 0, 60, 126, 20); this.table[18] = new Array(19, 31.25, 62.5, 1, 0, 59, 125, 19.5); this.table[19] = new Array(20, 30.75, 61.5, 0, 1, 59, 123, 19); this.table[20] = new Array(21, 30.5, 61, 0, 0, 58, 122, 19.5); this.table[21] = new Array(22, 30.25, 60.5, 1, 0, 57, 121, 19); this.table[22] = new Array(23, 29.75, 59.5, 0, 1, 57, 119, 18.5); this.table[23] = new Array(24, 29.5, 59, 0, 0, 56, 118, 19); this.table[24] = new Array(25, 29.25, 58.5, 1, 0, 55, 117, 18.5); this.table[25] = new Array(26, 28.75, 57.5, 0, 1, 55, 115, 18); this.table[26] = new Array(27, 28.5, 57, 0, 0, 54, 114, 18.5); this.table[27] = new Array(28, 28.25, 56.5, 1, 0, 53, 113, 18); this.table[28] = new Array(29, 27.75, 55.5, 0, 1, 53, 111, 17.5); this.table[29] = new Array(30, 27.5, 55, 0, 0, 52, 110, 18); this.table[30] = new Array(31, 27.25, 54.5, 1, 0, 51, 109, 17.5); this.table[31] = new Array(32, 26.75, 53.5, 0, 1, 51, 107, 17); this.table[32] = new Array(33, 26.5, 53, 0, 0, 50, 106, 17.5); this.table[33] = new Array(34, 26.25, 52.5, 1, 0, 49, 105, 17); this.table[34] = new Array(35, 25.75, 51.5, 0, 1, 49, 103, 16.5); this.table[35] = new Array(36, 25.5, 51, 0, 0, 48, 102, 17); this.table[36] = new Array(37, 25.25, 50.5, 1, 0, 47, 101, 16.5); this.table[37] = new Array(38, 24.75, 49.5, 0, 1, 47, 99, 16); this.table[38] = new Array(39, 24.5, 49, 0, 0, 46, 98, 16.5); this.table[39] = new Array(40, 24.25, 48.5, 1, 0, 45, 97, 16); this.table[40] = new Array(41, 23.75, 47.5, 0, 1, 45, 95, 15.5); this.table[41] = new Array(42, 23.5, 47, 0, 0, 44, 94, 16); this.table[42] = new Array(43, 23.25, 46.5, 1, 0, 43, 93, 15.5); this.table[43] = new Array(44, 22.75, 45.5, 0, 1, 43, 91, 15); this.table[44] = new Array(45, 22.5, 45, 0, 0, 42, 90, 15.5); this.table[45] = new Array(46, 22.25, 44.5, 1, 0, 41, 89, 15); this.table[46] = new Array(47, 21.75, 43.5, 0, 1, 41, 87, 14.5); this.table[47] = new Array(48, 21.5, 43, 0, 0, 40, 86, 15); this.table[48] = new Array(49, 21.25, 42.5, 1, 0, 39, 85, 14.5); this.table[49] = new Array(50, 20.75, 41.5, 0, 1, 39, 83, 14); this.table[50] = new Array(51, 20.5, 41, 0, 0, 38, 82, 14.5); this.table[51] = new Array(52, 20.25, 40.5, 1, 0, 37, 81, 14); this.table[52] = new Array(53, 19.5, 39, 0, 0, 36, 78, 14); } this.findNearIdByValue = function(field, value) { var min_distance = false; var target_element = 0; for (i = 0; i < this.table.length; i++) { if (min_distance === false || Math.abs(this.table[i][field] - value) < min_distance) { target_element = i; min_distance = Math.abs(this.table[i][field] - value); } } return target_element; } this.getElementById = function(id) { return this.table[id]; } this.getNextElement = function(id) { if (this.table[++id] == undefined) return false; else return this.table[id]; } this.getPrevElement = function(id) { if (this.table[--id] == undefined) return false; else return this.table[id]; } this.getFirstElement = function() { return this.table[0]; } this.getLastElement = function() { return this.table[this.table.length - 1]; } this.init(); } // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - // -- - -- - - -- - -- - -- - -- - - MEASUREMENTS CHEST LIMITS TABLE -- -- - -- - -- - - -- - -- - -- - - // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - function ChestLimitsTable() { this.table; this.init = function() { this.table = new Array(); // Sleeve width | min | max this.table.push( { "sleeveWidth": 6.25, "min": 16.50, "max": 16.50 } ); this.table.push( { "sleeveWidth": 6.50, "min": 16.50, "max": 17.50 } ); this.table.push( { "sleeveWidth": 6.75, "min": 16.50, "max": 18.00 } ); this.table.push( { "sleeveWidth": 7.00, "min": 16.50, "max": 19.00 } ); this.table.push( { "sleeveWidth": 7.25, "min": 16.50, "max": 19.50 } ); this.table.push( { "sleeveWidth": 7.50, "min": 16.50, "max": 20.00 } ); this.table.push( { "sleeveWidth": 7.75, "min": 16.50, "max": 21.00 } ); this.table.push( { "sleeveWidth": 8.00, "min": 16.50, "max": 21.50 } ); this.table.push( { "sleeveWidth": 8.25, "min": 17.50, "max": 22.00 } ); this.table.push( { "sleeveWidth": 8.50, "min": 18.00, "max": 23.00 } ); this.table.push( { "sleeveWidth": 8.75, "min": 19.00, "max": 23.50 } ); this.table.push( { "sleeveWidth": 9.00, "min": 19.50, "max": 24.00 } ); this.table.push( { "sleeveWidth": 9.25, "min": 20.00, "max": 25.00 } ); this.table.push( { "sleeveWidth": 9.50, "min": 21.00, "max": 25.50 } ); this.table.push( { "sleeveWidth": 9.75, "min": 21.50, "max": 26.00 } ); this.table.push( { "sleeveWidth": 10.00, "min": 22.00, "max": 27.00 } ); this.table.push( { "sleeveWidth": 10.25, "min": 23.00, "max": 27.50 } ); this.table.push( { "sleeveWidth": 10.50, "min": 23.50, "max": 28.00 } ); this.table.push( { "sleeveWidth": 10.75, "min": 24.00, "max": 29.00 } ); this.table.push( { "sleeveWidth": 11.00, "min": 25.00, "max": 29.50 } ); this.table.push( { "sleeveWidth": 11.25, "min": 25.50, "max": 30.00 } ); this.table.push( { "sleeveWidth": 11.50, "min": 26.00, "max": 31.00 } ); this.table.push( { "sleeveWidth": 11.75, "min": 27.00, "max": 31.50 } ); this.table.push( { "sleeveWidth": 12.00, "min": 27.50, "max": 32.00 } ); this.table.push( { "sleeveWidth": 12.25, "min": 28.00, "max": 32.50 } ); this.table.push( { "sleeveWidth": 12.50, "min": 29.00, "max": 32.50 } ); this.table.push( { "sleeveWidth": 12.75, "min": 29.50, "max": 32.50 } ); this.table.push( { "sleeveWidth": 13.00, "min": 30.00, "max": 32.50 } ); this.table.push( { "sleeveWidth": 13.25, "min": 31.00, "max": 32.50 } ); this.table.push( { "sleeveWidth": 13.50, "min": 31.50, "max": 32.50 } ); this.table.push( { "sleeveWidth": 13.75, "min": 32.00, "max": 32.50 } ); this.table.push( { "sleeveWidth": 14.00, "min": 32.50, "max": 32.50 } ); } this.getNearestObject = function( sleeveWidth ){ var nearestObject; var nearestValue; for ( var index in this.table ){ if ( undefined == nearestValue || nearestValue > Math.abs( this.table[index]["sleeveWidth"] - sleeveWidth ) ){ nearestObject = this.table[index]; nearestValue = Math.abs( this.table[index]["sleeveWidth"] - sleeveWidth ); } } return nearestObject; } this.getMinChestByNearestSleeveWidth = function( sleeveWidth ){ var obj = this.getNearestObject( sleeveWidth ); return obj.min; } this.getMaxChestByNearestSleeveWidth = function( sleeveWidth ){ var obj = this.getNearestObject( sleeveWidth ); return obj.max; } this.init(); } // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - // -- - -- - - -- - -- - -- - -- - - MEASUREMENTS SLEEVE WIDTH LIMITS TABLE -- -- - -- - -- - - -- - -- - -- - - // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - function SleeveWidthLimitsTable() { this.table; this.init = function() { this.table = new Array(); // Sleeve width | min | max this.table.push( { "chestWidth": 16.5, "min": 6.25, "max": 8.00} ); this.table.push( { "chestWidth": 17, "min": 6.25, "max": 8.00} ); this.table.push( { "chestWidth": 17.5, "min": 6.50, "max": 8.25} ); this.table.push( { "chestWidth": 18, "min": 6.75, "max": 8.50} ); this.table.push( { "chestWidth": 18.5, "min": 7.00, "max": 8.75} ); this.table.push( { "chestWidth": 19, "min": 7.00, "max": 8.75} ); this.table.push( { "chestWidth": 19.5, "min": 7.25, "max": 9.00} ); this.table.push( { "chestWidth": 20, "min": 7.50, "max": 9.25} ); this.table.push( { "chestWidth": 20.5, "min": 7.75, "max": 9.50} ); this.table.push( { "chestWidth": 21, "min": 7.75, "max": 9.50} ); this.table.push( { "chestWidth": 21.5, "min": 8.00, "max": 9.75} ); this.table.push( { "chestWidth": 22, "min": 8.25, "max": 10.00} ); this.table.push( { "chestWidth": 22.5, "min": 8.50, "max": 10.25} ); this.table.push( { "chestWidth": 23, "min": 8.50, "max": 10.25} ); this.table.push( { "chestWidth": 23.5, "min": 8.75, "max": 10.50} ); this.table.push( { "chestWidth": 24, "min": 9.00, "max": 10.75} ); this.table.push( { "chestWidth": 24.5, "min": 9.25, "max": 11.00} ); this.table.push( { "chestWidth": 25, "min": 9.25, "max": 11.00} ); this.table.push( { "chestWidth": 25.5, "min": 9.50, "max": 11.25} ); this.table.push( { "chestWidth": 26, "min": 9.75, "max": 11.50} ); this.table.push( { "chestWidth": 26.5, "min": 10.00, "max": 11.75} ); this.table.push( { "chestWidth": 27, "min": 10.00, "max": 11.75} ); this.table.push( { "chestWidth": 27.5, "min": 10.25, "max": 12.00} ); this.table.push( { "chestWidth": 28, "min": 10.50, "max": 12.25} ); this.table.push( { "chestWidth": 28.5, "min": 10.75, "max": 12.50} ); this.table.push( { "chestWidth": 29, "min": 10.75, "max": 12.50} ); this.table.push( { "chestWidth": 29.5, "min": 11.00, "max": 12.75} ); this.table.push( { "chestWidth": 30, "min": 11.25, "max": 13.00} ); this.table.push( { "chestWidth": 30.5, "min": 11.50, "max": 13.25} ); this.table.push( { "chestWidth": 31, "min": 11.50, "max": 13.25} ); this.table.push( { "chestWidth": 31.5, "min": 11.75, "max": 13.50} ); this.table.push( { "chestWidth": 32, "min": 12.00, "max": 13.75} ); this.table.push( { "chestWidth": 32.5, "min": 12.25, "max": 14.00} ); } this.getNearestObject = function( chestWidth ){ var nearestObject; var nearestValue; for ( var index in this.table ){ if ( undefined == nearestValue || nearestValue > Math.abs( this.table[index]["chestWidth"] - chestWidth ) ){ nearestObject = this.table[index]; nearestValue = Math.abs( this.table[index]["chestWidth"] - chestWidth ); } } return nearestObject; } this.getMinSleeveWidthByNearestChest = function( chestWidth ){ var obj = this.getNearestObject( chestWidth ); return obj.min; } this.getMaxSleeveWidthByNearestChest= function( chestWidth ){ var obj = this.getNearestObject( chestWidth ); return obj.max; } this.init(); } // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - // -- - -- - - -- - -- - -- - -- - - SHIRT MEASUREMENTS CLASS -- -- - -- - -- - - -- - -- - -- -- // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - function ShirtMeasurement() { // input values this.collar_Shirt = 0; this.sleeve_Shirt = 0; this.shoulder_Shirt = 0; this.chest_Shirt = 0; this.mid_Shirt = 0; this.sleeveW_Shirt = 0; this.length_Shirt = 0; this.cuff_Shirt = 0; this.washes_Shirt = 0; //output values this.fit = 0; this.model_Ord = 0; this.size_Ord = 0; this.neck_Ord = 0; this.length_Ord = 0; this.rSleeve_Ord = 0; this.lSleeve_Ord = 0; this.waist_Ord = 0; this.rCuff_Ord = 0; this.lCuff_Ord = 0; this.bicep_adj_Ord = 0; this.yokeadj_Ord = 0; this.backDetail_Ord = 0; this.rear_side_pleats = 1; this.bicepStdDum; this.yokeStandard; this.waistStdDum; this.waistDesDum; this.sleeveWDesDum; this.chestDesDum; this.collarDesDum; this.lengthStd; this.lengthDesDum; this.adjCollar; this.adjChest; this.adjMiddle; this.adjShoulder; this.adjBackLen; this.adjSleeveWidth; this.adjSleeveLen; this.adjCuff; // limits this.min_collar = 0; this.min_sleeve = 0; this.min_shoulder = 0; this.min_chest = 0; this.min_mid = 0; this.min_sleeveW = 0; this.min_length = 0; this.min_cuff = 0; this.max_collar = 0; this.max_sleeve = 0; this.max_shoulder = 0; this.max_chest = 0; this.max_mid = 0; this.max_sleeveW = 0; this.max_length = 0; this.max_cuff = 0; //setter functions this.setCollarShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.collar_Shirt = parseFloat(value);}; this.setSleeveShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.sleeve_Shirt = parseFloat(value);}; this.setShoulderShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.shoulder_Shirt = parseFloat(value);}; this.setChestShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.chest_Shirt = parseFloat(value);}; this.setMidShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.mid_Shirt = parseFloat(value);}; this.setSleeveWShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.sleeveW_Shirt = parseFloat(value);}; this.setLengthShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.length_Shirt = parseFloat(value);}; this.setCuffShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.cuff_Shirt = parseFloat(value);}; this.setWashesShirt = function(value) {value = value.toString(); value = value.replace(',', '.'); this.washes_Shirt = parseFloat(value);}; this.setRearSidePleats = function(value) {this.rear_side_pleats = (value == true);}; this.setAdjCollar = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjCollar = parseFloat(value);}; this.setAdjChest = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjChest = parseFloat(value);}; this.setAdjShoulder = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjShoulder = parseFloat(value);}; this.setAdjMiddle = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjMiddle = parseFloat(value);}; this.setAdjBackLen = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjBackLen = parseFloat(value);}; this.setAdjSleeveW = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjSleeveWidth = parseFloat(value);}; this.setAdjSleeveL = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjSleeveLen = parseFloat(value);}; this.setAdjCuff = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjCuff = parseFloat(value);}; this.setAdjParamsArr = function(arr) { this.setCollarShirt(arr[0]); this.setSleeveShirt(arr[1]); this.setShoulderShirt(arr[3]); this.setChestShirt(arr[2]); this.setMidShirt(arr[5]); this.setSleeveWShirt(arr[6]); this.setLengthShirt(arr[4]); this.setCuffShirt(arr[7]); this.setAdjCollar(arr[0]); this.setAdjSleeveL(arr[1]); this.setAdjChest(arr[2]); this.setAdjShoulder(arr[3]); this.setAdjBackLen(arr[4]); this.setAdjMiddle(arr[5]); this.setAdjSleeveW(arr[6]); this.setAdjCuff(arr[7]); } //getter functions this.getFitOrd = function() {return this.fit}; this.getModelOrd = function() {return this.model_Ord}; this.getSizeOrd = function() {return this.size_Ord}; this.getNeckOrd = function() {return this.neck_Ord}; this.getLengthOrd = function() {return this.length_Ord}; this.getRSleeveOrd = function() {return this.rSleeve_Ord}; this.getLSleeveOrd = function() {return this.lSleeve_Ord}; this.getWaistOrd = function() {return this.waist_Ord}; this.getRCuffOrd = function() {return this.rCuff_Ord}; this.getLCuffOrd = function() {return this.lCuff_Ord}; this.getBicepAdjOrd = function() {return this.bicep_adj_Ord}; this.getYokeAdjOrd = function() {return this.yokeadj_Ord}; this.getBackDetailOrd = function() {return this.backDetail_Ord}; this.getMinCollar = function() {return this.min_collar;}; this.getMinSleeve = function() {return this.min_sleeve;}; this.getMinShoulder = function() {return this.min_shoulder;}; this.getMinChest = function() {return this.min_chest;}; this.getMinMid = function() {return this.min_mid;}; this.getMinSleveW = function() {return this.min_sleeveW;}; this.getMinLength = function() {return this.min_length;}; this.getMinCuff = function() {return this.min_cuff;}; this.getMaxCollar = function() {return this.max_collar;}; this.getMaxSleeve = function() {return this.max_sleeve;}; this.getMaxShoulder = function() {return this.max_shoulder;}; this.getMaxChest = function() {return this.max_chest;}; this.getMaxMid = function() {return this.max_mid;}; this.getMaxSleveW = function() {return this.max_sleeveW;}; this.getMaxLength = function() {return this.max_length;}; this.getMaxCuff = function() {return this.max_cuff;}; this.getAdjCollar = function() {return Math.abs(this.adjCollar)}; this.getAdjChest = function() {return Math.abs(this.adjChest)}; this.getAdjShoulder = function() {return Math.abs(this.adjShoulder)}; this.getAdjMiddle = function() {return Math.abs(this.adjMiddle)}; this.getAdjBackLen = function() {return Math.abs(this.adjBackLen)}; this.getAdjSleeveW = function() {return Math.abs(this.adjSleeveWidth)}; this.getAdjSleeveL = function() {return Math.abs(this.adjSleeveLen)}; this.getAdjCuff = function() {return Math.abs(this.adjCuff)}; this.table = new ChestWidthTable(); // limits this.correctByLimits = function() { if (this.adjCollar > this.max_collar) this.adjCollar = this.max_collar; if (this.adjCollar < this.min_collar) this.adjCollar = this.min_collar; if (this.adjMiddle > this.max_mid) this.adjMiddle = this.max_mid; if (this.adjMiddle < this.min_mid) this.adjMiddle = this.min_mid; if (this.adjShoulder > this.max_shoulder) this.adjShoulder = this.max_shoulder; if (this.adjShoulder < this.min_shoulder) this.adjShoulder = this.min_shoulder; if (this.adjBackLen > this.max_length) this.adjBackLen = this.max_length; if (this.adjBackLen < this.min_length) this.adjBackLen = this.min_length; if (this.adjSleeveLen > this.max_sleeve) this.adjSleeveLen = this.max_sleeve; if (this.adjSleeveLen < this.min_sleeve) this.adjSleeveLen = this.min_sleeve; if (this.adjCuff > this.max_cuff) this.adjCuff = this.max_cuff; if (this.adjCuff < this.min_cuff) this.adjCuff = this.min_cuff; } // limits this.calculateLimits = function() { var chestLimitsTable = new ChestLimitsTable(); var sleeveWidthLimitsTable = new SleeveWidthLimitsTable(); this.min_collar = 12; this.min_chest = chestLimitsTable.getMinChestByNearestSleeveWidth( this.adjSleeveWidth ); this.min_mid = 10; this.min_shoulder = 10; this.min_length = 25; this.min_sleeveW = sleeveWidthLimitsTable.getMinSleeveWidthByNearestChest( this.adjChest ); this.min_sleeve = 28; this.min_cuff = 8; this.min_bottom_width = this.adjMiddle; this.max_collar = 24; this.max_chest = chestLimitsTable.getMaxChestByNearestSleeveWidth( this.adjSleeveWidth ); this.max_mid = 80; this.max_shoulder = 30; this.max_length = 45; this.max_sleeveW = sleeveWidthLimitsTable.getMaxSleeveWidthByNearestChest( this.adjChest ); this.max_sleeve = 40; this.max_cuff = 11; this.max_bottom_width = this.adjChest; /* this.min_collar = this.size_Ord - 2; // min chest var tmp1, tmp2, tmp3, tmp4; var slim_var; slim_var = 39; tmp1 = ((Math.max(this.adjCollar - 2, 14) - 14) * 4 + slim_var) / 2; tmp2 = this.adjChest + 2 * (this.yokeadj_Ord - 1.5); tmp3 = this.adjChest + (this.bicep_adj_Ord - 1) / 0.75; tmp4 = this.adjChest - ((6 - this.waist_Ord) / 2); this.min_chest = Math.max(Math.max(tmp1, tmp2), Math.max(tmp3, tmp4)); this.min_chest = this.table.getElementById(this.table.findNearIdByValue(1, this.min_chest))[1]; this.min_mid = (this.waistStdDum - 4) / 2; this.min_shoulder = this.size_Ord + (this.fit == 0? 3 : 3.5) - 1.5; this.min_length = 29; this.min_sleeveW = roundTo(this.bicepStdDum - 1, 0.25); this.min_sleeve = 28; this.min_cuff = 8; this.max_collar = this.size_Ord + 2; // max chest slim_var = 41.5; tmp1 = ((Math.min(this.adjCollar + 2, 22) - 14) * 4 + slim_var) / 2; tmp2 = this.adjChest + 2 * (this.yokeadj_Ord + 1.5); tmp3 = this.adjChest + (this.bicep_adj_Ord + 2) / 0.75; tmp4 = this.adjChest + ((this.waist_Ord + 4) / 2); this.max_chest = Math.min(Math.min(tmp1, tmp2), Math.min(tmp3, tmp4)); this.max_chest = this.table.getElementById(this.table.findNearIdByValue(1, this.max_chest))[1]; this.max_mid = (this.waistStdDum + 4) / 2; this.max_shoulder = this.size_Ord + (this.fit == 0? 3 : 3.5) + 1.5; this.max_length = 44; this.max_sleeveW = roundTo(this.bicepStdDum + 1, 0.25); this.max_sleeve = 40; this.max_cuff = 11; */ } // general function this.calculate = function(calculateAdjValues) { if (calculateAdjValues == undefined) calculateAdjValues = true; if ( calculateAdjValues ) { this.adjCollar = excelCeil(4 * this.collar_Shirt) / 4; this.adjChest = excelRound(2 * this.chest_Shirt) / 2; this.adjSleeveWidth = excelCeil( this.sleeveW_Shirt * 4 ) / 4; this.calculateLimits(); this.correctByLimits(); if (this.adjSleeveWidth > this.max_sleeveW) this.adjSleeveWidth = this.max_sleeveW; if (this.adjSleeveWidth < this.min_sleeveW) this.adjSleeveWidth = this.min_sleeveW; this.adjChest = excelRound(2 * this.chest_Shirt) / 2; this.calculateLimits(); if (this.adjChest > this.max_chest) this.adjChest = this.max_chest; if (this.adjChest < this.min_chest) this.adjChest = this.min_chest; this.adjMiddle = excelCeil(2 * this.mid_Shirt) / 2; this.adjShoulder = excelCeil(4 * this.shoulder_Shirt) / 4; this.adjBackLen = excelCeil(2 * this.length_Shirt) / 2; this.adjSleeveLen = excelRound(4 * ( this.sleeve_Shirt ) ) / 4; this.adjCuff = excelCeil(4 * this.cuff_Shirt) / 4; this.calculateLimits(); this.correctByLimits(); } return; // adj variables if (calculateAdjValues){ if (this.chest_Shirt > 16.5) this.adjChest = excelRound(2 * this.chest_Shirt) / 2; else this.adjChest = 16.5; if (this.adjChest > this.min_chest) this.adjChest = this.min_chest; if (this.adjChest < this.max_chest) this.adjChest = this.max_chest; } // ord variables switch (this.adjChest) { case 20.75: case 21.75: case 22.75: case 23.75: case 24.75: case 25.75: case 26.75: case 27.75: case 28.75: case 29.75: case 30.75: case 31.75: case 32.75: case 33.75: case 34.75: case 35.75: case 37.25: this.fit = 1; break; default: this.fit = 0; } this.model_Ord = this.fit; if (this.adjChest > 19.5) this.size_Ord = this.table.getElementById(this.table.findNearIdByValue(6, 4 * this.adjChest))[7]; else this.size_Ord = 14 /* switch (this.adjChest) { case 20.25: case 21.25: case 22.25: case 23.25: case 24.25: case 25.25: case 26.25: case 27.25: case 28.25: case 29.25: case 30.25: case 31.25: case 32.25: case 33.25: case 34.25: case 35.25: case 36.25: this.rear_side_pleats = 1; break; default: this.rear_side_pleats = 0; } */ // tmp variables this.bicepStdDum = ((this.size_Ord - 14) * 1.5 + 17) / 2; this.yokeStandard = this.size_Ord + (this.fit == 0? 3 : 3.5); this.waistStdDum = (this.fit == 0? 37 + 4 * (this.size_Ord - 14) : 40 + 4 * (this.size_Ord - 14)); if (this.model_Ord == 0 && this.rear_side_pleats == 1) this.waistStdDum = 37 + 4 * (this.size_Ord - 14); else if(this.model_Ord == 1 && this.rear_side_pleats == 1) this.waistStdDum = 40 + 4 * (this.size_Ord - 14); else if(this.model_Ord == 0 && this.rear_side_pleats == 0) this.waistStdDum = 36 + 4 * (this.size_Ord - 14); else this.waistStdDum = 39 + 4 * (this.size_Ord - 14); var tmp2; var tmp1; if (calculateAdjValues) this.sleeveWDesDum = this.sleeveW_Shirt; else this.sleeveWDesDum = this.adjSleeveWidth; // adj variables if (calculateAdjValues) { this.adjSleeveWidth = excelCeil( this.sleeveW_Shirt * 4 ) / 4; if (this.adjSleeveWidth > this.bicepStdDum + 1) this.adjSleeveWidth = this.bicepStdDum + 1; if (this.adjSleeveWidth < this.bicepStdDum - 1) this.adjSleeveWidth = this.bicepStdDum - 1; this.adjCollar = excelCeil(4 * this.collar_Shirt) / 4; this.adjMiddle = excelCeil(2 * this.mid_Shirt) / 2; this.adjShoulder = excelCeil(4 * this.shoulder_Shirt) / 4; this.adjBackLen = excelCeil(2 * this.length_Shirt) / 2; { // check for adj shoulder this.calculateLimits(); this.correctByLimits(); } this.adjSleeveLen = excelRound(4 * ( this.sleeve_Shirt + this.shoulder_Shirt / 2 ) ) / 4; this.adjCuff = excelCeil(4 * this.cuff_Shirt) / 4; } if (calculateAdjValues) { this.calculateLimits(); this.correctByLimits(); // this.calculateLimits(); // this.correctByLimits(); } // ord files this.neck_Ord=this.length_Ord=this.rSleeve_Ord=this.lSleeve_Ord=this.bicepStdDum=this.yokeStandard=this.waist_Ord=this.rCuff_Ord=this.lCuff_Ord= this.bicep_adj_Ord=this.yokeadj_Ord=this.backDetail_Ord = 0; /* this.neck_Ord = this.adjCollar; this.length_Ord = excelRound(this.adjBackLen - (31.625 + (0.75 * (this.size_Ord - 14)))); this.rSleeve_Ord = this.adjSleeveLen; this.lSleeve_Ord = this.adjSleeveLen; this.bicepStdDum = ((this.size_Ord - 14) * 1.5 + 17) / 2; this.yokeStandard = this.size_Ord + (this.fit == 0? 3 : 3.5); this.waist_Ord = this.adjMiddle * 2 - this.waistStdDum; this.rCuff_Ord = this.adjCuff + 1; this.lCuff_Ord = this.adjCuff + 1; this.bicep_adj_Ord = (this.adjSleeveWidth - this.bicepStdDum > 0? excelCeil((this.adjSleeveWidth - this.bicepStdDum) * 2) : excelFloor((this.adjSleeveWidth - this.bicepStdDum) * 2)); this.yokeadj_Ord = this.adjShoulder - this.yokeStandard; this.backDetail_Ord = this.rear_side_pleats ? 1 : 0; */ }; // --------- -------- --------- --------- --------- ---------- ---------- ---------- this.debug_limits = function() { var str = ''; str += 'collar: ' + this.min_collar + ' | ' + this.max_collar + '\n'; str += 'sleeve: ' + this.min_sleeve + ' | ' + this.max_sleeve + '\n'; str += 'shoulder: ' + this.min_shoulder + ' | ' + this.max_shoulder + '\n'; str += 'chest: ' + this.min_chest + ' | ' + this.max_chest + '\n'; str += 'midle: ' + this.min_mid + ' | ' + this.max_mid + '\n'; str += 'sleeve_width: ' + this.min_sleeveW + ' | ' + this.max_sleeveW + '\n'; str += 'shirt len: ' + this.min_length + ' | ' + this.max_length + '\n'; str += 'cuff: ' + this.min_cuff + ' | ' + this.max_cuff + '\n'; alert(str); } this.debug_adj = function() { var str = 'Collar: ' + this.adjCollar + '\n'; str += 'Chest: ' + this.adjChest + '\n'; str += 'Shoulder: ' + this.adjShoulder + '\n'; str += 'Middle: ' + this.adjMiddle + '\n'; str += 'Length: ' + this.adjBackLen + '\n'; str += 'Sleeve width: ' + this.adjSleeveWidth + '\n'; str += 'Sleeve Len: ' + this.adjSleeveLen + '\n'; str += 'Cuff: ' + this.adjCuff + '\n'; alert(str); } this.debug_tmp = function() { var str = 'bicep_std_dum: ' + this.bicepStdDum + '\n'; str += 'yoke_standart: ' + this.yokeStandard + '\n'; str += 'waist_std_dum: ' + this.waistStdDum + '\n'; str += 'waist_des_bum: ' + this.waistDesDum + '\n'; str += 'sleeve_w_des_dum: ' + this.sleeveWDesDum + '\n'; str += 'chest_des_dum: ' + this.chestDesDum + '\n'; str += 'collar_des_dum: ' + this.collarDesDum + '\n'; str += 'length_std: ' + this.lengthStd + '\n'; str += 'length_des_dum: ' + this.lengthDesDum + '\n'; alert(str); } this.debug_ord = function() { var str = ''; str += 'getFitOrd: ' + this.getFitOrd() + '\n'; str += 'getModelOrd: ' + this.getModelOrd() + '\n'; str += 'getSizeOrd: ' + this.getSizeOrd() + '\n'; str += 'getNeckOrd: ' + this.getNeckOrd() + '\n'; str += 'getLengthOrd: ' + this.getLengthOrd() + '\n'; str += 'getRSleeveOrd: ' + this.getRSleeveOrd() + '\n'; str += 'getLSleeveOrd: ' + this.getLSleeveOrd() + '\n'; str += 'getWaistOrd: ' + this.getWaistOrd() + '\n'; str += 'getRCuffOrd: ' + this.getRCuffOrd() + '\n'; str += 'getLCuffOrd: ' + this.getLCuffOrd() + '\n'; str += 'getBicepAdjOrd: ' + this.getBicepAdjOrd() + '\n'; str += 'getYokeAdjOrd: ' + this.getYokeAdjOrd() + '\n'; str += 'getBackDetailOrd: ' + this.getBackDetailOrd() + '\n'; str += '\n'; str += 'explanations: \n'; str += 'getBackDetailOrd: 1 or true = pleats ; 0 or false - no pleats\n'; str += 'getFitOrd: 1 or true - regular ; 0 or false - slim\n'; alert(str); } } // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- //-- - -- - - -- - -- - -- - -- - - BODY MEASUREMENTS CLASS -- -- - -- - -- - - -- - -- - -- -- // -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- - -- - -- - -- - -- -- - -- - -- - - -- - -- - -- - -- - - -- - -- - -- function BodyMeasurement() { // input values this.neck = 0; this.arm_len = 0; this.shoulder_W = 0; this.chest = 0; this.waist_around = 0; this.length = 0; this.wrist_around = 0; this.bicep_around = 0; this.style_body = 0; this.rear_side_pleats = true; //output values this.fit = 0; this.model_Ord = 0; this.size_Ord = 0; this.neck_Ord = 0; this.length_Ord = 0; this.rSleeve_Ord = 0; this.lSleeve_Ord = 0; this.waist_Ord = 0; this.rCuff_Ord = 0; this.lCuff_Ord = 0; this.bicep_adj_Ord = 0; this.yokeadj_Ord = 0; this.backDetail_Ord = false; // adj values this.adjCollar; this.adjChest; this.adjShoulder; this.adjMiddle; this.adjBackLen; this.adjSleeveWidth; this.adjSleeveLen; this.adjCuff; //tmp variables this.bicepStdDum; this.yokeStandard; this.waistStdDum; this.waistDesDum; this.bicepDesDum; this.chestDesDum; this.chest_tmp; //limits this.min_collar = 0; this.min_sleeve = 0; this.min_shoulder = 0; this.min_chest = 0; this.min_mid = 0; this.min_sleeveW = 0; this.min_length = 0; this.min_cuff = 0; this.max_collar = 0; this.max_sleeve = 0; this.max_shoulder = 0; this.max_chest = 0; this.max_mid = 0; this.max_sleeveW = 0; this.max_length = 0; this.max_cuff = 0; //setter functions // set input this.setNeck = function(value) {value = value.toString(); value = value.replace(',', '.'); this.neck = parseFloat(value);}; this.setArmLen = function(value) {value = value.toString(); value = value.replace(',', '.'); this.arm_len = parseFloat(value);}; this.setShoulderW = function(value) {value = value.toString(); value = value.replace(',', '.'); this.shoulder_W = parseFloat(value);}; this.setChest = function(value) {value = value.toString(); value = value.replace(',', '.'); this.chest = parseFloat(value);}; this.setWaist = function(value) {value = value.toString(); value = value.replace(',', '.'); this.waist_around = parseFloat(value);}; this.setLength = function(value) {value = value.toString(); value = value.replace(',', '.'); this.length = parseFloat(value);}; this.setWrist = function(value) {value = value.toString(); value = value.replace(',', '.'); this.wrist_around = parseFloat(value);}; this.setBicep = function(value) {value = value.toString(); value = value.replace(',', '.'); this.bicep_around = parseFloat(value);}; this.setStyleBody = function(value) {value = value.toString(); value = value.replace(',', '.'); this.style_body = parseFloat(value);}; // set adj values this.setAdjCollar = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjCollar = parseFloat(value);}; this.setAdjChest = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjChest = parseFloat(value);}; this.setAdjShoulder = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjShoulder = parseFloat(value);}; this.setAdjMiddle = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjMiddle = parseFloat(value);}; this.setAdjBackLen = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjBackLen = parseFloat(value);}; this.setAdjSleeveW = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjSleeveWidth = parseFloat(value);}; this.setAdjSleeveL = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjSleeveLen = parseFloat(value);}; this.setAdjCuff = function(value) {value = value.toString(); value = value.replace(',', '.'); this.adjCuff = parseFloat(value);}; this.setRearSidePleats = function(value) {this.rear_side_pleats = value == true;}; //getter functions // get ord variables this.getFitOrd = function() {return this.fit}; this.getModelOrd = function() {return this.model_Ord}; this.getSizeOrd = function() {return this.size_Ord}; this.getNeckOrd = function() {return this.neck_Ord}; this.getLengthOrd = function() {return this.length_Ord}; this.getRSleeveOrd = function() {return this.rSleeve_Ord}; this.getLSleeveOrd = function() {return this.lSleeve_Ord}; this.getWaistOrd = function() {return this.waist_Ord}; this.getRCuffOrd = function() {return this.rCuff_Ord}; this.getLCuffOrd = function() {return this.lCuff_Ord}; this.getBicepAdjOrd = function() {return this.bicep_adj_Ord}; this.getYokeAdjOrd = function() {return this.yokeadj_Ord}; this.getBackDetailOrd = function() {return this.backDetail_Ord}; // get adj variables this.getAdjCollar = function() {return Math.abs(this.adjCollar)}; this.getAdjChest = function() {return Math.abs(this.adjChest)}; this.getAdjShoulder = function() {return Math.abs(this.adjShoulder)}; this.getAdjMiddle = function() {return Math.abs(this.adjMiddle)}; this.getAdjBackLen = function() {return Math.abs(this.adjBackLen)}; this.getAdjSleeveW = function() {return Math.abs(this.adjSleeveWidth)}; this.getAdjSleeveL = function() {return Math.abs(this.adjSleeveLen)}; this.getAdjCuff = function() {return Math.abs(this.adjCuff)}; this.table = new ChestWidthTable(); // limits this.correctByLimits = function() { if (this.adjCollar > this.max_collar) this.adjCollar = this.max_collar; if (this.adjCollar < this.min_collar) this.adjCollar = this.min_collar; if (this.adjMiddle > this.max_mid) this.adjMiddle = this.max_mid; if (this.adjMiddle < this.min_mid) this.adjMiddle = this.min_mid; if (this.adjShoulder > this.max_shoulder) this.adjShoulder = this.max_shoulder; if (this.adjShoulder < this.min_shoulder) this.adjShoulder = this.min_shoulder; if (this.adjBackLen > this.max_length) this.adjBackLen = this.max_length; if (this.adjBackLen < this.min_length) this.adjBackLen = this.min_length; if (this.adjSleeveLen > this.max_sleeve) this.sleeve_Shirt = this.max_sleeve; if (this.adjSleeveLen < this.min_sleeve) this.sleeve_Shirt = this.min_sleeve; if (this.adjCuff > this.max_cuff) this.adjCuff = this.max_cuff; if (this.adjCuff < this.min_cuff) this.adjCuff = this.min_cuff; } this.calculateLimits = function() { var chestLimitsTable = new ChestLimitsTable(); var sleeveWidthLimitsTable = new SleeveWidthLimitsTable(); this.min_collar = 12; this.min_chest = chestLimitsTable.getMinChestByNearestSleeveWidth( this.adjSleeveWidth ); this.min_mid = 10; this.min_shoulder = 10; this.min_length = 25; this.min_sleeveW = sleeveWidthLimitsTable.getMinSleeveWidthByNearestChest( this.adjChest ); this.min_sleeve = 28; this.min_cuff = 8; this.min_bottom_width = this.adjMiddle; this.max_collar = 24; this.max_chest = chestLimitsTable.getMaxChestByNearestSleeveWidth( this.adjSleeveWidth ); this.max_mid = 80; this.max_shoulder = 30; this.max_length = 45; this.max_sleeveW = sleeveWidthLimitsTable.getMaxSleeveWidthByNearestChest( this.adjChest ); this.max_sleeve = 40; this.max_cuff = 11; this.max_bottom_width = this.adjChest; /* this.min_collar = this.size_Ord - 2; // min chest var tmp1, tmp2, tmp3, tmp4; var slim_var; slim_var = 39; tmp1 = ((Math.max(this.adjCollar - 2, 14) - 14) * 4 + slim_var) / 2; tmp2 = this.adjChest + 2 * (this.yokeadj_Ord - 1.5); tmp3 = this.adjChest + (this.bicep_adj_Ord - 1) / 0.75; tmp4 = this.adjChest - ((6 - this.waist_Ord) / 2); this.min_chest = Math.max(Math.max(tmp1, tmp2), Math.max(tmp3, tmp4)); this.min_chest = this.table.getElementById(this.table.findNearIdByValue(1, this.min_chest))[1]; this.min_mid = (this.waistStdDum-4)/2; this.min_shoulder = this.yokeStandard - 1.5; this.min_length = 29; this.min_sleeveW = (this.bicepStdDum - 1); this.min_sleeve = 27; this.min_cuff = 8; this.max_collar = this.size_Ord + 2; // max chest slim_var = 41.5; tmp1 = ((Math.min(this.adjCollar + 2, 22) - 14) * 4 + slim_var) / 2; tmp2 = this.adjChest + 2 * (this.yokeadj_Ord + 1.5); tmp3 = this.adjChest + (this.bicep_adj_Ord + 2) / 0.75; tmp4 = this.adjChest + ((this.waist_Ord + 4) / 2); //alert(tmp1 + ' | ' + tmp2 + ' | ' + tmp3 + ' | ' + tmp4); this.max_chest = Math.min(Math.min(tmp1, tmp2), Math.min(tmp3, tmp4)); this.max_mid = (this.waistStdDum+4)/2; this.max_shoulder = this.yokeStandard + 1.5; this.max_length = 44; this.max_sleeveW = (this.bicepStdDum + 1); this.max_sleeve = 43; this.max_cuff = 11; */ } // general function this.calculate = function(calculateAdjValues) { if (calculateAdjValues == undefined) calculateAdjValues = true; if ( calculateAdjValues ) { this.adjCollar = excelRound( this.neck * 4 ) / 4; this.adjChest = excelCeil( this.chest * ( BODY_STYLE_CLASSIC == this.style_body ? 1.14 : ( BODY_STYLE_SLIM == this.style_body ? 1.125 : 1.09 ) ) ) / 2; this.adjSleeveWidth = excelCeil( 2 * ( this.bicep_around + ( BODY_STYLE_CLASSIC == this.style_body ? 5 : ( BODY_STYLE_SLIM == this.style_body ? 4.25 : 3.5 ) ) ) ) / 4; // this.calculateLimits(); // if (this.adjSleeveWidth > this.max_sleeveW) this.adjSleeveWidth = this.max_sleeveW; // if (this.adjSleeveWidth < this.min_sleeveW) this.adjSleeveWidth = this.min_sleeveW; // this.adjChest = excelCeil( this.chest * ( BODY_STYLE_CLASSIC == this.style_body ? 1.15 : ( BODY_STYLE_SLIM == this.style_body ? 1.13 : 1.1 ) ) ) / 2; this.adjChest = excelCeil( this.chest * ( BODY_STYLE_CLASSIC == this.style_body ? 1.14 : ( BODY_STYLE_SLIM == this.style_body ? 1.125 : 1.09 ) ) ) / 2; // this.calculateLimits(); // if (this.adjChest > this.max_chest) this.adjChest = this.max_chest; // if (this.adjChest < this.min_chest) this.adjChest = this.min_chest; this.adjShoulder = excelRound( this.shoulder_W * 4 ) / 4; // this.adjMiddle = excelCeil( this.waist_around + ( BODY_STYLE_CLASSIC == this.style_body ? 7 : ( BODY_STYLE_SLIM == this.style_body ? 6 : 4 ) ) ) / 2; this.adjMiddle = excelCeil( this.waist_around * ( BODY_STYLE_CLASSIC == this.style_body ? 1.14 : ( BODY_STYLE_SLIM == this.style_body ? 1.125 : 1.09 ) ) ) / 2; this.adjBackLen = excelRound( this.length * 2 ) / 2; this.adjSleeveLen = excelCeil( 4 * this.arm_len ) / 4; this.adjCuff = excelCeil( ( this.wrist_around + 2.25 <= 8? 8 : (this.wrist_around + 2.25 > 11? 11 : this.wrist_around + 2.25) ) * 4 ) / 4; } this.calculateLimits(); this.correctByLimits(); return; // adj valriable if (calculateAdjValues) { this.adjSleeveLen = excelCeil(4 * this.arm_len) / 4; this.adjCuff = (this.wrist_around + 1.5 <= 8? 8 : (this.wrist_around + 1.5 > 11? 11 : this.wrist_around + 1.5)); } // tmp variables this.waistDesDum = this.waist_around + (this.style_body == 0? 5 : 7); // this.bicepDesDum = (this.style_body == 0? this.bicep_around + 3.5 : this.bicep_around + 5) / 2; this.bicepDesDum = (this.style_body == 0? this.bicep_around + 2.5 : this.bicep_around + 5) / 2; this.chestDesDum = (this.waist_around > this.chest + 5? (this.waist_around + (this.style_body == 0? 2 : 4)) / 2 : (this.chest + (this.style_body == 0? 6 : 8)) / 2); // adj variables (with out limits) if (this.chestDesDum > 19.5) this.chest_tmp = (this.table.getElementById(this.table.findNearIdByValue(6, 4 * this.chestDesDum))[6]) /4; else this.chest_tmp = 19.5; if (calculateAdjValues) { this.adjChest = this.chest_tmp; } switch (this.adjChest) { case 20.25: case 21.25: case 22.25: case 23.25: case 24.25: case 25.25: case 26.25: case 27.25: case 28.25: case 29.25: case 30.25: case 31.25: case 32.25: case 33.25: case 34.25: case 35.25: case 36.25: this.rear_side_pleats = 1; break; default: this.rear_side_pleats = 0; } // ord variables switch (this.adjChest) { case 20.75: case 21.75: case 22.75: case 23.75: case 24.75: case 25.75: case 26.75: case 27.75: case 28.75: case 29.75: case 30.75: case 31.75: case 32.75: case 33.75: case 34.75: case 35.75: case 36.75: this.model_Ord = 1; break; default: this.model_Ord = 0; } if (this.adjChest > 19.5) this.size_Ord = this.table.getElementById(this.table.findNearIdByValue(6, 4 * this.adjChest))[7]; else this.size_Ord = 14 this.rSleeve_Ord = this.adjSleeveLen; this.lSleeve_Ord = this.adjSleeveLen; this.rCuff_Ord = this.adjCuff + 1; this.lCuff_Ord = this.adjCuff + 1; // tmp variables this.bicepStdDum = ((this.size_Ord - 14) * 1.5 + 17)/2; this.yokeStandard = (this.model_Ord == 0? this.size_Ord + 3 : this.size_Ord + 3.5); if (this.model_Ord == 0 && this.rear_side_pleats == 1) this.waistStdDum = 37 + 4 * (this.size_Ord - 14); else if(this.model_Ord == 1 && this.rear_side_pleats == 1) this.waistStdDum = 40 + 4 * (this.size_Ord - 14); else if(this.model_Ord == 0 && this.rear_side_pleats == 0) this.waistStdDum = 36 + 4 * (this.size_Ord - 14); else this.waistStdDum = 39 + 4 * (this.size_Ord - 14); // adj variables if (calculateAdjValues) { this.adjShoulder = excelCeil( this.yokeStandard * 2 ) / 2; /* this.adjShoulder = excelCeil(2 * (this.shoulder_W <= this.yokeStandard - 1.5?this.yokeStandard - 1.5: (this.shoulder_W <= this.yokeStandard - 1?this.yokeStandard - 1: (this.shoulder_W <= this.yokeStandard - 0.5?this.yokeStandard - 0.5: (this.shoulder_W <= this.yokeStandard?this.yokeStandard: (this.shoulder_W <= this.yokeStandard + 0.5?this.yokeStandard + 0.5: (this.shoulder_W <= this.yokeStandard + 1?this.yokeStandard + 1:this.yokeStandard + 1.5))))))) / 2; */ this.adjMiddle = ((this.waistDesDum < this.waistStdDum - 4? this.waistStdDum - 4 : (this.waistDesDum > this.waistStdDum + 4? this.waistStdDum + 4 : this.waistDesDum))) / 2; // this.adjSleeveWidth = (this.bicepDesDum < this.bicepStdDum - 2? this.bicepStdDum - 2 : (this.bicepDesDum > this.bicepStdDum + 1? this.bicepStdDum + 1 : this.bicepStdDum - (excelFloor((this.bicepStdDum - this.bicepDesDum) * 2) / 2))) / 2; this.adjSleeveWidth = this.bicepDesDum; if (this.adjSleeveWidth > this.bicepStdDum + 1) this.adjSleeveWidth = this.bicepStdDum + 1; if (this.adjSleeveWidth < this.bicepStdDum - 1) this.adjSleeveWidth = this.bicepStdDum - 1; } // ord variables this.waist_Ord = this.adjMiddle * 2 - this.waistStdDum; this.bicep_adj_Ord = (this.adjSleeveWidth - this.bicepStdDum > 0? excelCeil((this.adjSleeveWidth - this.bicepStdDum) * 2) : excelFloor((this.adjSleeveWidth - this.bicepStdDum) * 2)); this.yokeadj_Ord = this.adjShoulder - this.yokeStandard; //alert(' adjMiddle: ' + this.adjMiddle + ' adjSleeveWidth: ' + this.adjSleeveWidth); // adj variables if (calculateAdjValues) { this.adjCollar = (this.neck); this.adjBackLen = this.length; } // check limits this.min_collar = this.size_Ord - 2; this.max_collar = this.size_Ord + 2; this.min_length = 29; this.max_length = 44; if (this.adjCollar > this.max_collar) this.adjCollar = this.max_collar; if (this.adjCollar < this.min_collar) this.adjCollar = this.min_collar; if (this.adjBackLen > this.max_length) this.adjBackLen = this.max_length; if (this.adjBackLen < this.min_length) this.adjBackLen = this.min_length; // ord variables this.neck_Ord = this.adjCollar; this.length_Ord = excelRound(this.adjBackLen - (31.625 + 0.75 * (this.size_Ord - 14))); this.calculateLimits(); this.correctByLimits(); return; }; // --------- -------- --------- --------- --------- ---------- ---------- ---------- this.debug_limits = function() { var str = ''; str += 'collar: ' + this.min_collar + ' | ' + this.max_collar + '\n'; str += 'sleeve: ' + this.min_sleeve + ' | ' + this.max_sleeve + '\n'; str += 'shoulder: ' + this.min_shoulder + ' | ' + this.max_shoulder + '\n'; str += 'chest: ' + this.min_chest + ' | ' + this.max_chest + '\n'; str += 'midle: ' + this.min_mid + ' | ' + this.max_mid + '\n'; str += 'sleeve_width: ' + this.min_sleeveW + ' | ' + this.max_sleeveW + '\n'; str += 'shirt len: ' + this.min_length + ' | ' + this.max_length + '\n'; str += 'cuff: ' + this.min_cuff + ' | ' + this.max_cuff + '\n'; alert(str); } this.debug_adj = function() { var str = 'Collar: ' + this.adjCollar + '\n'; str += 'Chest: ' + this.adjChest + '\n'; str += 'Shoulder: ' + this.adjShoulder + '\n'; str += 'Middle: ' + this.adjMiddle + '\n'; str += 'Length: ' + this.adjBackLen + '\n'; str += 'Sleeve width: ' + this.adjSleeveWidth + '\n'; str += 'Sleeve Len: ' + this.adjSleeveLen + '\n'; str += 'Cuff: ' + this.adjCuff + '\n'; alert(str); } this.debug_tmp = function() { var str = 'bicepStdDum: ' + this.bicepStdDum + '\n'; str += 'yokeStandard: ' + this.yokeStandard + '\n'; str += 'waistStdDum: ' + this.waistStdDum + '\n'; str += 'waistDesDum: ' + this.waistDesDum + '\n'; str += 'bicepDesDum: ' + this.bicepDesDum + '\n'; str += 'chestDesDum: ' + this.chestDesDum + '\n'; alert(str); } this.debug_ord = function() { var str = ''; str += 'getFitOrd: ' + this.getFitOrd() + '\n'; str += 'getModelOrd: ' + this.getModelOrd() + '\n'; str += 'getSizeOrd: ' + this.getSizeOrd() + '\n'; str += 'getNeckOrd: ' + this.getNeckOrd() + '\n'; str += 'getLengthOrd: ' + this.getLengthOrd() + '\n'; str += 'getRSleeveOrd: ' + this.getRSleeveOrd() + '\n'; str += 'getLSleeveOrd: ' + this.getLSleeveOrd() + '\n'; str += 'getWaistOrd: ' + this.getWaistOrd() + '\n'; str += 'getRCuffOrd: ' + this.getRCuffOrd() + '\n'; str += 'getLCuffOrd: ' + this.getLCuffOrd() + '\n'; str += 'getBicepAdjOrd: ' + this.getBicepAdjOrd() + '\n'; str += 'getYokeAdjOrd: ' + this.getYokeAdjOrd() + '\n'; str += 'getBackDetailOrd: ' + this.getBackDetailOrd() + '\n'; str += '\n'; str += 'explanations: \n'; str += 'getBackDetailOrd: 1 or true = pleats ; 0 or false - no pleats\n'; str += 'getFitOrd: 1 or true - regular ; 0 or false - slim\n'; alert(str); } } /* var bodyMeasurement = new BodyMeasurement(); bodyMeasurement.setNeck( 15.5 ); bodyMeasurement.setArmLen( 33.1 ); bodyMeasurement.setShoulderW( 18.5 ); bodyMeasurement.setChest( 42.25 ); bodyMeasurement.setWaist( 34.5 ); bodyMeasurement.setLength( 33 ); bodyMeasurement.setWrist( 7.25 ); bodyMeasurement.setBicep( 14 ); bodyMeasurement.setStyleBody( BODY_STYLE_CLASSIC ); bodyMeasurement.calculate(); bodyMeasurement.debug_adj(); bodyMeasurement.debug_limits(); */ function AdjSizes(data) { this.data = data; // check all for numbers for (var i in data) { if (isNaN(parseFloat(data[i])) && "adddim" != i.substr(0,6)) { throw new Error("`" + i + "` param in AdjSizes is not a number"); } else { this.data[i] = parseFloat(data[i]); } } // rounding this.rdata = {}; this.rdata.collar = Math.ceil(this.data.collar * 4) / 4; this.rdata.sleeve = Math.ceil(this.data.sleeve * 4) / 4; this.rdata.yoke = Math.ceil(this.data.yoke * 4) / 4; this.rdata.chest = Math.ceil(this.data.chest * 2) / 2; this.rdata.midsection = Math.ceil(this.data.midsection * 2) / 2; this.rdata.shirt_length = Math.ceil(this.data.shirt_length * 2) / 2; this.rdata.sleeve_w = Math.ceil(this.data.sleeve_w * 4) / 4; this.rdata.cuff = Math.ceil(this.data.cuff * 4) / 4; this.rdata.adddim_bottom_width = Math.ceil(this.data.adddim_bottom_width * 2) / 2; for (var i in this.rdata) { this.rdata[i] = this.rdata[i].toFixed(2); } // XML Variables this.xml_vars = {}; this.xml_vars.body_size = this.get_body_size_chest_width(); this.xml_vars.default_collar = this.xml_vars.body_size; this.xml_vars.adj_collar = this.restrict_limit( this.rdata.collar-this.xml_vars.default_collar, this.get_adj_limit('collar', 'min'), this.get_adj_limit('collar', 'max') ) + this.xml_vars.default_collar; this.xml_vars.default_chest = (this.xml_vars.body_size - 14.5) * 2 + 19; this.xml_vars.adj_chest = this.restrict_limit( (this.rdata.chest-this.xml_vars.default_chest) * 2, this.get_adj_limit('chest', 'min'), this.get_adj_limit('chest', 'max') ); this.xml_vars.default_midsection = (this.xml_vars.body_size - 14.5) * 2 + 17.5; this.xml_vars.adj_midsection = this.restrict_limit( (this.rdata.midsection-this.xml_vars.default_midsection) * 2, this.get_adj_limit('midsection', 'min'), this.get_adj_limit('midsection', 'max') ); this.xml_vars.default_bottom = (this.xml_vars.body_size - 14.5) * 2 + 18.5; this.xml_vars.adj_bottom = this.restrict_limit( (this.rdata.adddim_bottom_width-this.xml_vars.default_bottom) * 2, this.get_adj_limit('adddim_bottom_width', 'min'), this.get_adj_limit('adddim_bottom_width', 'max') ); this.xml_vars.default_yoke = this.xml_vars.body_size + 2; this.xml_vars.adj_yoke = this.restrict_limit( this.rdata.yoke-this.xml_vars.default_yoke, this.get_adj_limit('yoke', 'min'), this.get_adj_limit('yoke', 'max') ); this.xml_vars.default_length = 32; this.xml_vars.adj_length = this.restrict_limit( this.rdata.shirt_length-this.xml_vars.default_length, this.get_adj_limit('shirt_length', 'min'), this.get_adj_limit('shirt_length', 'max') ); this.xml_vars.default_sleeve_w = ((this.xml_vars.body_size - 14.5) * 2 * 0.75 + 16) / 2 this.xml_vars.adj_sleeve_w = this.restrict_limit( (this.rdata.sleeve_w-this.xml_vars.default_sleeve_w) * 2, this.get_adj_limit('sleeve_w', 'min'), this.get_adj_limit('sleeve_w', 'max') ); this.xml_vars.default_cuff = 0; this.xml_vars.adj_cuff = this.rdata.cuff - this.xml_vars.default_cuff + 1; this.xml_vars.default_sleeve = 0; this.xml_vars.adj_sleeve = this.data.sleeve - this.xml_vars.default_sleeve; // Actual Shirt Dimensions this.actual_dimensions = {}; this.actual_dimensions.collar = this.xml_vars.adj_collar; this.actual_dimensions.sleeve = this.xml_vars.default_sleeve + this.xml_vars.adj_sleeve; this.actual_dimensions.yoke = this.xml_vars.default_yoke + this.xml_vars.adj_yoke; this.actual_dimensions.chest = this.xml_vars.default_chest + this.xml_vars.adj_chest / 2; this.actual_dimensions.midsection = this.xml_vars.default_midsection + this.xml_vars.adj_midsection / 2; this.actual_dimensions.shirt_length = this.xml_vars.default_length + this.xml_vars.adj_length; this.actual_dimensions.sleeve_w = this.xml_vars.default_sleeve_w + this.xml_vars.adj_sleeve_w / 2; this.actual_dimensions.cuff = this.xml_vars.default_cuff + this.xml_vars.adj_cuff - 1; this.actual_dimensions.adddim_bottom_width = this.xml_vars.default_bottom + this.xml_vars.adj_bottom / 2; for (var i in this.actual_dimensions) { this.actual_dimensions[i] = this.actual_dimensions[i].toFixed(2); } this.min_collar = this.get_limit('collar', 'min'); this.max_collar = this.get_limit('collar', 'max'); this.min_sleeve = this.get_limit('sleeve', 'min'); this.max_sleeve = this.get_limit('sleeve', 'max'); this.min_shoulder = this.min_yoke = this.get_limit('yoke', 'min'); this.max_shoulder = this.max_yoke = this.get_limit('yoke', 'max'); this.min_chest = this.get_limit('chest', 'min'); this.max_chest = this.get_limit('chest', 'max'); this.min_mid = this.min_midsection = this.get_limit('midsection', 'min'); this.max_mid = this.max_midsection = this.get_limit('midsection', 'max'); this.min_length = this.get_limit('length', 'min'); this.max_length = this.get_limit('length', 'max'); this.min_sleeve_w = this.get_limit('sleeve_w', 'min'); this.max_sleeve_w = this.get_limit('sleeve_w', 'max'); this.min_cuff = this.get_limit('cuff', 'min'); this.max_cuff = this.get_limit('cuff', 'max'); this.min_bottom_width = this.get_limit('adddim_bottom_width', 'min'); this.max_bottom_width = this.get_limit('adddim_bottom_width', 'max'); /* var str = "this.actual_dimensions.collar = " + this.actual_dimensions.collar + "\n"; str += "this.actual_dimensions.sleeve = " + this.actual_dimensions.sleeve + "\n"; str += "this.actual_dimensions.yoke = " + this.actual_dimensions.yoke + "\n"; str += "this.actual_dimensions.chest = " + this.actual_dimensions.chest + "\n"; str += "this.actual_dimensions.midsection = " + this.actual_dimensions.midsection + "\n"; str += "this.actual_dimensions.shirt_length = " + this.actual_dimensions.shirt_length + "\n"; str += "this.actual_dimensions.sleeve_w = " + this.actual_dimensions.sleeve_w + "\n"; str += "this.actual_dimensions.cuff = " + this.actual_dimensions.cuff + "\n"; str += "this.actual_dimensions.adddim_bottom_width = " + this.actual_dimensions.adddim_bottom_width + "\n"; alert(str); */ /* var str1 = "collar - " + this.get_limit('collar', 'min') + " | " + this.get_limit('collar', 'max') + "\n"; str1 += "chest - " + this.get_limit('chest', 'min') + " | " + this.get_limit('chest', 'max') + "\n"; str1 += "midsection - " + this.get_limit('midsection', 'min') + " | " + this.get_limit('midsection', 'max') + "\n"; str1 += "adddim_bottom_width - " + this.get_limit('adddim_bottom_width', 'min') + " | " + this.get_limit('adddim_bottom_width', 'max') + "\n"; str1 += "yoke - " + this.get_limit('yoke', 'min') + " | " + this.get_limit('yoke', 'max') + "\n"; str1 += "length - " + this.get_limit('length', 'min') + " | " + this.get_limit('length', 'max') + "\n"; str1 += "sleeve_w - " + this.get_limit('sleeve_w', 'min') + " | " + this.get_limit('sleeve_w', 'max') + "\n"; str1 += "cuff - " + this.get_limit('cuff', 'min') + " | " + this.get_limit('cuff', 'max') + "\n"; str1 += "sleeve - " + this.get_limit('sleeve', 'min') + " | " + this.get_limit('sleeve', 'max') + "\n"; alert(str1); */ } AdjSizes.prototype.restrict_limit = function(value, minimum, maximum) { if (value < minimum) { return minimum; } else if(value > maximum) { return maximum; } else { return value; } } AdjSizes.prototype.get_limit = function(size, type) { switch (size.toLowerCase()) { case "collar": if ("min" == type) { return this.xml_vars.body_size - 2; } else if("max" == type) { return this.xml_vars.body_size + 2; } break; case "chest": if ("min" == type) { return parseFloat(this.actual_dimensions.chest) + Math.max( (this.xml_vars.adj_collar - this.xml_vars.body_size - this.get_adj_limit('collar', 'max')) * 2, this.xml_vars.adj_yoke - this.get_adj_limit('yoke', 'max'), (this.xml_vars.adj_sleeve_w - this.get_adj_limit('sleeve_w', 'max')) * 2 / 1.5, this.xml_vars.adj_midsection - this.get_adj_limit('midsection', 'max') ); } else if("max" == type) { return parseFloat(this.actual_dimensions.chest) + Math.min( (this.xml_vars.adj_collar - this.xml_vars.body_size - this.get_adj_limit('collar', 'min')) * 2, this.xml_vars.adj_yoke - this.get_adj_limit('yoke', 'min'), (this.xml_vars.adj_sleeve_w - this.get_adj_limit('sleeve_w', 'min')) * 2 / 1.5, this.xml_vars.adj_midsection - this.get_adj_limit('midsection', 'min') ); } break; case "midsection": if ("min" == type) { return parseFloat(this.actual_dimensions.midsection) + (this.get_adj_limit('midsection', 'min') - this.xml_vars.adj_midsection) / 2; } else if("max" == type) { return Math.min( parseFloat(this.actual_dimensions.midsection) + (this.get_adj_limit('midsection', 'max') - this.xml_vars.adj_midsection) / 2, parseFloat(this.actual_dimensions.chest) ); } break; case "adddim_bottom_width": if ("min" == type) { return Math.max( parseFloat(this.actual_dimensions.adddim_bottom_width) + ( this.get_adj_limit('adddim_bottom_width', 'min') - this.xml_vars.adj_bottom ) / 2, this.actual_dimensions.midsection ); } else if("max" == type) { return Math.min( parseFloat(this.actual_dimensions.adddim_bottom_width) + ( this.get_adj_limit('adddim_bottom_width', 'max') - this.xml_vars.adj_bottom ) / 2, this.actual_dimensions.chest ); } break; case "yoke": if ("min" == type) { return parseFloat(this.actual_dimensions.yoke) + this.get_adj_limit('yoke', 'min') - this.xml_vars.adj_yoke; } else if("max" == type) { return parseFloat(this.actual_dimensions.yoke) + this.get_adj_limit('yoke', 'max') - this.xml_vars.adj_yoke; } break; case "length": if ("min" == type) { return parseFloat(this.actual_dimensions.shirt_length) + this.get_adj_limit('shirt_length', 'min') - this.xml_vars.adj_length; } else if("max" == type) { return parseFloat(this.actual_dimensions.shirt_length) + this.get_adj_limit('shirt_length', 'max') - this.xml_vars.adj_length; } break; case "sleeve_w": if ("min" == type) { var t = parseFloat(this.actual_dimensions.sleeve_w) + (this.get_adj_limit('sleeve_w', 'min') - this.xml_vars.adj_sleeve_w) / 2; t = t.toFixed(2); return parseFloat(t); } else if("max" == type) { var t = parseFloat(this.actual_dimensions.sleeve_w) + (this.get_adj_limit('sleeve_w', 'max') - this.xml_vars.adj_sleeve_w) / 2; t = t.toFixed(2); return parseFloat(t); } break; case "cuff": if ("min" == type) { return 8; //return parseFloat(this.actual_dimensions.cuff) + this.get_adj_limit('cuff', 'min') - this.xml_vars.adj_cuff; } else if("max" == type) { return 13; //return parseFloat(this.actual_dimensions.cuff) + this.get_adj_limit('cuff', 'max') - this.xml_vars.adj_cuff; } break; case "sleeve": if ("min" == type) { return parseFloat(this.actual_dimensions.sleeve) + this.get_adj_limit('sleeve', 'min') - this.xml_vars.adj_sleeve; } else if("max" == type) { return parseFloat(this.actual_dimensions.sleeve) + this.get_adj_limit('sleeve', 'max') - this.xml_vars.adj_sleeve; } break; } throw new Error("`"+size+"` param in get_limit() doesn't exists"); } AdjSizes.prototype.get_adj_limit = function(size, type) { var limits = { "collar": {"min": -2, "max": 2}, "sleeve": {"min": 22, "max": 42}, "yoke": {"min": -2, "max": 2}, "chest": {"min": -2, "max": 2}, "midsection": {"min": -8, "max": 6}, "shirt_length": {"min": -6, "max": 6}, "sleeve_w": {"min": -2, "max": 2}, "cuff": {"min": 7.5, "max": 9.25}, "adddim_bottom_width": {"min": -6, "max": 6} } if ("min" != type && "max" != type) { throw new Error("type `"+type+"` doesn't exist"); } if (undefined != limits[size]) { return limits[size][type]; } else { throw new Error("size `"+size+"` doesn't exist"); } } AdjSizes.prototype.get_body_size_chest_width = function() { var body_size_chest_widths = { odd: { "13.5": {"2": 11.5, "3": 12.0}, "14.5": {"2": 12.0, "3": 12.5}, "15.5": {"2": 12.5, "3": 13.0}, "16.5": {"2": 13.0, "3": 13.5}, "17.5": {"2": 13.5, "3": 14.0}, "18.5": {"2": 14.0, "3": 14.5}, "19.5": {"2": 14.5, "3": 15.0}, "20.5": {"2": 15.0, "3": 15.5}, "21.5": {"2": 15.5, "3": 16.0}, "22.5": {"2": 16.0, "3": 16.5}, "23.5": {"2": 16.5, "3": 17.0}, "24.5": {"2": 17.0, "3": 17.5}, "25.5": {"2": 17.5, "3": 18.0}, "26.5": {"2": 18.0, "3": 18.5}, "27.5": {"2": 18.5, "3": 19.0}, "28.5": {"2": 19.0, "3": 19.5}, "29.5": {"2": 19.5, "3": 20.0}, "30.5": {"2": 20.0, "3": 20.5}, "31.5": {"2": 20.5, "3": 21.0}, "32.5": {"2": 21.0, "3": 21.5}, "33.5": {"2": 21.5, "3": 22.0}, "34.5": {"2": 22.0, "3": 22.5}, "35.5": {"2": 22.5, "3": 23.0}, "36.5": {"2": 23.0, "3": 23.5}, "37.5": {"2": 23.5, "3": 24.0} }, even: { "13": {"2": 11.0, "3": 11.5, "4": 12.0}, "14": {"2": 11.5, "3": 12.0, "4": 12.5}, "15": {"2": 12.0, "3": 12.5, "4": 13.0}, "16": {"2": 12.5, "3": 13.0, "4": 13.5}, "17": {"2": 13.0, "3": 13.5, "4": 14.0}, "18": {"2": 13.5, "3": 14.0, "4": 14.5}, "19": {"2": 14.0, "3": 14.5, "4": 15.0}, "20": {"2": 14.5, "3": 15.0, "4": 15.5}, "21": {"2": 15.0, "3": 15.5, "4": 16.0}, "22": {"2": 15.5, "3": 16.0, "4": 16.5}, "23": {"2": 16.0, "3": 16.5, "4": 17.0}, "24": {"2": 16.5, "3": 17.0, "4": 17.5}, "25": {"2": 17.0, "3": 17.5, "4": 18.0}, "26": {"2": 17.5, "3": 18.0, "4": 18.5}, "27": {"2": 18.0, "3": 18.5, "4": 19.0}, "28": {"2": 18.5, "3": 19.0, "4": 19.5}, "29": {"2": 19.0, "3": 19.5, "4": 20.0}, "30": {"2": 19.5, "3": 20.0, "4": 20.5}, "31": {"2": 20.0, "3": 20.5, "4": 21.0}, "32": {"2": 20.5, "3": 21.0, "4": 21.5}, "33": {"2": 21.0, "3": 21.5, "4": 22.0}, "34": {"2": 21.5, "3": 22.0, "4": 22.5}, "35": {"2": 22.0, "3": 22.5, "4": 23.0}, "36": {"2": 22.5, "3": 23.0, "4": 23.5}, "37": {"2": 23.0, "3": 23.5, "4": 24.0}, "38": {"2": 23.5, "3": 24.0, "4": 24.5} } }; var optimal_body = (this.data.chest - 19) / 2 + 14.5; var target_column_even = this.data.collar >= optimal_body + 1 ? 4 : (this.data.collar <= optimal_body - 1 ? 2 : 3); var target_column_odd = this.data.collar >= optimal_body ? 3 : 2; var double_chest = this.rdata.chest * 2; if (parseInt(double_chest / 2) == parseFloat(double_chest / 2)) { return body_size_chest_widths.even[parseInt(this.rdata.chest).toString()][target_column_even]; } else { return body_size_chest_widths.odd[parseFloat(this.rdata.chest).toString()][target_column_odd]; } } AdjSizes.prototype.get_default_bottom_width = function() { var default_bottom_widths = { "0": {"1":0, "2":0.5 , "3":1, "4":1.5, "5":2, "6":2 ,"7":2 ,"8":2 ,"9":2 ,"10":2 ,"11":2.5 ,"12":2.5 ,"13":2.5 }, "0.5": {"1":0, "2":0.5 , "3":1, "4":1.5, "5":2, "6":2 ,"7":2 ,"8":2 ,"9":2 ,"10":2 ,"11":2 ,"12":2.5 ,"13":2.5 }, "1": {"1":0, "2":0.25, "3":1, "4":1, "5":1.5, "6":2 ,"7":2 ,"8":2 ,"9":2 ,"10":2 ,"11":2 ,"12":2 ,"13":2 }, "1.5": {"1":0, "2":0.25, "3":0.5, "4":1, "5":1.5, "6":2 ,"7":2 ,"8":2 ,"9":2 ,"10":2 ,"11":2 ,"12":2 ,"13":2 }, "2": {"1":0, "2":0.25, "3":0.5, "4":1, "5":1.5, "6":1.5 ,"7":2 ,"8":2 ,"9":2 ,"10":2 ,"11":2 ,"12":2 ,"13":2 }, "2.5": {"1":0, "2":0.25, "3":0.5, "4":1, "5":1, "6":1.5 ,"7":1.5 ,"8":1.5 ,"9":1.5 ,"10":2 ,"11":2 ,"12":2 ,"13":2 }, "3": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":1, "6":1 ,"7":1.5 ,"8":1.5 ,"9":1.5 ,"10":1.5 ,"11":1.5 ,"12":1.5 ,"13":1.5 }, "3.5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":1, "6":1 ,"7":1 ,"8":1 ,"9":1.5 ,"10":1.5 ,"11":1.5 ,"12":1.5 ,"13":1.5 }, "4": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":1, "6":1 ,"7":1 ,"8":1 ,"9":1 ,"10":1.5 ,"11":1.5 ,"12":1.5 ,"13":1.5 }, "4.5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":1, "6":1 ,"7":1 ,"8":1 ,"9":1 ,"10":1 ,"11":1 ,"12":1 ,"13":1 }, "5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":1 ,"7":1 ,"8":1 ,"9":1 ,"10":1 ,"11":1 ,"12":1 ,"13":1 }, "5.5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":1 ,"10":1 ,"11":1 ,"12":1 ,"13":1 }, "6": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":0.5 ,"10":1 ,"11":1 ,"12":1 ,"13":1 }, "6.5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":0.5 ,"10":0.5 ,"11":0.5 ,"12":0.5 ,"13":0.5 }, "7": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":0.5 ,"10":0.5 ,"11":0.5 ,"12":0.5 ,"13":0.5 }, "7.5": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":0.5 ,"10":0.5 ,"11":0.5 ,"12":0.5 ,"13":0.5 }, "8": {"1":0, "2":0.25, "3":0.5, "4":0.5, "5":0.5, "6":0.5 ,"7":0.5 ,"8":0.5 ,"9":0.5 ,"10":0.5 ,"11":0.5 ,"12":0.5 ,"13":0.5 } }; var length_sleeve_sub = this.rdata.sleeve - this.rdata.shirt_length; length_sleeve_sub = Math.round(length_sleeve_sub * 2) / 2; var chest_midsection_sub = parseInt((this.rdata.chest - this.rdata.midsection) * 2 + 1); if (length_sleeve_sub < 0) length_sleeve_sub = 0; if (length_sleeve_sub > 8) length_sleeve_sub = 8; if (chest_midsection_sub < 1) chest_midsection_sub = 1; if (chest_midsection_sub > 13) chest_midsection_sub = 13; return parseFloat(this.rdata.midsection) + parseFloat(default_bottom_widths[length_sleeve_sub][chest_midsection_sub]); }