/* Combined js And Minified */ 
(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<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=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;G<E;G++){L.call(K(this[G],H),this.length>1||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<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-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+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!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;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?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)})}});
(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<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":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<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=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 U<T[3]-0},gt:function(V,U,T){return U>T[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<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=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<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+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="<a href='#'></a>";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="<p class='TEST'></p>";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="<div class='test e'></div><div class='test'></div>";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;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){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;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||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<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=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("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/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<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").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<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;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<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=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='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';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")}})})();
/*
* jQuery UI 1.7.3
*
* 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(c) { var i = c.fn.remove, d = c.browser.mozilla && (parseFloat(c.browser.version) < 1.9); c.ui = { version: "1.7.3", plugin: { add: function(k, l, n) { var m = c.ui[k].prototype; for (var j in n) { m.plugins[j] = m.plugins[j] || []; m.plugins[j].push([l, n[j]]) } }, call: function(j, l, k) { var n = j.plugins[l]; if (!n || !j.element[0].parentNode) { return } for (var m = 0; m < n.length; m++) { if (j.options[n[m][0]]) { n[m][1].apply(j.element, k) } } } }, contains: function(k, j) { return document.compareDocumentPosition ? k.compareDocumentPosition(j) & 16 : k !== j && k.contains(j) }, hasScroll: function(m, k) { if (c(m).css("overflow") == "hidden") { return false } var j = (k && k == "left") ? "scrollLeft" : "scrollTop", l = false; if (m[j] > 0) { return true } m[j] = 1; l = (m[j] > 0); m[j] = 0; return l }, isOverAxis: function(k, j, l) { return (k > j) && (k < (j + l)) }, isOver: function(o, k, n, m, j, l) { return c.ui.isOverAxis(o, n, j) && c.ui.isOverAxis(k, m, l) }, 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} }; if (d) { var f = c.attr, e = c.fn.removeAttr, h = "http://www.w3.org/2005/07/aaa", a = /^aria-/, b = /^wairole:/; c.attr = function(k, j, l) { var m = l !== undefined; return (j == "role" ? (m ? f.call(this, k, j, "wairole:" + l) : (f.apply(this, arguments) || "").replace(b, "")) : (a.test(j) ? (m ? k.setAttributeNS(h, j.replace(a, "aaa:"), l) : f.call(this, k, j.replace(a, "aaa:"))) : f.apply(this, arguments))) }; c.fn.removeAttr = function(j) { return (a.test(j) ? this.each(function() { this.removeAttributeNS(h, j.replace(a, "")) }) : e.call(this, j)) } } c.fn.extend({ remove: function(j, k) { return this.each(function() { if (!k) { if (!j || c.filter(j, [this]).length) { c("*", this).add(this).each(function() { c(this).triggerHandler("remove") }) } } return i.call(c(this), j, k) }) }, 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 j; if ((c.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { j = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test(c.curCSS(this, "position", 1)) && (/(auto|scroll)/).test(c.curCSS(this, "overflow", 1) + c.curCSS(this, "overflow-y", 1) + c.curCSS(this, "overflow-x", 1)) }).eq(0) } else { j = this.parents().filter(function() { return (/(auto|scroll)/).test(c.curCSS(this, "overflow", 1) + c.curCSS(this, "overflow-y", 1) + c.curCSS(this, "overflow-x", 1)) }).eq(0) } return (/fixed/).test(this.css("position")) || !j.length ? c(document) : j } }); c.extend(c.expr[":"], { data: function(l, k, j) { return !!c.data(l, j[3]) }, focusable: function(k) { var l = k.nodeName.toLowerCase(), j = c.attr(k, "tabindex"); return (/input|select|textarea|button|object/.test(l) ? !k.disabled : "a" == l || "area" == l ? k.href || !isNaN(j) : !isNaN(j)) && !c(k)["area" == l ? "parents" : "closest"](":hidden").length }, tabbable: function(k) { var j = c.attr(k, "tabindex"); return (isNaN(j) || j >= 0) && c(k).is(":focusable") } }); function g(m, n, o, l) { function k(q) { var p = c[m][n][q] || []; return (typeof p == "string" ? p.split(/,?\s+/) : p) } var j = k("getter"); if (l.length == 1 && typeof l[0] == "string") { j = j.concat(k("getterSetter")) } return (c.inArray(o, j) != -1) } c.widget = function(k, j) { var l = k.split(".")[0]; k = k.split(".")[1]; c.fn[k] = function(p) { var n = (typeof p == "string"), o = Array.prototype.slice.call(arguments, 1); if (n && p.substring(0, 1) == "_") { return this } if (n && g(l, k, p, o)) { var m = c.data(this[0], k); return (m ? m[p].apply(m, o) : undefined) } return this.each(function() { var q = c.data(this, k); (!q && !n && c.data(this, k, new c[l][k](this, p))._init()); (q && n && c.isFunction(q[p]) && q[p].apply(q, o)) }) }; c[l] = c[l] || {}; c[l][k] = function(o, n) { var m = this; this.namespace = l; this.widgetName = k; this.widgetEventPrefix = c[l][k].eventPrefix || k; this.widgetBaseClass = l + "-" + k; this.options = c.extend({}, c.widget.defaults, c[l][k].defaults, c.metadata && c.metadata.get(o)[k], n); this.element = c(o).bind("setData." + k, function(q, p, r) { if (q.target == o) { return m._setData(p, r) } }).bind("getData." + k, function(q, p) { if (q.target == o) { return m._getData(p) } }).bind("remove", function() { return m.destroy() }) }; c[l][k].prototype = c.extend({}, c.widget.prototype, j); c[l][k].getterSetter = "option" }; c.widget.prototype = { _init: function() { }, destroy: function() { this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").removeAttr("aria-disabled") }, option: function(l, m) { var k = l, j = this; if (typeof l == "string") { if (m === undefined) { return this._getData(l) } k = {}; k[l] = m } c.each(k, function(n, o) { j._setData(n, o) }) }, _getData: function(j) { return this.options[j] }, _setData: function(j, k) { this.options[j] = k; if (j == "disabled") { this.element[k ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", k) } }, enable: function() { this._setData("disabled", false) }, disable: function() { this._setData("disabled", true) }, _trigger: function(l, m, n) { var p = this.options[l], j = (l == this.widgetEventPrefix ? l : this.widgetEventPrefix + l); m = c.Event(m); m.type = j; if (m.originalEvent) { for (var k = c.event.props.length, o; k; ) { o = c.event.props[--k]; m[o] = m.originalEvent[o] } } this.element.trigger(m, n); return !(c.isFunction(p) && p.call(this.element[0], m, n) === false || m.isDefaultPrevented()) } }; c.widget.defaults = { disabled: false }; c.ui.mouse = { _mouseInit: function() { var j = this; this.element.bind("mousedown." + this.widgetName, function(k) { return j._mouseDown(k) }).bind("click." + this.widgetName, function(k) { if (j._preventClickEvent) { j._preventClickEvent = false; k.stopImmediatePropagation(); return false } }); if (c.browser.msie) { this._mouseUnselectable = this.element.attr("unselectable"); this.element.attr("unselectable", "on") } this.started = false }, _mouseDestroy: function() { this.element.unbind("." + this.widgetName); (c.browser.msie && this.element.attr("unselectable", this._mouseUnselectable)) }, _mouseDown: function(l) { l.originalEvent = l.originalEvent || {}; if (l.originalEvent.mouseHandled) { return } (this._mouseStarted && this._mouseUp(l)); this._mouseDownEvent = l; var k = this, m = (l.which == 1), j = (typeof this.options.cancel == "string" ? c(l.target).parents().add(l.target).filter(this.options.cancel).length : false); if (!m || j || !this._mouseCapture(l)) { return true } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function() { k.mouseDelayMet = true }, this.options.delay) } if (this._mouseDistanceMet(l) && this._mouseDelayMet(l)) { this._mouseStarted = (this._mouseStart(l) !== false); if (!this._mouseStarted) { l.preventDefault(); return true } } this._mouseMoveDelegate = function(n) { return k._mouseMove(n) }; this._mouseUpDelegate = function(n) { return k._mouseUp(n) }; c(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); (c.browser.safari || l.preventDefault()); l.originalEvent.mouseHandled = true; return true }, _mouseMove: function(j) { if (c.browser.msie && !j.button) { return this._mouseUp(j) } if (this._mouseStarted) { this._mouseDrag(j); return j.preventDefault() } if (this._mouseDistanceMet(j) && this._mouseDelayMet(j)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, j) !== false); (this._mouseStarted ? this._mouseDrag(j) : this._mouseUp(j)) } return !this._mouseStarted }, _mouseUp: function(j) { c(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; this._preventClickEvent = (j.target == this._mouseDownEvent.target); this._mouseStop(j) } return false }, _mouseDistanceMet: function(j) { return (Math.max(Math.abs(this._mouseDownEvent.pageX - j.pageX), Math.abs(this._mouseDownEvent.pageY - j.pageY)) >= this.options.distance) }, _mouseDelayMet: function(j) { return this.mouseDelayMet }, _mouseStart: function(j) { }, _mouseDrag: function(j) { }, _mouseStop: function(j) { }, _mouseCapture: function(j) { return true } }; c.ui.mouse.defaults = { cancel: null, distance: 1, delay: 0} })(jQuery); ; /*
 * jQuery UI Draggable 1.7.3
 *
 * 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/Draggables
 *
 * Depends:
 *	ui.core.js
 */
(function(a) { a.widget("ui.draggable", a.extend({}, a.ui.mouse, { _init: function() { if (this.options.helper == "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) { this.element[0].style.position = "relative" } (this.options.addClasses && this.element.addClass("ui-draggable")); (this.options.disabled && this.element.addClass("ui-draggable-disabled")); this._mouseInit() }, destroy: function() { if (!this.element.data("draggable")) { return } this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy() }, _mouseCapture: function(b) { var c = this.options; if (this.helper || c.disabled || a(b.target).is(".ui-resizable-handle")) { return false } this.handle = this._getHandle(b); if (!this.handle) { return false } return true }, _mouseStart: function(b) { var c = this.options; this.helper = this._createHelper(b); this._cacheHelperProportions(); if (a.ui.ddmanager) { a.ui.ddmanager.current = this } this._cacheMargins(); this.cssPosition = this.helper.css("position"); this.scrollParent = this.helper.scrollParent(); this.offset = this.element.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; a.extend(this.offset, { click: { left: b.pageX - this.offset.left, top: b.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this._generatePosition(b); this.originalPageX = b.pageX; this.originalPageY = b.pageY; if (c.cursorAt) { this._adjustOffsetFromHelper(c.cursorAt) } if (c.containment) { this._setContainment() } this._trigger("start", b); this._cacheHelperProportions(); if (a.ui.ddmanager && !c.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, b) } this.helper.addClass("ui-draggable-dragging"); this._mouseDrag(b, true); return true }, _mouseDrag: function(b, d) { this.position = this._generatePosition(b); this.positionAbs = this._convertPositionTo("absolute"); if (!d) { var c = this._uiHash(); this._trigger("drag", b, c); this.position = c.position } if (!this.options.axis || this.options.axis != "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis != "x") { this.helper[0].style.top = this.position.top + "px" } if (a.ui.ddmanager) { a.ui.ddmanager.drag(this, b) } return false }, _mouseStop: function(c) { var d = false; if (a.ui.ddmanager && !this.options.dropBehaviour) { d = a.ui.ddmanager.drop(this, c) } if (this.dropped) { d = this.dropped; this.dropped = false } if ((this.options.revert == "invalid" && !d) || (this.options.revert == "valid" && d) || this.options.revert === true || (a.isFunction(this.options.revert) && this.options.revert.call(this.element, d))) { var b = this; a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { b._trigger("stop", c); b._clear() }) } else { this._trigger("stop", c); this._clear() } return false }, _getHandle: function(b) { var c = !this.options.handle || !a(this.options.handle, this.element).length ? true : false; a(this.options.handle, this.element).find("*").andSelf().each(function() { if (this == b.target) { c = true } }); return c }, _createHelper: function(c) { var d = this.options; var b = a.isFunction(d.helper) ? a(d.helper.apply(this.element[0], [c])) : (d.helper == "clone" ? this.element.clone() : this.element); if (!b.parents("body").length) { b.appendTo((d.appendTo == "parent" ? this.element[0].parentNode : d.appendTo)) } if (b[0] != this.element[0] && !(/(fixed|absolute)/).test(b.css("position"))) { b.css("position", "absolute") } return b }, _adjustOffsetFromHelper: function(b) { if (b.left != undefined) { this.offset.click.left = b.left + this.margins.left } if (b.right != undefined) { this.offset.click.left = this.helperProportions.width - b.right + this.margins.left } if (b.top != undefined) { this.offset.click.top = b.top + this.margins.top } if (b.bottom != undefined) { this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top } }, _getParentOffset: function() { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) { b.left += this.scrollParent.scrollLeft(); b.top += this.scrollParent.scrollTop() } if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie)) { b = { top: 0, left: 0} } return { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function() { if (this.cssPosition == "relative") { var b = this.element.position(); return { top: b.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: b.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } else { return { top: 0, left: 0} } }, _cacheMargins: function() { this.margins = { left: (parseInt(this.element.css("marginLeft"), 10) || 0), top: (parseInt(this.element.css("marginTop"), 10) || 0)} }, _cacheHelperProportions: function() { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function() { var e = this.options; if (e.containment == "parent") { e.containment = this.helper[0].parentNode } if (e.containment == "document" || e.containment == "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(e.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (a(e.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (!(/^(document|window|parent)$/).test(e.containment) && e.containment.constructor != Array) { var c = a(e.containment)[0]; if (!c) { return } var d = a(e.containment).offset(); var b = (a(c).css("overflow") != "hidden"); this.containment = [d.left + (parseInt(a(c).css("borderLeftWidth"), 10) || 0) + (parseInt(a(c).css("paddingLeft"), 10) || 0) - this.margins.left, d.top + (parseInt(a(c).css("borderTopWidth"), 10) || 0) + (parseInt(a(c).css("paddingTop"), 10) || 0) - this.margins.top, d.left + (b ? Math.max(c.scrollWidth, c.offsetWidth) : c.offsetWidth) - (parseInt(a(c).css("borderLeftWidth"), 10) || 0) - (parseInt(a(c).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, d.top + (b ? Math.max(c.scrollHeight, c.offsetHeight) : c.offsetHeight) - (parseInt(a(c).css("borderTopWidth"), 10) || 0) - (parseInt(a(c).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } else { if (e.containment.constructor == Array) { this.containment = e.containment } } }, _convertPositionTo: function(f, h) { if (!h) { h = this.position } var c = f == "absolute" ? 1 : -1; var e = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, g = (/(html|body)/i).test(b[0].tagName); return { top: (h.top + this.offset.relative.top * c + this.offset.parent.top * c - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (g ? 0 : b.scrollTop())) * c)), left: (h.left + this.offset.relative.left * c + this.offset.parent.left * c - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : g ? 0 : b.scrollLeft()) * c))} }, _generatePosition: function(e) { var h = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, i = (/(html|body)/i).test(b[0].tagName); if (this.cssPosition == "relative" && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset() } var d = e.pageX; var c = e.pageY; if (this.originalPosition) { if (this.containment) { if (e.pageX - this.offset.click.left < this.containment[0]) { d = this.containment[0] + this.offset.click.left } if (e.pageY - this.offset.click.top < this.containment[1]) { c = this.containment[1] + this.offset.click.top } if (e.pageX - this.offset.click.left > this.containment[2]) { d = this.containment[2] + this.offset.click.left } if (e.pageY - this.offset.click.top > this.containment[3]) { c = this.containment[3] + this.offset.click.top } } if (h.grid) { var g = this.originalPageY + Math.round((c - this.originalPageY) / h.grid[1]) * h.grid[1]; c = this.containment ? (!(g - this.offset.click.top < this.containment[1] || g - this.offset.click.top > this.containment[3]) ? g : (!(g - this.offset.click.top < this.containment[1]) ? g - h.grid[1] : g + h.grid[1])) : g; var f = this.originalPageX + Math.round((d - this.originalPageX) / h.grid[0]) * h.grid[0]; d = this.containment ? (!(f - this.offset.click.left < this.containment[0] || f - this.offset.click.left > this.containment[2]) ? f : (!(f - this.offset.click.left < this.containment[0]) ? f - h.grid[0] : f + h.grid[0])) : f } } return { top: (c - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (i ? 0 : b.scrollTop())))), left: (d - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : i ? 0 : b.scrollLeft())))} }, _clear: function() { this.helper.removeClass("ui-draggable-dragging"); if (this.helper[0] != this.element[0] && !this.cancelHelperRemoval) { this.helper.remove() } this.helper = null; this.cancelHelperRemoval = false }, _trigger: function(b, c, d) { d = d || this._uiHash(); a.ui.plugin.call(this, b, [c, d]); if (b == "drag") { this.positionAbs = this._convertPositionTo("absolute") } return a.widget.prototype._trigger.call(this, b, c, d) }, plugins: {}, _uiHash: function(b) { return { helper: this.helper, position: this.position, absolutePosition: this.positionAbs, offset: this.positionAbs} } })); a.extend(a.ui.draggable, { version: "1.7.3", eventPrefix: "drag", defaults: { addClasses: true, appendTo: "parent", axis: false, cancel: ":input,option", connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, delay: 0, distance: 1, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false} }); a.ui.plugin.add("draggable", "connectToSortable", { start: function(c, e) { var d = a(this).data("draggable"), f = d.options, b = a.extend({}, e, { item: d.element }); d.sortables = []; a(f.connectToSortable).each(function() { var g = a.data(this, "sortable"); if (g && !g.options.disabled) { d.sortables.push({ instance: g, shouldRevert: g.options.revert }); g._refreshItems(); g._trigger("activate", c, b) } }) }, stop: function(c, e) { var d = a(this).data("draggable"), b = a.extend({}, e, { item: d.element }); a.each(d.sortables, function() { if (this.instance.isOver) { this.instance.isOver = 0; d.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = true } this.instance._mouseStop(c); this.instance.options.helper = this.instance.options._helper; if (d.options.helper == "original") { this.instance.currentItem.css({ top: "auto", left: "auto" }) } } else { this.instance.cancelHelperRemoval = false; this.instance._trigger("deactivate", c, b) } }) }, drag: function(c, f) { var e = a(this).data("draggable"), b = this; var d = function(i) { var n = this.offset.click.top, m = this.offset.click.left; var g = this.positionAbs.top, k = this.positionAbs.left; var j = i.height, l = i.width; var p = i.top, h = i.left; return a.ui.isOver(g + n, k + m, p, h, j, l) }; a.each(e.sortables, function(g) { this.instance.positionAbs = e.positionAbs; this.instance.helperProportions = e.helperProportions; this.instance.offset.click = e.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = a(b).clone().appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function() { return f.helper[0] }; c.target = this.instance.currentItem[0]; this.instance._mouseCapture(c, true); this.instance._mouseStart(c, true, true); this.instance.offset.click.top = e.offset.click.top; this.instance.offset.click.left = e.offset.click.left; this.instance.offset.parent.left -= e.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= e.offset.parent.top - this.instance.offset.parent.top; e._trigger("toSortable", c); e.dropped = this.instance.element; e.currentItem = e.element; this.instance.fromOutside = e } if (this.instance.currentItem) { this.instance._mouseDrag(c) } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance._trigger("out", c, this.instance._uiHash(this.instance)); this.instance._mouseStop(c, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); if (this.instance.placeholder) { this.instance.placeholder.remove() } e._trigger("fromSortable", c); e.dropped = false } } }) } }); a.ui.plugin.add("draggable", "cursor", { start: function(c, d) { var b = a("body"), e = a(this).data("draggable").options; if (b.css("cursor")) { e._cursor = b.css("cursor") } b.css("cursor", e.cursor) }, stop: function(b, c) { var d = a(this).data("draggable").options; if (d._cursor) { a("body").css("cursor", d._cursor) } } }); a.ui.plugin.add("draggable", "iframeFix", { start: function(b, c) { var d = a(this).data("draggable").options; a(d.iframeFix === true ? "iframe" : d.iframeFix).each(function() { a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1000 }).css(a(this).offset()).appendTo("body") }) }, stop: function(b, c) { a("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this) }) } }); a.ui.plugin.add("draggable", "opacity", { start: function(c, d) { var b = a(d.helper), e = a(this).data("draggable").options; if (b.css("opacity")) { e._opacity = b.css("opacity") } b.css("opacity", e.opacity) }, stop: function(b, c) { var d = a(this).data("draggable").options; if (d._opacity) { a(c.helper).css("opacity", d._opacity) } } }); a.ui.plugin.add("draggable", "scroll", { start: function(c, d) { var b = a(this).data("draggable"); if (b.scrollParent[0] != document && b.scrollParent[0].tagName != "HTML") { b.overflowOffset = b.scrollParent.offset() } }, drag: function(d, e) { var c = a(this).data("draggable"), f = c.options, b = false; if (c.scrollParent[0] != document && c.scrollParent[0].tagName != "HTML") { if (!f.axis || f.axis != "x") { if ((c.overflowOffset.top + c.scrollParent[0].offsetHeight) - d.pageY < f.scrollSensitivity) { c.scrollParent[0].scrollTop = b = c.scrollParent[0].scrollTop + f.scrollSpeed } else { if (d.pageY - c.overflowOffset.top < f.scrollSensitivity) { c.scrollParent[0].scrollTop = b = c.scrollParent[0].scrollTop - f.scrollSpeed } } } if (!f.axis || f.axis != "y") { if ((c.overflowOffset.left + c.scrollParent[0].offsetWidth) - d.pageX < f.scrollSensitivity) { c.scrollParent[0].scrollLeft = b = c.scrollParent[0].scrollLeft + f.scrollSpeed } else { if (d.pageX - c.overflowOffset.left < f.scrollSensitivity) { c.scrollParent[0].scrollLeft = b = c.scrollParent[0].scrollLeft - f.scrollSpeed } } } } else { if (!f.axis || f.axis != "x") { if (d.pageY - a(document).scrollTop() < f.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() - f.scrollSpeed) } else { if (a(window).height() - (d.pageY - a(document).scrollTop()) < f.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() + f.scrollSpeed) } } } if (!f.axis || f.axis != "y") { if (d.pageX - a(document).scrollLeft() < f.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() - f.scrollSpeed) } else { if (a(window).width() - (d.pageX - a(document).scrollLeft()) < f.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() + f.scrollSpeed) } } } } if (b !== false && a.ui.ddmanager && !f.dropBehaviour) { a.ui.ddmanager.prepareOffsets(c, d) } } }); a.ui.plugin.add("draggable", "snap", { start: function(c, d) { var b = a(this).data("draggable"), e = b.options; b.snapElements = []; a(e.snap.constructor != String ? (e.snap.items || ":data(draggable)") : e.snap).each(function() { var g = a(this); var f = g.offset(); if (this != b.element[0]) { b.snapElements.push({ item: this, width: g.outerWidth(), height: g.outerHeight(), top: f.top, left: f.left }) } }) }, drag: function(u, p) { var g = a(this).data("draggable"), q = g.options; var y = q.snapTolerance; var x = p.offset.left, w = x + g.helperProportions.width, f = p.offset.top, e = f + g.helperProportions.height; for (var v = g.snapElements.length - 1; v >= 0; v--) { var s = g.snapElements[v].left, n = s + g.snapElements[v].width, m = g.snapElements[v].top, A = m + g.snapElements[v].height; if (!((s - y < x && x < n + y && m - y < f && f < A + y) || (s - y < x && x < n + y && m - y < e && e < A + y) || (s - y < w && w < n + y && m - y < f && f < A + y) || (s - y < w && w < n + y && m - y < e && e < A + y))) { if (g.snapElements[v].snapping) { (g.options.snap.release && g.options.snap.release.call(g.element, u, a.extend(g._uiHash(), { snapItem: g.snapElements[v].item }))) } g.snapElements[v].snapping = false; continue } if (q.snapMode != "inner") { var c = Math.abs(m - e) <= y; var z = Math.abs(A - f) <= y; var j = Math.abs(s - w) <= y; var k = Math.abs(n - x) <= y; if (c) { p.position.top = g._convertPositionTo("relative", { top: m - g.helperProportions.height, left: 0 }).top - g.margins.top } if (z) { p.position.top = g._convertPositionTo("relative", { top: A, left: 0 }).top - g.margins.top } if (j) { p.position.left = g._convertPositionTo("relative", { top: 0, left: s - g.helperProportions.width }).left - g.margins.left } if (k) { p.position.left = g._convertPositionTo("relative", { top: 0, left: n }).left - g.margins.left } } var h = (c || z || j || k); if (q.snapMode != "outer") { var c = Math.abs(m - f) <= y; var z = Math.abs(A - e) <= y; var j = Math.abs(s - x) <= y; var k = Math.abs(n - w) <= y; if (c) { p.position.top = g._convertPositionTo("relative", { top: m, left: 0 }).top - g.margins.top } if (z) { p.position.top = g._convertPositionTo("relative", { top: A - g.helperProportions.height, left: 0 }).top - g.margins.top } if (j) { p.position.left = g._convertPositionTo("relative", { top: 0, left: s }).left - g.margins.left } if (k) { p.position.left = g._convertPositionTo("relative", { top: 0, left: n - g.helperProportions.width }).left - g.margins.left } } if (!g.snapElements[v].snapping && (c || z || j || k || h)) { (g.options.snap.snap && g.options.snap.snap.call(g.element, u, a.extend(g._uiHash(), { snapItem: g.snapElements[v].item }))) } g.snapElements[v].snapping = (c || z || j || k || h) } } }); a.ui.plugin.add("draggable", "stack", { start: function(b, c) { var e = a(this).data("draggable").options; var d = a.makeArray(a(e.stack.group)).sort(function(g, f) { return (parseInt(a(g).css("zIndex"), 10) || e.stack.min) - (parseInt(a(f).css("zIndex"), 10) || e.stack.min) }); a(d).each(function(f) { this.style.zIndex = e.stack.min + f }); this[0].style.zIndex = e.stack.min + d.length } }); a.ui.plugin.add("draggable", "zIndex", { start: function(c, d) { var b = a(d.helper), e = a(this).data("draggable").options; if (b.css("zIndex")) { e._zIndex = b.css("zIndex") } b.css("zIndex", e.zIndex) }, stop: function(b, c) { var d = a(this).data("draggable").options; if (d._zIndex) { a(c.helper).css("zIndex", d._zIndex) } } }) })(jQuery); ; /*
 * jQuery UI Dialog 1.7.3
 *
 * 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/Dialog
 *
 * Depends:
 *	ui.core.js
 *	ui.draggable.js
 *	ui.resizable.js
 */
(function(c) { var b = { dragStart: "start.draggable", drag: "drag.draggable", dragStop: "stop.draggable", maxHeight: "maxHeight.resizable", minHeight: "minHeight.resizable", maxWidth: "maxWidth.resizable", minWidth: "minWidth.resizable", resizeStart: "start.resizable", resize: "drag.resizable", resizeStop: "stop.resizable" }, a = "ui-dialog ui-widget ui-widget-content ui-corner-all "; c.widget("ui.dialog", { _init: function() { this.originalTitle = this.element.attr("title"); var l = this, m = this.options, j = m.title || this.originalTitle || "&nbsp;", e = c.ui.dialog.getTitleId(this.element), k = (this.uiDialog = c("<div/>")).appendTo(document.body).hide().addClass(a + m.dialogClass).css({ position: "absolute", overflow: "hidden", zIndex: m.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function(n) { (m.closeOnEscape && n.keyCode && n.keyCode == c.ui.keyCode.ESCAPE && l.close(n)) }).attr({ role: "dialog", "aria-labelledby": e }).mousedown(function(n) { l.moveToTop(false, n) }), g = this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k), f = (this.uiDialogTitlebar = c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k), i = c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", "button").hover(function() { i.addClass("ui-state-hover") }, function() { i.removeClass("ui-state-hover") }).focus(function() { i.addClass("ui-state-focus") }).blur(function() { i.removeClass("ui-state-focus") }).mousedown(function(n) { n.stopPropagation() }).click(function(n) { l.close(n); return false }).appendTo(f), h = (this.uiDialogTitlebarCloseText = c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i), d = c("<span/>").addClass("ui-dialog-title").attr("id", e).html(j).prependTo(f); f.find("*").add(f).disableSelection(); (m.draggable && c.fn.draggable && this._makeDraggable()); (m.resizable && c.fn.resizable && this._makeResizable()); this._createButtons(m.buttons); this._isOpen = false; (m.bgiframe && c.fn.bgiframe && k.bgiframe()); (m.autoOpen && this.open()) }, destroy: function() { (this.overlay && this.overlay.destroy()); this.uiDialog.hide(); this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); this.uiDialog.remove(); (this.originalTitle && this.element.attr("title", this.originalTitle)) }, close: function(f) { var d = this; if (false === d._trigger("beforeclose", f)) { return } (d.overlay && d.overlay.destroy()); d.uiDialog.unbind("keypress.ui-dialog"); (d.options.hide ? d.uiDialog.hide(d.options.hide, function() { d._trigger("close", f) }) : d.uiDialog.hide() && d._trigger("close", f)); c.ui.dialog.overlay.resize(); d._isOpen = false; if (d.options.modal) { var e = 0; c(".ui-dialog").each(function() { if (this != d.uiDialog[0]) { e = Math.max(e, c(this).css("z-index")) } }); c.ui.dialog.maxZ = e } }, isOpen: function() { return this._isOpen }, moveToTop: function(f, e) { if ((this.options.modal && !f) || (!this.options.stack && !this.options.modal)) { return this._trigger("focus", e) } if (this.options.zIndex > c.ui.dialog.maxZ) { c.ui.dialog.maxZ = this.options.zIndex } (this.overlay && this.overlay.$el.css("z-index", c.ui.dialog.overlay.maxZ = ++c.ui.dialog.maxZ)); var d = { scrollTop: this.element.attr("scrollTop"), scrollLeft: this.element.attr("scrollLeft") }; this.uiDialog.css("z-index", ++c.ui.dialog.maxZ); this.element.attr(d); this._trigger("focus", e) }, open: function() { if (this._isOpen) { return } var e = this.options, d = this.uiDialog; this.overlay = e.modal ? new c.ui.dialog.overlay(this) : null; (d.next().length && d.appendTo("body")); this._size(); this._position(e.position); d.show(e.show); this.moveToTop(true); (e.modal && d.bind("keypress.ui-dialog", function(h) { if (h.keyCode != c.ui.keyCode.TAB) { return } var g = c(":tabbable", this), i = g.filter(":first")[0], f = g.filter(":last")[0]; if (h.target == f && !h.shiftKey) { setTimeout(function() { i.focus() }, 1) } else { if (h.target == i && h.shiftKey) { setTimeout(function() { f.focus() }, 1) } } })); c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus(); this._trigger("open"); this._isOpen = true }, _createButtons: function(g) { var f = this, d = false, e = c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"); this.uiDialog.find(".ui-dialog-buttonpane").remove(); (typeof g == "object" && g !== null && c.each(g, function() { return !(d = true) })); if (d) { c.each(g, function(h, i) { c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function() { i.apply(f.element[0], arguments) }).hover(function() { c(this).addClass("ui-state-hover") }, function() { c(this).removeClass("ui-state-hover") }).focus(function() { c(this).addClass("ui-state-focus") }).blur(function() { c(this).removeClass("ui-state-focus") }).appendTo(e) }); e.appendTo(this.uiDialog) } }, _makeDraggable: function() { var d = this, f = this.options, e; this.uiDialog.draggable({ cancel: ".ui-dialog-content", handle: ".ui-dialog-titlebar", containment: "document", start: function() { e = f.height; c(this).height(c(this).height()).addClass("ui-dialog-dragging"); (f.dragStart && f.dragStart.apply(d.element[0], arguments)) }, drag: function() { (f.drag && f.drag.apply(d.element[0], arguments)) }, stop: function() { c(this).removeClass("ui-dialog-dragging").height(e); (f.dragStop && f.dragStop.apply(d.element[0], arguments)); c.ui.dialog.overlay.resize() } }) }, _makeResizable: function(g) { g = (g === undefined ? this.options.resizable : g); var d = this, f = this.options, e = typeof g == "string" ? g : "n,e,s,w,se,sw,ne,nw"; this.uiDialog.resizable({ cancel: ".ui-dialog-content", alsoResize: this.element, maxWidth: f.maxWidth, maxHeight: f.maxHeight, minWidth: f.minWidth, minHeight: f.minHeight, start: function() { c(this).addClass("ui-dialog-resizing"); (f.resizeStart && f.resizeStart.apply(d.element[0], arguments)) }, resize: function() { (f.resize && f.resize.apply(d.element[0], arguments)) }, handles: e, stop: function() { c(this).removeClass("ui-dialog-resizing"); f.height = c(this).height(); f.width = c(this).width(); (f.resizeStop && f.resizeStop.apply(d.element[0], arguments)); c.ui.dialog.overlay.resize() } }).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se") }, _position: function(i) { var e = c(window), f = c(document), g = f.scrollTop(), d = f.scrollLeft(), h = g; if (c.inArray(i, ["center", "top", "right", "bottom", "left"]) >= 0) { i = [i == "right" || i == "left" ? i : "center", i == "top" || i == "bottom" ? i : "middle"] } if (i.constructor != Array) { i = ["center", "middle"] } if (i[0].constructor == Number) { d += i[0] } else { switch (i[0]) { case "left": d += 0; break; case "right": d += e.width() - this.uiDialog.outerWidth(); break; default: case "center": d += (e.width() - this.uiDialog.outerWidth()) / 2 } } if (i[1].constructor == Number) { g += i[1] } else { switch (i[1]) { case "top": g += 0; break; case "bottom": g += e.height() - this.uiDialog.outerHeight(); break; default: case "middle": g += (e.height() - this.uiDialog.outerHeight()) / 2 } } g = Math.max(g, h); this.uiDialog.css({ top: g, left: d }) }, _setData: function(e, f) { (b[e] && this.uiDialog.data(b[e], f)); switch (e) { case "buttons": this._createButtons(f); break; case "closeText": this.uiDialogTitlebarCloseText.text(f); break; case "dialogClass": this.uiDialog.removeClass(this.options.dialogClass).addClass(a + f); break; case "draggable": (f ? this._makeDraggable() : this.uiDialog.draggable("destroy")); break; case "height": this.uiDialog.height(f); break; case "position": this._position(f); break; case "resizable": var d = this.uiDialog, g = this.uiDialog.is(":data(resizable)"); (g && !f && d.resizable("destroy")); (g && typeof f == "string" && d.resizable("option", "handles", f)); (g || this._makeResizable(f)); break; case "title": c(".ui-dialog-title", this.uiDialogTitlebar).html(f || "&nbsp;"); break; case "width": this.uiDialog.width(f); break } c.widget.prototype._setData.apply(this, arguments) }, _size: function() { var e = this.options; this.element.css({ height: 0, minHeight: 0, width: "auto" }); var d = this.uiDialog.css({ height: "auto", width: e.width }).height(); this.element.css({ minHeight: Math.max(e.minHeight - d, 0), height: e.height == "auto" ? "auto" : Math.max(e.height - d, 0) }) } }); c.extend(c.ui.dialog, { version: "1.7.3", defaults: { autoOpen: true, bgiframe: false, buttons: {}, closeOnEscape: true, closeText: "close", dialogClass: "", draggable: true, hide: null, height: "auto", maxHeight: false, maxWidth: false, minHeight: 150, minWidth: 150, modal: false, position: "center", resizable: true, show: null, stack: true, title: "", width: 300, zIndex: 1000 }, getter: "isOpen", uuid: 0, maxZ: 0, getTitleId: function(d) { return "ui-dialog-title-" + (d.attr("id") || ++this.uuid) }, overlay: function(d) { this.$el = c.ui.dialog.overlay.create(d) } }); c.extend(c.ui.dialog.overlay, { instances: [], maxZ: 0, events: c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function(d) { return d + ".dialog-overlay" }).join(" "), create: function(e) { if (this.instances.length === 0) { setTimeout(function() { if (c.ui.dialog.overlay.instances.length) { c(document).bind(c.ui.dialog.overlay.events, function(f) { var g = c(f.target).parents(".ui-dialog").css("zIndex") || 0; return (g > c.ui.dialog.overlay.maxZ) }) } }, 1); c(document).bind("keydown.dialog-overlay", function(f) { (e.options.closeOnEscape && f.keyCode && f.keyCode == c.ui.keyCode.ESCAPE && e.close(f)) }); c(window).bind("resize.dialog-overlay", c.ui.dialog.overlay.resize) } var d = c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({ width: this.width(), height: this.height() }); (e.options.bgiframe && c.fn.bgiframe && d.bgiframe()); this.instances.push(d); return d }, destroy: function(d) { this.instances.splice(c.inArray(this.instances, d), 1); if (this.instances.length === 0) { c([document, window]).unbind(".dialog-overlay") } d.remove(); var e = 0; c.each(this.instances, function() { e = Math.max(e, this.css("z-index")) }); this.maxZ = e }, height: function() { if (c.browser.msie && c.browser.version < 7) { var e = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); var d = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); if (e < d) { return c(window).height() + "px" } else { return e + "px" } } else { return c(document).height() + "px" } }, width: function() { if (c.browser.msie && c.browser.version < 7) { var d = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); var e = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if (d < e) { return c(window).width() + "px" } else { return d + "px" } } else { return c(document).width() + "px" } }, resize: function() { var d = c([]); c.each(c.ui.dialog.overlay.instances, function() { d = d.add(this) }); d.css({ width: 0, height: 0 }).css({ width: c.ui.dialog.overlay.width(), height: c.ui.dialog.overlay.height() }) } }); c.extend(c.ui.dialog.overlay.prototype, { destroy: function() { c.ui.dialog.overlay.destroy(this.$el) } }) })(jQuery); ; /*
 * jQuery UI Slider 1.7.3
 *
 * 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(a) { a.widget("ui.slider", a.extend({}, a.ui.mouse, { _init: function() { var b = this, c = 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 = a([]); if (c.range) { if (c.range === true) { this.range = a("<div></div>"); if (!c.values) { c.values = [this._valueMin(), this._valueMin()] } if (c.values.length && c.values.length != 2) { c.values = [c.values[0], c.values[0]] } } else { this.range = a("<div></div>") } this.range.appendTo(this.element).addClass("ui-slider-range"); if (c.range == "min" || c.range == "max") { this.range.addClass("ui-slider-range-" + c.range) } this.range.addClass("ui-widget-header") } if (a(".ui-slider-handle", this.element).length == 0) { a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle") } if (c.values && c.values.length) { while (a(".ui-slider-handle", this.element).length < c.values.length) { a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle") } } this.handles = a(".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(d) { d.preventDefault() }).hover(function() { if (!c.disabled) { a(this).addClass("ui-state-hover") } }, function() { a(this).removeClass("ui-state-hover") }).focus(function() { if (!c.disabled) { a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"); a(this).addClass("ui-state-focus") } else { a(this).blur() } }).blur(function() { a(this).removeClass("ui-state-focus") }); this.handles.each(function(d) { a(this).data("index.ui-slider-handle", d) }); this.handles.keydown(function(i) { var f = true; var e = a(this).data("index.ui-slider-handle"); if (b.options.disabled) { return } switch (i.keyCode) { case a.ui.keyCode.HOME: case a.ui.keyCode.END: case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: f = false; if (!b._keySliding) { b._keySliding = true; a(this).addClass("ui-state-active"); b._start(i, e) } break } var g, d, h = b._step(); if (b.options.values && b.options.values.length) { g = d = b.values(e) } else { g = d = b.value() } switch (i.keyCode) { case a.ui.keyCode.HOME: d = b._valueMin(); break; case a.ui.keyCode.END: d = b._valueMax(); break; case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: if (g == b._valueMax()) { return } d = g + h; break; case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: if (g == b._valueMin()) { return } d = g - h; break } b._slide(i, e, d); return f }).keyup(function(e) { var d = a(this).data("index.ui-slider-handle"); if (b._keySliding) { b._stop(e, d); b._change(e, d); b._keySliding = false; a(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(d) { var e = this.options; if (e.disabled) { return false } this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); var h = { x: d.pageX, y: d.pageY }; var j = this._normValueFromMouse(h); var c = this._valueMax() - this._valueMin() + 1, f; var k = this, i; this.handles.each(function(l) { var m = Math.abs(j - k.values(l)); if (c > m) { c = m; f = a(this); i = l } }); if (e.range == true && this.values(1) == e.min) { f = a(this.handles[++i]) } this._start(d, i); k._handleIndex = i; f.addClass("ui-state-active").focus(); var g = f.offset(); var b = !a(d.target).parents().andSelf().is(".ui-slider-handle"); this._clickOffset = b ? { left: 0, top: 0} : { left: d.pageX - g.left - (f.width() / 2), top: d.pageY - g.top - (f.height() / 2) - (parseInt(f.css("borderTopWidth"), 10) || 0) - (parseInt(f.css("borderBottomWidth"), 10) || 0) + (parseInt(f.css("marginTop"), 10) || 0) }; j = this._normValueFromMouse(h); this._slide(d, i, j); return true }, _mouseStart: function(b) { return true }, _mouseDrag: function(d) { var b = { x: d.pageX, y: d.pageY }; var c = this._normValueFromMouse(b); this._slide(d, this._handleIndex, c); return false }, _mouseStop: function(b) { this.handles.removeClass("ui-state-active"); this._stop(b, this._handleIndex); this._change(b, this._handleIndex); this._handleIndex = null; this._clickOffset = null; return false }, _detectOrientation: function() { this.orientation = this.options.orientation == "vertical" ? "vertical" : "horizontal" }, _normValueFromMouse: function(d) { var c, h; if ("horizontal" == this.orientation) { c = this.elementSize.width; h = d.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0) } else { c = this.elementSize.height; h = d.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0) } var f = (h / c); if (f > 1) { f = 1 } if (f < 0) { f = 0 } if ("vertical" == this.orientation) { f = 1 - f } var e = this._valueMax() - this._valueMin(), i = f * e, b = i % this.options.step, g = this._valueMin() + i - b; if (b > (this.options.step / 2)) { g += this.options.step } return parseFloat(g.toFixed(5)) }, _start: function(d, c) { var b = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) { b.value = this.values(c); b.values = this.values() } this._trigger("start", d, b) }, _slide: function(f, e, d) { var g = this.handles[e]; if (this.options.values && this.options.values.length) { var b = this.values(e ? 0 : 1); if ((this.options.values.length == 2 && this.options.range === true) && ((e == 0 && d > b) || (e == 1 && d < b))) { d = b } if (d != this.values(e)) { var c = this.values(); c[e] = d; var h = this._trigger("slide", f, { handle: this.handles[e], value: d, values: c }); var b = this.values(e ? 0 : 1); if (h !== false) { this.values(e, d, (f.type == "mousedown" && this.options.animate), true) } } } else { if (d != this.value()) { var h = this._trigger("slide", f, { handle: this.handles[e], value: d }); if (h !== false) { this._setData("value", d, (f.type == "mousedown" && this.options.animate)) } } } }, _stop: function(d, c) { var b = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) { b.value = this.values(c); b.values = this.values() } this._trigger("stop", d, b) }, _change: function(d, c) { var b = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) { b.value = this.values(c); b.values = this.values() } this._trigger("change", d, b) }, value: function(b) { if (arguments.length) { this._setData("value", b); this._change(null, 0) } return this._value() }, values: function(b, e, c, d) { if (arguments.length > 1) { this.options.values[b] = e; this._refreshValue(c); if (!d) { this._change(null, b) } } if (arguments.length) { if (this.options.values && this.options.values.length) { return this._values(b) } else { return this.value() } } else { return this._values() } }, _setData: function(b, d, c) { a.widget.prototype._setData.apply(this, arguments); switch (b) { case "disabled": if (d) { 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(c); break; case "value": this._refreshValue(c); break } }, _step: function() { var b = this.options.step; return b }, _value: function() { var b = this.options.value; if (b < this._valueMin()) { b = this._valueMin() } if (b > this._valueMax()) { b = this._valueMax() } return b }, _values: function(b) { if (arguments.length) { var c = this.options.values[b]; if (c < this._valueMin()) { c = this._valueMin() } if (c > this._valueMax()) { c = this._valueMax() } return c } else { return this.options.values } }, _valueMin: function() { var b = this.options.min; return b }, _valueMax: function() { var b = this.options.max; return b }, _refreshValue: function(c) { var f = this.options.range, d = this.options, l = this; if (this.options.values && this.options.values.length) { var i, h; this.handles.each(function(p, n) { var o = (l.values(p) - l._valueMin()) / (l._valueMax() - l._valueMin()) * 100; var m = {}; m[l.orientation == "horizontal" ? "left" : "bottom"] = o + "%"; a(this).stop(1, 1)[c ? "animate" : "css"](m, d.animate); if (l.options.range === true) { if (l.orientation == "horizontal") { (p == 0) && l.range.stop(1, 1)[c ? "animate" : "css"]({ left: o + "%" }, d.animate); (p == 1) && l.range[c ? "animate" : "css"]({ width: (o - lastValPercent) + "%" }, { queue: false, duration: d.animate }) } else { (p == 0) && l.range.stop(1, 1)[c ? "animate" : "css"]({ bottom: (o) + "%" }, d.animate); (p == 1) && l.range[c ? "animate" : "css"]({ height: (o - lastValPercent) + "%" }, { queue: false, duration: d.animate }) } } lastValPercent = o }) } else { var j = this.value(), g = this._valueMin(), k = this._valueMax(), e = k != g ? (j - g) / (k - g) * 100 : 0; var b = {}; b[l.orientation == "horizontal" ? "left" : "bottom"] = e + "%"; this.handle.stop(1, 1)[c ? "animate" : "css"](b, d.animate); (f == "min") && (this.orientation == "horizontal") && this.range.stop(1, 1)[c ? "animate" : "css"]({ width: e + "%" }, d.animate); (f == "max") && (this.orientation == "horizontal") && this.range[c ? "animate" : "css"]({ width: (100 - e) + "%" }, { queue: false, duration: d.animate }); (f == "min") && (this.orientation == "vertical") && this.range.stop(1, 1)[c ? "animate" : "css"]({ height: e + "%" }, d.animate); (f == "max") && (this.orientation == "vertical") && this.range[c ? "animate" : "css"]({ height: (100 - e) + "%" }, { queue: false, duration: d.animate }) } } })); a.extend(a.ui.slider, { getter: "value values", version: "1.7.3", eventPrefix: "slide", defaults: { animate: false, delay: 0, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null} }) })(jQuery); ; /*
 * jQuery UI Effects 1.7.3
 *
 * 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/Effects/
 */
jQuery.effects || (function(d) { d.effects = { version: "1.7.3", save: function(g, h) { for (var f = 0; f < h.length; f++) { if (h[f] !== null) { g.data("ec.storage." + h[f], g[0].style[h[f]]) } } }, restore: function(g, h) { for (var f = 0; f < h.length; f++) { if (h[f] !== null) { g.css(h[f], g.data("ec.storage." + h[f])) } } }, setMode: function(f, g) { if (g == "toggle") { g = f.is(":hidden") ? "show" : "hide" } return g }, getBaseline: function(g, h) { var i, f; switch (g[0]) { case "top": i = 0; break; case "middle": i = 0.5; break; case "bottom": i = 1; break; default: i = g[0] / h.height } switch (g[1]) { case "left": f = 0; break; case "center": f = 0.5; break; case "right": f = 1; break; default: f = g[1] / h.width } return { x: f, y: i} }, createWrapper: function(f) { if (f.parent().is(".ui-effects-wrapper")) { return f.parent() } var g = { width: f.outerWidth(true), height: f.outerHeight(true), "float": f.css("float") }; f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>'); var j = f.parent(); if (f.css("position") == "static") { j.css({ position: "relative" }); f.css({ position: "relative" }) } else { var i = f.css("top"); if (isNaN(parseInt(i, 10))) { i = "auto" } var h = f.css("left"); if (isNaN(parseInt(h, 10))) { h = "auto" } j.css({ position: f.css("position"), top: i, left: h, zIndex: f.css("z-index") }).show(); f.css({ position: "relative", top: 0, left: 0 }) } j.css(g); return j }, removeWrapper: function(f) { if (f.parent().is(".ui-effects-wrapper")) { return f.parent().replaceWith(f) } return f }, setTransition: function(g, i, f, h) { h = h || {}; d.each(i, function(k, j) { unit = g.cssUnit(j); if (unit[0] > 0) { h[j] = unit[0] * f + unit[1] } }); return h }, animateClass: function(h, i, k, j) { var f = (typeof k == "function" ? k : (j ? j : null)); var g = (typeof k == "string" ? k : null); return this.each(function() { var q = {}; var o = d(this); var p = o.attr("style") || ""; if (typeof p == "object") { p = p.cssText } if (h.toggle) { o.hasClass(h.toggle) ? h.remove = h.toggle : h.add = h.toggle } var l = d.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle)); if (h.add) { o.addClass(h.add) } if (h.remove) { o.removeClass(h.remove) } var m = d.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle)); if (h.add) { o.removeClass(h.add) } if (h.remove) { o.addClass(h.remove) } for (var r in m) { if (typeof m[r] != "function" && m[r] && r.indexOf("Moz") == -1 && r.indexOf("length") == -1 && m[r] != l[r] && (r.match(/color/i) || (!r.match(/color/i) && !isNaN(parseInt(m[r], 10)))) && (l.position != "static" || (l.position == "static" && !r.match(/left|top|bottom|right/)))) { q[r] = m[r] } } o.animate(q, i, g, function() { if (typeof d(this).attr("style") == "object") { d(this).attr("style")["cssText"] = ""; d(this).attr("style")["cssText"] = p } else { d(this).attr("style", p) } if (h.add) { d(this).addClass(h.add) } if (h.remove) { d(this).removeClass(h.remove) } if (f) { f.apply(this, arguments) } }) }) } }; function c(g, f) { var i = g[1] && g[1].constructor == Object ? g[1] : {}; if (f) { i.mode = f } var h = g[1] && g[1].constructor != Object ? g[1] : (i.duration ? i.duration : g[2]); h = d.fx.off ? 0 : typeof h === "number" ? h : d.fx.speeds[h] || d.fx.speeds._default; var j = i.callback || (d.isFunction(g[1]) && g[1]) || (d.isFunction(g[2]) && g[2]) || (d.isFunction(g[3]) && g[3]); return [g[0], i, h, j] } d.fn.extend({ _show: d.fn.show, _hide: d.fn.hide, __toggle: d.fn.toggle, _addClass: d.fn.addClass, _removeClass: d.fn.removeClass, _toggleClass: d.fn.toggleClass, effect: function(g, f, h, i) { return d.effects[g] ? d.effects[g].call(this, { method: g, options: f || {}, duration: h, callback: i }) : null }, show: function() { if (!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) { return this._show.apply(this, arguments) } else { return this.effect.apply(this, c(arguments, "show")) } }, hide: function() { if (!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) { return this._hide.apply(this, arguments) } else { return this.effect.apply(this, c(arguments, "hide")) } }, toggle: function() { if (!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (d.isFunction(arguments[0]) || typeof arguments[0] == "boolean")) { return this.__toggle.apply(this, arguments) } else { return this.effect.apply(this, c(arguments, "toggle")) } }, addClass: function(g, f, i, h) { return f ? d.effects.animateClass.apply(this, [{ add: g }, f, i, h]) : this._addClass(g) }, removeClass: function(g, f, i, h) { return f ? d.effects.animateClass.apply(this, [{ remove: g }, f, i, h]) : this._removeClass(g) }, toggleClass: function(g, f, i, h) { return ((typeof f !== "boolean") && f) ? d.effects.animateClass.apply(this, [{ toggle: g }, f, i, h]) : this._toggleClass(g, f) }, morph: function(f, h, g, j, i) { return d.effects.animateClass.apply(this, [{ add: h, remove: f }, g, j, i]) }, switchClass: function() { return this.morph.apply(this, arguments) }, cssUnit: function(f) { var g = this.css(f), h = []; d.each(["em", "px", "%", "pt"], function(j, k) { if (g.indexOf(k) > 0) { h = [parseFloat(g), k] } }); return h } }); d.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function(g, f) { d.fx.step[f] = function(h) { if (h.state == 0) { h.start = e(h.elem, f); h.end = b(h.end) } h.elem.style[f] = "rgb(" + [Math.max(Math.min(parseInt((h.pos * (h.end[0] - h.start[0])) + h.start[0], 10), 255), 0), Math.max(Math.min(parseInt((h.pos * (h.end[1] - h.start[1])) + h.start[1], 10), 255), 0), Math.max(Math.min(parseInt((h.pos * (h.end[2] - h.start[2])) + h.start[2], 10), 255), 0)].join(",") + ")" } }); function b(g) { var f; if (g && g.constructor == Array && g.length == 3) { return g } if (f = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)) { return [parseInt(f[1], 10), parseInt(f[2], 10), parseInt(f[3], 10)] } if (f = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)) { return [parseFloat(f[1]) * 2.55, parseFloat(f[2]) * 2.55, parseFloat(f[3]) * 2.55] } if (f = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)) { return [parseInt(f[1], 16), parseInt(f[2], 16), parseInt(f[3], 16)] } if (f = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)) { return [parseInt(f[1] + f[1], 16), parseInt(f[2] + f[2], 16), parseInt(f[3] + f[3], 16)] } if (f = /rgba\(0, 0, 0, 0\)/.exec(g)) { return a.transparent } return a[d.trim(g).toLowerCase()] } function e(h, f) { var g; do { g = d.curCSS(h, f); if (g != "" && g != "transparent" || d.nodeName(h, "body")) { break } f = "backgroundColor" } while (h = h.parentNode); return b(g) } var a = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0], transparent: [255, 255, 255] }; d.easing.jswing = d.easing.swing; d.extend(d.easing, { def: "easeOutQuad", swing: function(g, h, f, j, i) { return d.easing[d.easing.def](g, h, f, j, i) }, easeInQuad: function(g, h, f, j, i) { return j * (h /= i) * h + f }, easeOutQuad: function(g, h, f, j, i) { return -j * (h /= i) * (h - 2) + f }, easeInOutQuad: function(g, h, f, j, i) { if ((h /= i / 2) < 1) { return j / 2 * h * h + f } return -j / 2 * ((--h) * (h - 2) - 1) + f }, easeInCubic: function(g, h, f, j, i) { return j * (h /= i) * h * h + f }, easeOutCubic: function(g, h, f, j, i) { return j * ((h = h / i - 1) * h * h + 1) + f }, easeInOutCubic: function(g, h, f, j, i) { if ((h /= i / 2) < 1) { return j / 2 * h * h * h + f } return j / 2 * ((h -= 2) * h * h + 2) + f }, easeInQuart: function(g, h, f, j, i) { return j * (h /= i) * h * h * h + f }, easeOutQuart: function(g, h, f, j, i) { return -j * ((h = h / i - 1) * h * h * h - 1) + f }, easeInOutQuart: function(g, h, f, j, i) { if ((h /= i / 2) < 1) { return j / 2 * h * h * h * h + f } return -j / 2 * ((h -= 2) * h * h * h - 2) + f }, easeInQuint: function(g, h, f, j, i) { return j * (h /= i) * h * h * h * h + f }, easeOutQuint: function(g, h, f, j, i) { return j * ((h = h / i - 1) * h * h * h * h + 1) + f }, easeInOutQuint: function(g, h, f, j, i) { if ((h /= i / 2) < 1) { return j / 2 * h * h * h * h * h + f } return j / 2 * ((h -= 2) * h * h * h * h + 2) + f }, easeInSine: function(g, h, f, j, i) { return -j * Math.cos(h / i * (Math.PI / 2)) + j + f }, easeOutSine: function(g, h, f, j, i) { return j * Math.sin(h / i * (Math.PI / 2)) + f }, easeInOutSine: function(g, h, f, j, i) { return -j / 2 * (Math.cos(Math.PI * h / i) - 1) + f }, easeInExpo: function(g, h, f, j, i) { return (h == 0) ? f : j * Math.pow(2, 10 * (h / i - 1)) + f }, easeOutExpo: function(g, h, f, j, i) { return (h == i) ? f + j : j * (-Math.pow(2, -10 * h / i) + 1) + f }, easeInOutExpo: function(g, h, f, j, i) { if (h == 0) { return f } if (h == i) { return f + j } if ((h /= i / 2) < 1) { return j / 2 * Math.pow(2, 10 * (h - 1)) + f } return j / 2 * (-Math.pow(2, -10 * --h) + 2) + f }, easeInCirc: function(g, h, f, j, i) { return -j * (Math.sqrt(1 - (h /= i) * h) - 1) + f }, easeOutCirc: function(g, h, f, j, i) { return j * Math.sqrt(1 - (h = h / i - 1) * h) + f }, easeInOutCirc: function(g, h, f, j, i) { if ((h /= i / 2) < 1) { return -j / 2 * (Math.sqrt(1 - h * h) - 1) + f } return j / 2 * (Math.sqrt(1 - (h -= 2) * h) + 1) + f }, easeInElastic: function(g, i, f, m, l) { var j = 1.70158; var k = 0; var h = m; if (i == 0) { return f } if ((i /= l) == 1) { return f + m } if (!k) { k = l * 0.3 } if (h < Math.abs(m)) { h = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / h) } return -(h * Math.pow(2, 10 * (i -= 1)) * Math.sin((i * l - j) * (2 * Math.PI) / k)) + f }, easeOutElastic: function(g, i, f, m, l) { var j = 1.70158; var k = 0; var h = m; if (i == 0) { return f } if ((i /= l) == 1) { return f + m } if (!k) { k = l * 0.3 } if (h < Math.abs(m)) { h = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / h) } return h * Math.pow(2, -10 * i) * Math.sin((i * l - j) * (2 * Math.PI) / k) + m + f }, easeInOutElastic: function(g, i, f, m, l) { var j = 1.70158; var k = 0; var h = m; if (i == 0) { return f } if ((i /= l / 2) == 2) { return f + m } if (!k) { k = l * (0.3 * 1.5) } if (h < Math.abs(m)) { h = m; var j = k / 4 } else { var j = k / (2 * Math.PI) * Math.asin(m / h) } if (i < 1) { return -0.5 * (h * Math.pow(2, 10 * (i -= 1)) * Math.sin((i * l - j) * (2 * Math.PI) / k)) + f } return h * Math.pow(2, -10 * (i -= 1)) * Math.sin((i * l - j) * (2 * Math.PI) / k) * 0.5 + m + f }, easeInBack: function(g, h, f, k, j, i) { if (i == undefined) { i = 1.70158 } return k * (h /= j) * h * ((i + 1) * h - i) + f }, easeOutBack: function(g, h, f, k, j, i) { if (i == undefined) { i = 1.70158 } return k * ((h = h / j - 1) * h * ((i + 1) * h + i) + 1) + f }, easeInOutBack: function(g, h, f, k, j, i) { if (i == undefined) { i = 1.70158 } if ((h /= j / 2) < 1) { return k / 2 * (h * h * (((i *= (1.525)) + 1) * h - i)) + f } return k / 2 * ((h -= 2) * h * (((i *= (1.525)) + 1) * h + i) + 2) + f }, easeInBounce: function(g, h, f, j, i) { return j - d.easing.easeOutBounce(g, i - h, 0, j, i) + f }, easeOutBounce: function(g, h, f, j, i) { if ((h /= i) < (1 / 2.75)) { return j * (7.5625 * h * h) + f } else { if (h < (2 / 2.75)) { return j * (7.5625 * (h -= (1.5 / 2.75)) * h + 0.75) + f } else { if (h < (2.5 / 2.75)) { return j * (7.5625 * (h -= (2.25 / 2.75)) * h + 0.9375) + f } else { return j * (7.5625 * (h -= (2.625 / 2.75)) * h + 0.984375) + f } } } }, easeInOutBounce: function(g, h, f, j, i) { if (h < i / 2) { return d.easing.easeInBounce(g, h * 2, 0, j, i) * 0.5 + f } return d.easing.easeOutBounce(g, h * 2 - i, 0, j, i) * 0.5 + j * 0.5 + f } }) })(jQuery); ; /*
 * jQuery UI Effects Slide 1.7.3
 *
 * 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/Effects/Slide
 *
 * Depends:
 *	effects.core.js
 */
(function(a) { a.effects.slide = function(b) { return this.queue(function() { var e = a(this), d = ["position", "top", "left"]; var i = a.effects.setMode(e, b.options.mode || "show"); var h = b.options.direction || "left"; a.effects.save(e, d); e.show(); a.effects.createWrapper(e).css({ overflow: "hidden" }); var f = (h == "up" || h == "down") ? "top" : "left"; var c = (h == "up" || h == "left") ? "pos" : "neg"; var j = b.options.distance || (f == "top" ? e.outerHeight({ margin: true }) : e.outerWidth({ margin: true })); if (i == "show") { e.css(f, c == "pos" ? -j : j) } var g = {}; g[f] = (i == "show" ? (c == "pos" ? "+=" : "-=") : (c == "pos" ? "-=" : "+=")) + j; e.animate(g, { queue: false, duration: b.duration, easing: b.options.easing, complete: function() { if (i == "hide") { e.hide() } a.effects.restore(e, d); a.effects.removeWrapper(e); if (b.callback) { b.callback.apply(this, arguments) } e.dequeue() } }) }) } })(jQuery); ;var s=s_gi(sitecatalyst_account_id);function ClearOmnitureCodes(){s.events="";s.eVar1="";s.eVar2="";s.eVar3="";s.eVar4="";s.eVar6="";s.eVar7="";s.eVar8="";s.eVar9="";s.eVar10="";s.eVar11="";s.eVar12="";s.eVar13="";s.eVar15="";s.eVar17="";s.eVar18="";s.eVar19="";s.eVar20="";s.eVar21="";s.eVar22="";s.eVar23="";s.eVar24="";s.eVar25="";s.eVar26="";s.eVar27="";s.eVar28="";s.eVar29="";s.eVar30="";s.eVar31="";s.eVar32="";s.eVar33="";s.eVar35="";s.eVar36="";s.eVar37="";s.eVar38="";s.eVar39="";s.eVar43="";s.eVar45="";s.eVar46="";s.prop1="";s.prop2="";s.prop3="";s.prop4="";s.prop6="";s.prop7="";s.prop8="";s.prop9="";s.prop10="";s.prop11="";s.prop12="";s.prop13="";s.prop14="";s.prop15="";s.prop17="";s.prop18="";s.prop19="";s.prop20="";s.prop21="";s.prop22="";s.prop23="";s.prop24="";s.prop25="";s.prop26="";s.prop27="";s.prop28="";s.prop29="";s.prop30="";s.prop31="";s.prop32="";s.prop33="";s.prop35="";s.prop36="";s.prop37="";s.prop38="";s.prop39="";s.prop43="";s.prop45="";s.prop46="";s.heir1="";s.channel="";s.products="";s.server="";s.pageType=""}s.charSet="ISO-8859-1";s.currencyCode="USD";s.trackDownloadLinks=true;s.trackExternalLinks=true;s.trackInlineStats=true;s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx";s.linkInternalFilters="javascript:,viewer.inviewtours.com,apartmentfinder.com,apartmentsinview.com,devaf.com,testaf.com,stageaf.com,aptbook-colo.com,local-aptbook-colo.com,dev-aptbook-colo.com,test-aptbook-colo.com,stage-aptbook-colo.com";s.linkLeaveQueryString=false;s.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34";s.linkTrackEvents="None";s.usePlugins=true;function MagazineRequests(c,a){var b=s_gi(sitecatalyst_account_id);b.templtv=b.linkTrackVars;b.templte=b.linkTrackEvents;b.linkTrackVars="eVar7,events";b.linkTrackEvents="event5";b.eVar7=a;b.events="event5";b.tl(c,"o","Magazine Requets");if(b.templtv){b.linkTrackVars=b.templtv}if(b.templte){b.linkTrackEvents=b.templte}}function s_doPlugins(c){if(!c.pageName&&!c.pageType){c.pageName=c.getPageName()}if(!c.campaign){c.campaign=c.getQueryParam("ecid,SP_MID");if(document.URL.indexOf("ecid")>-1){var d=c.campaign.split("|");for(var b=0;b<d.length;b++){var a=c.getAndPersistValue(d[0],"cmp_channel",0);var e=c.getAndPersistValue(d[1],"cmp_category",0)}}else{if((document.URL.indexOf("SP_MID")>-1)||(document.URL.indexOf("sp_mid")>-1)){var a=c.getAndPersistValue("EM","cmp_channel",0);var e=c.getAndPersistValue("CM","cmp_category",0)}}}c.campaign=c.getValOnce(c.campaign,"s_campaign",0);c.eVar37=c.getQueryParam("SP_RID");c.prop12=c.setCustomPath(c.campaign,"s_campaign","ExtCmp=",c.pageName);if(c.c_r("cmp_channel")){c.prop41="Ch="+c.c_r("cmp_channel")+":"+c.pageName}if(c.c_r("cmp_category")){c.prop42="Cat="+c.c_r("cmp_category")+":"+c.pageName}if(c.prop39&&c.pageName){c.prop40=c.prop39+":"+c.pageName}c.eVar13=c.getDaysSinceLastVisit();if(c.prop32&&!c.eVar32){c.eVar32=c.prop32}if(c.pageName&&!c.eVar10){c.eVar10=c.pageName}if(c.prop18){c.prop18=c.prop18.toLowerCase()}if(c.prop18){c.eVar18=c.prop18}if(c.prop19){c.prop19=c.prop19.toLowerCase()}if(c.prop19){c.eVar19=c.prop19}if(c.prop20){c.prop20=c.prop20.toLowerCase()}if(c.prop20){c.eVar20=c.prop20}if(c.prop21){c.prop21=c.prop21.toLowerCase()}if(c.prop21){c.eVar21=c.prop21}if(c.prop22){c.prop22=c.prop22.toLowerCase()}if(c.prop22){c.eVar22=c.prop22}if(c.prop23){c.prop23=c.prop23.toLowerCase()}if(c.prop23){c.eVar23=c.prop23}if(c.prop24){c.prop24=c.prop24.toLowerCase()}if(c.prop24){c.eVar24=c.prop24}if(c.prop25){c.prop25=c.prop25.toLowerCase()}if(c.prop25){c.eVar25=c.prop25}if(c.prop27){c.prop27=c.prop27.toLowerCase()}if(c.prop27){c.eVar27=c.prop27}if(c.prop28){c.prop28=c.prop28.toLowerCase()}if(c.prop28){c.eVar28=c.prop28}if(c.prop29){c.prop29=c.prop29.toLowerCase()}if(c.prop29){c.eVar29=c.prop29}if(c.prop30){c.prop30=c.prop30.toLowerCase()}if(c.prop30){c.eVar30=c.prop30}if(c.prop31){c.prop31=c.prop31.toLowerCase()}if(c.prop31){c.eVar31=c.prop31}if(c.prop35){c.prop35=c.prop35.toLowerCase()}if(c.prop35){c.eVar35=c.prop35}if(c.prop33){c.prop33=c.prop33.toLowerCase()}}if(s.prop5){s.prop5=s.prop5.toLowerCase()}if(s.prop16){s.prop16=s.prop16.toLowerCase()}if(s.prop5){s.eVar5=s.prop5}if(s.prop16){s.eVar16=s.prop16}s.doPlugins=s_doPlugins;s.visitorNamespace="networkcommunications2";s.trackingServer="metrics.apartmentfinder.com";s.dc=112;s.setCustomPath=new Function("v","c","p","pt","var s=this,pt=pt?pt:'no value sent',k=s.c_r(c);if(v){return p+v+':'+pt} else return k?pt:'';");s.apl=new Function("L","v","d","u","var s=this,m=0;if(!L)L='';if(u){var i,n,a=s.split(L,d);for(i=0;i<a.length;i++){n=a[i];m=m||(u==1?(n==v):(n.toLowerCase()==v.toLowerCase()));}}if(!m)L=L?L+d+v:v;return L");s.getAndPersistValue=new Function("v","c","e","var s=this,a=new Date;e=e?e:0;a.setTime(a.getTime()+e*86400000);if(v)s.c_w(c,v,e?a:0);return s.c_r(c);");s.getDaysSinceLastVisit=new Function("c","var s=this,e=new Date(),es=new Date(),cval,cval_s,cval_ss,ct=e.getTime(),day=24*60*60*1000,f1,f2,f3,f4,f5;e.setTime(ct+3*365*day);es.setTime(ct+30*60*1000);f0='Cookies Not Supported';f1='First Visit';f2='More than 30 days';f3='More than 7 days';f4='Less than 7 days';f5='Less than 1 day';cval=s.c_r(c);if(cval.length==0){s.c_w(c,ct,e);s.c_w(c+'_s',f1,es);}else{var d=ct-cval;if(d>30*60*1000){if(d>30*day){s.c_w(c,ct,e);s.c_w(c+'_s',f2,es);}else if(d<30*day+1 && d>7*day){s.c_w(c,ct,e);s.c_w(c+'_s',f3,es);}else if(d<7*day+1 && d>day){s.c_w(c,ct,e);s.c_w(c+'_s',f4,es);}else if(d<day+1){s.c_w(c,ct,e);s.c_w(c+'_s',f5,es);}}else{s.c_w(c,ct,e);cval_ss=s.c_r(c+'_s');s.c_w(c+'_s',cval_ss,es);}}cval_s=s.c_r(c+'_s');if(cval_s.length==0) return f0;else if(cval_s!=f1&&cval_s!=f2&&cval_s!=f3&&cval_s!=f4&&cval_s!=f5) return '';else return cval_s;");s.split=new Function("l","d","var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x++]=l.substring(0,i);l=l.substring(i+d.length);}return a");s.getValOnce=new Function("v","c","e","var s=this,k=s.c_r(c),a=new Date;e=e?e:0;if(v){a.setTime(a.getTime()+e*86400000);s.c_w(c,v,e?a:0);}return v==k?'':v");s.getQueryParam=new Function("p","d","u","var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.location);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p.length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i==p.length?i:i+1)}return v");s.p_gpv=new Function("k","u","var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v=s.pt(q,'&','p_gvf',k)}return v");s.p_gvf=new Function("t","k","if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'True':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s.epa(v)}return ''");s.getDaysSinceLastVisit=new Function("var s=this,e=new Date(),cval,ct=e.getTime(),c='s_lastvisit',day=24*60*60*1000;e.setTime(ct+3*365*day);cval=s.c_r(c);if(!cval){s.c_w(c,ct,e);return 'First page view or cookies not supported';}else{var d=ct-cval;if(d>30*60*1000){if(d>30*day){s.c_w(c,ct,e);return 'More than 30 days';}if(d<30*day+1 && d>7*day){s.c_w(c,ct,e);return 'More than 7 days';}if(d<7*day+1 && d>day){s.c_w(c,ct,e);return 'Less than 7 days';}if(d<day+1){s.c_w(c,ct,e);return 'Less than 1 day';}}else return '';}");s.getPageName=new Function("u","var s=this,v=u?u:''+s.wd.location,x=v.indexOf(':'),y=v.indexOf('/',x+4),z=v.indexOf('?'),c=s.pathConcatDelim,e=s.pathExcludeDelim,g=s.queryVarsList,d=s.siteID,n=d?d:'',q=z<0?'':v.substring(z+1),p=v.substring(y+1,q?z:v.length);z=p.indexOf('#');p=z<0?p:s.fl(p,z);x=e?p.indexOf(e):-1;p=x<0?p:s.fl(p,x);p+=!p||p.charAt(p.length-1)=='/'?s.defaultPage:'';y=c?c:'/';while(p){x=p.indexOf('/');x=x<0?p.length:x;z=s.fl(p,x);if(!s.pt(s.pathExcludeList,',','p_c',z))n+=n?y+z:z;p=p.substring(x+1)}y=c?c:'?';while(g){x=g.indexOf(',');x=x<0?g.length:x;z=s.fl(g,x);z=s.pt(q,'&','p_c',z);if(z){n+=n?y+z:z;y=c?c:'&'}g=g.substring(x+1)}return n");s.c_rr=s.c_r;s.c_r=new Function("k","var s=this,d=new Date,v=s.c_rr(k),c=s.c_rr('s_pers'),i,m,e;if(v)return v;k=s.ape(k);i=c.indexOf(' '+k+'=');c=i<0?s.c_rr('s_sess'):c;i=c.indexOf(' '+k+'=');m=i<0?i:c.indexOf('|',i);e=i<0?i:c.indexOf(';',i);m=m>0?m:e;v=i<0?'':s.epa(c.substring(i+2+k.length,m<0?c.length:m));if(m>0&&m!=e)if(parseInt(c.substring(m+1,e<0?c.length:e))<d.getTime()){d.setTime(d.getTime()-60000);s.c_w(s.epa(k),'',d);v='';}return v;");s.c_wr=s.c_w;s.c_w=new Function("k","v","e","var s=this,d=new Date,ht=0,pn='s_pers',sn='s_sess',pc=0,sc=0,pv,sv,c,i,t;d.setTime(d.getTime()-60000);if(s.c_rr(k)) s.c_wr(k,'',d);k=s.ape(k);pv=s.c_rr(pn);i=pv.indexOf(' '+k+'=');if(i>-1){pv=pv.substring(0,i)+pv.substring(pv.indexOf(';',i)+1);pc=1;}sv=s.c_rr(sn);i=sv.indexOf(' '+k+'=');if(i>-1){sv=sv.substring(0,i)+sv.substring(sv.indexOf(';',i)+1);sc=1;}d=new Date;if(e){if(e.getTime()>d.getTime()){pv+=' '+k+'='+s.ape(v)+'|'+e.getTime()+';';pc=1;}}else{sv+=' '+k+'='+s.ape(v)+';';sc=1;}if(sc) s.c_wr(sn,sv,0);if(pc){t=pv;while(t&&t.indexOf(';')!=-1){var t1=parseInt(t.substring(t.indexOf('|')+1,t.indexOf(';')));t=t.substring(t.indexOf(';')+1);ht=ht<t1?t1:ht;}d.setTime(ht);s.c_wr(pn,pv,d);}return v==s.c_r(s.epa(k));");s.p_c=new Function("v","c","var x=v.indexOf('=');return c.toLowerCase()==v.substring(0,x<0?v.length:x).toLowerCase()?v:0");var s_code="",s_objectID;function s_gi(h,j,y){var o="s._c='s_c';s.wd=window;if(!s.wd.s_c_in){s.wd.s_c_il=new Array;s.wd.s_c_in=0;}s._il=s.wd.s_c_il;s._in=s.wd.s_c_in;s._il[s._in]=s;s.wd.s_c_in++;s.an=s_an;s.cls=function(x,c){var i,y='';if(!c)c=this.an;for(i=0;i<x.length;i++){n=x.substring(i,i+1);if(c.indexOf(n)>=0)y+=n}return y};s.fl=function(x,l){return x?(''+x).substring(0,l):x};s.co=function(o){if(!o)return o;var n=new Object,x;for(x in o)if(x.indexOf('select')<0&&x.indexOf('filter')<0)n[x]=o[x];return n};s.num=function(x){x=''+x;for(var p=0;p<x.length;p++)if(('0123456789').indexOf(x.substring(p,p+1))<0)return 0;return 1};s.rep=s_rep;s.sp=s_sp;s.jn=s_jn;s.ape=function(x){var s=this,h='0123456789ABCDEF',i,c=s.charSet,n,l,e,y='';c=c?c.toUpperCase():'';if(x){x=''+x;if(s.em==3)return encodeURIComponent(x);else if(c=='AUTO'&&('').charCodeAt){for(i=0;i<x.length;i++){c=x.substring(i,i+1);n=x.charCodeAt(i);if(n>127){l=0;e='';while(n||l<4){e=h.substring(n%16,n%16+1)+e;n=(n-n%16)/16;l++}y+='%u'+e}else if(c=='+')y+='%2B';else y+=escape(c)}return y}else{x=s.rep(escape(''+x),'+','%2B');if(c&&s.em==1&&x.indexOf('%u')<0&&x.indexOf('%U')<0){i=x.indexOf('%');while(i>=0){i++;if(h.substring(8).indexOf(x.substring(i,i+1).toUpperCase())>=0)return x.substring(0,i)+'u00'+x.substring(i);i=x.indexOf('%',i)}}}}return x};s.epa=function(x){var s=this;if(x){x=''+x;return s.em==3?decodeURIComponent(x):unescape(s.rep(x,'+',' '))}return x};s.pt=function(x,d,f,a){var s=this,t=x,z=0,y,r;while(t){y=t.indexOf(d);y=y<0?t.length:y;t=t.substring(0,y);r=s[f](t,a);if(r)return r;z+=y+d.length;t=x.substring(z,x.length);t=z<x.length?t:''}return ''};s.isf=function(t,a){var c=a.indexOf(':');if(c>=0)a=a.substring(0,c);if(t.substring(0,2)=='s_')t=t.substring(2);return (t!=''&&t==a)};s.fsf=function(t,a){var s=this;if(s.pt(a,',','isf',t))s.fsg+=(s.fsg!=''?',':'')+t;return 0};s.fs=function(x,f){var s=this;s.fsg='';s.pt(x,',','fsf',f);return s.fsg};s.si=function(){var s=this,i,k,v,c=s_gi+'var s=s_gi(\"'+s.oun+'\");s.sa(\"'+s.un+'\");';for(i=0;i<s.va_g.length;i++){k=s.va_g[i];v=s[k];if(v!=undefined){if(typeof(v)=='string')c+='s.'+k+'=\"'+s_fe(v)+'\";';else c+='s.'+k+'='+v+';'}}c+=\"s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3='';\";return c};s.c_d='';s.c_gdf=function(t,a){var s=this;if(!s.num(t))return 1;return 0};s.c_gd=function(){var s=this,d=s.wd.location.hostname,n=s.fpCookieDomainPeriods,p;if(!n)n=s.cookieDomainPeriods;if(d&&!s.c_d){n=n?parseInt(n):2;n=n>2?n:2;p=d.lastIndexOf('.');if(p>=0){while(p>=0&&n>1){p=d.lastIndexOf('.',p-1);n--}s.c_d=p>0&&s.pt(d,'.','c_gdf',0)?d.substring(p):d}}return s.c_d};s.c_r=function(k){var s=this;k=s.ape(k);var c=' '+s.d.cookie,i=c.indexOf(' '+k+'='),e=i<0?i:c.indexOf(';',i),v=i<0?'':s.epa(c.substring(i+2+k.length,e<0?c.length:e));return v!='[[B]]'?v:''};s.c_w=function(k,v,e){var s=this,d=s.c_gd(),l=s.cookieLifetime,t;v=''+v;l=l?(''+l).toUpperCase():'';if(e&&l!='SESSION'&&l!='NONE'){t=(v!=''?parseInt(l?l:0):-60);if(t){e=new Date;e.setTime(e.getTime()+(t*1000))}}if(k&&l!='NONE'){s.d.cookie=k+'='+s.ape(v!=''?v:'[[B]]')+'; path=/;'+(e&&l!='SESSION'?' expires='+e.toGMTString()+';':'')+(d?' domain='+d+';':'');return s.c_r(k)==v}return 0};s.eh=function(o,e,r,f){var s=this,b='s_'+e+'_'+s._in,n=-1,l,i,x;if(!s.ehl)s.ehl=new Array;l=s.ehl;for(i=0;i<l.length&&n<0;i++){if(l[i].o==o&&l[i].e==e)n=i}if(n<0){n=i;l[n]=new Object}x=l[n];x.o=o;x.e=e;f=r?x.b:f;if(r||f){x.b=r?0:o[e];x.o[e]=f}if(x.b){x.o[b]=x.b;return b}return 0};s.cet=function(f,a,t,o,b){var s=this,r,tcf;if(s.apv>=5&&(!s.isopera||s.apv>=7)){tcf=new Function('s','f','a','t','var e,r;try{r=s[f](a)}catch(e){r=s[t](e)}return r');r=tcf(s,f,a,t)}else{if(s.ismac&&s.u.indexOf('MSIE 4')>=0)r=s[b](a);else{s.eh(s.wd,'onerror',0,o);r=s[f](a);s.eh(s.wd,'onerror',1)}}return r};s.gtfset=function(e){var s=this;return s.tfs};s.gtfsoe=new Function('e','var s=s_c_il['+s._in+'],c;s.eh(window,\"onerror\",1);s.etfs=1;c=s.t();if(c)s.d.write(c);s.etfs=0;return true');s.gtfsfb=function(a){return window};s.gtfsf=function(w){var s=this,p=w.parent,l=w.location;s.tfs=w;if(p&&p.location!=l&&p.location.host==l.host){s.tfs=p;return s.gtfsf(s.tfs)}return s.tfs};s.gtfs=function(){var s=this;if(!s.tfs){s.tfs=s.wd;if(!s.etfs)s.tfs=s.cet('gtfsf',s.tfs,'gtfset',s.gtfsoe,'gtfsfb')}return s.tfs};s.mrq=function(u){var s=this,l=s.rl[u],n,r;s.rl[u]=0;if(l)for(n=0;n<l.length;n++){r=l[n];s.mr(0,0,r.r,0,r.t,r.u)}};s.br=function(id,rs){var s=this;if(s.disableBufferedRequests||!s.c_w('s_br',rs))s.brl=rs};s.flushBufferedRequests=function(){this.fbr(0)};s.fbr=function(id){var s=this,br=s.c_r('s_br');if(!br)br=s.brl;if(br){if(!s.disableBufferedRequests)s.c_w('s_br','');s.mr(0,0,br)}s.brl=0};s.mr=function(sess,q,rs,id,ta,u){var s=this,dc=s.dc,t1=s.trackingServer,t2=s.trackingServerSecure,tb=s.trackingServerBase,p='.sc',ns=s.visitorNamespace,un=s.cls(u?u:(ns?ns:s.fun)),r=new Object,l,imn='s_i_'+(un),im,b,e;if(!rs){if(t1){if(t2&&s.ssl)t1=t2}else{if(!tb)tb='2o7.net';if(dc)dc=(''+dc).toLowerCase();else dc='d1';if(tb=='2o7.net'){if(dc=='d1')dc='112';else if(dc=='d2')dc='122';p=''}t1=un+'.'+dc+'.'+p+tb}rs='http'+(s.ssl?'s':'')+'://'+t1+'/b/ss/'+s.un+'/'+(s.mobile?'5.1':'1')+'/H.21.1/'+sess+'?AQB=1&ndh=1'+(q?q:'')+'&AQE=1';if(s.isie&&!s.ismac){if(s.apv>5.5)rs=s.fl(rs,4095);else rs=s.fl(rs,2047)}if(id){s.br(id,rs);return}}if(s.d.images&&s.apv>=3&&(!s.isopera||s.apv>=7)&&(s.ns6<0||s.apv>=6.1)){if(!s.rc)s.rc=new Object;if(!s.rc[un]){s.rc[un]=1;if(!s.rl)s.rl=new Object;s.rl[un]=new Array;setTimeout('if(window.s_c_il)window.s_c_il['+s._in+'].mrq(\"'+un+'\")',750)}else{l=s.rl[un];if(l){r.t=ta;r.u=un;r.r=rs;l[l.length]=r;return ''}imn+='_'+s.rc[un];s.rc[un]++}im=s.wd[imn];if(!im)im=s.wd[imn]=new Image;im.s_l=0;im.onload=new Function('e','this.s_l=1;var wd=window,s;if(wd.s_c_il){s=wd.s_c_il['+s._in+'];s.mrq(\"'+un+'\");s.nrs--;if(!s.nrs)s.m_m(\"rr\")}');if(!s.nrs){s.nrs=1;s.m_m('rs')}else s.nrs++;im.src=rs;if(rs.indexOf('&pe=')>=0&&(!ta||ta=='_self'||ta=='_top'||(s.wd.name&&ta==s.wd.name))){b=e=new Date;while(!im.s_l&&e.getTime()-b.getTime()<500)e=new Date}return ''}return '<im'+'g sr'+'c=\"'+rs+'\" width=1 height=1 border=0 alt=\"\">'};s.gg=function(v){var s=this;if(!s.wd['s_'+v])s.wd['s_'+v]='';return s.wd['s_'+v]};s.glf=function(t,a){if(t.substring(0,2)=='s_')t=t.substring(2);var s=this,v=s.gg(t);if(v)s[t]=v};s.gl=function(v){var s=this;if(s.pg)s.pt(v,',','glf',0)};s.rf=function(x){var s=this,y,i,j,h,l,a,b='',c='',t;if(x){y=''+x;i=y.indexOf('?');if(i>0){a=y.substring(i+1);y=y.substring(0,i);h=y.toLowerCase();i=0;if(h.substring(0,7)=='http://')i+=7;else if(h.substring(0,8)=='https://')i+=8;h=h.substring(i);i=h.indexOf(\"/\");if(i>0){h=h.substring(0,i);if(h.indexOf('google')>=0){a=s.sp(a,'&');if(a.length>1){l=',q,ie,start,search_key,word,kw,cd,';for(j=0;j<a.length;j++){t=a[j];i=t.indexOf('=');if(i>0&&l.indexOf(','+t.substring(0,i)+',')>=0)b+=(b?'&':'')+t;else c+=(c?'&':'')+t}if(b&&c){y+='?'+b+'&'+c;if(''+x!=y)x=y}}}}}}return x};s.hav=function(){var s=this,qs='',fv=s.linkTrackVars,fe=s.linkTrackEvents,mn,i;if(s.pe){mn=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1);if(s[mn]){fv=s[mn].trackVars;fe=s[mn].trackEvents}}fv=fv?fv+','+s.vl_l+','+s.vl_l2:'';for(i=0;i<s.va_t.length;i++){var k=s.va_t[i],v=s[k],b=k.substring(0,4),x=k.substring(4),n=parseInt(x),q=k;if(v&&k!='linkName'&&k!='linkType'){if(s.pe||s.lnk||s.eo){if(fv&&(','+fv+',').indexOf(','+k+',')<0)v='';if(k=='events'&&fe)v=s.fs(v,fe)}if(v){if(k=='dynamicVariablePrefix')q='D';else if(k=='visitorID')q='vid';else if(k=='pageURL'){q='g';v=s.fl(v,255)}else if(k=='referrer'){q='r';v=s.fl(s.rf(v),255)}else if(k=='vmk'||k=='visitorMigrationKey')q='vmt';else if(k=='visitorMigrationServer'){q='vmf';if(s.ssl&&s.visitorMigrationServerSecure)v=''}else if(k=='visitorMigrationServerSecure'){q='vmf';if(!s.ssl&&s.visitorMigrationServer)v=''}else if(k=='charSet'){q='ce';if(v.toUpperCase()=='AUTO')v='ISO8859-1';else if(s.em==2||s.em==3)v='UTF-8'}else if(k=='visitorNamespace')q='ns';else if(k=='cookieDomainPeriods')q='cdp';else if(k=='cookieLifetime')q='cl';else if(k=='variableProvider')q='vvp';else if(k=='currencyCode')q='cc';else if(k=='channel')q='ch';else if(k=='transactionID')q='xact';else if(k=='campaign')q='v0';else if(k=='resolution')q='s';else if(k=='colorDepth')q='c';else if(k=='javascriptVersion')q='j';else if(k=='javaEnabled')q='v';else if(k=='cookiesEnabled')q='k';else if(k=='browserWidth')q='bw';else if(k=='browserHeight')q='bh';else if(k=='connectionType')q='ct';else if(k=='homepage')q='hp';else if(k=='plugins')q='p';else if(s.num(x)){if(b=='prop')q='c'+n;else if(b=='eVar')q='v'+n;else if(b=='list')q='l'+n;else if(b=='hier'){q='h'+n;v=s.fl(v,255)}}if(v)qs+='&'+q+'='+(k.substring(0,3)!='pev'?s.ape(v):v)}}}return qs};s.ltdf=function(t,h){t=t?t.toLowerCase():'';h=h?h.toLowerCase():'';var qi=h.indexOf('?');h=qi>=0?h.substring(0,qi):h;if(t&&h.substring(h.length-(t.length+1))=='.'+t)return 1;return 0};s.ltef=function(t,h){t=t?t.toLowerCase():'';h=h?h.toLowerCase():'';if(t&&h.indexOf(t)>=0)return 1;return 0};s.lt=function(h){var s=this,lft=s.linkDownloadFileTypes,lef=s.linkExternalFilters,lif=s.linkInternalFilters;lif=lif?lif:s.wd.location.hostname;h=h.toLowerCase();if(s.trackDownloadLinks&&lft&&s.pt(lft,',','ltdf',h))return 'd';if(s.trackExternalLinks&&h.substring(0,1)!='#'&&(lef||lif)&&(!lef||s.pt(lef,',','ltef',h))&&(!lif||!s.pt(lif,',','ltef',h)))return 'e';return ''};s.lc=new Function('e','var s=s_c_il['+s._in+'],b=s.eh(this,\"onclick\");s.lnk=s.co(this);s.t();s.lnk=0;if(b)return this[b](e);return true');s.bc=new Function('e','var s=s_c_il['+s._in+'],f,tcf;if(s.d&&s.d.all&&s.d.all.cppXYctnr)return;s.eo=e.srcElement?e.srcElement:e.target;tcf=new Function(\"s\",\"var e;try{if(s.eo&&(s.eo.tagName||s.eo.parentElement||s.eo.parentNode))s.t()}catch(e){}\");tcf(s);s.eo=0');s.oh=function(o){var s=this,l=s.wd.location,h=o.href?o.href:'',i,j,k,p;i=h.indexOf(':');j=h.indexOf('?');k=h.indexOf('/');if(h&&(i<0||(j>=0&&i>j)||(k>=0&&i>k))){p=o.protocol&&o.protocol.length>1?o.protocol:(l.protocol?l.protocol:'');i=l.pathname.lastIndexOf('/');h=(p?p+'//':'')+(o.host?o.host:(l.host?l.host:''))+(h.substring(0,1)!='/'?l.pathname.substring(0,i<0?0:i)+'/':'')+h}return h};s.ot=function(o){var t=o.tagName;t=t&&t.toUpperCase?t.toUpperCase():'';if(t=='SHAPE')t='';if(t){if((t=='INPUT'||t=='BUTTON')&&o.type&&o.type.toUpperCase)t=o.type.toUpperCase();else if(!t&&o.href)t='A';}return t};s.oid=function(o){var s=this,t=s.ot(o),p,c,n='',x=0;if(t&&!o.s_oid){p=o.protocol;c=o.onclick;if(o.href&&(t=='A'||t=='AREA')&&(!c||!p||p.toLowerCase().indexOf('javascript')<0))n=s.oh(o);else if(c){n=s.rep(s.rep(s.rep(s.rep(''+c,\"\\r\",''),\"\\n\",''),\"\\t\",''),' ','');x=2}else if(t=='INPUT'||t=='SUBMIT'){if(o.value)n=o.value;else if(o.innerText)n=o.innerText;else if(o.textContent)n=o.textContent;x=3}else if(o.src&&t=='IMAGE')n=o.src;if(n){o.s_oid=s.fl(n,100);o.s_oidt=x}}return o.s_oid};s.rqf=function(t,un){var s=this,e=t.indexOf('='),u=e>=0?t.substring(0,e):'',q=e>=0?s.epa(t.substring(e+1)):'';if(u&&q&&(','+u+',').indexOf(','+un+',')>=0){if(u!=s.un&&s.un.indexOf(',')>=0)q='&u='+u+q+'&u=0';return q}return ''};s.rq=function(un){if(!un)un=this.un;var s=this,c=un.indexOf(','),v=s.c_r('s_sq'),q='';if(c<0)return s.pt(v,'&','rqf',un);return s.pt(un,',','rq',0)};s.sqp=function(t,a){var s=this,e=t.indexOf('='),q=e<0?'':s.epa(t.substring(e+1));s.sqq[q]='';if(e>=0)s.pt(t.substring(0,e),',','sqs',q);return 0};s.sqs=function(un,q){var s=this;s.squ[un]=q;return 0};s.sq=function(q){var s=this,k='s_sq',v=s.c_r(k),x,c=0;s.sqq=new Object;s.squ=new Object;s.sqq[q]='';s.pt(v,'&','sqp',0);s.pt(s.un,',','sqs',q);v='';for(x in s.squ)if(x&&(!Object||!Object.prototype||!Object.prototype[x]))s.sqq[s.squ[x]]+=(s.sqq[s.squ[x]]?',':'')+x;for(x in s.sqq)if(x&&(!Object||!Object.prototype||!Object.prototype[x])&&s.sqq[x]&&(x==q||c<2)){v+=(v?'&':'')+s.sqq[x]+'='+s.ape(x);c++}return s.c_w(k,v,0)};s.wdl=new Function('e','var s=s_c_il['+s._in+'],r=true,b=s.eh(s.wd,\"onload\"),i,o,oc;if(b)r=this[b](e);for(i=0;i<s.d.links.length;i++){o=s.d.links[i];oc=o.onclick?\"\"+o.onclick:\"\";if((oc.indexOf(\"s_gs(\")<0||oc.indexOf(\".s_oc(\")>=0)&&oc.indexOf(\".tl(\")<0)s.eh(o,\"onclick\",0,s.lc);}return r');s.wds=function(){var s=this;if(s.apv>3&&(!s.isie||!s.ismac||s.apv>=5)){if(s.b&&s.b.attachEvent)s.b.attachEvent('onclick',s.bc);else if(s.b&&s.b.addEventListener)s.b.addEventListener('click',s.bc,false);else s.eh(s.wd,'onload',0,s.wdl)}};s.vs=function(x){var s=this,v=s.visitorSampling,g=s.visitorSamplingGroup,k='s_vsn_'+s.un+(g?'_'+g:''),n=s.c_r(k),e=new Date,y=e.getYear();e.setYear(y+10+(y<1900?1900:0));if(v){v*=100;if(!n){if(!s.c_w(k,x,e))return 0;n=x}if(n%10000>v)return 0}return 1};s.dyasmf=function(t,m){if(t&&m&&m.indexOf(t)>=0)return 1;return 0};s.dyasf=function(t,m){var s=this,i=t?t.indexOf('='):-1,n,x;if(i>=0&&m){var n=t.substring(0,i),x=t.substring(i+1);if(s.pt(x,',','dyasmf',m))return n}return 0};s.uns=function(){var s=this,x=s.dynamicAccountSelection,l=s.dynamicAccountList,m=s.dynamicAccountMatch,n,i;s.un=s.un.toLowerCase();if(x&&l){if(!m)m=s.wd.location.host;if(!m.toLowerCase)m=''+m;l=l.toLowerCase();m=m.toLowerCase();n=s.pt(l,';','dyasf',m);if(n)s.un=n}i=s.un.indexOf(',');s.fun=i<0?s.un:s.un.substring(0,i)};s.sa=function(un){var s=this;s.un=un;if(!s.oun)s.oun=un;else if((','+s.oun+',').indexOf(','+un+',')<0)s.oun+=','+un;s.uns()};s.m_i=function(n,a){var s=this,m,f=n.substring(0,1),r,l,i;if(!s.m_l)s.m_l=new Object;if(!s.m_nl)s.m_nl=new Array;m=s.m_l[n];if(!a&&m&&m._e&&!m._i)s.m_a(n);if(!m){m=new Object,m._c='s_m';m._in=s.wd.s_c_in;m._il=s._il;m._il[m._in]=m;s.wd.s_c_in++;m.s=s;m._n=n;m._l=new Array('_c','_in','_il','_i','_e','_d','_dl','s','n','_r','_g','_g1','_t','_t1','_x','_x1','_rs','_rr','_l');s.m_l[n]=m;s.m_nl[s.m_nl.length]=n}else if(m._r&&!m._m){r=m._r;r._m=m;l=m._l;for(i=0;i<l.length;i++)if(m[l[i]])r[l[i]]=m[l[i]];r._il[r._in]=r;m=s.m_l[n]=r}if(f==f.toUpperCase())s[n]=m;return m};s.m_a=new Function('n','g','e','if(!g)g=\"m_\"+n;var s=s_c_il['+s._in+'],c=s[g+\"_c\"],m,x,f=0;if(!c)c=s.wd[\"s_\"+g+\"_c\"];if(c&&s_d)s[g]=new Function(\"s\",s_ft(s_d(c)));x=s[g];if(!x)x=s.wd[\\'s_\\'+g];if(!x)x=s.wd[g];m=s.m_i(n,1);if(x&&(!m._i||g!=\"m_\"+n)){m._i=f=1;if((\"\"+x).indexOf(\"function\")>=0)x(s);else s.m_m(\"x\",n,x,e)}m=s.m_i(n,1);if(m._dl)m._dl=m._d=0;s.dlt();return f');s.m_m=function(t,n,d,e){t='_'+t;var s=this,i,x,m,f='_'+t,r=0,u;if(s.m_l&&s.m_nl)for(i=0;i<s.m_nl.length;i++){x=s.m_nl[i];if(!n||x==n){m=s.m_i(x);u=m[t];if(u){if((''+u).indexOf('function')>=0){if(d&&e)u=m[t](d,e);else if(d)u=m[t](d);else u=m[t]()}}if(u)r=1;u=m[t+1];if(u&&!m[f]){if((''+u).indexOf('function')>=0){if(d&&e)u=m[t+1](d,e);else if(d)u=m[t+1](d);else u=m[t+1]()}}m[f]=1;if(u)r=1}}return r};s.m_ll=function(){var s=this,g=s.m_dl,i,o;if(g)for(i=0;i<g.length;i++){o=g[i];if(o)s.loadModule(o.n,o.u,o.d,o.l,o.e,1);g[i]=0}};s.loadModule=function(n,u,d,l,e,ln){var s=this,m=0,i,g,o=0,f1,f2,c=s.h?s.h:s.b,b,tcf;if(n){i=n.indexOf(':');if(i>=0){g=n.substring(i+1);n=n.substring(0,i)}else g=\"m_\"+n;m=s.m_i(n)}if((l||(n&&!s.m_a(n,g)))&&u&&s.d&&c&&s.d.createElement){if(d){m._d=1;m._dl=1}if(ln){if(s.ssl)u=s.rep(u,'http:','https:');i='s_s:'+s._in+':'+n+':'+g;b='var s=s_c_il['+s._in+'],o=s.d.getElementById(\"'+i+'\");if(s&&o){if(!o.l&&s.wd.'+g+'){o.l=1;if(o.i)clearTimeout(o.i);o.i=0;s.m_a(\"'+n+'\",\"'+g+'\"'+(e?',\"'+e+'\"':'')+')}';f2=b+'o.c++;if(!s.maxDelay)s.maxDelay=250;if(!o.l&&o.c<(s.maxDelay*2)/100)o.i=setTimeout(o.f2,100)}';f1=new Function('e',b+'}');tcf=new Function('s','c','i','u','f1','f2','var e,o=0;try{o=s.d.createElement(\"script\");if(o){o.type=\"text/javascript\";'+(n?'o.id=i;o.defer=true;o.onload=o.onreadystatechange=f1;o.f2=f2;o.l=0;':'')+'o.src=u;c.appendChild(o);'+(n?'o.c=0;o.i=setTimeout(f2,100)':'')+'}}catch(e){o=0}return o');o=tcf(s,c,i,u,f1,f2)}else{o=new Object;o.n=n+':'+g;o.u=u;o.d=d;o.l=l;o.e=e;g=s.m_dl;if(!g)g=s.m_dl=new Array;i=0;while(i<g.length&&g[i])i++;g[i]=o}}else if(n){m=s.m_i(n);m._e=1}return m};s.vo1=function(t,a){if(a[t]||a['!'+t])this[t]=a[t]};s.vo2=function(t,a){if(!a[t]){a[t]=this[t];if(!a[t])a['!'+t]=1}};s.dlt=new Function('var s=s_c_il['+s._in+'],d=new Date,i,vo,f=0;if(s.dll)for(i=0;i<s.dll.length;i++){vo=s.dll[i];if(vo){if(!s.m_m(\"d\")||d.getTime()-vo._t>=s.maxDelay){s.dll[i]=0;s.t(vo)}else f=1}}if(s.dli)clearTimeout(s.dli);s.dli=0;if(f){if(!s.dli)s.dli=setTimeout(s.dlt,s.maxDelay)}else s.dll=0');s.dl=function(vo){var s=this,d=new Date;if(!vo)vo=new Object;s.pt(s.vl_g,',','vo2',vo);vo._t=d.getTime();if(!s.dll)s.dll=new Array;s.dll[s.dll.length]=vo;if(!s.maxDelay)s.maxDelay=250;s.dlt()};s.t=function(vo,id){var s=this,trk=1,tm=new Date,sed=Math&&Math.random?Math.floor(Math.random()*10000000000000):tm.getTime(),sess='s'+Math.floor(tm.getTime()/10800000)%10+sed,y=tm.getYear(),vt=tm.getDate()+'/'+tm.getMonth()+'/'+(y<1900?y+1900:y)+' '+tm.getHours()+':'+tm.getMinutes()+':'+tm.getSeconds()+' '+tm.getDay()+' '+tm.getTimezoneOffset(),tcf,tfs=s.gtfs(),ta='',q='',qs='',code='',vb=new Object;s.gl(s.vl_g);s.uns();s.m_ll();if(!s.td){var tl=tfs.location,a,o,i,x='',c='',v='',p='',bw='',bh='',j='1.0',k=s.c_w('s_cc','true',0)?'Y':'N',hp='',ct='',pn=0,ps;if(String&&String.prototype){j='1.1';if(j.match){j='1.2';if(tm.setUTCDate){j='1.3';if(s.isie&&s.ismac&&s.apv>=5)j='1.4';if(pn.toPrecision){j='1.5';a=new Array;if(a.forEach){j='1.6';i=0;o=new Object;tcf=new Function('o','var e,i=0;try{i=new Iterator(o)}catch(e){}return i');i=tcf(o);if(i&&i.next)j='1.7'}}}}}if(s.apv>=4)x=screen.width+'x'+screen.height;if(s.isns||s.isopera){if(s.apv>=3){v=s.n.javaEnabled()?'Y':'N';if(s.apv>=4){c=screen.pixelDepth;bw=s.wd.innerWidth;bh=s.wd.innerHeight}}s.pl=s.n.plugins}else if(s.isie){if(s.apv>=4){v=s.n.javaEnabled()?'Y':'N';c=screen.colorDepth;if(s.apv>=5){bw=s.d.documentElement.offsetWidth;bh=s.d.documentElement.offsetHeight;if(!s.ismac&&s.b){tcf=new Function('s','tl','var e,hp=0;try{s.b.addBehavior(\"#default#homePage\");hp=s.b.isHomePage(tl)?\"Y\":\"N\"}catch(e){}return hp');hp=tcf(s,tl);tcf=new Function('s','var e,ct=0;try{s.b.addBehavior(\"#default#clientCaps\");ct=s.b.connectionType}catch(e){}return ct');ct=tcf(s)}}}else r=''}if(s.pl)while(pn<s.pl.length&&pn<30){ps=s.fl(s.pl[pn].name,100)+';';if(p.indexOf(ps)<0)p+=ps;pn++}s.resolution=x;s.colorDepth=c;s.javascriptVersion=j;s.javaEnabled=v;s.cookiesEnabled=k;s.browserWidth=bw;s.browserHeight=bh;s.connectionType=ct;s.homepage=hp;s.plugins=p;s.td=1}if(vo){s.pt(s.vl_g,',','vo2',vb);s.pt(s.vl_g,',','vo1',vo)}if(s.usePlugins)s.doPlugins(s);var l=s.wd.location,r=tfs.document.referrer;if(!s.pageURL)s.pageURL=l.href?l.href:l;if(!s.referrer&&!s._1_referrer){s.referrer=r;s._1_referrer=1}if((vo&&vo._t)||!s.m_m('d')){s.m_m('g');if(s.lnk||s.eo){var o=s.eo?s.eo:s.lnk;if(!o)return '';var p=s.pageName,w=1,t=s.ot(o),n=s.oid(o),x=o.s_oidt,h,l,i,oc;if(s.eo&&o==s.eo){while(o&&!n&&t!='BODY'){o=o.parentElement?o.parentElement:o.parentNode;if(!o)return '';t=s.ot(o);n=s.oid(o);x=o.s_oidt}oc=o.onclick?''+o.onclick:'';if((oc.indexOf(\"s_gs(\")>=0&&oc.indexOf(\".s_oc(\")<0)||oc.indexOf(\".tl(\")>=0)return ''}ta=n?o.target:1;h=s.oh(o);i=h.indexOf('?');h=s.linkLeaveQueryString||i<0?h:h.substring(0,i);l=s.linkName;t=s.linkType?s.linkType.toLowerCase():s.lt(h);if(t&&(h||l))q+='&pe=lnk_'+(t=='d'||t=='e'?s.ape(t):'o')+(h?'&pev1='+s.ape(h):'')+(l?'&pev2='+s.ape(l):'');else trk=0;if(s.trackInlineStats){if(!p){p=s.pageURL;w=0}t=s.ot(o);i=o.sourceIndex;if(s.gg('objectID')){n=s.gg('objectID');x=1;i=1}if(p&&n&&t)qs='&pid='+s.ape(s.fl(p,255))+(w?'&pidt='+w:'')+'&oid='+s.ape(s.fl(n,100))+(x?'&oidt='+x:'')+'&ot='+s.ape(t)+(i?'&oi='+i:'')}}if(!trk&&!qs)return '';s.sampled=s.vs(sed);if(trk){if(s.sampled)code=s.mr(sess,(vt?'&t='+s.ape(vt):'')+s.hav()+q+(qs?qs:s.rq()),0,id,ta);qs='';s.m_m('t');if(s.p_r)s.p_r();s.referrer=''}s.sq(qs);}else{s.dl(vo);}if(vo)s.pt(s.vl_g,',','vo1',vb);s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3='';if(s.pg)s.wd.s_lnk=s.wd.s_eo=s.wd.s_linkName=s.wd.s_linkType='';if(!id&&!s.tc){s.tc=1;s.flushBufferedRequests()}return code};s.tl=function(o,t,n,vo){var s=this;s.lnk=s.co(o);s.linkType=t;s.linkName=n;s.t(vo)};if(pg){s.wd.s_co=function(o){var s=s_gi(\"_\",1,1);return s.co(o)};s.wd.s_gs=function(un){var s=s_gi(un,1,1);return s.t()};s.wd.s_dc=function(un){var s=s_gi(un,1);return s.t()}}s.ssl=(s.wd.location.protocol.toLowerCase().indexOf('https')>=0);s.d=document;s.b=s.d.body;if(s.d.getElementsByTagName){s.h=s.d.getElementsByTagName('HEAD');if(s.h)s.h=s.h[0]}s.n=navigator;s.u=s.n.userAgent;s.ns6=s.u.indexOf('Netscape6/');var apn=s.n.appName,v=s.n.appVersion,ie=v.indexOf('MSIE '),o=s.u.indexOf('Opera '),i;if(v.indexOf('Opera')>=0||o>0)apn='Opera';s.isie=(apn=='Microsoft Internet Explorer');s.isns=(apn=='Netscape');s.isopera=(apn=='Opera');s.ismac=(s.u.indexOf('Mac')>=0);if(o>0)s.apv=parseFloat(s.u.substring(o+6));else if(ie>0){s.apv=parseInt(i=v.substring(ie+5));if(s.apv>3)s.apv=parseFloat(i)}else if(s.ns6>0)s.apv=parseFloat(s.u.substring(s.ns6+10));else s.apv=parseFloat(v);s.em=0;if(s.em.toPrecision)s.em=3;else if(String.fromCharCode){i=escape(String.fromCharCode(256)).toUpperCase();s.em=(i=='%C4%80'?2:(i=='%U0100'?1:0))}s.sa(un);s.vl_l='dynamicVariablePrefix,visitorID,vmk,visitorMigrationKey,visitorMigrationServer,visitorMigrationServerSecure,ppu,charSet,visitorNamespace,cookieDomainPeriods,cookieLifetime,pageName,pageURL,referrer,currencyCode';s.va_l=s.sp(s.vl_l,',');s.vl_t=s.vl_l+',variableProvider,channel,server,pageType,transactionID,purchaseID,campaign,state,zip,events,products,linkName,linkType';for(var n=1;n<51;n++)s.vl_t+=',prop'+n+',eVar'+n+',hier'+n+',list'+n;s.vl_l2=',tnt,pe,pev1,pev2,pev3,resolution,colorDepth,javascriptVersion,javaEnabled,cookiesEnabled,browserWidth,browserHeight,connectionType,homepage,plugins';s.vl_t+=s.vl_l2;s.va_t=s.sp(s.vl_t,',');s.vl_g=s.vl_t+',trackingServer,trackingServerSecure,trackingServerBase,fpCookieDomainPeriods,disableBufferedRequests,mobile,visitorSampling,visitorSamplingGroup,dynamicAccountSelection,dynamicAccountList,dynamicAccountMatch,trackDownloadLinks,trackExternalLinks,trackInlineStats,linkLeaveQueryString,linkDownloadFileTypes,linkExternalFilters,linkInternalFilters,linkTrackVars,linkTrackEvents,linkNames,lnk,eo,_1_referrer';s.va_g=s.sp(s.vl_g,',');s.pg=pg;s.gl(s.vl_g);if(!ss)s.wds()",q=window,f=q.s_c_il,b=navigator,t=b.userAgent,r=b.appVersion,k=r.indexOf("MSIE "),d=t.indexOf("Netscape6/"),p,g,x;if(h){h=h.toLowerCase();if(f){for(g=0;g<f.length;g++){x=f[g];if(!x._c||x._c=="s_c"){if(x.oun==h){return x}else{if(x.fs&&x.sa&&x.fs(x.oun,h)){x.sa(h);return x}}}}}}q.s_an="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";q.s_sp=new Function("x","d","var a=new Array,i=0,j;if(x){if(x.split)a=x.split(d);else if(!d)for(i=0;i<x.length;i++)a[a.length]=x.substring(i,i+1);else while(i>=0){j=x.indexOf(d,i);a[a.length]=x.substring(i,j<0?x.length:j);i=j;if(i>=0)i+=d.length}}return a");q.s_jn=new Function("a","d","var x='',i,j=a.length;if(a&&j>0){x=a[0];if(j>1){if(a.join)x=a.join(d);else for(i=1;i<j;i++)x+=d+a[i]}}return x");q.s_rep=new Function("x","o","n","return s_jn(s_sp(x,o),n)");q.s_d=new Function("x","var t='`^@$#',l=s_an,l2=new Object,x2,d,b=0,k,i=x.lastIndexOf('~~'),j,v,w;if(i>0){d=x.substring(0,i);x=x.substring(i+2);l=s_sp(l,'');for(i=0;i<62;i++)l2[l[i]]=i;t=s_sp(t,'');d=s_sp(d,'~');i=0;while(i<5){v=0;if(x.indexOf(t[i])>=0) {x2=s_sp(x,t[i]);for(j=1;j<x2.length;j++){k=x2[j].substring(0,1);w=t[i]+k;if(k!=' '){v=1;w=d[b+l2[k]]}x2[j]=w+x2[j].substring(1)}}if(v)x=s_jn(x2,'');else{w=t[i]+' ';if(x.indexOf(w)>=0)x=s_rep(x,w,t[i]);i++;b+=62}}}return x");q.s_fe=new Function("c","return s_rep(s_rep(s_rep(c,'\\\\','\\\\\\\\'),'\"','\\\\\"'),\"\\n\",\"\\\\n\")");q.s_fa=new Function("f","var s=f.indexOf('(')+1,e=f.indexOf(')'),a='',c;while(s>=0&&s<e){c=f.substring(s,s+1);if(c==',')a+='\",\"';else if((\"\\n\\r\\t \").indexOf(c)<0)a+=c;s++}return a?'\"'+a+'\"':a");q.s_ft=new Function("c","c+='';var s,e,o,a,d,q,f,h,x;s=c.indexOf('=function(');while(s>=0){s++;d=1;q='';x=0;f=c.substring(s);a=s_fa(f);e=o=c.indexOf('{',s);e++;while(d>0){h=c.substring(e,e+1);if(q){if(h==q&&!x)q='';if(h=='\\\\')x=x?0:1;else x=0}else{if(h=='\"'||h==\"'\")q=h;if(h=='{')d++;if(h=='}')d--}if(d>0)e++}c=c.substring(0,s)+'new Function('+(a?a+',':'')+'\"'+s_fe(c.substring(o+1,e))+'\")'+c.substring(e+1);s=c.indexOf('=function(')}return c;");o=s_d(o);if(k>0){p=parseInt(g=r.substring(k+5));if(p>3){p=parseFloat(g)}}else{if(d>0){p=parseFloat(t.substring(d+10))}else{p=parseFloat(r)}}if(p>=5&&r.indexOf("Opera")<0&&t.indexOf("Opera")<0){q.s_c=new Function("un","pg","ss","var s=this;"+o);return new s_c(h,j,y)}else{x=new Function("un","pg","ss","var s=new Object;"+s_ft(o)+";return s")}return x(h,j,y)};var aptIDG=null;var mapTypeG=null;var onlinePG=null;var a40G=null;var leadBoth=null;function callEvent28(a){SocialEvent28("gplus")}function SocialEvent28(b){var c=s_gi(sitecatalyst_account_id);var a=c.pageName+"_"+b;var d="Social "+b;c.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar10,prop34,eVar7,events";c.linkTrackEvents="event28";c.events="event28";c.eVar10=a;c.tl(this,"e",d);ClearOmnitureCodes()}function addCookie(c,d,f){if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toUTCString()}else{var a=""}document.cookie=c+"="+d+a+"; domain="+afdomain+"; path=/";if(document.cookie.indexOf(c,0)<0){var e=document.getElementById("nocookie");if(e!=null){e.innerHTML="Cookies must be enabled to use the site."}}}function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function simplewait(c){var b=new Date();var a=null;do{a=new Date()}while(a-b<c)}function OmnitureModalRegister(){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events";a.linkTrackEvents="event1";a.events="event1";a.t();ClearOmnitureCodes()}function OmnitureBrowseOverlay(c,a){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,eVar39,prop1,prop2,prop3,prop4,prop5,eVar4,eVar5,eVar42,prop34,prop39";b.pageName="home-browse";b.channel="home";b.prop1="home-browse";b.prop2="home-browse";b.prop3="home-browse";b.prop4=c;b.eVar4=c;b.prop39=a;b.eVar39=a;b.t();ClearOmnitureCodes()}function OmnitureFeaturedShow1(c,a){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products";b.linkTrackEvents="event7";b.events="event7";b.pageName=page_name;b.server=page_server;b.channel=page_eVar40;b.products=";"+c+";;;event7=1;evar33="+a+"|evar40="+page_eVar40;b.tl(this,"o","Featured Apartment");ClearOmnitureCodes()}function OmnitureFeaturedClick(b,a){}function OmnitureFeatured(d,b){var c=s_gi(sitecatalyst_account_id);c.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar1,eVar2,eVar3,prop34,events,products";c.linkTrackEvents="event8";c.events="event8";c.eVar1=d;c.eVar2=d;c.eVar3="featured";var a=getCookie("PageRef");c.products=";"+d+";;;event8=1;evar33="+b+"|evar40="+a;c.tl(this,"o",description);ClearOmnitureCodes();addCookie("add40","true",7)}function OmnitureApartmentImpression(e,a,d,b){var c=s_gi(sitecatalyst_account_id);c.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar33,prop34,events,products";c.linkTrackEvents="event7";c.events="event7";c.products=";"+e+";;;event7=1;evar33="+a+"|evar40="+b;c.tl(this,"o",d);ClearOmnitureCodes()}function OmnitureApartmentClick(c,a,b){OmnitureFeaturedClick(c,a,b,"srch-sugg")}function OmnitureApartmentClick(e,a,d,b){var c=s_gi(sitecatalyst_account_id);c.linkTrackVars="eVar34,eVar40,prop5,eVar5,prop16,eVar16,eVar42,eVar1,eVar3,prop34,events,products";c.pageName="property details";c.linkTrackEvents="event8";c.events="event8";c.eVar1=e;c.eVar3=d;c.products=";"+e+";;;event8=1;evar33="+a+"|evar40="+b;c.tl(this,"o",d);ClearOmnitureCodes()}function OmnitureGetYourMoveOn(b,a){var c=s_gi(sitecatalyst_account_id);c.linkTrackVars="eVar12,eVar34,prop5,prop16,eVar5,eVar16,eVar42,prop34,events";c.linkTrackEvents="event6";c.events="event6";c.eVar12=b;if(a!=null&&a!=undefined){c.prop16=a;c.eVar16=a}if(a=="cyc"){c.tl(this,"e","Get Your Move on")}else{c.tl(this,"e","Get Your Credit Score")}ClearOmnitureCodes()}function OmnitureEvent9(b){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar44,prop34,events";a.linkTrackEvents="event9";a.events="event9";a.eVar44=b;a.tl(this,"o",b);ClearOmnitureCodes()}function OmnitureShowOnMap(d,a,c,e){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar33,eVar34,eVar36,prop5,eVar5,prop16,eVar16,eVar42,prop8,prop34,prop36,events,products";b.linkTrackEvents="event20";b.events="event20";if(e=="1"){b.products=";"+aptIDG+";;;;eVar33="+onlinePG;b.prop8=mapTypeG}else{if(e=="2"){b.products=";"+d+";;;;eVar33="+a;b.prop8=c}}b.eVar36="map and directions tab";b.prop36="map and directions tab";b.tl(this,"o","Show on Map");ClearOmnitureCodes()}function OmnitureVirtualTour(a,g,c,h,b){var i=s_gi(sitecatalyst_account_id);i.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar9,eVar17,eVar33,events,products";i.linkTrackEvents="event11";i.events="event11";i.eVar9=g;i.eVar17=c;var d=g;var e=c;if(a=="True"){var f=getCookie("PageRef");i.products=";"+i.eVar9+";;;;eVar33="+h+"|eVar40="+f}else{i.products=";"+i.eVar9+";;;;eVar33="+h}i.tl(this,"e","Virtual Tour");ClearOmnitureCodes();window.open(b,"_blank");return false}function OmniturePhotosVideoLink(c,b,f,e,g){var d=s_gi(sitecatalyst_account_id);var a=getCookie("PageRef");if(e=="event15"){d.linkTrackVars="eVar9,eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop1,prop2,prop3,prop7,prop34,events,products"}else{if(e=="event11"){d.linkTrackVars="eVar9,eVar17,eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products"}}d.linkTrackEvents=e;d.events=e;d.eVar9=b;d.eVar17="other";if(c=="True"){d.products=";"+d.eVar9+";;;;eVar33="+f+"|eVar40="+a}else{d.products=";"+d.eVar9+";;;;eVar33="+f}d.tl(this,"e",g);ClearOmnitureCodes()}function OmnitureEvent19(c,b,f,e,g){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar6,events,products";d.linkTrackEvents="event19";d.events="event19";d.eVar6=e;if(c=="True"){var a=getCookie("PageRef");d.products=";"+b+";;;;eVar33="+f+"|eVar40="+a}else{d.products=";"+b+";;;;eVar33="+f}if(g==undefined||g==null||g==""){g="web"}d.tl(this,"e",g);ClearOmnitureCodes()}function OmnitureFloorPlan(b,c){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products";a.linkTrackEvents="event16";a.events="event16";a.products=";"+b+";;;;eVar33="+c;a.tl(this,"o","Floor Plan View");ClearOmnitureCodes()}function OmnitureSendSaveCheck(c,b,f,d){var e=s_gi(sitecatalyst_account_id);e.linkTrackVars="eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products";e.linkTrackEvents="event20";e.events="event20";e.eVar36=d;e.prop36=d;if(c=="True"){var a=getCookie("PageRef");e.products=";"+b+";;;;eVar33="+f+"|eVar40="+a}else{e.products=";"+b+";;;;eVar33="+f}e.tl(this,"o",d);ClearOmnitureCodes()}function OmnitureOrderMagazine(a){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar7,events";b.linkTrackEvents="event5";b.events="event5";b.eVar7=b.pageName;b.tl(this,"e","Order Magazine");ClearOmnitureCodes()}function OmnitureFootLinks(a){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34";b.tl(this,"e","");ClearOmnitureCodes()}function OmnitureHoverBox(b,c){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,prop34,eVar11,eVar33,eVar42,products,events,prop11";a.eVar11="RESHBXREQ";a.prop11="RESHBXREQ";a.products=";"+b+";;;;eVar33="+c;a.tl(this,"o","Hover Box Free Brochure");ClearOmnitureCodes()}function OmnitureLeadForm(c,d,a){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar11,eVar33,products,events,prop11";b.eVar11=a;b.prop11=a;b.products=";"+c+";;;;eVar33="+d;b.tl(this,"o","Free Brochure");ClearOmnitureCodes()}function OmnitureMapViewClick(b,e,c){var d=s_gi(sitecatalyst_account_id);d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar1,eVar2,eVar3,eVar33,eVar40,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar8,events,products";d.linkTrackEvents="event10";d.events="event10";d.eVar1=b;d.eVar2=b;d.eVar3=c;d.eVar8=b;var a=getCookie("PageRef");d.products=";"+b+";;;;evar33="+e+"|evar40="+a;d.tl(this,"o","Map View Click");ClearOmnitureCodes()}function OmnitureAptSavedWithLead(){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events";a.linkTrackEvents="event14";a.events="event14";a.tl(this,"o","Save Apartment");ClearOmnitureCodes()}function OmnitureLeadSubmitted(c,g,b,e,a){var j=s_gi(sitecatalyst_account_id);var d=c;var i=g;var f=b;j.linkTrackVars="eVar34,eVar15,prop5,prop16,prop11,eVar5,eVar16,eVar11,eVar41,eVar42,eVar43,prop34,events,products";j.linkTrackEvents="event12";j.events="event12";j.eVar41="1";if(leadBoth!=null){if(leadBoth=="1"){j.eVar15="new"}else{j.eVar15="control"}}if(typeof(useTip)=="undefined"){j.eVar43="n"}else{j.eVar43=useTip}if(d==null||d==""||d=="missing"){if(aptIDG!=null){d=aptIDG}}if(i==null||i==""){if(onlinePG!=null){i=onlinePG}}if(f=="True"){var h=getCookie("PageRef");j.products=";"+d+";;;;eVar33="+i+"|eVar40="+h}else{j.products=";"+d+";;;;eVar33="+i}if(typeof(e)!="undefined"){j.prop34=e;j.eVar34=j.prop34}if(typeof(a)!="undefined"){j.eVar42=a}j.tl(this,"o","Lead Submission");ClearOmnitureCodes()}function OmnitureLeadSubmittedCompare(c,b,e,a){var i=s_gi(sitecatalyst_account_id);var d=c.split(",");var h;var f=b;i.linkTrackVars="eVar34,eVar15,prop2,prop5,prop16,prop11,eVar5,eVar16,eVar8,eVar11,eVar41,eVar42,eVar43,prop34,events,products";i.linkTrackEvents="event12";i.events="event12";i.eVar41=d.length.toString();if(leadBoth!=null){if(leadBoth=="1"){i.eVar15="new"}else{i.eVar15="control"}}i.products="";if(usecaptcha){i.prop2="y";i.eVar8="y";usecaptcha=false}else{i.prop2="n";i.eVar8="n"}if(typeof(useTip)=="undefined"){i.eVar43="n"}else{i.eVar43=useTip}if(f=="True"){var g=getCookie("PageRef");for(index=0;index<d.length;index++){h=d[index].split("|")[1].toString();i.products=";"+d[index].split("|")[0].toString()+";;;;eVar33="+h+"|eVar40="+g}}else{for(index=0;index<d.length;index++){h=d[index].split("|")[1].toString();i.products=";"+d[index].split("|")[0].toString()+";;;;eVar33="+h}}if(typeof(e)!="undefined"){i.prop34=e;i.eVar34=i.prop34}if(typeof(a)!="undefined"){i.eVar42=a}i.tl(this,"o","Lead Submission Compare");ClearOmnitureCodes();$("#name2").text(sname)}function OmnitureLeadSubmittedDetails(b,f,a,d){var i=s_gi(sitecatalyst_account_id);var c=b;var h=f;var e=a;i.linkTrackVars="eVar34,eVar15,prop5,eVar5,prop16,eVar16,eVar41,eVar42,eVar11,eVar43,prop11,prop34,events,products";i.linkTrackEvents="event12";i.events="event12";i.eVar41="1";i.eVar43=useTip;i.eVar11=d;i.prop11=d;if(leadBoth!=null){if(leadBoth=="1"){i.eVar15="new"}else{i.eVar15="control"}}if(c==null||c==""||c=="missing"){if(aptIDG!=null){c=aptIDG}}if(h==null||h==""){if(onlinePG!=null){h=onlinePG}}if(e=="True"){var g=getCookie("PageRef");i.products=";"+c+";;;;eVar33="+h+"|eVar40="+g}else{i.products=";"+c+";;;;eVar33="+h}i.tl(this,"o","Lead Submission");ClearOmnitureCodes()}function OmnitureSendToFriendOrMobile(d,c,h,g){var f=s_gi(sitecatalyst_account_id);var b=g;var e=c;f.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products";f.linkTrackEvents="event20";f.events="event20";f.eVar36=d;f.prop36=d;if(b=="True"){var a=getCookie("PageRef");f.products=";"+e+";;;;eVar33="+h+"|eVar40="+a}else{f.products=";"+e+";;;;eVar33="+h}f.tl(this,"o",d);ClearOmnitureCodes()}function OmnitureSignIn(b){var a=s_gi(sitecatalyst_account_id);if(b=="1"){a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events"}else{if(b=="2"){a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar39,prop34,prop39,events";a.eVar39="fbc";a.prop39="fbc"}}a.linkTrackEvents="event2";a.events="event2";a.tl(this,"o","Sign In");ClearOmnitureCodes()}function FBOmnitureRegister(){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar39,prop34,prop39,events";a.linkTrackEvents="event1";a.eVar39="fbc";a.prop39="fbc";a.events="event1";a.tl(this,"o","Register");ClearOmnitureCodes()}function OmnitureLeadImpressions(){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar10,eVar33,eVar34,eVar40,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products";a.linkTrackEvents="event7";a.events="event7";a.eVar10="lead confirmation";a.products=impressions;a.tl(this,"o","Lead Confirmation Impressions");ClearOmnitureCodes()}function OmnitureGetDirections20(c,b,e){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products";d.linkTrackEvents="event20";d.events="event20";d.eVar36="Get Directions";d.prop36="Get Directions";if(c=="True"){var a=getCookie("PageRef");d.products=";"+b+";;;;eVar33="+e+"|eVar40="+a}else{d.products=";"+b+";;;;eVar33="+e}d.tl(this,"o","Get Directions");ClearOmnitureCodes()}function OmnitureContactApt(c,b,f,e,g){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar11,eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,products,prop11";d.eVar11=e;d.prop11=e;if(c=="True"){var a=getCookie("PageRef");d.products=";"+b+";;;;eVar33="+f+"|eVar40="+a}else{d.products=";"+b+";;;;eVar33="+f}d.tl(this,"o",g);ClearOmnitureCodes()}function SendOmnitureCodesForTabs(a,k,h,e,i,d,c,l){ClearOmnitureCodes();var m=s_gi(sitecatalyst_account_id);if(e=="find out more direct"){m.eVar11="FINDOUTMORE";m.prop11="FINDOUTMORE";e="find out more"}m.pageName=c+":"+e;m.prop1=d;m.prop2=c;m.prop3=c+":"+e;m.prop7=k;m.server=l;m.channel=i;var b;if(e=="floor plan"){m.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop7,prop34,events,products";m.linkTrackEvents="event16";m.events="event16";if(a=="True"){var j=getCookie("PageRef");m.products=";"+k+";;;;eVar33="+h+"|eVar40="+j}else{m.products=";"+k+";;;;eVar33="+h}}if(e=="map and directions"){m.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop7,prop34,prop8,products";m.events="event20";m.eVar36="map and directions tab";m.prop36="map and directions tab";var f="";var g=document.getElementById&&!document.all;if(!g){f=(document.getElementById("ctl00$mst$hdnMapType"))?document.getElementById("ctl00$mst$hdnMapType").value:null}else{f=(document.getElementById("ctl00_cphPrimaryContentSection_hdnMapType"))?document.getElementById("ctl00_cphPrimaryContentSection_hdnMapType").value:null}m.prop8=f;if(a=="True"){var j=getCookie("PageRef");m.products=";"+k+";;;;eVar33="+h+"|eVar40="+j}else{m.products=";"+k+";;;;eVar33="+h}if(typeof(maptabvar)!="undefined"){if(maptabvar==0){b=m.t()}else{b=m.tl(this,"o","Map and Directions: map type")}maptabvar++}}else{b=m.t()}if(b){document.write(b)}ClearOmnitureCodes()}function OmnitureMiscClick(c,b,e,g,f){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products";d.linkTrackEvents="event20";d.events="event20";d.eVar36=f;d.prop36=f;if(c=="True"){var a=getCookie("PageRef");d.products=";"+b+";;;;eVar33="+e+"|eVar40="+a}else{d.products=";"+b+";;;;eVar33="+e}d.tl(this,g,f);ClearOmnitureCodes()}function LogOmnitureMisc(a,f,h,b,e,g){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar11,eVar33,products,events,prop11";d.eVar11=a;d.prop11=a;var c="";if(a=="HOMEFEATREQ"){c="home"}else{c="srch-feat"}if(c==""){d.products=";"+f+";;;;eVar33="+h}else{d.products=";"+f+";;;;eVar33="+h+"|evar40="+c}d.tl(this,"o",g);ClearOmnitureCodes();addCookie(b,"false",7)}function LogOmnitureFacebookShareSearch(b){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar44,prop34,events";a.linkTrackEvents="event9";a.events="event9";a.eVar44="fbc-facebook share search";a.tl(this,"o","facebook share search");ClearOmnitureCodes()}function LogOmnitureForum(c,b){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,eVar38,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,prop38,prop45,eVar45,eVar46,events,products";a.linkTrackEvents="event14";a.events="event14";a.prop45=c;a.eVar45=c;a.eVar46=b;a.tl(this,"o",b);ClearOmnitureCodes()}function LogOmnitureForumReportOffensive(b){var a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,eVar38,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,prop38,prop43,prop45,eVar45,eVar46,products";if(a.prop34!=null){a.prop43="flag:"+a.prop34+":"+b}a.prop45=b;a.eVar45=b;a.eVar46="report_offensive";a.tl(this,"o","report_offensive");ClearOmnitureCodes()}function LogAdvertiserPopUnder(b,a,c){s.linkTrackVars="eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,eVar6,eVar11,prop11,events,products";s.linkTrackEvents=String.format("event19{0}",b!=""?String.format(",{0}",b):"");s.events=String.format("event19{0}",b!=""?String.format(",{0}",b):"");s.products=String.format(";{0};;;;evar33={1}",a,c);s.prop11="advweb-auto";s.eVar11="advweb-auto";s.eVar6="advweb";if(b=="event20"){s.prop36="avail-auto";s.eVar36="avail-auto"}s.tl(this,"e","Advertiser Website");ClearOmnitureCodes()}function LogLeadPopUnder(b,a,c){s.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,eVar6,events,products";s.linkTrackEvents=String.format("event12{0}",b!=""?String.format(",{0}",b):"");s.events=String.format("event12{0}",b!=""?String.format(",{0}",b):"");s.products=String.format(";{0};;;;evar33={1}",a,c);if(b.toString().indexOf("event19")>-1){s.eVar6="advweb-auto"}if(b.toString().indexOf("event20")>-1){s.prop36="avail-auto";s.eVar36="avail-auto"}s.tl(this,"o","Submit Lead");ClearOmnitureCodes()}function LogAvailPopUnder(b,a,c){s.linkTrackVars="eVar33,eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,eVar6,eVar11,prop11,events,products";s.linkTrackEvents=String.format("event20{0}",b!=""?String.format(",{0}",b):"");s.events=String.format("event20{0}",b!=""?String.format(",{0}",b):"");s.products=String.format(";{0};;;;evar33={1}",a,c);s.prop11="avail-auto";s.eVar11="avail-auto";if(b.toString().indexOf("event19")>-1){s.eVar6="advweb-auto"}s.prop36="avail";s.eVar36="avail";s.tl(this,"o","Check Availability");ClearOmnitureCodes()}function ViewAllFloorPlans13(b,f,e,c,g,a){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar34,eVar42,eVar38,eVar39,prop34,eVar2,eVar3,eVar4,eVar10,prop1,prop2,prop3,prop4,prop7,events,products";d.linkTrackEvents="event13";d.events="event13";d.products=String.format(";{0};;;;evar33={1}",b,f);d.prop10=d.pageName;d.eVar2=b;d.eVar10=d.pageName;d.server=a;d.channel=g;d.prop1=e;d.prop2=c;d.prop3=c;d.prop7=b;d.tl(this,"o","Property View");ClearOmnitureCodes()}function OmnitureHeaderPicsClicks2(){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products";b.linkTrackEvents="event15";b.events="event15";if(a40G=="True"){var a=getCookie("PageRef");b.products=";"+aptIDG+";;;;eVar33="+onlinePG+"|eVar40="+a}else{b.products=";"+aptIDG+";;;;eVar33="+onlinePG}b.tl(this,"o","Slide Control Pictures Click");ClearOmnitureCodes()}function OmnitureIPhoneAppLink(){var b=s_gi(sitecatalyst_account_id);b.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,eVar44,prop34,events";b.linkTrackEvents="event9";b.events="event9";b.eVar44="iphone-app-iphone";var a=obj.href!=null?b.lt(obj.href):"";if(a==""){b.tl(obj,"e","iphone-app-iphone")}ClearOmnitureCodes()}function OmnitureRequest(b){var e;var g;var d;var j=s_gi(sitecatalyst_account_id);var i=requestListID.split(",");j.linkTrackVars="eVar11,eVar33,eVar34,prop2,prop5,eVar5,prop16,eVar16,eVar8,eVar42,prop34,events,products,prop11";if(usecaptcha){j.prop2="y";j.eVar8="y"}else{j.prop2="n";j.eVar8="n"}if(b=="1"){if(i.length>1){$("#PropCount").text(i.length+" properties")}else{$("#PropCount").text("property")}j.eVar11="COMPALLBTN";j.prop11="COMPALLBTN"}else{var c=0;for(index=0;index<i.length;index++){e=i[index].split("|")[2].toString();if(e=="1"){++c}}if(c>1){$("#PropCount").text(c+" properties")}else{$("#PropCount").text("property")}j.eVar11="COMPTOPBTN";j.prop11="COMPTOPBTN"}var a="<%= _add40 %>";var h="";if(a=="True"){var f=getCookie("PageRef");for(index=0;index<i.length;index++){e=i[index].split("|")[2].toString();if(b=="1"){e="1"}if(e=="1"){g=i[index].split("|")[0];d=i[index].split("|")[1];if(h==""){h=";"+g+";;;;eVar33="+d+"|eVar40="+f}else{h+=",;"+g+";;;;eVar33="+d+"|eVar40="+f}}}}else{for(index=0;index<i.length;index++){e=i[index].split("|")[2].toString();if(b=="1"){e="1"}if(e=="1"){g=i[index].split("|")[0];d=i[index].split("|")[1];if(h==""){h=";"+g+";;;;eVar33="+d}else{h+=",;"+g+";;;;eVar33="+d}}}}j.products=h;j.tl(this,"o","Contact Apartment Compare");ClearOmnitureCodes()}function OmniturePlayYouTube(c,b,e){var d=s_gi(sitecatalyst_account_id);d.linkTrackVars="eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products";d.linkTrackEvents="event20";d.events="event20";d.eVar36="youtube-play";d.prop36="youtube-play";if(c=="True"){var a=getCookie("PageRef");d.products=";"+b+";;;;eVar33="+e+"|eVar40="+a}else{d.products=";"+b+";;;;eVar33="+e}d.tl(this,"o","Play YouTube");ClearOmnitureCodes()}function logMobileClick(){var a=s_gi(sitecatalyst_account_id);a=s_gi(sitecatalyst_account_id);a.linkTrackVars="eVar34,prop2,prop5,prop16,prop11,eVar5,eVar16,eVar8,eVar11,eVar41,eVar42,eVar43,prop34,events,products";a.linkTrackEvents="event37";a.events="event37";a.tl(this,"o","Mobile Promo Click");ClearOmnitureCodes()};(function(d){d.fn.extend({renderCalendar:function(t){var C=function(i){return document.createElement(i)};t=d.extend({},d.fn.datePicker.defaults,t);if(t.showHeader!=d.dpConst.SHOW_HEADER_NONE){var o=d(C("tr"));for(var x=Date.firstDayOfWeek;x<Date.firstDayOfWeek+7;x++){var h=x%7;var v=Date.dayNames[h];o.append(jQuery(C("th")).attr({scope:"col",abbr:v,title:v,"class":(h==0||h==6?"weekend":"weekday")}).html(t.showHeader==d.dpConst.SHOW_HEADER_SHORT?v.substr(0,1):v))}}var e=d(C("table")).attr({cellspacing:2}).addClass("jCalendar").append((t.showHeader!=d.dpConst.SHOW_HEADER_NONE?d(C("thead")).append(o):C("thead")));var f=d(C("tbody"));var z=(new Date()).zeroTime();z.setHours(12);var B=t.month==undefined?z.getMonth():t.month;var p=t.year||z.getFullYear();var m=(new Date(p,B,1,12,0,0));var l=Date.firstDayOfWeek-m.getDay()+1;if(l>1){l-=7}var q=Math.ceil(((-1*l+1)+m.getDaysInMonth())/7);m.addDays(l-1);var A=function(i){return function(){if(t.hoverClass){var r=d(this);if(!t.selectWeek){r.addClass(t.hoverClass)}else{if(i&&!r.is(".disabled")){r.parent().addClass("activeWeekHover")}}}}};var g=function(){if(t.hoverClass){var i=d(this);i.removeClass(t.hoverClass);i.parent().removeClass("activeWeekHover")}};var n=0;while(n++<q){var u=jQuery(C("tr"));var k=t.dpController?m>t.dpController.startDate:false;for(var x=0;x<7;x++){var j=m.getMonth()==B;var y=d(C("td")).text(m.getDate()+"").addClass((j?"current-month ":"other-month ")+(m.isWeekend()?"weekend ":"weekday ")+(j&&m.getTime()==z.getTime()?"today ":"")).data("datePickerDate",m.asString()).hover(A(k),g);u.append(y);if(t.renderCallback){t.renderCallback(y,m,B,p)}m=new Date(m.getFullYear(),m.getMonth(),m.getDate()+1,12,0,0)}f.append(u)}e.append(f);return this.each(function(){d(this).empty().append(e)})},datePicker:function(e){if(!d.event._dpCache){d.event._dpCache=[]}e=d.extend({},d.fn.datePicker.defaults,e);return this.each(function(){var g=d(this);var i=true;if(!this._dpId){this._dpId=d.event.guid++;d.event._dpCache[this._dpId]=new a(this);i=false}if(e.inline){e.createButton=false;e.displayClose=false;e.closeOnSelect=false;g.empty()}var f=d.event._dpCache[this._dpId];f.init(e);if(!i&&e.createButton){f.button=d('<a href="#" class="dp-choose-date" title="'+d.dpText.TEXT_CHOOSE_DATE+'">'+d.dpText.TEXT_CHOOSE_DATE+"</a>").bind("click",function(){g.dpDisplay(this);this.blur();return false});g.after(f.button)}if(!i&&g.is(":text")){g.bind("dateSelected",function(k,j,l){this.value=j.asString()}).bind("change",function(){if(this.value==""){f.clearSelected()}else{var j=Date.fromString(this.value);if(j){f.setSelected(j,true,true)}}});if(e.clickInput){g.bind("click",function(){g.trigger("change");g.dpDisplay()})}var h=Date.fromString(this.value);if(this.value!=""&&h){f.setSelected(h,true,true)}}g.addClass("dp-applied")})},dpSetDisabled:function(e){return b.call(this,"setDisabled",e)},dpSetStartDate:function(e){return b.call(this,"setStartDate",e)},dpSetEndDate:function(e){return b.call(this,"setEndDate",e)},dpGetSelected:function(){var e=c(this[0]);if(e){return e.getSelected()}return null},dpSetSelected:function(i,g,f,h){if(g==undefined){g=true}if(f==undefined){f=true}if(h==undefined){h=true}return b.call(this,"setSelected",Date.fromString(i),g,f,h)},dpSetDisplayedMonth:function(e,f){return b.call(this,"setDisplayedMonth",Number(e),Number(f),true)},dpDisplay:function(f){return b.call(this,"display",f)},dpSetRenderCallback:function(e){return b.call(this,"setRenderCallback",e)},dpSetPosition:function(e,f){return b.call(this,"setPosition",e,f)},dpSetOffset:function(e,f){return b.call(this,"setOffset",e,f)},dpClose:function(){return b.call(this,"_closeCalendar",false,this[0])},dpRerenderCalendar:function(){return b.call(this,"_rerenderCalendar")},_dpDestroy:function(){}});var b=function(h,g,e,j,i){return this.each(function(){var f=c(this);if(f){f[h](g,e,j,i)}})};function a(e){this.ele=e;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.rememberViewedMonth=null;this.selectMultiple=null;this.numSelectable=null;this.numSelected=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context="#dp-popup";this.settings={}}d.extend(a.prototype,{init:function(e){this.setStartDate(e.startDate);this.setEndDate(e.endDate);this.setDisplayedMonth(Number(e.month),Number(e.year));this.setRenderCallback(e.renderCallback);this.showYearNavigation=e.showYearNavigation;this.closeOnSelect=e.closeOnSelect;this.displayClose=e.displayClose;this.rememberViewedMonth=e.rememberViewedMonth;this.selectMultiple=e.selectMultiple;this.numSelectable=e.selectMultiple?e.numSelectable:1;this.numSelected=0;this.verticalPosition=e.verticalPosition;this.horizontalPosition=e.horizontalPosition;this.hoverClass=e.hoverClass;this.setOffset(e.verticalOffset,e.horizontalOffset);this.inline=e.inline;this.settings=e;if(this.inline){this.context=this.ele;this.display()}},setStartDate:function(e){if(e){this.startDate=Date.fromString(e)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(e){if(e){this.endDate=Date.fromString(e)}if(!this.endDate){this.endDate=(new Date("12/31/2999"))}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setPosition:function(e,f){this.verticalPosition=e;this.horizontalPosition=f},setOffset:function(e,f){this.verticalOffset=parseInt(e)||0;this.horizontalOffset=parseInt(f)||0},setDisabled:function(e){$e=d(this.ele);$e[e?"addClass":"removeClass"]("dp-disabled");if(this.button){$but=d(this.button);$but[e?"addClass":"removeClass"]("dp-disabled");$but.attr("title",e?"":d.dpText.TEXT_CHOOSE_DATE)}if($e.is(":text")){$e.attr("disabled",e?"disabled":"")}},setDisplayedMonth:function(f,n,j){if(this.startDate==undefined||this.endDate==undefined){return}var i=new Date(this.startDate.getTime());i.setDate(1);var l=new Date(this.endDate.getTime());l.setDate(1);var h;if((!f&&!n)||(isNaN(f)&&isNaN(n))){h=new Date().zeroTime();h.setDate(1)}else{if(isNaN(f)){h=new Date(n,this.displayedMonth,1)}else{if(isNaN(n)){h=new Date(this.displayedYear,f,1)}else{h=new Date(n,f,1)}}}if(h.getTime()<i.getTime()){h=i}else{if(h.getTime()>l.getTime()){h=l}}var g=this.displayedMonth;var k=this.displayedYear;this.displayedMonth=h.getMonth();this.displayedYear=h.getFullYear();if(j&&(this.displayedMonth!=g||this.displayedYear!=k)){this._rerenderCalendar();d(this.ele).trigger("dpMonthChanged",[this.displayedMonth,this.displayedYear])}},setSelected:function(l,e,f,h){if(l<this.startDate||l>this.endDate){return}var g=this.settings;if(g.selectWeek){l=l.addDays(-(l.getDay()-Date.firstDayOfWeek+7)%7);if(l<this.startDate){return}}if(e==this.isSelected(l)){return}if(this.selectMultiple==false){this.clearSelected()}else{if(e&&this.numSelected==this.numSelectable){return}}if(f&&(this.displayedMonth!=l.getMonth()||this.displayedYear!=l.getFullYear())){this.setDisplayedMonth(l.getMonth(),l.getFullYear(),true)}this.selectedDates[l.asString()]=e;this.numSelected+=e?1:-1;var j="td."+(l.getMonth()==this.displayedMonth?"current-month":"other-month");var k;d(j,this.context).each(function(){if(d(this).data("datePickerDate")==l.asString()){k=d(this);if(g.selectWeek){k.parent()[e?"addClass":"removeClass"]("selectedWeek")}k[e?"addClass":"removeClass"]("selected")}});d("td",this.context).not(".selected")[this.selectMultiple&&this.numSelected==this.numSelectable?"addClass":"removeClass"]("unselectable");if(h){var g=this.isSelected(l);$e=d(this.ele);var i=Date.fromString(l.asString());$e.trigger("dateSelected",[i,k,g]);$e.trigger("change")}},isSelected:function(e){return this.selectedDates[e.asString()]},getSelected:function(){var e=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){e.push(Date.fromString(s))}}return e},clearSelected:function(){this.selectedDates={};this.numSelected=0;d("td.selected",this.context).removeClass("selected").parent().removeClass("selectedWeek")},display:function(e){if(d(this.ele).is(".dp-disabled")){return}e=e||this.ele;var m=this;var i=d(e);var l=i.offset();var n;var o;var g;var j;if(m.inline){n=d(this.ele);o={id:"calendar-"+this.ele._dpId,"class":"dp-popup dp-popup-inline"};d(".dp-popup",n).remove();j={}}else{n=d("body");o={id:"dp-popup","class":"dp-popup"};j={top:l.top+m.verticalOffset,left:l.left+m.horizontalOffset};var k=function(r){var p=r.target;var q=d("#dp-popup")[0];while(true){if(p==q){return true}else{if(p==document){m._closeCalendar();return false}else{p=d(p).parent()[0]}}}};this._checkMouse=k;m._closeCalendar(true);d(document).bind("keydown.datepicker",function(p){if(p.keyCode==27){m._closeCalendar()}})}if(!m.rememberViewedMonth){var h=this.getSelected()[0];if(h){h=new Date(h);this.setDisplayedMonth(h.getMonth(),h.getFullYear(),false)}}n.append(d("<div></div>").attr(o).css(j).append(d("<h2></h2>"),d('<div class="dp-nav-prev"></div>').append(d('<a class="dp-nav-prev-year" href="#" title="'+d.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,-1)}),d('<a class="dp-nav-prev-month" href="#" title="'+d.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,-1,0)})),d('<div class="dp-nav-next"></div>').append(d('<a class="dp-nav-next-year" href="#" title="'+d.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,1)}),d('<a class="dp-nav-next-month" href="#" title="'+d.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,1,0)})),d('<div class="dp-calendar"></div>')).bgIframe());var f=this.inline?d(".dp-popup",this.context):d("#dp-popup");if(this.showYearNavigation==false){d(".dp-nav-prev-year, .dp-nav-next-year",m.context).css("display","none")}if(this.displayClose){f.append(d('<a href="#" id="dp-close">'+d.dpText.TEXT_CLOSE+"</a>").bind("click",function(){m._closeCalendar();return false}))}m._renderCalendar();d(this.ele).trigger("dpDisplayed",f);if(!m.inline){if(this.verticalPosition==d.dpConst.POS_BOTTOM){f.css("top",l.top+i.height()-f.height()+m.verticalOffset)}if(this.horizontalPosition==d.dpConst.POS_RIGHT){f.css("left",l.left+i.width()-f.width()+m.horizontalOffset)}d(document).bind("mousedown.datepicker",this._checkMouse)}},setRenderCallback:function(e){if(e==null){return}if(e&&typeof(e)=="function"){e=[e]}this.renderCallback=this.renderCallback.concat(e)},cellRender:function(i,e,g,f){var j=this.dpController;var h=new Date(e.getTime());i.bind("click",function(){var k=d(this);if(!k.is(".disabled")){j.setSelected(h,!k.is(".selected")||!j.selectMultiple,false,true);if(j.closeOnSelect){j._closeCalendar()}if(!d.browser.msie){d(j.ele).trigger("focus",[d.dpConst.DP_INTERNAL_FOCUS])}}});if(j.isSelected(h)){i.addClass("selected");if(j.settings.selectWeek){i.parent().addClass("selectedWeek")}}else{if(j.selectMultiple&&j.numSelected==j.numSelectable){i.addClass("unselectable")}}},_applyRenderCallbacks:function(){var e=this;d("td",this.context).each(function(){for(var f=0;f<e.renderCallback.length;f++){$td=d(this);e.renderCallback[f].apply(this,[$td,Date.fromString($td.data("datePickerDate")),e.displayedMonth,e.displayedYear])}});return},_displayNewMonth:function(f,e,g){if(!d(f).is(".disabled")){this.setDisplayedMonth(this.displayedMonth+e,this.displayedYear+g,true)}f.blur();return false},_rerenderCalendar:function(){this._clearCalendar();this._renderCalendar()},_renderCalendar:function(){d("h2",this.context).html((new Date(this.displayedYear,this.displayedMonth,1)).asString(d.dpText.HEADER_FORMAT));d(".dp-calendar",this.context).renderCalendar(d.extend({},this.settings,{month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass}));if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){d(".dp-nav-prev-year",this.context).addClass("disabled");d(".dp-nav-prev-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Number(i.text())>20){i.addClass("disabled")}});var h=this.startDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var i=d(this);if(Number(i.text())<h){i.addClass("disabled")}})}else{d(".dp-nav-prev-year",this.context).removeClass("disabled");d(".dp-nav-prev-month",this.context).removeClass("disabled");var h=this.startDate.getDate();if(h>20){var f=this.startDate.getTime();var g=new Date(f);g.addMonths(1);if(this.displayedYear==g.getFullYear()&&this.displayedMonth==g.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Date.fromString(i.data("datePickerDate")).getTime()<f){i.addClass("disabled")}})}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){d(".dp-nav-next-year",this.context).addClass("disabled");d(".dp-nav-next-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var i=d(this);if(Number(i.text())<14){i.addClass("disabled")}});var h=this.endDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var i=d(this);if(Number(i.text())>h){i.addClass("disabled")}})}else{d(".dp-nav-next-year",this.context).removeClass("disabled");d(".dp-nav-next-month",this.context).removeClass("disabled");var h=this.endDate.getDate();if(h<13){var e=new Date(this.endDate.getTime());e.addMonths(-1);if(this.displayedYear==e.getFullYear()&&this.displayedMonth==e.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var j=d(this);var i=Number(j.text());if(i<13&&i>h){j.addClass("disabled")}})}}}this._applyRenderCallbacks()},_closeCalendar:function(e,f){if(!f||f==this.ele){d(document).unbind("mousedown.datepicker");d(document).unbind("keydown.datepicker");this._clearCalendar();d("#dp-popup a").unbind();d("#dp-popup").empty().remove();if(!e){d(this.ele).trigger("dpClosed",[this.getSelected()])}}},_clearCalendar:function(){d(".dp-calendar td",this.context).unbind();d(".dp-calendar",this.context).empty()}});d.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1,DP_INTERNAL_FOCUS:"dpInternalFocusTrigger"};d.dpText={TEXT_PREV_YEAR:"Previous year",TEXT_PREV_MONTH:"Previous month",TEXT_NEXT_YEAR:"Next year",TEXT_NEXT_MONTH:"Next month",TEXT_CLOSE:"Close",TEXT_CHOOSE_DATE:"Choose date",HEADER_FORMAT:"mmmm yyyy"};d.dpVersion="$Id: jquery.datePicker.js 94 2010-01-25 02:25:27Z kelvin.luck $";d.fn.datePicker.defaults={month:undefined,year:undefined,showHeader:d.dpConst.SHOW_HEADER_SHORT,startDate:undefined,endDate:undefined,inline:false,renderCallback:null,createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,numSelectable:Number.MAX_VALUE,clickInput:false,rememberViewedMonth:true,selectWeek:false,verticalPosition:d.dpConst.POS_TOP,horizontalPosition:d.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:"dp-hover"};function c(e){if(e._dpId){return d.event._dpCache[e._dpId]}return false}if(d.fn.bgIframe==undefined){d.fn.bgIframe=function(){return this}}d(window).bind("unload",function(){var f=d.event._dpCache||[];for(var e in f){d(f[e].ele)._dpDestroy()}})})(jQuery);﻿jQuery.cookie = function (key, value, options) {

    // key and value given, set cookie...
    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
        options = jQuery.extend({}, options);

        if (value === null) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? String(value) : encodeURIComponent(String(value)),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
;﻿(function($) {
    $.fn.jqm = function(o) { var p = { overlay: 50, overlayClass: 'jqmOverlay', closeClass: 'jqmClose', trigger: '.jqModal', ajax: F, ajaxText: '', target: F, modal: F, toTop: F, onShow: F, onHide: F, onLoad: F }; return this.each(function() { if (this._jqm) return H[this._jqm].c = $.extend({}, H[this._jqm].c, o); s++; this._jqm = s; H[s] = { c: $.extend(p, $.jqm.params, o), a: F, w: $(this).addClass('jqmID' + s), s: s }; if (p.trigger) $(this).jqmAddTrigger(p.trigger); }); }; $.fn.jqmAddClose = function(e) { return hs(this, e, 'jqmHide'); }; $.fn.jqmAddTrigger = function(e) { return hs(this, e, 'jqmShow'); }; $.fn.jqmShow = function(t) { return this.each(function() { t = t || window.event; $.jqm.open(this._jqm, t); }); }; $.fn.jqmHide = function(t) { return this.each(function() { t = t || window.event; $.jqm.close(this._jqm, t) }); }; $.jqm = { hash: {}, open: function(s, t) {
        var h = H[s], c = h.c, cc = '.' + c.closeClass, z = (parseInt(h.w.css('z-index'))), z = (z > 0) ? z : 3000, o = $('<div></div>').css({ height: '100%', width: '100%', position: 'fixed', left: 0, top: 0, 'z-index': z - 1, opacity: c.overlay / 100 }); if (h.a) return F; h.t = t; h.a = true; h.w.css('z-index', z); if (c.modal) { if (!A[0]) L('bind'); A.push(s); }
        else if (c.overlay > 0) h.w.jqmAddClose(o); else o = F; h.o = (o) ? o.addClass(c.overlayClass).prependTo('body') : F; if (ie6) { $('html,body').css({ height: '100%', width: '100%' }); if (o) { o = o.css({ position: 'absolute' })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'"); } }
        if (c.ajax) { var r = c.target || h.w, u = c.ajax, r = (typeof r == 'string') ? $(r, h.w) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u; r.html(c.ajaxText).load(u, function() { if (c.onLoad) c.onLoad.call(this, h); if (cc) h.w.jqmAddClose($(cc, h.w)); e(h); }); }
        else if (cc) h.w.jqmAddClose($(cc, h.w)); if (c.toTop && h.o) h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o); (c.onShow) ? c.onShow(h) : h.w.show(); e(h); return F;
    }, close: function(s) {
        var h = H[s]; if (!h.a) return F; h.a = F; if (A[0]) { A.pop(); if (!A[0]) L('unbind'); }
        if (h.c.toTop && h.o) $('#jqmP' + h.w[0]._jqm).after(h.w).remove(); if (h.c.onHide) h.c.onHide(h); else { h.w.hide(); if (h.o) h.o.remove(); } return F;
    }, params: {}
    }; var s = 0, H = $.jqm.hash, A = [], ie6 = $.browser.msie && ($.browser.version == "6.0"), F = false, i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({ opacity: 0 }), e = function(h) { if (ie6) if (h.o) h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0]) h.w.prepend(i); f(h); }, f = function(h) { try { $(':input:visible', h.w)[0].focus(); } catch (_) { } }, L = function(t) { $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m); }, m = function(e) { var h = H[A[A.length - 1]], r = (!$(e.target).parents('.jqmID' + h.s)[0]); if (r) f(h); return !r; }, hs = function(w, t, c) { return w.each(function() { var s = this._jqm; $(t).each(function() { if (!this[c]) { this[c] = []; $(this).click(function() { for (var i in { jqmShow: 1, jqmHide: 1 }) for (var s in this[i]) if (H[this[i][s]]) H[this[i][s]].w[i](this); return F; }); } this[c].push(s); }); }); };
})(jQuery);var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf?cache="+Math.round(Math.random()*1000000),"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":a.objAttrs[b[c]]=b[c+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a};var Utility={OnFailed:function(b){var a=b.get_stackTrace();var f=b.get_message();var d=b.get_statusCode();var e=b.get_exceptionType();var c=b.get_timedOut();var g="Stack Trace: "+a+"<br/>Service Error: "+f+"<br/>Status Code: "+d+"<br/>Exception Type: "+e+"<br/>Timedout: "+c;alert(g)},decodeLine:function(c){var e=c.length;var d=0;var g=[];var j=0;var k=0;try{while(d<e){var l;var a=0;var m=0;do{l=c.charCodeAt(d++)-63;m|=(l&31)<<a;a+=5}while(l>=32);var f=((m&1)?~(m>>1):(m>>1));j+=f;a=0;m=0;do{l=c.charCodeAt(d++)-63;m|=(l&31)<<a;a+=5}while(l>=32);var i=((m&1)?~(m>>1):(m>>1));k+=i;g.push(new VELatLong((j*0.00001),(k*0.00001)))}}catch(h){}return g},createEncodings:function(k){var b=0;var d=0;var e=0;var c="";for(b=0;b<k.length;++b){var h=k[b];var f=h.Latitude;var g=h.Longitude;var a=Math.floor(f*100000);var j=Math.floor(g*100000);dlat=a-d;dlng=j-e;d=a;e=j;c+=this._encodeSignedNumber(dlat)+this._encodeSignedNumber(dlng)}return c},_encodeSignedNumber:function(a){var b=a<<1;if(a<0){b=~(b)}return(this._encodeNumber(b))},_encodeNumber:function(b){var a="";while(b>=32){a+=(String.fromCharCode((32|(b&31))+63));b>>=5}a+=(String.fromCharCode(b+63));return a}};if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
if(typeof(MQA)=='undefined'){MQA=new Object();}
if(typeof(MQA.Common)=='undefined'){MQA.Common=new Object();}
MQA.createXMLDoc=function(strXML){var newDoc;if(document.implementation.createDocument){var parser=new window.DOMParser();if(MQA.BrowserInfo.isSafari)
strXML=strXML.replace(/&/g,'&amp;');newDoc=parser.parseFromString(strXML,"text/xml");}else if(window.ActiveXObject){newDoc=new window.ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(strXML);}
return newDoc;};mqCreateXMLDoc=MQA.createXMLDoc;MQA.createXMLDocFromNode=function(ndNewRoot){var newDoc;ndNewRoot=ndNewRoot.documentElement;if(document.implementation.createDocument){var newDoc=document.implementation.createDocument("","",null);try{newDoc.appendChild(newDoc.importNode(ndNewRoot,true))}catch(error){alert(error);alert(ndNewRoot.nodeName);};}else if(window.ActiveXObject){newDoc=new ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(ndNewRoot.xml);}
return newDoc;};mqCreateXMLDocFromNode=MQA.createXMLDocFromNode;MQA.Browser=function(){this.name=null;this.version=null;this.os=null;this.appname=null;this.appVersion=null;this.vMajor=null;this.isNS=null;this.isNS4=null;this.isNS6=null;this.isIE=null;this.isIE4=null;this.isIE5=null;this.isDOM=null;this.isSafari=null;this.platform=null;}
MQBrowser=MQA.Browser;MQA.getBrowserInfo=function()
{var browser=new MQA.Browser();browser.name=browser.version=browser.os="unknown";var userAgent=window.navigator.userAgent.toLowerCase();var appname=window.navigator.appName;var appVersion=window.navigator.appVersion;var browserListArray=new Array("firefox","msie","netscape","opera","safari");var osListArray=new Array("linux","mac","windows","x11");var browserListlength=browserListArray.length;var strPosition="";for(var i=0,n=browserListlength;i<n;i++)
{strPosition=userAgent.indexOf(browserListArray[i])+1;if(strPosition>0)
{browser.name=browserListArray[i];var versionPosition=strPosition+browser.name.length;var incr=((browser.name=="safari")||(userAgent.charAt(versionPosition+4)>0&&userAgent.charAt(versionPosition+4)<9))?5:3;browser.version=userAgent.substring(versionPosition,versionPosition+incr);}}
var osListArrayLength=osListArray.length;for(var j=0,m=osListArrayLength;j<m;j++)
{strPosition=userAgent.indexOf(osListArray[j])+1;if(strPosition>0)
{browser.os=osListArray[j];}}
if(appname=="Netscape")
browser.appname="ns";else if(appname=="Microsoft Internet Explorer")
browser.appname="ie";browser.appVersion=appVersion;browser.vMajor=parseInt(browser.appVersion);browser.isNS=(browser.appname=="ns"&&browser.vMajor>=4);browser.isNS4=(browser.appname=="ns"&&browser.vMajor==4);browser.isNS6=(browser.appname=="ns"&&browser.vMajor==5);browser.isIE=(browser.appname=="ie"&&browser.vMajor>=4);browser.isIE4=(browser.appVersion.indexOf('MSIE 4')>0);browser.isIE5=(browser.appVersion.indexOf('MSIE 5')>0);browser.isDOM=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;browser.isSafari=(browser.name=="safari");if(userAgent.indexOf("win")>-1)
browser.platform="win";else if(userAgent.indexOf("mac")>-1)
browser.platform="mac";else
browser.platform="other";return browser;}
mqGetBrowserInfo=MQA.getBrowserInfo;MQA.BrowserInfo=MQA.getBrowserInfo();MQA.Object=function(){var m_xmlDoc=null;this.getM_XmlDoc=function(){return m_xmlDoc;};this.setM_XmlDoc=function(xmlDoc){m_xmlDoc=xmlDoc;};var m_xpath=null;this.getM_Xpath=function(){return m_xpath;};this.setM_Xpath=function(xpath){m_xpath=xpath;};};MQA.Object.prototype.getClassName=function(){return"MQObject";};MQA.Object.prototype.getObjectVersion=function(){return 0;};MQA.Object.prototype.setProperty=function(strPropName,strPropValue){var strXPathExpression;if(strPropName!==null)strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;else strXPathExpression="/"+this.getM_Xpath();var ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);if(ndNewProp===null){var ndNewPropParent=this.getM_XmlDoc().createElement(strPropName);var ndRoot=this.getM_XmlDoc().documentElement.appendChild(ndNewPropParent);ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);}
return ndNewProp;};MQA.Object.prototype.getProperty=function(strPropName){var strXPathExpression;if(strPropName!==null)strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;else strXPathExpression="/"+this.getM_Xpath();return mqGetXPathNodeText(this.getM_XmlDoc(),strXPathExpression);};MQA.Object.prototype.copy=function(){var cp=new this.constructor;cp.loadXml(this.saveXml());return cp;};MQA.Object.prototype.internalCopy=function(obj){var strXml="<"+obj.getM_Xpath();if(this.getObjectVersion()>0){strXml=strXml+" Version=\""+this.getObjectVersion()+"\"";}
strXml=strXml+">";var root=this.getM_XmlDoc().documentElement;var nodes=root.childNodes;var maxCount=nodes.length;for(var count=0;count<maxCount;count++){strXml=strXml+mqXmlToStr(nodes[count]);}
strXml=strXml+"</"+obj.getM_Xpath()+">";var cp=new this.constructor;cp.loadXml(strXml);return cp;};MQObject=MQA.Object;MQA.Point=function(param1,param2){this.x=0;this.y=0;this.setM_Xpath("Point");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.x=parseInt(param1);this.y=parseInt(param2);if(isNaN(this.x)||isNaN(this.y))
{throw new Error("1MQPoint constructor called with invalid parameter");}}
else if(arguments.length>2){throw new Error("MQPoint constructor called with "
+arguments.length
+" arguments, but it expects 0, 1, or 2 arguments");}}
MQA.Point.prototype=new MQA.Object();MQA.Point.prototype.constructor=MQA.Point;MQA.Point.prototype.getClassName=function(){return"MQPoint";};MQA.Point.prototype.getObjectVersion=function(){return 0;};MQA.Point.prototype.loadXml=function(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(MQA.createXMLDoc(strXml));this.x=this.getProperty("X");this.y=this.getProperty("Y");}};MQA.Point.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><X>"+this.x+"</X><Y>"+this.y+"</Y></"+this.getM_Xpath()+">";};MQA.Point.prototype.setX=function(x){this.x=parseInt(x);if(isNaN(this.x))
throw new Error("MQPoint.setX called with invalid parameter");};MQA.Point.prototype.getX=function(){return this.x;};MQA.Point.prototype.setY=function(y){this.y=parseInt(y);if(isNaN(this.y))
throw new Error("MQPoint.setY called with invalid parameter");};MQA.Point.prototype.getY=function(){return this.y;};MQA.Point.prototype.setXY=function(x,y){this.x=parseInt(x);this.y=parseInt(y);if(isNaN(this.x)||isNaN(this.y))
throw new Error("MQPoint.setXY called with invalid parameter");};MQA.Point.prototype.valid=function(){if("undefined"!==typeof(mqutils)){return(Math.abs(this.x!=MQCONSTANT.MQPOINT_INVALID)&&Math.abs(this.y!=MQCONSTANT.MQPOINT_INVALID));}
return false;};MQA.Point.prototype.equals=function(pt){if(pt){return(this.x===pt.x&&this.y===pt.y);}
return false;};MQA.Point.prototype.toString=function(){return this.x+","+this.y;};MQPoint=MQA.Point;MQA.LatLng=function(param1,param2){MQA.Object.call(this);this.lat=0.0;this.lng=0.0;this.setM_Xpath("LatLng");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.lat=parseFloat(param1);this.lng=parseFloat(param2);if(isNaN(this.lat)||isNaN(this.lng))
throw new Error("MQA.LatLng constructor called with invalid parameter");}
else if(arguments.length>2){throw new Error("MQA.LatLng constructor called with "
+arguments.length
+" arguments, but it expects 0, 1, or 2 arguments.");}}
MQA.LatLng.prototype=new MQA.Object();MQA.LatLng.prototype.constructor=MQA.LatLng;MQA.LatLng.prototype.getClassName=function(){return"MQLatLng";};MQA.LatLng.prototype.getObjectVersion=function(){return 0;};MQA.LatLng.prototype.loadXml=function(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(MQA.createXMLDoc(strXml));this.lat=this.getProperty("Lat");this.lng=this.getProperty("Lng");}};MQA.LatLng.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><Lat>"+this.lat+"</Lat><Lng>"+this.lng+"</Lng></"+this.getM_Xpath()+">";};MQA.LatLng.prototype.setLatitude=function(fLatitude){this.lat=parseFloat(fLatitude);if(isNaN(this.lat))
throw new Error("MQA.LatLng.setLatitude called with invalid parameter");};MQA.LatLng.prototype.getLatitude=function(){return this.lat;};MQA.LatLng.prototype.setLongitude=function(fLongitude){this.lng=parseFloat(fLongitude);if(isNaN(this.lng))
throw new Error("MQA.LatLng.setLongitude called with invalid parameter");};MQA.LatLng.prototype.getLongitude=function(){return this.lng;};MQA.LatLng.prototype.setLatLng=function(fLatitude,fLongitude){this.lat=parseFloat(fLatitude);this.lng=parseFloat(fLongitude);if(isNaN(this.lat)||isNaN(this.lng))
throw new Error("MQA.LatLng.setLatLng called with invalid parameter");};MQA.LatLng.prototype.arcDistance=function(ll2,lUnits){if("undefined"!==typeof(mqutils)){if(ll2){if(ll2.getClassName()!=="MQLatLng"){alert("failure in arcDistance");throw"failure in arcDistance";}}else{alert("failure in arcDistance");throw"failure in arcDistance";}
if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(this.getLatitude()==ll2.getLatitude()&&this.getLongitude()==ll2.getLongitude()){return 0.0;}
var dLon=ll2.getLongitude()-this.getLongitude();var a=MQCONSTANT.MQLATLNG_RADIANS*(90.0-this.getLatitude());var c=MQCONSTANT.MQLATLNG_RADIANS*(90.0-ll2.getLatitude());var cosB=(Math.cos(a)*Math.cos(c))+(Math.sin(a)*Math.sin(c)*Math.cos(MQCONSTANT.MQLATLNG_RADIANS*(dLon)));var radius=(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_MILES)?3963.205:6378.160187;if(cosB<-1.0)
return MQCONSTANT.PI*radius;else if(cosB>=1.0)
return 0;else
return Math.acos(cosB)*radius;}
return-1;};MQA.LatLng.prototype.valid=function(){if("undefined"!==typeof(mqutils)){return(Math.abs(this.getLatitude()-MQCONSTANT.MQLATLNG_INVALID)>MQCONSTANT.MQLATLNG_TOLERANCE&&Math.abs(this.getLongitude()-MQCONSTANT.MQLATLNG_INVALID)>MQCONSTANT.MQLATLNG_TOLERANCE);}
return false;};MQA.LatLng.prototype.equals=function(ll){if(ll!==null){return(this.getLongitude()===ll.getLongitude()&&this.getLatitude()===ll.getLatitude());}
return false;};MQA.LatLng.prototype.toString=function(){return this.lat+","+this.lng;};MQLatLng=MQA.LatLng;MQA.XMLDOC=function(){this.AUTOGEOCODECOVSWITCH=null;this.AUTOROUTECOVSWITCH=null;this.AUTOMAPCOVSWITCH=null;this.DBLAYERQUERY=null;this.LINEPRIMITIVE=null;this.POLYGONPRIMITIVE=null;this.RECTANGLEPRIMITIVE=null;this.ELLIPSEPRIMITIVE=null;this.TEXTPRIMITIVE=null;this.SYMBOLPRIMITIVE=null;this.LATLNG=null;this.POINT=null;this.POINTFEATURE=null;this.LINEFEATURE=null;this.POLYGONFEATURE=null;this.LOCATION=null;this.ADDRESS=null;this.SINGLELINEADDRESS=null;this.GEOADDRESS=null;this.GEOCODEOPTIONS=null;this.MANEUVER=null;this.ROUTEOPTIONS=null;this.ROUTERESULTS=null;this.ROUTEMATRIXRESULTS=null;this.RADIUSSEARCHCRITERIA=null;this.RECTSEARCHCRITERIA=null;this.POLYSEARCHCRITERIA=null;this.CORRIDORSEARCHCRITERIA=null;this.SIGN=null;this.TREKROUTE=null;this.INTCOLLECTION=null;this.DTCOLLECTION=null;this.LATLNGCOLLECTION=null;this.LOCATIONCOLLECTION=null;this.LOCATIONCOLLECTIONCOLLECTION=null;this.MANEUVERCOLLECTION=null;this.SIGNCOLLECTION=null;this.STRINGCOLLECTION=null;this.STRCOLCOLLECTION=null;this.FEATURECOLLECTION=null;this.PRIMITIVECOLLECTION=null;this.POINTCOLLECTION=null;this.TREKROUTECOLLECTION=null;this.FEATURESPECIFIERCOLLECTION=null;this.GEOCODEOPTIONSCOLLECTION=null;this.COVERAGESTYLE=null;this.RECORDSET=null;this.MAPSTATE=null;this.SESSION=null;this.SESSIONID=null;this.DTSTYLE=null;this.DTSTYLEEX=null;this.DTFEATURESTYLEEX=null;this.FEATURESPECIFIER=null;this.BESTFIT=null;this.BESTFITLL=null;this.CENTER=null;this.CENTERLATLNG=null;this.PAN=null;this.ZOOMIN=null;this.ZOOMOUT=null;this.ZOOMTO=null;this.ZOOMTORECT=null;this.ZOOMTORECTLATLNG=null;this.getAUTOGEOCODECOVSWITCH=function(){if(this.AUTOGEOCODECOVSWITCH===null)
this.AUTOGEOCODECOVSWITCH=MQA.createXMLDoc("<AutoGeocodeCovSwitch/>");return this.AUTOGEOCODECOVSWITCH;}
this.getAUTOROUTECOVSWITCH=function(){if(this.AUTOROUTECOVSWITCH===null)
this.AUTOROUTECOVSWITCH=MQA.createXMLDoc("<AutoRouteCovSwitch><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></AutoRouteCovSwitch>");return this.AUTOROUTECOVSWITCH;}
this.getAUTOMAPCOVSWITCH=function(){if(this.AUTOMAPCOVSWITCH===null)
this.AUTOMAPCOVSWITCH=MQA.createXMLDoc("<AutoMapCovSwitch><Name/><Style/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/><ZoomLevels Count=\"14\"><Item>6000</Item><Item>12000</Item><Item>24000</Item><Item>48000</Item><Item>96000</Item><Item>192000</Item><Item>400000</Item><Item>800000</Item><Item>1600000</Item><Item>3000000</Item><Item>6000000</Item><Item>12000000</Item><Item>24000000</Item><Item>48000000</Item></ZoomLevels></AutoMapCovSwitch>");return this.AUTOMAPCOVSWITCH;}
this.getDBLAYERQUERY=function(){if(this.DBLAYERQUERY===null)
this.DBLAYERQUERY=MQA.createXMLDoc("<DBLayerQuery/>");return this.DBLAYERQUERY;}
this.getLINEPRIMITIVE=function(){if(this.LINEPRIMITIVE===null)
this.LINEPRIMITIVE=MQA.createXMLDoc("<LinePrimitive Version=\"2\"/>");return this.LINEPRIMITIVE;}
this.getPOLYGONPRIMITIVE=function(){if(this.POLYGONPRIMITIVE===null)
this.POLYGONPRIMITIVE=MQA.createXMLDoc("<PolygonPrimitive Version=\"2\"/>");return this.POLYGONPRIMITIVE;}
this.getRECTANGLEPRIMITIVE=function(){if(this.RECTANGLEPRIMITIVE===null)
this.RECTANGLEPRIMITIVE=MQA.createXMLDoc("<RectanglePrimitive Version=\"2\"/>");return this.RECTANGLEPRIMITIVE;}
this.getELLIPSEPRIMITIVE=function(){if(this.ELLIPSEPRIMITIVE===null)
this.ELLIPSEPRIMITIVE=MQA.createXMLDoc("<EllipsePrimitive Version=\"2\"/>");return this.ELLIPSEPRIMITIVE;}
this.getTEXTPRIMITIVE=function(){if(this.TEXTPRIMITIVE===null)
this.TEXTPRIMITIVE=MQA.createXMLDoc("<TextPrimitive Version=\"2\"/>");return this.TEXTPRIMITIVE;}
this.getSYMBOLPRIMITIVE=function(){if(this.SYMBOLPRIMITIVE===null)
this.SYMBOLPRIMITIVE=MQA.createXMLDoc("<SymbolPrimitive Version=\"2\"/>");return this.SYMBOLPRIMITIVE;}
this.getLATLNG=function(){if(this.LATLNG===null)
this.LATLNG=MQA.createXMLDoc("<LatLng/>");return this.LATLNG;}
this.getPOINT=function(){if(this.POINT===null)
this.POINT=MQA.createXMLDoc("<Point/>");return this.POINT;}
this.getPOINTFEATURE=function(){if(this.POINTFEATURE===null)
this.POINTFEATURE=MQA.createXMLDoc("<PointFeature/>");return this.POINTFEATURE;}
this.getLINEFEATURE=function(){if(this.LINEFEATURE===null)
this.LINEFEATURE=MQA.createXMLDoc("<LineFeature/>");return this.LINEFEATURE;}
this.getPOLYGONFEATURE=function(){if(this.POLYGONFEATURE===null)
this.POLYGONFEATURE=MQA.createXMLDoc("<PolygonFeature/>");return this.POLYGONFEATURE;}
this.getLOCATION=function(){if(this.LOCATION===null)
this.LOCATION=MQA.createXMLDoc("<Location/>");return this.LOCATION;}
this.getADDRESS=function(){if(this.ADDRESS===null)
this.ADDRESS=MQA.createXMLDoc("<Address/>");return this.ADDRESS;}
this.getSINGLELINEADDRESS=function(){if(this.SINGLELINEADDRESS===null)
this.SINGLELINEADDRESS=MQA.createXMLDoc("<SingleLineAddress/>");return this.SINGLELINEADDRESS;}
this.getGEOADDRESS=function(){if(this.GEOADDRESS===null)
this.GEOADDRESS=MQA.createXMLDoc("<GeoAddress/>");return this.GEOADDRESS;}
this.getGEOCODEOPTIONS=function(){if(this.GEOCODEOPTIONS===null)
this.GEOCODEOPTIONS=MQA.createXMLDoc("<GeocodeOptions/>");return this.GEOCODEOPTIONS;}
this.getMANEUVER=function(){if(this.MANEUVER===null)
this.MANEUVER=MQA.createXMLDoc("<Maneuver Version=\"1\"><Narrative/><Streets Count=\"0\"/><TurnType>-1</TurnType><Distance>0.0</Distance><Time>-1</Time><Direction>0</Direction><ShapePoints Count=\"0\"/><GEFIDs Count=\"0\"/><Signs  Count=\"0\"/></Maneuver>");return this.MANEUVER;}
this.getROUTEOPTIONS=function(){if(this.ROUTEOPTIONS===null)
this.ROUTEOPTIONS=MQA.createXMLDoc("<RouteOptions Version=\"3\"><RouteType>0</RouteType><NarrativeType>1</NarrativeType><NarrativeDistanceUnitType>0</NarrativeDistanceUnitType><MaxShape>0</MaxShape><MaxGEFID>0</MaxGEFID><Language>English</Language><CoverageName></CoverageName><CovSwitcher><Name></Name><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></CovSwitcher><AvoidAttributeList Count=\"0\"/><AvoidGefIdList Count=\"0\"/><AvoidAbsoluteGefIdList Count=\"0\"/><StateBoundaryDisplay>1</StateBoundaryDisplay><CountryBoundaryDisplay>1</CountryBoundaryDisplay></RouteOptions>");return this.ROUTEOPTIONS;}
this.getROUTERESULTS=function(){if(this.ROUTERESULTS===null)
this.ROUTERESULTS=MQA.createXMLDoc("<RouteResults Version=\"1\"><Locations Count=\"0\"/><CoverageName/><ResultMessages Count=\"0\"/><TrekRoutes Count=\"0\"/></RouteResults>");return this.ROUTERESULTS;}
this.getROUTEMATRIXRESULTS=function(){if(this.ROUTEMATRIXRESULTS===null)
this.ROUTEMATRIXRESULTS=MQA.createXMLDoc("<RouteMatrixResults/>");return this.ROUTEMATRIXRESULTS;}
this.getRADIUSSEARCHCRITERIA=function(){if(this.RADIUSSEARCHCRITERIA===null)
this.RADIUSSEARCHCRITERIA=MQA.createXMLDoc("<RadiusSearchCriteria/>");return this.RADIUSSEARCHCRITERIA;}
this.getRECTSEARCHCRITERIA=function(){if(this.RECTSEARCHCRITERIA===null)
this.RECTSEARCHCRITERIA=MQA.createXMLDoc("<RectSearchCriteria/>");return this.RECTSEARCHCRITERIA;}
this.getPOLYSEARCHCRITERIA=function(){if(this.POLYSEARCHCRITERIA===null)
this.POLYSEARCHCRITERIA=MQA.createXMLDoc("<PolySearchCriteria/>");return this.POLYSEARCHCRITERIA;}
this.getCORRIDORSEARCHCRITERIA=function(){if(this.CORRIDORSEARCHCRITERIA===null)
this.CORRIDORSEARCHCRITERIA=MQA.createXMLDoc("<CorridorSearchCriteria/>");return this.CORRIDORSEARCHCRITERIA;}
this.getSIGN=function(){if(this.SIGN===null)
this.SIGN=MQA.createXMLDoc("<Sign><Type>0</Type><Text></Text><ExtraText></ExtraText><Direction>0</Direction></Sign>");return this.SIGN;}
this.getTREKROUTE=function(){if(this.TREKROUTE===null)
this.TREKROUTE=MQA.createXMLDoc("<TrekRoute><Maneuvers Count=\"0\"/></TrekRoute>");return this.TREKROUTE;}
this.getINTCOLLECTION=function(){if(this.INTCOLLECTION===null)
this.INTCOLLECTION=MQA.createXMLDoc("<IntCollection Count=\"0\"/>");return this.INTCOLLECTION;}
this.getDTCOLLECTION=function(){if(this.DTCOLLECTION===null)
this.DTCOLLECTION=MQA.createXMLDoc("<DTCollection Version=\"1\" Count=\"0\"/>");return this.DTCOLLECTION;}
this.getLATLNGCOLLECTION=function(){if(this.LATLNGCOLLECTION===null)
this.LATLNGCOLLECTION=MQA.createXMLDoc("<LatLngCollection Version=\"1\" Count=\"0\"/>");return this.LATLNGCOLLECTION;}
this.getLOCATIONCOLLECTION=function(){if(this.LOCATIONCOLLECTION===null)
this.LOCATIONCOLLECTION=MQA.createXMLDoc("<LocationCollection Count=\"0\"/>");return this.LOCATIONCOLLECTION;}
this.getLOCATIONCOLLECTIONCOLLECTION=function(){if(this.LOCATIONCOLLECTIONCOLLECTION===null)
this.LOCATIONCOLLECTIONCOLLECTION=MQA.createXMLDoc("<LocationCollectionCollection Count=\"0\"/>");return this.LOCATIONCOLLECTIONCOLLECTION;}
this.getMANEUVERCOLLECTION=function(){if(this.MANEUVERCOLLECTION===null)
this.MANEUVERCOLLECTION=MQA.createXMLDoc("<ManeuverCollection Count=\"0\"/>");return this.MANEUVERCOLLECTION;}
this.getSIGNCOLLECTION=function(){if(this.SIGNCOLLECTION===null)
this.SIGNCOLLECTION=MQA.createXMLDoc("<SignCollection Count=\"0\"/>");return this.SIGNCOLLECTION;}
this.getSTRINGCOLLECTION=function(){if(this.STRINGCOLLECTION===null)
this.STRINGCOLLECTION=MQA.createXMLDoc("<StringCollection Count=\"0\"/>");return this.STRINGCOLLECTION;}
this.getSTRCOLCOLLECTION=function(){if(this.STRCOLCOLLECTION===null)
this.STRCOLCOLLECTION=MQA.createXMLDoc("<StrColCollectin/>");return this.STRCOLCOLLECTION;}
this.getFEATURECOLLECTION=function(){if(this.FEATURECOLLECTION===null)
this.FEATURECOLLECTION=MQA.createXMLDoc("<FeatureCollection Count=\"0\"/>");return this.FEATURECOLLECTION;}
this.getPRIMITIVECOLLECTION=function(){if(this.PRIMITIVECOLLECTION===null)
this.PRIMITIVECOLLECTION=MQA.createXMLDoc("<PrimitiveCollection Count=\"0\"/>");return this.PRIMITIVECOLLECTION;}
this.getPOINTCOLLECTION=function(){if(this.POINTCOLLECTION===null)
this.POINTCOLLECTION=MQA.createXMLDoc("<PointCollection Count=\"0\"/>");return this.POINTCOLLECTION;}
this.getTREKROUTECOLLECTION=function(){if(this.TREKROUTECOLLECTION===null)
this.TREKROUTECOLLECTION=MQA.createXMLDoc("<TrekRouteCollection Count=\"0\"/>");return this.TREKROUTECOLLECTION;}
this.getFEATURESPECIFIERCOLLECTION=function(){if(this.FEATURESPECIFIERCOLLECTION===null)
this.FEATURESPECIFIERCOLLECTION=MQA.createXMLDoc("<FeatureSpecifierCollection Count=\"0\"/>");return this.FEATURESPECIFIERCOLLECTION;}
this.getGEOCODEOPTIONSCOLLECTION=function(){if(this.GEOCODEOPTIONSCOLLECTION===null)
this.GEOCODEOPTIONSCOLLECTION=MQA.createXMLDoc("<GeocodeOptionsCollection Count=\"0\"/>");return this.GEOCODEOPTIONSCOLLECTION;}
this.getCOVERAGESTYLE=function(){if(this.COVERAGESTYLE===null)
this.COVERAGESTYLE=MQA.createXMLDoc("<CoverageStyle/>");return this.COVERAGESTYLE;}
this.getRECORDSET=function(){if(this.RECORDSET===null)
this.RECORDSET=MQA.createXMLDoc("<RecordSet/>");return this.RECORDSET;}
this.getMAPSTATE=function(){if(this.MAPSTATE===null)
this.MAPSTATE=MQA.createXMLDoc("<MapState/>");return this.MAPSTATE;}
this.getSESSION=function(){if(this.SESSION===null)
this.SESSION=MQA.createXMLDoc("<Session Count=\"0\"/>");return this.SESSION;}
this.getSESSIONID=function(){if(this.SESSIONID===null)
this.SESSIONID=MQA.createXMLDoc("<SessionID/>");return this.SESSIONID;}
this.getDTSTYLE=function(){if(this.DTSTYLE===null)
this.DTSTYLE=MQA.createXMLDoc("<DTStyle/>");return this.DTSTYLE;}
this.getDTSTYLEEX=function(){if(this.DTSTYLEEX===null)
this.DTSTYLEEX=MQA.createXMLDoc("<DTStyleEx/>");return this.DTSTYLEEX;}
this.getDTFEATURESTYLEEX=function(){if(this.DTFEATURESTYLEEX===null)
this.DTFEATURESTYLEEX=MQA.createXMLDoc("<DTFeatureStyleEx/>");return this.DTFEATURESTYLEEX;}
this.getFEATURESPECIFIER=function(){if(this.FEATURESPECIFIER===null)
this.FEATURESPECIFIER=MQA.createXMLDoc("<FeatureSpecifier/>");return this.FEATURESPECIFIER;}
this.getBESTFIT=function(){if(this.BESTFIT===null)
this.BESTFIT=MQA.createXMLDoc("<BestFit Version=\"2\"/>");return this.BESTFIT;}
this.getBESTFITLL=function(){if(this.BESTFITLL===null)
this.BESTFITLL=MQA.createXMLDoc("<BestFitLL Version=\"2\"/>");return this.BESTFITLL;}
this.getCENTER=function(){if(this.CENTER===null)
this.CENTER=MQA.createXMLDoc("<Center/>");return this.CENTER;}
this.getCENTERLATLNG=function(){if(this.CENTERLATLNG===null)
this.CENTERLATLNG=MQA.createXMLDoc("<CenterLatLng/>");return this.CENTERLATLNG;}
this.getPAN=function(){if(this.PAN===null)
this.PAN=MQA.createXMLDoc("<Pan/>");return this.PAN;}
this.getZOOMIN=function(){if(this.ZOOMIN===null)
this.ZOOMIN=MQA.createXMLDoc("<ZoomIn/>");return this.ZOOMIN;}
this.getZOOMOUT=function(){if(this.ZOOMOUT===null)
this.ZOOMOUT=MQA.createXMLDoc("<ZoomOut/>");return this.ZOOMOUT;}
this.getZOOMTO=function(){if(this.ZOOMTO===null)
this.ZOOMTO=MQA.createXMLDoc("<ZoomTo/>");return this.ZOOMTO;}
this.getZOOMTORECT=function(){if(this.ZOOMTORECT===null)
this.ZOOMTORECT=MQA.createXMLDoc("<ZoomToRect/>");return this.ZOOMTORECT;}
this.getZOOMTORECTLATLNG=function(){if(this.ZOOMTORECTLATLNG===null)
this.ZOOMTORECTLATLNG=MQA.createXMLDoc("<ZoomToRectLatLng/>");return this.ZOOMTORECTLATLNG;}}
MQXMLDOC=MQA.XMLDOC;MQA.MQXML=new MQA.XMLDOC();MQXML=MQA.MQXML;MQA.ObjectCollection=function(max){MQA.Object.call(this);var m_items=new Array();this.getM_Items=function(){return m_items;};var m_maxItems=(max!==null)?max:-1;var validClassName="MQObject";this.getValidClassName=function(){return validClassName;};this.setValidClassName=function(className){validClassName=className;};this.add=function(obj){if(this.isValidObject(obj)){if(m_maxItems!==-1&&m_items.length===max)return;m_items.push(obj);return m_items.length;}
return;};this.getSize=function(){return m_items.length;};this.get=function(i){return m_items[i];};this.remove=function(iIndex){return m_items.splice(iIndex,1);};this.removeAll=function(){m_items=null;m_items=new Array();};this.contains=function(item){var size=this.getSize();for(var count=0;count<size;count++){if(m_items[count]===item){return true;}}
return false;};this.append=function(collection){if(this.getClassName()===collection.getClassName()){m_items=m_items.concat(collection.getM_Items());}else{alert("Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!");throw"Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!";}};this.set=function(i,newO){var oldO=get(i);m_items[i]=newO;return oldO;};this.isValidObject=function(obj){if(obj!==null){if(validClassName==="ALL"){return true;}else if(validClassName==="MQObject"){return true;}else if(validClassName==="String"){return true;}else if(validClassName==="int"){if(isNaN(obj)){return false;}else if(obj===Math.floor(obj)){return true;}}else if(obj.getClassName()===validClassName){return true;}}
return false;};var m_itemXpath="Item";this.getM_itemXpath=function(){return m_itemXpath;};this.setM_itemXpath=function(itemXpath){m_itemXpath=itemXpath;};this.getById=function(strId){try{for(var count=0;count<this.getSize();count++){if(m_items[count].getId()==strId){return m_items[count];}}}catch(Error){}
return null;};this.removeItem=function(item){for(var i=0;i<m_items.length;i++)
{if(m_items[i]==item)
{this.remove(i);i=m_items.length;}}};};MQA.ObjectCollection.prototype=new MQA.Object();MQA.ObjectCollection.prototype.constructor=MQA.ObjectCollection;MQA.ObjectCollection.prototype.getClassName=function(){return"MQObjectCollection";};MQA.ObjectCollection.prototype.getObjectVersion=function(){return 0;};MQA.ObjectCollection.prototype.getAt=function(i){return this.get(i);};MQObjectCollection=MQA.ObjectCollection;MQA.LatLngCollection=function(){MQA.ObjectCollection.call(this,32678);this.setValidClassName("MQLatLng");this.setM_Xpath("LatLngCollection");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLATLNGCOLLECTION()));}
MQA.LatLngCollection.prototype=new MQA.ObjectCollection(32678);MQA.LatLngCollection.prototype.constructor=MQA.LatLngCollection;MQA.LatLngCollection.prototype.getClassName=function(){return"MQLatLngCollection";};MQA.LatLngCollection.prototype.getObjectVersion=function(){return 1;};MQA.LatLngCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQA.LatLngCollection.prototype.loadXmlFromNode=function(xmlNode){this.removeAll();var xmlDoc=mqCreateXMLDocImportNode(xmlNode);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQA.LatLngCollection.prototype._loadCollection=function(xmlDoc){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var prevLat=0;var prevLng=0;var currentLat=0;var currentLng=0;var latlng=null;if(this.getValidClassName()==="MQLatLng"){for(var count=0;count<maxCount;count++){if(count==0){if(nodes[count].firstChild!==null){currentLat=nodes[count].firstChild.nodeValue/1000000;}
count++;if(nodes[count].firstChild!==null){currentLng=nodes[count].firstChild.nodeValue/1000000;}}else{if(nodes[count].firstChild!==null){currentLat=prevLat+(nodes[count].firstChild.nodeValue/1000000);}
count++;if(nodes[count].firstChild!==null){currentLng=prevLng+(nodes[count].firstChild.nodeValue/1000000);}}
prevLat=currentLat;prevLng=currentLng;latlng=new MQA.LatLng(currentLat,currentLng);this.add(latlng);}}};MQA.LatLngCollection.prototype.saveXml=function(){var strRet="<"+this.getM_Xpath()+" Version=\""+this.getObjectVersion()+"\" Count=\""+this.getSize()+"\">";var size=parseInt(this.getSize());if(size>=1){var nLat=nLng=nPrevLat=nPrevLng=nDeltaLat=nDeltaLng=0;var latLng=null;for(var i=0;i<size;i++){latLng=this.getAt(i);nLat=parseInt(latLng.getLatitude()*1000000);nLng=parseInt(latLng.getLongitude()*1000000);nDeltaLat=nLat-nPrevLat;nDeltaLng=nLng-nPrevLng;strRet+="<Lat>"+nDeltaLat+"</Lat>";strRet+="<Lng>"+nDeltaLng+"</Lng>";nPrevLat=nLat;nPrevLng=nLng;}}
strRet=strRet+"</"+this.getM_Xpath()+">";return strRet;};MQA.LatLngCollection.prototype.generalize=function(dDeviance){var SOrigPoint=function()
{this.pLL=null;this.dSegmentLength=0.0;this.dPriorLength=0.0;};var SDerivedPoint=function()
{this.pLL=null;this.ulOriginalPoint=0;};mqllAnchor=null;var ulAnchor;var i;var dAccumLength=0.0;var nPoints=this.getSize();var pOrigPoints=new Array(nPoints);var pDerivedPoints=new Array(nPoints);var nDerivedPoints=0;if(nPoints<2)
return;for(i=0;i<nPoints;i++)
{pOrigPoints[i]=new SOrigPoint();pDerivedPoints[i]=new SDerivedPoint();pOrigPoints[i].pLL=this.getAt(i);}
for(i=0;i<nPoints-1;i++)
{pOrigPoints[i].dSegmentLength=pOrigPoints[i].pLL.arcDistance(pOrigPoints[(i+1)].pLL);if(i==0)
pOrigPoints[i].dPriorLength=0.0;else
pOrigPoints[i].dPriorLength=dAccumLength;dAccumLength+=pOrigPoints[i].dSegmentLength;}
mqllAnchor=pOrigPoints[0].pLL;ulAnchor=0;pDerivedPoints[0].pLL=mqllAnchor;pDerivedPoints[0].ulOriginalPoint=0;nDerivedPoints=1;for(i=2;i<nPoints;i++)
{if(!this.isEverybodyWithinDeviation(pOrigPoints,ulAnchor,i,dDeviance))
{mqllAnchor=pOrigPoints[(i-1)].pLL;ulAnchor=(i-1);pDerivedPoints[nDerivedPoints].pLL=mqllAnchor;pDerivedPoints[nDerivedPoints].ulOriginalPoint=(i-1);nDerivedPoints++;}}
pDerivedPoints[nDerivedPoints].pLL=pOrigPoints[nPoints-1].pLL;pDerivedPoints[nDerivedPoints].ulOriginalPoint=nPoints-1;nDerivedPoints++;var nPrev=nPoints;var nCount;for(nCount=(nDerivedPoints-1);nCount>=0;nCount--)
{if((nPrev-1)!=pDerivedPoints[nCount].ulOriginalPoint)
{for(var x=(nPrev-1);x>pDerivedPoints[nCount].ulOriginalPoint;x--)
{try
{this.remove(x);}
catch(e)
{}}
nPrev=pDerivedPoints[nCount].ulOriginalPoint;}
else
{nPrev--;}}
pOrigPoints=null;pDerivedPoints=null;};MQA.LatLngCollection.prototype.isEverybodyWithinDeviation=function(pOrigPoints,ulOrigStartPoint,ulOrigEndPoint,dMaxDeviation)
{var dMilesPerLng=0.0;var dMaxDeviationSquared=0.0;var mqllStartPoint=null;var mqllEndPoint=null;var dLineLatMiles=0.0;var dLineLngMiles=0.0;var dLineLengthSquared=0.0;var i;var mqllPoint=null;var dPointLatMiles=0.0;var dPointLngMiles=0.0;var dPointLengthSquared=0.0;var dRatio=0.0;var dNumerator=0.0;var dDenominator=0.0;var dProjectionLengthSquared=0.0;var dDeviationLengthSquared=0.0;dMilesPerLng=MQA.DistanceApproximation.getMilesPerLngDeg(pOrigPoints[ulOrigStartPoint].pLL.getLatitude());dMaxDeviationSquared=dMaxDeviation*dMaxDeviation;mqllStartPoint=pOrigPoints[ulOrigStartPoint].pLL;mqllEndPoint=pOrigPoints[ulOrigEndPoint].pLL;dLineLatMiles=(mqllEndPoint.getLatitude()-mqllStartPoint.getLatitude())*MQA.DistanceApproximation.MILES_PER_LATITUDE;dLineLngMiles=(mqllEndPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dLineLengthSquared=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;for(i=ulOrigStartPoint+1;i<ulOrigEndPoint;i++)
{mqllPoint=pOrigPoints[i].pLL;dPointLatMiles=(mqllPoint.getLatitude()-mqllStartPoint.getLatitude())*MQA.DistanceApproximation.MILES_PER_LATITUDE;;dPointLngMiles=(mqllPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dPointLengthSquared=dPointLatMiles*dPointLatMiles+dPointLngMiles*dPointLngMiles;dNumerator=dLineLatMiles*dPointLatMiles+dLineLngMiles*dPointLngMiles;dDenominator=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;if(dDenominator==0)
dRatio=0;else
dRatio=dNumerator/dDenominator;dProjectionLengthSquared=dRatio*dRatio*dLineLengthSquared;dDeviationLengthSquared=dPointLengthSquared-dProjectionLengthSquared;if(dDeviationLengthSquared>dMaxDeviationSquared)
return false;}
return true;};MQLatLngCollection=MQA.LatLngCollection;MQA.DistanceApproximation=new function()
{this.m_testLat;this.m_testLng;this.m_mpd;this.m_milesPerLngDeg=new Array(69.170976,69.160441,69.128838,69.076177,69.002475,68.907753,68.792041,68.655373,68.497792,68.319345,68.120088,67.900079,67.659387,67.398085,67.116253,66.813976,66.491346,66.148462,65.785428,65.402355,64.999359,64.576564,64.134098,63.672096,63.190698,62.690052,62.170310,61.631630,61.074176,60.498118,59.903632,59.290899,58.660106,58.011443,57.345111,56.661310,55.960250,55.242144,54.507211,53.755675,52.987764,52.203713,51.403761,50.588151,49.757131,48.910956,48.049882,47.174172,46.284093,45.379915,44.461915,43.530372,42.585570,41.627796,40.657342,39.674504,38.679582,37.672877,36.654698,35.625354,34.585159,33.534429,32.473485,31.402650,30.322249,29.232613,28.134073,27.026963,25.911621,24.788387,23.657602,22.519612,21.374762,20.223401,19.065881,17.902554,16.733774,15.559897,14.381280,13.198283,12.011266,10.820591,9.626619,8.429716,7.230245,6.028572,4.825062,3.620083,2.414002,1.207185,1.000000);this.MILES_PER_LATITUDE=69.170976;this.KILOMETERS_PER_MILE=1.609347;this.getMilesPerLngDeg=function(lat)
{return(Math.abs(lat)<=90.0)?this.m_milesPerLngDeg[parseInt(Math.abs(lat)+0.5)]:69.170976;}};DistanceApproximation=MQA.DistanceApproximation;
try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqutils.js.";}
var mqutils=1;if(!Array.prototype.push)Array.prototype.push=function(){var length=Array.push.arguments.length;for(var i=0;i<length;i++)
this[this.length]=Array.push.arguments[i];return this.length;};function mq_ParamExists(varname){var undef;return(varname!==undef);}
function mqGetElementById(fId)
{if(document.getElementById(fId))
{return document.getElementById(fId);}
return null;}
function mqBuildUrl(strQueryData)
{var mqServer=_mqServerPort.replace(/mapquest.com:?\d*/,'mapquest.com');return(_reqPrefix+mqServer+"/oapi/transaction?"+strQueryData+"&key="+_mqKey);}
function mqUrlLimit()
{var maxLength=2048;if(MQA.BrowserInfo.isNS){maxLength=7168;}
return maxLength;}
function mqLimitDisplay()
{var dispLength=2;if(MQA.BrowserInfo.isNS){dispLength=7;}
return dispLength;}
function mqDoRemote(strQueryData,strDivName,strParentTagName,mqObj)
{var parent=document.getElementsByTagName(strParentTagName).item(0);var scMQRemote=mqGetElementById(strDivName);if(scMQRemote)
{parent.removeChild(scMQRemote);}
scMQRemote=document.createElement("script");var srcString=mqBuildUrl(strQueryData);if(strQueryData.substring(0,4)=="http")
{srcString=strQueryData;}
if(srcString.length>mqUrlLimit())
{alert("The request query exceeds the limit ("+mqLimitDisplay()+" Kb) allowed for your browser type. Please reduce the amount of data in the request query!");return;}
scMQRemote.src=srcString;scMQRemote.type="text/javascript";scMQRemote.id=strDivName;parent.appendChild(scMQRemote);}
function mqCreateXMLDocImportNode(ndNewRoot){var newDoc;if(document.implementation.createDocument){var newDoc=document.implementation.createDocument("","",null);try{newDoc.appendChild(newDoc.importNode(ndNewRoot,true))}catch(error){alert(error);alert(ndNewRoot.nodeName);};}else if(window.ActiveXObject){newDoc=new ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(ndNewRoot.xml);}
return newDoc;}
function mqXmlToStr(xmlDoc){var strXml=new String;var serializer=null;if(xmlDoc==null)return"";if(MQA.BrowserInfo.isNS){serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);}else if(MQA.BrowserInfo.isIE){strXml=xmlDoc.xml;}
if(MQA.BrowserInfo.isSafari)
{serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);strXml=strXml||"";strXml=strXml.replace(/#38;/g,'&');}
return strXml;}
function mqCreateNSManager(namespace){var nsmgr={normalResolver:xmlDoc.createNSResolver(xmlDoc.documentElement),lookupNamespaceURI:function(prefix){switch(prefix){case"_mq":return namespace;default:return this.normalResolver.lookupNamespaceURI(prefix);}}}
return nsmgr;}
function mqGetNode(xmlDoc,strPath){var node;if(MQA.BrowserInfo.isSafari)
{if(!xmlDoc.evaluate)
{var names=new Array();names=strPath.split('/');if(names[names.length-1].indexOf('@')!=-1)
{names.splice(names.length-1,1);}
var tree=xmlDoc.documentElement;var isfound=false;if(names.length==2&&tree.tagName==names[1])
isfound=true;else
{var length=names.length-1;for(var i=1;i<length;i++)
{isfound=false;if(tree.tagName==names[i]&&tree.hasChildNodes())
{var nodes=(tree.hasChildNodes())?tree.childNodes.length:0;for(var j=0;j<nodes;j++)
{if(tree.childNodes[j].tagName==names[i+1])
{tree=tree.childNodes[j];isfound=true;break;}}}
if(names[i+1]&&names[i+1].indexOf('text()')!=-1)
{isfound=true;}
if(names[i+1].indexOf('[')!=-1)
{var index=parseInt(names[i+1].substr(names[i+1].indexOf('[')+1,names[i+1].indexOf(']')-1));names[i+1]=names[i+1].substr(0,names[i+1].indexOf('['));tree=xmlDoc.getElementsByTagName(names[i+1]).item(index-1);isfound=true;}}}
node=(isfound==true)?tree:null;return node;}
else
{node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}}
else if(MQA.BrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return node;}else if(MQA.BrowserInfo.isNS){node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}
return null;}
function mqGetNodeText(domNode){var elemText="";if(MQA.BrowserInfo.isIE){elemText=domNode.text;}else if(MQA.BrowserInfo.isNS&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;}
if(MQA.BrowserInfo.isSafari&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;elemText=(elemText?elemText:"");elemText=elemText.replace(/#38;/g,'&');}
return elemText;}
function mqGetXPathNodeText(xmlDoc,strPath){var node;if(MQA.BrowserInfo.isSafari)
{node=mqGetNode(xmlDoc,strPath);var nodeText="";var attribute="";if(strPath.indexOf('@')!=-1)
{attribute=strPath.substr(strPath.indexOf('@')+1,strPath.length);nodeText=node.attributes.getNamedItem(attribute).nodeValue;}
else if(node)
{nodeText=mqGetNodeText(node);}
return nodeText;}
if(MQA.BrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return(node==null?"":node.text);}else if(MQA.BrowserInfo.isNS){try{node=xmlDoc.evaluate(strPath,xmlDoc,null,2,null);}catch(error){alert(strPath);alert(error);}
return node.stringValue;}
return"";}
function mqReplaceNode(xmlDoc,node,strTxt){var ndNewText=xmlDoc.createTextNode(strTxt);if(node.firstChild){return node.replaceChild(ndNewText,node.firstChild);}else{return node.appendChild(ndNewText);}}
function mqReplaceElementNode(xmlDoc,nodeDoc,xpath){var root=xmlDoc.documentElement;var newnode=nodeDoc.documentElement;var oldnode=xmlDoc.getElementsByTagName(xpath).item(0);if(MQA.BrowserInfo.isIE)
node=newnode
else
node=xmlDoc.importNode(newnode,true);if(oldnode){root.replaceChild(node,oldnode);}else{root.appendChild(node);}
return xmlDoc;}
function mqSetNodeText(xmlDoc,strXPath,strTxt){var ndParent=mqGetNode(xmlDoc,strXPath);if(ndParent==null){return null;}
return mqReplaceNode(xmlDoc,ndParent,strTxt);}
function mqTransformXMLFromString(strXml,strXsl,dvParent){var xmlDoc=MQA.createXMLDoc(strXml);var xslDoc=MQA.createXMLDoc(strXsl);var newFragment;if(MQA.BrowserInfo.isNS){var xsltProcessor=new XSLTProcessor();xsltProcessor.importStylesheet(xslDoc);newFragment=xsltProcessor.transformToFragment(xmlDoc,document);dvParent.appendChild(newFragment);}else if(MQA.BrowserInfo.isIE){var newFragment=new ActiveXObject("Msxml2.DOMDocument.5.0");newFragment=xmlDoc.transformNode(xslDoc);dvParent.innerHTML+=newFragment;}}
function mqTransformXMLFromNode(ndXml,strXsl,dvParent){var xslDoc=MQA.createXMLDoc(strXsl);var newFragment;if(MQA.BrowserInfo.isNS){var xsltProcessor=new XSLTProcessor();xsltProcessor.importStylesheet(xslDoc);newFragment=xsltProcessor.transformToFragment(ndXml,document);dvParent.appendChild(newFragment);}else if(MQA.BrowserInfo.isIE){var newFragment=new ActiveXObject("Msxml2.DOMDocument.5.0");newFragment=ndXml.transformNode(xslDoc);dvParent.innerHTML+=newFragment;}}
function alphaBackgrounds(){if(navigator.platform=="Win32"&&navigator.appName=="Microsoft Internet Explorer"&&window.attachEvent){var rslt=navigator.appVersion.match(/MSIE (\d+\.\d+)/,'');var itsAllGood=(rslt!=null&&Number(rslt[1])>=5.5);for(i=0;i<document.all.length;i++){var bg=document.all[i].currentStyle.backgroundImage;if(itsAllGood&&bg){if(bg.match(/\.png/i)!=null){var mypng=bg.substring(5,bg.length-2);document.all[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";document.all[i].style.backgroundImage="url(/images/background-form-button.gif)";}}}}}
function mqFormatNumber(num,dec){return Math.floor(num*Math.pow(10,dec))/Math.pow(10,dec);}
function mq_display_time(totalTime){var newTime;if(totalTime>3600)
{newTime=totalTime/3600;var result=(" "+Math.floor(newTime)+" hours,");newTime=(totalTime/60)%60;result+=(" "+mqFormatNumber(newTime,2)+" minutes");return result;}
if(totalTime>60)
{newTime=totalTime/60;return(" "+mqFormatNumber(newTime,2)+" minutes");}}
function mq_display_distance(totalDistance){return(" "+mqFormatNumber(totalDistance.value,2)+(totalDistance.units=="mi"?" miles":" kilometers"));}
var isIE5Mac=(navigator.userAgent.indexOf('MSIE 5')!=-1&&navigator.userAgent.indexOf('Mac')!=-1);function mqCreateFormInput(container,id,spanClass,labelTxt,type,name,value,size,maxLength){var div=container.appendChild(document.createElement('div'));div.className='row';var label=div.appendChild(document.createElement('label'));label.htmlFor=id;label.appendChild(document.createTextNode(labelTxt));div.appendChild(document.createElement('br'));var input=document.createElement('input');input.id=id;input.type=type;input.name=name;if(size!=""){input.size=size;}
if(!isNaN(parseInt(maxLength))){input.maxLength=parseInt(maxLength);}
if(value!=""){input.value=value;}
if(spanClass!=""){var span=div.appendChild(document.createElement('span'));span.className=spanClass;span.appendChild(input);}else{div.appendChild(input);}}
function mqCreateInput(container,id,type,name,value,size,maxLength){var input=document.createElement('input');input.id=id;input.type=type;input.name=name;if(size!=""){input.size=size;}
if(!isNaN(parseInt(maxLength))){input.maxLength=parseInt(maxLength);}
if(value!=""){input.value=value;}
container.appendChild(input);}
function mqCreateHiddenInput(form,id,name,value){var input;if(isIE5Mac){input=document.createElement('input type=hidden');}else{input=document.createElement('input');input.type='hidden';}
input.name=name;if(id!=''){input.id=id;}
if(value!=''){input.value=value;}
form.appendChild(input);}
function mqCreateFormSelect(container,id,spanClass,labelTxt,name,elements,node){var div=container.appendChild(document.createElement('div'));div.className='row';var label=div.appendChild(document.createElement('label'));label.htmlFor=id;label.appendChild(document.createTextNode(labelTxt));div.appendChild(document.createElement('br'));if(spanClass!=""){var span=div.appendChild(document.createElement('span'));span.className=spanClass;var select=span.appendChild(document.createElement('select'));}else{var select=div.appendChild(document.createElement('select'));}
select.id=id;select.name=name;length=elements.length;for(x=0;x<length;x++){var option=select.appendChild(document.createElement('option'));eval("option.value = elements[x]."+node);eval("option.appendChild (document.createTextNode (elements[x]."+node+"))");}
return select;}
function mqCreateDiv(container,className,id){var div=container.appendChild(document.createElement('div'));if(className!=""){div.className=className;}
if(id!=""){div.id=id;}
return div;}
function mqCreateA(container,href,title){var a=container.appendChild(document.createElement('a'));a.href=href;if(title!=""){a.title=title;}
return a;}
function mqCreateSpan(container,className,id){var span=container.appendChild(document.createElement('span'));if(className!=""){span.className=className;}
if(id!=""){span.id=id;}
return span;}
function mqCreateImg(container,src,width,height,id,name,alt){var img=container.appendChild(document.createElement('img'));if(src!=""){img.src=src;}
if(!isNaN(parseInt(width))){img.width=parseInt(width);}
if(!isNaN(parseInt(height))){img.height=parseInt(height);}
if(id!=""){img.id=id;}
if(name!=""){img.name=name;}
if(alt!=""){img.alt=alt;}
return img;}
function mqCreateImgDiv(container,src,width,height,id,name,alt){var div=container.appendChild(document.createElement('div'));if(id!=""){div.id=id;}
if(!isNaN(parseInt(width))){div.style.width=parseInt(width)+"px";}
if(!isNaN(parseInt(height))){div.style.height=parseInt(height)+"px";}
if(name!=""){div.name=name;}
if(alt!=""){div.alt=alt;}
return div;}
function mqXMLHttpRequest()
{var request=null;if(window.XMLHttpRequest)
{try
{request=new XMLHttpRequest();}
catch(e)
{request=null;}}
else if(window.ActiveXObject)
{try
{request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{request=null;}}}
return request;}
function mqAddEvent(fObj,fEvent,fn)
{if(window.opera&&MQA.BrowserInfo.version<8)
{var r=fObj.attachEvent("on"+fEvent,fn);return r;}
else if(fObj.addEventListener)
{((window.opera)&&(MQA.BrowserInfo.version>=8))?fObj.addEventListener(fEvent,fn,false):fObj.addEventListener(fEvent,fn,true);return true;}
else if(fObj.attachEvent)
{var r=fObj.attachEvent("on"+fEvent,fn);return r;}
else
{fObj["on"+fEvent]=fn;}}
function mqRemoveEvent(fObj,fEvent,fn)
{if(window.opera)
{eval("fObj.on"+fEvent+" = null");}
if(fObj.removeEventListener)
{((window.opera)&&(MQA.BrowserInfo.version>=8))?fObj.removeEventListener(fEvent,fn,false):fObj.removeEventListener(fEvent,fn,true);}
else if(fObj.detachEvent)
{fObj.detachEvent("on"+fEvent,fn);}
else
{fObj["on"+fEvent]=null;}}
function mqGetEventData(evt)
{fEventData=new Object();if(document.addEventListener)
{fEventData.id=evt.target.id;fEventData.type=evt.type;fEventData.element=evt.target;}
else if(window.event)
{fEventData.id=window.event.srcElement.id;fEventData.type=window.event.type;fEventData.element=window.event.srcElement;}
else
{return null;}
return fEventData;}
function mqGetXY(evt)
{xyData=new Object();if(!document.createElement||!document.getElementsByTagName)return;if(!document.createElementNS)
{document.createElementNS=function(ns,elt)
{return document.createElement(elt);}}
if(document.addEventListener&&typeof evt.pageX=="number")
{var Element=evt.target;var CalculatedTotalOffsetLeft=CalculatedTotalOffsetTop=0;while(Element.offsetParent)
{CalculatedTotalOffsetLeft+=Element.offsetLeft;CalculatedTotalOffsetTop+=Element.offsetTop;Element=Element.offsetParent;}
var OffsetXForNS6=evt.pageX-CalculatedTotalOffsetLeft;var OffsetYForNS6=evt.pageY-CalculatedTotalOffsetTop;xyData.elementId=evt.target.id;xyData.elementX=OffsetXForNS6;xyData.elementY=OffsetYForNS6;xyData.pageX=evt.pageX;xyData.pageY=evt.pageY;}
else if(window.event&&typeof window.event.offsetX=="number")
{xyData.elementId=window.event.srcElement.id;xyData.elementX=event.offsetX;xyData.elementY=event.offsetY;xyData.pageX=0;xyData.pageY=0;var element=mqGetElementById(xyData.elementId);while(element)
{xyData.pageX+=element.offsetLeft;xyData.pageY+=element.offsetTop;element=element.offsetParent;}
xyData.pageX+=xyData.elementX;xyData.pageY+=xyData.elementY;}
return xyData;}
function mqGetPDivSize(pMQMapObject)
{size=new MQSize();if(pMQMapObject.parent.style.width.length==0)
pMQMapObject.parent.style.width="800px";if(pMQMapObject.parent.style.height.length==0)
pMQMapObject.parent.style.height="600px";size.setWidth(parseInt(pMQMapObject.parent.style.width)-4);size.setHeight(parseInt(pMQMapObject.parent.style.height)-4);return size;}
function mqSetPDivSize(pMQMapObject,size)
{pMQMapObject.parent.style.width=size.getWidth()+"px";pMQMapObject.parent.style.height=size.getHeight()+"px";}
function mqurlencode(strVal)
{var strEncode;strEncode=strVal.replace(/%/g,"%25");strEncode=strEncode.replace(/&/g,"%26");strEncode=strEncode.replace(/#/g,"%23");strEncode=strEncode.replace(/\//g,"%2F");strEncode=strEncode.replace(/:/g,"%3A");strEncode=strEncode.replace(/;/g,"%3B");strEncode=strEncode.replace(/=/g,"%3D");strEncode=strEncode.replace(/\?/g,"%3F");strEncode=strEncode.replace(/@/g,"%40");strEncode=strEncode.replace(/\$/g,"%24");strEncode=strEncode.replace(/,/g,"%2C");strEncode=strEncode.replace(/\+/g,"%2B");return strEncode;}
function mqGetGuid()
{var org=new Date(2006,0,1);var now=new Date();do{var cur=new Date();}while(cur-now<1);var diff=cur.getTime()-org.getTime();return(Math.ceil(diff));}
function mqPause(numberMillis)
{var now=new Date();var exitTime=now.getTime()+numberMillis;while(true)
{now=new Date();if(now.getTime()>exitTime)
return;}}
var _mqLogStartTime=null;var _mqLogCurTime=null;var _mqLogprevTime=null;function mqLogTime(str)
{if(mqGetElementById("mqTimeLogs"))
{var logtext=mqGetElementById("mqTimeLogs");var mqTimeLogger=new Date();if(_mqLogStartTime==null){logtext.value="Time(ms) Difference\t Message\n";_mqLogStartTime=mqTimeLogger.getTime();_mqLogprevTime=_mqLogStartTime;}
_mqLogCurTime=mqTimeLogger.getTime();var diff=_mqLogCurTime-_mqLogStartTime;var del=_mqLogCurTime-_mqLogprevTime;logtext.value=logtext.value+diff+"\t "+del+"\t\t "+str+"\n";_mqLogprevTime=_mqLogCurTime;}}
function mqResetTimeLogs()
{if(mqGetElementById("mqTimeLogs"))
{var logtext=mqGetElementById("mqTimeLogs");var mqTimeLogger=new Date();logtext.value="Time(ms) Difference\t Message\n";_mqLogStartTime=mqTimeLogger.getTime();_mqLogprevTime=_mqLogStartTime;}}
function mqGetAdvantageResultPath(transaction){var resultsPath;if(transaction=="poiMap")
resultsPath="poiResults";else if(transaction=="locMap")
resultsPath="locations";else if(transaction=="search")
resultsPath="searchResults";return resultsPath;}
function mqGetAdvantageMapPath(transaction){var mapPath;if(transaction=="locMap")
mapPath="/advantage/"+transaction+"/locations/location/map";else
mapPath="/advantage/"+transaction+"/map";return mapPath;}
function mqPrepareMapUrl(strmapUrl){var mapUrl="";mapUrl=strmapUrl.replace(/https?:\/\//,_reqPrefix);mapUrl=mapUrl.replace(/mapquest.com:?\d*/,'mapquest.com');mapUrl=mapUrl.replace(/iwebsys.aol.com:?\d*/,'iwebsys.aol.com');return mapUrl;}
function display(pid,name,value,id,sClass){if(mqGetElementById(pid)){var div=mqGetElementById(pid);var label=div.appendChild(document.createElement('label'));var bb=label.appendChild(document.createElement('b'));bb.appendChild(document.createTextNode(name));div.appendChild(document.createElement('br'));var span=div.appendChild(document.createElement('textarea'));span.className=sClass;span.style.overflow="auto";if(id!=null)span.id=id;span.appendChild(document.createTextNode(value));div.appendChild(document.createElement('br'));div.appendChild(document.createElement('br'));}}
try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqobjects.js.";}
function mqIsClass(strClassName,newObj,allowNull){if(newObj!==null){try{newObj.getClassName();}catch(error){throw"InvalidClassException";}
if(newObj.getClassName()===strClassName){return true;}else{throw"InvalidClassException";}}else if(allowNull){return true;}
throw"NullPointerException";};function MQConstants(){this.MQDISTANCEUNITS_MILES=0;this.MQDISTANCEUNITS_KILOMETERS=1;this.MQLATLNG_RADIANS=0.01745329251994;this.MQLATLNG_INVALID=314159.265358;this.MQLATLNG_TOLERANCE=0.000001;this.MQPOINT_INVALID=32767;this.PI=3.14159265358979323846;this.MQSEARCHCRITERIA_MILES_PER_DEGREE_LAT=68.9;this.MQSEARCHCRITERIA_DEGREES_LAT_PER_MILE=(1/this.MQSEARCHCRITERIA_MILES_PER_DEGREE_LAT);this.DISTANCEAPPROX_MILES_PER_LATITUDE=69.170976;this.DISTANCEAPPROX_KILOMETERS_PER_MILE=1.609347;this.MQROUTETYPE_FASTEST=0;this.MQROUTETYPE_SHORTEST=1;this.MQROUTETYPE_PEDESTRIAN=2;this.MQROUTETYPE_OPTIMIZED=3;this.MQROUTETYPE_SELECT_DATASET_ONLY=4;this.MQNARRATIVETYPE_DEFAULT=0;this.MQNARRATIVETYPE_HTML=1;this.MQNARRATIVETYPE_NONE=-1;this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_LIMITED_ACCESS="Limited Access";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_TOLL_ROAD="Toll Road";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_FERRY="Ferry";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_UNPAVED_ROAD="Unpaved";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_SEASONAL="Approximate seasonal closure";this.MQROUTEOPTIONS_LANGUAGE_ENGLISH="English";this.MQROUTEOPTIONS_LANGUAGE_FRENCH="French";this.MQROUTEOPTIONS_LANGUAGE_GERMAN="German";this.MQROUTEOPTIONS_LANGUAGE_ITALIAN="Italian";this.MQROUTEOPTIONS_LANGUAGE_SPANISH="Spanish";this.MQROUTEOPTIONS_LANGUAGE_DANISH="Danish";this.MQROUTEOPTIONS_LANGUAGE_DUTCH="Dutch";this.MQROUTEOPTIONS_LANGUAGE_NORWEGIAN="Norwegian";this.MQROUTEOPTIONS_LANGUAGE_SWEDISH="Swedish";this.MQROUTEOPTIONS_LANGUAGE_IBERIAN_SPANISH="Iberian Spanish";this.MQROUTEOPTIONS_LANGUAGE_BRITISH_ENGLISH="British English";this.MQROUTEOPTIONS_LANGUAGE_IBERIAN_PORTUGUESE="Iberian Portuguese";this.MQROUTERESULTSCODE_NOT_SPECIFIED=-1;this.MQROUTERESULTSCODE_SUCCESS=0;this.MQROUTERESULTSCODE_INVALID_LOCATION=1;this.MQROUTERESULTSCODE_ROUTE_FAILURE=2;this.MQROUTERESULTSCODE_NO_DATASET_FOUND=3;this.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED=-1;this.MQROUTEMATRIXRESULTSCODE_SUCCESS=0;this.MQROUTEMATRIXRESULTSCODE_INVALID_LOCATION=1;this.MQROUTEMATRIXRESULTSCODE_ROUTE_FAILURE=2;this.MQROUTEMATRIXRESULTSCODE_NO_DATASET_FOUND=3;this.MQROUTEMATRIXRESULTSCODE_INVALID_OPTION=4;this.MQROUTEMATRIXRESULTSCODE_PARTIAL_SUCCESS=5;this.MQROUTEMATRIXRESULTSCODE_EXCEEDED_MAX_LOCATIONS=6;this.MQMANEUVER_HEADING_NULL=0;this.MQMANEUVER_HEADING_NORTH=1;this.MQMANEUVER_HEADING_NORTH_WEST=2;this.MQMANEUVER_HEADING_NORTH_EAST=3;this.MQMANEUVER_HEADING_SOUTH=4;this.MQMANEUVER_HEADING_SOUTH_EAST=5;this.MQMANEUVER_HEADING_SOUTH_WEST=6;this.MQMANEUVER_HEADING_WEST=7;this.MQMANEUVER_HEADING_EAST=8;this.MQMANEUVER_TURN_TYPE_STRAIGHT=0;this.MQMANEUVER_TURN_TYPE_SLIGHT_RIGHT=1;this.MQMANEUVER_TURN_TYPE_RIGHT=2;this.MQMANEUVER_TURN_TYPE_SHARP_RIGHT=3;this.MQMANEUVER_TURN_TYPE_REVERSE=4;this.MQMANEUVER_TURN_TYPE_SHARP_LEFT=5;this.MQMANEUVER_TURN_TYPE_LEFT=6;this.MQMANEUVER_TURN_TYPE_SLIGHT_LEFT=7;this.MQMANEUVER_TURN_TYPE_RIGHT_UTURN=8;this.MQMANEUVER_TURN_TYPE_LEFT_UTURN=9;this.MQMANEUVER_TURN_TYPE_RIGHT_MERGE=10;this.MQMANEUVER_TURN_TYPE_LEFT_MERGE=11;this.MQMANEUVER_TURN_TYPE_RIGHT_ON_RAMP=12;this.MQMANEUVER_TURN_TYPE_LEFT_ON_RAMP=13;this.MQMANEUVER_TURN_TYPE_RIGHT_OFF_RAMP=14;this.MQMANEUVER_TURN_TYPE_LEFT_OFF_RAMP=15;this.MQMANEUVER_TURN_TYPE_RIGHT_FORK=16;this.MQMANEUVER_TURN_TYPE_LEFT_FORK=17;this.MQMANEUVER_TURN_TYPE_STRAIGHT_FORK=18;this.MQMANEUVER_ATTRIBUTE_PORTIONS_TOLL=1;this.MQMANEUVER_ATTRIBUTE_PORTIONS_UNPAVED=2;this.MQMANEUVER_ATTRIBUTE_POSSIBLE_SEASONAL_ROAD_CLOSURE=4;this.MQMANEUVER_ATTRIBUTE_GATE=8;this.MQMANEUVER_ATTRIBUTE_FERRY=16;this.MQCOORDINATETYPE_GEOGRAPHIC=1;this.MQCOORDINATETYPE_DISPLAY=2;this.MQDRAWTRIGGER_BEFORE_POLYGONS=3585;this.MQDRAWTRIGGER_AFTER_POLYGONS=3586;this.MQDRAWTRIGGER_BEFORE_TEXT=3588;this.MQDRAWTRIGGER_AFTER_TEXT=3618;this.MQDRAWTRIGGER_BEFORE_ROUTE_HIGHLIGHT=3616;this.MQDRAWTRIGGER_AFTER_ROUTE_HIGHLIGHT=3617;this.MQPENSTYLE_SOLID=0;this.MQPENSTYLE_DASH=1;this.MQPENSTYLE_DOT=2;this.MQPENSTYLE_DASH_DOT=3;this.MQPENSTYLE_DASH_DOT_DOT=4;this.MQPENSTYLE_NONE=5;this.MQCOLORSTYLE_INVALID=0xffffffff;this.MQCOLORSTYLE_BLACK=0;this.MQCOLORSTYLE_BLUE=16711680;this.MQCOLORSTYLE_CYAN=16776960;this.MQCOLORSTYLE_DARK_GRAY=4210752;this.MQCOLORSTYLE_GRAY=8421504;this.MQCOLORSTYLE_GREEN=65280;this.MQCOLORSTYLE_LIGHT_GRAY=12632256;this.MQCOLORSTYLE_MAGENTA=16711935;this.MQCOLORSTYLE_ORANGE=51455;this.MQCOLORSTYLE_PINK=11513855;this.MQCOLORSTYLE_RED=255;this.MQCOLORSTYLE_WHITE=16777215;this.MQCOLORSTYLE_YELLOW=65535;this.MQFILLSTYLE_SOLID=0;this.MQFILLSTYLE_BDIAGONAL=1;this.MQFILLSTYLE_CROSS=2;this.MQFILLSTYLE_DIAG_CROSS=3;this.MQFILLSTYLE_FDIAGONAL=4;this.MQFILLSTYLE_HORIZONTAL=5;this.MQFILLSTYLE_VERTICAL=6;this.MQFILLSTYLE_NONE=7;this.MQSYMBOLTYPE_RASTER=0;this.MQSYMBOLTYPE_VECTOR=1;this.MQTEXTALIGNMENT_CENTER=1;this.MQTEXTALIGNMENT_LEFT=2;this.MQTEXTALIGNMENT_RIGHT=4;this.MQTEXTALIGNMENT_BASELINE=8;this.MQTEXTALIGNMENT_BOTTOM=16;this.MQTEXTALIGNMENT_TOP=32;this.MQFONTSTYLE_INVALID=-1;this.MQFONTSTYLE_NORMAL=0;this.MQFONTSTYLE_BOLD=1;this.MQFONTSTYLE_BOXED=2;this.MQFONTSTYLE_OUTLINED=4;this.MQFONTSTYLE_ITALICS=8;this.MQFONTSTYLE_UNDERLINE=16;this.MQFONTSTYLE_STRIKEOUT=32;this.MQFONTSTYLE_THIN=64;this.MQFONTSTYLE_SEMIBOLD=128;this.MQFONTSTYLE_MAX_VALUE=256;this.MQBASEDTSTYLE_DT_NULL=65532;this.MQBASEDTSTYLE_CT_ROAD=0;this.MQBASEDTSTYLE_CT_LINE=1;this.MQBASEDTSTYLE_CT_POLYGON=2;this.MQBASEDTSTYLE_CT_POINT=3;this.MQBASEDTSTYLE_CT_POI=4;this.MQBASEDTSTYLE_CT_SEED=5;this.MQBASEDTSTYLE_CT_DISPLAYLIST=6;this.MQBASEDTSTYLE_CT_APP=7;this.MQBASEDTSTYLE_CT_XA=8;this.MQBASEDTSTYLE_BT_LINE=0;this.MQBASEDTSTYLE_BT_POLYGON=1;this.MQBASEDTSTYLE_BT_POINT=2;this.MQBASEDTSTYLE_BT_OTHER=3;this.MQBASEDTSTYLE_BT_XA=4;this.MQFEATURESPECIFERATTRIBUTETYPE_GEFID=0;this.MQFEATURESPECIFERATTRIBUTETYPE_NAME=1;this.MQMATCHTYPE_LOC=0;this.MQMATCHTYPE_INTR=1;this.MQMATCHTYPE_NEARBLK=2;this.MQMATCHTYPE_REPBLK=3;this.MQMATCHTYPE_BLOCK=4;this.MQMATCHTYPE_AA1=5;this.MQMATCHTYPE_AA2=6;this.MQMATCHTYPE_AA3=7;this.MQMATCHTYPE_AA4=8;this.MQMATCHTYPE_AA5=9;this.MQMATCHTYPE_AA6=10;this.MQMATCHTYPE_AA7=11;this.MQMATCHTYPE_PC1=12;this.MQMATCHTYPE_PC2=13;this.MQMATCHTYPE_PC3=14;this.MQMATCHTYPE_PC4=15;this.MQMATCHTYPE_POI=16;this.MQQUALITYTYPE_EXACT=0;this.MQQUALITYTYPE_GOOD=1;this.MQQUALITYTYPE_APPROX=2;}
var MQCONSTANT=new MQConstants();function MQErrors(){this.RECORDSET_GETFIELD_1="failure in getField -- m_curRec is not Pointing to an existing Record";this.RECORDSET_GETFIELD_2="failure in getField -- could not find strFieldName";this.RECORDSET_MOVEFIRST_1="failure in moveFirst -- Error Moving Cursor, RecordSet is Empty.";this.RECORDSET_MOVELAST_1="Error Moving Cursor, RecordSet is Empty.";this.RECORDSET_MOVENEXT_1="Error Moving Cursor, EOF was true.";this.RECORDSET_MOVENEXT_2="Error Moving Cursor, Unknown Error.";this.RECORDSET_MOVENEXT_3="Error Moving Cursor, RecordSet is Empty.";}
var MQERROR=new MQErrors();MQSign.prototype=new MQObject();MQSign.prototype.constructor=MQSign;function MQSign(){MQObject.call(this);this.setM_Xpath("Sign");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSIGN()));}
MQSign.prototype.getClassName=function(){return"MQSign";};MQSign.prototype.getObjectVersion=function(){return 0;};MQSign.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQSign.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));};MQSign.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQSign.prototype.clear=function(){this.setType(0);this.setText("");this.setExtraText("");this.setDirection(MQCONSTANT.MQMANEUVER_HEADING_NULL);};MQSign.prototype.setType=function(type){this.setProperty("Type",type);};MQSign.prototype.getType=function(){return this.getProperty("Type");};MQSign.prototype.setText=function(text){this.setProperty("Text",text);};MQSign.prototype.getText=function(){return this.getProperty("Text");};MQSign.prototype.setExtraText=function(extraText){this.setProperty("ExtraText",extraText);};MQSign.prototype.getExtraText=function(){return this.getProperty("ExtraText");};MQSign.prototype.setDirection=function(direction){this.setProperty("Direction",direction);};MQSign.prototype.getDirection=function(){return this.getProperty("Direction");};MQFeature.prototype=new MQObject();MQFeature.prototype.constructor=MQFeature;function MQFeature(){MQObject.call(this);}
MQFeature.prototype.getClassName=function(){return"MQFeature";};MQFeature.prototype.getObjectVersion=function(){return 0;};MQFeature.prototype.getDistance=function(){return this.getProperty("Distance");};MQFeature.prototype.setDistance=function(dblDistance){this.setProperty("Distance",dblDistance);};MQFeature.prototype.getName=function(){return this.getProperty("Name");};MQFeature.prototype.setName=function(strName){this.setProperty("Name",strName);};MQFeature.prototype.getSourceLayerName=function(){return this.getProperty("SourceLayerName");};MQFeature.prototype.setSourceLayerName=function(strSourceLayerName){this.setProperty("SourceLayerName",strSourceLayerName);};MQFeature.prototype.getKey=function(){return this.getProperty("Key");};MQFeature.prototype.setKey=function(strKey){this.setProperty("Key",strKey);};MQFeature.prototype.setGEFID=function(intGEFID){this.setProperty("GEFID",intGEFID);};MQFeature.prototype.getGEFID=function(){return this.getProperty("GEFID");};MQFeature.prototype.setDT=function(intDT){this.setProperty("DT",intDT);};MQFeature.prototype.getDT=function(){return this.getProperty("DT");};MQPointFeature.prototype=new MQFeature();MQPointFeature.prototype.constructor=MQPointFeature;function MQPointFeature(){MQObject.call(this);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPOINTFEATURE()));this.setM_Xpath("PointFeature");this.m_CenterLatLng=new MQLatLng("CenterLatLng");this.m_CenterPoint=new MQPoint("CenterPoint");}
MQPointFeature.prototype.getClassName=function(){return"MQPointFeature";};MQPointFeature.prototype.getObjectVersion=function(){return 0;};MQPointFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getCenterLatLng();var point=this.getCenterPoint();var lnode=mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng");var pnode=mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint");if(lnode!==null)
latlng.loadXmlFromNode(lnode);if(pnode!==null)
point.loadXmlFromNode(pnode);};MQPointFeature.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));this.getCenterLatLng().setLatLng(this.getProperty("CenterLatLng/Lat"),this.getProperty("CenterLatLng/Lng"));var x=this.getProperty("CenterPoint/X");if(x!=="")
this.getCenterPoint().setXY(x,this.getProperty("CenterPoint/Y"));};MQPointFeature.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=MQA.createXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQPointFeature.prototype.getCenterLatLng=function(){return this.m_CenterLatLng;};MQPointFeature.prototype.setCenterLatLng=function(latLng){this.m_CenterLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};MQPointFeature.prototype.getCenterPoint=function(){return this.m_CenterPoint;};MQPointFeature.prototype.setCenterPoint=function(Point){this.m_CenterPoint.setXY(Point.getX(),Point.getY());};MQPolygonFeature.prototype=new MQPointFeature();MQPolygonFeature.prototype.constructor=MQPolygonFeature;function MQPolygonFeature(){MQPointFeature.call(this);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPOLYGONFEATURE()));this.setM_Xpath("PolygonFeature");var m_LatLngs=new MQLatLngCollection();m_LatLngs.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LatLngs;};this.setLatLngs=function(latLngs){if(latLngs.getClassName()==="MQLatLngCollection"){m_LatLngs.removeAll();m_LatLngs.append(latLngs);}else{alert("failure in setLatLngs");throw"failure in setLatLngs";}};var m_Points=new MQPointCollection();m_Points.setM_Xpath("Points");this.getPoints=function(){return m_Points;};this.setPoints=function(pts){m_Points.removeAll();m_Points.append(pts);};}
MQPolygonFeature.prototype.getClassName=function(){return"MQPolygonFeature";};MQPolygonFeature.prototype.getObjectVersion=function(){return 0;};MQPolygonFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));var latlngs=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));var points=this.getPoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
points.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));};MQPolygonFeature.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=MQA.createXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));newNode=MQA.createXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=MQA.createXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));return mqXmlToStr(this.getM_XmlDoc());};MQLineFeature.prototype=new MQPolygonFeature();MQLineFeature.prototype.constructor=MQLineFeature;function MQLineFeature(){MQPolygonFeature.call(this);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLINEFEATURE()));this.setM_Xpath("LineFeature");}
MQLineFeature.prototype.getClassName=function(){return"MQLineFeature";};MQLineFeature.prototype.getObjectVersion=function(){return 0;};MQLineFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));var latlngs=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));var points=this.getPoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
points.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));};MQLineFeature.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=MQA.createXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));newNode=MQA.createXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=MQA.createXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));return mqXmlToStr(this.getM_XmlDoc());};MQLineFeature.prototype.getLeftPostalCode=function(){return this.getProperty("LeftPostalCode");};MQLineFeature.prototype.setLeftPostalCode=function(strVal){this.setProperty("LeftPostalCode",strVal);};MQLineFeature.prototype.getRightPostalCode=function(){return this.getProperty("RightPostalCode");};MQLineFeature.prototype.setRightPostalCode=function(strVal){this.setProperty("RightPostalCode",strVal);};MQLineFeature.prototype.getLeftAddressHi=function(){return this.getProperty("LeftAddressHi");};MQLineFeature.prototype.setLeftAddressHi=function(strVal){this.setProperty("LeftAddressHi",strVal);};MQLineFeature.prototype.getRightAddressHi=function(){return this.getProperty("RightAddressHi");};MQLineFeature.prototype.setRightAddressHi=function(strVal){this.setProperty("RightAddressHi",strVal);};MQLineFeature.prototype.getLeftAddressLo=function(){return this.getProperty("LeftAddressLo");};MQLineFeature.prototype.setLeftAddressLo=function(strVal){this.setProperty("LeftAddressLo",strVal);};MQLineFeature.prototype.getRightAddressLo=function(){return this.getProperty("RightAddressLo");};MQLineFeature.prototype.setRightAddressLo=function(strVal){this.setProperty("RightAddressLo",strVal);};MQLocation.prototype=new MQObject();MQLocation.prototype.constructor=MQLocation;function MQLocation(){MQObject.call(this);this.setM_Xpath("Location");}
MQLocation.prototype.getClassName=function(){return"MQLocation";};MQLocation.prototype.getObjectVersion=function(){return 0;};MQLocation.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQLocation.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAddress.prototype=new MQLocation();MQAddress.prototype.constructor=MQAddress;function MQAddress(){MQLocation.call(this);this.setM_Xpath("Address");if(this.getClassName()==="MQAddress"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getADDRESS()));}}
MQAddress.prototype.getClassName=function(){return"MQAddress";};MQAddress.prototype.getObjectVersion=function(){return 0;};MQAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQAddress.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAddress.prototype.getAdminArea=function(intIndex){return this.getProperty("AdminArea"+intIndex);};MQAddress.prototype.setAdminArea=function(intIndex,strAdminArea){this.setProperty("AdminArea"+intIndex,strAdminArea);};MQAddress.prototype.getCountry=function(){return this.getProperty("AdminArea1");};MQAddress.prototype.setCountry=function(strCountry){this.setProperty("AdminArea1",strCountry);};MQAddress.prototype.getCounty=function(){return this.getProperty("AdminArea4");};MQAddress.prototype.setCounty=function(strCounty){this.setProperty("AdminArea4",strCounty);};MQAddress.prototype.getCity=function(){return this.getProperty("AdminArea5");};MQAddress.prototype.setCity=function(strCity){this.setProperty("AdminArea5",strCity);};MQAddress.prototype.getPostalCode=function(){return this.getProperty("PostalCode");};MQAddress.prototype.setPostalCode=function(strPostalCode){this.setProperty("PostalCode",strPostalCode);};MQAddress.prototype.getState=function(){return this.getProperty("AdminArea3");};MQAddress.prototype.setState=function(strState){this.setProperty("AdminArea3",strState);};MQAddress.prototype.setStreet=function(strStreet){this.setProperty("Street",strStreet);};MQAddress.prototype.getStreet=function(){return this.getProperty("Street");};MQSingleLineAddress.prototype=new MQLocation();MQSingleLineAddress.prototype.constructor=MQSingleLineAddress;function MQSingleLineAddress(){MQLocation.call(this);this.setM_Xpath("SingleLineAddress");if(this.getClassName()==="MQSingleLineAddress"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSINGLELINEADDRESS()));}}
MQSingleLineAddress.prototype.getClassName=function(){return"MQSingleLineAddress";};MQSingleLineAddress.prototype.getObjectVersion=function(){return 0;};MQSingleLineAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQSingleLineAddress.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQSingleLineAddress.prototype.setAddress=function(strAddress){this.setProperty("Address",strAddress);};MQSingleLineAddress.prototype.getAddress=function(){return this.getProperty("Address");};MQSingleLineAddress.prototype.setCountry=function(strCountry){this.setProperty("Country",strCountry);};MQSingleLineAddress.prototype.getCountry=function(){return this.getProperty("Country");};MQGeoAddress.prototype=new MQAddress();MQGeoAddress.prototype.constructor=MQGeoAddress;function MQGeoAddress(){MQAddress.call(this);this.setM_Xpath("GeoAddress");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getGEOADDRESS()));var m_MQLatLng=new MQLatLng();this.getMQLatLng=function(){return m_MQLatLng;};this.setMQLatLng=function(latLng){m_MQLatLng=latLng;};}
MQGeoAddress.prototype.getClassName=function(){return"MQGeoAddress";};MQGeoAddress.prototype.getObjectVersion=function(){return 0;};MQGeoAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var lat=this.getProperty("LatLng/Lat");var lng=this.getProperty("LatLng/Lng");this.getMQLatLng().setLatLng(lat,lng);};MQGeoAddress.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getMQLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQGeoAddress.prototype.setDistAlong=function(dblDistAlong){this.setProperty("DistAlong",dblDistAlong);};MQGeoAddress.prototype.getDistAlong=function(){return this.getProperty("DistAlong");};MQGeoAddress.prototype.setGEFID=function(intGEFID){this.setProperty("GEFID",intGEFID);};MQGeoAddress.prototype.getGEFID=function(){return this.getProperty("GEFID");};MQGeoAddress.prototype.setResultCode=function(strResultCode){this.setProperty("ResultCode",strResultCode);};MQGeoAddress.prototype.getResultCode=function(){return this.getProperty("ResultCode");};MQGeoAddress.prototype.setSourceId=function(strSourceId){this.setProperty("SourceId",strSourceId);};MQGeoAddress.prototype.getSourceId=function(){return this.getProperty("SourceId");};MQManeuver.prototype=new MQObject();MQManeuver.prototype.constructor=MQManeuver;function MQManeuver(){MQObject.call(this);this.setM_Xpath("Maneuver");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getMANEUVER()));var m_Streets=new MQStringCollection("Item");m_Streets.setM_Xpath("Streets");this.getStreets=function(){return m_Streets;};this.setStreets=function(streets){m_Streets.removeAll();m_Streets.append(streets);};var m_ShapePoints=new MQLatLngCollection();m_ShapePoints.setM_Xpath("ShapePoints");this.getShapePoints=function(){return m_ShapePoints;};this.setShapePoints=function(shapePoints){if(shapePoints.getClassName()==="MQLatLngCollection"){m_ShapePoints.removeAll();m_ShapePoints.append(shapePoints);}
else{alert("failure in setShapePoints");throw"failure in setShapePoints";}};var m_GEFIDs=new MQIntCollection("Item");m_GEFIDs.setM_Xpath("GEFIDs");this.getGEFIDs=function(){return m_GEFIDs;};this.setGEFIDs=function(GEFIDs){m_GEFIDs.removeAll();m_GEFIDs.append(GEFIDs);};var m_Signs=new MQSignCollection("Sign");m_Signs.setM_Xpath("Signs");this.getSigns=function(){return m_Signs;};this.setSigns=function(signs){m_Signs.removeAll();m_Signs.append(signs);};}
MQManeuver.prototype.getClassName=function(){return"MQManeuver";};MQManeuver.prototype.getObjectVersion=function(){return 1;};MQManeuver.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var streets=this.getStreets();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Streets")!==null)
streets.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Streets"));var shapes=this.getShapePoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ShapePoints")!==null)
shapes.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ShapePoints"));var gefids=this.getGEFIDs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/GEFIDs")!==null)
gefids.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/GEFIDs")));var signs=this.getSigns();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Signs")!==null)
signs.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Signs"));};MQManeuver.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getStreets().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Streets"));newNode=MQA.createXMLDoc(this.getShapePoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"ShapePoints"));newNode=MQA.createXMLDoc(this.getGEFIDs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"GEFIDs"));newNode=MQA.createXMLDoc(this.getSigns().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Signs"));return mqXmlToStr(this.getM_XmlDoc());};MQManeuver.prototype.setTurnType=function(type){this.setProperty("TurnType",type);};MQManeuver.prototype.getTurnType=function(){return this.getProperty("TurnType");};MQManeuver.prototype.setDistance=function(distance){this.setProperty("Distance",distance);};MQManeuver.prototype.getDistance=function(){return this.getProperty("Distance");};MQManeuver.prototype.setTime=function(seconds){this.setProperty("Time",seconds);};MQManeuver.prototype.getTime=function(){return this.getProperty("Time");};MQManeuver.prototype.setDirection=function(direction){this.setProperty("Direction",direction);};MQManeuver.prototype.getDirection=function(){return this.getProperty("Direction");};MQManeuver.prototype.getDirectionName=function(){switch(parseInt(this.getDirection()))
{case MQCONSTANT.MQMANEUVER_HEADING_NORTH:return"North";case MQCONSTANT.MQMANEUVER_HEADING_NORTH_WEST:return"Northwest";case MQCONSTANT.MQMANEUVER_HEADING_NORTH_EAST:return"Northeast";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH:return"South";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH_EAST:return"Southeast";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH_WEST:return"Southwest";case MQCONSTANT.MQMANEUVER_HEADING_WEST:return"West";case MQCONSTANT.MQMANEUVER_HEADING_EAST:return"East";default:return"";}};MQManeuver.prototype.setAttributes=function(attributes){this.setProperty("Attributes",attributes);};MQManeuver.prototype.getAttributes=function(){return this.getProperty("Attributes");};MQManeuver.prototype.setNarrative=function(narrative){this.setProperty("Narrative",narrative);};MQManeuver.prototype.getNarrative=function(){return this.getProperty("Narrative");};MQTrekRoute.prototype=new MQObject();MQTrekRoute.prototype.constructor=MQTrekRoute;function MQTrekRoute(){MQObject.call(this);this.setM_Xpath("TrekRoute");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getTREKROUTE()));var maneuverList=new MQManeuverCollection("Maneuver");maneuverList.setM_Xpath("Maneuvers");this.getManeuvers=function(){return maneuverList;};var shapePoints=null;this.getShapePoints=function(){if(shapePoints===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return shapePoints;};var distance=null;this.getDistance=function(){if(distance===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return distance;};var time=null;this.getTime=function(){if(time===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return time;};}
MQTrekRoute.prototype.getClassName=function(){return"MQTrekRoute";};MQTrekRoute.prototype.getObjectVersion=function(){return 0;};MQTrekRoute.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var maneuvers=this.getManeuvers();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Maneuvers")!==null)
maneuvers.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Maneuvers")));};MQTrekRoute.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getManeuvers().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Maneuvers"));return mqXmlToStr(this.getM_XmlDoc());};MQGeocodeOptions.prototype=new MQObject();MQGeocodeOptions.prototype.constructor=MQGeocodeOptions;function MQGeocodeOptions(){MQObject.call(this);this.setM_Xpath("GeocodeOptions");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getGEOCODEOPTIONS()));var m_MatchType=new MQMatchType(0);this.getMatchType=function(){return m_MatchType;};this.setMatchType=function(MatchType){m_MatchType=MatchType;};var m_QualityType=new MQQualityType(0);this.getQualityType=function(){return m_QualityType;};this.setQualityType=function(QualityType){m_QualityType=QualityType;};};MQGeocodeOptions.prototype.getClassName=function(){return"MQGeocodeOptions";};MQGeocodeOptions.prototype.getObjectVersion=function(){return 0;};MQGeocodeOptions.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));this.setMatchType(new MQMatchType(Math.floor(this.getProperty("MatchType"))));this.getQualityType(new MQQualityType(Math.floor(this.getProperty("QualityType"))));};MQGeocodeOptions.prototype.saveXml=function(){this.setProperty("MatchType",this.getMatchType().intValue());this.setProperty("QualityType",this.getQualityType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQGeocodeOptions.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQGeocodeOptions.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQGeocodeOptions.prototype.setMaxMatches=function(nMax){this.setProperty("MaxMatches",nMax);};MQGeocodeOptions.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};MQRouteOptions.prototype=new MQObject();MQRouteOptions.prototype.constructor=MQRouteOptions;function MQRouteOptions(){MQObject.call(this);this.setM_Xpath("RouteOptions");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getROUTEOPTIONS()));var m_AvoidAttrList=new MQStringCollection();m_AvoidAttrList.setM_Xpath("AvoidAttributeList");this.getAvoidAttrList=function(){return m_AvoidAttrList;};this.setAvoidAttrList=function(avoidAttrList){m_AvoidAttrList.removeAll();m_AvoidAttrList.append(avoidAttrList);};var m_AvoidGefIdList=new MQIntCollection();m_AvoidGefIdList.setM_Xpath("AvoidGefIdList");this.getAvoidGefIdList=function(){return m_AvoidGefIdList;};this.setAvoidGefIdList=function(avoidGefIdList){m_AvoidGefIdList.removeAll();m_AvoidGefIdList.append(avoidGefIdList);};var m_AvoidAbsGefIdList=new MQIntCollection();m_AvoidAbsGefIdList.setM_Xpath("AvoidAbsoluteGefIdList");this.getAvoidAbsGefIdList=function(){return m_AvoidAbsGefIdList;};this.setAvoidAbsGefIdList=function(avoidAbsGefIdList){m_AvoidAbsGefIdList.removeAll();m_AvoidAbsGefIdList.append(avoidAbsGefIdList);};var m_AutoRouteCovSwitch=new MQAutoRouteCovSwitch("CovSwitcher");this.getAutoRouteCovSwitch=function(){return m_AutoRouteCovSwitch;};this.setAutoRouteCovSwitch=function(autoRouteCovSwitch){m_AutoRouteCovSwitch=autoRouteCovSwitch;};var m_RouteType=new MQRouteType(0);this.getRouteType=function(){return m_RouteType;};this.setRouteType=function(routeType){m_RouteType=routeType;};var m_NarrativeType=new MQNarrativeType(0);this.getNarrativeType=function(){return m_NarrativeType;};this.setNarrativeType=function(narrativeType){m_NarrativeType=narrativeType;};var m_DistanceUnits=new MQDistanceUnits(0);this.getDistanceUnits=function(){return m_DistanceUnits;};this.setDistanceUnits=function(distanceUnits){m_DistanceUnits=distanceUnits;};};MQRouteOptions.prototype.getClassName=function(){return"MQRouteOptions";};MQRouteOptions.prototype.getObjectVersion=function(){return 3;};MQRouteOptions.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var avoidAttributeList=this.getAvoidAttrList();avoidAttributeList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidAttributeList")));var avoidGefIdList=this.getAvoidGefIdList();avoidGefIdList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidGefIdList")));var avoidAbsoluteGefIdList=this.getAvoidAbsGefIdList();avoidAbsoluteGefIdList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidAbsoluteGefIdList")));var covSwitcher=this.getAutoRouteCovSwitch();covSwitcher.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CovSwitcher")));this.setRouteType(new MQRouteType(Math.floor(this.getProperty("RouteType"))));this.getNarrativeType(new MQNarrativeType(Math.floor(this.getProperty("NarrativeType"))));this.getDistanceUnits(new MQDistanceUnits(Math.floor(this.getProperty("NarrativeDistanceUnitType"))));};MQRouteOptions.prototype.saveXml=function(){var newNode=null;this.setProperty("RouteType",this.getRouteType().intValue());this.setProperty("NarrativeType",this.getNarrativeType().intValue());this.setProperty("NarrativeDistanceUnitType",this.getDistanceUnits().getValue());newNode=MQA.createXMLDoc(this.getAutoRouteCovSwitch().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CovSwitcher"));newNode=MQA.createXMLDoc(this.getAvoidAttrList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidAttributeList"));newNode=MQA.createXMLDoc(this.getAvoidGefIdList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidGefIdList"));newNode=MQA.createXMLDoc(this.getAvoidAbsGefIdList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidAbsoluteGefIdList"));return mqXmlToStr(this.getM_XmlDoc());};MQRouteOptions.prototype.setMaxShapePointsPerManeuver=function(nCount){this.setProperty("MaxShape",nCount);};MQRouteOptions.prototype.getMaxShapePointsPerManeuver=function(){return this.getProperty("MaxShape");};MQRouteOptions.prototype.setMaxGEFIDsPerManeuver=function(nCount){this.setProperty("MaxGEFID",nCount);};MQRouteOptions.prototype.getMaxGEFIDsPerManeuver=function(){return this.getProperty("MaxGEFID");};MQRouteOptions.prototype.setLanguage=function(strLanguage){this.setProperty("Language",strLanguage);};MQRouteOptions.prototype.getLanguage=function(){return this.getProperty("Language");};MQRouteOptions.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQRouteOptions.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQRouteOptions.prototype.setStateBoundaryDisplay=function(bFlag){this.setProperty("StateBoundaryDisplay",(bFlag===true)?1:0);};MQRouteOptions.prototype.getStateBoundaryDisplay=function(){return(this.getProperty("StateBoundaryDisplay")==1)?true:false;};MQRouteOptions.prototype.setCountryBoundaryDisplay=function(bFlag){this.setProperty("CountryBoundaryDisplay",(bFlag===true)?1:0);};MQRouteOptions.prototype.getCountryBoundaryDisplay=function(){return(this.getProperty("CountryBoundaryDisplay")==1)?true:false;};MQRouteResults.prototype=new MQObject();MQRouteResults.prototype.constructor=MQRouteResults;function MQRouteResults(){MQObject.call(this);this.setM_Xpath("RouteResults");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getROUTERESULTS()));var m_Locations=new MQLocationCollection();m_Locations.setM_Xpath("Locations");this.getLocations=function(){return m_Locations;};var m_TrekRoutes=new MQTrekRouteCollection("TrekRoute");m_TrekRoutes.setM_Xpath("TrekRoutes");this.getTrekRoutes=function(){return m_TrekRoutes;};var m_ResultCode=new MQRouteResultsCode(MQCONSTANT.MQROUTERESULTSCODE_NOT_SPECIFIED);this.getResultCode=function(){return m_ResultCode;};this.setResultCode=function(resultCode){m_ResultCode=resultCode;};var m_ResultMessages=new MQStringCollection("Item");m_ResultMessages.setM_Xpath("ResultMessages");this.getResultMessages=function(){return m_ResultMessages;};var shapePoints=null;this.getShapePoints=function(){if(shapePoints===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return shapePoints;};var distance=-1.0;this.getDistance=function(){if(distance===-1.0){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return distance;};var time=-1;this.getTime=function(){if(time===-1){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return time;};}
MQRouteResults.prototype.getClassName=function(){return"MQRouteResults";};MQRouteResults.prototype.getObjectVersion=function(){return 1;};MQRouteResults.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var locs=this.getLocations();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Locations")!==null)
locs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Locations")));var trek=this.getTrekRoutes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TrekRoutes")!==null)
trek.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TrekRoutes")));var mesgs=this.getResultMessages();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")!==null)
mesgs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")));this.setResultCode(new MQRouteResultsCode(Math.floor(this.getProperty("ResultCode"))));};MQRouteResults.prototype.saveXml=function(){this.setProperty("ResultCode",this.getResultCode().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRouteResults.prototype.setCoverageName=function(strName){this.setProperty("CoverageName",strName);};MQRouteResults.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQRouteMatrixResults.prototype=new MQObject();MQRouteMatrixResults.prototype.constructor=MQRouteMatrixResults;function MQRouteMatrixResults(){MQObject.call(this);this.setM_Xpath("RouteMatrixResults");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getROUTEMATRIXRESULTS()));var m_LocationCount=-1;var m_Distance=null;this.setDistance=function(col){if(col){if(col.getClassName()==="MQIntCollection"){if(m_Distance!==null){m_Distance.removeAll();m_Distance.append(col);}else{m_Distance=col;}}else{alert("failure in setDistance -- col is not MQIntCollection type");throw"failure in setDistance -- col is not MQIntCollection type";}}else{alert("failure in setDistance -- col is null");throw"failure in setDistance -- col is null";}};this.getDistance=function(from,to){if(m_LocationCount===-1){m_LocationCount=this.getProperty("LocationCount");}
var pos=((from*m_LocationCount)+to);return(m_Distance.get(pos)/1000.0).toFixed(6);};var m_Time=null;this.setTime=function(col){if(col){if(col.getClassName()==="MQIntCollection"){if(m_Time!==null){m_Time.removeAll();m_Time.append(col);}else{m_Time=col;}}else{alert("failure in setTime -- col is not MQIntCollection type");throw"failure in setTime -- col is not MQIntCollection type";}}else{alert("failure in setTime -- col is null");throw"failure in setTime -- col is null";}};this.getTime=function(from,to){if(m_LocationCount===-1){m_LocationCount=this.getProperty("LocationCount");}
var pos=((from*m_LocationCount)+to);return m_Time.get(pos);};var m_ResultCode=new MQRouteMatrixResultsCode(MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED);this.getResultCode=function(){return m_ResultCode;};this.setResultCode=function(rc){if(rc){if(rc.getClassName()==="MQRouteMatrixResultsCode"){m_ResultCode=rc;}else{alert("failure in setResultsCode -- rc is not MQRouteMatrixResultsCode type");throw"failure in setResultsCode -- rc is not MQRouteMatrixResultsCode type";}}else{alert("failure in setResultsCode -- rc is null");throw"failure in setResultsCode -- rc is null";}};var m_ResultMessages=null;this.setResultMessages=function(col){if(col){if(col.getClassName()==="MQStringCollection"){if(m_ResultMessages!==null){m_ResultMessages.removeAll();m_ResultMessages.append(col);}else{m_ResultMessages=col;}}else{alert("failure in setResultMessages -- col is not MQStringCollection type");throw"failure in setResultMessages -- col is not MQStringCollection type";}}else{alert("failure in setResultMessages -- col is null");throw"failure in setResultMessages -- col is null";}};this.getResultsMessages=function(){return m_ResultMessages;};}
MQRouteMatrixResults.prototype.getClassName=function(){return"MQRouteMatrixResults";};MQRouteMatrixResults.prototype.getObjectVersion=function(){return 0;};MQRouteMatrixResults.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var dis=new MQIntCollection();dis.setM_Xpath("DistanceMatrix");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DistanceMatrix")!==null)
dis.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DistanceMatrix")));this.setDistance(dis);var tim=new MQIntCollection();tim.setM_Xpath("TimeMatrix");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TimeMatrix")!==null)
tim.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TimeMatrix")));this.setTime(tim);var mes=new MQStringCollection();mes.setM_Xpath("ResultMessages");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")!==null)
mes.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")));this.setResultMessages(mes);this.setResultCode(new MQRouteMatrixResultsCode(Math.floor(this.getProperty("ResultCode"))));};MQRouteMatrixResults.prototype.saveXml=function(){this.setProperty("ResultCode",this.getResultCode().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRouteMatrixResults.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQRouteMatrixResults.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQRouteMatrixResults.prototype.getAllToAllFlag=function(){return(this.getProperty("AllToAll")==1)?true:false;}
MQRecordSet.prototype=new MQObject();MQRecordSet.prototype.constructor=MQRecordSet;function MQRecordSet(){MQObject.call(this);this.setM_Xpath("RecordSet");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getRECORDSET()));var m_EOF=true;var m_BOF=true;var m_recCnt=0;var m_curRec=-1;var m_Fields=new MQStringCollection();m_Fields.setM_Xpath("Fields");var m_Records=new MQStrColCollection("Record");m_Records.setM_Xpath("Records");m_Records.setValidClassName("MQStringCollection");this.moveFirst=function(){if(m_Records.getSize()!==0){m_EOF=false;m_BOF=false;m_curRec=0;}else{alert(MQERROR.RECORDSET_MOVEFIRST_1);throw MQERROR.RECORDSET_MOVEFIRST_1;}};this.moveLast=function(){if(m_Records.getSize()!==0){m_EOF=false;m_BOF=false;m_curRec=m_Records.getSize()-1;}else{alert(MQERROR.RECORDSET_MOVELAST_1);throw MQERROR.RECORDSET_MOVELAST_1;}};this.moveNext=function(){var numRecs=m_Records.getSize();if(numRecs!==0){if(m_curRec<numRecs-1){m_curRec++;m_BOF=false;m_EOF=false;}else if(m_curRec===numRecs-1){m_curRec++;m_BOF=false;m_EOF=true;}else if(m_EOF){alert(MQERROR.RECORDSET_MOVENEXT_1);throw MQERROR.RECORDSET_MOVENEXT_1;}else{alert(MQERROR.RECORDSET_MOVENEXT_2);throw MQERROR.RECORDSET_MOVENEXT_2;}}else{alert(MQERROR.RECORDSET_MOVENEXT_3);throw MQERROR.RECORDSET_MOVENEXT_3;}};this.isBOF=function(){return m_BOF;};this.isEOF=function(){return m_EOF;};this.getFieldNames=function(){return m_Fields;};this.getField=function(strFieldName){if(!(0<=m_curRec&&m_curRec<m_recCnt)){alert(MQERROR.RECORDSET_GETFIELD_1);throw MQERROR.RECORDSET_GETFIELD_1;}
var pos=-1;for(var i=0;i<m_Fields.getSize();i++){if(m_Fields.get(i)===strFieldName){pos=i;break;}}
if(pos===-1){alert(MQERROR.RECORDSET_GETFIELD_2);throw MQERROR.RECORDSET_GETFIELD_2;}
return m_Records.get(m_curRec).get(pos);};this.loadXml=function(strXml){var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);m_Fields.loadXml(mqXmlToStr(mqGetNode(xmlDoc,"/"+this.getM_Xpath()+"/Fields")));if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var col=null;m_Records.removeAll();for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="Record"){col=new MQStringCollection();col.setM_Xpath("Record");col.loadXml(mqXmlToStr(nodes[count]));m_Records.add(col);}}}
m_recCnt=this.getProperty("RecordCount");if(m_recCnt>0){m_curRec=0;m_BOF=false;m_EOF=false;}};};MQRecordSet.prototype.getClassName=function(){return"MQRecordSet";};MQRecordSet.prototype.getObjectVersion=function(){return 0;};MQRecordSet.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQMapState.prototype=new MQObject();MQMapState.prototype.constructor=MQMapState;function MQMapState(){MQObject.call(this);this.setM_Xpath("MapState");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getMAPSTATE()));var m_MQLatLng=new MQLatLng("Center");this.getCenter=function(){return m_MQLatLng;};this.setCenter=function(latLng){m_MQLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};}
MQMapState.prototype.getClassName=function(){return"MQMapState";};MQMapState.prototype.getObjectVersion=function(){return 0;};MQMapState.prototype.initObject=function(){this.setProperty("Scale",0);this.setCenter(new MQLatLng(0,0));this.setProperty("Width",-1.0);this.setProperty("Height",-1.0);this.setProperty("MapName","");this.setProperty("CoverageName","");}
MQMapState.prototype.equals=function(comparator){if(comparator){try{if(comparator.getClassName()==="MQMapState"){return m_nScale==other.m_nScale&&m_strMapName===other.m_strMapName&&m_strCoverageName===other.m_strCoverageName&&m_llCenter.equals(other.m_llCenter)&&m_dMapWidth===other.m_dMapWidth&&m_dMapHeight===other.m_dMapHeight;}}catch(error){}}
return false;};MQMapState.prototype.setMapName=function(strName){this.setProperty("MapName",strName);}
MQMapState.prototype.getMapName=function(){this.getProperty("MapName");}
MQMapState.prototype.setCoverageName=function(strCovId){this.setProperty("CoverageName",strCovId);}
MQMapState.prototype.getCoverageName=function(){this.getProperty("CoverageName");}
MQMapState.prototype.setWidthInches=function(dWidth){this.setProperty("Width",dWidth);}
MQMapState.prototype.getWidthInches=function(){return this.getProperty("Width");}
MQMapState.prototype.setHeightInches=function(dHeight){this.setProperty("Height",dHeight);}
MQMapState.prototype.getHeightInches=function(){return this.getProperty("Height");}
MQMapState.prototype.setWidthPixels=function(iWidth,dpi){if(dpi){this.setProperty("Width",parseFloat(iWidth)/parseFloat(dpi));}else{this.setProperty("Width",parseFloat(iWidth)/parseFloat(72));}}
MQMapState.prototype.getWidthPixels=function(dpi){if(dpi){return Math.ceil(this.getProperty("Width")*dpi);}else{return Math.ceil(this.getProperty("Width")*72);}}
MQMapState.prototype.setHeightPixels=function(iHeight,dpi){if(dpi){this.setProperty("Height",parseFloat(iHeight)/parseFloat(dpi));}else{this.setProperty("Height",parseFloat(iHeight)/parseFloat(72));}}
MQMapState.prototype.getHeightPixels=function(dpi){if(dpi){return Math.ceil(this.getProperty("Height")*dpi);}else{return Math.ceil(this.getProperty("Height")*72);}}
MQMapState.prototype.setMapScale=function(nNewScale){this.setProperty("Scale",nNewScale);}
MQMapState.prototype.getMapScale=function(){return this.getProperty("Scale");}
MQMapState.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var lat=this.getProperty("Center/Lat");var lng=this.getProperty("Center/Lng");this.getCenter().setLatLng(lat,lng);};MQMapState.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Center"));return mqXmlToStr(this.getM_XmlDoc());};MQSearchCriteria.prototype=new MQObject();MQSearchCriteria.prototype.constructor=MQSearchCriteria;function MQSearchCriteria(){MQObject.call(this);}
MQSearchCriteria.prototype.getClassName=function(){return"MQSearchCriteria";};MQSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQSearchCriteria.prototype.setMaxMatches=function(nMax){this.setProperty("MaxMatches",nMax);};MQSearchCriteria.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};MQRadiusSearchCriteria.prototype=new MQSearchCriteria();MQRadiusSearchCriteria.prototype.constructor=MQRadiusSearchCriteria;function MQRadiusSearchCriteria(){MQObject.call(this);this.setM_Xpath("RadiusSearchCriteria");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getRADIUSSEARCHCRITERIA()));var m_MQLatLng=new MQLatLng("CenterLatLng");this.getCenter=function(){return m_MQLatLng;};this.setCenter=function(latLng){m_MQLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};}
MQRadiusSearchCriteria.prototype.getClassName=function(){return"MQRadiusSearchCriteria";};MQRadiusSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQRadiusSearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var lat=this.getProperty("CenterLatLng/Lat");var lng=this.getProperty("CenterLatLng/Lng");this.getCenter().setLatLng(lat,lng);};MQRadiusSearchCriteria.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQRadiusSearchCriteria.prototype.setRadius=function(radius,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
radius=radius/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("Radius",radius);};MQRadiusSearchCriteria.prototype.getRadius=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var radius=this.getProperty("Radius");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
radius=radius*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return radius;};MQRectSearchCriteria.prototype=new MQSearchCriteria();MQRectSearchCriteria.prototype.constructor=MQRectSearchCriteria;function MQRectSearchCriteria(mqRectLL){MQObject.call(this);this.setM_Xpath("RectSearchCriteria");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getRECTSEARCHCRITERIA()));var m_UpperLeft=new MQLatLng("UpperLeftLatLng");this.getUpperLeft=function(){return m_UpperLeft;};this.setUpperLeft=function(latLng){m_UpperLeft.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_LowerRight=new MQLatLng("LowerRightLatLng");this.getLowerRight=function(){return m_LowerRight;};this.setLowerRight=function(latLng){m_LowerRight.setLatLng(latLng.getLatitude(),latLng.getLongitude());};if(mqRectLL){m_UpperLeft.setLatLng(mqRectLL.getUpperLeft().getLat(),mqRectLL.getUpperLeft().getLng());m_LowerRight.setLatLng(mqRectLL.getLowerRight().getLat(),mqRectLL.getLowerRight().getLng());}}
MQRectSearchCriteria.prototype.getClassName=function(){return"MQRectSearchCriteria";};MQRectSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQRectSearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var lat=this.getProperty("UpperLeftLatLng/Lat");var lng=this.getProperty("UpperLeftLatLng/Lng");this.getUpperLeft().setLatLng(lat,lng);lat=this.getProperty("LowerRightLatLng/Lat");lng=this.getProperty("LowerRightLatLng/Lng");this.getLowerRight().setLatLng(lat,lng);};MQRectSearchCriteria.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getUpperLeft().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=MQA.createXMLDoc(this.getLowerRight().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQPolySearchCriteria.prototype=new MQSearchCriteria();MQPolySearchCriteria.prototype.constructor=MQPolySearchCriteria;function MQPolySearchCriteria(){MQObject.call(this);this.setM_Xpath("PolySearchCriteria");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPOLYSEARCHCRITERIA()));var m_LatLngs=new MQLatLngCollection();m_LatLngs.setM_Xpath("LatLngs");this.getShapePoints=function(){return m_LatLngs;};this.setShapePoints=function(latLngs){if(latLngs.getClassName()==="MQLatLngCollection"){m_LatLngs.removeAll();m_LatLngs.append(latLngs);}
else{alert("failure in setShapePoints");throw"failure in setShapePoints";}};}
MQPolySearchCriteria.prototype.getClassName=function(){return"MQPolySearchCriteria";};MQPolySearchCriteria.prototype.getObjectVersion=function(){return 0;};MQPolySearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlngs=this.getShapePoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));};MQPolySearchCriteria.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getShapePoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));return mqXmlToStr(this.getM_XmlDoc());};MQCorridorSearchCriteria.prototype=new MQPolySearchCriteria();MQCorridorSearchCriteria.prototype.constructor=MQCorridorSearchCriteria;function MQCorridorSearchCriteria(){MQPolySearchCriteria.call(this);this.setM_Xpath("CorridorSearchCriteria");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getCORRIDORSEARCHCRITERIA()));}
MQCorridorSearchCriteria.prototype.getClassName=function(){return"MQCorridorSearchCriteria";};MQCorridorSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQCorridorSearchCriteria.prototype.setCorrExactLinks=function(bExactLinks){this.setProperty("ExactLinks",(bExactLinks===true)?1:0);};MQCorridorSearchCriteria.prototype.getCorrExactLinks=function(){return(this.getProperty("ExactLinks")==1)?true:false;};MQCorridorSearchCriteria.prototype.setCorridorWidth=function(dCorrWidth,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
dCorrWidth=dCorrWidth/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("CorridorWidth",dCorrWidth);};MQCorridorSearchCriteria.prototype.getCorridorWidth=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var width=this.getProperty("CorridorWidth");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
width=width*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return width;};MQCorridorSearchCriteria.prototype.setCorridorBufferWidth=function(dBufferWidth,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
dBufferWidth=dBufferWidth/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("CorridorBufferWidth",dBufferWidth);};MQCorridorSearchCriteria.prototype.getCorridorBufferWidth=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var width=this.getProperty("CorridorBufferWidth");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
width=width*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return width;};MQDBLayerQuery.prototype=new MQObject();MQDBLayerQuery.prototype.constructor=MQDBLayerQuery;function MQDBLayerQuery(){MQObject.call(this);this.setM_Xpath("DBLayerQuery");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDBLAYERQUERY()));};MQDBLayerQuery.prototype.getClassName=function(){return"MQDBLayerQuery";};MQDBLayerQuery.prototype.getObjectVersion=function(){return 0;};MQDBLayerQuery.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQDBLayerQuery.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQDBLayerQuery.prototype.setDBLayerName=function(strName){this.setProperty("LayerName",strName);};MQDBLayerQuery.prototype.getDBLayerName=function(){return this.getProperty("LayerName");};MQDBLayerQuery.prototype.setExtraCriteria=function(strQuery){this.setProperty("ExtraCriteria",strQuery);};MQDBLayerQuery.prototype.getExtraCriteria=function(){return this.getProperty("ExtraCriteria");};MQPrimitive.prototype=new MQObject();MQPrimitive.prototype.constructor=MQPrimitive;function MQPrimitive(){MQObject.call(this);var m_DrawTrigger=new MQDrawTrigger(MQCONSTANT.MQDRAWTRIGGER_AFTER_TEXT);this.getDrawTrigger=function(){return m_DrawTrigger;};this.setDrawTrigger=function(dt){if(dt){if(dt.getClassName()==="MQDrawTrigger"){m_DrawTrigger=dt;}}};var m_CoordinateType=new MQCoordinateType(MQCONSTANT.MQCOORDINATETYPE_GEOGRAPHIC);this.getCoordinateType=function(){return m_CoordinateType;};this.setCoordinateType=function(dt){if(dt){if(dt.getClassName()==="MQCoordinateType"){m_CoordinateType=dt;}}};};MQPrimitive.prototype.getClassName=function(){return"MQPrimitive";};MQPrimitive.prototype.getObjectVersion=function(){return 2;};MQPrimitive.prototype.setKey=function(strKey){this.setProperty("Key",strKey);};MQPrimitive.prototype.getKey=function(){return this.getProperty("Key");}
MQPrimitive.prototype.setOpacity=function(strOpacity){this.setProperty("Opacity",strOpacity);};MQPrimitive.prototype.getOpacity=function(){return this.getProperty("Opacity");}
MQLinePrimitive.prototype=new MQPrimitive();MQLinePrimitive.prototype.constructor=MQLinePrimitive;function MQLinePrimitive(){MQPrimitive.call(this);this.setM_Xpath("LinePrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLINEPRIMITIVE()));var m_Color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_Color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_Color=obj;}}};var m_Style=new MQPenStyle(MQCONSTANT.MQPENSTYLE_SOLID);this.getStyle=function(){return m_Style;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQPenStyle"){m_Style=obj;}}};var m_XYArray=new MQPointCollection();m_XYArray.setM_Xpath("Points");this.getPoints=function(){return m_XYArray;};var m_LLArray=new MQLatLngCollection();m_LLArray.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LLArray;};this.setLatLngs=function(obj){if(obj){if(obj.getClassName()==="MQLatLngCollection"){m_LLArray.removeAll();m_LLArray.append(obj);}}};};MQLinePrimitive.prototype.getClassName=function(){return"MQLinePrimitive";};MQLinePrimitive.prototype.getObjectVersion=function(){return 0;};MQLinePrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var ll=new MQLatLngCollection();ll.setM_Xpath("LatLngs");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
ll.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));this.setLatLngs(ll);var pt=new MQPointCollection();pt.setM_Xpath("Points");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
pt.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));this.setPoints(ll);this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));};MQLinePrimitive.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=MQA.createXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQLinePrimitive.prototype.setWidth=function(width){this.setProperty("Width",width);};MQLinePrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQPolygonPrimitive.prototype=new MQLinePrimitive();MQPolygonPrimitive.prototype.constructor=MQPolygonPrimitive;function MQPolygonPrimitive(){MQLinePrimitive.call(this);this.setM_Xpath("LinePrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPOLYGONPRIMITIVE()));var m_FillColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_RED);this.getFillColor=function(){return m_FillColor;};this.setFillColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FillColor=obj;}}};var m_FillStyle=new MQFillStyle(MQCONSTANT.MQFILLSTYLE_SOLID);this.getFillStyle=function(){return m_FillStyle;};this.setFillStyle=function(obj){if(obj){if(obj.getClassName()==="MQFillStyle"){m_FillStyle=obj;}}};};MQPolygonPrimitive.prototype.getClassName=function(){return"MQPolygonPrimitive";};MQPolygonPrimitive.prototype.getObjectVersion=function(){return 0;};MQPolygonPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var ll=new MQLatLngCollection();ll.setM_Xpath("LatLngs");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
ll.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));this.setLatLngs(ll);var pt=new MQPointCollection();pt.setM_Xpath("Points");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
pt.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));this.setPoints(ll);this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));this.setFillColor(new MQColorStyle(Math.floor(this.getProperty("FillColor"))));this.setFillStyle(new MQFillStyle(Math.floor(this.getProperty("FillStyle"))));};MQPolygonPrimitive.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=MQA.createXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("FillColor",this.getFillColor().intValue());this.setProperty("FillStyle",this.getFillStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRectanglePrimitive.prototype=new MQPrimitive();MQRectanglePrimitive.prototype.constructor=MQRectanglePrimitive;function MQRectanglePrimitive(){MQPrimitive.call(this);this.setM_Xpath("RectanglePrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getRECTANGLEPRIMITIVE()));var m_Color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_Color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_Color=obj;}}};var m_Style=new MQPenStyle(MQCONSTANT.MQPENSTYLE_SOLID);this.getStyle=function(){return m_Style;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQPenStyle"){m_Style=obj;}}};var m_FillColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_RED);this.getFillColor=function(){return m_FillColor;};this.setFillColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FillColor=obj;}}};var m_FillStyle=new MQFillStyle(MQCONSTANT.MQFILLSTYLE_SOLID);this.getFillStyle=function(){return m_FillStyle;};this.setFillStyle=function(obj){if(obj){if(obj.getClassName()==="MQFillStyle"){m_FillStyle=obj;}}};var m_UpperLeftLL=new MQLatLng("UpperLeftLatLng");this.getUpperLeftLatLng=function(){return m_UpperLeftLL;};this.setUpperLeftLatLng=function(latLng){m_UpperLeftLL.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_LowerRightLL=new MQLatLng("LowerRightLatLng");this.getLowerRightLatLng=function(){return m_LowerRightLL;};this.setLowerRightLatLng=function(latLng){m_LowerRightLL.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_UpperLeftPT=new MQPoint("UpperLeftPoint");this.getUpperLeftPoint=function(){return m_UpperLeftPT;};this.setUpperLeftPoint=function(point){m_UpperLeftPT.setXY(point.getX(),point.getY());};var m_LowerRightPT=new MQPoint("LowerRightPoint");this.getLowerRightPoint=function(){return m_LowerRightPT;};this.setLowerRightPoint=function(point){m_LowerRightPT.setXY(point.getX(),point.getY());};};MQRectanglePrimitive.prototype.getClassName=function(){return"MQRectanglePrimitive";};MQRectanglePrimitive.prototype.getObjectVersion=function(){return 0;};MQRectanglePrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getUpperLeftLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));latlng=this.getLowerRightLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")));var point=this.getUpperLeftPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));point=this.getLowerRightPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));this.setFillColor(new MQColorStyle(Math.floor(this.getProperty("FillColor"))));this.setFillStyle(new MQFillStyle(Math.floor(this.getProperty("FillStyle"))));};MQRectanglePrimitive.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getUpperLeftLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=MQA.createXMLDoc(this.getLowerRightLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));newNode=MQA.createXMLDoc(this.getUpperLeftPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));newNode=MQA.createXMLDoc(this.getLowerRightPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("FillColor",this.getFillColor().intValue());this.setProperty("FillStyle",this.getFillStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRectanglePrimitive.prototype.setWidth=function(width){this.setProperty("Width",width);};MQRectanglePrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQEllipsePrimitive.prototype=new MQRectanglePrimitive();MQEllipsePrimitive.prototype.constructor=MQEllipsePrimitive;function MQEllipsePrimitive(){MQRectanglePrimitive.call(this);this.setM_Xpath("EllipsePrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getELLIPSEPRIMITIVE()));}
MQEllipsePrimitive.prototype.getClassName=function(){return"MQEllipsePrimitive";};MQEllipsePrimitive.prototype.getObjectVersion=function(){return 0;};MQSymbolPrimitive.prototype=new MQPrimitive();MQSymbolPrimitive.prototype.constructor=MQSymbolPrimitive;function MQSymbolPrimitive(){MQPrimitive.call(this);this.setM_Xpath("SymbolPrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSYMBOLPRIMITIVE()));var m_pt=new MQPoint("CenterPoint");this.getCenterPoint=function(){return m_pt;};this.setCenterPoint=function(point){m_pt.setXY(point.getX(),point.getY());};var m_ll=new MQLatLng("CenterLatLng");this.getCenterLatLng=function(){return m_ll;};this.setCenterLatLng=function(latLng){m_ll.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_SymbolType=new MQSymbolType(MQCONSTANT.MQSYMBOLTYPE_RASTER);this.getSymbolType=function(){return m_SymbolType;};this.setSymbolType=function(obj){if(obj){if(obj.getClassName()==="MQSymbolType"){m_SymbolType=obj;}}};}
MQSymbolPrimitive.prototype.getClassName=function(){return"MQSymbolPrimitive";};MQSymbolPrimitive.prototype.getObjectVersion=function(){return 0;};MQSymbolPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setSymbolType(new MQSymbolType(Math.floor(this.getProperty("SymbolType"))));};MQSymbolPrimitive.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=MQA.createXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("SymbolType",this.getSymbolType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQSymbolPrimitive.prototype.setSymbolName=function(symbolName){this.setProperty("SymbolName",symbolName);};MQSymbolPrimitive.prototype.getSymbolName=function(){return this.getProperty("SymbolName");}
MQTextPrimitive.prototype=new MQPrimitive();MQTextPrimitive.prototype.constructor=MQTextPrimitive;function MQTextPrimitive(){MQPrimitive.call(this);this.setM_Xpath("TextPrimitive");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getTEXTPRIMITIVE()));var m_pt=new MQPoint("UpperLeftPoint");this.getUpperLeftPoint=function(){return m_pt;};this.setUpperLeftPoint=function(point){m_pt.setXY(point.getX(),point.getY());};var m_ll=new MQLatLng("UpperLeftLatLng");this.getUpperLeftLatLng=function(){return m_ll;};this.setUpperLeftLatLng=function(latLng){m_ll.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_color=obj;}}};var m_nStyle=new MQFontStyle(MQCONSTANT.MQFONTSTYLE_BOXED);this.getStyle=function(){return m_nStyle;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQFontStyle"){m_nStyle=obj;}}};var m_bgdColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_WHITE);this.getBkgdColor=function(){return m_bgdColor;};this.setBkgdColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_bgdColor=obj;}}};var m_lBoxOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getBoxOutlineColor=function(){return m_lBoxOutlineColor;};this.setBoxOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_lBoxOutlineColor=obj;}}};var m_lOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getOutlineColor=function(){return m_lOutlineColor;};this.setOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_lOutlineColor=obj;}}};}
MQTextPrimitive.prototype.getClassName=function(){return"MQTextPrimitive";};MQTextPrimitive.prototype.getObjectVersion=function(){return 0;};MQTextPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var latlng=this.getUpperLeftLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));var point=this.getUpperLeftPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQFontStyle(Math.floor(this.getProperty("Style"))));this.setBkgdColor(new MQColorStyle(Math.floor(this.getProperty("BkgdColor"))));this.setBoxOutlineColor(new MQColorStyle(Math.floor(this.getProperty("BoxOutlineColor"))));this.setOutlineColor(new MQColorStyle(Math.floor(this.getProperty("OutlineColor"))));};MQTextPrimitive.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getUpperLeftLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=MQA.createXMLDoc(this.getUpperLeftPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("BkgdColor",this.getBkgdColor().intValue());this.setProperty("BoxOutlineColor",this.getBoxOutlineColor().intValue());this.setProperty("OutlineColor",this.getOutlineColor().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQTextPrimitive.prototype.setText=function(str){this.setProperty("Text",str);};MQTextPrimitive.prototype.getText=function(){return this.getProperty("Text");}
MQTextPrimitive.prototype.setFontName=function(str){this.setProperty("FontName",str);};MQTextPrimitive.prototype.getFontName=function(){return this.getProperty("FontName");}
MQTextPrimitive.prototype.setWidth=function(val){this.setProperty("Width",val);};MQTextPrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQTextPrimitive.prototype.setFontSize=function(val){this.setProperty("FontSize",val);};MQTextPrimitive.prototype.getFontSize=function(){return this.getProperty("FontSize");}
MQTextPrimitive.prototype.setMargin=function(val){this.setProperty("Margin",val);};MQTextPrimitive.prototype.getMargin=function(){return this.getProperty("Margin");}
MQTextPrimitive.prototype.setTextAlignment=function(val){this.setProperty("TextAlignment",val);};MQTextPrimitive.prototype.getTextAlignment=function(){return this.getProperty("TextAlignment");}
MQFeatureSpecifier.prototype=new MQObject();MQFeatureSpecifier.prototype.constructor=MQFeatureSpecifier;function MQFeatureSpecifier(){MQObject.call(this);this.setM_Xpath("FeatureSpecifier");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getFEATURESPECIFIER()));var m_Type=new MQFeatureSpeciferAttributeType(MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_GEFID);this.getAttributeType=function(){return m_Type;};this.setAttributeType=function(obj){if(obj){if(obj.getClassName()==="MQFeatureSpeciferAttributeType"){m_Type=obj;}}};};MQFeatureSpecifier.prototype.getClassName=function(){return"MQFeatureSpecifier";};MQFeatureSpecifier.prototype.getObjectVersion=function(){return 0;};MQFeatureSpecifier.prototype.setAttributeValue=function(val){this.setProperty("AttributeValue",val);};MQFeatureSpecifier.prototype.getAttributeValue=function(){return this.getProperty("AttributeValue");};MQBaseDTStyle.prototype=new MQObject();MQBaseDTStyle.prototype.constructor=MQBaseDTStyle;function MQBaseDTStyle(){MQObject.call(this);};MQBaseDTStyle.prototype.getClassName=function(){return"MQBaseDTStyle";};MQBaseDTStyle.prototype.getObjectVersion=function(){return 0;};MQBaseDTStyle.prototype.setDT=function(val){this.setProperty("DT",val);};MQBaseDTStyle.prototype.getDT=function(){return this.getProperty("DT");}
MQBaseDTStyle.prototype.setHighScale=function(val){this.setProperty("HighScale",val);};MQBaseDTStyle.prototype.getHighScale=function(){return this.getProperty("HighScale");}
MQBaseDTStyle.prototype.setLowScale=function(val){this.setProperty("LowScale",val);};MQBaseDTStyle.prototype.getLowScale=function(){return this.getProperty("LowScale");};MQBaseDTStyle.prototype.equals=function(type){if(type){try{var className=type.getClassName();}catch(error){alert("Invalid type for this function!");throw"Invalid type for this function!";}
if(className===this.getClassName()){return(this.getDT()===type.getDT()&&this.getHighScale()===type.getHighScale()&&this.getLowScale()===type.getLowScale());}else{alert("Invalid type for this function!");throw"Invalid type for this function!";}}else{alert("An MQBaseDTStyle parameter must be provided for this function!");throw"An MQBaseDTStyle parameter must be provided for this function!";}};MQDTStyle.prototype=new MQBaseDTStyle();MQDTStyle.prototype.constructor=MQDTStyle;function MQDTStyle(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyle");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDTSTYLE()));var m_FontColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontColor=function(){return m_FontColor;};this.setFontColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontColor=obj;}}};var m_FontOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontOutlineColor=function(){return m_FontOutlineColor;};this.setFontOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontOutlineColor=obj;}}};var m_FontBoxBkgdColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontBoxBkgdColor=function(){return m_FontBoxBkgdColor;};this.setFontBoxBkgdColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontBoxBkgdColor=obj;}}};var m_FontBoxOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontBoxOutlineColor=function(){return m_FontBoxOutlineColor;};this.setFontBoxOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontBoxOutlineColor=obj;}}};var m_FontStyle=new MQFontStyle(MQCONSTANT.MQFONTSTYLE_INVALID);this.getFontStyle=function(){return m_FontStyle;};this.setFontStyle=function(obj){if(obj){if(obj.getClassName()==="MQFontStyle"){m_FontStyle=obj;}}};var m_SymbolType=new MQSymbolType(MQCONSTANT.MQSYMBOLTYPE_RASTER);this.getSymbolType=function(){return m_SymbolType;};this.setSymbolType=function(obj){if(obj){if(obj.getClassName()==="MQSymbolType"){m_SymbolType=obj;}}};};MQDTStyle.prototype.getClassName=function(){return"MQDTStyle";};MQDTStyle.prototype.getObjectVersion=function(){return 0;};MQDTStyle.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));this.setFontColor(new MQColorStyle(Math.floor(this.getProperty("FontColor"))));this.setFontOutlineColor(new MQColorStyle(Math.floor(this.getProperty("FontOutlineColor"))));this.setFontBoxBkgdColor(new MQColorStyle(Math.floor(this.getProperty("FontBoxBkgdColor"))));this.setFontBoxOutlineColor(new MQColorStyle(Math.floor(this.getProperty("FontBoxOutlineColor"))));this.setFontStyle(new MQFontStyle(Math.floor(this.getProperty("FeatureSpeciferAttributeType"))));this.setSymbolType(new MQSymbolType(Math.floor(this.getProperty("SymbolType"))));};MQDTStyle.prototype.saveXml=function(){this.setProperty("FontColor",this.getFontColor().intValue());this.setProperty("FontOutlineColor",this.getFontOutlineColor().intValue());this.setProperty("FontBoxBkgdColor",this.getFontBoxBkgdColor().intValue());this.setProperty("FontBoxOutlineColor",this.getFontBoxOutlineColor().intValue());this.setProperty("FontStyle",this.getFontStyle().intValue());this.setProperty("SymbolType",this.getSymbolType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQDTStyle.prototype.setSymbolName=function(val){this.setProperty("SymbolName",val);};MQDTStyle.prototype.getSymbolName=function(){return this.getProperty("SymbolName");};MQDTStyle.prototype.setFontName=function(val){this.setProperty("FontName",val);};MQDTStyle.prototype.getFontName=function(){return this.getProperty("FontName");};MQDTStyle.prototype.setVisible=function(bFlag){this.setProperty("Visible",(bFlag===true)?1:0);};MQDTStyle.prototype.getVisible=function(){return(this.getProperty("Visible")==1)?true:false;};MQDTStyle.prototype.setLabelVisible=function(bFlag){this.setProperty("LabelVisible",(bFlag===true)?1:0);};MQDTStyle.prototype.getLabelVisible=function(){return(this.getProperty("LabelVisible")==1)?true:false;};MQDTStyle.prototype.setFontSize=function(val){this.setProperty("FontSize",val);};MQDTStyle.prototype.getFontSize=function(){return this.getProperty("FontSize");}
MQDTStyle.prototype.setFontBoxMargin=function(val){this.setProperty("FontBoxMargin",val);};MQDTStyle.prototype.getFontBoxMargin=function(){return this.getProperty("FontBoxMargin");}
MQDTStyleEx.prototype=new MQBaseDTStyle();MQDTStyleEx.prototype.constructor=MQDTStyleEx;function MQDTStyleEx(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDTSTYLEEX()));};MQDTStyleEx.prototype.getClassName=function(){return"MQDTStyleEx";};MQDTStyleEx.prototype.getObjectVersion=function(){return 0;};MQDTStyleEx.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQDTStyleEx.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQDTStyleEx.prototype.setStyleString=function(val){this.setProperty("StyleString",val);};MQDTStyleEx.prototype.getStyleString=function(){return this.getProperty("StyleString");};MQDTFeatureStyleEx.prototype=new MQDTStyleEx();MQDTFeatureStyleEx.prototype.constructor=MQDTFeatureStyleEx;function MQDTFeatureStyleEx(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDTFEATURESTYLEEX()));var m_Col=new MQFeatureSpecifierCollection("FeatureSpecifier");m_Col.setM_Xpath("FeatureSpecifierCollection");this.getFeatureSpecifiers=function(){return m_Col;};this.setFeatureSpecifiers=function(col){if(mqIsClass(m_Col.getClassName(),col,false)){m_Col.removeAll();m_Col.append(col);}};};MQDTFeatureStyleEx.prototype.getClassName=function(){return"MQDTFeatureStyleEx";};MQDTFeatureStyleEx.prototype.getObjectVersion=function(){return 0;};MQDTFeatureStyleEx.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQDTFeatureStyleEx.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQMapCommand.prototype=new MQObject();MQMapCommand.prototype.constructor=MQMapCommand;function MQMapCommand(){MQObject.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDTFEATURESTYLEEX()));var m_Col=new MQFeatureSpecifierCollection("FeatureSpecifier");m_Col.setM_Xpath("FeatureSpecifierCollection");this.getFeatureSpecifiers=function(){return m_Col;};this.setFeatureSpecifiers=function(col){if(col.getClassName()==="MQFeatureSpecifierCollection")
m_Col=col;else{alert("failure in setFeatureSpecifiers");throw"failure in setFeatureSpecifiers";}};}
MQMapCommand.prototype.getClassName=function(){return"MQMapCommand";};MQMapCommand.prototype.getObjectVersion=function(){return 0;};MQBestFit.prototype=new MQMapCommand();MQBestFit.prototype.constructor=MQBestFit;function MQBestFit(){MQMapCommand.call(this);this.setM_Xpath("BestFit");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getBESTFIT()));var m_DisplayTypes=new MQDTCollection();m_DisplayTypes.setM_Xpath("DisplayTypes");this.getDisplayTypes=function(){return m_DisplayTypes;};this.setDisplayTypes=function(col){m_DisplayTypes.removeAll();m_DisplayTypes.append(col);};}
MQBestFit.prototype.getClassName=function(){return"MQBestFit";};MQBestFit.prototype.getObjectVersion=function(){return 2;};MQBestFit.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getDisplayTypes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DisplayTypes")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DisplayTypes")));};MQBestFit.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getDisplayTypes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DisplayTypes"));return mqXmlToStr(this.getM_XmlDoc());};MQBestFit.prototype.setIncludePrimitives=function(bFlag){this.setProperty("IncludePrimitives",(bFlag===true)?1:0);};MQBestFit.prototype.getIncludePrimitives=function(){return(this.getProperty("IncludePrimitives")==1)?true:false;};MQBestFit.prototype.setKeepCenter=function(bFlag){this.setProperty("KeepCenter",(bFlag===true)?1:0);};MQBestFit.prototype.getKeepCenter=function(){return(this.getProperty("KeepCenter")==1)?true:false;};MQBestFit.prototype.setSnapToZoomLevel=function(bFlag){this.setProperty("SnapToZoomLevel",(bFlag===true)?1:0);};MQBestFit.prototype.getSnapToZoomLevel=function(){return(this.getProperty("SnapToZoomLevel")==1)?true:false;};MQBestFit.prototype.setScaleAdjustmentFactor=function(val){this.setProperty("ScaleAdjFactor",val);};MQBestFit.prototype.getScaleAdjustmentFactor=function(){return this.getProperty("ScaleAdjFactor");}
MQBestFitLL.prototype=new MQMapCommand();MQBestFitLL.prototype.constructor=MQBestFitLL;function MQBestFitLL(){MQMapCommand.call(this);this.setM_Xpath("BestFitLL");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getBESTFITLL()));var m_LatLng=new MQLatLngCollection();m_LatLng.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LatLng;};this.setLatLngs=function(col){m_LatLng.removeAll();m_LatLng.append(col);};}
MQBestFitLL.prototype.getClassName=function(){return"MQBestFitLL";};MQBestFitLL.prototype.getObjectVersion=function(){return 0;};MQBestFitLL.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));};MQBestFitLL.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));return mqXmlToStr(this.getM_XmlDoc());};MQBestFitLL.prototype.setKeepCenter=function(bFlag){this.setProperty("KeepCenter",(bFlag===true)?1:0);};MQBestFitLL.prototype.getKeepCenter=function(){return(this.getProperty("KeepCenter")==1)?true:false;};MQBestFitLL.prototype.setSnapToZoomLevel=function(bFlag){this.setProperty("SnapToZoomLevel",(bFlag===true)?1:0);};MQBestFitLL.prototype.getSnapToZoomLevel=function(){return(this.getProperty("SnapToZoomLevel")==1)?true:false;};MQBestFitLL.prototype.setScaleAdjustmentFactor=function(val){this.setProperty("ScaleAdjFactor",val);};MQBestFitLL.prototype.getScaleAdjustmentFactor=function(){return this.getProperty("ScaleAdjFactor");}
MQCenter.prototype=new MQMapCommand();MQCenter.prototype.constructor=MQCenter;function MQCenter(){MQMapCommand.call(this);this.setM_Xpath("Center");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getCENTER()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){if(mqIsClass(m_Center.getClassName(),pt,false)){m_Center=pt.internalCopy(m_Center);}};}
MQCenter.prototype.getClassName=function(){return"MQCenter";};MQCenter.prototype.getObjectVersion=function(){return 0;};MQCenter.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQCenter.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQCenterLatLng.prototype=new MQMapCommand();MQCenterLatLng.prototype.constructor=MQCenterLatLng;function MQCenterLatLng(){MQMapCommand.call(this);this.setM_Xpath("CenterLatLng");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getCENTERLATLNG()));var m_Center=new MQLatLng("CenterLatLng");this.getCenter=function(){return m_Center;};this.setCenter=function(ll){if(mqIsClass(m_Center.getClassName(),ll,false)){m_Center=ll.internalCopy(m_Center);}};}
MQCenterLatLng.prototype.getClassName=function(){return"MQCenterLatLng";};MQCenterLatLng.prototype.getObjectVersion=function(){return 0;};MQCenterLatLng.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));};MQCenterLatLng.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQPan.prototype=new MQMapCommand();MQPan.prototype.constructor=MQPan;function MQPan(){MQMapCommand.call(this);this.setM_Xpath("Pan");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPAN()));var m_Point=new MQPoint("DeltaPoint");this.getPoint=function(){return m_Point;};this.setDeltaXY=function(dblX,dblY){m_Point.setXY(dblX,dblY);};this.setDeltaY=function(dblY){m_Point.setY(dblY);};this.setDeltaX=function(dblX){m_Point.setX(dblX);};}
MQPan.prototype.getClassName=function(){return"MQPan";};MQPan.prototype.getObjectVersion=function(){return 0;};MQPan.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DeltaPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DeltaPoint")));};MQPan.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DeltaPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomIn.prototype=new MQMapCommand();MQZoomIn.prototype.constructor=MQZoomIn;function MQZoomIn(){MQMapCommand.call(this);this.setM_Xpath("ZoomIn");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getZOOMIN()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomIn.prototype.getClassName=function(){return"MQZoomIn";};MQZoomIn.prototype.getObjectVersion=function(){return 0;};MQZoomIn.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomIn.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomOut.prototype=new MQMapCommand();MQZoomOut.prototype.constructor=MQZoomOut;function MQZoomOut(){MQMapCommand.call(this);this.setM_Xpath("ZoomOut");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getZOOMOUT()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomOut.prototype.getClassName=function(){return"MQZoomOut";};MQZoomOut.prototype.getObjectVersion=function(){return 0;};MQZoomOut.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomOut.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomTo.prototype=new MQMapCommand();MQZoomTo.prototype.constructor=MQZoomTo;function MQZoomTo(){MQMapCommand.call(this);this.setM_Xpath("ZoomTo");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getZOOMTO()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomTo.prototype.getClassName=function(){return"MQZoomTo";};MQZoomTo.prototype.getObjectVersion=function(){return 0;};MQZoomTo.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomTo.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomTo.prototype.getZoomLevel=function(){return this.getProperty("ZoomLevel");};MQZoomTo.prototype.setZoomLevel=function(val){this.setProperty("ZoomLevel",val);};MQZoomToRect.prototype=new MQMapCommand();MQZoomToRect.prototype.constructor=MQZoomToRect;function MQZoomToRect(){MQMapCommand.call(this);this.setM_Xpath("ZoomToRect");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getZOOMTORECT()));var m_UpperLeft=new MQPoint("UpperLeftPoint");var m_LowerRight=new MQPoint("LowerRightPoint");this.getRect=function(ulpt,lrpt){ulpt.loadXml(m_UpperLeft.copy().saveXml());lrpt.loadXml(m_LowerRight.copy().saveXml());};this.setRect=function(ulpt,lrpt){if(mqIsClass(m_UpperLeft.getClassName(),ulpt,false)&&mqIsClass(m_LowerRight.getClassName(),lrpt,false)){m_UpperLeft=ulpt.internalCopy(m_UpperLeft);m_LowerRight=lrpt.internalCopy(m_LowerRight);}};}
MQZoomToRect.prototype.getClassName=function(){return"MQZoomToRect";};MQZoomToRect.prototype.getObjectVersion=function(){return 0;};MQZoomToRect.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var ul=new MQPoint("UpperLeftPoint"),lr=new MQPoint("LowerRightPoint");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
ul.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")!==null)
lr.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")));this.setRect(ul,lr);};MQZoomToRect.prototype.saveXml=function(){var ul=new MQPoint("UpperLeftPoint"),lr=new MQPoint("LowerRightPoint");this.getRect(ul,lr);var newNode=MQA.createXMLDoc(ul.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));newNode=MQA.createXMLDoc(lr.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomToRectLatLng.prototype=new MQMapCommand();MQZoomToRectLatLng.prototype.constructor=MQZoomToRectLatLng;function MQZoomToRectLatLng(){MQMapCommand.call(this);this.setM_Xpath("ZoomToRectLatLng");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getZOOMTORECTLATLNG()));var m_UpperLeft=new MQLatLng("UpperLeftLatLng");var m_LowerRight=new MQLatLng("LowerRightLatLng");this.getRect=function(ulll,lrll){ulll.loadXml(m_UpperLeft.copy().saveXml());lrll.loadXml(m_LowerRight.copy().saveXml());};this.setRect=function(ulll,lrll){if(mqIsClass(m_UpperLeft.getClassName(),ulll,false)&&mqIsClass(m_LowerRight.getClassName(),lrll,false)){m_UpperLeft=ulll.internalCopy(m_UpperLeft);m_LowerRight=lrll.internalCopy(m_LowerRight);}};}
MQZoomToRectLatLng.prototype.getClassName=function(){return"MQZoomToRectLatLng";};MQZoomToRectLatLng.prototype.getObjectVersion=function(){return 0;};MQZoomToRectLatLng.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var ul=new MQLatLng("UpperLeftLatLng"),lr=new MQLatLng("LowerRightLatLng");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
ul.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")!==null)
lr.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")));this.setRect(ul,lr);};MQZoomToRectLatLng.prototype.saveXml=function(){var ul=new MQLatLng("UpperLeftLatLng"),lr=new MQLatLng("LowerRightLatLng");this.getRect(ul,lr);var newNode=MQA.createXMLDoc(ul.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=MQA.createXMLDoc(lr.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));return mqXmlToStr(this.getM_XmlDoc());};function MQType(){};MQType.prototype.equals=function(type){if(type){try{var className=type.getClassName();}catch(error){alert("Invalid type for this function!");throw"Invalid type for this function!";}
if(className===this.getClassName()){return(this.intValue()===type.intValue());}else{alert("Invalid type for this function!");throw"Invalid type for this function!";}}else{alert("An MQType parameter must be provided for this function!");throw"An MQType parameter must be provided for this function!";}};MQRouteType.prototype=new MQType();MQRouteType.prototype.constructor=MQRouteType;function MQRouteType(val){var value=-1;switch(val)
{case MQCONSTANT.MQROUTETYPE_FASTEST:value=val;break;case MQCONSTANT.MQROUTETYPE_SHORTEST:value=val;break;case MQCONSTANT.MQROUTETYPE_PEDESTRIAN:value=val;break;case MQCONSTANT.MQROUTETYPE_OPTIMIZED:value=val;break;case MQCONSTANT.MQROUTETYPE_SELECT_DATASET_ONLY:value=val;break;default:alert(val+" is an invalid value for MQRouteType!");throw val+" invalid value for MQRouteType!";};this.intValue=function(){return value;};}
MQRouteType.prototype.getClassName=function(){return"MQRouteType";};MQRouteType.prototype.getObjectVersion=function(){return 0;};MQNarrativeType.prototype=new MQType();MQNarrativeType.prototype.constructor=MQNarrativeType;function MQNarrativeType(val){var value=-2;switch(val)
{case MQCONSTANT.MQNARRATIVETYPE_DEFAULT:value=val;break;case MQCONSTANT.MQNARRATIVETYPE_HTML:value=val;break;case MQCONSTANT.MQNARRATIVETYPE_NONE:value=val;break;default:alert(val+" is an invalid value for MQNarrativeType!");throw val+" invalid value for MQNarrativeType!";};this.intValue=function(){return value;};}
MQNarrativeType.prototype.getClassName=function(){return"MQNarrativeType";};MQNarrativeType.prototype.getObjectVersion=function(){return 0;};MQCoordinateType.prototype=new MQType();MQCoordinateType.prototype.constructor=MQCoordinateType;function MQCoordinateType(val){var value=-2;switch(val)
{case MQCONSTANT.MQCOORDINATETYPE_DISPLAY:value=val;break;case MQCONSTANT.MQCOORDINATETYPE_GEOGRAPHIC:value=val;break;default:alert(val+" is an invalid value for MQCoordinateType!");throw val+" invalid value for MQCoordinateType!";};this.intValue=function(){return value;};}
MQCoordinateType.prototype.getClassName=function(){return"MQCoordinateType";};MQCoordinateType.prototype.getObjectVersion=function(){return 0;};MQFeatureSpeciferAttributeType.prototype=new MQType();MQFeatureSpeciferAttributeType.prototype.constructor=MQFeatureSpeciferAttributeType;function MQFeatureSpeciferAttributeType(val){var value=-1;switch(val)
{case MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_GEFID:value=val;break;case MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_NAME:value=val;break;default:alert(val+" is an invalid value for MQFeatureSpeciferAttributeType!");throw val+" invalid value for MQFeatureSpeciferAttributeType!";};this.intValue=function(){return value;};}
MQFeatureSpeciferAttributeType.prototype.getClassName=function(){return"MQFeatureSpeciferAttributeType";};MQFeatureSpeciferAttributeType.prototype.getObjectVersion=function(){return 0;};MQSymbolType.prototype=new MQType();MQSymbolType.prototype.constructor=MQSymbolType;function MQSymbolType(val){var value=-1;switch(val)
{case MQCONSTANT.MQSYMBOLTYPE_RASTER:value=val;break;case MQCONSTANT.MQSYMBOLTYPE_VECTOR:value=val;break;default:alert(val+" is an invalid value for MQSymbolType!");throw val+" invalid value for MQSymbolType!";};this.intValue=function(){return value;};}
MQSymbolType.prototype.getClassName=function(){return"MQSymbolType";};MQSymbolType.prototype.getObjectVersion=function(){return 0;};MQMatchType.prototype=new MQType();MQMatchType.prototype.constructor=MQMatchType;function MQMatchType(val){var value=-1;switch(val)
{case MQCONSTANT.MQMATCHTYPE_LOC:value=val;break;case MQCONSTANT.MQMATCHTYPE_INTR:value=val;break;case MQCONSTANT.MQMATCHTYPE_NEARBLK:value=val;break;case MQCONSTANT.MQMATCHTYPE_REPBLK:value=val;break;case MQCONSTANT.MQMATCHTYPE_BLOCK:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA1:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA2:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA3:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA4:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA5:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA6:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA7:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC1:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC2:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC3:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC4:value=val;break;case MQCONSTANT.MQMATCHTYPE_POI:value=val;break;default:alert(val+" is an invalid value for MQMatchType!");throw val+" invalid value for MQMatchType!";};this.intValue=function(){return value;};}
MQMatchType.prototype.getClassName=function(){return"MQMatchType";};MQMatchType.prototype.getObjectVersion=function(){return 0;};MQQualityType.prototype=new MQType();MQQualityType.prototype.constructor=MQQualityType;function MQQualityType(val){var value=-1;switch(val)
{case MQCONSTANT.MQQUALITYTYPE_EXACT:value=val;break;case MQCONSTANT.MQQUALITYTYPE_GOOD:value=val;break;case MQCONSTANT.MQQUALITYTYPE_APPROX:value=val;break;default:alert(val+" is an invalid value for MQQualityType!");throw val+" invalid value for MQQualityType!";};this.intValue=function(){return value;};}
MQQualityType.prototype.getClassName=function(){return"MQQualityType";};MQQualityType.prototype.getObjectVersion=function(){return 0;};MQDrawTrigger.prototype=new MQType();MQDrawTrigger.prototype.constructor=MQDrawTrigger;function MQDrawTrigger(val){var value=-1;switch(val)
{case MQCONSTANT.MQDRAWTRIGGER_AFTER_POLYGONS:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_AFTER_ROUTE_HIGHLIGHT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_AFTER_TEXT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_POLYGONS:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_ROUTE_HIGHLIGHT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_TEXT:value=val;break;default:alert(val+" is an invalid value for MQDrawTrigger!");throw val+" invalid value for MQDrawTrigger!";};this.intValue=function(){return value;};}
MQDrawTrigger.prototype.getClassName=function(){return"MQDrawTrigger";};MQDrawTrigger.prototype.getObjectVersion=function(){return 0;};MQPenStyle.prototype=new MQType();MQPenStyle.prototype.constructor=MQPenStyle;function MQPenStyle(val){var value=-1;switch(val)
{case MQCONSTANT.MQPENSTYLE_DASH:value=val;break;case MQCONSTANT.MQPENSTYLE_DASH_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_DASH_DOT_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_SOLID:value=val;break;case MQCONSTANT.MQPENSTYLE_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_NONE:value=val;break;default:alert(val+" is an invalid value for MQPenStyle!");throw val+" invalid value for MQPenStyle!";};this.intValue=function(){return value;};}
MQPenStyle.prototype.getClassName=function(){return"MQPenStyle";};MQPenStyle.prototype.getObjectVersion=function(){return 0;};MQFontStyle.prototype=new MQType();MQFontStyle.prototype.constructor=MQFontStyle;function MQFontStyle(val){var value=-2;switch(val)
{case MQCONSTANT.MQFONTSTYLE_BOLD:value=val;break;case MQCONSTANT.MQFONTSTYLE_BOXED:value=val;break;case MQCONSTANT.MQFONTSTYLE_DOT:value=val;break;case MQCONSTANT.MQFONTSTYLE_ITALICS:value=val;break;case MQCONSTANT.MQFONTSTYLE_MAX_VALUE:value=val;break;case MQCONSTANT.MQFONTSTYLE_NORMAL:value=val;break;case MQCONSTANT.MQFONTSTYLE_OUTLINED:value=val;break;case MQCONSTANT.MQFONTSTYLE_SEMIBOLD:value=val;break;case MQCONSTANT.MQFONTSTYLE_STRIKEOUT:value=val;break;case MQCONSTANT.MQFONTSTYLE_THIN:value=val;break;case MQCONSTANT.MQFONTSTYLE_UNDERLINE:value=val;break;case MQCONSTANT.MQFONTSTYLE_INVALID:value=val;break;default:alert(val+" is an invalid value for MQFontStyle!");throw val+" invalid value for MQFontStyle!";};this.intValue=function(){return value;};}
MQFontStyle.prototype.getClassName=function(){return"MQFontStyle";};MQFontStyle.prototype.getObjectVersion=function(){return 0;};MQColorStyle.prototype=new MQType();MQColorStyle.prototype.constructor=MQColorStyle;function MQColorStyle(val){var value=MQCONSTANT.MQCOLORSTYLE_INVALID;if(val!==null){value=val;}
this.intValue=function(){return value;};}
MQColorStyle.prototype.getClassName=function(){return"MQColorStyle";};MQColorStyle.prototype.getObjectVersion=function(){return 0;};MQColorStyle.prototype.getRGB=function(){var rgb=-16777216;var a=parseInt(parseInt(this.intValue()/65536)%256);var b=parseInt(parseInt(parseInt(this.intValue()/256)%256)*256);var c=parseInt(parseInt(this.intValue()%256)*65536);return rgb+a+b+c;}
MQFillStyle.prototype=new MQType();MQFillStyle.prototype.constructor=MQFillStyle;function MQFillStyle(val){var value=-1;switch(val)
{case MQCONSTANT.MQFILLSTYLE_SOLID:value=val;break;case MQCONSTANT.MQFILLSTYLE_BDIAGONAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_CROSS:value=val;break;case MQCONSTANT.MQFILLSTYLE_DIAG_CROSS:value=val;break;case MQCONSTANT.MQFILLSTYLE_FDIAGONAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_HORIZONTAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_VERTICAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_NONE:value=val;break;default:alert(val+" is an invalid value for MQFillStyle!");throw val+" invalid value for MQFillStyle!";};this.intValue=function(){return value;};}
MQFillStyle.prototype.getClassName=function(){return"MQFillStyle";};MQFillStyle.prototype.getObjectVersion=function(){return 0;};MQDistanceUnits.prototype=new MQType();MQDistanceUnits.prototype.constructor=MQDistanceUnits;function MQDistanceUnits(val){var value=0;val=val||0;switch(val)
{case MQCONSTANT.MQDISTANCEUNITS_MILES:value=val;break;case MQCONSTANT.MQDISTANCEUNITS_KILOMETERS:value=val;break;default:alert(val+" is an invalid value for MQDistanceUnits!");throw val+" invalid value for MQDistanceUnist!";};this.getValue=function(){return value;};}
MQDistanceUnits.prototype.getClassName=function(){return"MQDistanceUnits";};MQDistanceUnits.prototype.getObjectVersion=function(){return 0;};MQRouteResultsCode.prototype=new MQType();MQRouteResultsCode.prototype.constructor=MQRouteResultsCode;function MQRouteResultsCode(val){var value=-2;switch(val)
{case MQCONSTANT.MQROUTERESULTSCODE_NOT_SPECIFIED:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_SUCCESS:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_INVALID_LOCATION:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_ROUTE_FAILURE:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_NO_DATASET_FOUND:value=val;break;default:alert(val+" is an invalid value for MQRouteResultsCode!");throw val+" invalid value for MQRouteResultsCode!";};this.intValue=function(){return value;};}
MQRouteResultsCode.prototype.getClassName=function(){return"MQRouteResultsCode";};MQRouteResultsCode.prototype.getObjectVersion=function(){return 0;};MQRouteMatrixResultsCode.prototype=new MQType();MQRouteMatrixResultsCode.prototype.constructor=MQRouteMatrixResultsCode;function MQRouteMatrixResultsCode(val){var value=-2;switch(val)
{case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_SUCCESS:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_INVALID_LOCATION:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_ROUTE_FAILURE:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NO_DATASET_FOUND:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_INVALID_OPTION:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_PARTIAL_SUCCESS:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_EXCEEDED_MAX_LOCATIONS:value=val;break;default:alert(val+" is an invalid value for MQRouteMatrixResultsCode!");throw val+" invalid value for MQRouteMatrixResultsCode!";};this.intValue=function(){return value;};}
MQRouteMatrixResultsCode.prototype.getClassName=function(){return"MQRouteMatrixResultsCode";};MQRouteMatrixResultsCode.prototype.getObjectVersion=function(){return 0;};MQLocationCollection.prototype=new MQObjectCollection(32678);MQLocationCollection.prototype.constructor=MQLocationCollection;function MQLocationCollection(){MQObjectCollection.call(this,32678);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLOCATIONCOLLECTION()));this.setM_Xpath("LocationCollection");}
MQLocationCollection.prototype.getClassName=function(){return"MQLocationCollection";};MQLocationCollection.prototype.getObjectVersion=function(){return 0;};MQLocationCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var loc=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="Address"){loc=new MQAddress();loc.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="GeoAddress"){loc=new MQGeoAddress();loc.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="SingleLineAddress"){loc=new MQSingleLineAddress();loc.loadXml(mqXmlToStr(nodes[count]));}
this.add(loc);}}};MQLocationCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQLocationCollection.prototype.isValidObject=function(obj){if(obj){if(obj.getClassName()==="MQGeoAddress"||obj.getClassName()==="MQAddress"||obj.getClassName()==="MQSingleLineAddress"){return true;}}
return false;};MQLocationCollectionCollection.prototype=new MQObjectCollection(32678);MQLocationCollectionCollection.prototype.constructor=MQLocationCollectionCollection;function MQLocationCollectionCollection(){MQObjectCollection.call(this,32678);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLOCATIONCOLLECTIONCOLLECTION()));this.setM_Xpath("LocationCollectionCollection");}
MQLocationCollectionCollection.prototype.getClassName=function(){return"MQLocationCollectionCollection";};MQLocationCollectionCollection.prototype.getObjectVersion=function(){return 0;};MQLocationCollectionCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var loc=null;for(var count=minCount;count<maxCount;count++){loc=new MQLocationCollection();loc.loadXml(mqXmlToStr(nodes[count]));this.add(loc);}}};MQLocationCollectionCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQLocationCollectionCollection.prototype.isValidObject=function(obj){if(obj){if(obj.getClassName()==="MQLocationCollection"){return true;}}
return false;};MQSignCollection.prototype=new MQObjectCollection(32678);MQSignCollection.prototype.constructor=MQSignCollection;function MQSignCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQSign");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSIGNCOLLECTION()));this.setM_Xpath("SignCollection");}
MQSignCollection.prototype.getClassName=function(){return"MQSignCollection";};MQSignCollection.prototype.getObjectVersion=function(){return 0;};MQSignCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var sign=null;if(this.getValidClassName()==="MQSign"){for(var count=minCount;count<maxCount;count++){sign=new MQSign();sign.setM_Xpath(this.getM_itemXpath());sign.loadXml(mqXmlToStr(nodes[count]));this.add(sign);}}}};MQSignCollection.prototype.loadXmlFromNode=function(node){var xmlDoc=mqCreateXMLDocImportNode(node);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var sign=null;if(this.getValidClassName()==="MQSign"){for(var count=minCount;count<maxCount;count++){sign=new MQSign();sign.setM_Xpath(this.getM_itemXpath());sign.loadXmlFromNode(nodes[count]);this.add(sign);}}}};MQSignCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQPointCollection.prototype=new MQObjectCollection(32678);MQPointCollection.prototype.constructor=MQPointCollection;function MQPointCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQPoint");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPOINTCOLLECTION()));this.setM_Xpath("PointCollection");}
MQPointCollection.prototype.getClassName=function(){return"MQPointCollection";};MQPointCollection.prototype.getObjectVersion=function(){return 0;};MQPointCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var pnt=null;if(this.getValidClassName()==="MQPoint"){for(var count=minCount;count<maxCount;count++){var x;var y;if(nodes[count].firstChild!==null){x=nodes[count].firstChild.nodeValue;}
count++;if(nodes[count].firstChild!==null){y=nodes[count].firstChild.nodeValue;}
pnt=new MQPoint(x,y);this.add(pnt);}}}};MQPointCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQDBLayerQueryCollection.prototype=new MQObjectCollection(32678);MQDBLayerQueryCollection.prototype.constructor=MQDBLayerQueryCollection;function MQDBLayerQueryCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQDBLayerQuery");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSIGNCOLLECTION()));this.setM_Xpath("DBLayerQueryCollection");}
MQDBLayerQueryCollection.prototype.getClassName=function(){return"MQDBLayerQueryCollection";};MQDBLayerQueryCollection.prototype.getObjectVersion=function(){return 0;};MQDBLayerQueryCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var sign=null;if(this.getValidClassName()==="MQDBLayerQuery"){for(var count=minCount;count<maxCount;count++){sign=new MQDBLayerQuery();sign.setM_Xpath(this.getM_itemXpath());sign.loadXml(mqXmlToStr(nodes[count]));this.add(sign);}}}};MQDBLayerQueryCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQManeuverCollection.prototype=new MQObjectCollection(32678);MQManeuverCollection.prototype.constructor=MQManeuverCollection;function MQManeuverCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQManeuver");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getMANEUVERCOLLECTION()));this.setM_Xpath("ManeuverCollection");}
MQManeuverCollection.prototype.getClassName=function(){return"MQManeuverCollection";};MQManeuverCollection.prototype.getObjectVersion=function(){return 0;};MQManeuverCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var maneuver=null;if(this.getValidClassName()==="MQManeuver"){for(var count=minCount;count<maxCount;count++){maneuver=new MQManeuver();maneuver.setM_Xpath(this.getM_itemXpath());maneuver.loadXml(mqXmlToStr(nodes[count]));this.add(maneuver);}}}};MQManeuverCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQTrekRouteCollection.prototype=new MQObjectCollection(32678);MQTrekRouteCollection.prototype.constructor=MQTrekRouteCollection;function MQTrekRouteCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQTrekRoute");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getTREKROUTECOLLECTION()));this.setM_Xpath("TrekRouteCollection");}
MQTrekRouteCollection.prototype.getClassName=function(){return"MQTrekRouteCollection";};MQTrekRouteCollection.prototype.getObjectVersion=function(){return 0;};MQTrekRouteCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var trek=null;if(this.getValidClassName()==="MQTrekRoute"){for(var count=minCount;count<maxCount;count++){trek=new MQTrekRoute();trek.setM_Xpath(this.getM_itemXpath());trek.loadXml(mqXmlToStr(nodes[count]));this.add(trek);}}}};MQTrekRouteCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQIntCollection.prototype=new MQObjectCollection(32678);MQIntCollection.prototype.constructor=MQIntCollection;function MQIntCollection(itemXpath){MQObjectCollection.call(this,32678);this.setValidClassName("int");if(itemXpath){this.setM_itemXpath(itemXpath);}
if(this.getClassName()==="MQIntCollection"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getINTCOLLECTION()));this.setM_Xpath("IntCollection");}}
MQIntCollection.prototype.getClassName=function(){return"MQIntCollection";};MQIntCollection.prototype.getObjectVersion=function(){return 0;};MQIntCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=parseInt(nodes[count].firstChild.nodeValue);}else{str=0;}
this.add(str);}}};MQIntCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]="<"+this.getM_itemXpath()+">"+this.get(i)+"</"+this.getM_itemXpath()+">";}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQDTCollection.prototype=new MQIntCollection("Item");MQDTCollection.prototype.constructor=MQDTCollection;function MQDTCollection(itemXpath){MQIntCollection.call(this,itemXpath);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getDTCOLLECTION()));this.setM_Xpath("DTCollection");};MQDTCollection.prototype.getClassName=function(){return"MQDTCollection";};MQDTCollection.prototype.getObjectVersion=function(){return 1;};MQFeatureCollection.prototype=new MQObjectCollection(32678);MQFeatureCollection.prototype.constructor=MQFeatureCollection;function MQFeatureCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getFEATURECOLLECTION()));this.setM_Xpath("FeatureCollection");}
MQFeatureCollection.prototype.getClassName=function(){return"MQFeatureCollection";};MQFeatureCollection.prototype.getObjectVersion=function(){return 0;};MQFeatureCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var feat=null;var nodeName="";for(var count=minCount;count<maxCount;count++){nodeName=nodes[count].nodeName;if(nodeName==="LineFeature"){feat=new MQLineFeature();feat.loadXml(mqXmlToStr(nodes[count]));}else if(nodeName==="PointFeature"){feat=new MQPointFeature();feat.loadXmlFromNode(nodes[count]);}else if(nodeName==="PolygonFeature"){feat=new MQPolygonFeature();feat.loadXml(mqXmlToStr(nodes[count]));}
this.add(feat);}}};MQFeatureCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Version=\""+this.getObjectVersion()+"\" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQFeatureSpecifierCollection.prototype=new MQObjectCollection(32678);MQFeatureSpecifierCollection.prototype.constructor=MQFeatureSpecifierCollection;function MQFeatureSpecifierCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQFeatureSpecifier");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getFEATURESPECIFIERCOLLECTION()));this.setM_Xpath("FeatureCollection");}
MQFeatureSpecifierCollection.prototype.getClassName=function(){return"MQFeatureSpecifierCollection";};MQFeatureSpecifierCollection.prototype.getObjectVersion=function(){return 0;};MQFeatureSpecifierCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var feat=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="FeatureSpecifier"){feat=new MQFeatureSpecifier();feat.loadXml(mqXmlToStr(nodes[count]));}
this.add(feat);}}};MQFeatureSpecifierCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQGeocodeOptionsCollection.prototype=new MQObjectCollection(32678);MQGeocodeOptionsCollection.prototype.constructor=MQGeocodeOptionsCollection;function MQGeocodeOptionsCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQGeocodeOptions");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getGEOCODEOPTIONSCOLLECTION()));this.setM_Xpath("GeocodeOptionsCollection");}
MQGeocodeOptionsCollection.prototype.getClassName=function(){return"MQGeocodeOptionsCollection";};MQGeocodeOptionsCollection.prototype.getObjectVersion=function(){return 0;};MQGeocodeOptionsCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var geoO=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="GeocodeOptions"){geoO=new MQGeocodeOptions();geoO.loadXml(mqXmlToStr(nodes[count]));}
this.add(geoO);}}};MQGeocodeOptionsCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQCoverageStyle.prototype=new MQObjectCollection(32678);MQCoverageStyle.prototype.constructor=MQCoverageStyle;function MQCoverageStyle(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getCOVERAGESTYLE()));this.setM_Xpath("CoverageStyle");}
MQCoverageStyle.prototype.getClassName=function(){return"MQCoverageStyle";};MQCoverageStyle.prototype.getObjectVersion=function(){return 0;};MQCoverageStyle.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var dt=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="DTStyle"){dt=new MQDTStyle();dt.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DTStyleEx"){dt=new MQDTStyleEx();dt.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DTFeatureStyleEx"){dt=new MQDTFeatureStyleEx();dt.loadXml(mqXmlToStr(nodes[count]));}
if(dt!==null){this.add(dt);}
dt=null;}}};MQCoverageStyle.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<CoverageStyle Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="<Name>"+this.getProperty("Name")+"</Name>";strRetArray[strRetArray.length]="</CoverageStyle>";var strRet=strRetArray.join("");return strRet;};MQCoverageStyle.prototype.setName=function(strName){this.setProperty("Name",strName);};MQCoverageStyle.prototype.getName=function(){return this.getProperty("Name");};MQPrimitiveCollection.prototype=new MQObjectCollection(32678);MQPrimitiveCollection.prototype.constructor=MQPrimitiveCollection;function MQPrimitiveCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getPRIMITIVECOLLECTION()));this.setM_Xpath("PrimitiveCollection");}
MQPrimitiveCollection.prototype.getClassName=function(){return"MQPrimitiveCollection";};MQPrimitiveCollection.prototype.getObjectVersion=function(){return 0;};MQPrimitiveCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var prim=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="EllipsePrimitive"){prim=new MQEllipsePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="LinePrimitive"){prim=new MQLinePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="PolygonPrimitive"){prim=new MQPolygonPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="RectanglePrimitive"){prim=new MQRectanglePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="TextPrimitive"){prim=new MQTextPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="SymbolPrimitive"){prim=new MQSymbolPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}
this.add(prim);}}};MQPrimitiveCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQStringCollection.prototype=new MQObjectCollection(32678);MQStringCollection.prototype.constructor=MQStringCollection;function MQStringCollection(itemXpath){MQObjectCollection.call(this,32678);this.setValidClassName("String");if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSTRINGCOLLECTION()));this.setM_Xpath("StringCollection");}
MQStringCollection.prototype.getClassName=function(){return"MQStringCollection";};MQStringCollection.prototype.getObjectVersion=function(){return 0;};MQStringCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=nodes[count].firstChild.nodeValue;}else{str="";}
this.add(str);}}};MQStringCollection.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));var xmlDoc=this.getM_XmlDoc();if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=nodes[count].firstChild.nodeValue;}else{str="";}
this.add(str);}}};MQStringCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]="<"+this.getM_itemXpath()+">"+this.get(i)+"</"+this.getM_itemXpath()+">";}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQStrColCollection.prototype=new MQObjectCollection(32678);MQStrColCollection.prototype.constructor=MQStrColCollection;function MQStrColCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQStringCollection");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSTRCOLCOLLECTION()));}
MQStrColCollection.prototype.getClassName=function(){return"MQStrColCollection";};MQStrColCollection.prototype.getObjectVersion=function(){return 0;};MQStrColCollection.prototype.saveXml=function(){var strRetArray=new Array();var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRet=strRetArray.join("");return strRet;};MQAutoGeocodeCovSwitch.prototype=new MQObject();MQAutoGeocodeCovSwitch.prototype.constructor=MQAutoGeocodeCovSwitch;function MQAutoGeocodeCovSwitch(){MQObject.call(this);this.setM_Xpath("AutoGeocodeCovSwitch");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getAUTOGEOCODECOVSWITCH()));}
MQAutoGeocodeCovSwitch.prototype.getClassName=function(){return"MQAutoGeocodeCovSwitch";};MQAutoGeocodeCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoGeocodeCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQAutoGeocodeCovSwitch.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAutoGeocodeCovSwitch.prototype.setName=function(strName){this.setProperty("Name",strName);};MQAutoGeocodeCovSwitch.prototype.getName=function(){return this.getProperty("Name");};MQAutoGeocodeCovSwitch.prototype.setMaxMatches=function(lMaxMatches){this.setProperty("MaxMatches",lMaxMatches);};MQAutoGeocodeCovSwitch.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};MQAutoRouteCovSwitch.prototype=new MQObject();MQAutoRouteCovSwitch.prototype.constructor=MQAutoRouteCovSwitch;function MQAutoRouteCovSwitch(strXpath){MQObject.call(this);if(this.getClassName()==="MQAutoRouteCovSwitch"){if(strXpath){this.setM_Xpath(strXpath);this.setM_XmlDoc(MQA.createXMLDoc("<"+strXpath+"><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></"+strXpath+">"));}else{this.setM_Xpath("AutoRouteCovSwitch");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getAUTOROUTECOVSWITCH()));}}
var m_DataVendorCodes=new MQIntCollection();m_DataVendorCodes.setM_Xpath("DataVendorCodes");this.getDataVendorCodes=function(){return m_DataVendorCodes;};}
MQAutoRouteCovSwitch.prototype.getClassName=function(){return"MQAutoRouteCovSwitch";};MQAutoRouteCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoRouteCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var dataVendorCodes=this.getDataVendorCodes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")!==null)
dataVendorCodes.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")));};MQAutoRouteCovSwitch.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getDataVendorCodes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DataVendorCodes"));return mqXmlToStr(this.getM_XmlDoc());};MQAutoRouteCovSwitch.prototype.setName=function(strName){this.setProperty("Name",strName);};MQAutoRouteCovSwitch.prototype.getName=function(){return this.getProperty("Name");};MQAutoRouteCovSwitch.prototype.setDataVendorCodeUsage=function(lDataVendorCodeUsage){this.setProperty("DataVendorCodeUsage",lDataVendorCodeUsage);};MQAutoRouteCovSwitch.prototype.getDataVendorCodeUsage=function(){return this.getProperty("DataVendorCodeUsage");};MQAutoMapCovSwitch.prototype=new MQAutoRouteCovSwitch();MQAutoMapCovSwitch.prototype.constructor=MQAutoMapCovSwitch;function MQAutoMapCovSwitch(strXpath){MQAutoRouteCovSwitch.call(this);if(strXpath){this.setM_Xpath(strXpath);this.setM_XmlDoc(MQA.createXMLDoc("<"+strXpath+"><Name/><Style/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/><ZoomLevels Count=\"14\"><Item>6000</Item><Item>12000</Item><Item>24000</Item><Item>48000</Item><Item>96000</Item><Item>192000</Item><Item>400000</Item><Item>800000</Item><Item>1600000</Item><Item>3000000</Item><Item>6000000</Item><Item>12000000</Item><Item>24000000</Item><Item>48000000</Item></ZoomLevels></"+strXpath+">"));}else{this.setM_Xpath("AutoMapCovSwitch");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getAUTOMAPCOVSWITCH()));}
var m_ZoomLevels=new MQIntCollection();m_ZoomLevels.setM_Xpath("ZoomLevels");m_ZoomLevels.add(6000);m_ZoomLevels.add(12000);m_ZoomLevels.add(24000);m_ZoomLevels.add(48000);m_ZoomLevels.add(96000);m_ZoomLevels.add(192000);m_ZoomLevels.add(400000);m_ZoomLevels.add(800000);m_ZoomLevels.add(1600000);m_ZoomLevels.add(3000000);m_ZoomLevels.add(6000000);m_ZoomLevels.add(12000000);m_ZoomLevels.add(24000000);m_ZoomLevels.add(48000000);this.getZoomLevels=function(){return m_ZoomLevels;};}
MQAutoMapCovSwitch.prototype.getClassName=function(){return"MQAutoMapCovSwitch";};MQAutoMapCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoMapCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var dataVendorCodes=this.getDataVendorCodes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")!==null)
dataVendorCodes.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")));};MQAutoMapCovSwitch.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getDataVendorCodes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DataVendorCodes"));return mqXmlToStr(this.getM_XmlDoc());};MQAutoMapCovSwitch.prototype.setStyle=function(strStyle){this.setProperty("Style",strStyle);};MQAutoMapCovSwitch.prototype.getStyle=function(){return this.getProperty("Style");};MQSession.prototype=new MQObjectCollection(32678);MQSession.prototype.constructor=MQSession;function MQSession(){MQObjectCollection.call(this,32678);this.setM_Xpath("Session");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSESSION()));}
MQSession.prototype.getClassName=function(){return"MQSession";};MQSession.prototype.getObjectVersion=function(){return 0;};MQSession.prototype.loadXml=function(strXml){var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var obj=null;for(var count=minCount;count<maxCount;count++){obj=null;if(nodes[count].nodeName==="MapState"){obj=new MQMapState();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="CoverageStyle"){obj=new MQCoverageStyle();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="AutoMapCovSwitch"){obj=new MQAutoMapCovSwitch();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DBLayerQueryCollection"){obj=new MQDBLayerQueryCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="FeatureCollection"){obj=new MQFeatureCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="PrimitiveCollection"){obj=new MQPrimitiveCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="Center"){obj=new MQCenter();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="CenterLL"){obj=new MQCenterLL();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomIn"){obj=new MQZoomIn();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomOut"){obj=new MQZoomOut();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomTo"){obj=new MQZoomTo();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomToRect"){obj=new MQZoomToRect();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomToRectLL"){obj=new MQZoomToRectLL();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="Pan"){obj=new MQPan();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="BestFit"){obj=new MQBestFit();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="BestFitLL"){obj=new MQBestFitLL();obj.loadXml(mqXmlToStr(nodes[count]));}
if(obj!==null)
this.add(obj);}}};MQSession.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQSession.prototype.add=function(obj){return this.addOne(obj,null);}
MQSession.prototype.isMapCommandObject=function(obj)
{if(obj){var cls=obj.getClassName();if(cls==="MQCenter"||cls==="MQCenterLatLng"||cls==="MQZoomIn"||cls==="MQZoomOut"||cls==="MQZoomTo"||cls==="MQZoomToRect"||cls==="MQZoomToRectLatLng"||cls==="MQPan"||cls==="MQBestFit"||cls==="MQBestFitLL"){return true;}else{return false;}}}
MQSession.prototype.addOne=function(newElement,replacedElement){var collectionSize=this.getSize();var newTypeId=newElement.getClassName();var newIndex=0;if(this.isValidObject(newElement)){if(this.isMapCommandObject(newElement)){for(newIndex=0;newIndex<collectionSize;newIndex++){if(isMapCommandObject(get(newIndex)))
break;}}else{for(newIndex=0;newIndex<collectionSize;newIndex++){if(get(newIndex).getClassId()==newTypeId)
break;}}}else{alert("Invalid object for this collection.");throw("Invalid object for this collection.");}
if(newIndex<collectionSize){replacedElement=this.set(newIndex,newElement);}else{m_collection.add(newElement);}
return newIndex;}
MQSession.prototype.isValidObject=function(obj){if(obj){var cls=obj.getClassName();if(cls==="MQCenter"||cls==="MQCenterLatLng"||cls==="MQZoomIn"||cls==="MQZoomOut"||cls==="MQZoomTo"||cls==="MQZoomToRect"||cls==="MQZoomToRectLatLng"||cls==="MQPan"||cls==="MQBestFit"||cls==="MQBestFitLL"||cls==="MQDBLayerQueryCollection"||cls==="MQCoverageStyle"||cls==="MQFeatureCollection"||cls==="MQAutoMapCovSwitch"||cls==="MQPrimitiveCollection"||cls==="MQMapState"){return true;}else{return false;}}}
function MQAuthentication(strInfo){var strTransactionInfo=(strInfo!=null)?strInfo:"";this.getInfo=function(){return strTransactionInfo;}}
MQAuthentication.prototype.saveXml=function(){return"<Authentication Version=\""+this.getObjectVersion()+"\">"+"<TransactionInfo>"+this.getInfo()+"</TransactionInfo>"+"</Authentication>";};MQAuthentication.prototype.getClassName=function(){return"MQAuthentication";};MQAuthentication.prototype.getObjectVersion=function(){return 2;};function MQXmlNodeObject(strName,strValue){var nodeName=strName;var nodeValue=strValue;this.saveXml=function(){return"<"+nodeName+">"+nodeValue+"</"+nodeName+">";};}
try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqexec.js.";}
function MQExec(strServerNameORmqeObj,strPathToServer,nServerPort,strProxyServerName,strPathToProxyServerPage,nProxyServerPort)
{var m_strServerName;var m_strServerPath;var m_nServerPort;var m_strProxyServerPath;var m_strProxyServerName;var m_nProxyServerPort;var m_lSocketTimeout;var m_strXInfo="";if(typeof strServerNameORmqeObj=="string"){m_strServerName=strServerNameORmqeObj||"localhost";m_strServerPath=strPathToServer||"mq";m_nServerPort=nServerPort||80;m_strProxyServerPath=strPathToProxyServerPage||"";m_strProxyServerName=strProxyServerName||"";m_nProxyServerPort=nProxyServerPort||0;m_lSocketTimeout=0;}else if(strServerNameORmqeObj.getClassName()&&strServerNameORmqeObj.getClassName()=="MQExec"){m_strServerName=strServerNameORmqeObj.getServerName();m_strServerPath=strServerNameORmqeObj.getServerPath();m_nServerPort=strServerNameORmqeObj.getServerPort();m_strProxyServerName=strServerNameORmqeObj.getProxyServerName();m_nProxyServerPort=strServerNameORmqeObj.getProxyServerPort();m_strProxyServerPath=strServerNameORmqeObj.getProxyServerPath();m_lSocketTimeout=strServerNameORmqeObj.m_lSocketTimeout;}
this.setServerName=function(strServerName){m_strServerName=strServerName;};this.getServerName=function(){return m_strServerName;};this.setServerPath=function(strServerPath){m_strServerPath=strServerPath;};this.getServerPath=function(){return m_strServerPath;};this.setServerPort=function(nServerPort){m_nServerPort=nServerPort;};this.getServerPort=function(){return m_nServerPort;};this.setProxyServerName=function(strProxyServerName){m_strProxyServerName=strProxyServerName;};this.getProxyServerName=function(){return m_strProxyServerName;};this.setProxyServerPath=function(strProxyServerPath){m_strProxyServerPath=strProxyServerPath;};this.getProxyServerPath=function(){return m_strProxyServerPath;};this.setProxyServerPort=function(nProxyServerPort){m_nProxyServerPort=nProxyServerPort;};this.getProxyServerPort=function(){return m_nProxyServerPort;};this.setTransactionInfo=function(strXInfo){if(strXInfo.length>32)
m_strXInfo=strXInfo.substring(0,32);else
m_strXInfo=strXInfo;};this.getTransactionInfo=function(){return m_strXInfo;};}
MQExec.prototype.ROUTE_VERSION="2";MQExec.prototype.SEARCH_VERSION="0";MQExec.prototype.GEOCODE_VERSION="1";MQExec.prototype.ROUTEMATRIX_VERSION="0";MQExec.prototype.GETRECORDINFO_VERSION="0";MQExec.prototype.REVERSEGEOCODE_VERSION="0";MQExec.prototype.GETSESSION_VERSION="1";MQExec.prototype.getRequestXml=function(strTransaction,arrRequest,strVersion){var arrXmlBuf=new Array();var version=strVersion||"0";arrXmlBuf.push("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");arrXmlBuf.push("<"+strTransaction+" Version=\""+version+"\">\n");for(var i=0;i<arrRequest.length;i++){arrXmlBuf.push(arrRequest[i].saveXml());arrXmlBuf.push("\n");}
arrXmlBuf.push("</"+strTransaction+">");return arrXmlBuf.join("");};MQExec.prototype.doTransaction=function(strTransaction,arrRequest,strVersion){var xmlDoc;var strResXml;var http_request=mqXMLHttpRequest();var strUrl="";arrRequest.push(new MQAuthentication(this.getTransactionInfo()));var strReqXml=this.getRequestXml(strTransaction,arrRequest,strVersion);if(this.getProxyServerName()!=""){strUrl+="http://"+this.getProxyServerName();if(this.getProxyServerPort()!=0){strUrl+=":"+this.getProxyServerPort();}
strUrl+="/";}
strUrl+=this.getProxyServerPath();strUrl+="?sname="+this.getServerName();strUrl+="&spath="+this.getServerPath();strUrl+="&sport="+this.getServerPort();display("mqXmlLogs","Request URL: ",strUrl,"rURL","mqDisplay");display("mqXmlLogs","Request XML: ",strReqXml,"","mqDisplay");http_request.open("POST",strUrl,false);http_request.send(strReqXml);if(http_request.status==200){xmlDoc=http_request.responseXML;}
else{alert("HTTP Status: "+http_request.status+" ("+http_request.statusText+")\n"+"Details: \n"+http_request.responseText);xmlDoc=null;}
display("mqXmlLogs","Response XML: ",mqXmlToStr(xmlDoc),"resXML","mqDisplay");return xmlDoc;};MQExec.prototype.geocode=function(mqaAddress,mqlcLocations,theOptions){var xmlDoc;var strXml;var arrRequest=new Array();if(mqaAddress==null||(mqaAddress.getClassName()!=="MQAddress"&&mqaAddress.getClassName()!=="MQSingleLineAddress")){throw"Null or Illegal Argument passed for MQAddress";}else{arrRequest.push(mqaAddress);}
if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}
if(theOptions!=null){if(theOptions.getClassName()!=="MQAutoGeocodeCovSwitch"&&theOptions.getClassName()!=="MQGeocodeOptionsCollection"){throw"Illegal Argument passed for Geocode Options";}else{arrRequest.push(theOptions);}}
mqLogTime("MQExec.geocode: Transaction Start");xmlDoc=this.doTransaction("Geocode",arrRequest,this.GEOCODE_VERSION);mqLogTime("MQExec.geocode: Transaction End");mqLogTime("MQExec.geocode: Loading of GeocodeResponse Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GeocodeResponse/LocationCollection"));mqlcLocations.loadXml(strXml);mqLogTime("MQExec.geocode: Loading of GeocodeResponse End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.batchGeocode=function(mqlcLocations,mqlccLocations,theOptions){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(mqlccLocations==null||mqlccLocations.getClassName()!=="MQLocationCollectionCollection"){throw"Null or Illegal Argument passed for MQLocationCollectionCollection";}
if(theOptions!=null){if(theOptions.getClassName()!=="MQAutoGeocodeCovSwitch"&&theOptions.getClassName()!=="MQGeocodeOptionsCollection"){throw"Illegal Argument passed for Geocode Options";}else{arrRequest.push(theOptions);}}
mqLogTime("MQExec.batchGeocode: Transaction Start");xmlDoc=this.doTransaction("BatchGeocode",arrRequest,this.GEOCODE_VERSION);mqLogTime("MQExec.batchGeocode: Transaction End");mqLogTime("MQExec.batchGeocode: Loading of GeocodeResponse Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/BatchGeocodeResponse/LocationCollectionCollection"));mqlccLocations.loadXml(strXml);mqLogTime("MQExec.batchGeocode: Loading of GeocodeResponse End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.doRoute=function(mqlcLocations,mqroOptions,mqrrResults,strSessionUID,mqRectLL){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(mqroOptions==null||mqroOptions.getClassName()!=="MQRouteOptions"){throw"Null or Illegal Argument passed for MQRouteOptions";}else{arrRequest.push(mqroOptions);}
if(mqrrResults==null||mqrrResults.getClassName()!=="MQRouteResults"){throw"Null or Illegal Argument passed for MQRouteResults";}else{var sessionId=strSessionUID||"";arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));}
mqLogTime("MQExec.doRoute: Transaction Start");xmlDoc=this.doTransaction("DoRoute",arrRequest,this.ROUTE_VERSION);mqLogTime("MQExec.doRoute: Transaction End");mqLogTime("MQExec.doRoute: Loading of RouteResults Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/DoRouteResponse/RouteResults"));mqrrResults.loadXml(strXml);mqLogTime("MQExec.doRoute: Loading of RouteResults End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");if(mqRectLL!==null&&sessionId!==""){this.getRouteBoundingBoxFromSessionResponse(sessionId,mqRectLL);}};MQExec.prototype.createSessionEx=function(mqsSession){var xmlDoc;var strSessId;var arrRequest=new Array();if(mqsSession==null||mqsSession.getClassName()!=="MQSession"){throw"Null or Illegal Argument passed for MQSession";}else{arrRequest.push(mqsSession);}
xmlDoc=this.doTransaction("CreateSession",arrRequest);strSessId=mqGetNodeText(mqGetNode(xmlDoc,"/CreateSessionResponse/SessionID"));return strSessId;};MQExec.prototype.getSession=function(strSessionID,mqObj){var xmlDoc;var strXml;var sessionId=strSessionID||"";var arrRequest=new Array();arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));xmlDoc=this.doTransaction("GetSession",arrRequest,this.GETSESSION_VERSION);if(mqObj.getClassName()==="MQMapState"){strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetSessionResponse/Session/MapState"));mqObj.loadXml(strXml);}else if(mqObj.getClassName()==="MQSession"){strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetSessionResponse/Session"));mqObj.loadXml(strXml);}};MQExec.prototype.doRouteMatrix=function(mqlcLocations,bAllToAll,mqroOptions,mqrmrResults){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(bAllToAll==null||typeof bAllToAll!="boolean"){throw"Null or Illegal Argument passed for bAllToAll";}else{var iAllToAll=bAllToAll?1:0;arrRequest.push(new MQXmlNodeObject("AllToAll",iAllToAll));}
if(mqroOptions==null||mqroOptions.getClassName()!=="MQRouteOptions"){throw"Null or Illegal Argument passed for MQRouteOptions";}else{arrRequest.push(mqroOptions);}
if(mqrmrResults==null||mqrmrResults.getClassName()!=="MQRouteMatrixResults"){throw"Null or Illegal Argument passed for MQRouteMatrixResults";}
mqLogTime("MQExec.doRoute: Transaction Start");xmlDoc=this.doTransaction("DoRouteMatrix",arrRequest,this.ROUTEMATRIX_VERSION);mqLogTime("MQExec.doRoute: Transaction End");mqLogTime("MQExec.doRoute: Loading of RouteResults Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/DoRouteMatrixResponse/RouteMatrixResults"));mqrmrResults.loadXml(strXml);mqLogTime("MQExec.doRoute: Loading of RouteResults End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.getRecordInfo=function(mqscFieldNames,mqdlqQuery,mqrsResults,mqscRecIds){var xmlDoc;var strXml;var arrRequest=new Array();if(mqscFieldNames==null||mqscFieldNames.getClassName()!=="MQStringCollection"){throw"Null or Illegal Argument passed for MQStringCollection";}else{var fields=new MQStringCollection();fields.setM_Xpath("Fields");fields.append(mqscFieldNames);arrRequest.push(fields);}
if(mqdlqQuery==null||mqdlqQuery.getClassName()!=="MQDBLayerQuery"){throw"Null or Illegal Argument passed for MQDBLayerQuery";}else{arrRequest.push(mqdlqQuery);}
if(mqrsResults==null||mqrsResults.getClassName()!=="MQRecordSet"){throw"Null or Illegal Argument passed for MQRecordSet";}
if(mqscRecIds==null||mqscRecIds.getClassName()!=="MQStringCollection"){throw"Null or Illegal Argument passed for MQStringCollection";}else{var recordIds=new MQStringCollection();recordIds.setM_Xpath("RecordIds");recordIds.append(mqscRecIds);arrRequest.push(recordIds);}
mqLogTime("MQExec.getRecordInfo: Transaction Start");xmlDoc=this.doTransaction("GetRecordInfo",arrRequest,this.GETRECORDINFO_VERSION);mqLogTime("MQExec.getRecordInfo: Transaction End");mqLogTime("MQExec.getRecordInfo: Loading of RecordSet Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetRecordInfoResponse/RecordSet"));mqrsResults.loadXml(strXml);mqLogTime("MQExec.getRecordInfo: Loading of RecordSet End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.reverseGeocode=function(mqllLatLng,mqlcLocations,strMapCovName,strGeocodeCovName){var xmlDoc;var strXml;var arrRequest=new Array();if(mqllLatLng==null||mqllLatLng.getClassName()!=="MQLatLng"){throw"Null or Illegal Argument passed for MQLatLng";}else{arrRequest.push(mqllLatLng);}
if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}
var mapPool=strMapCovName||"";arrRequest.push(new MQXmlNodeObject("MapPool",mapPool));var geocodePool=strGeocodeCovName||"";arrRequest.push(new MQXmlNodeObject("GeocodePool",geocodePool));mqLogTime("MQExec.reverseGeocode: Transaction Start");xmlDoc=this.doTransaction("ReverseGeocode",arrRequest,this.REVERSEGEOCODE_VERSION);mqLogTime("MQExec.reverseGeocode: Transaction End");mqLogTime("MQExec.reverseGeocode: Loading of Response Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/ReverseGeocodeResponse/LocationCollection"));mqlcLocations.loadXml(strXml);mqLogTime("MQExec.reverseGeocode: Loading of Response End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.search=function(mqscCriteria,mqfcSearchResults,strCoverageName,mqdlqcDbLayers,mqfcFeatures,mqdcDisplayTypes){var xmlDoc;var strXml;var arrRequest=new Array();var strName=mqscCriteria?mqscCriteria.getClassName():null;if(strName==null||(strName!=="MQSearchCriteria"&&strName!=="MQRadiusSearchCriteria"&&strName!=="MQRectSearchCriteria"&&strName!=="MQPolySearchCriteria"&&strName!=="MQCorridorSearchCriteria")){throw"Null or Illegal Argument passed for Search Criteria";}else{arrRequest.push(mqscCriteria);}
if(mqfcSearchResults==null||mqfcSearchResults.getClassName()!=="MQFeatureCollection"){throw"Null or Illegal Argument passed for MQFeatureCollection";}
if(typeof strCoverageName!=="string"){throw"Illegal Argument passed for strCoverageName";}else{arrRequest.push(new MQXmlNodeObject("CoverageName",strCoverageName));}
if(mqdlqcDbLayers!=null&&mqdlqcDbLayers.getClassName()!=="MQDBLayerQueryCollection"){throw"Illegal Argument passed for MQRouteOptions";}else if(mqdlqcDbLayers==null){mqdlqcDbLayers=new MQDBLayerQueryCollection();}
arrRequest.push(mqdlqcDbLayers);if(mqfcFeatures!=null&&mqfcFeatures.getClassName()!=="MQFeatureCollection"){throw"Illegal Argument passed for MQFeatureCollection";}else if(mqfcFeatures==null){mqfcFeatures=new MQFeatureCollection();}
arrRequest.push(mqfcFeatures);if(mqdcDisplayTypes!=null&&mqdcDisplayTypes.getClassName()!=="MQDTCollection"){throw"Illegal Argument passed for MQDTCollection";}else if(mqdcDisplayTypes==null){mqdcDisplayTypes=new MQDTCollection();}
arrRequest.push(mqdcDisplayTypes);mqLogTime("MQExec.Search: Transaction Start");xmlDoc=this.doTransaction("Search",arrRequest,this.SEARCH_VERSION);mqLogTime("MQExec.Search: Transaction End");mqLogTime("MQExec.Search: Loading of Search results Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/SearchResponse/FeatureCollection"));mqfcSearchResults.loadXml(strXml);mqLogTime("MQExec.Search: Loading of Search results End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.getRouteBoundingBoxFromSessionResponse=function(sessionId,mqRectLL){var xmlDoc;var strXml;var arrRequest=new Array();if(mqRectLL==null){throw"Null or Illegal Argument passed for MQRectLL";}
arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));xmlDoc=this.doTransaction("GetRouteBoundingBoxFromSession",arrRequest);mqLogTime("MQExec.doRoute: Loading of MQRectLL Start");var nodes=xmlDoc.documentElement.childNodes;var ul=new MQLatLng();ul.loadXml(mqXmlToStr(nodes[0]));var lr=new MQLatLng();lr.loadXml(mqXmlToStr(nodes[1]));mqRectLL.setUpperLeft(ul);mqRectLL.setLowerRight(lr);mqLogTime("MQExec.doRoute: Loading of MQRectLL End");};MQExec.prototype.isAlive=function(){if(this.getServerPort()==-1||this.getServerName()=="")
return false;return true;};MQExec.prototype.getServerInfo=function(lType){if(!this.isAlive())
return null;var strReqXml;var xmlDoc;var strXml;var type=lType||0;var arrRequest=new Array();if(typeof type!=="number"){throw"Illegal Argument passed for lType";}else{arrRequest.push(new MQXmlNodeObject("Type",type));}
mqLogTime("MQExec.GetServerInfo: Transaction Start");xmlDoc=this.doTransaction("GetServerInfo",arrRequest);mqLogTime("MQExec.GetServerInfo: Transaction End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");return xmlDoc;};var leftArrid=null;var rightArrid=null;var sphone=null;var sname=null;var scity=null;var sstate=null;var szip=null;var spic=null;var afMapDetails=null;var EmailAddressClientID=null;var NameClientID=null;var AreaClientID=null;var PrefixClientID=null;var NumberClientID=null;var loginsave=null;var timeID=null;var gHead=null;var submitb=null;var justOnce="1";var compareCount=0;var tb=null;var n;var p;var p1;var len;var cmpConfirmation="";var multivalue=false;var numSelected=0;var numAll=0;var usecaptcha=false;function cpost(){if(usecaptcha){if(LeadChallenge!=null&&LeadChallenge!="undefined"){var b=document.getElementById(LeadChallenge);if(b!=null){b.value=$("#recaptcha_challenge_field").val()}}if(LeadResponse!=null&&LeadResponse!="undefined"){var a=document.getElementById(LeadResponse);if(a!=null){a.value=$("#recaptcha_response_field").val()}}}else{if(LeadChallenge!=null&&LeadChallenge!="undefined"){var b=document.getElementById(LeadChallenge);if(b!=null){b.value=""}}if(LeadResponse!=null&&LeadResponse!="undefined"){var a=document.getElementById(LeadResponse);if(a!=null){a.value=""}}}}function pato(){var a=document.getElementById("LeadEmailLocal");if(a!=null){a.style.height=0}a.style.height="0px"}function clicker(){var a=document.getElementById("displaybox");if(a.style.display=="none"){a.style.display="";a.innerHTML="<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><br><a href='#' onclick='return clicker();'>CLOSE WINDOW</a></td></tr></table>"}else{a.style.display="none";a.innerHTML=""}return false}function ImgLoad(e,c,b,a,k){var m=document.getElementById(e);var l=document.getElementById(c);var j=document.getElementById(b);var i=document.getElementById(a);var h=document.getElementById(k);var g=new Image();var f=new Image();var d=new Image();g.onerror=function(o){m.style.display="none";i.style.display="none";h.style.display="none"};g.src=m.src;f.onerror=function(o){l.style.display="none";i.style.display="none";h.style.display="none"};f.src=l.src;d.onerror=function(o){j.style.display="none";i.style.display="none";h.style.display="none"};d.src=j.src}function ValidatePhone(){p=p1.value;p=removeNoDigit(p);if(p.length==3){pp=p;d4=p.indexOf("(");d5=p.indexOf(")");if(d4==-1){pp="("+pp}if(d5==-1){pp=pp+")"}tb.value="";pp=removeNoDigit(pp);tb.value=pp}if(p.length>3){d1=p.indexOf("(");d2=p.indexOf(")");if(d2==-1){l30=p.length;p30=p.substring(0,4);p30=p30+")";p31=p.substring(4,l30);pp=p30+p31;tb.value="";pp=removeNoDigit(pp);tb.value=pp}}if(p.length>5){p11=p.substring(d1+1,d2);if(p11.length>3){p12=p11;l12=p12.length;l15=p.length;p13=p11.substring(0,3);p14=p11.substring(3,l12);p15=p.substring(d2+1,l15);tb.value="";pp="("+p13+")"+p14+p15;pp=removeNoDigit(pp);tb.value=pp}l16=p.length;p16=p.substring(d2+1,l16);l17=p16.length;if(l17>3&&p16.indexOf("-")==-1){p17=p.substring(d2+1,d2+4);p18=p.substring(d2+4,l16);p19=p.substring(0,d2+1);pp=p19+p17+"-"+p18;tb.value="";pp=removeNoDigit(pp);tb.value=pp}}len=tb.value.length;if(len>0){p=tb.value;p=removeNoDigit(p);if(p.length>2){pp=p;d4=p.indexOf("(");d5=p.indexOf(")");if(d4==-1){pp="("+pp}if(d5==-1){pp=pp.substring(0,4)+")"+pp.substring(4)}p=pp}tb.value=p}setTimeout(ValidatePhone,100)}function getIt(a,b){n=a.name;p1=a;tb=document.getElementById(b);ValidatePhone()}function testphone(a){p=a.value;p=p.replace("(","");p=p.replace(")","");p=p.replace("-","");p=p.replace("-","");if(isNaN(p)==true){alert("Check phone");return false}}function KeyCheck(c,a){var b=(window.event)?event.keyCode:c.keyCode;n=a.name;p1=a;switch(b){case 37:p1.value="Izq";break;case 39:p1.value="Der";break}}function Format2(b,d,i){var k=document.getElementById(d);var f=null;var c=null;var g=null;var h;var j;h=b.name;j=b;if(tb!=null){inp=tb.value;len=tb.value.length}var a=j.value;c=j.value.length;f=a.charCodeAt(c-1);tb.value=removeNoDigit(a)}function countInt(b){var a;var d=0;for(a=0;a<b.length;a++){var e=b.charAt(a);if(((e>="0")&&(e<="9"))){++d}}return d}function removeDash(d){var b;var a="";for(b=0;b<d.length;b++){var e=d.charAt(b);if(e!="-"){a+=e}}return a}function removeBlank(d){var b;var a="";for(b=0;b<d.length;b++){var e=d.charAt(b);if(e!=""&&e!=" "&&e!=""&&e!=" "){a+=e}}return a}function removeNoDigit(d){var b;var a="";for(b=0;b<d.length;b++){var e=d.charCodeAt(b);if(e!=26&&e!=27){if(e>=48&&e<=57){a+=d.charAt(b)}if(e==40&&b==0){a+=d.charAt(b)}if(e==41&&b==4){a+=d.charAt(b)}if(e==45&&b==8){a+=d.charAt(b)}}}return a}function ConfirmActionForPostback(b,c,d){var a=confirm(b);if(a==true){__doPostBack(c,d)}}function ChangeImageSource(c,d,b){var a=document.getElementById(c);if(a){try{a.src=d}catch(f){try{if(b!=null&&b.length>0){a.src=b}}catch(f){}}}}function changeButtonStyle(c,a,d){var b=window.event?event.srcElement:c.target;if(b.tagName=="INPUT"&&b.type=="submit"){b.style.textDecoration=d;b.style.backgroundColor=a}}function searchType(a){var b=new Array();b=a.split(",");if(b.length==1){return b[0].toString().trim()}else{if(b.length==2){return b[1].toString().trim().toLowerCase()}else{if(b.length==3){return b[2].toString().trim().toLowerCase()}}}}function ShowRadiusValue(c,a){var b=$find("RadiusSliderExtender");if(b!=null){var d=(100*b._textBox.value)/b._length;if($.browser.mozilla){document.getElementById(RadiusUpdateLabelClientID).innerHTML="Radius "+Math.round(d)+" miles"}else{document.getElementById(RadiusUpdateLabelClientID).innerText="Radius "+Math.round(d)+" miles"}}}function ShowPriceSliderValue(g,c){var e=$find("PriceSliderExtender");var d=document.getElementById(g._handleUnderDrag.id);var f=null;if(e!=null){var b=document.getElementById(MaxPriceClientID).value;var a=document.getElementById(e._multiHandleSliderTargets[0].ControlID);var h=document.getElementById(e._multiHandleSliderTargets[1].ControlID);if(d.id=="PriceSliderExtender_handle_0"){f=Math.round((b*a.value)/e._length);UpdatePriceLabel(PriceUpdateLabelFromClientID,f)}else{if(d.id=="PriceSliderExtender_handle_1"){f=Math.round((b*h.value)/e._length);UpdatePriceLabel(PriceUpdateLabelToClientID,f)}}}}function UpdatePriceLabel(a,b){if($.browser.mozilla){document.getElementById(a).innerHTML=b.localeFormat("C0")}else{document.getElementById(a).innerText=b.localeFormat("C0")}}function ShowProgress(b,a){ShowProgress(b,a)}function CheckCalendarDate(b,a){b._textbox.set_Value(b._selectedDate.format(b._format))}function GetRule(e){var f=null;var c=new Array();var a=0;for(var b=0;b<document.styleSheets.length;b++){f=document.styleSheets[b];for(var d=0;d<f.rules.length;d++){rule=f.rules[d];if((rule.selectorText=="."+e)||(rule.selectorText==e)){c[a]=rule;a++}}}return c}var timer=null;function HideDivTag(a){var b=document.getElementById(a);if(b!=null){b.style.display="none"}if(timer!=null){clearTimeout(timer)}}function ShowDepositContent(c){var a=$get(c);var b=$get("SlideShowDivTag");if(a!=null){if($.browser.msie){$(b).css("position","absolute");$(b).css("top","0");$(b).css("left","0")}a.style.display="block";if($.browser.msie){$(b).css("position","absolute");$(b).css("top","260");$(b).css("left","145")}}return false}function OpenAvailabilityLink(c,b,e,d,f){OpenAvailabilityModal(c,false);OpenPopUnder(b,"lead",$(window).height()*0.4,$(window).width()*0.31);OpenPopUnder(e,"advt",$(window).height()*0.5,$(window).width()*0.5);var a=e!=""?"event19":"";LogAvailPopUnder(a.toString().trimEnd(),d,f);return false}function OpenAvailabilityModal(b,a){var c=$find("ExtExtenderBehavior");if(c!=null&&c!="undefined"){SetCheckAvailabilityPopUpStyle(c,b);c.show()}if(a){return false}}function SetCheckAvailabilityPopUpStyle(c,a){var e=$(String.format("#{0}",c._PopupControlID));var b=$(window).height()*0.8;var d="1000";e.css("height",b);e.css("width",d);e.find("#IFrameDiv").css("height",b);e.find("#IFrameDiv").css("width",d);e.find("#ExtFrame").attr({src:a});e.find("#ExtFrame").attr({height:b});e.find("#ExtFrame").attr({width:d});e.find("#CloseImg").attr({src:"/partners/af/images/chk_avail_close.gif"});e.find("#CloseImg").unbind("click");e.find("#CloseImg").click(function(){c.hide();e.find("#ExtFrame").attr({src:""})})}function LeadSubmissionPopUnder(e,d,b,c){OpenPopUnder(e,"advt",$(window).height()*0.5,$(window).width()*0.5);OpenPopUnder(d,"check",$(window).height()*0.8,"1000");var a=String.format("{0}{1}{2}",e!=""?"event19":"",e!=""&&d!=""?",":"",d!=""?"event20":"");LogLeadPopUnder(a.toString().trimEnd(),b,c);return false}function ViewWebsitePopUp(c,e,b,d){OpenPopUnder(c,"lead",$(window).height()*0.4,$(window).width()*0.31);OpenPopUnder(e,"check",$(window).height()*0.8,$(window).width()*0.8);var a=e!=""?"event20":"";LogAdvertiserPopUnder(a.toString().trimEnd(),b,d);return false}function OpenPopUnder(c,b,a,e){if(typeof(c)!="undefined"&&c!=""){var d=String.format("height={0}, width={1}, status=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no",a,e);window.open(c,b,d).blur();window.focus()}}function HideDispayInfo(b){var a=$get(b);if(a!=null){if($.browser.msie){$("#SlideShowDivTag").css("position","absolute");$("#SlideShowDivTag").css("top","0");$("#SlideShowDivTag").css("left","0")}$(a).hide();if($.browser.msie){$("#SlideShowDivTag").css("position","absolute");$("#SlideShowDivTag").css("top","260");$("#SlideShowDivTag").css("left","145")}}}function ShowDivTag(a){var b=document.getElementById(a);if(b!=null){b.style.display="block"}timer=setTimeout("HideDivTag('"+a+"')",10000)}function HideMap(b,a,f){CloseInfoBox(true);CloseRolloverBox(true);var c=document.getElementById(b);$(c).slideUp("slow");var e=document.getElementById(a);e.style.display="block";var d=document.getElementById(f);d.style.display="none";addCookie("showmap","false",1)}function ShowMap(b,a,f){var c=document.getElementById(b);$(c).slideDown("fast",function(){LoadMap()});var e=document.getElementById(a);e.style.display="none";var d=document.getElementById(f);d.style.display="block";addCookie("showmap","true",1)}function HideMapCmp(b,a,f){CloseInfoBox(true);CloseRolloverBox(true);var c=document.getElementById(b);$(c).slideUp("slow");var e=document.getElementById(a);e.style.display="block";var d=document.getElementById(f);d.style.display="none";addCookie("showmapcmp","false",1)}function ShowMapCmp(b,a,f){CloseRolloverBox(true);$("#updateMap").css("display","none");var c=document.getElementById(b);LoadMapCmp();$(c).slideDown("fast",function(){LoadMapCmp()});var e=document.getElementById(a);e.style.display="none";var d=document.getElementById(f);d.style.display="block";addCookie("showmapcmp","true",1)}function ShowMapCmpID(i,c,g,e,f,b){CloseRolloverBox(true);$("#updateMap").css("display","block");var a=e+"|"+f+"|"+b;var d=document.getElementById(i);$(d).slideDown("fast",function(){LoadMapCmpID(a)});var j=document.getElementById(c);j.style.display="none";var h=document.getElementById(g);h.style.display="block";addCookie("showmapcmp","true",1)}function ResetMapFacetCookies(){addCookie("showmap","false",1);addCookie("showmapcmp","false",1);addCookie("showfacet","false",1)}function ShowPrintButton(){if(typeof(PrintButtonClientID)!="undefined"){var a=$(PrintButtonClientID);var b=$(GetBrochureElementID);if(a!=null){a.show()}if(b!=null){b.hide()}UpdateHeaderPanel()}}function ShowGetBrochureButton(){if(typeof(PrintButtonClientID)!="undefined"){var a=$(PrintButtonClientID);var b=$(GetBrochureElementID);if(a!=null){a.hide()}if(b!=null){b.show()}UpdateHeaderPanel()}}function UpdateHeaderPanel(){var a=$(RefreshPanelID);if(a!=null){__doPostBack(RefreshPanelID,"")}}function disableEnterKey(a){$("input").keypress(function(b){return b.keyCode==13?false:true})}function AutoComplete_OnClientShown(b,a){if($.browser.msie&&$.browser.version.substr(0,1)>6){return}if($.browser.msie){var e=b.get_completionList();var c=e.parentNode;var d=getChildObj(c,"IFRAME");if(d){c.removeChild(d)}d=document.createElement("IFRAME");c.appendChild(d);d.style.display="block";d.style.position="absolute";d.style.width=e.style.width;d.style.height=e.offsetHeight;d.style.left=e.style.left;d.style.top=e.style.top}}function AutoComplete_OnClientHiding(b,a){if($.browser.msie&&$.browser.version.substr(0,1)>6){return}if($.browser.msie){var e=b.get_completionList();var c=e.parentNode;var d=getChildObj(c,"IFRAME");if(d){c.removeChild(d)}}}function getChildObj(b,a){for(var c=0;c<b.childNodes.length;c++){if(b.childNodes[c].tagName==a){return b.childNodes[c]}}return false}function ShowHideOptions(){var b=$find("cpeOptions");if(b!=null&&b!="undefined"){var a=b._collapsed;if(a){addCookie("showfacet","false",1)}else{addCookie("showfacet","true",1)}}}function ShowHideResetUpdateLinks(c){var b=document.getElementById("ResetUpdateDiv1");var a=document.getElementById("ResetUpdateDiv2");if(b!=null&&a!=null){if(c){b.style.display="block";a.style.display="none"}else{b.style.display="none";a.style.display="block"}}}function ShowFloorPlanViewPopUp(a,d,c){var b=$find("mpeFloorPlanPopUpBehavior");if(b!=null&&b!="undefined"){SwitchFloorPlanPopUpView(a,d,c);b.show()}return false}function SwitchFloorPlanPopUpView(a,e,d){var c=document.getElementById("FloorPlanPopUpPanel1");var b=document.getElementById("FloorPlanPopUpPanel2");if(a==1){if(c!=null){c.style.display="block";b.style.display="none"}}else{if(a==2){if(b!=null){$("#imgFloorPlanImageSingle").attr("src",e);$("#lblFloorPlanDescriptionSingle").html(d);b.style.display="block";c.style.display="none"}}}}function CloseFloorPlanPopUp(){var a=$find("mpeFloorPlanPopUpBehavior");if(a!=null&&a!="undefined"){a.hide();disableProgressIndicator=false}}function ShowProgressPopUp(){var a=$find("mpeProgressIndicatorBehavior");if(a!=null&&a!="undefined"){a.show()}}function CloseProgressPopUp(){var a=$find("mpeProgressIndicatorBehavior");if(a!=null&&a!="undefined"){a.hide();timeID=window.setTimeout("AutoCloseProgressPopUp()",2000)}}function AutoCloseProgressPopUp(){var a=$find("mpeProgressIndicatorBehavior");if(a!=null){a.hide();if(timeID!=null){window.clearTimeout(timeID)}}}function ShowPhotosViewPopUp(c,a,b){var d=document.getElementById("photodiv");if(d!=null&&d!="undefined"){SwitchPhotosPopUpView(1,c,a,b);d.style.display="block"}return false}function SwitchPhotosPopUpView(a,e,c,d){var b=document.getElementById("PhotosViewPopUpPanel1");var f=document.getElementById("ViewVideoLink");if(c!=null){leftArrid=document.getElementById(c)}if(d!=null){rightArrid=document.getElementById(d)}if(b!=null){if(justOnce=="1"){justOnce="0";OmnitureHeaderPicsClicks2()}b.style.display=(a==1)?"block":"none";if(f!=null){if(e=="0"){f.style.display="none"}}if(leftArrid!=null){leftArrid.style.display="none"}if(rightArrid!=null){rightArrid.style.display="none"}}}function ClosePhotosPopUp(){var a=document.getElementById("photodiv");if(a!=null&&a!="undefined"){if(leftArrid!=null){leftArrid.style.display="inline"}if(rightArrid!=null){rightArrid.style.display="inline"}a.style.display="none";disableProgressIndicator=false}}function ClosePhotosOpenVideo(){var a=document.getElementById("photodiv");if(a!=null&&a!="undefined"){a.style.display="none";disableProgressIndicator=false}a=document.getElementById("videodiv");if(a!=null&&a!="undefined"){SwitchVideoPopUpView(1);a.style.display="block"}return false}function ShowVideoPopUp(a,b){var c=document.getElementById("videodiv");if(c!=null&&c!="undefined"){SwitchVideoPopUpView(1,a,b);c.style.display="block"}return false}function SwitchVideoPopUpView(a,c,d){var b=document.getElementById("YouTubePlayerPopUpPanel1");if(c!=null){leftArrid=document.getElementById(c)}if(d!=null){rightArrid=document.getElementById(d)}if(b!=null){b.style.display=(a==1)?"block":"none";if(leftArrid!=null){leftArrid.style.display="none"}if(rightArrid!=null){rightArrid.style.display="none"}}}function CloseVideoPopUp(){var a=document.getElementById("videodiv");if(a!=null&&a!="undefined"){if(leftArrid!=null){leftArrid.style.display="inline"}if(rightArrid!=null){rightArrid.style.display="inline"}stopYouTube();a.style.display="none";disableProgressIndicator=false}}function CloseVideoOpenPhotos(){var a=document.getElementById("videodiv");if(a!=null&&a!="undefined"){stopYouTube();a.style.display="none";disableProgressIndicator=false}var a=document.getElementById("photodiv");if(a!=null&&a!="undefined"){SwitchPhotosPopUpView(1);a.style.display="block"}return false}function ShowSavedPopUpAfterLogin(){if(loginsave!=null){if(loginsave=="1"){ShowSavedPopUp()}}loginsave=null}function ShowSavedPopUp(){var a=$find("mpeSavedBehavior");if(a!=null&&a!="undefined"){a.show()}}function CloseSavedPopUp(){var a=$find("mpeSavedBehavior");if(a!=null&&a!="undefined"){a.hide()}}function AddCookieAptIdForLocal(a){addCookie("contactaptid",a,1)}function ShowLeadFormPopUpLocal(a,b,g,e,c){var f=$find("mpeLeadFormBehavior");if(f!=null&&f!="undefined"){addCookie("contactaptid",a,1);if(HiddenApartmentIDClientID!=null&&HiddenApartmentIDClientID!="undefined"){var d=$(String.format("#{0}",HiddenApartmentIDClientID));if(d!=null){d.val(a)}}sname=b;Popu();SwitchLeadFormView(2);f.show()}return false}function ShowLeadFormPopUp(m,l,b,f,i,a,k,q,c,j,o){var d=$find("mpeLeadFormBehavior");if(d!=null&&d!="undefined"){addCookie("contactaptid",l,1);if(HiddenApartmentIDClientID!=null&&HiddenApartmentIDClientID!="undefined"){var h=$(String.format("#{0}",HiddenApartmentIDClientID));if(h!=null){h.val(l)}}if(o!="undefined"&&o){if(EmailAddressClientID!=null&&EmailAddressClientID!="undefined"&&LeadEmailClientID!=null&&LeadEmailClientID!="undefined"){var e=document.getElementById(EmailAddressClientID);var g=document.getElementById(LeadEmailClientID);if(e!=null&&g!=null){g.value=e.value}}}if(f==""||f==null){PopulateLeadForm(m,b,"/partners/af/images/no_photo_small.gif",i,a,k,q,c,j)}else{PopulateLeadForm(m,b,f,i,a,k,q,c,j)}SwitchLeadFormView(1);d.show()}return false}function ShowMBFormPopUp(){var a=$find("mpeMBFormBehavior");if(a!=null&&a!="undefined"){a.show()}return false}function CloseMBFormPopUp(){var a=$find("mpeMBFormBehavior");if(a!=null&&a!="undefined"){a.hide()}}function ChageCaptchaUI(){$("#recaptcha_widget").show();$("#recaptcha_table").removeClass();$("#recaptcha_reload").attr("src","../../Content/partners/af/images/reload_captcha.png");$("#recaptcha_switch_img").attr("src","../../Content/partners/af/images/get_image_captcha.png");$("#recaptcha_switch_audio").attr("src","../../Content/partners/af/images/get_audio_captcha.png");$("#recaptcha_whatsthis").attr("src","../../Content/partners/af/images/help_captcha.png")}function SetNameInModal(){var a=document.getElementById("name2");if(a!=null){if(sname!=null){a.innerHTML=sname}}}function Popu(){try{var c=document.getElementById("headTitle");if(c!=null){if(gHead!=null){c.innerHTML=gHead}}var a=document.getElementById("thumbnailurl");if(spic!=null){a.src=spic}var z=document.getElementById("name");if(z!=null){if(sname!=null){z.innerHTML=sname}}var s=document.getElementById("name2");if(s!=null){if(sname!=null){s.innerHTML=sname}}var x=document.getElementById("city");if(x!=null){if(scity!=null){x.innerHTML=scity}}var t=document.getElementById("state");if(t!=null){if(sstate!=null){t.innerHTML=sstate}}var v=document.getElementById("zip");if(v!=null){if(szip!=null){v.innerHTML=szip}}var E=document.getElementById("headPhone");if(E!=null){if(sphone!=null){E.innerHTML=sphone}}var f=document.getElementById("pricerange");if(f!=null){f.innerHTML=pricerange;if(sqftrange!=null&&sqftrange!=""){var y=document.getElementById("divider");y.innerHTML="  |  ";var B=document.getElementById("sqftrange");B.innerText=sqftrange}}if(EmailAddressClientID!=null&&EmailAddressClientID!="undefined"&&LeadEmailClientID!=null&&LeadEmailClientID!="undefined"){var d=document.getElementById(EmailAddressClientID);var h=document.getElementById(LeadEmailClientID);if(d!=null&&h!=null){h.value=d.value}}if(NameClientID!=null&&NameClientID!="undefined"&&LeadNameClientID!=null&&LeadNameClientID!="undefined"){var l=NameClientID;var u=document.getElementById(LeadNameClientID);if(l!=null&&u!=null){u.value=l;if(LeadNameLocalClientID!=null&&LeadNameLocalClientID!="undefined"){var k=document.getElementById(LeadNameLocalClientID);if(k!=null){k.value=l}}}}if(LNameClientID!=null&&LNameClientID!="undefined"&&LeadLastNameClientID!=null&&LeadLastNameClientID!="undefined"){var w=LNameClientID;var m=document.getElementById(LeadLastNameClientID);if(w!=null&&m!=null){m.value=w}}if(AreaClientID!=null&&AreaClientID!="undefined"&&LeadAreaClientID!=null&&LeadAreaClientID!="undefined"){var o=AreaClientID;var q=document.getElementById(LeadAreaClientID);if(o!=null&&q!=null){q.value=o;if(LeadAreaLocalClientID!=null&&LeadAreaLocalClientID!="undefined"){var b=document.getElementById(LeadAreaLocalClientID);if(b!=null){b.value=o}}}}if(PrefixClientID!=null&&PrefixClientID!="undefined"&&LeadPrefixClientID!=null&&LeadPrefixClientID!="undefined"){var D=PrefixClientID;var C=document.getElementById(LeadPrefixClientID);if(D!=null&&C!=null){C.value=D;if(LeadPrefixLocalClientID!=null&&LeadPrefixLocalClientID!="undefined"){var r=document.getElementById(LeadPrefixLocalClientID);if(r!=null){r.value=D}}}}if(NumberClientID!=null&&NumberClientID!="undefined"&&LeadNumberClientID!=null&&LeadNumberClientID!="undefined"){var j=NumberClientID;var g=document.getElementById(LeadNumberClientID);if(j!=null&&g!=null){g.value=j;if(LeadNumberLocalClientID!=null&&LeadNumberLocalClientID!="undefined"){var i=document.getElementById(LeadNumberLocalClientID);if(i!=null){i.value=j}}}}}catch(A){}}function PopuDet(){try{var c=document.getElementById("headTitle");if(c!=null){if(gHead!=null){c.innerHTML=gHead}}var a=document.getElementById("thumbnailurl");if(spic!=null){a.src=spic}var y=document.getElementById("name");if(y!=null){if(sname!=null){y.innerHTML=sname}}var s=document.getElementById("name2");if(s!=null){if(sname!=null){s.innerHTML=sname}}var w=document.getElementById("city");if(w!=null){if(scity!=null){w.innerHTML=scity}}var t=document.getElementById("state");if(t!=null){if(sstate!=null){t.innerHTML=sstate}}var v=document.getElementById("zip");if(v!=null){if(szip!=null){v.innerHTML=szip}}var f=document.getElementById("pricerange");if(f!=null){f.innerHTML=pricerange;if(sqftrange!=null&&sqftrange!=""){var x=document.getElementById("divider");x.innerHTML="  |  ";var A=document.getElementById("sqftrange");A.innerText=sqftrange}}if(EmailAddressClientID!=null&&EmailAddressClientID!="undefined"&&LeadEmailClientID!=null&&LeadEmailClientID!="undefined"){var d=document.getElementById(EmailAddressClientID);var h=document.getElementById(LeadEmailClientID);if(d!=null&&h!=null){h.value=d.value;if(LeadEmailLocalClientID!=null&&LeadEmailLocalClientID!="undefined"){var r=document.getElementById(LeadEmailLocalClientID);if(r!=null){r.value=d.value}}}}if(NameClientID!=null&&NameClientID!="undefined"&&LeadNameClientID!=null&&LeadNameClientID!="undefined"){var l=NameClientID;var u=document.getElementById(LeadNameClientID);if(l!=null&&u!=null){u.value=l;if(LeadNameLocalClientID!=null&&LeadNameLocalClientID!="undefined"){var k=document.getElementById(LeadNameLocalClientID);if(k!=null){k.value=l}}}}if(AreaClientID!=null&&AreaClientID!="undefined"&&LeadAreaClientID!=null&&LeadAreaClientID!="undefined"){var m=AreaClientID;var o=document.getElementById(LeadAreaClientID);if(m!=null&&o!=null){o.value=m;if(LeadAreaLocalClientID!=null&&LeadAreaLocalClientID!="undefined"){var b=document.getElementById(LeadAreaLocalClientID);if(b!=null){b.value=m}}}}if(PrefixClientID!=null&&PrefixClientID!="undefined"&&LeadPrefixClientID!=null&&LeadPrefixClientID!="undefined"){var C=PrefixClientID;var B=document.getElementById(LeadPrefixClientID);if(C!=null&&B!=null){B.value=C;if(LeadPrefixLocalClientID!=null&&LeadPrefixLocalClientID!="undefined"){var q=document.getElementById(LeadPrefixLocalClientID);if(q!=null){q.value=C}}}}if(NumberClientID!=null&&NumberClientID!="undefined"&&LeadNumberClientID!=null&&LeadNumberClientID!="undefined"){var j=NumberClientID;var g=document.getElementById(LeadNumberClientID);if(j!=null&&g!=null){g.value=j;if(LeadNumberLocalClientID!=null&&LeadNumberLocalClientID!="undefined"){var i=document.getElementById(LeadNumberLocalClientID);if(i!=null){i.value=j}}}}}catch(z){}}function PopuLogin(o,d,g){try{var h=document.getElementById("thumbnailurl");if(spic!=null){h.src=spic}var a=document.getElementById("name");if(a!=null){if(sname!=null){a.innerHTML=sname}}var s=document.getElementById("name2");if(s!=null){if(sname!=null){s.innerHTML=sname}}var r=document.getElementById("city");if(r!=null){if(scity!=null){r.innerHTML=scity}}var c=document.getElementById("state");if(c!=null){if(sstate!=null){c.innerHTML=sstate}}var l=document.getElementById("zip");if(l!=null){if(szip!=null){l.innerHTML=szip}}var j=document.getElementById("pricerange");if(j!=null){j.innerHTML=pricerange;if(sqftrange!=null&&sqftrange!=""){var b=document.getElementById("divider");b.innerHTML="  |  ";var i=document.getElementById("sqftrange");i.innerText=sqftrange}}if(LeadEmailClientID!=null&&LeadEmailClientID!="undefined"){var f=document.getElementById(LeadEmailClientID);if(f!=null){f.value=o}}if(LeadNameClientID!=null&&LeadNameClientID!="undefined"){var q=document.getElementById(LeadNameClientID);if(q!=null){q.value=d}}if(LeadNumberClientID!=null&&LeadNumberClientID!="undefined"){var k=document.getElementById(LeadNumberClientID);if(k!=null){k.value=g}}}catch(m){}}function setFocus(){if(EmailAddressClientID!=null&&EmailAddressClientID!="undefined"){var a=document.getElementById(EmailAddressClientID);if(a!=null){window.setTimeout("miscFocus()",2000)}}}function miscFocus(){if(EmailAddressClientID!=null&&EmailAddressClientID!="undefined"){var a=document.getElementById(EmailAddressClientID);if(a!=null){try{a.focus()}catch(b){}}}}function PopuLoginDet(k,v,b){try{var a=document.getElementById("thumbnailurl");a.src=spic;var s=document.getElementById("name");if(s!=null){if(sname!=null){s.innerHTML=sname}}var j=document.getElementById("name2");if(j!=null){if(sname!=null){j.innerHTML=sname}}var q=document.getElementById("city");if(q!=null){if(scity!=null){q.innerHTML=scity}}var l=document.getElementById("state");if(l!=null){if(sstate!=null){l.innerHTML=sstate}}var o=document.getElementById("zip");if(o!=null){if(szip!=null){o.innerHTML=szip}}var c=document.getElementById("pricerange");if(c!=null){c.innerHTML=pricerange;if(sqftrange!=null&&sqftrange!=""){var r=document.getElementById("divider");r.innerHTML="  |  ";var u=document.getElementById("sqftrange");u.innerText=sqftrange}}if(LeadEmailClientID!=null&&LeadEmailClientID!="undefined"){var f=document.getElementById(LeadEmailClientID);if(f!=null){f.value=k;if(LeadEmailLocalClientID!=null&&LeadEmailLocalClientID!="undefined"){var i=document.getElementById(LeadEmailLocalClientID);if(i!=null){i.value=k}}}}if(LeadNameClientID!=null&&LeadNameClientID!="undefined"){var m=document.getElementById(LeadNameClientID);if(m!=null){m.value=v;if(LeadNameLocalClientID!=null&&LeadNameLocalClientID!="undefined"){var h=document.getElementById(LeadNameLocalClientID);if(h!=null){h.value=v}}}}if(LeadNumberClientID!=null&&LeadNumberClientID!="undefined"){var d=document.getElementById(LeadNumberClientID);if(d!=null){d.value=b;if(LeadNumberLocalClientID!=null&&LeadNumberLocalClientID!="undefined"){var g=document.getElementById(LeadNumberLocalClientID);if(g!=null){g.value=b}}}}}catch(t){}}function PopulateLeadForm(g,v,u,m,f,b,i,s,h){var a=document.getElementById("thumbnailurl");if(a!=null){a.src=u;spic=u;var c=document.getElementById("headTitle");if(g=="none"){g=gHead;if(g=="Free Brochure"){g="free"}else{if(g=="Check Availability"){g="check"}else{if(g=="Contact Us"){g="contact"}}}}if(c!=null){if(g=="free"){c.innerHTML="Free Brochure"}else{if(g=="check"){c.innerHTML="Check Availability"}else{if(g=="contact"){c.innerHTML="Contact Us"}}}}gHead=c.innerHTML;var d=document.getElementById("headPhone");if(d!=null){d.innerHTML=h;sphone=h}var r=document.getElementById("name");if(r!=null){r.innerHTML=v;sname=v}var j=document.getElementById("name2");if(j!=null){j.innerHTML=v;sname=v}var q=document.getElementById("city");if(q!=null){q.innerHTML=m;scity=m}var k=document.getElementById("state");if(k!=null){k.innerHTML=f;sstate=f}var l=document.getElementById("zip");if(l!=null){l.innerHTML=s;szip=s}var e=document.getElementById("pricerange");if(e!=null){e.innerHTML=b;if(i!=null&&i!=""){var o=document.getElementById("divider");o.innerHTML="  |  ";var t=document.getElementById("sqftrange");t.innerText=i}}}}function SwitchLeadFormView(a){var c=document.getElementById("LeadFormPanel1");var b=document.getElementById("LeadFormPanel2");if(a==1){if(c!=null){if(b!=null){document.getElementById("LeadFormPanel2").className="modalBackgroundLeadForm3";if(dvTCID!=null&&dvTCID!="undefined"){var f=document.getElementById(dvTCID);if(f!=null){document.getElementById(dvTCID).className="topC2"}}if(dvBCID!=null&&dvBCID!="undefined"){var e=document.getElementById(dvBCID);if(e!=null){document.getElementById(dvBCID).className="bottomC2"}}}document.getElementById("LeadFormPanel1").className="modalBackgroundLeadForm1";b.style.display="none";c.style.display=(a==1)?"block":"none"}}if(a==2){if(b!=null){document.getElementById("LeadFormPanel2").className="modalBackgroundLeadForm2";if(dvTCID!=null&&dvTCID!="undefined"){var f=document.getElementById(dvTCID);if(f!=null){document.getElementById(dvTCID).className="topC"}}if(dvBCID!=null&&dvBCID!="undefined"){var e=document.getElementById(dvBCID);if(e!=null){document.getElementById(dvBCID).className="bottomC"}}c.style.display="none";b.style.display=(a==2)?"block":"none";var d=document.getElementById("overbox");if(d!=null&&d!="undefined"){d.style.visibility="visible"}}}if(a==2){}}function showStick(b){var a=document.getElementById("overbox");var c=document.getElementById("dvLocalForm");if(b=="1"){if(c!=null&&c!="undefined"){c.style.visibility="visible"}}else{if(b=="2"){if(a!=null&&a!="undefined"){a.style.visibility="visible"}}}}function AutoCloseLeadFormPopUp(){var a=document.getElementById("LeadFormPanel1");if(a!=null&&a.style.display=="none"){CloseLeadFormPopUp()}}function CloseLeadFormPopUp(){var b=$find("mpeLeadFormBehavior");var a=document.getElementById("LeadFormPanel1");if(a!=null){document.getElementById("LeadFormPanel1").className="modalBackgroundLeadForm3"}if(b!=null&&b!="undefined"){b.hide();disableProgressIndicator=false}}function CloseLeadFormPopUpInside(){var d=$find("mpeLeadFormBehavior");var a=document.getElementById("LeadFormPanel2");if(dvTCID!=null&&dvTCID!="undefined"){var c=document.getElementById(dvTCID);if(c!=null){document.getElementById(dvTCID).className="topC2"}}if(dvBCID!=null&&dvBCID!="undefined"){var b=document.getElementById(dvBCID);if(b!=null){document.getElementById(dvBCID).className="bottomC2"}}if(a!=null){document.getElementById("LeadFormPanel2").className="modalBackgroundLeadForm3"}if(d!=null&&d!="undefined"){d.hide();disableProgressIndicator=false}}function ShowDirMessPopUp(){var a=$find("mpeDirBehavior");if(a!=null&&a!="undefined"){SwitchDirView();a.show()}return false}function SwitchDirView(){var a=document.getElementById("MessagePanel");if(a!=null){a.style.display="block"}}function CloseDirMessPopUp(){var a=$find("mpeDirBehavior");if(a!=null&&a!="undefined"){a.hide();disableProgressIndicator=false}}function DetailsBeginRequest(b,a){detailsPostbackElement=a.get_postBackElement();if(typeof(detailsPostbackElement)==="undefined"){return}if(detailsPostbackElement.id.indexOf("lbtnDeposit")>-1){return}}function DetailsPageLoaded(b,a){if(typeof(detailsPostbackElement)==="undefined"){return}else{if(detailsPostbackElement.id.indexOf("Floorplans")>-1){ShowGetBrochureButton()}else{if(detailsPostbackElement.id.indexOf("MainDetailsTab")>-1||detailsPostbackElement.id.indexOf("Photos")>-1||detailsPostbackElement.id.indexOf("MapDirections")>-1||detailsPostbackElement.id.indexOf("NeighborhoodInfo")>-1||detailsPostbackElement.id.indexOf("FindOutMore")>-1){ShowPrintButton()}}}}function ShowCalendar(a){$(document).ready(function(){$(String.format("#{0}",a)).datepicker({showOn:"button",buttonImage:"/partners/af/images/calpick.gif",buttonImageOnly:true})})}function pausecomp(c){var b=new Date();var a=null;do{a=new Date()}while(a-b<c)}function enterPressed(a){if(event.which||event.keyCode){if((event.which==13)||(event.keyCode==13)){document.getElementById(a).click();return false}}else{return true}}function ScrollToResults(){var b=686;var a=document.getElementById("HideMapLink");if(a!=null&&a.style.display=="none"){b=330}window.scroll(0,b)}function CloseAlert(){$("#dialog-confirm").jqmHide()}function CheckCompare(a,b){compareCount=parseInt($("#CompareCount").val());if(compareCount>24&&$(b).attr("checked")){$("#dialog-confirm").jqmShow();$(b).attr("checked",false)}else{$.ajax({url:"/PostCheckCompare?aptid="+a+"&checked="+$(b).attr("checked"),type:"POST",cache:false,success:function(c){if(!$(b).attr("checked")){compareCount--;$("#CompareCount").val(compareCount);ToggleCmpBtn(b,false);if(compareCount==1){$("#listings :checked").each(function(){ToggleCmpBtn(this,false)})}}else{compareCount++;$("#CompareCount").val(compareCount);if($("#listings :checked").size()>1||compareCount>1){if(compareCount==2){$("#listings :checked").each(function(){ToggleCmpBtn(this,true)})}else{ToggleCmpBtn(b,true)}}}}})}}function ToggleCmpBtn(b,c){var d=$(b).attr("id");var a=d.substring(13);if(c){$("#comparetext_"+a).css("display","none");$("#comparenow_"+a).css("display","block")}else{$("#comparetext_"+a).css("display","block");$("#comparenow_"+a).css("display","none")}}function RemoveCompare(a){$.ajax({url:"/PostCheckRemoveCompare?aptid="+a,type:"POST",cache:false,success:function(b){}})}function UpdateLeadList(b,c){var a=$("#dvActions :checked").size();$.ajax({url:"/removecomparelead?aptid="+b+"&opt="+c,type:"POST",success:function(d){}})}function SetValuesAgain(){SetCmpLeadForm(multivalue)}function SetCmpLeadForm(c){multivalue=c;numSelected=$("#dvActions :checked").size();numAll=$("#dvActions input[type='checkbox']").size();var a=0;if(!c){$("#multiType").val("selected");a=$("#dvActions :checked").size();numSelected=a;if(a>1){$("#PropCount").text("the "+a+" properties you have selected");sname="the "+a+" properties you have selected";$("#name2").text(sname);ShowLeadFormPopUp()}else{GetAptName()}}else{$("#multiType").val("all");a=$("#dvActions input[type='checkbox']").size();numAll=a;if(a>1){$("#PropCount").text("the "+a+" properties you have selected");sname="the "+a+" properties you have selected";$("#name2").text(sname);ShowLeadFormPopUp()}else{GetAptName()}}var b=0;if(c){b=numAll}else{b=numSelected}var d=parseInt(HowMany);d=d+b;if(d==5||d==10){usecaptcha=true;$("#dvCaptcha").show();showRecaptcha()}else{usecaptcha=false;$("#dvCaptcha").hide()}}function DivisibleBy5(a){return((a%5)==0)?true:false}function GetAptName(){var b=$("#dvActions :checked");if(b.length==1){var a=b.attr("id").substring(3);$.ajax({url:"/getapartmentname?aptid="+a,success:function(c){CmpLeadUp(c)}})}}function CmpLeadUp(a){$("#PropCount").text(a);sname=a;$("#name2").text(sname);ShowLeadFormPopUp()}function RequestChange(c,g){var d=g.split("|")[1].toString();var f="#imgoff"+g.split("|")[0].toString();var b="#imgon"+g.split("|")[0].toString();var e=g.toString()+"|1";var a=g.toString()+"|0";if(c==true){$(f).css("display","none");$(b).css("display","block");if(requestListID==""){requestListID=e}else{requestListID=requestListID.replace(a,e)}UpdateLeadList(g.split("|")[0],"1")}else{if(c==false){$(b).css("display","none");$(f).css("display","block");if(requestListID!=""){requestListID=requestListID.replace(e,a)}UpdateLeadList(g.split("|")[0],"0")}}}function RemoveItem(c){var m="#item"+c.toString();$("div").remove(m);listsize=listsize-1;var i=parseInt($(".content-conveyor-compare").css("left"));if(listsize<5){$("#rt_image").css("display","none");if(i>=0){$("#lt_image").css("display","none")}}var g="";if(listsize>4){if(i<0){var d=i*(-1);d=d/192;d+=1;var h=d+3;var l=listsize-(d-1);if(l<=4){h=d+(l-1);$("#rt_image").attr("src","/partners/af/images/arrow_rt_grey.gif")}g="(showing "+d.toString()+" - "+h.toString()+" of "+listsize.toString()+")"}else{g="(showing 1 - 4 of "+listsize.toString()+")"}}$("#lblCompareCount").html("Compare Apartment Finder Results "+g);if(listsize<1){$("#imgBtnAll").css("display","none");$("#imgBtnPrint").css("display","none");$("#ShowMapCmpLink").css("display","none");$("#ShowMapCmpLink").hide();$("#HideMapCmpLink").css("display","none")}var k=requestListID.split(",");for(index=0;index<k.length;index++){var j=k[index].toString();var f=k[index].split("|")[0].toString()+"|"+k[index].split("|")[1].toString()+"|0";var b=k[index].split("|")[0].toString();if(c.toString()==b){var e=j+",";if(requestListID.indexOf(e)!=-1){requestListID=requestListID.replace(e,"")}else{e=","+j;if(requestListID.indexOf(e)!=-1){requestListID=requestListID.replace(e,"")}else{requestListID=requestListID.replace(j,"")}}break}}$("#imgBtnPrint").unbind("click");k=requestListID.split(",");var a="";for(index=0;index<k.length;index++){if(a==""){a=k[index].split("|")[0].toString()}else{a+=","+k[index].split("|")[0].toString()}}$("#imgBtnPrint").click(function(){OmnitureEvent9("compare-print");var q="<%= domain %>";if(q=="<%= domain %>"&&afdomain!="undefined"){q=afdomain}var o=String.format("http://www.{0}/compareprint.aspx?aptid={1}",q,a);window.open(o);return false});RemoveCompare(c);RemovePoi(c)}function Move(c){var i;var h;var e="";var b=$(".content-conveyor-compare",$("#sliderContentCompare")),l=$(".compare",$("#sliderContentCompare"));l.css("width",ItemWidth);$(".viewer-compare").css("width",ViewerWidth);$(".viewer-compare").css("height",ViewerHeight);$(".content-conveyor-compare").css("height",ViewerHeight);var f=parseInt($(".content-conveyor-compare").css("left"));var j=parseInt($(".content-conveyor-compare").css("width"));var d=listsize;d=d*192;var g=0;if(listsize>4){g=listsize-4;g=g*(-192)}if(c=="l"){if(f<0){f+=192;j-=192;$(".content-conveyor-compare").css("width",j);if(f>g){$("#rt_image").attr("src","/partners/af/images/arrow_rt.gif")}i=f;var a=0;if(f<0){i=(f*-1);a=i/192}if(f==0){i=1}else{i=(i/192)+1}h=i+3;if(a>0){var k=listsize-a;if(k<4){--k;h=i+k}}if(f==0&&listsize<5){$("#lblCompareCount").html("Compare Apartment Finder Results");$("#lt_image").css("display","none")}if(listsize>4){e=i.toString()+" - "+h.toString()+" of ";$("#lblCompareCount").html("Compare Apartment Finder Results (showing "+e+listsize.toString()+")")}}if(f==0){$("#lt_image").attr("src","/partners/af/images/arrow_lt_grey.gif")}}else{if(c=="r"){if(g<f){f-=192;$("#lt_image").attr("src","/partners/af/images/arrow_lt.gif");j+=192;$(".content-conveyor-compare").css("width",j);if(g==f){$("#rt_image").attr("src","/partners/af/images/arrow_rt_grey.gif")}i=(f*-1);i=(i/192)+1;h=i+3;e=i.toString()+" - "+h.toString()+" of ";$("#lblCompareCount").html("Compare Apartment Finder Results (showing "+e+listsize.toString()+")")}}}$(".content-conveyor-compare").css("left",f)}function GetRefineMapView(){if(jQuery.browser.msie){$("#mapModal").html('<div class="mapmodelcontainer"><div class="map-top"></div><div class="map-bg"><div class="inter-om"><p>Loading</p></div></div><div class="map-bottom"></div></div>');$("#mapModal").jqmShow()}$.ajax({type:"GET",cache:true,url:"/Results/get-map-search-view",success:function(a){if(a!=null&&a.length>0){$("#mapModal").jqmHide();$("#mapModal").html(a);$("#mapModal").jqmShow()}}});OmnitureEvent9("search map refine")}function PostMapSrcQuery(c,b,a){$("#mapModal").html('<div class="mapmodelcontainer"><div class="map-top"></div><div class="map-bg"><div class="inter-om"><p>Loading</p></div></div><div class="map-bottom"></div></div>');alert("in shared utilities");$.ajax({type:"POST",cache:false,dataType:"json",url:"/Search/PerformMapSearch/"+c+"/"+b+"/"+a,success:function(d){if(d!=null){location.href=d.cr}}})}function setMobileCookie(){var a=new Date();a.setDate(a.getFullYear()+1);$.cookie("Mobile","redirect=yes",{path:"/",expires:a,domain:afdomain,raw:true})}function LoadFav(){$.ajax({type:"GET",cache:false,url:"/Favorites",success:function(a){if(a!=null&&a.length>0){$("#favModal").empty();$("#favModal").html(a);$("#favModal").jqmShow()}}})}function AddFav(a){$.ajax({type:"GET",cache:false,url:"/Favorite/Add/"+a,success:function(c){$("#fav_"+a).addClass("af-favorited").attr("href","javascript:RemFav("+a+",false);").attr("title","Remove from my favorites").html("Remove from my favorites");var b=parseInt($(".favorites-count").text());$(".favorites-count").text(b+1);if($(".details-favorites").length>0){$(".details-favorites").addClass("af-favorited")}LoadFav()}})}function RemFav(b,a){$.ajax({type:"GET",cache:false,url:"/Favorite/Remove/"+b,success:function(d){if(a){($("#favList").find("#fav_"+b)).parent().parent().remove();($("#srcResList").find("#fav_"+b)).removeClass("af-favorited").attr("href","javascript:AddFav("+b+");").attr("title","Add to my favorites").html("Add to my favorites")}else{$("#fav_"+b).removeClass("af-favorited").attr("href","javascript:AddFav("+b+");").attr("title","Add to my favorites").html("Add to my favorites")}var c=parseInt($(".favorites-count").text());c-=1;$(".favorites-count").text(c);if(c==0){$(".afModalFavs-heading").html("You presently have no favorites selected.");$(".afModalFavs-contact").removeClass("dividing").empty();$("#favList").remove()}if($(".details-favorites").length>0){$(".details-favorites").removeClass("af-favorited")}}})}function LoadFavLead(){$.ajax({type:"GET",cache:false,url:"/Lead/FavLeadForm",success:function(a){$("#favModal").empty();$("#favModal").jqmHide();$("#LeadModal").empty();$("#LeadModal").html(a);$("#LeadModal").jqmShow()}})}function closeModal(a){$("#"+a).jqmHide();$("#"+a).empty()};﻿
var rw;
var detMqMap;
var mqOrigCenter;
var mqOrigZoom;
var mqCenter;
var mqZoom;
var mqPoiCollection;
var mqResultsPoiCollection;
var prevBrowserSize;
var detMapIcon;
var detMapIconMult;
var detMapIconMkt;
var detIconOffset;
var detIconMultOffset;
var detIconMktOffset;
var detMapIconShadow;
var updateMapFlag = true;
var mqIconPath = "/partners/af/images/push-pin.gif";
var mqIconMultPath = "/partners/af/images/push-pin.gif";
var mqIconShadowPath = "/partners/af/images/push-pin.gif";
var mqIconMktPath = "/partners/af/images/push-pin.gif";
var mqIconPath1 = "/partners/af/images/push-pin1.gif";
var mqIconPath2 = "/partners/af/images/push-pin2.gif";
var iteration = 0;
var meid;
var mapCenterLat;
var mapCenterLng;
var globalPoints = null;
var globalfromLat = null;
var globalfromLong = null;
var globalDivdir = null;
var propName = null;
var grev = '0';
var ispartner = '0';
var mqType;
var proxyServerName = "";
var proxyServerPort = "";
var ProxyServerPath = "";
var mapServerName = "map.access.mapquest.com";
var mapServerPort = "80";
var mapServerPath = "mq";
var mapExec;
var geoServerName = "geocode.access.mapquest.com";
var geoServerPort = "80";
var geoServerPath = "mq";
var geoExec;
var routeServerName = "route.access.mapquest.com";
var routeServerPort = "80";
var routeServerPath = "mq";
var routeExec;
var proxyServerPath = "";
var mqPort = "80";
var mqPath = "mq";
var myGExec = null;
var myRExec = null;
var myTAddress = new MQAddress();
var myFAddress = new MQAddress();
var myGcColl = new MQLocationCollection("MQGeoAddress");
var myRtColl = new MQLocationCollection("MQGeoAddress");
var myOptions = new MQRouteOptions();
var myRtResults = new MQRouteResults();
var myTrkRtColl = new MQTrekRouteCollection();
var myManeuverColl = new MQManeuverCollection();
var myManStr = "";
var myTrkStr = "";
var mySessID = "";
var myBoundingBox = null;

function popInfo(mapclientID, Fstreet, Fcity, Fstate, Fpostalcode, Fcountry, Tstreet, Tcity, Tstate, Tpostalcode, Tcountry, doplot, lang) {
    mqType = detMqMap.getMapType();
    myFAddress.setStreet(Fstreet);
    myFAddress.setCity(Fcity);
    myFAddress.setState(Fstate);
    myFAddress.setPostalCode(Fpostalcode);
    myFAddress.setCountry(Fcountry);
    myTAddress.setStreet(Tstreet);
    myTAddress.setCity(Tcity);
    myTAddress.setState(Tstate);
    myTAddress.setPostalCode(Tpostalcode);
    myTAddress.setCountry(Tcountry);
    myOptions.setLanguage(lang);
    geocodeThem(doplot); 
}
function popInfoP(mapclientID, Fstreet, Fcity, Fstate, Fpostalcode, Fcountry, Tstreet, Tcity, Tstate, Tpostalcode, Tcountry, rev, nonevisible, lang) 
{
    mqType = detMqMap.getMapType();
    if (rev == '1') {
        myTAddress = new MQAddress();
        myFAddress = new MQAddress(); 
    }
    myFAddress.setStreet(Fstreet);
    myFAddress.setCity(Fcity);
    myFAddress.setState(Fstate);
    myFAddress.setPostalCode(Fpostalcode);
    myFAddress.setCountry(Fcountry);
    myTAddress.setStreet(Tstreet);
    myTAddress.setCity(Tcity);
    myTAddress.setState(Tstate);
    myTAddress.setPostalCode(Tpostalcode);
    myTAddress.setCountry(Tcountry);
    myOptions.setLanguage(lang); 
    geocodeThemP(rev, nonevisible);
}
function geocodeThem(doplot) {
    myRtColl = new MQLocationCollection("MQGeoAddress");
    myGExec.geocode(myFAddress, myGcColl);
    var objLL = myGcColl.get(0);
    globalfromLat = objLL.getMQLatLng().getLatitude();
    globalfromLong = objLL.getMQLatLng().getLongitude();
    myRtColl.add(myGcColl.get(0));
    myGExec.geocode(myTAddress, myGcColl);    
    objLL = myGcColl.get(0);
    var myLL = new MQA.LatLng(mapCenterLat, mapCenterLng);
    objLL.setMQLatLng(myLL);
    myGcColl.remove(0);
    myGcColl.add(objLL);
    myRtColl.add(myGcColl.get(0));
    detMqMap.removeAllShapes();
    AddPinMQ(mapCenterLat, mapCenterLng, 'Arrive', mqIconPath, '2');
    AddPinMQ(globalfromLat, globalfromLong, 'Start', mqIconPath, '1'); 
    if (doplot == '1')
        ProcessPoiCollection(globalPoints, '1')
    getRoute();
}
function geocodeThemP(rev, nonevisible) {
    grev = rev;
    ispartner = '1';
    myRtColl = new MQLocationCollection("MQGeoAddress");
    myGExec.geocode(myFAddress, myGcColl);
    var objLL = myGcColl.get(0);
    if (rev == '0') {
        globalfromLat = objLL.getMQLatLng().getLatitude();
        globalfromLong = objLL.getMQLatLng().getLongitude(); 
    }
    myRtColl.add(myGcColl.get(0));
    myGExec.geocode(myTAddress, myGcColl);
    objLL = myGcColl.get(0);
    if (rev == '1') {
        globalfromLat = objLL.getMQLatLng().getLatitude();
        globalfromLong = objLL.getMQLatLng().getLongitude(); 
    }
    myRtColl.add(myGcColl.get(0)); 
    if (nonevisible == '0')
        InitMQ(10, detMqMap.getMapType());
    detMqMap.removeAllShapes();
    if (rev == '1') {
        AddPinMQ(mapCenterLat, mapCenterLng, 'Start', mqIconPath, '1');
        AddPinMQ(globalfromLat, globalfromLong, 'Arrive', mqIconPath, '2'); 
        }
        else {
            AddPinMQ(mapCenterLat, mapCenterLng, 'Arrive', mqIconPath, '2');
            AddPinMQ(globalfromLat, globalfromLong, 'Start', mqIconPath, '1'); 
    }
    detMqMap.setMapType(mqType); getRoute(); detMqMap.setMapType(mqType);
}
function getRoute() {
    mqType = detMqMap.getMapType();
    myBoundingBox = new MQA.RectLL(new MQA.LatLng(), new MQA.LatLng());
    myRExec.doRoute(myRtColl, myOptions, myRtResults, mySessID, myBoundingBox); 
    displayIt2(); 
}
function GetMQ(mapElementID, Tstreet, Tcity, Tstate, Tpostalcode, Tcountry, propname, partner, aptLat, aptLong) {
    $(document).ready(function() {
    try {
        proxyServerPath = "http://www." + afdomainmq + "/MQJSProxy.aspx";
        myGExec = new MQExec("geocode.access.mapquest.com", mqPath, mqPort, proxyServerName, proxyServerPath, proxyServerPort);
        myRExec = new MQExec("route.access.mapquest.com", mqPath, mqPort, proxyServerName, proxyServerPath, proxyServerPort);
        mySessID = myRExec.createSessionEx(new MQSession());
        mapCenterLat = aptLat;
        mapCenterLng = aptLong;
        ispartner = partner;
        propName = propname;
        PageStart(mapElementID); 
        }
        catch (ex) { alert("The following exception has occurred GetMQ: " + ex.name + ", " + ex.message); } 
    });
}
function InitMQ(zoom, mapType) { detMqMap = new MQA.TileMap(document.getElementById(meid), zoom, new MQA.LatLng(mapCenterLat, mapCenterLng), mapType); mqType = mapType; mqMoveRefPoint = detMqMap.pixToLL(new MQA.Point(0, 0)); mqZoomControl = new MQA.LargeZoomControl(); detMqMap.addControl(mqZoomControl, new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(10, 21))); mqViewControl = new MQA.ViewControl(); detMqMap.addControl(mqViewControl); }
function PageStart(mapElementID) { var testID = document.getElementById(mapElementID); if (testID != null) { meid = mapElementID; mqZoom = 10; InitMQ(mqZoom, 'map'); AddPinMQ(mapCenterLat, mapCenterLng, '', mqIconPath, '0'); } }
function PlotPointsMQ(mapElementID, centerLat, centerLong, pointsList, aptIconUrl, dodir) {
    $(document).ready(function() {
        try {
            mqType = detMqMap.getMapType();
            globalPoints = pointsList;
            if (dodir == '1') {
                InitMQ(10, mqType);
                popInfo(mapElementID, myFAddress.getStreet(), myFAddress.getCity(), myFAddress.getState(), myFAddress.getPostalCode(), myFAddress.getCountry(), myTAddress.getStreet(), myTAddress.getCity(), myTAddress.getState(), myTAddress.getPostalCode(), myTAddress.getCountry(), '1', 'english'); 
            }
            else
                ProcessPoiCollection(pointsList, '0');
        }
        catch (ex) { alert("The following exception has occurred PP: " + ex.name + ", " + ex.message); } 
    });
}
function onPoiMouseout2(e) { targetPoi = this; var mi = detMqMap.getInfoWindow(); mi.hide(); }
function onPoiMouseover2(e) { targetPoi = this; targetPoi.showInfoWindow(); }
function ProcessPoiCollection(pointsList, after) {
    var points = pointsList; mqPoiCollection = new MQA.ShapeCollection();
    if (points.length > 0) {
        var latLongTokens = points.split(';');
        var veLatLongs = new Array(latLongTokens.length - 1);
        for (index = 0; index < latLongTokens.length; index++) {
            var latitude = latLongTokens[index].split('|')[0]; var longitude = latLongTokens[index].split('|')[1];
            var description = latLongTokens[index].split('|')[2];
            var iconUrl = latLongTokens[index].split('|')[3];
            detMapIconShadow = new MQA.Icon(iconUrl, 0, 0);
            detMapIcon = new MQA.Icon(iconUrl, 19, 19);
            mqIconOffset = new MQA.Point(-10, -26);
            if (latitude != 'undefined' && latitude != "") {
                var mqPointLatLng = new MQA.LatLng(latitude, longitude);
                var mqPoint = new MQA.Poi(mqPointLatLng, detMapIcon);
                mqPoint.setValue('infoContentHTML', "<div style='width:237px; height:auto; z-index:999999999;'>" + description + "</div>"); mqPoint.setValue('infoTitleHTML', "");
                mqPoint.setValue('titleBackgroundColor', "#FFFFFF");
                MQA.EventManager.addListener(mqPoint, "mouseover", onPoiMouseover2, mqPoint);
                MQA.EventManager.addListener(mqPoint, "mouseout", onPoiMouseout2, mqPoint);
           mqPoiCollection.add(mqPoint); } } }
    if (after == '1')
        RenderPoiCollectionAfter(mqPoiCollection); else
        RenderPoiCollection(mqPoiCollection);
}
function RenderPoiCollection(poiCollection) { InitMQ(10, mqType); detMqMap.setMapType(mqType); AddPinMQ(mapCenterLat, mapCenterLng, '', mqIconPath, '0'); detMqMap.setMapType(mqType); detMqMap.addShapeCollection(poiCollection); detMqMap.setMapType(mqType); }
function RenderPoiCollectionAfter(poiCollection) { detMqMap.setMapType(mqType); detMqMap.addShapeCollection(poiCollection); detMqMap.setMapType(mqType); }
function AddPinMQ(latitude, longitude, description, icon, issearch) {
    if (latitude != null && longitude != null) {
        detMapIcon = new MQA.Icon(icon, 24, 46); if (issearch == '1')
            detMapIcon = new MQA.Icon(mqIconPath1, 24, 46); else if (issearch == '2')
            detMapIcon = new MQA.Icon(mqIconPath2, 24, 46); mqIconOffset = new MQA.Point(-10, -40); var poiLL = new MQA.LatLng(latitude, longitude); var mqPoint = new MQA.Poi(poiLL); mqPoint.setIcon(detMapIcon); mqPoint.setValue('iconOffset', mqIconOffset); mqPoint.setValue('infoTitleHTML', "<strong>" + propName + "</strong>"); if (ispartner == '1')
            mqPoint.setValue('infoTitleHTML', "<strong>" + propName + "</strong>"); if (grev == '1') {
            if (issearch == '1') { mqPoint.setValue('infoTitleHTML', "<strong>" + "Start Here: " + propName + "</strong>"); }
            else if (issearch == '2') { mqPoint.setValue('infoTitleHTML', "<strong>" + "Arrive" + "</strong>"); } 
        } else {
            if (issearch == '1') { mqPoint.setValue('infoTitleHTML', "<strong>" + "Start Here" + "</strong>"); }
            else if (issearch == '2') {
                mqPoint.setValue('infoTitleHTML', "<strong>" + propName + " (Arrive) " + "</strong>"); if (ispartner == '1')
                    mqPoint.setValue('infoTitleHTML', "<strong>" + propName + " (Arrive) " + "</strong>");
            } 
        }
        detMqMap.addShape(mqPoint);
    } 
}
function GetDirectionsMQ(mapElementID, latitude, longitude, toLatitude, toLongitude, dvDirections, doplot) {
    try {
        globalfromLat = latitude;
        globalfromLong = longitude;
        globalDivdir = dvDirections;
        detMqMap.removeAllShapes();
        AddPinMQ(toLatitude, toLongitude, 'Arrive', mqIconPath, '2');
        AddPinMQ(latitude, longitude, 'Start', mqIconPath, '1'); 
        if (doplot == '1')
            ProcessPoiCollection(globalPoints, '1')
        if (latitude != 0 & longitude != 0) {
            AddRouteToMapMQ2(latitude, longitude, toLatitude, toLongitude); 
        } 
    }
    catch (ex) { alert("The following exception has occurred GD: " + ex.name + ", " + ex.message); } 
}
function GetDirectionsMQP(mapElementID, latitude, longitude, toLatitude, toLongitude, rev, nonevisible) {
    try {
        globalfromLat = latitude; globalfromLong = longitude; grev = rev; ispartner = '1'; if (nonevisible == '0')
            InitMQ(10, detMqMap.getMapType()); detMqMap.removeAllShapes(); AddPinMQ(toLatitude, toLongitude, 'Arrive', mqIconPath, '2'); AddPinMQ(latitude, longitude, 'Start', mqIconPath, '1'); if (latitude != 0 & longitude != 0) { AddRouteToMapMQ2(latitude, longitude, toLatitude, toLongitude); } 
    }
    catch (ex) { alert("The following exception has occurred GDP: " + ex.name + ", " + ex.message); } 
}
function GetDirectionsMQAfter(mapElementID, latitude, longitude, toLatitude, toLongitude) {
    try {
        if (latitude != 0 & longitude != 0) {
            AddRouteToMapMQ(latitude, longitude, toLatitude, toLongitude);
        } 
    }
    catch (ex) { alert("The following exception has occurred GD: " + ex.name + ", " + ex.message); } 
}
function AddRouteToMapMQ2(startLat, startLng, endLat, endLng) {
    MQA.withModule('directions',
function() {
    detMqMap.addRoute([{ latLng: { lat: startLat, lng: startLng} },
{ latLng: { lat: endLat, lng: endLng}}],
{ draggable: false },
displayNarrative);
}); 
}
function displayNarrative(data) {
    if (data.route) {
        var legs = data.route.legs; var html = ''; var i = 0; var j = 0; var trek; var maneuver; html += '<table><tbody>'
        html += "<tr><td colspan='2' style='width:600px;'><b>Driving Directions</b></td><td align='center'><b>Distance</b></td></tr>"
        for (; i < legs.length; i++) {
            for (j = 0; j < legs[i].maneuvers.length; j++) {
                maneuver = legs[i].maneuvers[j]; html += '<tr>'; html += '<td>&nbsp;'; if (maneuver.iconUrl) { html += (j + 1) + ". " + '<img src="' + maneuver.iconUrl + '">  '; }
                for (k = 0; k < maneuver.signs.length; k++) { var sign = maneuver.signs[k]; if (sign && sign.url) { html += '<img src="' + sign.url + '">  '; } }
                html += '</td>'
                html += '<td>' + maneuver.narrative + '</td>'
                html += '<td>' + maneuver.distance.toFixed(1) + ' miles</td>'
                html += '</tr>';
            } 
        }
        html += '</tbody></table>'; html += "<div style='padding-left:570px;'><b>Total distance:</b> " + legs[0].distance.toFixed(1) + " miles</div>"; document.getElementById('dvD').innerHTML = html;
    } 
}
function displayIt() {
    var myDist = Math.round(myRtResults.getDistance() * 100) / 100; myTrkRtColl = myRtResults.getTrekRoutes(); myManeuverColl = myTrkRtColl.get(0).getManeuvers(); for (intX = 0; intX < myManeuverColl.getSize(); intX++) { myManDist = Math.round(myManeuverColl.get(intX).getDistance() * 100) / 100; myManStr = (intX + 1) + ". " + myManeuverColl.get(intX).getNarrative() + "(Distance: " + myManDist + " mi)"; myTrkStr = myTrkStr + myManStr + "<br/><hr/>"; }
    document.getElementById('dvD').innerHTML = "<hr/><b>DRIVING DIRECTIONS: </b><br/><hr/>" + myTrkStr + "<b> Total Distance: </b>" + myDist + " miles<hr/><br/>"; detMqMap.addRouteHighlight(myBoundingBox, "http://map.access.mapquest.com", mySessID, true);
}
function displayIt2() {
    var myDist = Math.round(myRtResults.getDistance() * 100) / 100;
    var tot = 0;
    myTrkRtColl = myRtResults.getTrekRoutes();
    myManeuverColl = myTrkRtColl.get(0).getManeuvers();
    var myTrkStr = "<table><tr><td  style='width:600px;'><b>Driving Directions</b></td><td align='center'><b>Distance</b></td></tr>";
    for (intX = 0; intX < myManeuverColl.getSize(); intX++) {
        myTrkStr += "<tr><td style='width:600px'>";
        myManStr = (intX + 1) + ". " + myManeuverColl.get(intX).getNarrative();
        myTrkStr += myManStr;
        myManDist = Math.round(myManeuverColl.get(intX).getDistance() * 100) / 100;
        myTrkStr += "</td><td>" + myManDist + " miles </td></tr>";
        tot += parseFloat(myManDist); 
    }
    myTrkStr += "</table>"; myTrkStr += "<div style='padding-left:570px;'><b>Total distance:</b> " + tot.toFixed(1).toString() + " miles</div>";
    document.getElementById('dvD').innerHTML = myTrkStr;
    detMqMap.addRouteHighlight(myBoundingBox, "http://map.access.mapquest.com", mySessID, true); 
    detMqMap.setMapType(mqType);
}
function AddRouteToMapMQ(startLat, startLng, endLat, endLng) {
    var start = new MQGeoAddress();
    var end = new MQGeoAddress();
    start.setMQLatLng(new MQA.LatLng(startLat, startLng));
    end.setMQLatLng(new MQA.LatLng(endLat, endLng));
    var session = new MQSession();
    var routeRes = new MQRouteResults();
    var wayPoints = new MQLocationCollection();
    var myBB = new MQA.RectLL(new MQA.LatLng(), new MQA.LatLng());
    wayPoints.add(start);
    wayPoints.add(end);
    var routeOpt = new MQRouteOptions();
    var sessId = routeExec.createSessionEx(session);
    routeExec.doRoute(wayPoints, routeOpt, routeRes, sessId, myBB);
    detMqMap.addRouteHighlight(myBB, "http://map.access.mapquest.com", sessId, true);
    onGotRouteMQ(routeRes); 
}
function onGotRouteMQ(route) {
    var trek = new MQTrekRouteCollection();
    trek = route.getTrekRoutes();
    var turns = "<table><tr><td  style='width:600px;'><b>Driving Directions</b></td><td align='center'><b>Distance</b></td></tr>";
    var leg = null;
    var tot = 0;
    var currD = 0;
    for (var z = 0; z < trek.getAt(0).getManeuvers().getSize() - 1; z++) {
        leg = trek.getAt(0).getManeuvers().getAt(z);
        turns += "<tr><td style='width:600px'>";
        turns += (z + 1) + ".\t" + leg.getNarrative();
        currD = parseFloat(leg.getDistance()).toFixed(1);
        turns += "</td><td>" + currD.toString() + " miles </td></tr>";
        tot += parseFloat(leg.getDistance()); 
    }
    turns += "</table>"; turns += "<div style='padding-left:570px;'><b>Total distance:</b> " + tot.toFixed(1).toString() + " miles</div>"; 
    SetDirectionsMQ(turns);
}
function SetDirectionsMQ(turns) {
    var dvdir = document.getElementById('dvD');
    if (dvdir != null) {
        document.getElementById('dvD').innerHTML = turns;
        detMqMap.addRouteHighlight(myBoundingBox, "http://map.access.mapquest.com", mySessID, true);
    } 
}﻿
var map; var pins; var targetPoi = null; var infoBoxListingId = null; var infoBoxX = 0; var infoBoxY = 0; var centerLat = null; var centerLong = null; var maxLat = null; var minLat = null; var maxLong = null; var minLong = null; var currentZoomLevel = null; var filter = ""; var infoBox = false; var hoverBox = false; var boxMinX = 0; var boxMaxX = 0; var doBestFit = false; var latLongOld = null; var panThreshold = 10; var dontLoadPins = false; var retryCenterOnMap = 0; var earthRadius = 3961.3; 

function LoadMapStates() {
    var point = document.getElementById(pointID).value; if (point != null && point.split(",").length == 2) { centerLat = point.split(",")[0]; centerLong = point.split(",")[1]; }
    radius = document.getElementById(radiusID).value; maxLat = document.getElementById(maxLatID).value; minLat = document.getElementById(minLatID).value; maxLong = document.getElementById(maxLongID).value; minLong = document.getElementById(minLongID).value; filter = document.getElementById(filterID).value; if (filter == null)
        filter = "";
}
function SaveMapStates()
{ var bounds = map.getBounds(); var topleft = bounds.ul; var bottomright = bounds.lr; document.getElementById(maxLatID).value = bottomright.lat; document.getElementById(minLatID).value = topleft.lat; document.getElementById(maxLongID).value = bottomright.lng; document.getElementById(minLongID).value = topleft.lng; maxLat = document.getElementById(maxLatID).value; minLat = document.getElementById(minLatID).value; maxLong = document.getElementById(maxLongID).value; minLong = document.getElementById(minLongID).value; }
function CloseInfoBox(force) {
    if (force) { var box = document.getElementById('infoBox'); if (box != null) { box.style.display = "none"; infoBox = false; hoverBox = false; } }
    ToggleContentDivHeight();
}
function CloseRolloverBox() {
    if (!hoverBox || force) { var box = document.getElementById('rolloverBox'); if (box != null) { box.style.display = "none"; hoverBox = false; } }
    ToggleContentDivHeight();
}
function setInfoBoxPosition(e) {
    infoBoxX = e.clientX; infoBoxY = e.clientY; if (infoBoxX < boxMinX) { CloseRolloverBox(true); }
    else if (infoBoxX > boxMaxX) { CloseRolloverBox(true); }
    else if (infoBoxY < boxMinY) { CloseRolloverBox(true); }
    else if (infoBoxY > boxMaxY) { CloseRolloverBox(true); } 
}
function onPoiMouseclick(e) {
    CloseRolloverBox(true); CloseInfoBox(true); targetPoi = this; if (this.key[0] == '+') { PageMethods.GetRolloverBox(targetPoi.key, OnCallRolloverBoxComplete, OnCallBoxError, targetPoi); return; }
    var box = document.getElementById('infoBox'); var boxtext = document.getElementById('infoBoxText'); box.style.display = "none"; if (this.key.split(',').length > 1) { boxtext.style.height = "220px"; boxtext.style.overflow = "auto"; }
    else { boxtext.style.height = "auto"; }
    PageMethods.GetInfoBox(targetPoi.key, OnCallInfoBoxComplete, OnCallBoxError, targetPoi); ToggleContentDivHeight();
}
function onPoiMouseover(e) {
    if (infoBox) { return; }
    targetPoi = this;
    var box = document.getElementById('rolloverBox');
    var boxtext = document.getElementById('rolloverBoxText');
    box.style.display = "none";
    boxtext.style.height = "auto";
    PageMethods.GetRolloverBox(targetPoi.key, OnCallRolloverBoxComplete, OnCallBoxError, targetPoi);
    ToggleContentDivHeight();
}
function onPoiMouseout(e) { ToggleContentDivHeight(); }
function OnCallInfoBoxComplete(result, targetPoi, methodName) {
    var box = document.getElementById('infoBox');
    var boxtext = document.getElementById('infoBoxText');
    boxtext.innerHTML = result;
    var offset = getCenterOffset();
    var point = map.llToPix(targetPoi.getLatLng());
    var x = point.getX();
    var y = point.getY();
    box.style.left = (x + 196 + offset.x) + 'px';
    box.style.top = (y + 263 + offset.y) + 'px';
    box.style.display = "block";
    infoBox = true;
    ToggleContentDivHeight();
}
function OnCallRolloverBoxComplete(result, targetPoi, methodName) {
    var box = document.getElementById('rolloverBox'); var boxtext = document.getElementById('rolloverBoxText'); var beak = document.getElementById('rolloverBeak'); boxtext.innerHTML = result; var numitems = targetPoi.key.split(',').length;
    boxMinX = infoBoxX - 240; boxMaxX = infoBoxX + 20; boxMinY = infoBoxY - 30; boxMaxY = infoBoxY + (25 * numitems); var offset = getCenterOffset(); var point = map.llToPix(targetPoi.getLatLng()); var x = point.getX(); var y = point.getY();
    if (typeof(compareListID) == 'undefined') { box.style.left = (x + 390 + offset.x) + 'px'; } else { box.style.left = (x + 290 + offset.x) + 'px'; }
    box.style.top = (y + 313 + offset.y) + 'px'; box.style.display = "block";
    if (targetPoi.key[0] == '+') {
        beak.style.top = '5px'
        box.style.top = (y + 320 + offset.y) + 'px';
    }
    else { beak.style.top = '12px' }
    hoverBox = false; ToggleContentDivHeight();
}
function OnCallCenterBoxComplete(result, targetPoi, methodName) { var box = document.getElementById('infoBox'); var boxtext = document.getElementById('infoBoxText'); boxtext.innerHTML = result; box.style.left = '195px'; box.style.top = '258px'; box.style.display = "block"; infoBox = true; ToggleContentDivHeight(); }
function OnCallBoxError(error, userContext, methodName) {
    if (error !== null) { alert(error.get_message()); }
    ToggleContentDivHeight();
}
function LoadMap() { if (map == null) { LoadMapStates(); calculateView(); poiLL = new MQA.LatLng(centerLat, centerLong); map = new MQA.TileMap(document.getElementById('map'), currentZoomLevel, poiLL, 'map'); map.addControl(new MQA.LargeZoomControl()); map.addControl(new MQA.ViewControl(), new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_RIGHT)); MQA.EventManager.addListener(map, "moveend", OnMapMoved); MQA.EventManager.addListener(map, "zoomend", OnMapZoomed); LoadPushpins(true, false); RememberPreviousCenter(); } }
function LoadMapCmp() {
    if (map == null) { poiLL = new MQA.LatLng(39.5, -98.0); map = new MQA.TileMap(document.getElementById('mapcmp'), 10, poiLL, 'mapcmp'); map.addControl(new MQA.LargeZoomControl()); map.addControl(new MQA.ViewControl(), new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_RIGHT)); }
    LoadComparePushpins();
}
function LoadMapCmpID(propID) {
    if (map == null) { poiLL = new MQA.LatLng(39.5, -98.0); map = new MQA.TileMap(document.getElementById('mapcmp'), 10, poiLL, 'mapcmp'); map.addControl(new MQA.LargeZoomControl()); map.addControl(new MQA.ViewControl(), new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_RIGHT)); }
    LoadComparePushpinID(propID);
}
function ReloadMap() {
    filter = document.getElementById(filterID).value; if (filter == null) { filter = ""; }
    LoadPushpins(true, true); RememberPreviousCenter();
}
function OnMapZoomed() {
    if (!dontLoadPins) { currentZoomLevel = map.getZoomLevel(); LoadPushpins(false, false); }
    RememberPreviousCenter(); ToggleContentDivHeight();
}
function OnMapMoved() { if (IsMapMovedBeyondThreshold()) { CloseInfoBox(true); LoadPushpins(false, false); RememberPreviousCenter(); } }
function LoadPushpins(byRadius, bestFit) {
    if (pins != null)
    { pins.removeAll(); map.removeShapeCollection("pushpins"); }
    var url = null; if (byRadius) { url = '/pushpins.rss?lat=' + centerLat + '&lon=' + centerLong + '&radius=' + radius + '&zoom=' + currentZoomLevel + '&filter=' + filter + '&forceAll=' + bestFit; }
    else { SaveMapStates(); url = '/pushpins.rss?minLat=' + minLat + '&minLon=' + minLong + '&maxLat=' + maxLat + '&maxLon=' + maxLong + '&zoom=' + currentZoomLevel + '&filter=' + filter; }
    doBestFit = bestFit; pins = new MQA.RemoteCollection(url, new MQA.GeoRSSDeserializer()); pins.collectionName = 'pushpins'; MQA.EventManager.addListener(pins, 'dataloaded', onDataLoaded);
}
function LoadComparePushpins() {
    if (pins != null)
    { pins.removeAll(); map.removeShapeCollection("cmppins"); }
    pins = new MQA.ShapeCollection(); pins.collectionName = 'cmppins'; var compareList = document.getElementById(compareListID).value; var list = compareList.split(","); for (i = 0; i < list.length; i++) { var onePin = new MQA.Poi(new MQA.LatLng(list[i].split('|')[1], list[i].split('|')[2])); onePin.setIcon(new MQA.Icon("/partners/af/images/push-pin.gif", 24, 46)); onePin.setKey(list[i].split('|')[0]); onePin.setInfoTitleHTML(null); onePin.setInfoContentHTML(null); MQA.EventManager.addListener(onePin, "mouseover", onPoiMouseover, onePin); MQA.EventManager.addListener(onePin, "mouseout", onPoiMouseout, onePin); MQA.EventManager.addListener(onePin, "click", onPoiMouseclick, onePin); pins.add(onePin); }
    map.addShapeCollection(pins); map.bestFit();
}
function LoadComparePushpinID(propID) {
    if (pins != null) { pins.removeAll(); map.removeShapeCollection("cmppins"); }
    pins = new MQA.ShapeCollection(); pins.collectionName = 'cmppins'; var compareList = propID; var list = compareList; for (i = 0; i < list.length; i++) { var onePin = new MQA.Poi(new MQA.LatLng(list.split('|')[1], list.split('|')[2])); onePin.setIcon(new MQA.Icon("/partners/af/images/push-pin.gif", 24, 46)); onePin.setKey(list.split('|')[0]); onePin.setInfoTitleHTML(null); onePin.setInfoContentHTML(null); MQA.EventManager.addListener(onePin, "mouseover", onPoiMouseover, onePin); MQA.EventManager.addListener(onePin, "mouseout", onPoiMouseout, onePin); MQA.EventManager.addListener(onePin, "click", onPoiMouseclick, onePin); pins.add(onePin); }
    map.addShapeCollection(pins); map.bestFit();
}

function RemovePoi(key) {
    var compareIDs = $("#" + compareListID);
    if (compareIDs != null) {
        var listArray = compareIDs.val().split(',')
        if (listArray != null) {
            for (var i = 0; i < listArray.length; i++) {
                var aptID = listArray[i].split('|')[0];
                if (aptID == key) {
                    listArray.splice(i, 1);
                }
            }
            $("#" + compareListID).val(listArray);
        }
        
        if (map != null) {
            CloseRolloverBox(true);
            var poiArray = map.getShapeCollection("cmppins");
            poiArray.removeItem(poiArray.getByKey(key));
            map.bestFit();
        }
    }
}
function onDataLoaded() {
    for (var i = 0; i < pins.getSize(); i++) {
        var item = pins.getAt(i); item.setIcon(new MQA.Icon("/partners/af/images/push-pin.gif", 24, 46)); item.setKey(item.infoTitleHTML); if (item.key == 'C' || item.key == 'M' || item.key == 'S') { item.setKey('+' + item.infoContentHTML); }
        item.setInfoTitleHTML(null); item.setInfoContentHTML(null); MQA.EventManager.addListener(item, "mouseover", onPoiMouseover, item); MQA.EventManager.addListener(item, "mouseout", onPoiMouseout, item); MQA.EventManager.addListener(item, "click", onPoiMouseclick, item);
    }
    if (infoBoxListingId != null) {
        for (var i = 0; i < pins.getSize(); i++) { var item = pins.getAt(i); if (item.key == infoBoxListingId) { targetPoi = item; } }
        infoBoxListingId = null; if (targetPoi != null) { showHover(targetPoi); } 
    }
    map.addShapeCollection(pins); if (doBestFit == true) { doBestFit = false; map.bestFit(); } 
}
function centerOnMapAndShowHover(latitude, longitude, listingId) {
    try {
        if (map != null) { retryCenterOnMap = 0; dontLoadPins = true; map.setZoomLevel(15); dontLoadPins = false; infoBoxListingId = listingId; centerOnMap(latitude, longitude); }
        else if (retryCenterOnMap < 3) { retryCenterOnMap = retryCenterOnMap + 1; setTimeout('centerOnMapAndShowHover(' + latitude + ', ' + longitude + ', ' + listingId + ');', 1000); } else { retryCenterOnMap = 0; } 
    }
    catch (ex) { LogError(ex, "Results.aspx->centerOnMapAndShowHover()", false); } 
}
function centerOnMap(latitude, longitude) {
    if (document.getElementById("pageTop") != null) { var target = $("pageTop"); var targetOffset = target.offset().top; $('html,body').animate({ scrollTop: targetOffset }, 1500); }
    map.setCenter(new MQA.LatLng(latitude, longitude), 15); RememberPreviousCenter(); currentZoomLevel = 15; LoadPushpins(false, false); currentZoomLevel = map.getZoomLevel();
}
function showHover(targetPoi) { var box = document.getElementById('infoBox'); var boxtext = document.getElementById('infoBoxText'); box.style.display = "none"; box.style.height = "auto"; PageMethods.GetInfoBox(targetPoi.key, OnCallCenterBoxComplete, OnCallBoxError, targetPoi); }
function ZoomToLocation(latitude, longitude, level)
{ map.setCenter(new MQA.LatLng(latitude, longitude), level); RememberPreviousCenter(); CloseInfoBox(true); CloseRolloverBox(true); }
function getCenterOffset() { var point = map.getDragOffset(); var point2 = map.llToPix(map.getCenter()); var x = point2.getX(); var y = point2.getY(); return new MQA.PointXY(-x, -y) }
function IsMapMovedBeyondThreshold() {
    var cpLatLongNew = map.getCenter(); var cpPixelOld = map.llToPix(latLongOld); var cpPixelNew = map.llToPix(cpLatLongNew); var x = Math.abs(cpPixelOld.x - cpPixelNew.x); var y = Math.abs(cpPixelOld.y - cpPixelNew.y); if (x > panThreshold || y > panThreshold)
    { return true; }
    else
    { return false; } 
}
function RememberPreviousCenter()
{ latLongOld = map.getCenter(); }
function calculateView() {
    var defaultScales = new Array(48.62866424, 24.31433212, 12.15716606, 6.07858303, 3.039291515, 1.519642651, 0.759821326, 0.379913769, 0.189956885, 0.094975336, 0.047490774, 0.023745387, 0.011872694, 0.00593324, 0.002969727, 0.001484863, 0.000739325, 0.000372769, 0.000186385); centerLat = (parseFloat(maxLat) + parseFloat(minLat)) / 2; centerLong = (parseFloat(maxLong) + parseFloat(minLong)) / 2; var meanDistanceX = distance(centerLat, minLong, centerLat, maxLong); var meanDistanceY = distance(maxLat, centerLong, minLat, centerLong) * 2; var mapWidth = parseFloat(document.getElementById(mapElementId).style.width); var mapHeight = parseFloat(document.getElementById(mapElementId).style.height); var meanScaleValueX = meanDistanceX / mapWidth; var meanScaleValueY = meanDistanceY / mapHeight; var meanScale; if (meanScaleValueX > meanScaleValueY)
        meanScale = meanScaleValueX; else
        meanScale = meanScaleValueY; var zoom = 1; currentZoomLevel = 0; for (var i = 0; i < 19; i++) {
        if (meanScale >= defaultScales[i] / 10) {
            if (i <= 7) { zoom = 8; }
            else { zoom = i + 2; }
            currentZoomLevel = zoom; break;
        } 
    }
    if (currentZoomLevel == 0)
    { zoom = 11; currentZoomLevel = zoom; } 
}
function distance(lat1, lon1, lat2, lon2)
{ var factor = Math.PI / 180; var dLat = (lat2 - lat1) * factor; var dLon = (lon2 - lon1) * factor; var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * factor) * Math.cos(lat2 * factor) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = earthRadius * c; return d; }
function SetContentDivHeight(value) {
    return; var el = document.getElementById('contentdiv'); if (el != null) {
        if (value == '3000px') { value = el.offsetHeight + 'px'; }
        el.style.height = value;
    } 
}
function ToggleContentDivHeight() { var el = document.getElementById('contentdiv'); var el2 = document.getElementById('dummydiv'); if (el != null && el2 != null) { el.style.height = '2700px'; el2.innerHTML = '.'; el.style.height = 'auto'; el2.innerHTML = ' '; } }
function doMapSearch(searchType) {
    var latLng = null;
    var street = "";
    $("#addressErrorSpan").css("display", "none");
    $("#cityErrorSpan").css("display", "none");
    if (searchType == "address") {
        var streetValue = $.trim($("#mapStreetAddress").val());
        var cityState = $("#mapCityState").val();
        if (streetValue == "" || streetValue == "Search Address") {
            $("#addressErrorSpan").css("display", "block");
            return;
        }
        if (!IsValidCityState()) {
            $("#cityErrorSpan").css("display", "block");
            return;
        }
        var query = streetValue + " " + cityState;
        var mapGeoAddress = new MQLocationCollection("MQGeoAddress");
        var mqPort = "80";
        var mqPath = "mq";
        var searchAddress = new MQAddress();
        var proxyPath = "http://www." + afdomain + "/MQJSProxy.aspx";
        var mapquestGeocoder = new MQExec("geocode.access.mapquest.com", mqPath, mqPort, "", proxyPath, "");
        var street = query;
        searchAddress.setStreet(street);
        mapquestGeocoder.geocode(searchAddress, mapGeoAddress);
        var numberOfResults = mapGeoAddress.getSize();
        if (numberOfResults > 0) {
            var GeoCodeStop = mapGeoAddress.get(0);
            if (numberOfResults > 1) {
                SetAmbigousView(numberOfResults, mapGeoAddress, true);

            }
            else {
                var reg = new RegExp("(([0-9]{5,5})(\\s*)([0-9]*)(\\s*))");
                var enteredZip = "";
                var suggestedAddress = GeoCodeStop.getPostalCode();
                if (suggestedAddress.length > 0) {
                    if (suggestedAddress.indexOf("-") > -1) {
                        suggestedAddress = suggestedAddress.substring(0, suggestedAddress.indexOf("-"));
                    }
                }
                
                var hasZip = false;
                var matches = reg.exec(cityState);
                if (matches != null) {
                    enteredZip = matches[0];
                    hasZip = true;
                }
                if ($.trim(GetStreetAbrv(streetValue)) != GeoCodeStop.getStreet() ||
                                (hasZip && $.trim(enteredZip) != $.trim(suggestedAddress))) {
                    SetAmbigousView(numberOfResults, mapGeoAddress, false);
                    return;
                }
                else {
                    latLng = GeoCodeStop.getMQLatLng();
                }
            }
        }
    }
    else {
        var Stoppos = $("#dragImg").position();
        var offset = new MQA.Point((parseInt(Stoppos.left) + 33), (parseInt(Stoppos.top) + 33));
        latLng = mapQuestMap.pixToLL(offset);
        street = "map";
    }
    PostMapSrcQuery(latLng.lat, latLng.lng, street);
}

function GetStreetAbrv(address) {
    var loweredCase = address.toLowerCase();
    if (loweredCase.indexOf("drive") > -1) {
        address = address.replace(/drive/i, "Dr")
    }
    else if (loweredCase.indexOf("dr.") > -1) {
        address = address.replace(/dr./i, "Dr")
    }
    else if (loweredCase.indexOf("lane") > -1) {
        address = address.replace(/lane/i, "Ln")
    }
    else if (loweredCase.indexOf("ln.") > -1) {
        address = address.replace(/ln./i, "Ln")
    }
    else if (loweredCase.indexOf("street") > -1) {
        address = address.replace(/street/i, "St")
    }
    else if (loweredCase.indexOf("st.") > -1) {
        address = address.replace(/street./i, "St")
    }
    else if (loweredCase.indexOf("road") > -1) {
        address = address.replace(/road/i, "Rd")
    }
    else if (loweredCase.indexOf("rd.") > -1) {
        address = address.replace(/rd./i, "Rd")
    }
    else if (loweredCase.indexOf("circle") > -1) {
        address = address.replace(/circle/i, "Cir")
    }
    else if (loweredCase.indexOf("cir.") > -1) {
        address = address.replace(/cir./i, "Cir")
    }
    else if (loweredCase.indexOf("trail") > -1) {
        address = address.replace(/trail/i, "Trl")
    }
    else if (loweredCase.indexOf("trl.") > -1) {
        address = address.replace(/lane/i, "Trl")
    }
    return address;
}
function InitializeMapSearch() {
    InitializeAddressSearch();
    var p = $("#" + pointID).val();
    if (p != null && p.split(",").length == 2) {
        centerLat = p.split(",")[0]; centerLong = p.split(",")[1];
    }
    mapQuestMap = new MQA.TileMap(document.getElementById('mapControl'), 8, { lat: parseFloat(centerLat), lng: parseFloat(centerLong) }, 'map');
    mapQuestMap.addControl(new MQA.LargeZoomControl());
    $("#dragImg").draggable({ containment: '#mapControl', scroll: false });
    
}
function IsValidCityState() {
    var value = $("#mapCityState").val();
    if ($.trim(value) == "City, State(or Zip Code)") {
        return false;
    }
    var rx = new RegExp("(([0-9a-zA-Z \\.\\-\\\',]+)([\\s,]+)([a-zA-Z]{2,2})(\\s*)([0-9]*)(\\s*))|([0-9]{5,5})(\\s*)|(([0-9a-zA-Z \\.\\-\\\']+)(\\s*),([a-zA-Z \\.\\-\\\']+)(\\s*),(\\s*)([a-zA-Z]{2,2})(\\s*)|([0-9]{5,5})(\\s*)([0-9]*)(\\s*))");
    var matches = rx.exec(value);
    return (matches != null && value == matches[0]);
}
function InitializeAddressSearch() {
    var citySrchBox = $("#mapCityState");
    var addressSrchBox = $("#mapStreetAddress");
    addressSrchBox.blur(function() { SetDefaultSeachBoxText(addressSrchBox,"Search Address"); });
    addressSrchBox.focus(function() { if (addressSrchBox.val() == "Search Address") { addressSrchBox.val(""); } });
    citySrchBox.blur(function() { SetDefaultSeachBoxText(citySrchBox, "City, State(or Zip Code)"); });
    citySrchBox.focus(function() { if (citySrchBox.val() == "City, State(or Zip Code)") { citySrchBox.val(""); } });

}
function SetDefaultSeachBoxText(elem, text) {
    if ($.trim(elem.val()) == "") { elem.val(text); }
}

function SetAmbigousView(numberOfResults, mapGeoCodeResults,areMultiple) {
    var geocodeAddress = null;
    if (numberOfResults > 5) {
        numberOfResults = 5;
    }
    var sb = "";
    var text = "";
    if(areMultiple)
    {
    sb += "<div class=\"maperror\" style=\"width:75%;margin:12px;\" ><img src=\"/partners/af/images/warning.png\" style=\"width: 16px; height: 16px; float:left; padding-right:5px; margin-top:5px;\">Multiple addresses were found. For best results, please verify your address above or select one of the following:</div><ol>";
    
    }
    else{
    sb += "<div class=\"maperror\" style=\"width:75%;margin:12px;\" ><img src=\"/partners/af/images/warning.png\" style=\"width: 16px; height: 16px; float:left; padding-right:5px; margin-top:5px;\">We did not find an exact match for your search, please verify your address above or select one of the following:</div><ol>";
    
    }
    
    for (var i = 0; i < numberOfResults; i++) {
        geocodeAddress = mapGeoCodeResults.get(i);
        text = "";
        if (geocodeAddress.getStreet().length > 0)
            text += geocodeAddress.getStreet() + ", ";
        if (geocodeAddress.getCity().length > 0)
            text += geocodeAddress.getCity() + ", ";
        if (geocodeAddress.getState().length > 0)
            text += geocodeAddress.getState();
        if (geocodeAddress.getPostalCode().length > 0)
            text += ", " + geocodeAddress.getPostalCode();
        text = text.replace("'", "\'");
        sb += "<li><a href=\"javascript:PostMapSrcQuery(" + geocodeAddress.getMQLatLng().lat + "," + geocodeAddress.getMQLatLng().lng + ",'" + text + "');\">";
        sb += text;
        sb += "</a></li>";
    }
    sb += "</ol>";
    $("#multipleAddressDiv").css("display", "block");
    $("#multipleAddressDiv").html(sb);
}function login_facebook_user() {
    FB.Connect.requireSession();
    return false;
}
function facebook_userInfo() {
    if (FB.Facebook.apiClient.get_session() != null) {
        var userID = FB.Facebook.apiClient.get_session().uid;
        FB.Facebook.apiClient.users_getInfo(userID, "first_name,last_name,uid,pic_square,proxied_email,profile_url", SetFacebookParameters);
    }
}
function logout_facebook_user() {
    FB.Connect.logout(function() {
        ClearFacebookParameters();
    });
}
function not_connected() {
    ClearFacebookParameters();
}
function ShowSucessMessage(result) {
    if (result == 2) {
        Hide_Login_Modal();
        ShowFacebookRegistration();
        FBOmnitureRegister();
    }
    else if (result == 1) {
        Hide_Login_Modal();
        OmnitureSignIn('2');
    }
    else if (result == 3) {
        ShowFacebookLinkPopUp();
        Hide_Login_Modal();
        OmnitureSignIn('2');
    }
    UpdateLoginHeader();
    // HideModalProgressPopup();
}
function UpdateLoginHeader() {

    var RefreshPanel = $(RefreshHeaderPanel);
    if (RefreshPanel != null) {
        __doPostBack(RefreshHeaderPanel, "");
    }
    //HideModalProgressPopup();
}
function update_facebook_user() {
    facebook_userInfo();
   var RefreshPanel = $(RefreshHeaderPanel);
    if (RefreshPanel != null) {
        __doPostBack(RefreshHeaderPanel, "");
    }
    HideModalProgressPopup();
}
function SetFacebookParameters(result) {
    if (result != null) {
        var ProfileHiddenElement = document.getElementById(ProfileHidden);
        if (ProfileHiddenElement != null) {
            ProfileHiddenElement.value = String.format("{0}|{1}|{2}", result[0]["uid"], result[0]["pic_square"], result[0]["profile_url"]);
        }
        if ($.cookie("fb_cookie") == null) {
            NCI.ApartmentFinder.Web.UI.Services.AuthenticationService.LoginFacebookUser(result[0]["first_name"], result[0]["last_name"], result[0]["uid"], result[0]["proxied_email"], ShowSucessMessage);
        }
        else {
            UpdateLoginHeader();
            HideModalProgressPopup();
        }

    }
}
function IsUserLoggedIn() {
    FB_RequireFeatures(["XFBML", "Api", "Connect"], function() {
        if (FacebookKey != null) {
            FB.init(FacebookKey, "/xd_receiver.htm");
            FB.ensureInit(function() { FB.Connect.ifUserConnected(update_facebook_user, not_connected); });
        }
    });

}
function fbs_click() {
    u = location.href +'&ecid=SOC|FBC|SR';
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    LogOmnitureFacebookShareSearch();
    return false;
}
function fbs_post(add40, apartmentID, packageID, actionItem, urlName) {
    u = urlName;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    OmnitureSendSaveCheck(add40, apartmentID, packageID, actionItem);
    return false;
}
function ClearFacebookParameters() {
    var ProfileHiddenElement = document.getElementById(ProfileHidden);
    if (ProfileHiddenElement != null) {
        ProfileHiddenElement.value = '';
    }
    $.cookie('fb_cookie', null);
}

function ShowFacebookRegistration() {
    var popupBehaviorID = $find('mpeFacebookBehavior');
    if (popupBehaviorID != null && popupBehaviorID != 'undefined') {
        var existingAccount = document.getElementById('ExistingAccountDiv');
        if (existingAccount != null) {
            existingAccount.style.display = 'block';
        }
        popupBehaviorID.show();
    }
}

function ShowFacebookLinkPopUp() {
    var popupBehaviorID = $find('mpeFacebookBehavior');
    if (popupBehaviorID != null && popupBehaviorID != 'undefined') {
        var existingAccount = document.getElementById('ExistingAccountDiv');
        if (existingAccount != null) {
            existingAccount.style.display = 'none';
        }
        popupBehaviorID.show();
    }
}
function CloseFacebookPopUp() {
    var popupBehaviorID = $find('mpeFacebookBehavior');

    // Hide the modal popup
    if (popupBehaviorID != null && popupBehaviorID != 'undefined') {
        popupBehaviorID.hide();
    }
}
function Hide_Login_Modal() {
    var modal = $find('LogInModalPopupExtenderBehavior');
    if (modal != null && modal != 'undefined') {
        modal.hide();
    }
}
// JScript File
 
var prm = null;
var modalProgressIndicatorMPEId = "mpeProgressIndicatorBehavior";
var progressErrorMessageLabelId = "lblProgressIndicatorErrorMessage";
var progressDivId = "divModalProgressIndicator";
var progressMsgDivId = "divModalProgressIndicatorMessage";
var progressMessageLabelId = "lblProgressIndicatorMessage";
var cancelButton = "btnProgressIndicatorCancel";
var disableProgressIndicator = false;

Sys.Application.add_load(ConfigureProgress)

// Configure the objects for the Progresss Indicator.
function ConfigureProgress() {
    var hdnShowProgress = $get("hdnShowProgress");
    if (hdnShowProgress != null && hdnShowProgress != "undefined") {
        if (hdnShowProgress.value.toLowerCase() == "true") {
            prm = Sys.WebForms.PageRequestManager.getInstance();
            if (prm != null && prm != "undefined") {
                prm.add_initializeRequest(ShowProgress);
                prm.add_pageLoaded(HideProgress);
                prm.add_endRequest(CheckProgressStatus);
            }
            ConfigureProgressForm();
        }
    }
}

// Show Progress Indicator.
function ShowProgress(sender, eventArgs) {
    ConfigureProgressForm();
    ShowModalProgressPopup();
    if (prm != null && prm != "undefined") {
        prm.remove_initializeRequest(ShowProgress);
    }
}

// Hide Progress Indicator.
function HideProgress(sender, eventArgs) {
   // ToggleContentDivHeight();
    HideModalProgressPopup();
    if (prm != null && prm != "undefined") {
        prm.remove_pageLoaded(HideProgress);
    }
}

// Check Status for Progress Indicator.
function CheckProgressStatus(sender, eventArgs) {
    var error = eventArgs.get_error();
    if (error != null) {
        if (error.name.length > 0) {
        errorMessage = 'There was a problem processing the last request. Please try again.';
            eventArgs.set_errorHandled(true);
            DisplayProgressErrorMessage(errorMessage);
        }
    }
    //prm.remove_endRequest(CheckStatus);
}

// Cancel Async Post back request.
function CancelAsyncPostBack() {
    if (prm != null && prm != "undefined" && prm.get_isInAsyncPostBack()) {
        prm.abortPostBack();
    }
    HideModalProgressPopup();
    ConfigureProgress();
}

// Show the progress modal popup
function ShowModalProgressPopup() {
    // Find the modal popup extender
    var mpe = $find(modalProgressIndicatorMPEId);

    // Show the modal popup
    if (mpe != null && mpe != 'undefined' && !disableProgressIndicator) {
        mpe.show();
    }

    mpe = null;
}

// Hide the progress modal popup
function HideModalProgressPopup() {
    // Find the modal popup extender
    var mpe = $find(modalProgressIndicatorMPEId);
    // Hide the modal popup
    if (mpe != null && mpe != "undefined" && !disableProgressIndicator) {
        mpe.hide();
    }
}

// Restores the Progress form to an unused state
function ConfigureProgressForm() {
    // Display message relating they are logged in
    var mpe = $find(modalProgressIndicatorMPEId);
    if (mpe != null && mpe != undefined && !disableProgressIndicator) {
        var progressPanelId = mpe.get_PopupControlID();
        var progressPanel = $get(progressPanelId);
        if (progressPanel != null && progressPanel != "undefined") {
            // Hide the message
            var progressMsgDiv = $get(progressMsgDivId);
            if (progressMsgDiv != null && progressMsgDiv != "undefined") {
                $get(progressMessageLabelId).innerText = "";
                Sys.UI.DomElement.setVisible(progressMsgDiv, false);
            }

            // Show the Progress form
            var progressDiv = $get(progressDivId);
            if (progressDiv != null && progressDiv != "undefined") {
                Sys.UI.DomElement.setVisible(progressDiv, true);
                // Show the animation.
                var image = $get("imgProgressIndicator");
                if (image != null && image != "undefined") {
                    Sys.UI.DomElement.setVisible(image, true);
                }
            }
        }
    }
}

// Displays an error message in the modal dialog
function DisplayProgressErrorMessage(message) {
    var confirmError = $get("btnProgressIndicatorConfirmError");

    if (confirmError != null && confirmError != "undefined" && !disableProgressIndicator) {
        confirmError.style.display = "block";
        Sys.UI.DomEvent.addHandler(confirmError, "click", ConfirmProgressErrorMessage);
    }
    ShowProgressMessage(message, true);
}

// 
function ShowProgressMessage(message, isError) {
    ConfigureErrorMessage(message);
    ShowModalProgressPopup();

    // Set the focus
    if ($get("btnProgressIndicatorConfirmError") != null && !disableProgressIndicator) {
        $get("btnProgressIndicatorConfirmError").focus();
    }
}

// Called when the user confirms an error message (clicks OK)
function ConfirmProgressErrorMessage(eventElement) {
    eventElement.preventDefault();
    eventElement.stopPropagation();
    HideModalProgressPopup();
    return true;
}

// Displays a message in the modal dialog
function ConfigureErrorMessage(message) {
    // Display message relating there is a problem.
    var mpe = $find(modalProgressIndicatorMPEId);
    if (mpe != null && mpe != undefined && !disableProgressIndicator) {
        var progressPanelId = mpe.get_PopupControlID();
        var progressPanel = $get(progressPanelId);

        // Get the login panel element
        if (progressPanel != null && progressPanel != "undefined") {
            // Hide the login form
            var progressDiv = $get(progressDivId);
            if (progressDiv != null && progressDiv != "undefined") {
                Sys.UI.DomElement.setVisible(progressDiv, false);
                // Hide the animation.
                var image = $get("imgProgressIndicator");
                if (image != null && image != "undefined") {
                    Sys.UI.DomElement.setVisible(image, false);
                }
            }

            // Show the message
            var progressMsgDiv = $get(progressMsgDivId);
            if (progressMsgDiv != null && progressMsgDiv != "undefined") {
                Sys.UI.DomElement.setVisible(progressMsgDiv, true);
                if (document.all) {
                    // IE
                    $get(progressErrorMessageLabelId).innerText = message;
                }
                else {
                    // Firefox
                    $get(progressErrorMessageLabelId).textContent = message;
                }
            }
        }
    }
}

if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

var activeElement = null;
var tempVariable='';

function AfterAnimationEnds(a) {
    activeElement = a;
    AddClickEvent(a);
    LogCarouselOmniture(activeElement);
    ShowAptName(activeElement);
    
}
function LogCarouselOmniture(e) {
    OmnitureFeaturedShow1(e.find(".apt_id").val(), e.find(".pk_id").val());
}
function ShowAptName(currentElement) {
    SetCaption(currentElement, true);
    InitializeHoverBox(currentElement);
    InitializeHover(currentElement);
}

function SetCaption(e, showAnimation) {

    e.find(".caption").css("visibility", "visible");
    e.find(".caption").css("padding-left", "10px");
    e.find(".caption").css("padding-right", "10px");
    if (showAnimation) {
        e.find(".caption").animate({ opacity: 1.0 }, 400);
        e.find(".car_content").css("width", e.find(".mainpic").width());
    }
    else {
        e.find(".mainpic").load(function() {
            e.find(".car_content").css("width", e.find(".mainpic").width());
        });
        e.find(".caption").css({ opacity: 1.0 });
    }
}
function BeforeAnimationStarts(a) {
    activeElement = a;
    a.css("visibility", "visible");
    activeElement.find(".caption").animate({ opacity: 0.0 }, 400);
}


function InitializeThumbnails() {
    $(".thumb").hover(function() {
        $(this).css({ 'z-index': '10' }); /*Add a higher z-index value so this image stays on top*/
        $(this).addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate(400); /* this value of "200" is the speed of how fast/slow this hover animates */

    }, function() {
        $(this).css({ 'z-index': '0' }); /* Set z-index back to 0 */
        $(this).removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate(400);
    });
   
}

function AddClickEvent(e) {
    e.find(".thumb").unbind('click');
    e.find(".thumb").click(function() {
        tempVariable = e.find(".mainpic").attr("src");
        e.find(".mainpic").attr({ src: $(this).attr("src") });
        $(this).attr({ src: tempVariable });
        SetHoverboxStyle(e, true);
        SetCaption(e, true);
       
    });
}
function InitializeFirstSlide() {
    var firstSlide = $("#slide1");
    InitializeHoverBox(firstSlide);
    InitializeHover(firstSlide);
    AddClickEvent(firstSlide);
    LogCarouselOmniture(firstSlide);
    SetCaption(firstSlide,false);
    $("#car_prog").css("display", "none");
}
function SetCarouselParams(carouselSpeed) {
     $(".anyClass").jCarouselLite({
        visible: 1,
        btnNext: ".next",
        btnPrev: ".prev",
        speed: carouselSpeed,
        afterEnd: AfterAnimationEnds,
        beforeStart: BeforeAnimationStarts
    });
    
}

function ResetCaption() {
    $(".caption").css({ opacity: 0.0 });
    $(".hoverbox").css("visibility", "hidden");

}
function InitializeHoverBox(current) {
    current.find(".mainpic").hover(function() {
    SetHoverboxStyle(current,false);
    current.find(".hoverbox").css("visibility", "visible");
    }, function() {
        current.find(".hoverbox").css("visibility", "hidden");

    });
}

function SetHoverboxStyle(e, isClicked) {
    if (e.find(".mainpic").width() < 170) {
        e.find(".hoverbox").css("margin-left", "15px");
        e.find(".hoverbox").css("width", "122px");
        e.find(".hoverbox").css("background-image", "url(/partners/af/images/hover_small.png)");
    }
    else if (isClicked) {
        e.find(".hoverbox").css("width", "160px");
        e.find(".hoverbox").css("background-image", "url(/partners/af/images/hover_div_tall.png)");
        if ($.browser.msie) {
            e.find(".hoverbox").css("margin-left", "29%");
        }
        else {
            e.find(".hoverbox").css("margin-left", "52px");
        }
    }
    FixPng();
}

function InitializeHover(current) {
    current.find(".hoverbox").hover(function() {
        current.find(".hoverbox").css("visibility", "visible");
    });
}

function InitializeCarousel(carouselSpeed) {
    $(document).ready(function() {
        var firstSlide = $("#slide1");
        ShowAptName(firstSlide);
        SetCarouselParams(carouselSpeed);
        $(".car_list").css("visibility", "visible");
        ResetCaption();
        InitializeThumbnails();
        InitializeFirstSlide();
        FixPng();
    });
}

function FixPng() {
    if ($.browser.msie && $.browser.version == '6.0') {
        $(document).pngFix();
    }
}
var currentImgID=null;
var numID=null;
var imgArray=null;
var currentThumbnail=null;
var currentSelection=null;
var stop=false;
var indexTracker=0;
var timeoutID=null;
var started=false;
var imgArrayLength=0;
var numberOfImagesToShow=10;
var divisionValue=0;
var incrementDivisionValue=0;

function OmnitureSlideClicks()
{
    var s=s_gi(sitecatalyst_account_id); 
    var apt = afapt;
    var disp = afdisplay;
    var add40 = afadd40;
    //s.pageName='Details: Photos and Tour tab';
    s.linkTrackVars = 'eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,events,products';
    s.linkTrackEvents='event15';
    s.events='event15';     
    if(add40 == 'True')
    {
        var eVar40 = getCookie('PageRef');
        s.products=';'+apt+';;;;eVar33='+disp+'|eVar40='+eVar40;
    }
    else
    {
        s.products=';'+apt+';;;;eVar33='+disp;
    }
    s.tl(this, 'o', 'Slide Control Pictures Click'); 
    ClearOmnitureCodes();            
}

function SplitArray(imgString,dvImgClientID,dvMainImg,communityName,dvNumClientID)
{
        imgArray = imgString.split(",");
        imgArrayLength =imgArray.length;
        divisionValue = Math.floor(imgArrayLength/numberOfImagesToShow);
        currentImgID = document.getElementById(dvMainImg);
        numID = document.getElementById(dvNumClientID);
        var clientID = document.getElementById(dvImgClientID);
        
        
        indexTracker=0;
        stop=false;
        if(timeoutID!=null)
        {
            clearTimeout(timeoutID);
        }
   
        var innerString='';
        innerString = innerString + "<img id='imgLeftArrow' src='/partners/af/images/left_white_arrow.gif' alt='next' style='width:9px;height:16px;padding-left:7px;padding-right:7px;padding-top:18px;display:none;float:left;' onclick='setTimeout(\"ShowPreviousLevel()\",1000)' />";
        for(var index=0;index<imgArray.length;index++)
        {
            if(index<numberOfImagesToShow)
            {
                innerString = innerString + "<span id='span_"+index+"' style='float:left;padding:5px;'><img id='track_"+index+"' src='"+imgArray[index]+"' alt='"+communityName+"-apartments-photo-"+(index+1)+"' style='width:50px;height:50px;' onclick='ShowSelected("+index+")' /></span>";
            }
            else
            {
            
               innerString = innerString + "<span id='span_"+index+"' style='float:left;padding:5px;display:none;'><img id='track_"+index+"' src='"+imgArray[index]+"' alt='"+communityName+"-apartments-photo-"+(index+1)+"' style='width:50px;height:50px;' onclick='ShowSelected("+index+")' /></span>";
               
            }
        }
        if(imgArrayLength>numberOfImagesToShow)
        {
                innerString = innerString + "<img id='imgRightArrow' src='/partners/af/images/right_white_arrow.gif' alt='next' style='width:9px;height:16px;padding-left:7px;padding-top:18px;float:left;' onclick='setTimeout(\"ShowNextLevel()\",1000)' />";
            
        }
        if((currentImgID != null) && (clientID != null)) {

            var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
            var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
            if (strPercentageH != '')
                currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + "  style='border:1px solid orange;'/>";
            else
                currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' style='border:1px solid orange;' />";                        
            clientID.innerHTML=innerString;
                        
            if(document.getElementById("track_"+indexTracker)!=null)
            {
                document.getElementById("track_"+indexTracker).style.border='2px solid orange';                
                document.getElementById("track_"+indexTracker).style.height='40px';                
                document.getElementById("track_"+indexTracker).style.width='40px';                
                var sc = 0;
                var numS = '';
                sc = indexTracker + 1;                
                if((sc > 0) && (sc < 10))
                {                    
                    numS = "0" + sc.toString() + " / " + imgArrayLength;
                }
                else
                {
                    numS = sc.toString() + " / " + imgArrayLength;
                }
                numID.innerHTML= numS;
            }
            indexTracker++;
            StartPhotoTour();
        }
    
}

function SplitArrayOld(imgString,dvImgClientID,dvMainImg,dvControlID,communityName)
{
        imgArray = imgString.split(",");
        imgArrayLength =imgArray.length;
        divisionValue = Math.floor(imgArrayLength/numberOfImagesToShow);
        currentImgID = document.getElementById(dvMainImg);
        var clientID = document.getElementById(dvImgClientID);
        var controlID = document.getElementById(dvControlID);
        indexTracker=0;
        stop=false;
        if(timeoutID!=null)
        {
            clearTimeout(timeoutID);
        }
   
        var innerString='';
        innerString = innerString + "<img id='imgLeftArrow' src='/partners/af/images/leftarrow.gif' alt='next' style='width:36px;height:36px;padding-top:13px;display:none;float:left;' onclick='setTimeout(\"ShowPreviousLevel()\",1000)' />";
        for(var index=0;index<imgArray.length;index++)
        {
            if(index<numberOfImagesToShow)
            {
                innerString = innerString + "<span id='span_"+index+"' style='float:left;padding:5px;'><img id='track_"+index+"' src='"+imgArray[index]+"' alt='"+communityName+"-apartments-photo-"+(index+1)+"' style='width:40px;height:40px;' onclick='ShowSelected("+index+")' /><br/>"+(index+1)+"</span>";
            }
            else
            {
            
               innerString = innerString + "<span id='span_"+index+"' style='float:left;padding:5px;display:none;'><img id='track_"+index+"' src='"+imgArray[index]+"' alt='"+communityName+"-apartments-photo-"+(index+1)+"' style='width:40px;height:40px;' onclick='ShowSelected("+index+")' /><br/>"+(index+1)+"</span>";
               
            }
        }
        if(imgArrayLength>numberOfImagesToShow)
        {
                innerString = innerString + "<img id='imgRightArrow' src='/partners/af/images/rightarrow.gif' alt='next' style='width:36px;height:36px;padding-top:13px;float:left;' onclick='setTimeout(\"ShowNextLevel()\",1000)' />";
            
        }
        if((currentImgID != null) && (clientID != null) && (controlID != null))
        {
            currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' style='border:1px solid orange;' />";                        
            clientID.innerHTML=innerString;
            
            SetUpControls(controlID);
            if(document.getElementById("track_"+indexTracker)!=null)
            {
                document.getElementById("track_"+indexTracker).style.border='2px solid orange';                
                document.getElementById("track_"+indexTracker).style.height='40px';                
                document.getElementById("track_"+indexTracker).style.width='40px';                
            }
            indexTracker++;
            StartPhotoTour();
        }
    
}

function StartPhotoTour()
{
  
    timeoutID= setTimeout("SetCurrentImg()",3000);
}

function getFinalSize(imgSrc, d) {
    var finalH = 0;
    var finalW = 0;    
    var newImg = new Image();
    newImg.src = imgSrc;
    var currH = newImg.height;
    var currW = newImg.width;
    var scalePercentage;
    var strPercentage = '';
    var res = '';

    if (currH > 216) {
        scalePercentage = (216 * 100) / currH;
        finalH = (currH * scalePercentage) / 100;
        finalW = (currW * scalePercentage) / 100;
        strPercentage = scalePercentage.toString() + '%';
    }
    else {
        finalH = currH;
        finalW = currW;
    }

    if (d == 'h')
        res = finalH.toString() + 'px';
    else
        res = finalW.toString() + 'px';

    return res;
}

function ShowSelected(selectedID)
{
    //OmnitureSlideClicks();
    var numS = '';    


    stop = true;
    var strPercentageH = getFinalSize(imgArray[selectedID],'h');
    var strPercentageW = getFinalSize(imgArray[selectedID],'w');
    if (strPercentageH != '')
        currentImgID.innerHTML = "<img src='" + imgArray[selectedID] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " style='border:1px solid orange;'/>";
    else
        currentImgID.innerHTML = "<img src='" + imgArray[selectedID] + "' alt='images' height='216px' width='288px' style='border:1px solid orange;'/>";
    for(var i=0;i<imgArrayLength;i++)
    {
        if(i==selectedID)
        {
            if(document.getElementById("track_"+i)!=null)
            {                
                document.getElementById("track_"+i).style.border='2px solid orange';                
                document.getElementById("track_"+i).style.height='40px';                
                document.getElementById("track_"+i).style.width='40px';                
                var sc = 0;
                sc = i + 1;                
                if((sc > 0) && (sc < 10))
                {                    
                    numS = "0" + sc.toString() + " / " + imgArrayLength;
                }
                else
                {
                    numS = sc.toString() + " / " + imgArrayLength;
                }
                numID.innerHTML= numS;
            } 
        }
        else
        {
            if(document.getElementById("track_"+i)!=null)
            {
                document.getElementById("track_"+i).style.border='1px solid blue';
                document.getElementById("track_"+i).style.height='40px';                
                document.getElementById("track_"+i).style.width='40px';                
            }
        }
            
    }
    indexTracker=selectedID+1;
    if(document.getElementById('imgPause')!=null)
     {
       document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
     }
 
}

function SetUpControls(controlsClientID)
{
   var goBack= "<img id='imgBack' src='/partners/af/images/af_arrow_lt.gif' alt='First' onclick='setTimeout(\"ShowFirst()\",1000)' style='padding-right:10px;padding-bottom:5px;' />"
   var goForward= "<img id='imgForward' src='/partners/af/images/af_arrow_rt.gif' onclick='setTimeout(\"ShowLast()\",1000)' alt='Last' style='padding-left:10px;padding-bottom:5px;' />"
   var pause= "<img id='imgPause' src='/partners/af/images/af_pause.gif' alt='pause' onclick='ToggleImage()' style='padding-right:5px;padding-left:5px;' />"
   controlsClientID.innerHTML= goBack  + pause + goForward;
}

function SetCurrentImg()
{
    if(!stop)
    {
            if(indexTracker>=imgArrayLength)
            {
                indexTracker=0;
                incrementDivisionValue=0;
                if(document.getElementById("imgLeftArrow")!=null)
                {
                    document.getElementById("imgLeftArrow").style.display="none";
                }
                for(var j=0;j<numberOfImagesToShow-1;j++)
                {
                    if(document.getElementById("span_"+j)!=null)
                    {
                        document.getElementById("span_"+j).style.display="inline";
                    }    
                }
               for(var j=numberOfImagesToShow;j<imgArrayLength;j++)
               {
                    if(document.getElementById("span_"+j)!=null)
                    {
                        document.getElementById("span_"+j).style.display="none";
                    }    
               }
            }


            var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
            var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
            if (strPercentageH != '')
                currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " style='border:1px solid orange;'/>";
                else
                currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' style='border:1px solid orange;'/>";
           
           var divider=0;
           
           if(indexTracker>0 && (indexTracker % numberOfImagesToShow==0))
           {
               incrementDivisionValue = (indexTracker/numberOfImagesToShow)-1;
           }
           if(indexTracker>=numberOfImagesToShow*(incrementDivisionValue+1))
           {
                if(document.getElementById("span_"+indexTracker)!=null)
                {
                    document.getElementById("span_"+indexTracker).style.display="inline";
                }
                if(document.getElementById("span_"+(indexTracker-numberOfImagesToShow))!=null)
                {
                    document.getElementById("span_"+(indexTracker-numberOfImagesToShow)).style.display="none";
                }
                if(document.getElementById("imgLeftArrow")!=null)
                {
                    document.getElementById("imgLeftArrow").style.display="inline";
                }
                if(document.getElementById("imgRighArrow")!=null)
                {
                    document.getElementById("imgRighArrow").style.display="inline";
                }
            }

            var numS = '';
            for(var i=0;i<imgArray.length;i++)
            {
                    if(i==indexTracker)
                    {
                        if(document.getElementById("track_"+i)!=null)
                        {
                            document.getElementById("track_"+i).style.border='2px solid orange';
                            document.getElementById("track_"+i).style.height='40px';                
                            document.getElementById("track_"+i).style.width='40px';                
                            var sc = 0;
                            sc = i + 1;                
                            if((sc > 0) && (sc < 10))
                            {                    
                                numS = "0" + sc.toString() + " / " + imgArrayLength;
                            }
                            else
                            {
                                numS = sc.toString() + " / " + imgArrayLength;
                            }
                            numID.innerHTML= numS;
                        }    
                    }
                    else
                    {
                       
                        if(document.getElementById("track_"+i)!=null)
                        {
                            document.getElementById("track_"+i).style.border='1px solid blue';
                            document.getElementById("track_"+i).style.height='40px';                
                            document.getElementById("track_"+i).style.width='40px';                
                        }
                    }
                }
            indexTracker++;
           timeoutID= setTimeout("SetCurrentImg()",3000);
        }
     
}

function ToggleImage()
{    
  //OmnitureSlideClicks();
  if(!stop)
  {
     if(document.getElementById('imgPause')!=null)
     {
       document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
     }
  }
   else
   {
     if(document.getElementById('imgPause')!=null)
     {
       document.getElementById('imgPause').src='/partners/af/images/af_pause.gif';
     }
   }
   setTimeout("StopPhotoTour();",1000);
}


function StopPhotoTour()
{
   if(!stop)
   {
     stop=true;
   }
   else
   {
     stop=false;
     StartPhotoTour();
   }
  
}


function ShowLast()
{
    //OmnitureSlideClicks();
    
    var numS = '';
    indexTracker = imgArrayLength-1;
    stop=true;
    document.getElementById('imgPause').src = '/partners/af/images/af_play.gif';

    var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
    var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
    if (strPercentageH != '')
        currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
    else
        currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
    if(imgArrayLength>numberOfImagesToShow)
    {
        for(var i=0;i<imgArrayLength;i++)
        {
            if(i>=(imgArrayLength-numberOfImagesToShow))
            {
                if(document.getElementById("span_"+i)!=null)
                {
                    document.getElementById("span_"+i).style.display="inline";
                }
                if(i==indexTracker)
                {
                    if(document.getElementById("track_"+i)!=null)
                    {
                        document.getElementById("track_"+i).style.border="2px solid orange";                        
                        document.getElementById("track_"+i).style.height='40px';                
                        document.getElementById("track_"+i).style.width='40px';                
                    }
                }
                else
                {
                    if(document.getElementById("track_"+i)!=null)
                    {
                        document.getElementById("track_"+i).style.border="1px solid blue";
                        document.getElementById("track_"+i).style.height='40px';                
                        document.getElementById("track_"+i).style.width='40px';                
                    }
                }
            }
            else
            {
                if(document.getElementById("span_"+i)!=null)
                {
                    document.getElementById("span_"+i).style.display="none";
                }
             
            }
        }
    }
    else
    {
        for(var i=0;i<imgArrayLength;i++)
        {
            if(document.getElementById("track_"+(i))!=null)
            {
                document.getElementById("track_"+(i)).style.display="inline";
            }
            if(i==indexTracker)
            {
                if(document.getElementById("track_"+i)!=null)
                {
                    document.getElementById("track_"+i).style.border="2px solid orange";                    
                    document.getElementById("track_"+i).style.height='40px';                
                    document.getElementById("track_"+i).style.width='40px';                
                }
            }
            else
            {
                if(document.getElementById("track_"+i)!=null)
                {
                    document.getElementById("track_"+i).style.border="1px solid blue";
                    document.getElementById("track_"+i).style.height='40px';                
                    document.getElementById("track_"+i).style.width='40px';                
                }
            }
        }
    }
     if(document.getElementById("imgRightArrow")!=null)
     {
        document.getElementById("imgRightArrow").style.display="none";
     }
     if(imgArrayLength>numberOfImagesToShow)
     {
        if(document.getElementById("imgLeftArrow")!=null)
        {
            document.getElementById("imgLeftArrow").style.display="inline";
        }
    }
    else
    {
        if(document.getElementById("imgLeftArrow")!=null)
        {
            document.getElementById("imgLeftArrow").style.display="none";
        }
    }
     
    ShowLastClick();
 }
 
 function ShowLastClick()
 {
    indexTracker=imgArrayLength;
 }

function ShowFirst()
{
    //OmnitureSlideClicks();
    
    var numS = '';
    indexTracker = 0;
    stop=true;
    document.getElementById('imgPause').src = '/partners/af/images/af_play.gif';

    var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
    var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
    if (strPercentageH != '')
        currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
    else
        currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
    if(imgArrayLength>numberOfImagesToShow)
    {
        for(var i=0;i<imgArrayLength;i++)
        {
            if(i>numberOfImagesToShow-1)
            {
                if(document.getElementById("span_"+i)!=null)
                {
                    document.getElementById("span_"+i).style.display="none";
                }
            }
            else
            {
                if(document.getElementById("span_"+i)!=null)
                {
                    document.getElementById("span_"+i).style.display="inline";
        
                }
                if(i==indexTracker)
                {
                    if(document.getElementById("track_"+i)!=null)
                    {
                        document.getElementById("track_"+i).style.border="2px solid orange";                        
                        document.getElementById("track_"+i).style.height='40px';                
                        document.getElementById("track_"+i).style.width='40px';                
                    }
                }
                else
                {
                    if(document.getElementById("track_"+i)!=null)
                    {
                        document.getElementById("track_"+i).style.border="1px solid blue";
                        document.getElementById("track_"+i).style.height='40px';                
                        document.getElementById("track_"+i).style.width='40px';                
                    }
                }
            }
         }
    }
    else
    {
        for(var i=0;i<imgArrayLength;i++)
        {
            if(document.getElementById("span_"+i)!=null)
            {
                document.getElementById("span_"+i).style.display="inline";
            }
            if(i==indexTracker)
            {
                if(document.getElementById("track_"+i)!=null)
                {
                    document.getElementById("track_"+i).style.border="2px solid orange";                    
                    document.getElementById("track_"+i).style.height='40px';                
                    document.getElementById("track_"+i).style.width='40px';                
                }
            }
            else
            {
                if(document.getElementById("track_"+i)!=null)
                {
                    document.getElementById("track_"+i).style.border="1px solid blue";
                    document.getElementById("track_"+i).style.height='40px';                
                    document.getElementById("track_"+i).style.width='40px';                
                }
            }
        }
    }
    if(document.getElementById("imgLeftArrow")!=null)
    {
        document.getElementById("imgLeftArrow").style.display="none";
    }
    if(imgArrayLength>numberOfImagesToShow)
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="inline";
        }
    }
    else
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="none";
        }
    }
    
    indexTracker++;
}

function ShowNextLevel()
{
    //OmnitureSlideClicks();
    
    
    stop=true;
    if(indexTracker==imgArrayLength)
    {
        indexTracker=0;
    }

    var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
    var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
    if (strPercentageH != '')
        currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
    else
        currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
    //document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
    if(document.getElementById("imgLeftArrow")!=null)
    {
        document.getElementById("imgLeftArrow").style.display="inline";
    }

    
    for(var i=0;i<imgArrayLength;i++)
    {
        if(i<indexTracker)
        {
            if(document.getElementById("span_"+i)!=null)
           {
                document.getElementById("span_"+i).style.display="none";
           }
       }
       else if(i>=indexTracker && i<indexTracker+numberOfImagesToShow)
       {
            if(document.getElementById("span_"+i)!=null)
           {
                document.getElementById("span_"+i).style.display="inline";
           }
       }
       else
       {
            if(document.getElementById("span_"+i)!=null)
           {
                document.getElementById("span_"+i).style.display="none";
           }
       }
    }
    if(indexTracker+numberOfImagesToShow>=imgArrayLength)
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="none";
        }
    }
    else
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="inline";
        }
    }
     if(document.getElementById("track_"+indexTracker)!=null)
     {
        document.getElementById("track_"+indexTracker).style.border='2px solid orange';        
        document.getElementById("track_"+indexTracker).style.height='40px';                
        document.getElementById("track_"+indexTracker).style.width='40px';                
        var sc = 0;
        var numS = '';
        sc = indexTracker + 1;                
        if((sc > 0) && (sc < 10))
        {                    
            numS = "0" + sc.toString() + " / " + imgArrayLength;
        }
        else
        {
            numS = sc.toString() + " / " + imgArrayLength;
        }
        numID.innerHTML= numS;
     } 
     indexTracker++;
}

function ShowPreviousLevel()
{
    //OmnitureSlideClicks();

    
    stop=true;
    if(indexTracker>0)
    {
        indexTracker--;
        document.getElementById('imgLeftArrow').style.display='inline';    
    }
    if(indexTracker==1)
    {
        document.getElementById('imgLeftArrow').style.display='none';    
    }
    if(indexTracker+numberOfImagesToShow<=imgArrayLength)
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="inline";
        }
    }
    else
    {
        if(document.getElementById("imgRightArrow")!=null)
        {
            document.getElementById("imgRightArrow").style.display="none";
        }
    }

    var strPercentageH = getFinalSize(imgArray[indexTracker - 1],'h');
    var strPercentageW = getFinalSize(imgArray[indexTracker - 1],'w');
    if (strPercentageH != '')
        currentImgID.innerHTML = "<img src='" + imgArray[indexTracker - 1] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
    else
        currentImgID.innerHTML = "<img src='"+imgArray[indexTracker-1]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
    //document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
    
    if(document.getElementById("span_"+(indexTracker+numberOfImagesToShow-1))!=null)
    {
        document.getElementById("span_"+(indexTracker+numberOfImagesToShow-1)).style.display="none";
    }
           
   if(document.getElementById("span_"+(indexTracker-1))!=null)
   {
        document.getElementById("span_"+(indexTracker-1)).style.display="inline";
        document.getElementById("track_"+(indexTracker-1)).style.border='2px solid orange';                
        document.getElementById("track_"+(indexTracker-1)).style.height='40px';                
        document.getElementById("track_"+(indexTracker-1)).style.width='40px';                
        var sc = 0;
        var numS = '';
        sc = indexTracker;                
        if((sc > 0) && (sc < 10))
        {                    
            numS = "0" + sc.toString() + " / " + imgArrayLength;
        }
        else
        {
            numS = sc.toString() + " / " + imgArrayLength;
        }
        numID.innerHTML= numS;
   }
   if(document.getElementById("track_"+indexTracker)!=null)
   {
        document.getElementById("track_"+indexTracker).style.border='1px solid blue';
        document.getElementById("track_"+indexTracker).style.height='40px';                
        document.getElementById("track_"+indexTracker).style.width='40px';                
   }
    
    
}

function GoForward()
{
    var numS = '';
    stop=true;
    document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
    if(indexTracker<imgArrayLength-1)
    {
        var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
        var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
        if (strPercentageH != '')
            currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " style='border:1px solid orange;'/>";
        else
            currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' style='border:1px solid orange;'/>";
        if(document.getElementById("track_"+indexTracker)!=null)
        {
            document.getElementById("track_"+indexTracker).style.border='2px solid orange';            
            document.getElementById("track_"+indexTracker).style.height='40px';                
            document.getElementById("track_"+indexTracker).style.width='40px';                
        }
        if(document.getElementById("track_"+(indexTracker-1))!=null)
        {
            document.getElementById("track_"+(indexTracker-1)).style.border='1px solid blue';
            document.getElementById("track_"+(indexTracker-1)).style.height='40px';                
            document.getElementById("track_"+(indexTracker-1)).style.width='40px';                
        }
       
    }
    else
    {
        indexTracker = 0;
        var strPercentageH = getFinalSize(imgArray[indexTracker],'h');
        var strPercentageW = getFinalSize(imgArray[indexTracker],'w');
        if (strPercentageH != '')
            currentImgID.innerHTML = "<img src='" + imgArray[indexTracker] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " style='border:1px solid orange;'/>";
        else
            currentImgID.innerHTML = "<img src='"+imgArray[indexTracker]+"' alt='images' height='216px' width='288px' style='border:1px solid orange;'/>";
        if(document.getElementById("track_"+indexTracker)!=null)
        {
            document.getElementById("track_"+indexTracker).style.border='2px solid orange';            
            document.getElementById("track_"+indexTracker).style.height='40px';                
            document.getElementById("track_"+indexTracker).style.width='40px';                
        }
    }
 
    indexTracker++;
 
}

function GoBackwards()
{
  var numS = '';
  stop=true;
  document.getElementById('imgPause').src='/partners/af/images/af_play.gif';
  indexTracker--;
    if(indexTracker>0)
    {
        var strPercentageH = getFinalSize(imgArray[indexTracker - 1],'h');
        var strPercentageW = getFinalSize(imgArray[indexTracker - 1],'w');
        if (strPercentageH != '')
            currentImgID.innerHTML = "<img src='" + imgArray[indexTracker - 1] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
        else
            currentImgID.innerHTML = "<img src='"+imgArray[indexTracker-1]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
        if(document.getElementById("track_"+(indexTracker-1))!=null)
        {
            document.getElementById("track_"+(indexTracker-1)).style.border='2px solid orange';            
            document.getElementById("track_"+(indexTracker-1)).style.height='40px';                
            document.getElementById("track_"+(indexTracker-1)).style.width='40px';                
        }
        if(document.getElementById("track_"+indexTracker)!=null)
        {
            document.getElementById("track_"+indexTracker).style.border='1px solid blue';
            document.getElementById("track_"+indexTracker).style.height='40px';                
            document.getElementById("track_"+indexTracker).style.width='40px';                
        }
       
    }
    else
    {
        indexTracker = imgArrayLength - 1;
        var strPercentageH = getFinalSize(imgArray[indexTracker - 1],'h');
        var strPercentageW = getFinalSize(imgArray[indexTracker - 1],'w');
        if (strPercentageH != '')
            currentImgID.innerHTML = "<img src='" + imgArray[indexTracker - 1] + "' alt='images' width=" + strPercentageW + " height=" + strPercentageH + " class='divstyle'/>";
        else
            currentImgID.innerHTML = "<img src='"+imgArray[indexTracker-1]+"' alt='images' height='216px' width='288px' class='divstyle'/>";
        if(document.getElementById("track_"+(indexTracker-1))!=null)
        {
            document.getElementById("track_"+(indexTracker-1)).style.border='2px solid orange';
            document.getElementById("track_"+(indexTracker-1)).style.height='40px';                
            document.getElementById("track_"+(indexTracker-1)).style.width='40px';                            
        }
    }
 
   
}


     



﻿var currentImgIDp = null;
var imgArrayp = null;
var currentThumbnailp = null;
var currentSelectionp = null;
var stopp = false;
var indexTrackerp = 0;
var timeoutIDp = null;
var startedp = false;
var imgArrayLengthp = 0;
var numberOfImagesToShowp = 8;
var divisionValuep = 0;
var incrementDivisionValuep = 0;

function OmnitureSlideClicksp() {
    var s = s_gi(sitecatalyst_account_id);
    var apt = afapt;
    var disp = afdisplay;
    var add40 = afadd40;
    //s.pageName='Details: Photos and Tour tab';
    s.linkTrackVars = 'eVar34,eVar42,prop34,events,products';
    s.linkTrackEvents = 'event15';
    s.events = 'event15';
    if (add40 == 'True') {
        var eVar40 = getCookie('OmniturePageReferrer');
        s.products = ';' + apt + ';;;;eVar33=' + disp + '|eVar40=' + eVar40;
    }
    else {
        s.products = ';' + apt + ';;;;eVar33=' + disp;
    }
    s.tl(this, 'o', 'Slide Control Pictures Click');
    ClearOmnitureCodes();
}

function SplitArrayp(imgString, dvImgClientID, dvMainImg, dvControlID, communityName) {
    imgArrayp = imgString.split(",");
    imgArrayLengthp = imgArrayp.length;
    divisionValuep = Math.floor(imgArrayLengthp / numberOfImagesToShowp);
    currentImgIDp = document.getElementById(dvMainImg);
    var clientID = document.getElementById(dvImgClientID);
    var controlID = document.getElementById(dvControlID);
    indexTrackerp = 0;
    stopp = false;
    if (timeoutIDp != null) {
        clearTimeout(timeoutIDp);
    }

    var innerString = '';
    innerString = innerString + "<img id='imgLeftArrow' src='/partners/af/images/leftarrow.gif' alt='next' style='width:36px;height:36px;padding-top:13px;display:none;float:left;' onclick='setTimeout(\"ShowPreviousLevelp()\",1000)' />";
    for (var index = 0; index < imgArrayp.length; index++) {
        if (index < numberOfImagesToShowp) {
            innerString = innerString + "<span id='span_" + index + "' style='float:left;padding:5px;'><img id='track_" + index + "' src='" + imgArrayp[index] + "' alt='" + communityName + "-apartments-photo-" + (index + 1) + "' style='width:50px;height:50px;' onclick='ShowSelectedp(" + index + ")' /><br/>" + (index + 1) + "</span>";
        }
        else {

            innerString = innerString + "<span id='span_" + index + "' style='float:left;padding:5px;display:none;'><img id='track_" + index + "' src='" + imgArrayp[index] + "' alt='" + communityName + "-apartments-photo-" + (index + 1) + "' style='width:50px;height:50px;' onclick='ShowSelectedp(" + index + ")' /><br/>" + (index + 1) + "</span>";

        }
    }
    if (imgArrayLengthp > numberOfImagesToShowp) {
        innerString = innerString + "<img id='imgRightArrow' src='/partners/af/images/rightarrow.gif' alt='next' style='width:36px;height:36px;padding-top:13px;float:left;' onclick='setTimeout(\"ShowNextLevelp()\",1000)' />";

    }
    if ((currentImgIDp != null) && (clientID != null) && (controlID != null)) {
        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' style='border:1px solid orange;' />";
        clientID.innerHTML = innerString;

        SetUpControlsp(controlID);
        if (document.getElementById("track_" + indexTrackerp) != null) {
            document.getElementById("track_" + indexTrackerp).style.border = '2px solid orange';
        }
        indexTrackerp++;
        StartPhotoTourp();
    }

}

function StartPhotoTourp() {

    timeoutIDp = setTimeout("SetCurrentImgp()", 3000);
}

function ShowSelectedp(selectedID) {
    OmnitureSlideClicksp();

    stopp = true;
    currentImgIDp.innerHTML = "<img src='" + imgArrayp[selectedID] + "' alt='images' style='border:1px solid orange;'/>";
    for (var i = 0; i < imgArrayLengthp; i++) {
        if (i == selectedID) {
            if (document.getElementById("track_" + i) != null) {
                document.getElementById("track_" + i).style.border = '2px solid orange';
            }
        }
        else {
            if (document.getElementById("track_" + i) != null) {
                document.getElementById("track_" + i).style.border = '1px solid blue';
            }
        }

    }
    indexTrackerp = selectedID + 1;
    if (document.getElementById('imgPausep') != null) {
        document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    }

}

function SetUpControlsp(controlsClientID) {
    var goBackp = "<img id='imgBackp' src='/partners/af/images/af_arrow_lt.gif' alt='First' onclick='setTimeout(\"ShowFirstp()\",1000)' style='padding-right:10px;padding-bottom:5px;' />"
    var goForwardp = "<img id='imgForwardp' src='/partners/af/images/af_arrow_rt.gif' onclick='setTimeout(\"ShowLastp()\",1000)' alt='Last' style='padding-left:10px;padding-bottom:5px;' />"
    var pausep = "<img id='imgPausep' src='/partners/af/images/af_pause.gif' alt='pause' onclick='ToggleImagep()' style='padding-right:5px;padding-left:5px;' />"
    controlsClientID.innerHTML = goBackp + pausep + goForwardp;
}

function SetCurrentImgp() {
    if (!stopp) {
        if (indexTrackerp >= imgArrayLengthp) {
            indexTrackerp = 0;
            incrementDivisionValuep = 0;
            if (document.getElementById("imgLeftArrow") != null) {
                document.getElementById("imgLeftArrow").style.display = "none";
            }
            for (var j = 0; j < numberOfImagesToShowp - 1; j++) {
                if (document.getElementById("span_" + j) != null) {
                    document.getElementById("span_" + j).style.display = "inline";
                }
            }
            for (var j = numberOfImagesToShowp; j < imgArrayLengthp; j++) {
                if (document.getElementById("span_" + j) != null) {
                    document.getElementById("span_" + j).style.display = "none";
                }
            }
        }

        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' style='border:1px solid orange;'/>";

        var divider = 0;

        if (indexTrackerp > 0 && (indexTrackerp % numberOfImagesToShowp == 0)) {
            incrementDivisionValuep = (indexTrackerp / numberOfImagesToShowp) - 1;
        }
        if (indexTrackerp >= numberOfImagesToShowp * (incrementDivisionValuep + 1)) {
            if (document.getElementById("span_" + indexTrackerp) != null) {
                document.getElementById("span_" + indexTrackerp).style.display = "inline";
            }
            if (document.getElementById("span_" + (indexTrackerp - numberOfImagesToShowp)) != null) {
                document.getElementById("span_" + (indexTrackerp - numberOfImagesToShowp)).style.display = "none";
            }
            if (document.getElementById("imgLeftArrow") != null) {
                document.getElementById("imgLeftArrow").style.display = "inline";
            }
            if (document.getElementById("imgRighArrow") != null) {
                document.getElementById("imgRighArrow").style.display = "inline";
            }
        }


        for (var i = 0; i < imgArrayp.length; i++) {
            if (i == indexTrackerp) {
                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = '2px solid orange';
                }
            }
            else {

                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = '1px solid blue';
                }
            }
        }
        indexTrackerp++;
        timeoutIDp = setTimeout("SetCurrentImgp()", 3000);
    }

}

function ToggleImagep() {
    OmnitureSlideClicksp();
    if (!stopp) {
        if (document.getElementById('imgPausep') != null) {
            document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
        }
    }
    else {
        if (document.getElementById('imgPausep') != null) {
            document.getElementById('imgPausep').src = '/partners/af/images/af_pause.gif';
        }
    }
    setTimeout("StopPhotoTourp();", 1000);
}


function StopPhotoTourp() {
    if (!stopp) {
        stopp = true;
    }
    else {
        stopp = false;
        StartPhotoTourp();
    }

}


function ShowLastp() {
    OmnitureSlideClicksp();

    indexTrackerp = imgArrayLengthp - 1;
    stopp = true;
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' class='divstyle'/>";
    if (imgArrayLengthp > numberOfImagesToShowp) {
        for (var i = 0; i < imgArrayLengthp; i++) {
            if (i >= (imgArrayLengthp - numberOfImagesToShowp)) {
                if (document.getElementById("span_" + i) != null) {
                    document.getElementById("span_" + i).style.display = "inline";
                }
                if (i == indexTrackerp) {
                    if (document.getElementById("track_" + i) != null) {
                        document.getElementById("track_" + i).style.border = "2px solid orange";
                    }
                }
                else {
                    if (document.getElementById("track_" + i) != null) {
                        document.getElementById("track_" + i).style.border = "1px solid blue";
                    }
                }
            }
            else {
                if (document.getElementById("span_" + i) != null) {
                    document.getElementById("span_" + i).style.display = "none";
                }

            }
        }
    }
    else {
        for (var i = 0; i < imgArrayLengthp; i++) {
            if (document.getElementById("track_" + (i)) != null) {
                document.getElementById("track_" + (i)).style.display = "inline";
            }
            if (i == indexTrackerp) {
                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = "2px solid orange";
                }
            }
            else {
                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = "1px solid blue";
                }
            }
        }
    }
    if (document.getElementById("imgRightArrow") != null) {
        document.getElementById("imgRightArrow").style.display = "none";
    }
    if (imgArrayLengthp > numberOfImagesToShowp) {
        if (document.getElementById("imgLeftArrow") != null) {
            document.getElementById("imgLeftArrow").style.display = "inline";
        }
    }
    else {
        if (document.getElementById("imgLeftArrow") != null) {
            document.getElementById("imgLeftArrow").style.display = "none";
        }
    }

    ShowLastClickp();
}

function ShowLastClickp() {
    indexTrackerp = imgArrayLengthp;
}

function ShowFirstp() {
    OmnitureSlideClicksp();

    indexTrackerp = 0;
    stopp = true;
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' class='divstyle'/>";
    if (imgArrayLengthp > numberOfImagesToShowp) {
        for (var i = 0; i < imgArrayLengthp; i++) {
            if (i > numberOfImagesToShowp - 1) {
                if (document.getElementById("span_" + i) != null) {
                    document.getElementById("span_" + i).style.display = "none";
                }
            }
            else {
                if (document.getElementById("span_" + i) != null) {
                    document.getElementById("span_" + i).style.display = "inline";

                }
                if (i == indexTrackerp) {
                    if (document.getElementById("track_" + i) != null) {
                        document.getElementById("track_" + i).style.border = "2px solid orange";
                    }
                }
                else {
                    if (document.getElementById("track_" + i) != null) {
                        document.getElementById("track_" + i).style.border = "1px solid blue";
                    }
                }
            }
        }
    }
    else {
        for (var i = 0; i < imgArrayLengthp; i++) {
            if (document.getElementById("span_" + i) != null) {
                document.getElementById("span_" + i).style.display = "inline";
            }
            if (i == indexTrackerp) {
                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = "2px solid orange";
                }
            }
            else {
                if (document.getElementById("track_" + i) != null) {
                    document.getElementById("track_" + i).style.border = "1px solid blue";
                }
            }
        }
    }
    if (document.getElementById("imgLeftArrow") != null) {
        document.getElementById("imgLeftArrow").style.display = "none";
    }
    if (imgArrayLengthp > numberOfImagesToShowp) {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "inline";
        }
    }
    else {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "none";
        }
    }

    indexTrackerp++;
}

function ShowNextLevelp() {
    OmnitureSlideClicksp();

    stopp = true;
    if (indexTrackerp == imgArrayLengthp) {
        indexTrackerp = 0;
    }

    currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' class='divstyle'/>";
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    if (document.getElementById("imgLeftArrow") != null) {
        document.getElementById("imgLeftArrow").style.display = "inline";
    }


    for (var i = 0; i < imgArrayLengthp; i++) {
        if (i < indexTrackerp) {
            if (document.getElementById("span_" + i) != null) {
                document.getElementById("span_" + i).style.display = "none";
            }
        }
        else if (i >= indexTrackerp && i < indexTrackerp + numberOfImagesToShowp) {
            if (document.getElementById("span_" + i) != null) {
                document.getElementById("span_" + i).style.display = "inline";
            }
        }
        else {
            if (document.getElementById("span_" + i) != null) {
                document.getElementById("span_" + i).style.display = "none";
            }
        }
    }
    if (indexTrackerp + numberOfImagesToShowp >= imgArrayLengthp) {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "none";
        }
    }
    else {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "inline";
        }
    }
    if (document.getElementById("track_" + indexTrackerp) != null) {
        document.getElementById("track_" + indexTrackerp).style.border = '2px solid orange';
    }
    indexTrackerp++;
}

function ShowPreviousLevelp() {
    OmnitureSlideClicksp();

    stopp = true;
    if (indexTrackerp > 0) {
        indexTrackerp--;
        document.getElementById('imgLeftArrow').style.display = 'inline';
    }
    if (indexTrackerp == 1) {
        document.getElementById('imgLeftArrow').style.display = 'none';
    }
    if (indexTrackerp + numberOfImagesToShowp <= imgArrayLengthp) {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "inline";
        }
    }
    else {
        if (document.getElementById("imgRightArrow") != null) {
            document.getElementById("imgRightArrow").style.display = "none";
        }
    }
    currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp - 1] + "' alt='images' class='divstyle'/>";
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';

    if (document.getElementById("span_" + (indexTrackerp + numberOfImagesToShowp - 1)) != null) {
        document.getElementById("span_" + (indexTrackerp + numberOfImagesToShowp - 1)).style.display = "none";
    }

    if (document.getElementById("span_" + (indexTrackerp - 1)) != null) {
        document.getElementById("span_" + (indexTrackerp - 1)).style.display = "inline";
        document.getElementById("track_" + (indexTrackerp - 1)).style.border = '2px solid orange';
    }
    if (document.getElementById("track_" + indexTrackerp) != null) {
        document.getElementById("track_" + indexTrackerp).style.border = '1px solid blue';
    }


}

function GoForwardp() {
    stopp = true;
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    if (indexTrackerp < imgArrayLengthp - 1) {
        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' style='border:1px solid orange;'/>";
        if (document.getElementById("track_" + indexTrackerp) != null) {
            document.getElementById("track_" + indexTrackerp).style.border = '2px solid orange';
        }
        if (document.getElementById("track_" + (indexTrackerp - 1)) != null) {
            document.getElementById("track_" + (indexTrackerp - 1)).style.border = '1px solid blue';
        }

    }
    else {
        indexTrackerp = 0;
        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp] + "' alt='images' style='border:1px solid orange;'/>";
        if (document.getElementById("track_" + indexTrackerp) != null) {
            document.getElementById("track_" + indexTrackerp).style.border = '2px solid orange';
        }
    }

    indexTrackerp++;

}

function GoBackwardsp() {
    stopp = true;
    document.getElementById('imgPausep').src = '/partners/af/images/af_play.gif';
    indexTrackerp--;
    if (indexTrackerp > 0) {
        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp - 1] + "' alt='images' class='divstyle'/>";
        if (document.getElementById("track_" + (indexTrackerp - 1)) != null) {
            document.getElementById("track_" + (indexTrackerp - 1)).style.border = '2px solid orange';
        }
        if (document.getElementById("track_" + indexTrackerp) != null) {
            document.getElementById("track_" + indexTrackerp).style.border = '1px solid blue';
        }

    }
    else {
        indexTrackerp = imgArrayLengthp - 1;
        currentImgIDp.innerHTML = "<img src='" + imgArrayp[indexTrackerp - 1] + "' alt='images' class='divstyle'/>";
        if (document.getElementById("track_" + (indexTrackerp - 1)) != null) {
            document.getElementById("track_" + (indexTrackerp - 1)).style.border = '2px solid orange';
        }
    }


}


     




var imageElement; var imageElementId = "imgSlideShowPhoto"; var currentIndex = 0; var initializedFlag = false; var activeFlag = false; var interval = 3; var intervalId; function NextPhoto() {
    if (initializedFlag) {
        currentIndex++
        if (currentIndex > photoUrl.length - 1)
        { currentIndex = 0; }
        ChangeImage();
    } 
}
function PreviousPhoto() {
    if (initializedFlag) {
        currentIndex--
        if (currentIndex < 0)
        { currentIndex = photoUrl.length - 1; }
        ChangeImage();
    } 
}
function ChangeImage() {
    if (imageElement != null)
    { originalSrc = imageElement.src; imageElement.src = photoUrl[currentIndex]; } 
}
function Initialize() {
    try {
        imageElement = document.getElementById(imageElementId); if (document.getElementById("hdnSlideshowInterval"))
        { interval = document.getElementById("hdnSlideshowInterval").value; }
        var images = photoUrl.length; initializedFlag = true;
    }
    catch (e)
{ initializeFlag = false; } 
}
function StartSlideShow(restartFlag) {
    Initialize(); if (initializedFlag) {
        if (restartFlag)
        { StopSlideShow(); currentIndex = 0; activeFlag = false; }
        if (!activeFlag) {
            if (photoUrl.length > 1 && imageElement != null)
            { ChangeImage(); intervalId = window.setInterval(NextPhoto, interval * 1000); activeFlag = true; } 
        } 
    } 
}
function StopSlideShow() {
    if (intervalId != null)
    { window.clearInterval(intervalId); activeFlag = false; } 
}
function ToggleSlideShow(action) {
    button = document.getElementById("toggle"); button.alt = (action == "Play") ? "Pause" : "Play"; button.title = (action == "Play") ? "Play" : "Pause"; if (action == "Pause")
    { button.src = 'floatL slideshow_pause'; StartSlideShow(); }
    else { button.className = 'floatL slideshow_play'; StopSlideShow(); } 
}/*
 * Show your last tweet in real time
 * 
 * http://www.position-absolute.com
 *
 * Copyright (c) 2009 Cedric Dugas
 * Licensed under the MIT license.
 */
	//$(document).ready(function() {		
	//	tweetInterval("karlisha")	// Start tweet funciton parameter: twitter username
		 
	//});		
	function tweetInterval(twitterName){
		var lastTweet
		//$("#twtList").html('allanq');            
		// TWEET STYLE
				// APPLY TWEET TO THE BODY
		 $("body").append('<div id="twitter_script"></div>')
		 //createJSONtweet("'"+twitterName+"'")
		 setInterval("createJSONtweet('"+twitterName+"')",0)
		 //setInterval("createJSONtweet('"+twitterName+"')",10000)
		 //setTimeout("createJSONtweet('"+twitterName+"')",10000)
		 
		 
		 twitterCallback2 = function(tweet) {		// FUNCTION CALLED WHEN TWITTER SCRIPT IS PARSED		 
		 	if(tweet){
			 	var updateTweet = tweet[0].text			// Tweet text
			 	var updateTweet = tweet[0].text		// Tweet text
			 	var time = tweet[0].created_at
			 	var text = updateTweet + " <a href=\"http://www.yahoo.com\" target=\"_blank\">" + time + "</a>"
			 	$("#twtList").html(text);
		 	}
			
		 }
		createJSONtweet = function(twitterName){		// PARSE twitter SCRIPT GET CALLBACK FUNCTION AND JSON 	
			 var getTweet = document.createElement("script");
			 getTweet.src="http://twitter.com/statuses/user_timeline/"+twitterName+".json?callback=twitterCallback2&count=1";
			 document.getElementById('twitter_script').appendChild(getTweet)
			 //document.getElementById('twtList').appendChild(getTweet)
			 //$("#twtList").html(getTweet);
		 }
	}//////////////////////////
//Testing for yelp

var YWSID = "aqBIfVhDEZQfpkk_Uqtiaw"; // common required parameter (api key)
var APTID = null;
var PACKAGE = null;
var YELPDIVID = null;
var YELPHOLDER = null;
var TWEETPROP6 = null;

function constructYelpURLAF(phone) {
    var URL = "http://api.yelp.com/" +
            "phone_search?" +
            "callback=" + "handleResults" +
            "&phone=" + phone +
            "&ywsid=" + YWSID;
    return encodeURI(URL);
}



function updateYelp(phone, aptId, packageId, yelpDivId, tweetProp6, yelpHolder) {

    APTID = aptId;
    PACKAGE = packageId;
    YELPDIVID = yelpDivId;
    YELPHOLDER = yelpHolder;
    TWEETPROP6 = tweetProp6;

    $(document).ready(function() {
        var yelpRequestURL = constructYelpURLAF(phone);
        /* do the api request */
        var script = document.createElement('script');
        script.src = yelpRequestURL;
        script.type = 'text/javascript';
        var head = document.getElementsByTagName('head').item(0);
        head.appendChild(script);
        return false;
    });
}


function handleResults(data) {
    
   var biz = null;
   if (data.message.text == "OK") {
    
        if (data.businesses.length == 0) {            
            $(String.format("#{0}",YELPHOLDER)).css("display", "none");                
        }
        else {
            
            for (var i = 0; i < data.businesses.length; i++) {
                biz = data.businesses[i];                                    
                $("#firstReview").html(generateInfoWindowHtmlAF(biz));            

                $(String.format("#{0}",YELPDIVID)).css("display", "block");                
                if(biz.review_count == 0){                              
                        /*if(TWEETPROP6 == 0)
                        {
                            s.prop6 = "yelpimpr-norvw";
                        }
                        else s.prop6 = "twitterimpr-tweet:yelpimpr-norvw";                      
                    }
                else{
                        if(TWEETPROP6 == 0)
                        {
                            s.prop6 = "yelpimpr-rvw";                            
                        }
                        else s.prop6 = "twitterimpr-tweet:yelpimpr-rvw";*/
                    }
                break;
            }
        }        
        CallOmniture();
    }
    else {
        $(String.format("#{0}",YELPHOLDER)).css("display", "none");                
        if(TWEETPROP6 == 1)
        {
            //s.prop6 = "twitterimpr-tweet";            
            CallOmniture();        
        }
    }
    
}

function generateInfoWindowHtmlAF(biz) {
    var text = null;    
    if (biz != null) {
        if(biz.review_count > 1)
        {                               
            text = '<div>';
            
            //Begins First Review            
            
            //posted by text
            text += '<label id="lblPost1" style="font-size:11px; color:#838282; font-weight:bold;">'+'Posted by'+'</label>&nbsp;&nbsp;';
            
            //posted by user
            text += '<label id="lblNa1" style="font-size:11px; color:#007aaa; font-weight:bold;">'+biz.reviews[0].user_name+'</label>'+ '<label id="lblOn1" style="font-size:11px; color:#838282; font-weight:bold;">'+' on '+'</label>' +'<a href="http://www.yelp.com" target="_blank" style="font-size:11px; font-weight:bold; text-decoration:none;">yelp</a>';
            
            //date
            text += '<label id="lblDate1" style="font-size:11px; color:#007aaa; font-weight:bold;">'+ ' - ' +biz.reviews[0].date+'</label>&nbsp;&nbsp;&nbsp;&nbsp;';
            
            //stars
            text += '<img src="'+ biz.reviews[0].rating_img_url + '"/><br />'                        
                    
            //review excerpt
            text += '<label id="lblEx1" style="font-size:11px; color:#333333;">'+biz.reviews[0].text_excerpt+'</label><br />';
                    
            // Read full review
            text += '<a onclick="YelpClick(' + APTID + ',' + PACKAGE + ',' + biz.review_count + ')" href="'+biz.url+'" target="_blank" style="font-size:11px; color:#007aaa; text-decoration:none; font-weight:bold;">Read More</a><br/>';                                    
            
            //Ends First Review
            
            //divide the 2 reviews
            text += '<br /><br /><br />';
            
            //Begins Second Review                        
            
            //posted by text
            text += '<label id="lblPost2" style="font-size:11px; color:#838282; font-weight:bold;">'+'Posted by'+'</label>&nbsp;&nbsp;';
            
            //posted by user
            text += '<label id="lblNa2" style="font-size:11px; color:#007aaa; font-weight:bold;">'+biz.reviews[1].user_name+'</label>'+ '<label id="lblOn2" style="font-size:11px; color:#838282; font-weight:bold;">'+' on '+'</label>' +'<a href="http://www.yelp.com" target="_blank" style="font-size:11px; text-decoration:none; font-weight:bold;">yelp</a>';
            
            //date
            text += '<label id="lblDate2" style="font-size:11px; color:#007aaa; font-weight:bold;">'+ ' - ' +biz.reviews[1].date+'</label>&nbsp;&nbsp;&nbsp;&nbsp;';
            
            //stars
            text += '<img src="'+ biz.reviews[1].rating_img_url + '"/><br />'                                    
                    
            //review excerpt
            text += '<label id="lblEx2" style="font-size:11px; color:#333333;">'+biz.reviews[1].text_excerpt+'</label><br />';
                    
            // Read full review
            text += '<a onclick="YelpClick(' + APTID + ',' + PACKAGE + ',' + biz.review_count + ')" href="'+biz.url+'" target="_blank" style="font-size:11px; color:#007aaa; text-decoration:none; font-weight:bold;">Read More</a><br/><br/>';                        
            
            //Ends Second Review
            
            //End the 2 reviews            
            
            // Read all reviews
            if(biz.review_count > 2)
                text += '<a onclick="YelpClick(' + APTID + ',' + PACKAGE + ',' + biz.review_count + ')" href="'+biz.url+'" target="_blank" style="float:right; font-size:11px; color:#007aaa; text-decoration:none; font-weight:bold;">'+'Read all '+ biz.review_count + ' reviews'+'</a><br/>';                                                
                    
            text += '</div>'
        }
        else if(biz.review_count == 1)
        {            
            text = '<div>';
            
            //Begins First Review
            
            //posted by text
            text += '<label id="lblPost" style="font-size:11px; color:#838282; font-weight:bold;">'+'Posted by'+'</label>&nbsp;&nbsp;';
            
            //posted by user
            text += '<label id="lblNa" style="font-size:11px; color:#007aaa; font-weight:bold;">'+biz.reviews[0].user_name+'</label>'+ '<label id="lblOn" style="font-size:11px; color:#838282; font-weight:bold;">'+' on '+'</label>' +'<a href="http://www.yelp.com" target="_blank" style="font-size:11px; text-decoration:none; font-weight:bold;">yelp</a>';
            
            //date
            text += '<label id="lblDate" style="font-size:11px; color:#007aaa; font-weight:bold;">'+ ' - ' +biz.reviews[0].date+'</label>&nbsp;&nbsp;&nbsp;&nbsp;';                        
            
            //stars
            text += '<img src="'+ biz.reviews[0].rating_img_url + '"/><br />'
                        
                    
            //review excerpt
            text += '<label id="lblEx" style="font-size:11px; color:#333333;">'+biz.reviews[0].text_excerpt+'</label><br />';
                    
            // Read full review
            text += '<a onclick="YelpClick(' + APTID + ',' + PACKAGE + ',' + biz.review_count + ')" href="'+biz.url+'" target="_blank" style="font-size:11px; color:#007aaa; text-decoration:none; font-weight:bold;">Read More</a><br/><br/>';                        
            
            //Ends First Review
            
            text += '</div>'
        }
        else if(biz.review_count == 0)
        {            
            text = '<div style="font-size:11px; color:#333333;">';
            text += 'No reviews exist for this apartment.<br /><br />'; 
            text += 'If you live here, be the first to submit a review!<br /><br />';
            text += '<a onclick="YelpClick(' + APTID + ',' + PACKAGE + ',' + biz.review_count + ')" href="https://www.yelp.com/signup?return_url=%2Fwriteareview " target="_blank" style="font-size:11px; color:#007aaa; text-decoration:none; font-weight:bold;">Go to Yelp now!</a><br/>';
            text += '</div>';
        }
        
        return text;
    }
}


function YelpClick(aptId, displayPoint, reviews)
{
    var s=s_gi(sitecatalyst_account_id);
    s.linkTrackVars = 'eVar34,prop5,eVar5,prop16,eVar16,eVar42,prop34,eVar36,prop36,events,products';
    s.linkTrackEvents='event20';
    s.events='event20'; 
    s.eVar36='yelpclick'; 
    s.prop36='yelpclick';             
    s.products=';'+ aptId +';;;;eVar33='+ displayPoint;
    
    s.tl(this, 'e', 'YelpClick'); 
    ClearOmnitureCodes();
}

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

var event_sent = false;
var player = null;

function initYouTube(video_id)
{    
    var params = { allowScriptAccess: "always",wmode:"opaque" };
    var atts = { id: "myytplayer" };
    var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

    if (hasReqestedVersion)
    {
        player = swfobject.embedSWF("http://www.youtube.com/v/" + video_id + "&enablejsapi=1&playerapiid=ytplayer&showinfo=1&fs=0&rel=0&color1=0x417cb6&color2=0x417cb6",
                       "ytapiplayer", "414", "270", "8", null, null, params, atts);
    }
    else
    {
        //debugger;
        var ytplayer = document.getElementById("ytapiplayer");
        // flash is too old or we can't detect the plugin

        var alternateContent = '<center><br><br><br><br><br>Please install Flash Player version 8.0 or higher to view this video.<br>If you already have Flash Player version 8.0 or higher installed, please ensure flash is enabled in your browser.'
	    + '<br><br><a href="http://www.adobe.com/go/getflash/" target="_blank">Get Flash</a></center>';
        ytplayer.innerHTML = alternateContent;  // insert non-flash content
        ytplayer.className = "noFlash";
    }
}

function onYouTubePlayerReady(playerId) {    
  ytplayer = document.getElementById("myytplayer");
  player = ytplayer;
  if (ytplayer != null) {      
      ytplayer.addEventListener("onStateChange", "onytplayerStateChange");      
  }
}

function onytplayerStateChange(newState) {    
    if (newState == 1 && !event_sent) {        
        OmniturePlayYouTube(afadd40, afapt, afdisplay);        
        event_sent = true; 
    }
}

function stopYouTube()
{
    if (player != null)
        player.stopVideo();
}

