/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<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)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<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")}})})();
/*! SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/

var swfobject = function() {
	
	var UNDEF = "undefined",
		OBJECT = "object",
		SHOCKWAVE_FLASH = "Shockwave Flash",
		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
		FLASH_MIME_TYPE = "application/x-shockwave-flash",
		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
		
		win = window,
		doc = document,
		nav = navigator,
		
		domLoadFnArr = [],
		regObjArr = [],
		objIdArr = [],
		listenersArr = [],
		script,
		timer = null,
		storedAltContent = null,
		storedAltContentId = null,
		isDomLoaded = false,
		isExpressInstallActive = false;
	
	/* Centralized function for browser feature detection
		- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
		- User agent string detection is only used when no alternative is possible
		- Is executed directly for optimal performance
	*/	
	var ua = function() {
		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
			playerVersion = [0,0,0],
			d = null;
		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
			d = nav.plugins[SHOCKWAVE_FLASH].description;
			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
				playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
			}
		}
		else if (typeof win.ActiveXObject != UNDEF) {
			var a = null, fp6Crash = false;
			try {
				a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
			}
			catch(e) {
				try { 
					a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
					playerVersion = [6,0,21];
					a.AllowScriptAccess = "always";	 // Introduced in fp6.0.47
				}
				catch(e) {
					if (playerVersion[0] == 6) {
						fp6Crash = true;
					}
				}
				if (!fp6Crash) {
					try {
						a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
					}
					catch(e) {}
				}
			}
			if (!fp6Crash && a) { // a will return null when ActiveX is disabled
				try {
					d = a.GetVariable("$version");	// Will crash fp6.0.21/23/29
					if (d) {
						d = d.split(" ")[1].split(",");
						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
					}
				}
				catch(e) {}
			}
		}
		var u = nav.userAgent.toLowerCase(),
			p = nav.platform.toLowerCase(),
			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
			ie = false,
			windows = p ? /win/.test(p) : /win/.test(u),
			mac = p ? /mac/.test(p) : /mac/.test(u);
		/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
		return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
	}();

	/* Cross-browser onDomLoad
		- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
		- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
	*/ 
	var onDomLoad = function() {
		if (!ua.w3cdom) {
			return;
		}
		addDomLoadEvent(main);
		if (ua.ie && ua.win) {
			try {	 // Avoid a possible Operation Aborted error
				doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors 
				script = getElementById("__ie_ondomload");
				if (script) {
					addListener(script, "onreadystatechange", checkReadyState);
				}
			}
			catch(e) {}
		}
		if (ua.webkit && typeof doc.readyState != UNDEF) {
			timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
		}
		if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
		}
		addLoadEvent(callDomLoadFunctions);
	}();
	
	function checkReadyState() {
		if (script.readyState == "complete") {
			script.parentNode.removeChild(script);
			callDomLoadFunctions();
		}
	}
	
	function callDomLoadFunctions() {
		if (isDomLoaded) {
			return;
		}
		if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
			var s = createElement("span");
			try { // Avoid a possible Operation Aborted error
				var t = doc.getElementsByTagName("body")[0].appendChild(s);
				t.parentNode.removeChild(t);
			}
			catch (e) {
				return;
			}
		}
		isDomLoaded = true;
		if (timer) {
			clearInterval(timer);
			timer = null;
		}
		var dl = domLoadFnArr.length;
		for (var i = 0; i < dl; i++) {
			domLoadFnArr[i]();
		}
	}
	
	function addDomLoadEvent(fn) {
		if (isDomLoaded) {
			fn();
		}
		else { 
			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
		}
	}
	
	/* Cross-browser onload
		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
		- Will fire an event as soon as a web page including all of its assets are loaded 
	 */
	function addLoadEvent(fn) {
		if (typeof win.addEventListener != UNDEF) {
			win.addEventListener("load", fn, false);
		}
		else if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("load", fn, false);
		}
		else if (typeof win.attachEvent != UNDEF) {
			addListener(win, "onload", fn);
		}
		else if (typeof win.onload == "function") {
			var fnOld = win.onload;
			win.onload = function() {
				fnOld();
				fn();
			};
		}
		else {
			win.onload = fn;
		}
	}
	
	/* Main function
		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
	*/
	function main() { // Static publishing only
		var rl = regObjArr.length;
		for (var i = 0; i < rl; i++) { // For each registered object element
			var id = regObjArr[i].id;
			if (ua.pv[0] > 0) {
				var obj = getElementById(id);
				if (obj) {
					regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
					regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
					if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
						if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
							fixParams(obj);
						}
						setVisibility(id, true);
					}
					else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
						showExpressInstall(regObjArr[i]);
					}
					else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
						displayAltContent(obj);
					}
				}
			}
			else {	// If no fp is installed, we let the object element do its job (show alternative content)
				setVisibility(id, true);
			}
		}
	}
	
	/* Fix nested param elements, which are ignored by older webkit engines
		- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
		- Fall back to the proprietary embed element
	*/
	function fixParams(obj) {
		var nestedObj = obj.getElementsByTagName(OBJECT)[0];
		if (nestedObj) {
			var e = createElement("embed"), a = nestedObj.attributes;
			if (a) {
				var al = a.length;
				for (var i = 0; i < al; i++) {
					if (a[i].nodeName == "DATA") {
						e.setAttribute("src", a[i].nodeValue);
					}
					else {
						e.setAttribute(a[i].nodeName, a[i].nodeValue);
					}
				}
			}
			var c = nestedObj.childNodes;
			if (c) {
				var cl = c.length;
				for (var j = 0; j < cl; j++) {
					if (c[j].nodeType == 1 && c[j].nodeName == "PARAM") {
						e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
					}
				}
			}
			obj.parentNode.replaceChild(e, obj);
		}
	}
	
	/* Show the Adobe Express Install dialog
		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
	*/
	function showExpressInstall(regObj) {
		isExpressInstallActive = true;
		var obj = getElementById(regObj.id);
		if (obj) {
			if (regObj.altContentId) {
				var ac = getElementById(regObj.altContentId);
				if (ac) {
					storedAltContent = ac;
					storedAltContentId = regObj.altContentId;
				}
			}
			else {
				storedAltContent = abstractAltContent(obj);
			}
			if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
				regObj.width = "310";
			}
			if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
				regObj.height = "137";
			}
			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
				dt = doc.title,
				fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
				replaceId = regObj.id;
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			if (ua.ie && ua.win && obj.readyState != 4) {
				var newObj = createElement("div");
				replaceId += "SWFObjectNew";
				newObj.setAttribute("id", replaceId);
				obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
				obj.style.display = "none";
				var fn = function() {
					obj.parentNode.removeChild(obj);
				};
				addListener(win, "onload", fn);
			}
			createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
		}
	}
	
	/* Functions to abstract and display alternative content
	*/
	function displayAltContent(obj) {
		if (ua.ie && ua.win && obj.readyState != 4) {
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			var el = createElement("div");
			obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
			el.parentNode.replaceChild(abstractAltContent(obj), el);
			obj.style.display = "none";
			var fn = function() {
				obj.parentNode.removeChild(obj);
			};
			addListener(win, "onload", fn);
		}
		else {
			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
		}
	} 

	function abstractAltContent(obj) {
		var ac = createElement("div");
		if (ua.win && ua.ie) {
			ac.innerHTML = obj.innerHTML;
		}
		else {
			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
			if (nestedObj) {
				var c = nestedObj.childNodes;
				if (c) {
					var cl = c.length;
					for (var i = 0; i < cl; i++) {
						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
							ac.appendChild(c[i].cloneNode(true));
						}
					}
				}
			}
		}
		return ac;
	}
	
	/* Cross-browser dynamic SWF creation
	*/
	function createSWF(attObj, parObj, id) {
		var r, el = getElementById(id);
		if (el) {
			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
				attObj.id = id;
			}
			if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
				var att = "";
				for (var i in attObj) {
					if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
						if (i.toLowerCase() == "data") {
							parObj.movie = attObj[i];
						}
						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
							att += ' class="' + attObj[i] + '"';
						}
						else if (i.toLowerCase() != "classid") {
							att += ' ' + i + '="' + attObj[i] + '"';
						}
					}
				}
				var par = "";
				for (var j in parObj) {
					if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
					}
				}
				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
				objIdArr[objIdArr.length] = attObj.id; // Stored to fix object 'leaks' on unload (dynamic publishing only)
				r = getElementById(attObj.id);	
			}
			else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
				var e = createElement("embed");
				e.setAttribute("type", FLASH_MIME_TYPE);
				for (var k in attObj) {
					if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
						if (k.toLowerCase() == "data") {
							e.setAttribute("src", attObj[k]);
						}
						else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
							e.setAttribute("class", attObj[k]);
						}
						else if (k.toLowerCase() != "classid") { // Filter out IE specific attribute
							e.setAttribute(k, attObj[k]);
						}
					}
				}
				for (var l in parObj) {
					if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
						if (l.toLowerCase() != "movie") { // Filter out IE specific param element
							e.setAttribute(l, parObj[l]);
						}
					}
				}
				el.parentNode.replaceChild(e, el);
				r = e;
			}
			else { // Well-behaving browsers
				var o = createElement(OBJECT);
				o.setAttribute("type", FLASH_MIME_TYPE);
				for (var m in attObj) {
					if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
							o.setAttribute("class", attObj[m]);
						}
						else if (m.toLowerCase() != "classid") { // Filter out IE specific attribute
							o.setAttribute(m, attObj[m]);
						}
					}
				}
				for (var n in parObj) {
					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
						createObjParam(o, n, parObj[n]);
					}
				}
				el.parentNode.replaceChild(o, el);
				r = o;
			}
		}
		return r;
	}
	
	function createObjParam(el, pName, pValue) {
		var p = createElement("param");
		p.setAttribute("name", pName);	
		p.setAttribute("value", pValue);
		el.appendChild(p);
	}
	
	/* Cross-browser SWF removal
		- Especially needed to safely and completely remove a SWF in Internet Explorer
	*/
	function removeSWF(id) {
		var obj = getElementById(id);
		if (obj && (obj.nodeName == "OBJECT" || obj.nodeName == "EMBED")) {
			if (ua.ie && ua.win) {
				if (obj.readyState == 4) {
					removeObjectInIE(id);
				}
				else {
					win.attachEvent("onload", function() {
						removeObjectInIE(id);
					});
				}
			}
			else {
				obj.parentNode.removeChild(obj);
			}
		}
	}
	
	function removeObjectInIE(id) {
		var obj = getElementById(id);
		if (obj) {
			for (var i in obj) {
				if (typeof obj[i] == "function") {
					obj[i] = null;
				}
			}
			obj.parentNode.removeChild(obj);
		}
	}
	
	/* Functions to optimize JavaScript compression
	*/
	function getElementById(id) {
		var el = null;
		try {
			el = doc.getElementById(id);
		}
		catch (e) {}
		return el;
	}
	
	function createElement(el) {
		return doc.createElement(el);
	}
	
	/* Updated attachEvent function for Internet Explorer
		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
	*/	
	function addListener(target, eventType, fn) {
		target.attachEvent(eventType, fn);
		listenersArr[listenersArr.length] = [target, eventType, fn];
	}
	
	/* Flash Player and SWF content version matching
	*/
	function hasPlayerVersion(rv) {
		var pv = ua.pv, v = rv.split(".");
		v[0] = parseInt(v[0], 10);
		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
		v[2] = parseInt(v[2], 10) || 0;
		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
	}
	
	/* Cross-browser dynamic CSS creation
		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
	*/	
	function createCSS(sel, decl) {
		if (ua.ie && ua.mac) {
			return;
		}
		var h = doc.getElementsByTagName("head")[0], s = createElement("style");
		s.setAttribute("type", "text/css");
		s.setAttribute("media", "screen");
		if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
			s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
		}
		h.appendChild(s);
		if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
			var ls = doc.styleSheets[doc.styleSheets.length - 1];
			if (typeof ls.addRule == OBJECT) {
				ls.addRule(sel, decl);
			}
		}
	}
	
	function setVisibility(id, isVisible) {
		var v = isVisible ? "visible" : "hidden";
		if (isDomLoaded && getElementById(id)) {
			getElementById(id).style.visibility = v;
		}
		else {
			createCSS("#" + id, "visibility:" + v);
		}
	}

	/* Filter to avoid XSS attacks 
	*/
	function urlEncodeIfNecessary(s) {
		var regex = /[\\\"<>\.;]/;
		var hasBadChars = regex.exec(s) != null;
		return hasBadChars ? encodeURIComponent(s) : s;
	}
	
	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
	*/
	var cleanup = function() {
		if (ua.ie && ua.win) {
			window.attachEvent("onunload", function() {
				// remove listeners to avoid memory leaks
				var ll = listenersArr.length;
				for (var i = 0; i < ll; i++) {
					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
				}
				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
				var il = objIdArr.length;
				for (var j = 0; j < il; j++) {
					removeSWF(objIdArr[j]);
				}
				// cleanup library's main closures to avoid memory leaks
				for (var k in ua) {
					ua[k] = null;
				}
				ua = null;
				for (var l in swfobject) {
					swfobject[l] = null;
				}
				swfobject = null;
			});
		}
	}();
	
	
	return {
		/* Public API
			- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
		*/ 
		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
			if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
				return;
			}
			var regObj = {};
			regObj.id = objectIdStr;
			regObj.swfVersion = swfVersionStr;
			regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
			regObjArr[regObjArr.length] = regObj;
			setVisibility(objectIdStr, false);
		},
		
		getObjectById: function(objectIdStr) {
			var r = null;
			if (ua.w3cdom) {
				var o = getElementById(objectIdStr);
				if (o) {
					var n = o.getElementsByTagName(OBJECT)[0];
					if (!n || (n && typeof o.SetVariable != UNDEF)) {
							r = o;
					}
					else if (typeof n.SetVariable != UNDEF) {
						r = n;
					}
				}
			}
			return r;
		},
		
		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
			if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
				return;
			}
			widthStr += ""; // Auto-convert to string
			heightStr += "";
			if (hasPlayerVersion(swfVersionStr)) {
				setVisibility(replaceElemIdStr, false);
				var att = {};
				if (attObj && typeof attObj === OBJECT) {
					for (var i in attObj) {
						if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
							att[i] = attObj[i];
						}
					}
				}
				att.data = swfUrlStr;
				att.width = widthStr;
				att.height = heightStr;
				var par = {}; 
				if (parObj && typeof parObj === OBJECT) {
					for (var j in parObj) {
						if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
							par[j] = parObj[j];
						}
					}
				}
				if (flashvarsObj && typeof flashvarsObj === OBJECT) {
					for (var k in flashvarsObj) {
						if (flashvarsObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
							if (typeof par.flashvars != UNDEF) {
								par.flashvars += "&" + k + "=" + flashvarsObj[k];
							}
							else {
								par.flashvars = k + "=" + flashvarsObj[k];
							}
						}
					}
				}
				addDomLoadEvent(function() {
					createSWF(att, par, replaceElemIdStr);
					if (att.id == replaceElemIdStr) {
						setVisibility(replaceElemIdStr, true);
					}
				});
			}
			else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
				isExpressInstallActive = true; // deferred execution
				setVisibility(replaceElemIdStr, false);
				addDomLoadEvent(function() {
					var regObj = {};
					regObj.id = regObj.altContentId = replaceElemIdStr;
					regObj.width = widthStr;
					regObj.height = heightStr;
					regObj.expressInstall = xiSwfUrlStr;
					showExpressInstall(regObj);
				});
			}
		},
		
		getFlashPlayerVersion: function() {
			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
		},
		
		hasFlashPlayerVersion: hasPlayerVersion,
		
		createSWF: function(attObj, parObj, replaceElemIdStr) {
			if (ua.w3cdom) {
				return createSWF(attObj, parObj, replaceElemIdStr);
			}
			else {
				return undefined;
			}
		},
		
		removeSWF: function(objElemIdStr) {
			if (ua.w3cdom) {
				removeSWF(objElemIdStr);
			}
		},
		
		createCSS: function(sel, decl) {
			if (ua.w3cdom) {
				createCSS(sel, decl);
			}
		},
		
		addDomLoadEvent: addDomLoadEvent,
		
		addLoadEvent: addLoadEvent,
		
		getQueryParamValue: function(param) {
			var q = doc.location.search || doc.location.hash;
			if (param == null) {
				return urlEncodeIfNecessary(q);
			}
			if (q) {
				var pairs = q.substring(1).split("&");
				for (var i = 0; i < pairs.length; i++) {
					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
					}
				}
			}
			return "";
		},
		
		// For internal usage only
		expressInstallCallback: function() {
			if (isExpressInstallActive && storedAltContent) {
				var obj = getElementById(EXPRESS_INSTALL_ID);
				if (obj) {
					obj.parentNode.replaceChild(storedAltContent, obj);
					if (storedAltContentId) {
						setVisibility(storedAltContentId, true);
						if (ua.ie && ua.win) {
							storedAltContent.style.display = "block";
						}
					}
					storedAltContent = null;
					storedAltContentId = null;
					isExpressInstallActive = false;
				}
			} 
		}
	};
}();

/*
 * Queue Manager
 * 
 * Queue Manager provides a central timer for a webpage, allows for the prioritized queueing of javascript code execution, and allows objects to
 * implement queueability internally via the Queueable.prototype.queue method
 * 
 * @author Jonathan 'J5' Cook [jonathan.j5.cook@gmail.com]
 * @version 0.2
 */

(function(){

/**
 * Create an instance of the Queue Manager object (there should only be one instance per page)
 * 
 * @constructor
 * @param {number} levels the number of different priority levels the Queue will contain (sub-queues)
 * @param {number} interval the queue processor will execute at the given interval, in milliseconds
 * @param {boolean} advanced queued items should be executable at independent intervals (although execution will only happen at multiples of the manager's interval), repeatable, etc.
 */
jQuery.qmanager = function (levels,interval,advanced) {
	this.initialize(levels,interval,advanced);
};

/**
 * Create an instance of the Queuable object.  The Queueable object is only used as an abstract base class for other objects which directly implement queueing via the Queue object 
 *
 * @constructor
 */
jQuery.qmanageable = function () {};

/**
 * Prototype for the Queueable object, which defines the inheritable queue method
 *
 * @prototype
 */
jQuery.qmanageable.prototype = {
	/**
	 * Queues the given method for later execution.  If no method is supplied, the "load" method of the object is called
	 * The original method uses jQuery(document).ready to queue the code execution.
	 * When a Queue is added to the document, it will overload the method and take control of queueing Queuables
	 * 
	 * @param {string} the name of a method of the current object, defaults to "load" if none is specified
	 */
	queue: function(method) {
		var t = this;
		jQuery(document).ready(function() {
			t[method || "load"]();
		});
	}
};

/**
 * Queue Manager object prototype, which contains all methods for the Queue Manager
 *
 * @prototype
 */
jQuery.qmanager.prototype = {
	advanced: false,
	totalLength: 0,
	timerid: undefined,
	_uid: 0,
	/**
	 * Initialize the Queue Manager object, creating the queues, redefining the Queueable.prototype.queue method, etc.
	 * 
	 * @param {number} levels the number of subqueues to create, defaults to 3
	 * @param {number} interval the amount of time to wait (in milliseconds) between attempts to execute items in the queue, defaults to 1000 (one second)
	 * @param {boolean} advanced whether the queue will allow items which are executed repeatedly or at irregular intervals
	 */
	initialize: function(levels,interval,advanced) {
		var q = this;
		jQuery.qmanageable.prototype.queue = function(method,label) {
			var t = this;
			q.queue({
				func: function() {
				t[method || "load"]();
				}, label: label
			});
		};	
		
		this.queues = new Array(levels || 3);
		this.interval = interval || 1000;
		this.advanced = advanced || false;
		if (this.advanced) {
			this.params = new Array(levels || 3);
			this.undefinedLength = 0;
			this.cancelled = [];
		}
	},
	/**
	 * A unique label to identify the queued item if none was otherwise specified
	 * @returns {number} uid the unique identifier for this queued item
	 */
	_getUid: function() {
		return this._uid++;
	},
	/**
	 * Cancel the interval with the given label/uid
	 * 
	 * @param {number or string} the label or UID of the queued item
	 */
	cancel: function(label) {
		this.cancelled.push(label);
	},
	/**
	 * If the queued item has been cancelled, returns true
	 *
	 * @param {object} params the parameter portions of the queued item (i.e. interval, label, etc.)
	 * @returns {boolean} returns true if the queued item has been cancelled, else returns false
	 */
	_isCancelled: function(params) {
		if (jQuery.inArray(params.label,this.cancelled) != -1) {
			this.cancelled = jQuery.grep(this.cancelled, function(value) { return value==params.label ? false : true; });
			return true;
		} else {
			return false;
		}
	},
	/**
	 * Execute the given function on each member of the given array (or array-like object), asynchronously
	 * 
	 * Based on the chunk method by Nicholas C. Zakas
	 * http://www.nczonline.net/blog/2009/01/13/speed-up-your-javascript-part-1/
	 *
	 * @param {Object} options: an anonymous object containing all available chunking options:
			{array}		array: an array or array-like object to operate on (required)
			{function}	process: a function to call on each member of array (required)
			{Object}	context: an object context in which to execute the process function (required)
			{number}	interval: the interval (a number in milliseconds) at which to execute each "step", default is the interval of the Queue Manager
			{number}	level: the priority level (a number) for the execution of each step, default is the lowest priority
			{boolean}	immediate: whether or not to immediately execute the first "step", a boolean property
	 */
	chunk: function(options){
		var q = this;
		var options = jQuery.extend(true,{
			interval: q.interval,
			level: q.queues.length-1
		},options);
	    var items = options.array.concat();   //clone the array
	    this.queue({
			func: function(){
				var item = items.shift();
				q.process.call(options.context, item);
				if (items.length> 0){
	            	q.queue(jQuery.extend(true,options,{
						func: arguments.callee
					}));
				}
			},
			interval: options.immediate ? 0 : options.interval,
			level: options.level
		});
	},
	/**
	 * Queue the item for later execution
	 *
	 * @param {function or object} func either a function to direcly execute, or an object describing code to execute and parameters for that execution
	 * @param {number} level the priority level to assign to the item
	 * 
	 * When func is an object, the following properties are supported:
		{function}	func: the code to execute (required)
		{number}	level: the priority level, default is the lowest available priority level
		{string}	label: a unique label to identify the queued item, default is a "random" UID
		{number}	interval: the interval (in milliseconds) at which to execute the code, if possible, default is the Queue Manager's interval
		{boolean}	repeat: whether or not to repeat the code execution every interval, default is false
		{boolean}	process: whether or not to immediately begin queue processing (which may result in the code executing sooner), default is false
	 */
	queue: function(func,level) {
		var options;
		if (undefined!=level) {
			options = { func: func, level: level};
		} else {
			options = func;
		}
		this.totalLength++;
		var qlevel = options.level || this.queues.length-1;
		var qlevel = this.queues.length > qlevel ? qlevel : this.queues.length-1;
		
		if (this.queues[qlevel]==undefined) {
			this.queues[qlevel]=[];
			if (this.advanced) {
				this.params[qlevel]=[];
				this.params[qlevel].defined=0;
			}
		}
		
		var q = this.queues[qlevel];
		q.push(options.func);

		if (this.advanced) {
			var p = this.params[qlevel];
			p.push({
				"label": (options.label || this._getUid()),
				"internalTime": new Date().valueOf(),
				"interval": (options.interval || this.interval),
				"repeat": (options.repeat || false)
			});
			this.params[qlevel].defined++;
		}		
		if ((options.process || false)) { this.process(false); }
		return (options.label || true);
	},
	/**
	 * Return the next available function to be executed
	 * 
	 * @param {boolean} update whether or not to update the "internal"
	 * @returns {function or boolean} returns the function to execute if one exits, else returns false
	 */
	dequeue: function(update) {
		for (var qn = 0; qn < this.queues.length; qn++) {
			if (undefined != this.queues[qn] && this.queues[qn].length > 0) {
				// basic implementation allows no repeating code to be queued
				if (!this.advanced) {
					this.totalLength--;
					return this.queues[qn].shift();
				} else {
					// look for next executable method
					if (this.params[qn].defined == undefined || this.params[qn].defined > 0) {
						for (var f = 0; f < this.queues[qn].length; f++) {
							if (undefined != this.params[qn][f]) {
								with (this.params[qn][f]) {
									// has been cancelled?
									if (this._isCancelled(this.params[qn][f])) {
										this.queues[qn][f]=undefined;
										this.params[qn][f]=undefined;
										this.params[qn].defined--;
										this.undefinedLength++;										
									} else {
										// if the interval has passed since the internalTime was updated, pop and/or execute
										var currentTime = new Date().valueOf();
										if ((currentTime-internalTime) >= interval) {
											if (repeat) {
												internalTime = currentTime;
												return this.queues[qn][f];
											} else {
												var func = this.queues[qn][f];
												this.queues[qn][f]=undefined;
												this.params[qn][f]=undefined;
												this.params[qn].defined--;
												this.undefinedLength++;
												if (update) { internalTime = currentTime; }
												return func;
											}
										}
									}
								}
							}
						}
					} else {
						if (this.params[qn].length > this.params[qn].defined) {
							this.params[qn]=[];
							this.params[qn].defined=0;
						}
					}
				}
			}
		}
		return false;
	},
	/**
	 * Based on the callLazy function by Matt Snider
	 * http://mattsnider.com/architecture/architecture-function-calllazy/
	 * 
	 * when options.isReadyFunction evaluates to true, then execute options.func
	 * otherwise, wait options.interval and try again
     * 
	 * @param {object} options object
	 * 		{function}	func				the payload to execute
	 *		{function}	isReadyFunction		when this function returns true, func should execute
	 *		{number}	maxAttempts			the maximum number of attempts to make
	 *		{number}	attemptNumber		the current attempt number executing
	 *		{number}	interval			the interval at which to check isReadyFunction
	 */
	callLazy: function(options) {
		var max = (0 < options.maxAttempts) ? options.maxAttempts : 100,
			index = (0 < options.attemptNumber) ? options.attemptNumber : 0,
			interval = (0 < options.interval) ? options.interval : null;

		if (index > max) { return; } // this prevents these calls from running forever

		if (options.func) {
			if (options.isReadyFunction()) {
				options.func();
			}
			else {
				var t = this;
				t.queue({
					func: function() {
						t.callLazy({
							func: options.func,
							isReadyFunction: options.isReadyFunction,
							maxAttempts: max,
							attemptNumber: (index+1),
							interval: interval
						});
					},
					interval: interval,
					repeat: false,
					process: false
				});
			}
		}
	},
	/**
	 * Private function used with jQuery.grep method to filter out undefined items
	 * @param {any} value is the value of the array item to compare against undefined
	 * @returns {number} returns 0 if the value is undefined, 1 otherwise
	 */
	_filter: function(value,index) {
		return value==undefined ? 0 : 1;
	},
	/**
	 * Removes undefined elements from the sub-queues, when the number of undefined elements exceeds 1/2 of the total elements
	 */
	clean: function() {
		// clean only when the length of undefined items is 1/2 or more of the total length of items
		if (this.advanced && this.totalLength > 0 && this.undefinedLength >= (this.totalLength / 2)) {
			this.totalLength=0;
			for (var qn = 0; qn < this.queues.length; qn++) {
				if (undefined != this.queues[qn] && this.queues[qn].length > 0) {
					this.queues[qn] = jQuery.grep(this.queues[qn],this._filter);
					this.params[qn] = jQuery.grep(this.params[qn],this._filter);
					this.params[qn].defined = this.params[qn].length;
					this.totalLength += this.queues[qn].length;
				}
			}
			this.undefinedLength=0;
		}
	},
	/**
	 * Process the queues, executing code that has been queued and in the case of advanced Queue Managers, is ready to be executed
	 *
	 * @param {boolean} update when true, the internal time of queued items is updated
	 */
	process: function(update) {
		var qq = this;
		if (this.totalLength > 0) {
			if (undefined != this.timerid) {
				window.clearTimeout(this.timerid);
				this.timerid = undefined;
			}
			// dequeue the function, execute it, then immediately check for more queued stuff
			// that is ready to be executed
			var func = this.dequeue(update);
			// if nothing is ready to be executed, recheck next interval
			if (func) {
				func();
				this.timerid = setTimeout(function() { qq.process(false); },0);
				return true;
			}
		}
		// when everything in the queue is done executing,
		// go back to checking for work at the interval
		this.timerid = setTimeout(function() {
			qq.clean();
			qq.process(true);
		},this.interval);
	}
};
})();
/**
 * cqEditAny allows the use of a javascript function to open any dialog to edit any content from any page
 * 
 * @requires jQuery 1.2.6 or higher
 * @param {string} pathAndDialogAndType provides the path to the content, the dialog to use and the resource type of the component in a comma delimited string
 * @param {boolean} newItem use true to insert a new item, false to edit the existing content
 * 
 * example: cqEditAny("/content/geometrixx/fr/jcr:content/header,/apps/geometrixx/components/header/dialog,geometrixx/components/header",false);
 */
function cqEditAny(pathAndDialogAndType,newItem) {
	var hasCQEditables = false;
	try { if (CQ.WCM.getEditables) { hasCQEditables = true; } } catch (e) {}
	
	if (hasCQEditables && typeof(jQuery) != "undefined") {
		// get the parameters needed for using the dialog
		var splits = pathAndDialogAndType.split(",");
		
		// create new element to put the dialog into, removing old one(s)
		jQuery(".GenericEditTarget").remove();
		var element = new CQ.Ext.Element(jQuery("body").append("<div class='GenericEditTarget' style='display:none'></div>").get(0));
		
		// clone an existing editable
		var editable = CQ.WCM.genericEditable = CQ.WCM.genericEditable || {};
		var editables = CQ.WCM.getContentWindow().CQ.WCM.getEditables();
		for (var i in editables) {
			foundEdit = true;
			break;
		}
		if (foundEdit) {
			for (var i in editables) {
				foundEdit = true;
			    jQuery.extend(editable,editables[i]);
			    break;
			}
			
			// customize the editable
			editable.path=splits[0];
			editable.dialog=splits[1];
			editable.params["./sling:resourceType"]=splits[2];
		
			// clear the old dialog out
		
			editable.dialogs[CQ.wcm.EditBase.EDIT]=undefined;

			// define the element the editable will appear "in"
			editable.element.dom=element;
			editable.element.linkedEditComponent=editable;

			// show the dialog
			CQ.wcm.EditBase.showDialog(editable,newItem ? CQ.wcm.EditBase.INSERT : CQ.wcm.EditBase.EDIT);
		} else {
			alert("Editing is not available on this page.")
		}
	} else {
		alert(pathAndDialogAndType);
	}
}

/**
 * Limit the number of paragraphs which can be present in a paragraph system 
 * 
 * @param parName the name/path for the paragraph system
 * @param max the maximum number of children to allow (including grandchildren)
 * @return
 */
function limitParCount(parName,max) {
    // retrieve all of the editable content items on the page
    var editables = CQ.WCM.getEditables();
    var parPath = "/jcr:content/"+parName+"/";
    var dropZone = parPath+"*";
    var ignore = parPath + "promo";

    // set the count of editables of the type parName (path,really)
    var count = 0;
   
    // a reference to be used for the full path of the par, including the page
    var p;

    // look through all the editables to check how many are at/below the parName path
    for (var path in editables) {
        // par in the path, but is not the parsys, nor the "new par" dropzone
        if (path.indexOf(parPath) != -1 && path.indexOf(dropZone) == -1 && path.indexOf(ignore) ==-1 ) {
           	// if the par is not a grandchild (has only one level of pathing below the parpath)
        	if (path.substring(path.indexOf(parPath)+parPath.length).split("/").length==1) {	
	            count++;
	            // if we've already met/exceeded the max, we want to disallow new pars
	            if (count >= max) {
	                // convert the par we found to the dropzone/new par reference
	                p = path.replace(new RegExp(parPath+".*","ig"),dropZone);
	                break;
	            }
        	}
        }
    }
    if (count >= max) {
        // tell the editable to hide
        editables[p].hide();
    }
}

/**
 * Set the three paths used by the custom content finder in the parent window if the page is called from within an iframe
 */
function setContentFinderPaths(options) {	
	if (window.parent) {
		window.parent.cfTabSpecificQuery = options.specific;
		window.parent.cfTabRelatedQuery = options.related;
		window.parent.cfTabCommonQuery = options.common;
	}	
}


function Terser(name) {
	switch (typeof(name)) {
		case 'string':
			this.name=name;
			this.initialize();
			break;
		case 'object':
			this.initialize(name);
			break;
		default:
			this.name="terser";
			this.initialize();
	}
}

Terser.prototype = {
	initialize: function(options) {
		jQuery.extend(true,this,options);
		this.callback=this.callback || this.name+".getData";
		this.loadFlash = this.load;
		this.queue=jQuery.qmanageable.prototype.queue;
	},
	name: "",
	shell: "",
	element: "",
	/*
	internal terse ecmascript objects which can be passed between Flash and the browser hosting it:
		data: data terser
		shadows: an 'associate array' used to contain shadow tersers that virtually extend the data values in the original terser
	*/
	data: {},
	shadows: {},
	/*
	callback functions:
		callback: callback function name, the function named should pass the internal terser to Flash, by default this is simply the getData method,
		complete: callback function name, this function executes when the Flash load is complete (data and minimum assets)
	*/
	callback: null,
	complete: null,
	/* parameters for instantiating the flash object */
	height: null,
	width: null,
	flashvars: {},
	params: {},
	/* cache for lazy loaded data related stuff */
	_dataCache: {},
	/* wrapper object methods */
	getData: function () {
		try {
			switch(arguments.length) {
				// default, get existing data
				case 0:
					return this.data;
					break;
				default:
					if (!this._dataCache[arguments[0].url]) {
						// closure used to preserve access to the calling function and the calling arguments
						var saveThis = this;
						var saveArgs = arguments;
						this._dataCache[arguments[0].url]={status:"pending",callbacks: [arguments[0].callback]};
						jQuery.ajax({
							url: arguments[0].url+".callback."+this.name+"!extend.jsonp",
							dataType: "script",
							complete: function(data,responseCode){
								var successCode = responseCode != "error";
								saveThis._dataCache[saveArgs[0].url].status = successCode ? "cached" : "failed";
								var callbacks = saveThis._dataCache[saveArgs[0].url].callbacks;
								for (var i = 0; i < callbacks.length; i++) {
									try { callbacks[i](successCode); } catch (e) { /* callback may not exist */ }
								}
								saveThis._dataCache[saveArgs[0].url].callbacks=[];
							}
						});
						return null;
					} else {
						switch (this._dataCache[arguments[0].url].status) {
							case "cached":
								return this.data;
								break;
							case "pending":
								this._dataCache[arguments[0].url].callbacks.push(arguments[0].callback);
								return null;
								break;
							case "failed":
								arguments[0].callback(false);
								return null;
						}
					}
					break;
			}
		} catch (e) {
			if (console) { console.log(e.toString()); }
			return false;
		}
	},
	getShadow: function(shadowName) {
		return this.shadows[shadowName];
	},
	shadow: function(shadow) {
		jQuery.extend(true,this.shadows,shadow);
	},
	extend: function(data) {
		jQuery.extend(true,this.data,data);
	},
	edit: function(hook) {
		alert(hook);
	},
	getModel: function() {
		
	},
	load: function() {
		if (jQuery.flash) {
			jQuery(this.element).flash({
				swf: this.shell,
				hasVersion: 9,
				height: this.height,
				width: this.width,
				params: jQuery.extend({
					wmode: "transparent",
					"allowScriptAccess": "always",
					base:"/apps/nna/docroot/swf/"
				},this.params),
				flashvars: jQuery.extend(true,{
					terserName: this.name,
					section: (typeof currentSection=='String')?currentSection:"home",
					model: (typeof currentModel=='String')?currentModel:"fx",
					callback: this.callback,
					shadow: this.name + ".getShadow",
					edit: this.name + ".edit",
					complete: this.complete
				},this.flashvars) ///,id: this.element.replace('#','')+'_srrwf' ///this.id
			});
		} else {
			if(swfobject.getFlashPlayerVersion().major>0){
				swfobject.embedSWF(this.shell, this.element.replace("#",""), this.width, this.height, "9.0.0", false,
					jQuery.extend(true,{
						terserName: this.name,
						section: (typeof currentSection=='String')?currentSection:"home",
						model: (typeof currentModel=='String')?currentModel:"fx",
						callback: this.callback,
						shadow: this.name + ".getShadow",
						edit: this.name + ".edit",
						complete: this.complete
					},this.flashvars),
					jQuery.extend({
						wmode: "transparent",
						"allowScriptAccess": "always",
						base:"/apps/nna/docroot/swf/"
					},this.params),
					{id: this.element.replace("#","") });
			}else{
				importXML();
			}		
		}
	}
};

/*
 * jQuery UI 1.7.1
 *
 * 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.1",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(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var 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 Dialog 1.7.1
 *
 * 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(e){var d=this;if(false===d._trigger("beforeclose",e)){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",e)}):d.uiDialog.hide()&&d._trigger("close",e));c.ui.dialog.overlay.resize();d._isOpen=false},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.1",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(){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()},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);;
// $Id: engine.js 45610 2008-10-09 20:16:30Z thaxtonm $
// ####################### CONSTANTS & GLOBAL VARS #############################

// SR 15705
var crmZipCode = 'czc';			     // Cookie name for zipcode
// END OF SR 15705

var crmLeadId = 'crmLeadId';		// Cookie name for Lead Id
var crmReferralSite="Site";			// Cookie and query param name for referral site
var crmReferralArea="Area";			// Cookie and query param name for referral area
var crmReferralCreative="Creative";	// Cookie and query param name for referral creative
var crmDoubleClickCampain="dcc";	// query param name for the DoubleClick campaign value
var crmDoubleClickPlacement="dcp";	// query param name for the DoubleClick campaign value
var crmUnknownSite = "UnknownSite";	// query param value for no referral site
var crmUnknownArea = "UnknownArea";	// query param value for no referral area
var crmUnknownCreative = "UnknownCreative";	// query param value for no referral creative
var crmVidCookieName = 'visitorID';	// Cookie name for visitor id
var crmPageLocale;					// pagelocale value from script tag attribute
var crmPageSite;					// pagesite value from script tag attribute
var crmPageId						// pageid value from the script tag attribute
///var crmDebugIsOn;					// crmdebug state from the query string
var crmDebugState=0;				// crmdebug state: 0=off, 1=alerts, 2=firebug with expanded function, 3=firebug with small function
var crmDebugCookie='crmDebugState';	// cookie name to track crmDebug state
var crmCondCallList=[];				// used to track conditional calls in the crmCondCall function
var crmUrl = location.pathname+location.search; // stores the the current page path + any querystring info
var crmJsURLPrefix;					// will store the full URL of engine.js (url up to, but not including the engine.js filename)
var crmTagBucketId="pageTags";		// id value of the div in which to place dynamic tags (ie images)
var crmCollageHost="collage.designory.com"	// Collage hostname/ip (used for preview trapping)
var crmCollageContribPage="as_contrib_edit.jsp" // Collage contribution page (used for preview trapping)
var crmOffer;						// Will contain an instance of CrmOfferClass on init
var crmCheckOfferFreq=250;			// frequency at which crmGetOffers checks the crmOffer obj (in ms)
var crmCheckOfferTimeOut=5000;		// how long to wait befor crmGetOffers gives up on crmOffer obj and shows defaults (in ms)
var crmPFALinkId='rtoPfaLink';		// id value for pfa link
var crmSMB1HeaderId='rtoSMB1Head';	// id value for smb1 link
var crmSMB1LinkId='rtoSMB1Link';	// id value for smb1 link
var crmSMB2LinkId='rtoSMB2Link';	// id value for smb2 link
var crmBuildNum;					// Will hold the build number for which the current page tag file was created
var crmBuildDate;					// Will hold the date (date object) for which the current page tag file was created
var crmClient;						// Will hold the object based on the CrmClientDetectClass
var genTag = {};					// Create generic tagging object

jQuery.noConflict();

function $(ee) {
	return document.getElementById(ee);
}

if (typeof crmAllowCreateVidCookie == 'undefined')
  var crmAllowCreateVidCookie = true;					// Gives external files the ability to prevent the VisitorID cookie from being created

// ############################### CLASSES #####################################

// ###	CRM Client Detect Class
//		Creates an object that holds client detail information
//		Properties:
//			.OS - Operating system name
//			.browser - Web Browser name
//			.version - Web Browser Version
function CrmClientDetectClass () {
	var detect = navigator.userAgent.toLowerCase();
	var thestring;
	this.OS;
	this.browser;
	this.version;

	if (checkIt('konqueror'))
	{
		this.browser = "Konqueror";
		this.OS = "Linux";
	}
	else if (checkIt('safari')) this.browser = "Safari"
	else if (checkIt('omniweb')) this.browser = "OmniWeb"
	else if (checkIt('opera')) this.browser = "Opera"
	else if (checkIt('webtv')) this.browser = "WebTV";
	else if (checkIt('icab')) this.browser = "iCab"
	else if (checkIt('msie')) this.browser = "Internet Explorer"
	else if (!checkIt('compatible'))
	{
		this.browser = "Netscape Navigator"
		this.version = detect.charAt(8);
	}
	else this.browser = "An unknown browser";

	if (!this.version) this.version = detect.charAt(place + thestring.length);

	if (!this.OS)
	{
		if (checkIt('linux')) this.OS = "Linux";
		else if (checkIt('x11')) this.OS = "Unix";
		else if (checkIt('mac')) this.OS = "Mac"
		else if (checkIt('win')) this.OS = "Windows"
		else this.OS = "an unknown operating system";
	}

	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}
}

// ###	CRM Offer Class
//		Holds dynamic offer information which is returned from providers
function CrmOfferClass () {
	var pfaSwf='', pfaSwfDefault='', pfaImg='', pfaImgDefault='', pfaText='', pfaTextDefault='', pfaLink='', pfaLinkDefault='', isLoaded=false;

	this.getPfaSwf = function () { return pfaSwf; }
	this.getPfaSwfDefault = function () { return pfaSwfDefault; }
	this.getPfaImg = function () { return pfaImg; }
	this.getPfaImgDefault = function () { return pfaImgDefault; }
	this.getPfaText = function () { return pfaText; }
	this.getPfaTextDefault = function () { return pfaTextDefault; }
	this.getPfaLink = function () { return pfaLink; }
	this.getPfaLinkDefault = function () { return pfaLinkDefault; }
	this.getLoaded = function () { return isLoaded; }

	this.setPfaSwf = function (value) { pfaSwf = value; }
	this.setPfaSwfDefault = function (value) { pfaSwfDefault = value; }
	this.setPfaImg = function (value) { pfaImg = value; }
	this.setPfaImgDefault = function (value) { pfaImgDefault = value; }
	this.setPfaText = function (value) { pfaText = value; }
	this.setPfaTextDefault = function (value) { pfaTextDefault = value; }
	this.setPfaLink = function (value) { pfaLink = value; }
	this.setPfaLinkDefault = function (value) { pfaLinkDefault = value; }
	this.setLoaded = function (value) { isLoaded = value; }
}

// ###	CRM Site Class
//		Associates nissan or infiniti with provider specific strings
//		Example: var localEnvObj = new CrmEnvironmentClass({
//					nissan:		'NissanUSA_',
//					infiniti:	'Infiniti_'});
function CrmSiteClass ( locSiteObj ) {
	var siteLocalObj = locSiteObj;
	this.isNissan = (crmPageSite=='nissan') ? true : false;
	this.isInfiniti = !this.isNissan;
	this.getSite = function () {
		if (crmPageSite=='nissan') return siteLocalObj.nissan;
		if (crmPageSite=='infiniti') {
			if(/.infinitiusaretailers/.test(location.host))
				return siteLocalObj.infinitiusaretailers;
			else
				return siteLocalObj.infiniti;
		}
		return null;
	}
	this.getSiteName = function () { return crmPageSite }
}

// ###	CRM Environment Class
//		Associates dev, qa, stage & prod with provider specific host and path names
//		Protocol should NOT be provided as it derived from the current page location
//		Example: var localEnvObj = new CrmEnvironmentClass({
//					dev:	  'some.dev.domain.com/path/to/file.html',
//					qa:		  'some.qa.domain.nna/path/to/file.html',
//					stage:	'some.stage.domain.com/path/to/file.html',
//					prod:	  'some.prod.domain.com/path/to/file.html'});
function CrmEnvironmentClass ( locEnvObj ) {
    var envHostName = location.hostname.toLowerCase();
	var envPort = location.port;
	var envLocalEnvObj = locEnvObj;
	var envProtocol = location.protocol + '//';
	this.getProtocol = function () { return envProtocol; }
	this.getEnv = function () {

		if (/(9080|8080|9000|9091|1160|92|209|210)/.test(envPort) || /(collage.|integ.|designory|localhost|author|publish|vangogh)/.test(envHostName)) return envLocalEnvObj.dev;
		if (/(www.qa|prod.)/.test(envHostName) || envPort == 9090) return envLocalEnvObj.qa;
		if (/(stage)/.test(envHostName))	return envLocalEnvObj.stage;
		if (/(.nissanusa.com|.infiniti.com)/.test(envHostName)) return envLocalEnvObj.prod;
		return envLocalEnvObj.prod;
	}
}

// ###	CRM Language Local Class
//		Associates en (english) & es (spanish) with provider specific strings
//		Example: var locLocalObj = new CrmLocalClass ({
//					es:		'parameter_string_for_spanish',
//					en:		'parameter_string_for_english'});
function CrmLocaleClass ( localObj ) {
	var locLocalObj = localObj;
	this.getLocale = function () {
		if (crmPageLocale=='en') return locLocalObj.en;
		if (crmPageLocale=='es') return locLocalObj.es;
		return null;
	}
}

// ########################## GENERAL FUNCTIONS ################################

// ###	Debugging alert box
function crmDebug ( msgObj ) {
	if( !crmDebugState ) return;
	if( ('console' in window) && crmDebugState>1 ) return crmDebugFirebug(msgObj);
	var buildInfo = "BUILD: Not specified in page tag file\n\n";
	if (typeof crmBuildDate != 'undefined')
		buildInfo = "BUILD: " + crmBuildNum + " (" + crmBuildDate.toLocaleString() + ")\n\n";
	var msgHeader = "___CRM DEBUG________________________________\n\n";
	if (typeof msgObj == 'function') { //assumes a crmEvent function object
		var funcName = "coreevent";
		var funcLine = msgObj.toString().substring(0,(msgObj.toString().indexOf('{')+1));
		var funcNameIndex = funcLine.toLowerCase().indexOf(funcName.toLowerCase());
		var funcOpenParensIndex = funcLine.indexOf('(');
		var funcCloseParensIndex = funcLine.indexOf(')');
		var eventID = funcLine.substring( (funcNameIndex + funcName.length),funcOpenParensIndex );
		var argsNameList = crmGetParamNames(msgObj);
		var argsDisplayText ='';
		for (n=0; n<argsNameList.length; n++)
			if (argsNameList[n].length > 0)
				argsDisplayText += (typeof msgObj.arguments[n] != 'undefined' ) ? argsNameList[n]+': '+msgObj.arguments[n]+'\n' : argsNameList[n]+': [no value passed in]\n';
		if ( !confirm( msgHeader + 'EVENT ID: ' + eventID + ' ................................. PAGE ID: '+crmPageId+'\n' + buildInfo + argsDisplayText ) )
			if( !confirm(msgHeader + msgObj,'Visitor ID: '+crmGetVID()) )
				prompt(msgHeader + 'Visitor ID:',crmGetVID());
	} else { // assumes a string
		if ( !confirm(msgHeader + msgObj) )
			prompt(msgHeader + 'Visitor ID:',crmGetVID());
	}
}

function crmDebugFirebug ( msgObj ) {
	if ( !crmDebugState ) return;

	var buildInfo="BUILD: "+((typeof crmBuildDate == 'undefined') ? "Not specified in page tag file" : "{0} ({1})".format(crmBuildNum,crmBuildDate.toLocaleString()));

	if (typeof msgObj == 'function') { //assumes a crmEvent function object
		var funcName = "coreEvent";
		var funcLine = msgObj.toString().substring(0,(msgObj.toString().indexOf('{')+1));
		var funcNameIndex = funcLine.toLowerCase().indexOf(funcName.toLowerCase());
		var funcOpenParensIndex = funcLine.indexOf('(');
		var funcCloseParensIndex = funcLine.indexOf(')');
		var eventID = funcLine.substring( (funcNameIndex + funcName.length),funcOpenParensIndex );
		var argsNameList = crmGetParamNames(msgObj);
		var argsDisplayText ='';

		console.group("CRM Page: "+crmPageId+"\tevent: "+eventID+"\t"+buildInfo)

		if(crmDebugState==3){ console.log(msgObj,"\t\t",'Visitor ID:\t' + crmGetVID()) }

		for (n=0; n<argsNameList.length; n++){
			if (argsNameList[n].length > 0){
				switch(typeof msgObj.arguments[n]){
					case 'undefined':	console.warn(argsNameList[n]+':\t[no value passed in]');break;
					case 'number':	console.info(argsNameList[n]+':\t%f',msgObj.arguments[n]);break;
					case 'string':	console.info(argsNameList[n]+':\t%a',msgObj.arguments[n]);break;
					default:	console.info(argsNameList[n]+':\t',msgObj.arguments[n]);
				}
			}
		}

		var myArgs=[];
		for(var i=0;i<argsNameList.length;i++){
			var mAi=msgObj.arguments[i];
			myArgs.push( (typeof mAi == 'string')?'"'+mAi+'"': mAi );
		}
		var myFuncCall="// {0}{1}({2})".format(funcName,eventID,myArgs.join(','));

		if(crmDebugState==2){
			setTimeout( function(){
				console.log(myFuncCall);
				var _fnc= String(msgObj).replace(/(s\.(\w+)) = (.+?);/g,function(){ //this will swap in computed values.
				        	var A=arguments;
				        	return ((/^"[^"]+"$/.test(A[3]))? A[0] : A[1]+' = "'+s[A[2]]+'"');//   // '+A[3]);
				    	});
				//console.log(_fnc);
				var _ss=['','','',''];//save the first 4 for some vals
				var _fl=_fnc.replace(/= /g,'=\t').split(/\n\s*/);

				for(var i=0;i<_fl.length;i++){
					if(/^s\.(pagename|prop10|channel|events)\b/i.test(_fl[i])){
						switch(RegExp.$1.toLowerCase()){
							case 'pagename'	: _ss[0]=_fl[i];break;
							case 'prop10'	: _ss[1]=_fl[i];break;
							case 'channel'	: _ss[2]=_fl[i];break;
							case 'events'	: _ss[3]=_fl[i];
						}
					}else if(/^(s\.\w+\b|olUpdateState|ping[^O])/.test(_fl[i])){
						_ss.push(_fl[i]);
					}
				}
				console.log(_ss.slice(0,4).join('\n'))
				console.log(_ss.slice(4).join('\n'))
				console.groupEnd();
			},5);
		}else{
			console.groupEnd();
		}

	} else { // assumes a string
		console.group("CRM\tPage: "+crmPageId+"\t"+buildInfo)
		console.info(msgObj);
		console.log('Visitor ID:\t'+crmGetVID());
		console.groupEnd();
	}
}


// ###	CRM cookie related functions
function crmSetCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function crmGetCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
function crmDeleteCookie(name, path, domain) {
  if (crmGetCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
function crmMakeExpDate(days, hours, minutes) {
    var expDate = new Date( );
    if (typeof days == "number" && typeof hours == "number" &&
        typeof hours == "number") {
        expDate.setDate(expDate.getDate( ) + parseInt(days));
        expDate.setHours(expDate.getHours( ) + parseInt(hours));
        expDate.setMinutes(expDate.getMinutes( ) + parseInt(minutes));
		return expDate;
    }
}
function crmGetZipCode(){
	var zipParam=s.getQueryParam('zipCode','');
	var zipCookie=crmGetCookie(crmZipCode);
	return (zipParam) ? zipParam : zipCookie;
}// END CRM Cookie functions

// ###	Returns the string value of the param from the search/query string (location.search)
//		Returns empty string if null if no value is found
function crmGetQueryParam(paramName) {
	var qString = location.search.substring(1);
	if (qString.indexOf(paramName) == -1) return '';
	var pValueStart = qString.indexOf(paramName) + paramName.length + 1;
	var pValueEnd = qString.indexOf('&', pValueStart);
	if ( pValueEnd==-1 ) pValueEnd = qString.length;
	return unescape( qString.substring( pValueStart,pValueEnd ) );
}

// ###	Returns an array of name/value params from the query string (location.search)
//		Array is bothed named and index based. So values can be pulled by:
//			queryArray['paramName']
//		and
//			queryArray[n].name, queryArray[n].value
function crmGetQueryStringArray () {
	var qArray = new Array();
	var qString = location.search.substring(1);
	var nameValues = qString.split('&');
	for (n=0; n<nameValues.length; n++) {
		nameValue = nameValues[n].split('=');
		qArray[ unescape(nameValue[0]) ] = unescape(nameValue[1]);
		qArray[n] = { name:unescape(nameValue[0]), value:unescape(nameValue[1])};
	}
	return qArray;
}

// ###	Dynamic HTML tag creation function
//		tagName:			type of tag to create
//		tagInsertPoint:		tag name to insert this tag inside of (ie html, head, body).
//							Will always insert new tag as the last item within the
//							Insert Point container. OR a tag element object can be
//							supplied (ie getElementById value can be passed in)
//		further arguments:	This function can be overloaded with further arguments.
//							They represent the attributes of the tag and should be
//							passed in as objects:
//							crmCreateTag( 'img', 'body', {attrName: 'attribute name',attrValue: 'attribute value'}, ... , ...);
function crmCreateTag ( tagName, tagInsertPoint ) {
	try {
		insertElm = (typeof tagInsertPoint == 'string') ? document.getElementsByTagName( tagInsertPoint ).item(0) : tagInsertPoint;
		attrObjs = crmCreateTag.arguments;
		newElm = document.createElement( tagName.toLowerCase() );
		for( n=2; n < attrObjs.length; n++ )
			newElm.setAttribute( attrObjs[n].attrName.toLowerCase(), attrObjs[n].attrValue );
		insertElm.appendChild( newElm );
		return true;
	} catch (err) {
		crmDebug('crmCreateTag failed with:\n\n' + err);
		return false;
	}
}

// ###	Generates new random visitorIDs
//		calls: crmSha1Hash
function crmMakeNewVID() {
	var seed = navigator.userAgent;
	if (typeof screenX != 'undefined')
		seed += (screenX/screenY).toString();
	else if (typeof screenLeft != 'undefined')
		seed += (screenLeft/screenTop).toString();
	if (typeof document.body.clientHeight != 'undefined')
		seed += (document.body.clientHeight/document.body.clientWidth).toString();
	seed += (new Date()).getTime().toString();
	seed += Math.random().toString();
	substrIndex = Math.floor(Math.random()*21);
	newVid = crmSha1Hash(seed).substr(substrIndex,20);
	finalVid = '';
	for (n=0; n<newVid.length; n++)
		finalVid += (Math.floor(Math.random()*2)) ? newVid.charAt(n).toUpperCase() : newVid.charAt(n);
	return finalVid;
}

function crmGetHostName() {
	var h;
	var arrHostName=document.location.hostname.split(".");
	if (arrHostName[arrHostName.length-1] == "com" || arrHostName[arrHostName.length-1] == "nna")
    h="."+arrHostName[arrHostName.length-2]+"."+arrHostName[arrHostName.length-1];
  else
		h=document.location.hostname;

  return h;
}

// ###	Gets new VID and sets cookie
//		uses: crmVidCookieName
//		calls: crmGetCookie, crmMakeNewVID, crmDeleteCookie, crmSetCookie, crmMakeExpDate
function crmGetVID() {
	var vid = crmGetCookie(crmVidCookieName);
	if (vid==null) vid = crmMakeNewVID();
	var hostName = crmGetHostName();
  if (crmAllowCreateVidCookie) {
  	crmDeleteCookie(crmVidCookieName,"/",hostName);
	  crmSetCookie( crmVidCookieName, vid, crmMakeExpDate(365,0,0), "/", hostName);
  }
	return vid;
}

// ###	Sets Referral Cookies (session) if they are found in the query string
function crmSetReferralCookies () {
	var hostName = crmGetHostName();
	var queryList = crmGetQueryStringArray();
  var site="";
  var area="";
  var creative="";
  var dcc="";
  var dcp="";
  var cmp="";

  for(n=0; n<queryList.length; n++) {
		if ( queryList[n].name.toLowerCase() == crmReferralSite.toLowerCase() ) {
      site=queryList[n].value;
    } else if ( queryList[n].name.toLowerCase() == crmReferralArea.toLowerCase() ) {
      area=queryList[n].value
    } else if ( queryList[n].name.toLowerCase() == crmReferralCreative.toLowerCase() ) {
      creative=queryList[n].value
    } else if ( queryList[n].name.toLowerCase() == crmDoubleClickCampain.toLowerCase() ) {
      dcc=queryList[n].value
    } else if ( queryList[n].name.toLowerCase() == crmDoubleClickPlacement.toLowerCase() ) {
      dcp=queryList[n].value
    } else if ( queryList[n].name.toLowerCase() == "cmp" ) {
      cmp=queryList[n].value
    }
	}

  if ( dcc!="" || dcp!="" ) {
        crmDeleteCookie(crmDoubleClickCampain, '/', hostName);
        crmDeleteCookie(crmDoubleClickPlacement, '/', hostName);
        crmDeleteCookie(crmReferralSite, '/', hostName);
        crmDeleteCookie(crmReferralArea, '/', hostName);
        crmDeleteCookie(crmReferralCreative, '/', hostName);

        crmSetCookie(crmDoubleClickCampain, dcc, crmMakeExpDate(7,0,0), '/', hostName);
        crmSetCookie(crmDoubleClickPlacement, dcp, crmMakeExpDate(7,0,0), '/', hostName);
  } else if ( site!="" || area!="" || creative!="" ) {
        crmDeleteCookie(crmDoubleClickCampain, '/', hostName);
        crmDeleteCookie(crmDoubleClickPlacement, '/', hostName);
        crmDeleteCookie(crmReferralSite, '/', hostName);
        crmDeleteCookie(crmReferralArea, '/', hostName);
        crmDeleteCookie(crmReferralCreative, '/', hostName);

        crmSetCookie(crmReferralSite, site + ";", crmMakeExpDate(7,0,0), '/', hostName);
        crmSetCookie(crmReferralArea, area + ";", crmMakeExpDate(7,0,0), '/', hostName);
        crmSetCookie(crmReferralCreative, creative, crmMakeExpDate(7,0,0), '/', hostName);
  } else if (cmp != "") {
        crmDeleteCookie(crmDoubleClickCampain, '/', hostName);
        crmDeleteCookie(crmDoubleClickPlacement, '/', hostName);
        crmDeleteCookie(crmReferralSite, '/', hostName);
        crmDeleteCookie(crmReferralArea, '/', hostName);
        crmDeleteCookie(crmReferralCreative, '/', hostName);

        crmSetCookie(crmReferralSite, cmp + ";;", crmMakeExpDate(7,0,0), '/', hostName);
  }
}

// ###	Checks query string and cookie info to see how crmDebugState should be set
function crmSetDebug() {
	if(/crmdebug=(on|[1-3])/i.test(location.search)){
		crmDebugState=(RegExp.$1=='on')? 1 : +RegExp.$1 ;
		crmDeleteCookie(crmDebugCookie,'/',location.hostname);
		crmSetCookie(crmDebugCookie,crmDebugState,'','/',location.hostname);
	}else if(/crmdebug=(off|0)/i.test(location.search)){
		crmDebugState=0;
		crmDeleteCookie(crmDebugCookie,'/',location.hostname);
	}else{
		crmDebugState=crmGetCookie(crmDebugCookie);
	}
}

// ###	Checks to see if the value is null, undefined or empty string. If any of
//		these are true, it returns the safe value. Otherwise passes the value
//		back.
function crmGetSafeValue(initValue, safeValue) {
	if (typeof initValue == 'undefined' || initValue == null || initValue == '')
		return safeValue;
	return initValue;
}

// ###	Sets the the global vars crmBuildNum and crmBuildDate with provided values
function crmBuildInfo (buildNum, buildTime) {
	crmBuildNum = buildNum;
	crmBuildDate = new Date(buildTime);
}

// ###	Aggregates parameter values in the order required for the core event fucntion and returns them in an array
// 		Determines if call is orderless or not and handles each case accordingly
function crmMarshallEventParams (evtFunc, coreFunc) {
	var args = evtFunc.arguments;
	var finalParams = [];
	if (typeof args[0] == 'object') { // assume orderless
		var paramsObj = args[0];
		var paramNames = crmGetParamNames(coreFunc);
		for(var n=0; n<paramNames.length; n++){
			if(typeof paramsObj[ paramNames[n] ] == 'string'){
				finalParams[n] = crmConvertParam(paramsObj[ paramNames[n] ]);
			}else{
				finalParams[n] = paramsObj[ paramNames[n] ];
			}
		}
	} else { // assume ordered
		for(var n=0; n<args.length; n++)
			if(typeof args[n] == 'string'){
				finalParams[n] = crmConvertParam(args[n]);
			}else{
				finalParams[n] = args[n];
			}
	}
	return finalParams;
}

// ###	Converts all space characters to underscores
//      This is used to make our parameters with spaces match BI's style
//      It also cleans up some of the various Z parameters to match BI's expectations
function crmConvertParam (str) {
	if (str.toLowerCase() == "z&#174;" || str.toLowerCase() == "z&reg;" || str.toLowerCase() == "z coupe" || str.toLowerCase() == "z roadster") {
		str = "350Z"
	}
	return str.replace(/ /g,"_");
}


// ###	Returns an array of function parameters names associated to their argument position
//		Array is both indexed (returning arg name by position) and named (returning arg position by name)
function crmGetParamNames (func) {
	var funcStr = func.toString();
	var paramsStart = funcStr.indexOf('(')+1;
	var paramsEnd = funcStr.lastIndexOf(')',funcStr.indexOf('{'));
	var params = funcStr.substring(paramsStart,paramsEnd).replace(/\s/g,'').split(',');
	for (var index in params)
		params[ params[index] ] = index;
	return params;
}

// ###	SHA1 hashing functions
function crmSha1Hash(msg) {
    var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
    msg += String.fromCharCode(0x80);
    var l = Math.ceil(msg.length/4) + 2;
    var N = Math.ceil(l/16);
    var M = new Array(N);
    for (var i=0; i<N; i++) {
        M[i] = new Array(16);
        for (var j=0; j<16; j++) {
            M[i][j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) |
                      (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3));
        }
    }
    M[N-1][14] = ((msg.length-1) >>> 30) * 8;
    M[N-1][15] = ((msg.length-1)*8) & 0xffffffff;
    var H0 = 0x67452301;
    var H1 = 0xefcdab89;
    var H2 = 0x98badcfe;
    var H3 = 0x10325476;
    var H4 = 0xc3d2e1f0;
    var W = new Array(80); var a, b, c, d, e;
    for (var i=0; i<N; i++) {
        for (var t=0;  t<16; t++) W[t] = M[i][t];
        for (var t=16; t<80; t++) W[t] = ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1);
        a = H0; b = H1; c = H2; d = H3; e = H4;
        for (var t=0; t<80; t++) {
            var s = Math.floor(t/20);
            var T = (ROTL(a,5) + f(s,b,c,d) + e + K[s] + W[t]) & 0xffffffff;
            e = d;
            d = c;
            c = ROTL(b, 30);
            b = a;
            a = T;
        }
        H0 = (H0+a) & 0xffffffff;
        H1 = (H1+b) & 0xffffffff;
        H2 = (H2+c) & 0xffffffff;
        H3 = (H3+d) & 0xffffffff;
        H4 = (H4+e) & 0xffffffff;
    }
    return H0.toHexStr() + H1.toHexStr() + H2.toHexStr() + H3.toHexStr() + H4.toHexStr();
}

function f(s, x, y, z) {
    switch (s) {
    case 0: return (x & y) ^ (~x & z);
    case 1: return x ^ y ^ z;
    case 2: return (x & y) ^ (x & z) ^ (y & z);
    case 3: return x ^ y ^ z;
    }
}
function ROTL(x, n) {
    return (x<<n) | (x>>>(32-n));
}
Number.prototype.toHexStr = function() {
    var s="", v;
    for (var i=7; i>=0; i--) { v = (this>>>(i*4)) & 0xf; s += v.toString(16); }
    return s;
}// END SHA1

  // ############################## INITIALIZE ###################################
  // ###	Validate script tag attributes. Check that the crmEngine
  if (jQuery("meta[name='pagesite']") &&
  	  jQuery("meta[name='pageid']") &&
  	  jQuery("meta[name='pagelocale']")){

/*	  
  if	(	$('crmEngine') &&									// ensure that the crmEngine ID exists
  		$('crmEngine').tagName.toLowerCase()=='script' && 	// ensure that crmEngine ID is assigned to a SCRIPT tag
  		$('crmEngine').getAttribute('pageid') &&			// ensures that the pageid attribute is set
  		$('crmEngine').getAttribute('pagelocale') &&		// ensures that the pagelocal attribute is set
  		( $('crmEngine').getAttribute('pagelocale')=='es' || $('crmEngine').getAttribute('pagelocale')=='en' ) &&
  															// ensures that the pagelocal attribute is set to either en or es
  		$('crmEngine').getAttribute('pagesite') &&			// ensures that the pagesite attribute is set
  		( $('crmEngine').getAttribute('pagesite')=='nissan' || $('crmEngine').getAttribute('pagesite')=='infiniti' )
  															// ensures that the pagesite attribute is set to either nissan or infiniti
  	) {
*/  	

  	// Check crmDebug settings and set accordingly
  	crmSetDebug();

  	// Set global vars from tag attributes
  	crmPageLocale = jQuery("meta[name='pagelocale']").attr("content");//$('crmEngine').getAttribute('pagelocale');	// en, es
  	crmPageSite = jQuery("meta[name='pagesite']").attr("content");//$('crmEngine').getAttribute('pagesite');		// nissan, infiniti
  	crmPageId = jQuery("meta[name='pageid']").attr("content");//$('crmEngine').getAttribute('pageid');

  	// Setup base crmEvent# functions which will be redefined by tagging file
  	for (n = 1; n <=99; n++) eval('crmEvent'+n+'= function(){ crmDebug("Event '+n+' Failed.\\n\\nThere is either no crmEvent'+n+' function in the '+crmPageId+'.js tagging file, \\nor this tagging file failed to load."); }');

	//Create our client detection object
	crmClient = new CrmClientDetectClass();

	//Create our offer object to hold real time offer info
	crmOffer = new CrmOfferClass();

	// Check for any referral params
	crmSetReferralCookies();

	// Determine URL prefix from current script
	crmJsURLPrefix =  "/content/infiniti/us/en/crm/"; //$('crmEngine').src.substring( 0,$('crmEngine').src.indexOf('/engine.js')+1 ); // the '/' in '/engine.js' seems to be required for collage preview to work

    // default behavior for non-email matchback files
    if (crmAllowCreateVidCookie) {
    		// Include provider specific js files
    		//document.write('\n<scr'+'ipt src="' + crmJsURLPrefix +	'providers/atlas.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/doubleclick.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/eloyalty.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/omniture.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/legacy.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/factortg.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/opinionlab.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
			if(crmPageId != 19036 && crmPageId != 19047){
				//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/surveygizmo.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
			}
    } else {
        // special behavior for email matchback
   		//document.write('<scr'+'ipt src="' + crmJsURLPrefix +	'providers/omniture.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');
    }

	// Include page specific tagging file
	document.write('<scr'+'ipt src="' + crmJsURLPrefix + crmPageId + '.js" language="JavaScript" type="text/javascript"></scr'+'ipt>\n');


  } else { // Create crmEngine failure debug message
  	crmErrorMsg = "crmEngine FAILED\n";
  	if ( !jQuery("meta[name='pageid']") )
  		crmErrorMsg += '"crmEngine" ID not found';
  	//else if ( $('crmEngine').tagName.toLowerCase() != 'script' )
  	//	crmErrorMsg += '"crmEngine" ID not assigned to SCRIPT tag';
  	else if ( !jQuery("meta[name='pageid']") )
  		crmErrorMsg += '"pageid" attribute not found in the appropriate meta tag';
  	else if ( !jQuery("meta[name='pagesite']") )
  		crmErrorMsg += '"pagesite" attribute not found in the appropriate meta tag';
  	else if ( jQuery("meta[name='pagesite']").attr("content")!='nissan' && jQuery("meta[name='pagesite']").attr("content")!='infiniti' )
  		crmErrorMsg += '"pagesite" attribute must be set to either "nissan" or "infiniti" in the appropriate meta tag';
  	else if ( !jQuery("meta[name='pagelocale']") )
  		crmErrorMsg += '"pagelocale" attribute not found in the appropriate meta tag';
  	else if ( jQuery("meta[name='pagelocale']").attr("content")!='es' && jQuery("meta[name='pagelocale']").attr("content")!='en' )
  		crmErrorMsg += '"pagelocale" attribute must be set to either "en" or "es" in the appropriate meta tag';
  	else
  		crmErrorMsg += 'unkown error with the CRM Engine script tag structure';
  	crmDebug(crmErrorMsg);
  }

// ###	CRM Conditional Call
//		key:						A unique value that associates together all the calls to this function so that it can determine if its the first call or not
//		initialValue: 				The value to be returned on the first call
//		subsequentValue (optional): The value to be returned on all subsequent calls
//									Will return an empty string if no value is provided
function crmCondCall (key, initialValue, subsequentValue) {
	if(crmCondCallList[key]) {
		return (typeof subsequentValue=='undefined') ? '' : subsequentValue;
	} else {
		crmCondCallList[key]=true;
		return initialValue
	}
}


// ###	Returns a named array of offer values. Will wait until crmOffer is loaded
//		and return the results. If crmOffer dosent return within a given amount
//		of time, function will timeout and return defaults
//		uses: crmOffer
function crmGetOffers(callBackFunc,callBackStartTime) {
	//if this is the first time called, time stamp this
	callBackStartTime = (typeof callBackStartTime == 'undefined') ? (new Date()).getTime() : callBackStartTime;

	//setup restults var in case we have results to return
	var result = [];

	// Check to see if offers have loaded
	if ( crmOffer.getLoaded() ) {
		//got offers back, return the values and fire the callback
		result['pfaSwf'] = crmOffer.getPfaSwf();
		result['pfaText'] = crmOffer.getPfaText();
		result['pfaImg'] = crmOffer.getPfaImg();
		result['pfaLink'] = crmOffer.getPfaLink();
		eval(callBackFunc+'(result)');
	} else {
		//check to see if we still have time to try again
		if ( ((new Date()).getTime() - callBackStartTime) < crmCheckOfferTimeOut ) {
			//still have time, try again
			setTimeout('crmGetOffers(\'' + callBackFunc + '\','+callBackStartTime+')',crmCheckOfferFreq);
		} else {
			//out of time, return default values and fire the callback;
			result['pfaSwf'] = crmOffer.getPfaSwfDefault();
			result['pfaText'] = crmOffer.getPfaTextDefault();
			result['pfaImg'] = crmOffer.getPfaImgDefault();
			result['pfaLink'] = crmOffer.getPfaLinkDefault();
			eval(callBackFunc+'(result)');
		}
	}
}

function callPromo(index){
	   var currentPromo = promoTerser.data.promo.vehicleData[index]
	   var url = currentPromo.link.href;
	   var trackingCode = currentPromo.trackingCode;
	   var crmev = currentPromo.link.crmEvent;
	   var px = currentPromo.link.popupX;
	   var py = currentPromo.link.popupY;
	   var targ = currentPromo.link.target;
	   var qamp = (url.indexOf('?')>=0)?'&':'?';
       var placement = index + 1;
       var gtMod;
	   if(genTag.model == undefined){
	       gtMod = "";
	   }else{
	       gtMod = genTag.model;
	   }
	   calledUrl = url + qamp + "intcmp=" + trackingCode + "." + genTag.siteSection + "." + genTag.pageName + ".P" + placement + "." + gtMod +".";
	   var newWindow;
	   if(targ=="_blank"){
		   newWindow = window.open(calledUrl, '_blank');
		   newWindow.focus();
	   }else if(targ=="popup"){
		   newWindow = window.open(calledUrl, "infinitiusa", "addressbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,status=yes,width="+py+",height="+px);
		   newWindow.focus();
	   }else{
		   location.href = calledUrl;
	   }
}


// $Id: omniture.js 49819 2008-12-03 22:51:27Z vangogh $

// DOM image load failsafe
jQuery(document).ready(function(){
	imn='s_i_'+s.fun;
	if(s.d.images[imn]){s.ios=1};
});

// ###	Sets the style for the reporting image so that it does not affect page layout
document.write('<style type="text/css">.omnReportImg{position:absolute;height:1px;width:1px;top:-1px;left:-1px;}</style>');

// ###	Sets all omniture variables to empty strings
//		Called before every call to omniture to make sure we don't resend parameters
function omnFlushObj() {
	for (n=1; n <= 50; n++) eval('s.prop'+n+'="";');
	for (n=1; n <= 50; n++) eval('s.eVar'+n+'="";');
	for (n=1; n <= 5;  n++) eval('s.heir'+n+'="";');
	s.channel="";
	s.campaign="";
	s.products="";
	s.state="";
	s.zip="";
	s.pageType="";
	s.pageName="";
}
// ###	For concatenating report suite IDs (e.g. nissanusacom)
var omnAccountSiteObj = new CrmSiteClass ({
					nissan:		'nissan',
					infinitiusaretailers: 'nissaninfinitiretailers',
					infiniti:	'nissaninfiniti'});

// ###	For concatenating reporting domain (e.g. metrics.nissanusa.com)
var omnDomainSiteObj = new CrmSiteClass ({
					nissan:		'nissanusa.com',
					infinitiusaretailers: 'infinitiusa.com',
					infiniti:	'infinitiusa.com'});

// ###	Associate Env URLS for this provider
var omnEnvObj = new CrmEnvironmentClass ({
					dev:	'dev',
					qa:		'dev',
					stage:	'dev',
					prod:	''});

//SR 19115					
var userAgentString = navigator.userAgent;
userAgentString = userAgentString.toLowerCase();
if(userAgentString.indexOf("regressiontest")!=-1)
{
	omnEnvObj = new CrmEnvironmentClass ({
					dev:	'dev',
					qa:		'dev',
					stage:	'dev',
					prod:	'dev'});
}
//End of SR 19115

// ###	Associate langauges with provider specific strings
var omnLocaleObj=[];
if (omnAccountSiteObj.isNissan)
	omnLocaleObj = new CrmLocaleClass ({
					es:		'espanol',
					en:		'usacom' });
else
	omnLocaleObj = new CrmLocaleClass ({
					es:		(omnEnvObj.getEnv() == "dev") ? "" : "com",
					en:		(omnEnvObj.getEnv() == "dev") ? "" : "com" });

// ###	Primary tag firing function
function pingOmn () {
  // add querystring param 'owe' value to prop37 for tagging internal links for Owners Email Matchback
  if (s.getQueryParam('owe','') != '')
    s.prop37 = s.getQueryParam('owe','').toLowerCase();

  omnCustEvents();
  s.t();
}

// ###	Primary tag firing function
function pingOmnLink (linkType, linkName) {
  omnCustEvents();
  s.tl(this, linkType, linkName);
}

// ###	Applies custom event rules to the omniture object.
function omnCustEvents () {
	if (s.events=='') return;
	var evts = s.events.split(',');
	if ( listContains(evts,'event4') || listContains(evts,'event8') || listContains(evts,'event11') || listContains(evts,'event22') || listContains(evts,'event23') || listContains(evts,'event24') || listContains(evts,'event28') ) {
		s.events +=',event12';
        if (s.prop20 != "") {
            s.prop20 = s.prop20 + "_Lead";
        }
        crmDebug('Omniture: Added "event12" to s.events\n\ns.events = '+s.events);
	}
	if ( listContains(evts,'event1') || listContains(evts,'event2') || listContains(evts,'event6')) {
		s.events +=',event13';
        if (s.prop20 != "" && s.prop20.indexOf("_Lead") < 0) {
            s.prop20 = s.prop20 + "_Handraiser";
        }
        crmDebug('Omniture: Added "event13" to s.events\n\ns.events = '+s.events);
	}

	function listContains(stack, needle) {
		for(var idx in stack) {
			if ( stack[idx]==needle ) {
				return true;
			}
		}
		return false;
	}

    if (s.prop29 != '') {
        s.eVar29 = s.prop29;
    }
}

var doubleclickAccountIdObj=[];
if (omnAccountSiteObj.isNissan)
	doubleclickAccountIdObj = new CrmLocaleClass ({
					es:		'1507209',
					en:		'1507209' });
else
	doubleclickAccountIdObj = new CrmLocaleClass ({
                    es:		'',
                    en:		'1500855' });

function omnGetDoubleclickSite() {
    return 'DFA#' + doubleclickAccountIdObj.getLocale() + ':v26=[["DFA:"+lis+":"+lip+":"+lastimp+":"+lastimptime+":"+lcs+":"+lcp+":"+lastclk+":"+lastclktime]]';
}

/* SiteCatalyst code version: H.9.
Copyright 1997-2007 Omniture, Inc. More info available at
http://www.omniture.com */
/* Specify the Report Suite ID(s) to track here */
var s_account=omnEnvObj.getEnv() + omnAccountSiteObj.getSite() + omnLocaleObj.getLocale()
var s=s_gi(s_account)
/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */
/* E-commerce Config */
s.currencyCode="USD"
/* Link Tracking Config */
s.trackDownloadLinks=true
s.trackExternalLinks=true
s.trackInlineStats=true
s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls,ics"
//s.linkInternalFilters="javascript:,z.com,xterra.com,nissanmotoracceptance.com,nissanmotors.com,nissan-usa.com,nissandriven.com,nissanowner.com,nissan-na.com,nissanusa.com"
s.linkInternalFilters="javascript:,nissanusa.com/,infinitiusaretailers.com/,infinitiusa.com/"
s.linkLeaveQueryString=false
s.linkTrackVars="None"
s.linkTrackEvents="None"
s.fpcdomain=omnDomainSiteObj.getSite();
s.fpcsubdomain="metrics"
s.sslfpcsubdomain="smetrics"
s.vmk="43D8135C"
s.maxFlashVersion="9"
currentSite=location.href
s.variableProvider=omnGetDoubleclickSite();

/* WARNING: Changing any of the below variables will cause drastic
changes to how your visitor data is collected.  Changes should only be
made when instructed to do so by your account manager.*/
//s.fpcdomain=omnDomainSiteObj.getSite(); //Custom Code to grab current domain
s.trackingServer="metrics."+s.fpcdomain;
s.trackingServerSecure="smetrics."+s.fpcdomain;
s.dc=112

/* Plugin Config */
s.usePlugins=true
function s_doPlugins(s) {
	/* Add calls to plugins here */


    // We need to set the appropriate campaign variables into prop38.  This is either a concatenation of dcp+dcc or Site+Area+Creative
    // or possibly CMP.  If we do NOT have a 'dcn' parameter, then we also set these values into eVar25.  If there IS a 'dcn' parameter,
    // this signifies that the link came from a doubleclick national campaign, and we will expect the DC/omn integration to fill in eVar25
    // instead.

    if (s.getQueryParam('dcp','') == '' && s.getQueryParam('dcc','') == '')
    {
        s.prop38=(s.getQueryParam('Site','')=='' || /search.(infinitiusaretailers|infinitiusa|nissanusa).com/.test(location.host)) ? s.getQueryParam('CMP','') : (s.getQueryParam('Site','') + '.' + s.getQueryParam('Area','') + '.' + s.getQueryParam('Creative',''));
    } else {
        s.prop38=s.getQueryParam('dcp','') + s.getQueryParam('dcc','');
    }

    s.prop38=s.getValOnce(s.prop38,'camp',0);

    s.eVar30= s.prop38;

    if (s.getQueryParam('dcn','') == '') {
        s.eVar25 = s.prop38;
    }

	// array of possible querystring value/prop42 value pairs, add/delete as needed
	var newArr = [
        ['cpi','CPO_Ad'],
        ['cpn','CPO_Ad'],
        ['dwi','Dealer_Website'],
        ['dwn','Dealer_Website'],
        ['ebr','eBrochure'],
        ['mci','Multi-cultural_Ad'],
        ['mcn','Multi-cultural_Ad'],    
        ['nml','Corporate_Referral'],   
        ['oii','Opt-In_Incentive'],
        ['oin','National_Ad'],
        ['oir','Regional_Ad'],
        ['omd','National_Ad'],
        ['oth','Other_Ad'],
        ['pages','YellowPages'],
        ['partner','Partner_Ad'],
        ['ppi','Paid_Search_National'],
        ['ppn','Paid_Search_National'],
        ['ppr','Paid_Search_Regional'],
        ['ppy','Paid_Inclusion'],
        ['snx','Social_Network'],
        ['taf','Tell-a-Friend'],
        ['tqd','National_Email'],
        ['vdx','Vanity_Domain'],
        ['widget','Widget'],
        ['yp','YellowPages'],
        ['zmm','Regional_Ad'],
        ['zmn','National_Ad']
        ];

	var p=s.prop38;
	var varFirst = s.getVisitStart("visitStart");
	var valFound = false;
	// possible "National Email" values for prop42
	var arrNatlEmail = ['n0','n1','i0','i1'];

	if(varFirst){

		for(i=0;i<arrNatlEmail.length;i++){
			if(s.getQueryParam('site','').indexOf(arrNatlEmail[i])!=-1){
				s.prop42='National_Email';
				valFound=true;
			}
		}

	for(i=0;i<newArr.length;i++){
		if(p.indexOf(newArr[i][0])>-1){
			s.prop42=newArr[i][1];
			valFound=true;
		}
	}

	if(valFound==false){
		if((p==null) || (p=='')){
			s.prop42='VISTA';
		}else{
			s.prop42='Unknown_Ad';
		}
	}

	}else{
		s.prop42='';
	}

    s.prop36='';

	
	if(s.prop7 != '')
	{
		if(s.prop1!=undefined && s.prop1.toLowerCase() == 'regional' )
		{
			s.prop12= s.prop3+ '_' + s.prop7;
		}
		else{
			s.prop12 = 'National_' + s.prop7;
		}
		s.eVar12 = s.prop12;
	}
	

    s.eVar4=s.getQueryParam('intcmp','');
	s.eVar4=s.getValOnce(s.eVar4,'evar4',0);
	if (s.eVar4!=''){
		s.prop36= s.getValOnce('promo.'+s.eVar4,'evar4',0);
	}

	s.eVar5=s.getQueryParam('tool','');
	s.eVar5=s.getValOnce(s.eVar5,'evar5',0);
	if (s.eVar5!=''){
	s.prop36= s.getValOnce('toolbox.'+s.eVar5,'evar5',0);
	}

	s.eVar13=s.getQueryParam('rdx','');
	s.eVar13=s.getValOnce(s.eVar13,'evar13',0);
	if (s.eVar13!=''){
	s.prop36= s.getValOnce('redirect.'+s.eVar13,'evar13',0);
	}
	


    s.eVar38=s.getQueryParam('next','');
    s.eVar38=s.getValOnce(s.eVar38,'next',0);
    if (s.eVar38!=''){
    s.prop36= s.getValOnce('next_step.'+s.eVar38,'evar38',0);
    }

    s.eVar33=s.getQueryParam('offer','');
	s.eVar33=s.getValOnce(s.eVar33,'offer',0);


 	if (s.prop40==''){
    	 s.prop40=s.getQueryParam('nvx','');
 	}


	/*
	 * Changed to match
	 */
    s.prop41=s.detectFlash('s_fv');

    // Added to support sending omniture properties to OpinionLab
    s.createOpinionLabObject();

    // Added to support call to doubleclick
    s.partnerDFACheck('dfa','dcn','prop23');
}
s.doPlugins=s_doPlugins




/************************** PLUGINS SECTION *************************/
/* You may insert any plugins you wish to use here.                 */

/*
 * Plugin: getVisitStart v2.0 - returns 1 on first page of visit
 * otherwise 0
 */
s.getVisitStart=new Function("c",""
+"var s=this,v=1,t=new Date;t.setTime(t.getTime()+1800000);if(s.c_r(c"
+")){v=0}if(!s.c_w(c,1,t)){s.c_w(c,1,0)}if(!s.c_r(c)){v=0}return v;");

/*
 * Plugin: getQueryParam 1.3 - Return query string parameter values
 */
s.getQueryParam=new Function("qp","d",""
+"var s=this,v='',i,t;d=d?d:'';while(qp){i=qp.indexOf(',');i=i<0?qp.l"
+"ength:i;t=s.gcgi(qp.substring(0,i));if(t)v+=v?d+t:t;qp=qp.substring"
+"(i==qp.length?i:i+1)}return v");
s.gcgi=new Function("k",""
+"var v='',s=this;if(k&&s.wd.location.search){var q=s.wd.location.sea"
+"rch.toLowerCase(),qq=q.indexOf('?');q=qq<0?q:q.substring(qq+1);v=s."
+"pt(q,'&','cgif',k.toLowerCase())}return v");
s.cgif=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),sk=i<0?t:t.substring(0,i),sv=i<0?"
+"'True':t.substring(i+1);if(sk.toLowerCase()==k)return s.epa(sv)}ret"
+"urn ''");

/*
 * Plugin: getValOnce 0.2 - get a value once per session or number of days
 */
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");

/*
 * Plugin: Flash Detection 0.4 - Detect Flash version number
 */
s.detectFlash=new Function("cn",""
+"var s=this,fv=-1,dwi=0,r,w,mt=s.n.mimeTypes;if(cn&&s.c_r(cn))return"
+" s.c_r(cn);if(s.pl&&s.pl.length){if(s.pl['Shockwave Flash 2.0'])fv="
+"2;x=s.pl['Shockwave Flash'];if(x){fv=0;z=x.description;if(z)fv=z.su"
+"bstring(16,z.indexOf('.'));}}else if(mt&&mt.length){x=mt['applicati"
+"on/x-shockwave-flash'];if(x&&x.enabledPlugin)fv=0;}if(fv<=0)dwi=1;w"
+"=s.u.indexOf('Win')!=-1?1:0;if(dwi&&s.isie&&w&&execScript){result=f"
+"alse;for(var i=s.maxFlashVersion;i>=3&&result!=true;i--){execScript"
+"('on error resume next: result = IsObject(CreateObject(\"ShockwaveF"
+"lash.ShockwaveFlash.'+i+'\"))','VBScript');fv=i;}}r=fv==-1?'flash n"
+"ot detected':fv==0?'flash enabled (no version)':'flash '+fv;s.c_w(c"
+"n,r,0);return r;");

/*
 * Plugin: Create Partner Object for OpinionLab integration
 * Make sure call to this plugin is done after any prop/evar changes
 */
s.createOpinionLabObject=new Function(""
+"var p=this,t,x,z=0,y,d=',';omtr_opinionlab=new Object();p.vl='pageN"
+"ame,pageURL,referrer,purchaseID,channel,server,pageType,campaign,st"
+"ate,zip,events,products,linkName,linkType';for(var n=1;n<51;n++)p.v"
+"l+=',prop'+n+',eVar'+n+',hier'+n;t=x=p.vl;while(t){y=t.indexOf(d);y"
+"=y<0?t.length:y;t=t.substring(0,y);omtr_opinionlab[t]=p[t];z+=y+d.l"
+"ength;t=x.substring(z,x.length);t=z<x.length?t:''}");

/*
 * Partner Plugin: DFA Check 0.6 - Restrict DFA calls to once a visit,
 * per report suite, per click through. Used in conjunction with VISTA
 */
s.partnerDFACheck=new Function("c","src","p",""
+"var s=this,dl=',',cr,nc,q,g,i,j,k,fnd,v=1,t=new Date,cn=0,ca=new Ar"
+"ray,aa=new Array,cs=new Array;t.setTime(t.getTime()+1800000);cr=s.c"
+"_r(c);if(cr){v=0}ca=s.split(cr,dl);aa=s.split(s.un,dl);for(i=0;i<aa"
+".length;i++){fnd=0;for(j=0;j<ca.length;j++){if(aa[i]==ca[j]){fnd=1}"
+"}if(!fnd){cs[cn]=aa[i];cn++}}if(cs.length){for(k=0;k<cs.length;k++)"
+"{nc=(nc?nc+dl:'')+cs[k]}cr=(cr?cr+dl:'')+nc;s.vpr(p,nc);v=1}q=s.wd."
+"location.search.toLowerCase();g=q.indexOf(src.toLowerCase()+'=');if"
+"(g>0){s.vpr(p,cr);v=1}if(!s.c_w(c,cr,t)){s.c_w(c,cr,0)}if(!s.c_r(c)"
+"){v=0}if(v<1)s.vpr('variableProvider','')");

s.vpr=new Function("vs","v",
"var s=this,k=vs.substring(0,2)=='s.'?vs.substring(2):vs;s['vpv_'+k]="
+"v;s['vpm_'+k]=1");

/*
 * Utility Function: split v1.5 - split a string (JS 1.0 compatible)
 * REQUIRED for the above partnerDFACheck function (omn/doubleclick integration)
 */
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");


/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_objectID;function s_c2fe(f){var x='',s=0,e,a,b,c;while(1){e=
f.indexOf('"',s);b=f.indexOf('\\',s);c=f.indexOf("\n",s);if(e<0||(b>=
0&&b<e))e=b;if(e<0||(c>=0&&c<e))e=c;if(e>=0){x+=(e>s?f.substring(s,e):
'')+(e==c?'\\n':'\\'+f.substring(e,e+1));s=e+1}else return x
+f.substring(s)}return f}function s_c2fa(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}function s_c2f(cc){cc=''+cc;var fc='var f=new Function(',s=
cc.indexOf(';',cc.indexOf('{')),e=cc.lastIndexOf('}'),o,a,d,q,c,f,h,x
fc+=s_c2fa(cc)+',"var s=new Object;';c=cc.substring(s+1,e);s=
c.indexOf('function');while(s>=0){d=1;q='';x=0;f=c.substring(s);a=
s_c2fa(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_c2fe(c.substring(o+1,e))+'")'
+c.substring(e+1);s=c.indexOf('function')}fc+=s_c2fe(c)+';return s");'
eval(fc);return f}function s_gi(un,pg,ss){var c="function s_c(un,pg,s"
+"s){var s=this;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.w"
+"d.s_c_in++;s.m=function(m){return (''+m).indexOf('{')<0};s.fl=funct"
+"ion(x,l){return x?(''+x).substring(0,l):x};s.co=function(o){if(!o)r"
+"eturn o;var n=new Object,x;for(x in o)if(x.indexOf('select')<0&&x.i"
+"ndexOf('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=function(x,o,n){var i=x.indexOf(o);wh"
+"ile(x&&i>=0){x=x.substring(0,i)+n+x.substring(i+o.length);i=x.index"
+"Of(o,i+n.length)}return x};s.ape=function(x){var s=this,i;x=x?s.rep"
+"(escape(''+x),'+','%2B'):x;if(x&&s.charSet&&s.em==1&&x.indexOf('%u'"
+")<0&&x.indexOf('%U')<0){i=x.indexOf('%');while(i>=0){i++;if(('89ABC"
+"DEFabcdef').indexOf(x.substring(i,i+1))>=0)return x.substring(0,i)+"
+"'u00'+x.substring(i);i=x.indexOf('%',i)}}return x};s.epa=function(x"
+"){var s=this;return x?unescape(s.rep(''+x,'+',' ')):x};s.pt=functio"
+"n(x,d,f,a){var s=this,t=x,z=0,y,r;while(t){y=t.indexOf(d);y=y<0?t.l"
+"ength:y;t=t.substring(0,y);r=s.m(f)?s[f](t,a):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.fs"
+"g!=''?',':'')+t;return 0};s.fs=function(x,f){var s=this;s.fsg='';s."
+"pt(x,',','fsf',f);return s.fsg};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.coo"
+"kieDomainPeriods;if(d&&!s.c_d){n=n?parseInt(n):2;n=n>2?n:2;p=d.last"
+"IndexOf('.');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.ind"
+"exOf(' '+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=functi"
+"on(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!=''?parseI"
+"nt(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.e"
+"hl;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;if(s.apv>=5&&(!s.isopera||s.apv>=7))eval('t"
+"ry{r=s.m(f)?s[f](a):f(a)}catch(e){r=s.m(t)?s[t](e):t(e)}');else{if("
+"s.ismac&&s.u.indexOf('MSIE 4')>=0)r=s.m(b)?s[b](a):b(a);else{s.eh(s"
+".wd,'onerror',0,o);r=s.m(f)?s[f](a):f(a);s.eh(s.wd,'onerror',1)}}re"
+"turn r};s.gtfset=function(e){var s=this;return s.tfs};s.gtfsoe=new "
+"Function('e','var s=s_c_il['+s._in+'];s.eh(window,\"onerror\",1);s."
+"etfs=1;var c=s.t();if(c)s.d.write(c);s.etfs=0;return true');s.gtfsf"
+"b=function(a){return window};s.gtfsf=function(w){var s=this,p=w.par"
+"ent,l=w.location;s.tfs=w;if(p&&p.location!=l&&p.location.host==l.ho"
+"st){s.tfs=p;return s.gtfsf(s.tfs)}return s.tfs};s.gtfs=function(){v"
+"ar s=this;if(!s.tfs){s.tfs=s.wd;if(!s.etfs)s.tfs=s.cet('gtfsf',s.tf"
+"s,'gtfset',s.gtfsoe,'gtfsfb')}return s.tfs};s.ca=function(){var s=t"
+"his,imn='s_i_'+s.fun;if(s.d.images&&s.apv>=3&&(!s.isopera||s.apv>=7"
+")&&(s.ns6<0||s.apv>=6.1)){s.ios=1;if(!s.d.images[imn]&&(!s.isns||(s"
+".apv<4||s.apv>=5))){s.d.write('<im'+'g class=\"omnReportImg\" name=\"'+imn+'\" height=1 wi" // added class for custom style -Designory
+"dth=1 border=0 alt=\"\">');if(!s.d.images[imn])s.ios=0}}};s.mr=func"
+"tion(sess,q,ta){var s=this,dc=s.dc,t1=s.trackingServer,t2=s.trackin"
+"gServerSecure,ns=s.visitorNamespace,unc=s.rep(s.fun,'_','-'),imn='s"
+"_i_'+s.fun,im,b,e,rs='http'+(s.ssl?'s':'')+'://'+(t1?(s.ssl&&t2?t2:"
+"t1):((ns?ns:(s.ssl?'102':unc))+'.'+(s.dc?s.dc:112)+'.2o7.net'))+'/b"
+"/ss/'+s.un+'/1/H.9-pdvu-2/'+sess+'?[AQB]&ndh=1'+(q?q:'')+(s.q?s.q:'"
+"')+'&[AQE]';if(s.isie&&!s.ismac){if(s.apv>5.5)rs=s.fl(rs,4095);else"
+" rs=s.fl(rs,2047)}if(s.ios||s.ss){if (!s.ss)s.ca();im=s.wd[imn]?s.w"
+"d[imn]:s.d.images[imn];if(!im)im=s.wd[imn]=new Image;im.src=rs;if(r"
+"s.indexOf('&pe=')>=0&&(!ta||ta=='_self'||ta=='_top'||(s.wd.name&&ta"
+"==s.wd.name))){b=e=new Date;while(e.getTime()-b.getTime()<500)e=new"
+" Date}return ''}return '<im'+'g class=\"omnReportImg\" sr'+'c=\"'+rs+'\" width=1 height=1 " // added class for custom style -Designory
+"border=0 alt=\"\">'};s.gg=function(v){var s=this;return s.wd['s_'+v"
+"]};s.glf=function(t,a){if(t.substring(0,2)=='s_')t=t.substring(2);v"
+"ar s=this,v=s.gg(t);if(v)s[t]=v};s.gl=function(v){var s=this;s.pt(v"
+",',','glf',0)};s.gv=function(v){var s=this;return s['vpm_'+v]?s['vp"
+"v_'+v]:(s[v]?s[v]:'')};s.havf=function(t,a){var s=this,b=t.substrin"
+"g(0,4),x=t.substring(4),n=parseInt(x),k='g_'+t,m='vpm_'+t,q=t,v=s.l"
+"inkTrackVars,e=s.linkTrackEvents;s[k]=s.gv(t);if(s.lnk||s.eo){v=v?v"
+"+','+s.vl_l:'';if(v&&!s.pt(v,',','isf',t))s[k]='';if(t=='events'&&e"
+")s[k]=s.fs(s[k],e)}s[m]=0;if(t=='visitorID')q='vid';else if(t=='pag"
+"eURL')q='g';else if(t=='referrer')q='r';else if(t=='vmk')q='vmt';el"
+"se if(t=='charSet'){q='ce';if(s[k]&&s.em==2)s[k]='UTF-8'}else if(t="
+"='visitorNamespace')q='ns';else if(t=='cookieDomainPeriods')q='cdp'"
+";else if(t=='cookieLifetime')q='cl';else if(t=='variableProvider')q"
+"='vvp';else if(t=='currencyCode')q='cc';else if(t=='channel')q='ch'"
+";else if(t=='campaign')q='v0';else if(s.num(x)) {if(b=='prop')q='c'"
+"+n;else if(b=='eVar')q='v'+n;else if(b=='hier'){q='h'+n;s[k]=s.fl(s"
+"[k],255)}}if(s[k]&&t!='linkName'&&t!='linkType')s.qav+='&'+q+'='+s."
+"ape(s[k]);return ''};s.hav=function(){var s=this;s.qav='';s.pt(s.vl"
+"_t,',','havf',0);return s.qav};s.lnf=function(t,h){t=t?t.toLowerCas"
+"e():'';h=h?h.toLowerCase():'';var te=t.indexOf('=');if(t&&te>0&&h.i"
+"ndexOf(t.substring(te+1))>=0)return t.substring(0,te);return ''};s."
+"ln=function(h){var s=this,n=s.linkNames;if(n)return s.pt(n,',','lnf"
+"',h);return ''};s.ltdf=function(t,h){t=t?t.toLowerCase():'';h=h?h.t"
+"oLowerCase():'';var qi=h.indexOf('?');h=qi>=0?h.substring(0,qi):h;i"
+"f(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():'';i"
+"f(t&&h.indexOf(t)>=0)return 1;return 0};s.lt=function(h){var s=this"
+",lft=s.linkDownloadFileTypes,lef=s.linkExternalFilters,lif=s.linkIn"
+"ternalFilters;lif=lif?lif:s.wd.location.hostname;h=h.toLowerCase();"
+"if(s.trackDownloadLinks&&lft&&s.pt(lft,',','ltdf',h))return 'd';if("
+"s.trackExternalLinks&&(lef||lif)&&(!lef||s.pt(lef,',','ltef',h))&&("
+"!lif||!s.pt(lif,',','ltef',h)))return 'e';return ''};s.lc=new Funct"
+"ion('e','var s=s_c_il['+s._in+'],b=s.eh(this,\"onclick\");s.lnk=s.c"
+"o(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;if(s.d&&s.d.all&&s.d.all.c"
+"ppXYctnr)return;s.eo=e.srcElement?e.srcElement:e.target;eval(\"try{"
+"if(s.eo&&(s.eo.tagName||s.eo.parentElement||s.eo.parentNode))s.t()}"
+"catch(f){}\");s.eo=0');s.ot=function(o){var a=o.type,b=o.tagName;re"
+"turn (a&&a.toUpperCase?a:b&&b.toUpperCase?b:o.href?'A':'').toUpperC"
+"ase()};s.oid=function(o){var s=this,t=s.ot(o),p=o.protocol,c=o.oncl"
+"ick,n='',x=0;if(!o.s_oid){if(o.href&&(t=='A'||t=='AREA')&&(!c||!p||"
+"p.toLowerCase().indexOf('javascript')<0))n=o.href;else if(c){n=s.re"
+"p(s.rep(s.rep(s.rep(''+c,\"\\r\",''),\"\\n\",''),\"\\t\",''),' ',''"
+");x=2}else if(o.value&&(t=='INPUT'||t=='SUBMIT')){n=o.value;x=3}els"
+"e 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)+',':'';return u&&u.indexOf(','+un+',')>"
+"=0?s.epa(t.substring(e+1)):''};s.rq=function(un){var s=this,c=un.in"
+"dexOf(','),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.inde"
+"xOf('='),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)s.sqq[s.squ"
+"[x]]+=(s.sqq[s.squ[x]]?',':'')+x;for(x in s.sqq)if(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.indexO"
+"f(\"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.visitor"
+"SamplingGroup,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))ret"
+"urn n}return 0};s.uns=function(){var s=this,x=s.dynamicAccountSelec"
+"tion,l=s.dynamicAccountList,m=s.dynamicAccountMatch,n,i;s.un.toLowe"
+"rCase();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){s.un=un;if(!s.oun)s.oun=un;else if((','+s.oun+',').in"
+"dexOf(un)<0)s.oun+=','+un;s.uns()};s.t=function(){var s=this,trk=1,"
+"tm=new Date,sed=Math&&Math.random?Math.floor(Math.random()*10000000"
+"000000):tm.getTime(),sess='s'+Math.floor(tm.getTime()/10800000)%10+"
+"sed,yr=tm.getYear(),vt=tm.getDate()+'/'+tm.getMonth()+'/'+(yr<1900?"
+"yr+1900:yr)+' '+tm.getHours()+':'+tm.getMinutes()+':'+tm.getSeconds"
+"()+' '+tm.getDay()+' '+tm.getTimezoneOffset(),tfs=s.gtfs(),ta='',q="
+"'',qs='';s.uns();if(!s.q){var tl=tfs.location,x='',c='',v='',p='',b"
+"w='',bh='',j='1.0',k=s.c_w('s_cc','true',0)?'Y':'N',hp='',ct='',pn="
+"0,ps;if(s.apv>=4)x=screen.width+'x'+screen.height;if(s.isns||s.isop"
+"era){if(s.apv>=3){j='1.1';v=s.n.javaEnabled()?'Y':'N';if(s.apv>=4){"
+"j='1.2';c=screen.pixelDepth;bw=s.wd.innerWidth;bh=s.wd.innerHeight;"
+"if(s.apv>=4.06)j='1.3'}}s.pl=s.n.plugins}else if(s.isie){if(s.apv>="
+"4){v=s.n.javaEnabled()?'Y':'N';j='1.2';c=screen.colorDepth;if(s.apv"
+">=5){bw=s.d.documentElement.offsetWidth;bh=s.d.documentElement.offs"
+"etHeight;j='1.3';if(!s.ismac&&s.b){s.b.addBehavior('#default#homePa"
+"ge');hp=s.b.isHomePage(tl)?\"Y\":\"N\";s.b.addBehavior('#default#cl"
+"ientCaps');ct=s.b.connectionType}}}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.q=(x?'&s='+s.ape(x):'')+(c?'&c='+s.ape(c):'')+(j?'&j='+j"
+":'')+(v?'&v='+v:'')+(k?'&k='+k:'')+(bw?'&bw='+bw:'')+(bh?'&bh='+bh:"
+"'')+(ct?'&ct='+s.ape(ct):'')+(hp?'&hp='+hp:'')+(p?'&p='+s.ape(p):''"
+")}if(s.usePlugins)s.doPlugins(s);var l=s.wd.location,r=tfs.document"
+".referrer;if(!s.pageURL)s.pageURL=s.fl(l?l:'',255);if(!s.referrer)s"
+".referrer=s.fl(r?r:'',255);if(s.lnk||s.eo){var o=s.eo?s.eo:s.lnk;if"
+"(!o)return '';var p=s.gv('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.parent"
+"Element?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_g"
+"s(\")>=0&&oc.indexOf(\".s_oc(\")<0)||oc.indexOf(\".tl(\")>=0)return"
+" ''}ta=n?o.target:1;h=o.href?o.href:'';i=h.indexOf('?');h=s.linkLea"
+"veQueryString||i<0?h:h.substring(0,i);l=s.linkName?s.linkName:s.ln("
+"h);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."
+"gv('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 '';if(s.p_r)s.p_r()"
+";var code='';if(trk&&s.vs(sed))code=s.mr(sess,(vt?'&t='+s.ape(vt):'"
+"')+s.hav()+q+(qs?qs:s.rq(s.un)),ta);s.sq(trk?'':qs);s.lnk=s.eo=s.li"
+"nkName=s.linkType=s.wd.s_objectID=s.ppu='';return code};s.tl=functi"
+"on(o,t,n){var s=this;s.lnk=s.co(o);s.linkType=t;s.linkName=n;s.t()}"
+";s.ssl=(s.wd.location.protocol.toLowerCase().indexOf('https')>=0);s"
+".d=document;s.b=s.d.body;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.ind"
+"exOf('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)}el"
+"se if(s.ns6>0)s.apv=parseFloat(s.u.substring(s.ns6+10));else s.apv="
+"parseFloat(v);s.em=0;if(String.fromCharCode){i=escape(String.fromCh"
+"arCode(256)).toUpperCase();s.em=(i=='%C4%80'?2:(i=='%U0100'?1:0))}s"
+".sa(un);s.vl_l='visitorID,vmk,ppu,charSet,visitorNamespace,cookieDo"
+"mainPeriods,cookieLifetime,pageName,pageURL,referrer,currencyCode,p"
+"urchaseID';s.vl_t=s.vl_l+',variableProvider,channel,server,pageType"
+",campaign,state,zip,events,products,linkName,linkType';for(var n=1;"
+"n<51;n++)s.vl_t+=',prop'+n+',eVar'+n+',hier'+n;s.vl_g=s.vl_t+',trac"
+"kDownloadLinks,trackExternalLinks,trackInlineStats,linkLeaveQuerySt"
+"ring,linkDownloadFileTypes,linkExternalFilters,linkInternalFilters,"
+"linkNames';if(pg)s.gl(s.vl_g);s.ss=ss;if(!ss){s.wds();s.ca()}}",
l=window.s_c_il,n=navigator,u=n.userAgent,v=n.appVersion,e=v.indexOf(
'MSIE '),m=u.indexOf('Netscape6/'),a,i,s;if(l)for(i=0;i<l.length;i++){
s=l[i];if(s.oun==un)return s;else if(s.fs(s.oun,un)){s.sa(un);return s
}}if(e>0){a=parseInt(i=v.substring(e+5));if(a>3)a=parseFloat(i)}
else if(m>0)a=parseFloat(u.substring(m+10));else a=parseFloat(v);if(a
>=5&&v.indexOf('Opera')<0&&u.indexOf('Opera')<0){eval(c);return new
s_c(un,pg,ss)}else s=s_c2f(c);return s(un,pg,ss)}


/* OnlineOpinion (S3t,1424b) */
/* This product and other products of OpinionLab, Inc. are protected by U.S. Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
var omtr_qsv='',custom_var,_sp='%3A\\/\\/',_rp='%3A//',_poE=0.0, _poX=0.0,_sH=screen.height,_d=document,_w=window,_ht=escape(_w.location.href),_hr=_d.referrer,_tm=(new Date()).getTime(),_kp=0,_sW=screen.width;_d.onkeypress=_fK;
function _fK(_e){if(!_e)_e=_w.event;var _k=(typeof _e.which=='number')?_e.which:_e.keyCode;if((_kp==15&&_k==12))_w.open('https://secure.opinionlab.com/pageviewer/pv_controlboard.html?url='+_fC(_ht),'PageViewer','height=529,width=705,screenX='+((_sW-705)/2)+',screenY='+((_sH-529)/2)+',top='+((_sH-529)/2)+',left='+((_sW-705)/2)+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes');_kp=_k};
function _fC(_u){_aT=_sp+',\\/,\\.,-,_,'+_rp+',%2F,%2E,%2D,%5F';_aA=_aT.split(',');for(i=0;i<5;i++){eval('_u=_u.replace(/'+_aA[i]+'/g,_aA[i+5])')}return _u};
//function O_LC(){_w.open('http://ccc01.opinionlab.com/comment_card.asp?time1='+_tm+'&time2='+(new Date()).getTime()+'&prev='+_fC(escape(_hr))+'&referer='+_fC(_ht)+'&height='+_sH+'&width='+_sW+'&custom_var='+custom_var+omtr_qsv,'comments','width=535,height=192,screenX='+((_sW-535)/2)+',screenY='+((_sH-192)/2)+',top='+((_sH-192)/2)+',left='+((_sW-535)/2)+',resizable=yes,copyhistory=yes,scrollbars=no');return false;};

function O_LC(){};

function _fPe(){if(Math.random()>=1.0-_poE){O_LC();_poX=0.0}};
function _fPx(){if(Math.random()>=1.0-_poX)O_LC()};window.onunload=_fPx;
//function O_GoT(_p){_d.write('<a href=\'javascript:O_LC()\' class=\'glArrow\'>'+_p+'</a>');_fPe()}
if(typeof omtr_opinionlab=='object'){var obj=omtr_opinionlab;for(var i in obj){if(typeof obj[i]!='undefined'&&obj[i]!='')omtr_qsv+='&omtr_'+i+'='+escape(obj[i])}}


var olLocalObj = new CrmLocaleClass ({
	es:'Spanish',
	en:''
});
var olSiteObj = new CrmSiteClass ({
	nissan:		'Nissan'+olLocalObj.getLocale(),
	infiniti:	'Infiniti'
});

var olMojoId=0;
var olIsStateUpdated=false;
var olIsIconDrawn=false;
var olImgBase=''; // set in olCreateFloatingPlus since it's called onload

function olUpdateState(pageName,channel,prop10){
	olIsStateUpdated=(crmPageLocale=="en");
	_hr=window.location.href;
	_ht = location.href.replace(/(http:\/\/.+?)[\/#$\?].*/,'$'+'1/') + pageName + '.html'; //do not escape here. it's escaped later.
	custom_var=prop10+'|'+channel+'|'+pageName;
}
String.prototype.format=function(){
	var ar=arguments;
	return this.replace(/\{\d+\}/g,function(w){return ar[+w.replace(/[}{]/g,'')]});
}
function getChildNodesThatMatter(theNode){
	var cn=theNode.childNodes;
	var rv=[];
	for(var i=0;i<cn.length;i++){
		if(cn[i].nodeType==1){rv.push(cn[i])}
	}
	return rv;
}


//create floating plus
//create footer link 
var olTryCounter=0
function olCreateFooterLink(){
	//- ONLY ADD FOR remote nav.
	if((typeof isRemote != "undefined") && isRemote && olIsStateUpdated){
		if($('gFooter')){// refresh
     	// Do this only if global.js file is not included
     	if(jQuery('script[src$=global.js]').length==0) {
        var cn=getChildNodesThatMatter($('gFooter'));
  			var _a=document.createElement('a');
  			_a.href="#";
  			_a.innerHTML="Site Feedback";
  			_a.onclick=O_LC;
  			cn[1].parentNode.insertBefore(_a,cn[2]);
      }
		}else if($('footernav')){ // pre-refresh
			var cn=getChildNodesThatMatter($('footernav').parentNode.parentNode);
			var _li=document.createElement('li');
			var _a=document.createElement('a');
			_a.href="#";
			_a.innerHTML="Site Feedback";
			_a.onclick=O_LC;
			_li.appendChild(_a);
			cn[1].parentNode.insertBefore(_li,cn[1]);
		}else{
			olTryCounter++
			if(olTryCounter>20)return; // only try for 2 seconds, 10x per second.
			setTimeout("olCreateFooterLink",100);
			//alert("would have been a setTimeout")
		}
	};
}




function olCreateFloatingPlus(){
	//- ONLY ADD FOR remote nav.
	if((typeof isRemote != "undefined") && isRemote && olIsStateUpdated){
		olImgBase=(typeof infinitiRootSrc=='undefined')?'http://www.infinitiusa.com':infinitiRootSrc;
	
		if(!olIsStateUpdated){return;}
		var d=document.createElement("div");
		//d.outerHTML='<div style="background-color:red;width:100px;height:100px"></div>'
		d.id="olPlus";
		var _di=""
		var brows=(brows=="moz")?"pointer":"hand"; //should sniff, later, but this works.
		_di+='<img id="ol1" src="{0}/img/opinionlab/popns_en-US.gif">'.format(olImgBase);
		_di+='<img id="ol2" src="{0}/img/opinionlab/dot.gif">'.format(olImgBase);
		_di+='<img id="ol3" src="{0}/img/opinionlab/plus.gif">'.format(olImgBase);
		_di+='<img id="ol4" src="{0}/img/opinionlab/feedback.gif">'.format(olImgBase);
		d.innerHTML=_di;
		
		document.body.appendChild(d);
	}
	//- BUT add the functons either way.
	if($('ol1')) $('ol1').onmouseover=olMojo;
	if($('ol2')) $('ol2').onmouseover=olMojo;
	if($('ol3')) $('ol3').onmouseover=olMojo;
	if($('ol1')) $('ol1').onclick=O_LC;
	if($('ol2')) $('ol2').onclick=O_LC;
	if($('ol3')) $('ol3').onclick=O_LC;
	if($('ol4')) $('ol4').onclick=O_LC;
}
function olMojo(){
	window.clearTimeout(olMojoId);
	olMojoId=0;
	$('ol1').style.display="block";
	$('ol1').onmouseout=olNoMojo;
	$('ol2').style.display="block";
	$('ol2').onmouseout=olNoMojo;
	$('ol3').src="{0}/img/opinionlab/comment.gif".format(olImgBase);
	$('ol3').onmouseout=olNoMojo;
	$('ol4').style.display="none";
}
function olNoMojo(){
	olMojoId=window.setTimeout("olRemoveMojo()",5)
}
function olRemoveMojo(){
	$('ol1').style.display="none";
	$('ol2').style.display="none";
	$('ol3').src="{0}/img/opinionlab/plus.gif".format(olImgBase);
	$('ol4').style.display="block";
}
function olAddLoadEvents(){
	addLoadEvent(olCreateFloatingPlus);
	if(!olSiteObj.isNissan){
		addLoadEvent(olCreateFooterLink);
	}
}
//olAddLoadEvents();
var sgFrameWidth = 632;

//checking if the browser is InternetExplorer and if so displaying a different FrameWidth to fix the issue with the right border displaying behind the scroll bar
if(jQuery.browser.msie && jQuery.browser.version=="6.0" || jQuery.browser.msie && jQuery.browser.version=="7.0"){
	var sgFrameWidth = 605;
}

var currentURI = window.location.href;
var isStageEnv=false;
var sStageEnvServer='';
var sStageEnvServerSuffix='';
var nonSecurePath;

//Set Default Survey ID:
sgPageID = jQuery("meta[name='pageid']");
sgPageLocale = jQuery("meta[name='pagelocale']");

if(currentURI.indexOf('.infinitiusa.com') > -1){
	sgUpdateState("HZ6KOHI60Q5PG4R80C9DE578AVHDOG-231519|Default|17|14|15|12","Page=Page_Not_Yet_Loaded~TID=0~PID="+sgPageID+"_"+sgPageLocale);
}
else if(currentURI.indexOf('.nissanusa.com') > -1){
	sgUpdateState("RH53T0GNWMFZ1P9667A02DI0BVC0R8-166320|Default|17|14|15|12","Page=Page_Not_Yet_Loaded~TID=0~PID="+sgPageID+"_"+sgPageLocale);
}


if(currentURI.indexOf('.stage.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='stage';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.newdev.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='newdev';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.dev.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='dev';
	sStageEnvServerSuffix='designory.com';
}
else if(currentURI.indexOf('.qa1.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='qa1';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.qa2.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='qa2';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.qa.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='qa';
	sStageEnvServerSuffix='nna';
}
else if(currentURI.indexOf('search') > -1)
{
	isStageEnv=false;
	sStageEnvServer='search';
	sStageEnvServerSuffix='com';
}

if((currentURI.indexOf('.infinitiusa.com') > -1)||(currentURI.indexOf('.dev.') > -1))
{
	nonSecurePath =	(!isStageEnv) ?	"http://www.infinitiusa.com" : "http://www."+sStageEnvServer+".infinitiusa."+sStageEnvServerSuffix;
}
else if((currentURI.indexOf('.nissanusa.com') > -1)||(currentURI.indexOf('.dev.') > -1))
{
	nonSecurePath =	(!isStageEnv) ?	"http://www.nissanusa.com" : "http://www."+sStageEnvServer+".nissanusa."+sStageEnvServerSuffix;
}

var aaflag = 0;
var objFrameSrc;
var winW;
var winY;
var gizmoPid = jQuery("meta[name='pageid']");

// pages that is looking for the ID before addload event is called
if(gizmoPid == 16677){
		sgInit();
}

function makeFrame(getObj) {
   var aa = getObj;
   ifrm = document.createElement("IFRAME");
   ifrm.setAttribute("frameBorder","0");
   ifrm.setAttribute("src", aa);
   ifrm.style.width = 632+"px";
   ifrm.style.height = 480+"px";
   ifrm.id = ifrm.name = 'gzFrame';
   if(aaflag == 0){
		document.getElementById('putFrame').appendChild(ifrm);
   }
   aaflag = 1;
}

function sgUpdateState(surveyinfo,pagename){
	custom_var = surveyinfo;
	custom_query = pagename;
	objFrameSrc = "/sgframe.html";
	objFrameSrc = objFrameSrc + "?gizmo=" + custom_var + '::' + custom_query;
}

function gizmoHeight(gizmoHeight){
	var gHeight = 500 + 75;
}

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
	if (!ns4)
	return
	temp=eval(name)
	temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
	temp.onmousedown=gons
	temp.onmousemove=dragns
	temp.onmouseup=stopns
}

function gons(e){
	temp.captureEvents(Event.MOUSEMOVE)
	nsx=e.x
	nsy=e.y
}
function dragns(e){
	if (dragswitch==1){
		temp.moveBy(e.x-nsx,e.y-nsy)
		return false
	}
}

function stopns(){
	temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
	if (ie4&&dragapproved){
		crossobj.style.left=tempx+event.clientX-offsetx
		crossobj.style.top=tempy+event.clientY-offsety
		return false
	}
	else if (ns6&&dragapproved){
		crossobj.style.left=tempx+e.clientX-offsetx+"px"
		crossobj.style.top=tempy+e.clientY-offsety+"px"
		return false
	}
}

function initializedrag(e){
	crossobj=ns6? document.getElementById("showimage") : document.all.showimage
	var firedobj=ns6? e.target : event.srcElement
	var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
	
	while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
	}

	if (firedobj.id=="dragbar"){
		offsetx=ie4? event.clientX : e.clientX
		offsety=ie4? event.clientY : e.clientY

		tempx=parseInt(crossobj.style.left)
		tempy=parseInt(crossobj.style.top)

		dragapproved=true
		document.onmousemove=drag_drop
	}
}

document.onmouseup=new Function("dragapproved=false")

function hidebox(){
	//crossobj=ns6? document.getElementById("showimage") : document.all.showimage
	crossobj= document.getElementById("showimage");
	if (ie4||ns6)
	{crossobj.style.visibility="hidden"
	crossobj.style.display="none";}
	else if (ns4)
	document.showimage.visibility="hide"
}

function showbox(trkSource){	
	var additionalTracking = (trkSource=='trkGloablFeedBkSurvey') ? "&nvx=DefaultSurvey_Image" : "&nvx=DefaultSurvey_Footer";
	if(!(objFrameSrc.indexOf('nvx') > -1)){
		objFrameSrc = objFrameSrc + additionalTracking
	}
	makeFrame(objFrameSrc);
	document.getElementById('showimage').style.display = 'inline';

	var winY = 0;
	var winW = 0;
	if (window.innerWidth != undefined) {
		winW = window.innerWidth;
	} else if (document.body.clientWidth != undefined) {
		winW = document.body.clientWidth;
	} else {
		winW = document.documentElement.clientWidth;
	}
	if (document.documentElement.scrollTop != undefined) {
		winY = document.documentElement.scrollTop;
	} else if (document.body.scrollTop != undefined && document.body.scrollTop > 0) {
		winY = document.body.scrollTop;
	} else if (window.pageYOffset != undefined) {
		winY = window.pageYOffset;
	} else {
		winY = 0;
	}

	winW = (winW - sgFrameWidth)/2;

	document.getElementById('showimage').style.display = 'inline';
	crossobj=ns6? document.getElementById("showimage") : document.all.showimage

	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
	var dsocleft=document.all? iebody.scrollLeft : pageXOffset
	var dsoctop=document.all? iebody.scrollTop : pageYOffset
	var ieWidth	= document.body.clientWidth / 2;
	var FFWidth = parent.window.innerWidth / 2;

	dsocleft = ns6? (dsocleft + FFWidth - 320) : (dsocleft + ieWidth - 320) ;
	dsoctop = dsoctop +100;

	//crossobj=ns6? document.getElementById("showimage") : document.all.showimage
	crossobj=document.getElementById("showimage");

	if (ie4||ns6)
	crossobj.style.visibility="visible"
	else if (ns4)
	document.showimage.visibility="show"
}

function adjustSgFrame() {
	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body

	var dsocleft=document.all? iebody.scrollLeft : pageXOffset
	var dsoctop=document.all? iebody.scrollTop : pageYOffset

	var ieWidth	= document.body.clientWidth / 2;
	var FFWidth = parent.window.innerWidth / 2;

	dsocleft = ns6? (dsocleft + FFWidth - 320) : (dsocleft + ieWidth - 320) ;
	document.getElementById('sgFrameLayer').style.left=dsocleft+"px";
	
	ieWidth	= document.body.clientWidth;
	FFWidth = parent.window.innerWidth;
	dsocleft=document.all? iebody.scrollLeft : pageXOffset
	dsoctop=document.all? iebody.scrollTop : pageYOffset	
	
	if ((ieWidth < 1180) || (FFWidth < 1192)) {
		document.getElementById('gizmoS').style.left="1066px";
	} else {	
		dsocleft = ns6? (dsocleft + FFWidth - 126 ) : (dsocleft + ieWidth - 126) ;
		document.getElementById('gizmoS').style.right="";
		var msie = navigator.appVersion.split("MSIE");
		var ieVersion = parseFloat(msie[1]);
		var ie7OrLower = (!isNaN(ieVersion) && ieVersion<=7);
		if(ie7OrLower){
			dsocleft = -100;
		}		
		document.getElementById('gizmoS').style.left=dsocleft+"px";
	}
}

function sgInit(){
	var sgD1=document.createElement("div");
	sgD1.id="sgFrameLayer";
	//Survey Gizmo changes start
	sgD1.style.position="fixed";
	/*var LeftPosition = (screen.width) ? (screen.width-600)/2 : 0;
	sgD1.style.left=LeftPosition+'px';*/
	sgD1.style.top="40px";
	sgD1.style.zIndex="10000";
	//Survey Gizmo changes end
	var _sgdi="";
	var brows=(brows=="moz")?"pointer":"hand"; //should sniff, later, but this works.

		//Survey Gizmo changes start
		var msie = navigator.appVersion.split("MSIE");
		var ieVersion = parseFloat(msie[1]);
		var ie7OrLower = (!isNaN(ieVersion) && ieVersion<=7);

		if(ie7OrLower){
			sgD1.style.position="absolute";
			sgD1.className="sgFrameLayer";
		}
		//Survey Gizmo changes end

	_sgdi+='<div id="showimage" style="z-index: 100000;position:fixed;_position:absolute;width:'+sgFrameWidth+'px; border-left:14px solid #333333; border-right:14px solid #333333; border-bottom:14px solid #333333; display:none;"><table border="0" width="'+sgFrameWidth+'" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="0" height="36px"><tr><td bgcolor="#333333" id="dragbar" style="cursor:default"></td><td align="right" bgcolor="#333333" id="dragbar" style="cursor:default"><div style="height:20px;text-align:right;"><a href="#" onClick="hidebox();return false" style="color:#000000;"><img style="display:inline" src="'+nonSecurePath+'/img/surveygizmo/btn_close.gif" height="16" width="50" border="0"></a></div></td></tr><tr><td colspan="2"><div id="putFrame"></div></td></tr></table></td></tr></table></td></tr></table></div>';

	sgD1.innerHTML=_sgdi;
	document.body.appendChild(sgD1);

	if(Math.floor(Math.random()*300) ==1) { 
		sgUpdateState("HZ6KOHI60Q5PG4R80C9DE578AVHDOG-231519|Random|17|14|15|12","PageName=Random_Survey~TID=0~PID="+sgPageID+"_"+sgPageLocale);
		sgran = true;
		//showbox();
	}	
}

function sgShowImgLink(){
	var d=document.createElement("div");
	//d.outerHTML='<div style="background-color:red;width:100px;height:100px"></div>'
	d.id="sgcss";
	d.style.zIndex="1000";

	try{
		var fileref=document.createElement("link");
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", "/apps/nna/docroot/css/sgizmo.css");
		document.getElementsByTagName("head")[0].appendChild(fileref);
		d.className="sgcssIe7";
	}catch(e){
	}

	var _di="";
	var brows=(brows=="moz")?"pointer":"hand"; //should sniff, later, but this works.
	
	_di+='<div onclick="showbox(\'trkGloablFeedBkSurvey\');" style="cursor:pointer;position:fixed;_position:absolute;right:20px;bottom:19px;z-index:1000;" id="gizmoS"><img src="'+nonSecurePath+'/img/surveygizmo/feedback_icon.gif" onload="setOverSrc(this);"></div>';
	d.innerHTML=_di;
	document.body.appendChild(d);

	var msie = navigator.appVersion.split("MSIE");
	var ieVersion = parseFloat(msie[1]);
	var ie6OrLower = (!isNaN(ieVersion) && ieVersion<=6);

	//d.style.position='fixed';//removing for the fix for bluetooth
	if(ie6OrLower){
		//d.style.position='absolute';//removing for the fix for bluetooth
		d.className="sgcssIe6";
	}
	adjustSgFrame();	
}

function O_LC(){
	showbox();
	};

jQuery(document).ready(function(){
	sgInit();
	sgShowImgLink();
});

window.onresize=adjustSgFrame;

// $Id: factortg.js 69 2006-06-22 00:57:20Z rootl $

// ###  Associate Env URLS for this provider
var factortgEnvObj = new CrmEnvironmentClass ({
                                        dev:    'static.suitesmart.com/cs/sitetags/nissan/nna.js',
                                        qa:     'static.suitesmart.com/cs/sitetags/nissan/nna.js',
                                        stage:  'static.suitesmart.com/cs/sitetags/nissan/nna.js',
                                        prod:   'static.suitesmart.com/cs/sitetags/nissan/nna.js'});


// ###	Primary tag firing function
function pingFactortg ( eventNo, sPageName ) {
return false;
	crmCreateTag( 'script', 'head',
					{attrName:'language', attrValue: 'JavaScript'},
					{attrName:'src',	  attrValue: factortgEnvObj.getProtocol() + factortgEnvObj.getEnv() + "?" + "NNAID=" + eventNo + "&PLA=" + sPageName },
					{attrName:'ID',		  attrValue: 'FTG'+new Date().getTime()}
					);

}


// $Id: atlas.js 65 2006-06-21 20:31:51Z rootl $


//// ###	Associate Env URLS for this provider
// Doubleclick uses the same url for qa, stage and prod
var doubleclickEnvObj = new CrmEnvironmentClass ({
					dev:	'fls.doubleclick.net',
					qa:		'fls.doubleclick.net',
					stage:	'fls.doubleclick.net',
					prod:	'fls.doubleclick.net'});

// ###	Associate sites with provider specific strings
var doubleclickSiteObj = new CrmSiteClass ({
					nissan:		'1361549',
					infiniti:	'1361547'});


function pingDoubleclick ( type, cat, events ) {
    var axel = Math.random()+"";
    var a = axel * 10000000000000;

    var tagString = doubleclickEnvObj.getProtocol() + doubleclickEnvObj.getEnv() + '/activityi;src='+ doubleclickSiteObj.getSite() +';'
    tagString += 'type='+type+';'
    tagString += 'cat='+cat+';';
    tagString += events;
    tagString += 'ord=1;num='+ a + '?';


    crmCreateTag( 'iframe', $(crmTagBucketId),
                    {attrName:'src',	        attrValue: tagString },
                    {attrName:'id',		        attrValue: 'DoubleClickTag_'+new Date().getTime()},
                    {attrName:'height',	        attrValue: '1'},
                    {attrName:'width',	        attrValue: '1'},
                    {attrName:'frameborder',	attrValue: '0'} );
}
// ###      Applies custom event rules to the omniture object.
function dcCustEvents ( events ) {
      if (events=='') return;
      if ( events.indexOf('u1=true') || events.indexOf('u1=true') || events.indexOf('u1=true')) {
            events +='u6=true;';
            crmDebug('Doubleclick: Added "u6" to events\n\nevents = '+ events);
      }
}

f// ### URI ENFORCER ############################################################
var globalJsIsIndeedLoaded=true;
var currentURI = window.location.href;
var isInfinitiSite = ( location.hostname.indexOf('www.infinitiusa.com') > -1 ||
						location.hostname.indexOf('secure.infinitiusa.com') > -1  ||
						location.hostname.indexOf('stage.infinitiusa.com') > -1 ) ? true : false;
//var isStageEnv = (currentURI.indexOf('.stage.') > -1) ? true : false;
//s SDSR
var isStageEnv=false;
var sStageEnvServer='';
var sStageEnvServerSuffix='';
if(currentURI.indexOf('.stage.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='stage';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.dev.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='dev';
	sStageEnvServerSuffix='designory.com';
}
else if(currentURI.indexOf('.qa1.') > -1)
{
	isstageEnv=true;
	sStageEnvServer='qa1';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.qa2.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='qa2';
	sStageEnvServerSuffix='com';
}
else if(currentURI.indexOf('.qa.') > -1)
{
	isStageEnv=true;
	sStageEnvServer='qa';
	sStageEnvServerSuffix='nna';
}
//e SDSR

//  set paths for...                 Live site                       Staging environment
var securePath =    (!isStageEnv) ?	"https://secure.infinitiusa.com" : "https://www."+sStageEnvServer+".infinitiusa."+sStageEnvServerSuffix; //"https://www.stage.infinitiusa.com";
var nonSecurePath =	(!isStageEnv) ?	"http://www.infinitiusa.com"     : "http://www."+sStageEnvServer+".infinitiusa."+sStageEnvServerSuffix;  //"http://www.stage.infinitiusa.com";
if(currentURI.indexOf('129.33.85.202') > -1)
{
  securePath =    "https://129.33.85.202";
  nonSecurePath =	"http://129.33.85.202";
} else if(currentURI.indexOf('129.33.85.215') > -1)
{
  securePath =    "https://129.33.85.215";
  nonSecurePath =	"http://129.33.85.215";
}

var secureURIs = [

	// Ownership / My Infiniti
//	["http://www.infinitiusa.com/iapps/ownership",		"https://secure.infinitiusa.com/iapps/ownership"],
//	["https://www.infinitiusa.com/iapps/ownership",		"https://secure.infinitiusa.com/iapps/ownership"],
//	["http://secure.infinitiusa.com/iapps/ownership",		"https://secure.infinitiusa.com/iapps/ownership"],
//	["http://www.stage.infinitiusa.com/iapps/ownership",	"https://www.stage.infinitiusa.com/iapps/ownership"],

	// PreApproval
//	["http://www.infinitiusa.com/iapps/preapprovedinput",	"https://secure.infinitiusa.com/iapps/preapprovedinput"],
//	["https://www.infinitiusa.com/iapps/preapprovedinput",	"https://secure.infinitiusa.com/iapps/preapprovedinput"],
//	["http://secure.infinitiusa.com/iapps/preapprovedinput",	"https://secure.infinitiusa.com/iapps/preapprovedinput"],
//	["http://www.stage.infinitiusa.com/iapps/preapprovedinput","https://www.stage.infinitiusa.com/iapps/preapprovedinput"],

	// PreApproval - LDS
//	["http://www.infinitiusa.com/iapps/preapprovedconfirm",	"https://secure.infinitiusa.com/iapps/preapprovedconfirm"],
//	["https://www.infinitiusa.com/iapps/preapprovedconfirm",	"https://secure.infinitiusa.com/iapps/preapprovedconfirm"],
//	["http://secure.infinitiusa.com/iapps/preapprovedconfirm",	"https://secure.infinitiusa.com/iapps/preapprovedconfirm"],
//	["http://www.stage.infinitiusa.com/iapps/preapprovedconfirm","https://www.stage.infinitiusa.com/iapps/preapprovedconfirm"]

];

var secureURIfound = false;
//    push user to secure URI
if (isInfinitiSite && currentURI.indexOf('http://') > -1) {
	for (var i in secureURIs) {
		if (currentURI.indexOf(secureURIs[i][0]) > -1) {
			secureURIfound = true;
			location.replace(currentURI.replace(secureURIs[i][0],secureURIs[i][1]));
		}
	}
	// no secure URI found, check & pull user from bad http://secure URI
	if (!secureURIfound && currentURI.indexOf('http://secure.') > -1) {
		location.replace(currentURI.replace("http://secure.","http://www."));
	}
}
//    pull user from secure-svr
else if (isInfinitiSite && currentURI.indexOf('https://') > -1) {
	for (var i in secureURIs) {
		if (currentURI.indexOf(secureURIs[i][1]) > -1) {
			secureURIfound = true;
		}
	}
	// no secure URI found, check & pull user from bad https://www URI
	if (!secureURIfound && currentURI.indexOf('https://www.') > -1) {
		location.replace(currentURI.replace("https://www.","http://www."));
	}
	// else pull user from standard secure URI to non secure URI
	else if (!secureURIfound) {
		location.replace(currentURI.replace(securePath,nonSecurePath));
	}
}

if (currentURI.indexOf('.infinitiusaretailers.com') > -1 &&
    currentURI.indexOf('/iapps/retailerlocator') == -1 &&
		!/dealerzip=/.test(currentURI) &&
		!/city=(.*)&state=(.*)/.test(currentURI)) {
	location.replace(currentURI.replace(".infinitiusaretailers.com",".infinitiusa.com"));
}

// #############################################################################

/* GLOBAL SCRIPTS */

				// Function to safely register multiple functions with the onLoad browser event
				function addLoadEvent(func) {
					var oldonload = window.onload;
					if (typeof window.onload != 'function') window.onload = func;
					else {
						window.onload = function() {
							oldonload();
							func();
						}
					}
				}

				// Shortcut getID function
				function $(ee) {
					return document.getElementById(ee);
				}

// Schricker's format
String.prototype.format=function(){
	var ar=arguments;
	return this.replace(/\{\d+\}/g,function(w){return ar[+w.replace(/[}{]/g,'')]});
}

				// Shortuct to innerHTML
				// used on Payment Estimator - only?
				function getHtml(elmId) {
					return $( elmId ).innerHTML;
				}

				// Modifier for innerHTML
				// used on config colors/packages pages
				function setHtml(elmId, strContent) {
					$( elmId ).innerHTML = strContent;
				}

				// Sean Schricker's simplerSwap
				function setOverSrc(elem){
					elem.onmouseover=function(){this.src=this.src.replace(/(_on)*(\.\w+)$/,'_on$2')}
					elem.onmouseout=function(){this.src=this.src.replace(/(_on)+(\.\w+)$/,'$2')}
					elem.onload='';
				}

function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}

jQuery(document).ready(function() {
	if(jQuery("a[target='Disclaimer'],a[target='Details'").size()>-1){
		jQuery.each(jQuery("a[target='Disclaimer'],a[target='Details']"), function() {
			if (this.target=="Details") {
				jQuery(this).css("border-bottom","1px dashed #000000");
			}
			jQuery(this).css("text-decoration","none");
			jQuery(this).bind("click", function(e){
				if (this.target=="Details") {
					jQuery(this).removeClass("disc");
				}else{
					jQuery(this).removeClass("disc-details");
				}
				return disclaimerPop(this.hash.substr(this.hash.search("_")+1),e.pageX,e.pageY,e.originalEvent);
			});
		});	
		var newlist = new Array();
		discURLs=jQuery("a[target='Disclaimer']");
		detURLs=jQuery("a[target='Details']");
		combURLs=jQuery.merge(jQuery.makeArray(detURLs),jQuery.makeArray(discURLs));
		var hash = new Object();
		for (var i=0; i<combURLs.length; i++){
		    if (hash[combURLs[i].href.toLowerCase()] != 1){
		        newlist = newlist.concat(combURLs[i].href.substr(combURLs[i].href.lastIndexOf("_")+1));
		        hash[combURLs[i].href.toLowerCase()] = 1;
		    }else {
		    }
		}
		jQuery("body").append("<div id='discs' style='display:none;'></div>");
		jQuery("#discs").load("/infiniti/us/en/disclaimers.viewall."+newlist.join('.')+".html");
	}
	//Pricing Disclaimer for non-Flash vehicle pages
	//jQuery("body").append("<div style='display:none;'><a target='Disclaimer' href='/content/infiniti/us/en/disclaimers.html#Disclaimers_disclaimers_14'></a></div>");
});

function showPricingDetails(pageArg){
	var jTop = jQuery(".gBody").offset().top;
	var jLeft = jQuery(".gBody").offset().left;
	disclaimerPop("disclaimers_14",jLeft+660,jTop+160);
}

function disclaimerPop(hash,ex,ey,oe){
	
	jQuery(".ui-dialog").each(function() {	
		jQuery(this).remove();
	});
	
	if (jQuery.browser.msie && jQuery.browser.version.substring(0,1) === '8'){

	uiHgt=jQuery(".ui-dialog").height();
	uiWdh=jQuery(".ui-dialog").width();
	var windowX = jQuery(window).width() - 300;	
	
	var newX;
	var newY;	

	if(ex>windowX){
		newX = ex;
		newY = ey-uiHgt;
	}
	else if(ex<300)
	{
		newX = ex-50;
		newY = ey-uiHgt;	
	}
	else{
		newX = ex-150;
		newY = ey;
	} 
		jQuery("#id-content-infiniti-us-en-disclaimers-Disclaimers-"+hash).dialog('destroy');	
		jQuery("#id-content-infiniti-us-en-disclaimers-Disclaimers-"+hash).dialog({ autoOpen:true, modal: false, closeText: "Close  ", stack:false, dialogClass: 'popDialog', position: [newX,newY] });
		return false;
		
	}else{
	
	jQuery("#id-content-infiniti-us-en-disclaimers-Disclaimers-"+hash).dialog('destroy');
	jQuery("#id-content-infiniti-us-en-disclaimers-Disclaimers-"+hash).dialog({ autoOpen:true, modal: false, closeText: "Close  ", stack:false, dialogClass: 'popDialog' });
	uiHgt=jQuery(".ui-dialog").height();
	uiWdh=jQuery(".ui-dialog").width();
    var windowX = jQuery(window).width() - 300;
	var dialY = ey;
	var dialX = ex;
    
    if (dialX > windowX) {
        jQuery(".popDialog").css("top", dialY+10);
        jQuery(".popDialog").css("left", dialX-275);
    }
	else if(dialX<300)
	{
		
		jQuery(".popDialog").css("top", dialY+10);
        jQuery(".popDialog").css("left", dialX-30);	
	}
    else {
        jQuery(".popDialog").css("top", dialY+10);
        jQuery(".popDialog").css("left", dialX-100);
    }
    
    return false;


	}
}

function popupVideo(){
    document.getElementById('video-popup').style.width = '740px';
    document.getElementById('video-popup').style.height = '394px';
}

function loadVideo(obj, size){
     
    
    var shellValue = (size === "wide")? "/apps/nna/docroot/swf/videoPlayer_widescreen_CMS.swf" : "/apps/nna/docroot/swf/videoPlayer_CMS.swf";
    
    vidTerser = new Terser({
        name: "vidTerser",
        shell: shellValue,
        element: "#video-swf",
        height: 361,
        width: 712,
        params: {
            wmode: "opaque",
            base:"/apps/nna/docroot/swf/"
        }
    });

    var cls = "."+obj;
    
    disclaimerArr = [];

    jQuery.each(jQuery(cls+" .disclaimers"), function() {
      disclaimerArr.push(jQuery(this).html());
    });

    var zd = {videoData:{
        imageSrc:jQuery(cls+" .imageSrc").html(),
        flvSrc:jQuery(cls+" .flvSrc").html(),
        headline:jQuery(cls+" .headline").html(),
        runtime:jQuery(cls+" .runtime").html(),
        copy:jQuery(cls+" .copy").html(),
        disclaimers:disclaimerArr,
        id:"0",
        section_id:"0",
        taggingEventID:jQuery(cls+" .taggingEventID").html(),
        replayCopy:jQuery(cls+" .replayCopy").html(),
        autoplay:true
    }};

    vidTerser.extend(zd);
    vidTerser.load();
}

function destroyVideo(obj){
    jQuery('#video-swf').replaceWith('<div id="video-swf"></div>');//document.getElementById('video-swf').innerHTML = '';
    hideDhtmlPop(obj);
}

jQuery(document).ready(function(){
    // apply hover effect for site feedback
    var siteFeedback = jQuery('#gizmoS img:first');
    if(siteFeedback.length > 0){
        setOverSrc(siteFeedback[0]);
    }
    
    if(jQuery("a[target='Video']").size()>-1){
        jQuery("body").append("<div class='gPopUpDisplay' id='video-popup'>" +
                "<div class='gFirstChild'><a href='#' onclick='destroyVideo(this);return false;' class='gClose'>Close</a></div>" +
                "<div class='' style='opacity: 1;' id='video-swf'></div>" +
                "</div>");
        jQuery("body").append("<div class='videos' style='display:none;'></div>");
        jQuery.each(jQuery("a[target='Video']"), function(i,data) {
               if((jQuery("link[rel='canonical'][href*='headtohead']").size()==0) || (jQuery(this).html()=="[Video]")){
                   jQuery(this).css("text-decoration","none");
               
                if (jQuery(this).hasClass("special_video_link_54")){
                   jQuery(this).html("&nbsp;<img src='/content/dam/infiniti/ownership/infiniti-personal-assistant/infiniti-pa-btn-on.png' alt='Video' class='gDisInline' />");
                  } else {
                  
                  jQuery(this).html("&nbsp;<img src='/apps/nna/docroot/img/global/video_icon.png' alt='Video' class='gDisInline' />");
                  
                  }
                   
              
               }
               var vidContent = jQuery.get("/infiniti/us/en/videos/_jcr_content/Videos/"+data.href.split("#Videos_")[1]+".html",
                       function(data){
                       jQuery(".videos").append("<div class='videodetails"+i+"'>"+data+"</div>");
                       });
                
                   jQuery(this).bind("click", function(){
                    var size = jQuery(this).attr('rel');
                    var elementPosition = (size === "wide")? 'positiontop' : 'centerinwindow';
                    
                    showDhtmlPop('video-popup','event',this,elementPosition,popupVideo,loadVideo('videodetails'+i, size) );
                    return false;
                });
        });
    }
    if(jQuery("a[target='PDF']").size()>-1){
        jQuery.each(jQuery("a[target='PDF']"), function(i,data) {
               jQuery(this).html("&nbsp;<img src='/apps/nna/docroot/img/global/icon-pdf.gif' alt='PDF' class='gDisInline' />");
        });
    }
    jQuery.each(jQuery("a[href$='pdf']"),function(){
        linky=this.href;
        this.href="javascript:popPDFViewer('"+linky+"');"
        jQuery(this).removeAttr("target");
    });
    jQuery(".imgSwap").hover(
             function()
             {
              var baseRef = this.src.substring(0,this.src.lastIndexOf("."));
              var extRef = this.src.substring(this.src.lastIndexOf("."));
              this.src = baseRef + "_on" + extRef;
             },
             function()
             {
              this.src = this.src.replace("_on","");
             }
            );  
});
function swapHeaders(){
	for(var i=1;i<=2;i++){
		var _h=document.getElementsByTagName('h'+i);
		for(var j=0;j<_h.length;j++){
			if(/gSwap/.test(_h[j].className)){
				swapHeader(_h[j],"h{0}_{1}".format(i,j))
			}
		}
	}
}

jQuery(document).ready(function(){
	swapHeaders();
});

HnHeights=[22,16];

function swapHeader(myHeader,swfID){
	if(myHeader && /h[12]/i.test(myHeader.tagName)){
		var headerN=+myHeader.tagName.replace(/h/i,'')
		var _id=swfID||'header'+(''+Math.random()).replace(".",'')
		var _ih=myHeader.innerHTML.replace(/^\s+|\s+$|[\r\n]/g,'');
		_ih=_ih.replace(/["' \t&+]/g,function(blah1){return "%"+blah1.charCodeAt(0).toString(16) });
		var _d=document.createElement('div');
		myHeader.innerHTML="";
		_d.className="gNoPrint";
		_d.id=_id;
		myHeader.appendChild(_d);
		var _d=document.createElement('div');
		_d.className="gOnlyPrint";
		_d.innerHTML=unescape(_ih);
		_d.id=_id+"_text"
		myHeader.appendChild(_d);
		var _fv={}
		_fv["h{0}Text".format(headerN)]=_ih;
		_fv.param_quality="low";
		//new swfoWrapper("/flash/global/h1.swf", _id, _fv, 720, HnHeights[headerN-1]);
		swfobject.embedSWF("/apps/nna/docroot/swf/h1.swf", _id, 720, HnHeights[headerN-1], "9.0.0",false, _fv, {"allowscriptaccess":"always","bgcolor":"#000000","wmode":"transparent"}, {});
		myHeader.style.visibility = 'visible';
	}
}

function _popWindow(url, windowName, windowAttributes) {
	winObj = window.open(url,windowName,windowAttributes);
	winObj.focus();
	return winObj;
}

//pdf viewer
function popPDFViewer(url) {
	if(url != 'NA') _popWindow(url, "pdfWindow","width=700,height=600,resizable");
}

function preLoadImages(source)
{
	if (!!document.images)
    {
      preload_image_object = new Image();
	  preload_image_object.src=source;
    }
}

function getStringParam(searchString, nombre) {
	var _re = new RegExp("[&\?]"+String(nombre)+"=([^&]+)");
	return (_re.test(searchString))?RegExp.$1:'';
}

/********************/
/* NON-FLASH NAV JS */
/********************/

var xmlDoc;
var hostname=window.location.host + "/apps/nna/docroot";
var nonSecNonToolsPath="";

function importXML() {
	if (currentURI.indexOf('http://stage.build.infiniti.com') > -1){
		var xmlPath = "http://stage.build.infiniti.com/ngstcms_infiniti/js/non-flash/nonFlash.xml";
	}else if (currentURI.indexOf('http://build.infinitiusa.com') > -1){
		var xmlPath = "http://build.infinitiusa.com/ngstcms_infiniti/js/non-flash/nonFlash.xml";
	}else if (currentURI.indexOf('secure.infinitiusa.com') > -1){
		var xmlPath = "https://secure.infinitiusa.com/xml/non-flash/nonFlash.xml";
	}else{
		var xmlPath = "/apps/nna/docroot/nonFlash.xml";
	}

	if (typeof jQuery != 'undefined') {
		jQuery.ajax({url: xmlPath, async: false, dataType: "xml",
			error: function (o, status, error) {if (typeof(console) != 'undefined') console.log("o: " + o + "\nstatus: " + status + "\nerror: " + error);},
			success: function (data, status) {xmlDoc = data; createTopNav(); }
		});
	} else {
		//importXMLRaw();
	}
}

/** Topnav is a constructor to hold attributes of each menu item*/
function topnavitem(name,source,href,border,bordercolor){
	this.name = name;
	this.source = source;
	this.href = href;
	this.border = border;
	this.bordercolor = bordercolor;
}

// set to resolve Safari bug
varMenuComplete = false;

/** Creates top navigator using data from XML sheet */
function createTopNav(){
	//console.log(varMenuComplete);
	if (varMenuComplete==true){
		return;
	}
	var menus = xmlDoc.getElementsByTagName("menu");
	var no_of_menus = menus.length;
	jQuery("#gTopNav").html("");
	jQuery("#gTopNavExternal").html("");
	jQuery("#ufoGlobalNav").html("");/*added to fix SR 17503*/
	if (jQuery('#gTopNav').hasClass('homepage-gtopnav')){
		// create a containing div for the new homepage nav width
		var gTopNavNew = jQuery('<div id="hompage-gnav-container">');
		var gTopNavNewCon = jQuery('<div id="gnav-container">');
		var gTopNavOld = jQuery('#gTopNav').clone();
		gTopNavNewCon.append(gTopNavOld);
		gTopNavNew.append(gTopNavNewCon);
		//console.log(gTopNavOld.children().length);
		jQuery('#gTopNav').replaceWith(gTopNavNew);
		jQuery('#gTopNav').css('width', 964);
		
	}
	

	for(var i=0; i<menus.length; i++)
	{
		var iframeWidth=0;
		var iframeHeight=0;
		var menuitems = menus[i].childNodes;
		var no_of_items = menus[i].childNodes.length;
		var topnavarray = new Array(no_of_items);
		var j=0;
		if (menus[i].childNodes[j].nodeType != 1)
			j++;
		if(menus[i].childNodes[j].firstChild.nodeValue=="iframe"){
			iframeWidth = menus[i].childNodes[j].getAttribute("width");
			iframeHeight=  menus[i].childNodes[j].getAttribute("height");
			j++;
			if (menus[i].childNodes[j].nodeType != 1)
				j++;
		}
		topnavarray[0] = new topnavitem(menus[i].childNodes[j].firstChild.nodeValue,menus[i].childNodes[j].getAttribute("src"),menus[i].childNodes[j].getAttribute("href"));
		j++;
		for( ; j<no_of_items; j++)
		{
			if (menus[i].childNodes[j].nodeType != 1)
				continue;
			topnavarray[menus[i].childNodes[j].getAttribute("order")] = new topnavitem(menus[i].childNodes[j].firstChild.nodeValue,menus[i].childNodes[j].getAttribute("src"),menus[i].childNodes[j].getAttribute("href"),menus[i].childNodes[j].getAttribute("border"),menus[i].childNodes[j].getAttribute("border-color"));
		}
		createmenu(topnavarray,iframeWidth,iframeHeight);
	}
	//jQuery("a[@href=null]").removeAttr("href");
	/*modifications to fix SR 17503: start here*/
	jQuery("#gTopNav > div,#gTopNavExternal > div,#ufoGlobalNav > div").css("float", "left");
	jQuery("#gTopNav *,#gTopNavExternal *,#ufoGlobalNav *").css("z-index", "300");
	jQuery("#gTopNav > div > div,#gTopNavExternal > div > div,#ufoGlobalNav > div > div").css("position","absolute");
	jQuery("#gTopNav > div > div,#gTopNavExternal > div > div,#ufoGlobalNav > div > div").hide();
	jQuery("#gTopNav > div > iframe,#gTopNavExternal > div > iframe,#ufoGlobalNav > div > iframe").hide();
	jQuery("#gTopNav > div,#gTopNavExternal > div,#ufoGlobalNav > div").hover(function(){showMenu(jQuery(this).attr("ID"),jQuery("#"+jQuery(this).attr("ID") +">"+" div").attr("ID"));},function(){hideMenu(jQuery(this).attr("ID"),jQuery("#"+jQuery(this).attr("ID") +">"+" div").attr("ID"));});
	jQuery("#gTopNav > div > div > div > a > img,#gTopNavExternal > div > div > div > a > img,#ufoGlobalNav > div > div > div > a > img").css("cursor","pointer");
	jQuery("#gTopNav > div > div > div > a >img,#gTopNavExternal > div > div > div > a >img,#ufoGlobalNav > div > div > div > a > img").each(function() { setOverSrc(this)});
	/*modifications to fix SR 17503: end here*/
	// create non-flash footer navigation
	jQuery(document).ready(function() {
		jQuery("#gFooter").html("<a href='/global/index.html' target='wGlobal'><span id='gFooterAboutLink'>Infiniti Worldwide</span></a> <a target='_blank' href='http://www.infinitilifestyle.com/' style='text-decoration: none'>Merchandise</a><a href='/iapps/contactus'>Contact Us</a>  <a href='/global/privacy.html'>Privacy &amp; Legal</a> <a href='http://www.adobe.com/products/flashplayer/'>Get Flash</a><span id='gFooterSocialLinks' style='padding-left:10px; color:#fff;'>Follow Us: <a target='_blank' style='display:inline-block; padding:0px; margin:3px 0px 0px 5px;' href='http://www.facebook.com/infiniti'><img src='/content/dam/infiniti/global/footer/icoFacebook.gif' border='0' /></a><a target='_blank' style='display:inline-block; padding:0px; margin:3px 0px 0px 5px;' href='http://twitter.com/infinitinews'><img src='/content/dam/infiniti/global/footer/icoTwitter.gif' border='0' /></a><a target='_blank' style='display:inline-block; padding:0px; margin:3px 0px 0px 5px;' href='http://www.youtube.com/infiniti'><img src='/content/dam/infiniti/global/footer/icoYoutube.gif' border='0' /></a></span>");
	});	
	varMenuComplete = true;
	
}

// This function creates menu for each item in the topNav depending on no. of menuitems
// provided in the nonFlash.xml.
function createmenu(menuarray,iframeWidth,iframeHeight)
{
	var menuheaderdiv = imageanchordiv(menuarray[0].name,menuarray[0].source,menuarray[0].href);
	var itemdiv = document.createElement("div");
	itemdiv.id = menuarray[0].name+"items";
	var fixdiv = document.createElement("div");
	fixdiv.id = menuarray[0].name+"items1";
	var itemiframe = document.createElement("iframe");
	itemiframe.id = menuarray[0].name+"itemsiframe";
	jQuery(itemiframe).css({width:iframeWidth, height:iframeHeight});

	for(var k=1; k<menuarray.length && menuarray[k]!=null; k++){
		var menuImageDiv = imageanchordiv(menuarray[k].name,menuarray[k].source,menuarray[k].href);

		if(menuarray[k].border!=null ){
			jQuery(menuImageDiv).css({borderBottomWidth:menuarray[k].border, borderColor:menuarray[k].bordercolor, borderBottomStyle:"solid"});
		}

		itemdiv.appendChild(menuImageDiv);
	}

	fixdiv.innerHTML=itemdiv.innerHTML;
	menuheaderdiv.appendChild(itemdiv);
	menuheaderdiv.appendChild(fixdiv);
	menuheaderdiv.appendChild(itemiframe);

	// If gTopNav exists then menu is appended to gTopNav, else it's appended to gTopNavExternal.
	
if(jQuery("#gTopNav")){

			jQuery("#gTopNav").append(menuheaderdiv);

		}else if(jQuery("#gTopNavExternal")){

			jQuery("#gTopNavExternal").append(menuheaderdiv);

		}/*added to fix SR 17503*/else if(jQuery("#ufoGlobalNav")){

			jQuery("#ufoGlobalNav").append(menuheaderdiv);
	}
	
}

// This function creates an anchor tag for every menuItem in the menu.
// It takes three parameters: 1) the name of the div for each menuItem,
// 2) source which is the path of the image and
// 3) href which is the set as link for anchor tag.
function imageanchordiv(divname,source,href){
	var img = document.createElement("img");
	img.id="img"+divname;
	img.src = "http://"+hostname+"/"+source;
	//img.src = source;
	var a = document.createElement("a");
	if(href=="null"){
		jQuery(a).removeAttr("href");
	}else{
		a.setAttribute("href",nonSecNonToolsPath+"/"+href);
	}
	var div = document.createElement("div");
	div.id = divname;
	a.appendChild(img);
	div.appendChild(a);
	return div;
}


/** This method Retains the menu even after moving on to menu list from menu header*/
function retainMenu(buttonID,menuID){
	jQuery("#"+menuID).show();
	jQuery("#"+buttonID+"itemsiframe").show();
}

var menuShouldShow = new Array();
var menuHiding = new Array();
var menuShowing = new Array();

/** To show menu list when mouse moves on to menu header */
function showMenu(buttonID, menuID,alignment){
	if (typeof menuShouldShow[buttonID]=='undefined') {
		menuShouldShow[buttonID] = true;
	}
	menuShouldShow[buttonID] = true;
	if (typeof menuShowing[buttonID]=='undefined') {
		menuShowing[buttonID] = false;
	}
	if (typeof menuHiding[buttonID]=='undefined') {
		menuHiding[buttonID] = false;
	}
	if (!menuShowing[buttonID] && !menuHiding[buttonID]) {
		//jQuery("#"+menuID+"1").css({zIndex: "101"});
		if(jQuery.browser.msie && jQuery.browser.version=="6.0" || jQuery.browser.msie && jQuery.browser.version=="7.0"){
					jQuery("#gTopNav").css("z-index", "500");
				}
		var temp=jQuery("#"+buttonID).position().left +20;//+ ((alignment!="horizontal")?20:($(buttonID).offsetWidth-1));
		jQuery("#"+menuID ).css({left: temp+"px", top: jQuery("#"+buttonID).offset().top+((alignment!="horizontal")?($(buttonID).offsetHeight)+"px":0+"px") });
		jQuery("#"+menuID+"1").css({left: temp+"px", top: jQuery("#"+buttonID).offset().top+((alignment!="horizontal")?($(buttonID).offsetHeight)+"px":0+"px") });
		jQuery("#"+menuID).slideDown("fast", function() { menuShowing[buttonID] = false; if(!menuShouldShow[buttonID] && !menuHiding[buttonID]) { hideMenu(buttonID, menuID) }; } );
		jQuery("#"+menuID+"1").slideDown("fast");
		jQuery("#"+buttonID+"itemsiframe").css({position:"absolute",left: temp+"px", top: jQuery("#"+buttonID).offset().top+((alignment!="horizontal")?($(buttonID).offsetHeight)+"px":0+"px"), border:"none", zIndex:"99" });
		jQuery("#"+buttonID+"itemsiframe").slideDown("fast");
	}
	
	
}

/** To hide menu list when mouse moves out of menu header or menu list */
function hideMenu(buttonID,menuID) {
	if(jQuery.browser.msie && jQuery.browser.version=="6.0" || jQuery.browser.msie && jQuery.browser.version=="7.0"){
				jQuery("#gTopNav").css("z-index", "300");
			}
	menuShouldShow[buttonID] = false;
	if(menuShowing[buttonID] == false) {
		menuHiding[buttonID] = true;
		jQuery("#"+menuID+"1").slideUp("fast");
		jQuery("#"+menuID).slideUp("fast", function() { menuHiding[buttonID] = false; if(menuShouldShow[buttonID] && !menuShowing[buttonID]) { showMenu(buttonID, menuID) }; } );
		jQuery("#"+buttonID+"itemsiframe").slideUp("fast");
	}
}

/************************/
/* END NON-FLASH NAV JS */
/************************/

// print-specific js for specs, options, and accessories pages

var copied = false; //we don't want to duplicate the disclaimers if a user keeps hitting print

function printspecs() {
        if(copied)
            { window.print();}
    /*added else to fix SR 16868*/  else{

        var arr = ['details','power','handling','interior','safety','security','disclaimer'];
        for (j = 0; j < arr.length; j++) {
            var i = 1;
            while (document.getElementById(arr[j] + i)) {
                _copyCode(document.getElementById(arr[j] + i).getElementsByTagName('div')[1], document.getElementById('tPrintOnlyDisclaimer'));
                i++;
            }
        }
        if(document.getElementById('pricingDetails'))
            _copyCode(document.getElementById('pricingDetails').getElementsByTagName('div')[1], 
                      document.getElementById('tPrintOnlyDisclaimer'));
        
        copied = true;
        try {
            window.print();
        } catch(e) {
        }
}
}
function _copyCode(source, destination) {
        destination.innerHTML = destination.innerHTML + '<br />' + source.innerHTML;
}

function spitTitle() {
        var temp = document.title;
        try {
                temp = temp.substr(temp.indexOf("-") + 1);
                while(temp.charAt(0) == ' ') temp = temp.substr(1); //eliminate leading spaces
                document.write(temp);
        } catch(e) {
                document.write('Specifications'); //default in case string operation fails
        }
}


var _currentDhtmlPop
var minX=0, maxX=0
var minY=0, maxY=0

function _snapWithinBounds(min,val1, val2, max){
	if(isNaN(parseFloat(val2))){val2=val1}
	//val2 gives a second possible placement. 
	if( ((val1>=max) & (val2<val1)) || ((val1<=min) & (val1<val2)) ){
		return Math.max( min, Math.min(val2,max) )
	}else{
		return Math.max( min, Math.min(val1,max) )
	}
}
function _snapX(val1,val2){
	return _snapWithinBounds(minX,val1,val2,maxX)
}
function _snapY(val1,val2){
	//if(_currentDhtmlPop.clientHeight > (maxY-minY)){
	//	//buggy, but may be worked with in the future to keep it onscreen.
	//	return _snapWithinBounds(minY,val1,null,minY)
	//}
	return _snapWithinBounds(minY,val1,val2,maxY)
}
function showDhtmlPop( obj, e, anchor, preferredPlacement, onopen, cleanupPop){
	/// sample usage: showDhtmlPop('dhtmlPopID',event,this,3)	
	/// second and third args MUST be event and this when called from an anchor
	/// There are 2 new extra args. References to functions to call on opening and after closing.
	// see the switch() below for the preferredPlacement options.
	if(typeof onopen == 'function'){onopen(anchor,obj)}

	hideDhtmlPop()
	
	obj=document.getElementById(obj)	
	if (obj==null) return;

	obj.style.visibility='hidden'
	obj.style.display='inline'
	
	_currentDhtmlPop=obj
	
	var tempX = 0, originalX = 0;
	var tempY = 0, originalY = 0;
	var offset=10;
  
  var scrollTop = document.documentElement.scrollTop;
  if (scrollTop == 0)
    scrollTop = document.body.scrollTop;
	
	minX=(document.body.clientWidth-964)/2 //For centered-content div pages.
	maxX= minX+964-obj.clientWidth

	minY = scrollTop
	maxY = document.body.clientHeight + scrollTop - (obj.clientHeight);

	tempX = originalX = (document.all) ? (event.clientX + document.body.scrollLeft) : (e.pageX);
	tempY = originalY = (document.all) ? (event.clientY + scrollTop) : (e.pageY);
  
//  alert('tempY = ' + tempY + '\ne.pageY = ' + e.pageY + '\nobj.clientHeight = ' + obj.clientHeight + '\nevent.clientY = ' + event.clientY + '\ndocument.body.scrollTop = ' + document.body.scrollTop + '\nobj.top = ' + obj.top + '\ne.offsetY \ ' + e.offsetY + '\nobj.y = ' + obj.y + '\nobj.offsetParent = ' + obj.offsetParent + '\nanchor.style.posTop = ' + anchor.style.posTop + '\ne.srcElement.y = ' + e.srcElement.y + '\ndocument.documentElement.scrollTop = ' + document.documentElement.scrollTop);

	//code to position the popup when it is hiding in the bottom
	var mouseYpos = e.clientY;
	var bodyHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
	if ((mouseYpos+obj.clientHeight+offset)>bodyHeight) {
		tempY=tempY-obj.clientHeight;
	}

	switch(preferredPlacement.toLowerCase()){
		case 'side': /// right/left, mainly right, centered vertically. 
			tempX=_snapX(tempX + offset, tempX-obj.clientWidth - offset)
			tempY=_snapY(tempY-(obj.clientHeight/2))
			break;
		case 'above': /// above. 
			tempX=_snapX(tempX-(obj.clientWidth/2)-offset)
			tempY=_snapY(tempY-(obj.clientHeight)-offset, tempY+offset)
			break;
		case 'below': /// below. 
			tempX=_snapX(tempX-(obj.clientWidth/2)+offset)
			tempY=_snapY(tempY+offset, tempY-(obj.clientHeight)-offset)
			break;
		case 'belowtallpage': /// belowTallPage. 
			tempX=_snapX(tempX-(obj.clientWidth/2)+offset)
			tempY=tempY+offset //_snapY(tempY+offset, tempY-(obj.clientHeight)-offset) //
			break;
		case 'centerinwindow':
			var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
			var scrollY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
			var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
			var scrollX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;
			//tempX = (document.body.clientWidth - obj.clientWidth)/2 + document.body.scrollLeft;
			tempX = (winWidth - 964)/2 + scrollX + 194;
			tempY = (winHeight - obj.offsetHeight)/2 + scrollY;
			//console.log('winWidth='+winWidth+', tempX='+tempX+', tempY='+tempY);
			break;
                                            case 'positiontop':
                                            var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
                                            var scrollX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;
                                            tempX = (winWidth - 964)/2 + scrollX + 194;
                                             tempY = 100;
                                           break;
		default:
		case 'anchorcenter': /// anchorCenter.
//      alert('before: tempX = ' + tempX);
//      alert('obj.clientWidth = ' + obj.clientWidth);
//      alert('offset = ' + offset);
      
      tempX=_snapX(tempX-(obj.clientWidth/2)+offset)
			tempY=tempY-(obj.clientHeight/2)+offset
      
//      alert('after: tempX = ' + tempX);

      // make sure the right of the popup is not off the main page
      if((tempX + obj.clientWidth) > 964) { tempX = 964 - obj.clientWidth - 80; }
      
      // make sure the left of the popup positive
      if(tempX < 30) { tempX = 30; }
      
			break;
      
      // make sure the left of the popup positive
      if(tempX < 30) { tempX = 30; }

      //Detect IE
      version=0
      if (navigator.appVersion.indexOf("MSIE")!=-1) {
        temp=navigator.appVersion.split("MSIE")
        version=parseFloat(temp[1])
      }

      // IE
      if (version > 0) {
        // make sure popup is below the start of the visible client area
        if(tempY < scrollTop) {
          tempY = scrollTop + 30
        }

        if (document.getElementById("tabSoaPageBgResize")) {
          // make sure the bottom of the popup is above the bottom of the visible client area
          if((tempY + obj.clientHeight) > (document.getElementById("tabSoaPageBgResize").clientHeight)) {
//            tempY = document.body.scrollHeight - obj.clientHeight - 240
            tempY -= obj.clientHeight
          }
        } else {
          // make sure the bottom of the popup is above the bottom of the visible client area
          if((tempY + obj.clientHeight) > (scrollTop  - 340)) {
            tempY = document.body.scrollHeight - obj.clientHeight - 380
          }
        }

      // Non-IE
      } else {
        // make sure popup is below the start of the visible client area
        if(tempY < window.scrollY) {
          tempY = window.scrollY + 30
        }

        // make sure the bottom of the popup is above the bottom of the visible client are
        if (document.getElementById("tabSoaPageBgResize")) {          
          if((tempY + obj.clientHeight) > (document.getElementById("tabSoaPageBgResize").clientHeight)) {
            tempY -= obj.clientHeight
          } else if((tempY + obj.clientHeight) > (window.scrollY + document.body.scrollHeight - 340)) {
            tempY = window.scrollY + document.body.scrollHeight - obj.clientHeight - 240
          }
        }
      }

      // make sure the top of the popup is below the global header
      if(tempY < 50)
        tempY = 50;
      
	}
	obj.style.top  = (tempY) + 'px';
	obj.style.left = (tempX) + 'px';
	obj.style.visibility='visible'

	/*with($('mPopShadow').style){
		width=obj.clientWidth+ 'px';
		height=obj.clientHeight+ 'px';
		top=(tempY+8) + 'px';
		left=(tempX+8) + 'px';
		display='block'
	}*/
	
	if(typeof cleanupPop == 'function'){cleanupPop(anchor)}
}
function _getElementNodes(popID){
	var nodes=[]
	var cn=$(popID).childNodes
	for(var i=0;i<cn.length;i++){
		if(cn[i].nodeType==1){ nodes.push(cn[i]) }
	}
	return nodes
}
function setDhtmlContentsTEMPLATE(popID){
	///begin prelim
	var nodes=_getElementNodes(popID)
	var header=nodes[1]
	var panel1=nodes[2]
	var panel2=nodes[3]
	///end prelim
	///begin your code ##########
	header.innerHTML=counterTest++
	
	return (popID)
}
function hideDhtmlPop(ref){
	if(_currentDhtmlPop){_currentDhtmlPop.style.display=''}
	//if(ref){ref.style.display='none'}
	//$('mPopShadow').style.display='none'
}

var popMovieCrmEvent = function () {}; // do nothing

function startPopMovie(movieName, movieTitle, stopEvent){
  popMovieCrmEvent = stopEvent;
  $("movieCode").innerHTML = '<embed type="application/x-shockwave-flash" src="' + movieName + '" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="false" menu="false" quality="high" scale="exactfit" wmode="transparent" width="490" height="400">';
  $("movieTitle").innerHTML = movieTitle;
  return false;
}

function stopPopMovie(){
  $("movieCode").innerHTML = "";
  if (popMovieCrmEvent) popMovieCrmEvent();
  return false;
}


