if(typeof SEAT==="undefined"){var SEAT={}}if(typeof SEAT.TC==="undefined"){SEAT.TC={}}SEAT.TC.HOST="http://www.tuttocitta.it";SEAT.TC.APP_PFX="/tcol";SEAT.TC.WEB_PFX="/tc";SEAT.TC.IMG_PFX="http://img.tuttocitta.it/tcolnew/img";(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.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(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,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return }var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}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 F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},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: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(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};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){G=o.trim(G);if(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(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},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,R){if(typeof R==="number"){R+=""}if(!R){return }if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).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]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?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(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});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(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});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).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=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(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return }F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};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);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})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){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&&typeof l.frameElement==="undefined"){(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="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();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/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();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}this[H].style.display=o.data(this[H],"olddisplay",K)}}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"))}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)==1){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)}},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(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();jQuery.log=function(){};(function(B){B.event.special.mousewheel={setup:function(){var A=B.event.special.mousewheel.handler;if(B.browser.mozilla){B(this).bind("mousemove.mousewheel",function(D){B.data(this,"mwcursorposdata",{pageX:D.pageX,pageY:D.pageY,clientX:D.clientX,clientY:D.clientY})})}if(this.addEventListener){this.addEventListener((B.browser.mozilla?"DOMMouseScroll":"mousewheel"),A,false)}else{this.onmousewheel=A}},teardown:function(){var A=B.event.special.mousewheel.handler;B(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener((B.browser.mozilla?"DOMMouseScroll":"mousewheel"),A,false)}else{this.onmousewheel=function(){}}B.removeData(this,"mwcursorposdata")},handler:function(F){var H=Array.prototype.slice.call(arguments,1);F=B.event.fix(F||window.event);B.extend(F,B.data(this,"mwcursorposdata")||{});var A=0,G=true;if(F.wheelDelta){A=F.wheelDelta/120}if(F.detail){A=-F.detail/3}if(B.browser.opera){A=-F.wheelDelta}F.data=F.data||{};F.type="mousewheel";H.unshift(A);H.unshift(F);return B.event.handle.apply(this,H)}};B.fn.extend({mousewheel:function(A){return A?this.bind("mousewheel",A):this.trigger("mousewheel")},unmousewheel:function(A){return this.unbind("mousewheel",A)}})})(jQuery);if(jQuery){(function(){$.extend($.fn,{rightClick:function(B){$(this).each(function(){$(this).mouseup(function(A){if(A.button===2){B($(this),A)}return true});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightDblClick:function(C){var D;$(this).each(function(){$(this).rightClick(function(A,B){if(D){clearTimeout(D);D=null;C($(this),B);return true}else{D=setTimeout(function(){clearTimeout(D);D=null},300);return false}})});return $(this)},rightMouseDown:function(B){$(this).each(function(){$(this).mousedown(function(A){if(A.button==2){B($(this));return true}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseUp:function(B){$(this).each(function(){$(this).mouseup(function(A){if(A.button==2){B($(this));return true}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},noContext:function(){$(this).each(function(){$(this)[0].oncontextmenu=function(){return false}});return $(this)}})})(jQuery)}if(typeof SEAT==="undefined"){var SEAT={}}var PGEvent=function(){return{addListener:function(G,F,H,E){if(G&&G.eventRegister){G.eventRegisterPre(F,H,E);G.eventRegister(F,H,E);G.eventRegisterPost(F,H,E)}return{obj:G,id:F,fn:H,scope:E}},removeListener:function(B){B.obj.eventDeRegisterPre(B.id,B.fn,B.scope);B.obj.eventDeRegister(B.id,B.fn,B.scope);B.obj.eventDeRegisterPost(B.id,B.fn,B.scope)}}}();Array.prototype.max=function(){return Math.max.apply(Math,this)};Array.prototype.min=function(){return Math.min.apply(Math,this)};[].indexOf||(Array.prototype.indexOf=function(H,F){F=(F==null)?0:F;var E=this.length;for(var G=F;G<E;G++){if(this[G]==H){return G}}return -1});SEAT.PGUtil={getZone:function(H,I){var J=Math.floor((H+180)/360),G=(H+180)-J*360-180,F=Math.floor((G+180)/6)+1;if(G>=3&&G<12){F=32}else{if(F<=34){F=32}else{F=35}}return F},latLong2UTM:function(g,j,C){var X=6378137,Z=0.00669438,b=0.9996,A=3.14159265,i=A*g/180,f=A*j/180,T=((C-1)*6-180+3)*A/180,d=(Z)/(1-Z),e=X/Math.sqrt(1-Z*Math.sin(f)*Math.sin(f)),h=Math.tan(f)*Math.tan(f),a=d*Math.cos(f)*Math.cos(f),Y=Math.cos(f)*(i-T),c=X*((1-Z/4-3*Z*Z/64-5*Z*Z*Z/256)*f-(3*Z/8+3*Z*Z/32+45*Z*Z*Z/1024)*Math.sin(2*f)+(15*Z*Z/256+45*Z*Z*Z/1024)*Math.sin(4*f)-(35*Z*Z*Z/3072)*Math.sin(6*f)),M=(b*e*(Y+(1-h+a)*Y*Y*Y/6+(5-18*h+h*h+72*a-58*d)*Y*Y*Y*Y*Y/120)+500000),N=(b*(c+e*Math.tan(f)*(Y*Y/2+(5-h+9*a+4*a*a)*Y*Y*Y*Y/24+(61-58*h+h*h+600*a-330*d)*Y*Y*Y*Y*Y*Y/720)));return{x:M,y:N}},utm2LatLong:function(y,z,AL){var b=0.9996,AG=6378137,AI=6356752.3142,AJ=3.14159265,u=((AL-1)*6-180+3);y=y-500000;var t=z/b,AA=0.081819,AK=0.006694348761,AO=t/(AG*(1-(AK)/4-3*AK*AK/64-5*AK*AK*AK/256)),v=(1-Math.sqrt(1-AK))/(1+Math.sqrt(1-AK)),AC=(1.5*v-27*Math.pow(v,3)/32),AD=(21*v*v/16-55*Math.pow(v,4)/32),AE=(151*Math.pow(v,3)/96),AF=(1097*Math.pow(v,4)/512),w=AO+AC*Math.sin(2*AO)+AD*Math.sin(4*AO)+AE*Math.sin(6*AO)+AF*Math.sin(8*AO),AH=AA*AA/(1-AA*AA),AN=AH*Math.cos(w)*Math.cos(w),D=Math.tan(w)*Math.tan(w),AM=AG*(1-AK)/Math.pow(1-AK*Math.sin(w)*Math.sin(w),1.5),l=AG/Math.sqrt(1-AK*Math.sin(w)*Math.sin(w)),M=y/(l*b),a=l*Math.tan(w)/AM,m=(M*M/2),n=(5+3*D+10*AN-4*AN*AN-9*AH)*Math.pow(M,4)/24,o=(61+90*D+298*AN+45*D*D-3*AN*AN-252*AH)*Math.pow(M,6)/720,p=M,q=(1+2*D+AN)*Math.pow(M,3)/6,s=(5-2*AN+28*D-3*AN*AN+8*AH+24*D*D)*Math.pow(M,5)/120,x=(w-a*(m-n+o))*180/AJ,AB=u+((p-q+s)/Math.cos(w))*180/AJ;return{x:AB,y:x}},pixelLatLong:function(Y,b,Q,U,Z,d,f,c){var e=this.latLong2UTM(Q,U,c),V=(Z*1609.3)*(d/430),W=f/d*V;Y=parseInt(Y-d/2,10);b=parseInt(f/2-b,10);var R=((Y/d)*V)+e.x,T=((b/f)*W)+e.y,X=SEAT.PGUtil.utm2LatLong(R,T,c),S=parseFloat(SEAT.PGUtil.trunc(X.x+"",5)),a=parseFloat(SEAT.PGUtil.trunc(X.y+"",5));return{lon:S,lat:a}},pixelLatLongPoint:function(U,X,O,Q,V,M){var N=this.latLong2UTM(O,Q,M),R=(V*1609.3)*(U/430),S=(V*1609.3)*(X/430),T=SEAT.PGUtil.utm2LatLong(N.x+R,N.y+S,M),P=parseFloat(SEAT.PGUtil.trunc(T.x+0.000005+"",5)),W=parseFloat(SEAT.PGUtil.trunc(T.y+0.000005+"",5));return{lon:P,lat:W}},trunc:function(F,E){var D=F.lastIndexOf(".");if(D<0){return F}if(E>0){D+=1+E}if(D>F.length){return F}return F.substr(0,D)},isFilters:function(D){try{if(D.filters){return true}else{return false}}catch(C){return false}},addBckImg:function(H,F,G,I){var J;if(SEAT.PGUtil.isFilters(H)){H.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true "+(I||"")+' src="'+F+'")'}else{J='url("'+F+'") '+G;H.style.background=J}},isArray:function(B){return(B.constructor.toString().indexOf("Array")!==-1)},calcCoefficients:function(O,Q,P,V,U,S){var M=SEAT.PGUtil.latLong2UTM(parseFloat(O),parseFloat(Q),S),L=M.x+((P/2)-V),N=U+(P/2)-M.y,R=L/P,T=N/P;return{cox:R,coy:T}},augment:function(K,L){var M=K.prototype,J=L.prototype,H=arguments,N,I;if(H[2]){for(N=2;N<H.length;N=N+1){M[H[N]]=J[H[N]]}}else{for(I in J){if(!M[I]){M[I]=J[I]}}}},purge:function(H){var J=H.attributes,I,F,G;if(J){F=J.length;for(I=0;I<F;I+=1){G=J[I].name;if(typeof H[G]==="function"){H[G]=null}}}J=H.childNodes;if(J){F=J.length;for(I=0;I<F;I+=1){SEAT.PGUtil.purge(H.childNodes[I])}}},isPointInLine:function(M,P,N,Q,S,T,R){var U=R/2;N-=M;Q-=P;S-=M;T-=P;var V=S*N+T*Q;var O;if(V<=0){O=0}else{S=N-S;T=Q-T;V=S*N+T*Q;if(V<=0){O=0}else{O=V*V/(N*N+Q*Q)}}var L=S*S+T*T-O;if(L<0){L=0}return Math.sqrt(L)<U}};SEAT.Date={days:["Domenica","Luned&igrave;","Marted&igrave;","Mercolid&igrave;","Gioved&igrave;","Venerd&igrave;","Sabato"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],getDay:function(B){if(B>=0&&B<this.days.length){return this.days[B]}else{return""}},getMonth:function(B){if(B>=0&&B<this.months.length){return this.months[B]}else{return""}}};SEAT.EventMgr=function(){};SEAT.EventMgr.prototype={eventRegisterPre:function(E,F,D){},eventRegisterPost:function(E,F,D){},eventRegister:function(F,H,E){var G=true;if(!this.listenerList){this.listenerList=[]}$.each(this.listenerList,function(A,B){if(B.id===F&&B.fn===H&&B.scope===E){G=false;return false}});if(G){this.listenerList.push({id:F,fn:H,scope:E||null})}},eventFire:function(D,C){if(this.listenerList){$.each(this.listenerList,function(A,B){if(B.id===D){B.fn.call((B.scope||B.fn),C)}})}},eventDeRegisterPre:function(E,F,D){},eventDeRegisterPost:function(E,F,D){},eventDeRegister:function(F,G,H){var E=this;if(this.listenerList){$.each(this.listenerList,function(A,B){if(B&&B.id===F&&(!G||(G&&B.fn===G))&&(!H||(H&&B.scope===H))){E.listenerList.splice(A,1)}})}},eventDeRegisterAll:function(){this.listenerList=[]}};SEAT.DragDropMgr=function(){};SEAT.DragDropMgr.prototype={addDragDrop:function(){},removeDragDrop:function(){},dragDropAdd:function(E,F){var D=this;this.dragDropId=E;this.ddOpts={dragBefore:function(){},dragging:function(){},dragAfter:function(){}};$.extend(this.ddOpts,F);this.ddFnMouseDown=function(A){return D.dragDropMouseDown(A)};this.ddFnMouseMove=function(A){return D.dragDropMouseMove(A)};this.ddFnMouseUp=function(A){return D.dragDropMouseUp(A)};this.selDDEle=$("#"+E).bind("mousedown",this.ddFnMouseDown);$(document).bind("mousemove",this.ddFnMouseMove);$(document).bind("mouseup",this.ddFnMouseUp)},dragDropRemove:function(){if(this.selDDEle){this.selDDEle.unbind("mousedown",this.ddFnMouseDown);$(document).unbind("mousemove",this.ddFnMouseMove);$(document).unbind("mouseup",this.ddFnMouseUp)}this.mouseStart=null;this.eleStart=null;this.selDDEle=null},dragDropMouseDown:function(B){this.dragDropping=true;this.actuallyMoved=false;this.mouseStart={x:B.pageX,y:B.pageY};this.eleStart={left:parseInt(this.selDDEle.css("left"),10),right:parseInt(this.selDDEle.css("right"),10),top:parseInt(this.selDDEle.css("top"),10),bottom:parseInt(this.selDDEle.css("bottom"),10)};this.ddOpts.dragBefore.call(this.ddOpts.dragBefore,{e:B});return false},dragDropMouseMove:function(D){var C;if(this.dragDropping){this.actuallyMoved=true;C=this.dragDropGetChg(D);this.dragDropSetPos(C);this.ddOpts.dragging.call(this.ddOpts.dragging,{e:D,chg:C});return false}},dragDropMouseUp:function(D){var C;if(this.dragDropping){C=this.dragDropGetChg(D);if(C.x!==0||C.y!==0){this.dragDropSetPos(C)}this.dragDropping=false;if(this.actuallyMoved){this.ddOpts.dragAfter.call(this.ddOpts.dragAfter,{e:D,chg:C})}return false}},dragDropGetChg:function(D){var C={x:D.pageX,y:D.pageY};return{x:C.x-this.mouseStart.x,y:C.y-this.mouseStart.y}},dragDropSetPos:function(G){var F=this.eleStart,H=(F.left||F.left===0)?{left:F.left+G.x}:(F.right)?{right:F.right-G.x}:{},E=(F.top||F.top===0)?{top:F.top+G.y}:(F.bottom)?{bottom:F.bottom-G.y}:{};this.selDDEle.css(H).css(E)}};var PGDragDrop=function(){return{addDragDrop:function(B){if(B&&B.addDragDrop){B.addDragDrop()}},removeDragDrop:function(B){if(B&&B.removeDragDrop){B.removeDragDrop()}}}}();SEAT.ImgQ=function(B){this.p=B||{};this.p.concurReq=B.concurReq||4;this.p.imgTimeout=B.imgTimeout||50;this.p.onImgLoad=B.onImgLoad||function(){};this.numReq=0;this.Q=[]};SEAT.ImgQ.prototype={STS_QUEUED:"q",STS_REQUESTED:"r",STS_CALLING:"c",STS_DELETE:"d",queueImg:function(F,E){this.deQueueImg(F);var G,H=this.getAvaiable();if(H===null){G=this.Q.length;this.Q[G]={}}else{G=H}$.extend(this.Q[G],{id:F,imgName:E,sts:this.STS_QUEUED});if(this.numReq<this.p.concurReq){this.requestImg(G)}},deQueueAll:function(){var B=this;$.each(this.Q,function(A,D){B.deleteImg(A)})},deQueueImg:function(D){var C=this.isInQueue(D);if(C!==null){this.deleteImg(C)}},getAvaiable:function(){var C,D=null;for(C=0;C<this.Q.length;C+=1){if(this.Q[C].sts===this.STS_DELETE){D=C;break}}return D},isInQueue:function(D){var C;for(C=0;C<this.Q.length;C+=1){if(this.Q[C]&&this.Q[C].id===D){return C}}return null},requestImg:function(G){var J=this;this.numReq+=1;var H=function(){J.callImg(G)};var I=((this.numReq%this.p.concurReq)+1)*80;var F=window.setTimeout(H,I);$.extend(this.Q[G],{sts:this.STS_REQUESTED,tm:F})},deleteImg:function(B){if(this.Q[B].sts===this.STS_REQUESTED||this.Q[B].sts===this.STS_CALLING){this.numReq-=1}this.Q[B].id="";this.Q[B].imgName="";if(this.Q[B].tm){window.clearTimeout(this.Q[B].tm);this.Q[B].tm=null}if(this.Q[B].img){this.Q[B].img=null}this.Q[B].sts=this.STS_DELETE;this.checkQueue()},callImg:function(E){var D=this;$.extend(this.Q[E],{sts:this.STS_CALLING,tm:null,img:null});if(!this.Q[E].img){this.Q[E].img=new Image()}var F=function(){D.loadedImg(E)};this.Q[E].img.onload=F;this.Q[E].img.src=this.Q[E].imgName},loadedImg:function(B){this.p.onImgLoad(this.Q[B].id,this.Q[B].imgName,this.Q[B].img);this.deleteImg(B)},checkQueue:function(){var B;if(this.numReq<this.p.concurReq){for(B=0;B<this.Q.length;B+=1){if(this.Q[B].sts===this.STS_QUEUED&&this.numReq<this.p.concurReq){this.requestImg(B)}if(this.numReq>=this.p.concurReq){break}}}}};SEAT.GraphicsMgr=function(D){var C=this;this.id=D;$(window).unload(function(){C.unloadMe()})};SEAT.GraphicsMgr.prototype={unloadMe:function(){this.cvs=null;this.ctx=null},prepareCanvas:function(F,D,E){if(F!==this.containerId||D!==this.width||E!==this.height){this.removeCanvas()}this.containerId=F;this.width=D;this.height=E;if(!this.canvasExists()){this.createCanvas();this.ieFix();this.setContext()}},canvasExists:function(){return(this.cvs)?true:false},createCanvas:function(){var H=this,E=$("#"+this.containerId),F=E.css("z-index"),G=parseInt((F===undefined||F==="auto")?0:F,10)+1;this.cvsContId=this.containerId+"_cvsCont_"+this.id;$("<div></div>").attr({id:H.cvsContId}).css({position:"absolute",width:this.width,height:this.width,"z-index":G+""}).appendTo(E);this.cvsId=this.cvsContId+"_cvs";this.cvs=document.createElement("canvas");this.cvs.setAttribute("id",this.cvsId);this.cvs.setAttribute("width",this.width);this.cvs.setAttribute("height",this.width);$("#"+this.cvsContId)[0].appendChild(this.cvs);$("#"+this.cvsId).css({position:"absolute",left:0,top:0})},ieFix:function(){if(window.G_vmlCanvasManager){window.G_vmlCanvasManager.initElement(this.cvs)}},setContext:function(){this.ctx=$("#"+this.cvsId)[0].getContext("2d")},posCanvas:function(C,D){$("#"+this.cvsContId).css({left:C,top:D})},clearCanvas:function(){if(this.ctx){this.ctx.clearRect(0,0,this.width,this.height)}},removeCanvas:function(){if(this.cvs){this.cvs=null;this.ctx=null;$("#"+this.cvsContId).html("");$("#"+this.cvsContId).remove()}},drawLine:function(J,L,H,M){var K,N,I;this.setStrokeColour(L);this.setLineWidth(H);this.setOpacity(M);N=J.length;if(N>=2){this.ctx.lineJoin="round";this.ctx.beginPath();this.ctx.moveTo(J[0].x,J[0].y);for(K=0;K<N;K+=1){I=J[K];this.ctx.lineTo(I.x,I.y)}this.ctx.stroke();this.ctx.closePath()}},drawPolygon:function(I,K,L){var J,G,H;this.setFillColour(K);this.setOpacity(L);G=I.length;if(G>=2){this.ctx.beginPath();this.ctx.moveTo(I[0].x,I[0].y);for(J=0;J<G;J+=1){H=I[J];this.ctx.lineTo(H.x,H.y)}this.ctx.closePath();this.ctx.fill()}},setStrokeColour:function(B){this.ctx.strokeStyle="rgb("+B.r+", "+B.g+", "+B.b+")"},setFillColour:function(B){this.ctx.fillStyle="rgb("+B.r+", "+B.g+", "+B.b+")"},setLineWidth:function(B){this.ctx.lineWidth=""+B},setOpacity:function(B){if(B&&(B<0||B>1)){B=null}if(B){this.ctx.globalAlpha=B}}};SEAT.AnimateMgr=function(H,F,J,I,G){this.dur=H;this.cbStep=F;this.scStep=J;this.cbEnd=I;this.scEnd=G};SEAT.AnimateMgr.prototype={startAnimate:function(){var B=this;this.start=(new Date()).getTime();this.vNow=0;this.chg();this.tm=setInterval(function(){B.aStep(0,1)},15)},aStep:function(G,H){var I,J;var F=(new Date()).getTime();if(F>this.dur+this.start){if(this.tm){clearInterval(this.tm)}this.tm=null;this.vNow=H;this.chg();this.cbEnd.call(this.scEnd,this.vNow)}else{I=F-this.start;J=I/this.dur;this.vNow=((-Math.cos(J*Math.PI)/2)+0.5)*(H-G)+G;this.chg()}},chg:function(){this.cbStep.call(this.scStep,this.vNow)},isActive:function(){return Boolean(this.tm)},stopAnimate:function(){if(this.tm){clearInterval(this.tm)}this.tm=null;this.chg();this.cbEnd.call(this.scEnd,this.vNow)}};var KEY_ESC=27;var KEY_LEFT_ARROW=37;var KEY_RIGHT_ARROW=39;var KEY_UP_ARROW=38;var KEY_DOWN_ARROW=40;var PGMAP_TYPE_MAP=1;var PGMAP_TYPE_ORTO=2;var PGMAP_TYPE_MIXED=3;var PGMAP_ACTION_DRAG=1;var PGMAP_ACTION_ZOOM=2;var PGMAP_WWW="http://www.tuttocitta.it";var PGMAP_WWW_IMG_PFX="visualapi";var PGMAP_IMG_TYPE_LIGHT=2;var PGMAP_ZOOM_PAVEMENT=-3;var PGMAP_ZOOM_PAVEMENT_STREET=-2;var PGMAP_ZOOM_PAVEMENT_INTRA_STREET=-1;var PGMAP_ZOOM_STREET=0;var PGMAP_ZOOM_STREET_QUARTER=1;var PGMAP_ZOOM_QUARTER=2;var PGMAP_ZOOM_QUARTER_TOWN=3;var PGMAP_ZOOM_TOWN=4;var PGMAP_ZOOM_TOWN_PROVINCE=5;var PGMAP_ZOOM_PROVINCE=6;var PGMAP_ZOOM_PROVINCE_REGION=7;var PGMAP_ZOOM_REGION=8;var PGMAP_ZOOM_REGION_ITALY=9;var PGMAP_ZOOM_REGION_INTER_ITALY=9;var PGMAP_ZOOM_ITALY=10;var PGMAP_ZOOM_EUROPE=11;var PGMAP_TILE_OVER_MIXED=1;var PGMAP_TILE_OVER_STREET=2;SEAT.Map=function(N){var M={nameContainer:"mapcontainer",tileWidth:256,tileHeight:256,mapWidth:400,mapHeight:400,lng:1,mapType:PGMAP_TYPE_MAP,actionType:PGMAP_ACTION_DRAG,cursorDrag:"move",cursorZoom:"crosshair",lon:12.49353,lat:41.89504,minPixelsClick:3,quality:0,qualities:["85","75","55"],pgPoint:null,x:0,y:0,z:1,tmDispTileVal:1250,sito:"",tmDisp:1,tmLnk:1,dragEnabled:1,radarParent:null,imgHost:null,imgType:null,classNoPrint:"noprint",zone:32,extraZooms:false,tileOverLayers:0,minMapLevel:PGMAP_ZOOM_STREET,extraTilesAround:0,mapBackground:(N.imgType&&N.imgType===PGMAP_IMG_TYPE_LIGHT)?"#F0F2E8":"#DAD38F",compassImgs:[]};$.extend(M,N||{});if(M.pgPoint){M.lon=M.pgPoint.lon;M.lat=M.pgPoint.lat}M.zone=SEAT.PGUtil.getZone(M.lon,M.lat);var O=this,R,K,Q,J,L;function P(){R=new SEAT.Map.Model(M);J=new SEAT.Map.View(O,R,M);L=new SEAT.Map.Controller(J,R);J.setController(L);R.eventRegister("modelMapUpdate",J.update,J)}this.startUp=function(){R.notifyUpdate()};this.addLayer=function(A){A.setViewMap(J);A.setContMap(L);J.addLayer(A)};this.removeLayer=function(A){J.removeLayer(A)};this.setCenter=function(A,B){L.setLonLat(A,B)};this.getCenter=function(){return{lon:R.getLonLat().lon,lat:R.getLonLat().lat}};this.setCenterAndZoom=function(A,C,B){L.setLonLatAndZoom(A,C,B)};this.setDisabledZoom=function(A){R.setDisabledZoom(A)};this.getDisabledZoom=function(){return R.getDisabledZoom()};this.setZoom=function(A){L.setZoom(A)};this.getZoom=function(){return R.getZoom()};this.getZoomDist=function(){return J.model.zoomArray[R.getZIdx()]};this.getNewZoom=function(){return J.model.newVals.z};this.zoomIn=function(){L.zoomIn()};this.zoomOut=function(){L.zoomOut()};this.setSize=function(B,A){J.setSize(B,A)};this.getSize=function(){return{width:J.opts.mapWidth,height:J.opts.mapHeight}};this.setLng=function(A){J.setLng(A)};this.getLng=function(){return J.opts.lng};this.setMapType=function(A){L.setMapType(A)};this.getMapType=function(){return L.getMapType()};this.setTileOverLayers=function(A){L.setTileOverLayers(A)};this.getTileOverLayers=function(){return L.getTileOverLayers()};this.setActionType=function(A){J.setActionType(A)};this.setQuality=function(A){var B=parseInt(A,10);J.opts.quality=(B>=0&&B<J.opts.qualities.length)?B:0};this.panMapBy=function(B,A){J.panMapBy(B,A)};this.panMapTo=function(A,B){J.panMapTo(A,B)};this.getUpdated=function(){return J.updated};this.setUpdated=function(A){J.updated=A};this.getLonLatFromPixel=function(B,A){var C=SEAT.PGUtil.pixelLatLong(B,A,R.getLonLat().lon,R.getLonLat().lat,R.getZoomValueFromIdx(R.getZIdx()),J.opts.mapWidth,J.opts.mapHeight,J.opts.zone);return{lon:C.lon,lat:C.lat}};this.getPixelFromLonLat=function(F,G){var B=R.getConsts();var D=SEAT.PGUtil.calcCoefficients(F,G,B.mapWidthMeters,B.mapCentreUTMEasting,B.mapCentreUTMNorthing,J.opts.zone);var A=J.tileLayerMgr.getCurrentLayer();var E=(R.getCoefficients().cox*A.width)-(J.opts.mapWidth/2);var C=(R.getCoefficients().coy*A.height)-(J.opts.mapHeight/2);return{x:(D.cox*A.width)-E,y:(D.coy*A.height)-C}};this.getMapBounds=function(){return J.getMapBounds()};this.disableMap=function(){J.opts.dragEnabled=0};this.enableMap=function(){J.opts.dragEnabled=1};this.preventMapMouseDown=function(){J.setPreventMapMouseDown(true)};this.addRadar=function(A){J.addRadar(A)};this.getZoomIndex=function(A){return R.getZoomIndex(A)};this.getZoomValueFromIdx=function(A){return R.getZoomValueFromIdx(A)};this.moveToCoeff=function(A,B){J.moveToCoeff(A,B)};this.getZone=function(){return J.opts.zone};P()};SEAT.PGUtil.augment(SEAT.Map,SEAT.EventMgr);SEAT.Map.ID_LAYER_CONTAINER="mapLayerCont";SEAT.Map.PAN_DURATION=1000;SEAT.Map.View=function(F,E,G){this.myParent=F;this.mapModel=E;this.opts=G;this.model=null;this.initedUpdated=false;this.layerList=[];this.sel=$("#"+G.nameContainer).css({position:"relative",overflow:"hidden",background:G.mapBackground});this.chgMapSize();this.updateCursor();this.initEventListeners();this.tileLayerMgr=new SEAT.Map.TileLayerMgr(G);this.initZoomBox();if(this.opts.tmDisp===1){this.createLogoDiv()}var H=this;this.eventClickMap=function(A){var B=H.getMapContainerPos();var D={x:A.pageX,y:A.pageY};var K=(D.x-B.x);var L=(D.y-B.y);var C=H.myParent.getLonLatFromPixel(K,L);H.myParent.eventFire("click",{event:A,x:K,y:L,lon:C.lon,lat:C.lat})};this.createEventClick();$("#"+G.nameContainer).bind("mousedown",function(A){return H.cont.mouseDown(A)});$(document).bind("mousemove",function(A){return H.cont.mouseMove(A)});$(document).bind("mouseup",function(A){return H.cont.mouseUp(A)});if(!this.opts.radarParent){$("#"+G.nameContainer).bind("dblclick",function(A){return H.cont.dblClick(A)}).bind("keydown",function(A){return H.cont.keyDown(A)}).bind("keyup",function(A){return H.cont.keyUp(A)});$("#"+G.nameContainer).rightDblClick(function(A,B){H.cont.dblClick(B,true);return true});$("#"+G.nameContainer).mousewheel(function(B,A){B.preventDefault();return H.cont.mouseWheel(B,A)})}$(window).unload(function(){H.unloadMe()})};SEAT.Map.View.prototype={createEventClick:function(){if(!this.eventClickCreated){$("#"+this.opts.nameContainer).bind("click",this.eventClickMap);this.eventClickCreated=true}},destroyEventClick:function(){if(this.eventClickCreated){$("#"+this.opts.nameContainer).unbind("click",this.eventClickMap);this.eventClickCreated=false}},unloadMe:function(){this.sel=null;this.radar=null;this.radarBox=null},initEventListeners:function(){var B=this},setController:function(B){this.cont=B},addLayer:function(B){this.layerList.push(B);B.init()},removeLayer:function(B){B.remove();this.layerList=$.grep(this.layerList,function(D,A){return D!==B})},update:function(S){var O,N,Q,K,M,P,T,L;var R=false;this.model=S;this.tileLayerMgr.update(this.model);if(S.transType&&S.transType==="zoom"){if(S.startTrans){this.oldZ=S.z;this.newLon=S.newLon;this.newLat=S.newLat;this.updated=true;if(this.radar){L=this.checkZoomValue(this.model.newVals.z+3);this.radar.setCenterAndZoom(this.newLon,this.newLat,L)}}else{if(S.stepTrans){}else{if(S.endTrans){this.cont.setLonLat(this.newLon,this.newLat);this.myParent.eventFire("zoomaftermap",{oldZ:this.oldZ,z:S.z})}}}}else{if(S.transType&&S.transType==="pan"){O={x:this.startPan.chgX*S.now,y:this.startPan.chgY*S.now};if(S.startTrans){this.panning=true}else{if(S.stepTrans){N=O.x+this.startPan.startX;Q=O.y+this.startPan.startY;this.moveToSimple(N,Q,true)}else{if(S.endTrans){this.clearTmDispTile();this.panning=false;R=true}}}}else{if(this.initedUpdated){if(this.radar){if(!this.radar.getUpdated()){this.updated=true;this.radar.setCenter(S.lon,S.lat)}this.radar.setUpdated(false)}else{if(this.opts.radarParent){if(!this.opts.radarParent.getUpdated()){this.opts.radarParent.panMapTo(S.lon,S.lat,true);this.updated=true}this.opts.radarParent.setUpdated(false)}}}if(S.oldMapType){this.myParent.eventFire("typeaftermap",{oldMapType:S.oldMapType,mapType:S.mapType})}}}M=this.layerList.length;for(K=0;K<M;K+=1){this.layerList[K].updateMap(S)}if(R){this.cont.recalcLonLat({x:O.x+(this.recalcOffsetX||0),y:O.y+(this.recalcOffsetY||0)})}if(S.transType&&S.transType==="zoom"){if(S.endTrans){this.myParent.eventFire("zoomafter",{oldZ:this.oldZ,z:S.z})}}else{if(S.transType&&S.transType==="pan"){}else{if(S.oldMapType){this.myParent.eventFire("typeafter",{oldMapType:S.oldMapType,mapType:S.mapType})}}}this.initedUpdated=true},getMapPos:function(){var B=this.tileLayerMgr.getCurrentLayer();return{x:B.x,y:B.y}},getMapContainerPos:function(){var B=this.sel.offset();return{x:B.left,y:B.top,xTo:B.left+this.opts.mapWidth,yTo:B.top+this.opts.mapHeight}},moveTo:function(I,J,L){var K,G,H=this.tileLayerMgr.getCurrentLayer();this.moveToSimple(I,J,L);if(this.radar){K=((I*-1)+(this.opts.mapWidth/2))/H.width;G=((J*-1)+(this.opts.mapHeight/2))/H.height;this.radar.moveToCoeff(K,G)}},moveToSimple:function(I,J,G){var K,L=this;this.tileLayerMgr.showTileLayerHideOthers(this.tileLayerMgr.getCurrentLayerIdx());var H=this.tileLayerMgr.getCurrentLayer();H.moveTo(I,J);if(G&&!this.tmDispTile){K=function(){L.checkForTilesToDisplay();L.clearTmDispTile()};this.tmDispTile=window.setTimeout(K,this.opts.tmDispTileVal)}},checkForTilesToDisplay:function(){var E=this.tileLayerMgr.getCurrentLayer(),D=E.x*-1,F=E.y*-1;if(D<E.visiblePos.minX||(D+this.opts.mapWidth)>E.visiblePos.maxX||F<E.visiblePos.minY||(F+this.opts.mapHeight)>E.visiblePos.maxY){this.displayTiles()}},moveToCoeff:function(F,D){var E=this.tileLayerMgr.getCurrentLayer();this.moveToSimple(((F*E.width)-(this.opts.mapWidth/2))*-1,((D*E.height)-(this.opts.mapHeight/2))*-1,true)},clearTmDispTile:function(){if(this.tmDispTile){window.clearTimeout(this.tmDispTile);this.tmDispTile=null}},chgMapSize:function(){this.sel.css({width:this.opts.mapWidth,height:this.opts.mapHeight})},setSize:function(F,D){var E={oldWidth:this.opts.mapWidth,oldHeight:this.opts.mapHeight};this.opts.mapWidth=F;this.opts.mapHeight=D;this.chgMapSize();this.model.transType=null;this.model.oldMapType=null;this.model.oldZ=null;this.model.oldZIdx=null;this.update(this.model);$.extend(E,{width:F,height:D});this.myParent.eventFire("sizeaftermap",E);if(this.radar){this.radar.setSize(this.radar.getSize().width,this.radar.getSize().height)}$.each(this.layerList,function(A,B){B.updateMapSize()});this.myParent.eventFire("sizeafter",E)},setLng:function(C){var D={oldLng:this.opts.lng};this.opts.lng=C;this.model.transType=null;this.model.oldMapType=null;this.model.oldZ=null;this.model.oldZIdx=null;this.update(this.model);$.extend(D,{lng:C});this.myParent.eventFire("languageaftermap",D);if(this.radar){this.radar.setLng(C)}$.each(this.layerList,function(A,B){B.updateMapLanguage()});this.myParent.eventFire("languageafter",D)},setActionType:function(B){this.opts.actionType=(B===PGMAP_ACTION_DRAG||B===PGMAP_ACTION_ZOOM)?B:PGMAP_ACTION_DRAG;this.updateCursor()},panMapBy:function(G,H,E){var F=this.tileLayerMgr.getCurrentLayer();this.startPan={chgX:G,chgY:H,startX:F.x,startY:F.y};this.cont.panMapBy((E||E===0)?E:SEAT.Map.PAN_DURATION)},panMapTo:function(L,N){var I=SEAT.PGUtil.calcCoefficients(L,N,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);var J=this.model.cox-I.cox;var M=this.model.coy-I.coy;var H=(J*this.tileLayerMgr.getCurrentLayer().width);var K=(M*this.tileLayerMgr.getCurrentLayer().height);this.panMapBy(H,K)},updateCursor:function(){this.sel[0].style.cursor=(this.opts.actionType===PGMAP_ACTION_ZOOM)?this.opts.cursorZoom:this.opts.cursorDrag},initZoomBox:function(){this.idZoomBox=this.opts.nameContainer+"_zoomBox";var B='<div id="'+this.idZoomBox+'"></div>';$("body").append(B);$("#"+this.idZoomBox).css({position:"absolute",display:"none",overflow:"hidden",zIndex:"250",border:"3px solid #4144AE"})},zoomBoxActivate:function(J,M){var N=(J.x<M.x)?J.x:M.x;var P=(J.x>M.x)?J.x:M.x;var I=(J.y<M.y)?J.y:M.y;var K=(J.y>M.y)?J.y:M.y;if(N<this.getMapContainerPos().x){N=this.getMapContainerPos().x}var L=parseInt($("#"+this.idZoomBox).css("borderLeftWidth"),10)*2;if((P+L)>this.getMapContainerPos().xTo){P=this.getMapContainerPos().xTo-L}if(I<this.getMapContainerPos().y){I=this.getMapContainerPos().y}var O=parseInt($("#"+this.idZoomBox).css("borderTopWidth"),10)*2;if((K+O)>this.getMapContainerPos().yTo){K=(this.getMapContainerPos().yTo-O)}if((P-N>=this.opts.minPixelsClick)||(K-I>=this.opts.minPixelsClick)){this.zoomBoxShow()}$("#"+this.idZoomBox).css({left:N+"px",top:I+"px",width:P-N+"px",height:K-I+"px"})},zoomBoxMouseUp:function(I,M){this.zoomBoxHide();var L=I.x-this.getMapContainerPos().x;var J=I.y-this.getMapContainerPos().y;var N=M.x-this.getMapContainerPos().x;var K=M.y-this.getMapContainerPos().y;if(N<0){N=0}if(N>this.opts.mapWidth){N=this.opts.mapWidth}if(K<0){K=0}if(K>this.opts.mapHeight){K=this.opts.mapHeight}var H=SEAT.PGUtil.pixelLatLong(parseInt((L+N)/2,10),parseInt((J+K)/2,10),this.model.lon,this.model.lat,this.myParent.getZoomValueFromIdx(this.model.zIdx),this.opts.mapWidth,this.opts.mapHeight,this.opts.zone);this.cont.setLonLatAndZoom(H.lon,H.lat,this.zoomBoxGetNewZoom())},zoomBoxGetNewZoom:function(){var F=this.model.zIdx;var H=$("#"+this.idZoomBox).width();var G=$("#"+this.idZoomBox).height();var E=(H<G)?H:G;if(F>0){F-=1;if((F>0)&&(parseInt(E,10)<this.opts.mapWidth/3)){F-=1}}return this.cont.calcZFromIdx(F)},zoomBoxShow:function(){$("#"+this.idZoomBox).show()},zoomBoxHide:function(){$("#"+this.idZoomBox).hide()},zoomBoxCancel:function(){this.zoomBoxHide()},createLogoDiv:function(){var F=this;this.idWWW=this.opts.nameContainer+"_WWW";var I='<div id="'+this.idWWW+'">www.tuttocitta.it</div>';var J=$(I).appendTo("#"+this.opts.nameContainer);J.css({position:"absolute",width:"150px",height:"27px",fontFamily:"verdana",fontSize:"11px",zIndex:"999",top:"5px",right:"20px"});this.idLogo=this.opts.nameContainer+"_logo";var G='<div id="'+this.idLogo+'"><div style="float:left;"><img src="http://img.tuttocitta.it/tcolnew/img/PGvisual_watermark.gif" width="112" height="27" /></div><div style="float:left;padding-top:5px;">&nbsp;&copy;2009 Navteq</div></div>';var H=$(G).appendTo("#"+this.opts.nameContainer);H.css({position:"absolute",width:"200px",height:"27px",fontFamily:"verdana",fontSize:"11px",zIndex:"999",bottom:"5px",left:"10px"});if(this.opts.tmLnk===1){J.css({cursor:"pointer"}).click(function(){F.openVisual()});H.find("img").css({cursor:"pointer"}).click(function(){F.openVisual()})}},openVisual:function(){window.open(PGMAP_WWW)},addRadar:function(H){H=H||{};H.width=H.width||150;H.height=H.height||100;var G=this.opts.nameContainer+"_radar";var I=$('<div id="'+G+'_wrap"><div id="'+G+'"></div></div>').css({position:"absolute",width:H.width,height:H.height,border:"4px solid #000","z-index":999,background:"#fff"}).appendTo(this.sel);var F={};if(H.top){$.extend(F,{top:H.top})}else{if(H.bottom){$.extend(F,{bottom:H.bottom})}else{$.extend(F,{top:20})}}if(H.left){$.extend(F,{left:H.left})}else{if(H.right){$.extend(F,{right:H.right})}else{$.extend(F,{right:10})}}I.css(F);var J=this.model.z<9?this.model.z+3:this.model.z;this.radar=new SEAT.PGMappy({nameContainer:G,radarParent:this.myParent,lon:this.model.lon,lat:this.model.lat,mapWidth:H.width,mapHeight:H.height,z:J,tmDisp:0,sito:this.opts.sito,imgHost:this.opts.imgHost,imgType:this.opts.imgType,zone:this.opts.zone,extraTilesAround:0,mapBackground:this.opts.mapBackground});this.radarBox=new SEAT.RadarBox();this.radar.addLayer(this.radarBox)},setPreventMapMouseDown:function(B){this.preventMapMove=B},getPreventMapMouseDown:function(){return this.preventMapMove},displayTiles:function(){this.tileLayerMgr.displayTiles()},calcZIdx:function(B){return this.cont.calcZIdx(B)},getZoomIndex:function(B){return this.cont.getZoomIndex(B)},checkZoomValue:function(B){return this.cont.checkZoomValue(B)},getMapBounds:function(){var E=this.myParent.getLonLatFromPixel(0,0);var G=this.myParent.getLonLatFromPixel(this.opts.mapWidth,0);var F=this.myParent.getLonLatFromPixel(0,this.opts.mapHeight);var H=this.myParent.getLonLatFromPixel(this.opts.mapWidth,this.opts.mapHeight);return{topLeft:{lon:E.lon,lat:E.lat},topRight:{lon:G.lon,lat:G.lat},botLeft:{lon:F.lon,lat:F.lat},botRight:{lon:H.lon,lat:H.lat}}}};SEAT.Map.Controller=function(D,C){this.view=D;this.mapModel=C};SEAT.Map.Controller.prototype={mouseDown:function(D){var C=true;if(!this.view.getPreventMapMouseDown()){this.view.myParent.eventFire("mousedownbefore",{event:D});this.view.clearTmDispTile();if(this.view.opts.actionType===PGMAP_ACTION_DRAG&&this.view.opts.dragEnabled!==1){}else{this.dragging=true}this.okToDrag=true;if(this.view.panning){this.view.panning=false;this.mapModel.stopTransition()}this.mouseStart={x:D.pageX,y:D.pageY};this.mapLayerContStart=this.view.getMapPos();if(this.view.opts.actionType===PGMAP_ACTION_ZOOM){this.zoomBoxing=true;this.view.zoomBoxActivate(this.mouseStart,this.mouseStart)}this.view.myParent.eventFire("mousedownafter",{event:D});C=false}return C},mouseMove:function(G){var H=true;var I,J,F=this;if(!this.view.getPreventMapMouseDown()){if(this.dragging){if(this.okToDrag){this.view.destroyEventClick();this.view.myParent.eventFire("mousemovebefore",{event:G});if(this.view.opts.actionType===PGMAP_ACTION_ZOOM){if(this.zoomBoxing){this.view.zoomBoxActivate(this.mouseStart,{x:G.pageX,y:G.pageY})}}else{J=this.getChg(G);this.setPos(J,true)}this.okToDrag=false;setTimeout(function(){F.okToDrag=true},20);this.view.myParent.eventFire("mousemoveafter",{event:G})}H=false}}return H},mouseUp:function(F){var G,H,E=this;if(!this.view.getPreventMapMouseDown()){H=this.isMouseOverMap(F);if(H){this.view.myParent.eventFire("mouseupbefore",{event:F})}if(this.dragging){this.view.myParent.eventFire("mouseupmapbefore",{event:F});this.dragging=false;setTimeout(function(){E.view.createEventClick()},0);if(this.view.opts.actionType===PGMAP_ACTION_ZOOM){if(this.zoomBoxing){this.view.zoomBoxMouseUp(this.mouseStart,{x:F.pageX,y:F.pageY});this.zoomBoxing=false}}else{this.view.clearTmDispTile();G=this.getChg(F);if(G.x!==0||G.y!==0){this.setPos(G,false);this.recalcLonLat(G)}}this.view.myParent.eventFire("mouseupmapafter",{event:F})}if(H){this.view.myParent.eventFire("mouseupafter",{event:F})}}this.view.setPreventMapMouseDown(false);return true},dblClick:function(J,K){var M={x:J.pageX,y:J.pageY};var N=M.x-(this.view.getMapContainerPos().x+this.view.opts.mapWidth/2);var I=M.y-(this.view.getMapContainerPos().y+this.view.opts.mapHeight/2);var H=SEAT.PGUtil.pixelLatLongPoint(N,-I,this.view.model.lon,this.view.model.lat,parseFloat(this.view.model.zoomArray[this.view.model.zIdx]),this.view.opts.zone);var L=(K)?this.view.model.z+1:this.view.model.z-1;this.setLonLatAndZoom(H.lon,H.lat,L);return false},keyDown:function(D){var C=10;if(!this.keyDownStarted){this.mapLayerContStart=this.view.getMapPos();this.keyDownStarted=true;this.keyChg={x:0,y:0}}if(this.zoomBoxing&&D.keyCode===KEY_ESC){this.zoomBoxing=false;this.view.zoomBoxCancel();return false}else{if(D.keyCode===KEY_LEFT_ARROW){this.keyChg.x+=C;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(D.keyCode===KEY_RIGHT_ARROW){this.keyChg.x-=C;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(D.keyCode===KEY_UP_ARROW){this.keyChg.y+=C;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(D.keyCode===KEY_DOWN_ARROW){this.keyChg.y-=C;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}}}}}return true},keyUp:function(B){if(B.keyCode===KEY_LEFT_ARROW||B.keyCode===KEY_RIGHT_ARROW||B.keyCode===KEY_UP_ARROW||B.keyCode===KEY_DOWN_ARROW){this.recalcLonLat({x:this.keyChg.x,y:this.keyChg.y})}this.keyDownStarted=false},mouseWheel:function(F,E){var D=(E>0)?this.view.model.z-1:this.view.model.z+1;this.setZoom(D);return false},getChg:function(D){var C={x:D.pageX,y:D.pageY};return{x:C.x-this.mouseStart.x,y:C.y-this.mouseStart.y}},setPos:function(E,D){var F={x:this.mapLayerContStart.x+E.x,y:this.mapLayerContStart.y+E.y};this.view.moveTo(F.x,F.y,D)},recalcLonLat:function(G){var H=(parseInt(this.view.opts.mapWidth,10)/2)-G.x;var F=(parseInt(this.view.opts.mapHeight,10)/2)-G.y;var E=SEAT.PGUtil.pixelLatLong(H,F,this.mapModel.model.lon,this.mapModel.model.lat,parseFloat(this.mapModel.model.zoomArray[this.mapModel.model.zIdx]),this.view.opts.mapWidth,this.view.opts.mapHeight,this.view.opts.zone);this.mapModel.setLonLat(E.lon,E.lat)},panMapBy:function(B){this.mapModel.transition(B,{transType:"pan"})},setLonLat:function(D,C){this.mapModel.setLonLat(D,C)},setLonLatAndZoom:function(E,D,F){this.mapModel.setLonLatAndZoom(E,D,F)},setZoom:function(B){this.mapModel.setZoom(B)},zoomIn:function(){this.mapModel.zoomIn()},zoomOut:function(){this.mapModel.zoomOut()},setMapType:function(B){this.mapModel.setMapType(B)},getMapType:function(){return this.mapModel.getMapType()},setTileOverLayers:function(B){this.mapModel.setTileOverLayers(B)},getTileOverLayers:function(){return this.mapModel.getTileOverLayers()},calcZIdx:function(B){return this.mapModel.calcZIdx(B)},calcZFromIdx:function(B){return this.mapModel.calcZFromIdx(B)},getZoomIndex:function(B){return this.mapModel.getZoomIndex(B)},checkZoomValue:function(B){return this.mapModel.checkZoomValue(B)},isMouseOverMap:function(E){var F={x:E.pageX,y:E.pageY};var D=this.view.getMapContainerPos();return((F.x>=D.x)&&(F.x<=D.xTo)&&(F.y>=D.y)&&(F.y<=D.yTo))}};SEAT.Map.Model=function(B){this.model={mapWidthLevel1Pixel:33554432,mapWidthMeters:4709238.7,mapCentreUTMEasting:637855.35,mapCentreUTMNorthing:5671353.65,zoomArray:(B.extraZooms)?[0.0375,0.075,0.15,0.3,0.6,1.2,2.4,4.8,9.6,19.2,38.4,76.8,153.6,307.2,614.4,1228.8]:[0.0375,0.075,0.15,0.3,0.6,1.2,2.4,4.8,9.6,19.2,38.4,76.8,153.6,614.4,1228.8],zoomArrayCent:(B.extraZooms)?[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]:[1,2,3,4,5,6,7,8,9,10,11,12,13,15,16],mapType:B.mapType,tileOverLayers:B.tileOverLayers,minMapLevel:B.minMapLevel,lon:B.lon,lat:B.lat,cox:0,coy:0,zIdx:0,z:B.z,zone:B.zone,extraZooms:B.extraZooms,disabledZoom:B.disabledZoom||[]};this.model.zIdx=this.calcZIdx(this.model.z);if(this.model.zone===35){this.model.mapCentreUTMNorthing=4533619.12}if(this.model.extraZooms){PGMAP_ZOOM_REGION_INTER_ITALY=10;PGMAP_ZOOM_ITALY=11;PGMAP_ZOOM_EUROPE=12}this.extra={};this.calcCoefficients()};SEAT.Map.Model.prototype={transition:function(G,F,H){var E=this;this.stopTransition();this.newVals=H||{};this.transExtra=F;$.extend(this.extra,this.transExtra,{startTrans:true},{newVals:this.newVals});this.notifyUpdate();this.anim=new SEAT.AnimateMgr(G,E.transitionStep,E,E.transitionEnd,E);this.anim.startAnimate()},transitionStep:function(B){$.extend(this.extra,this.transExtra,{stepTrans:true,now:B},{newVals:this.newVals});this.notifyUpdate()},transitionEnd:function(B){$.extend(this.model,this.newVals);$.extend(this.extra,this.transExtra,{endTrans:true,now:B});this.transExtra=null;this.anim=null;this.notifyUpdate()},stopTransition:function(){if(this.anim){this.anim.stopAnimate()}this.transExtra=null},setDisabledZoom:function(B){this.model.disabledZoom=B},getDisabledZoom:function(){return this.model.disabledZoom},setZoom:function(F,H){var G,E=false;$.each(this.model.disabledZoom,function(A,B){if(parseInt(B,10)===parseInt(F,10)){E=true;return false}});if(!E){F=this.checkZoomValue(F);H=H||{};if(!H.newLon||!H.newLat){H.newLon=this.model.lon;H.newLat=this.model.lat;H.newCox=this.model.cox;H.newCoy=this.model.coy}G={z:F,zIdx:this.calcZIdx(F)};this.transition(500,$.extend(H,{transType:"zoom"}),G)}},zoomIn:function(){var B=this.model.z-1;this.setZoom(B)},zoomOut:function(){var B=this.model.z+1;this.setZoom(B)},checkZoomValue:function(D){D=parseInt(D,10);var C=this.model.zoomArray.length-1-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS;if(D<-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS){D=-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS}else{if(D>=C){D=C}}if((this.model.mapType===PGMAP_TYPE_MAP)&&(D<this.model.minMapLevel)){D=this.model.minMapLevel}return D},calcZIdx:function(B){return B+SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS},calcZFromIdx:function(B){return B-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS},calcCoefficients:function(){var B=SEAT.PGUtil.calcCoefficients(this.model.lon,this.model.lat,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);this.model.cox=B.cox;this.model.coy=B.coy},setLonLat:function(D,C){this.model.lon=D;this.model.lat=C;this.calcCoefficients();this.notifyUpdate()},setLonLatAndZoom:function(H,J,I){var G=SEAT.PGUtil.calcCoefficients(H,J,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);var F={newLon:H,newLat:J,newCox:G.cox,newCoy:G.coy};this.setZoom(I,F)},setMapType:function(D){var C;if((D===PGMAP_TYPE_MAP||D===PGMAP_TYPE_ORTO||D===PGMAP_TYPE_MIXED)&&D!==this.model.mapType){$.extend(this.extra,{oldMapType:this.model.mapType});this.model.mapType=D;C=this.checkZoomValue(this.model.z);if(C!==this.model.z){this.setZoom(C)}else{this.notifyUpdate()}}},getMapType:function(){return this.model.mapType},setTileOverLayers:function(B){if(B!==this.model.tileOverLayers){$.extend(this.extra,{oldTileOverLayers:this.model.tileOverLayers});this.model.tileOverLayers=B;this.notifyUpdate()}},getTileOverLayers:function(){return this.model.tileOverLayers},notifyUpdate:function(){var B=$.extend({},this.model,this.extra);this.extra={};this.eventFire("modelMapUpdate",B)},getLonLat:function(){return{lon:this.model.lon,lat:this.model.lat}},getZoom:function(){return this.model.z},getZIdx:function(){return this.model.zIdx},getCoefficients:function(){return{cox:this.model.cox,coy:this.model.coy}},getConsts:function(){return{mapWidthLevel1Pixel:this.model.mapWidthLevel1Pixel,mapWidthMeters:this.model.mapWidthMeters,mapCentreUTMEasting:this.model.mapCentreUTMEasting,mapCentreUTMNorthing:this.model.mapCentreUTMNorthing}},getZoomIndex:function(E){var F;var D=this.model.zoomArray.length-1;for(F=3;F<this.model.zoomArray.length;F+=1){if(E<=parseFloat(this.model.zoomArray[F])){D=F;break}}return this.calcZFromIdx(D)},getZoomValueFromIdx:function(B){return parseFloat(this.model.zoomArray[B])}};SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS=3;SEAT.PGUtil.augment(SEAT.Map.Model,SEAT.EventMgr);SEAT.Map.TileLayer=function(H,I,J,G){var L=this,K='<div id="'+H+'"></div>';this.id=H;this.opts=I;this.sel=$(K).appendTo("#"+I.nameContainer).css({position:"absolute"});this.setSize(J,G);this.width=J;this.height=G;this.x=0;this.y=0;this.visiblePos={minX:0,maxX:0,minY:0,maxY:0};this.tiles=[];this.eta=0;this.imgQ=new SEAT.ImgQ({onImgLoad:function(A,B){L.imgLoad(A,B)}});this.hideZ();this.imgTrans=new Image();this.imgTrans.src="http://img.tuttocitta.it/nuovotcol/img/trans_point.gif";$(window).unload(function(){L.unloadMe()})};SEAT.Map.TileLayer.prototype={IMG_ID_PART_MAP:"tile",IMG_ID_PART_MIXED:"otile1",IMG_ID_PART_STREET:"otile2",OPACITY_STREET_IMG:0.5,unloadMe:function(){this.sel=null;this.ij=null;this.imgQ=null;this.imgTrans=null;this.tiles=null},setSize:function(C,D){this.width=C;this.height=D;this.sel.css({width:C,height:D})},addTileToList:function(J,G,I,K,L,H){this.tiles.push({sel:J,selImg:G,tp:I,i:K,j:L,id:H})},getTilesByType:function(B){return $.grep(this.tiles,function(D,A){return(D.tp===B)})},getATile:function(F,H,G){var E=null;$.each(this.tiles,function(A,B){if((B.tp===F)&&(B.i===H)&&(B.j===G)){E=B;return false}});return E},removeTilesByType:function(B){this.tiles=$.grep(this.tiles,function(D,A){return(D.tp!==B)})},removeAllTilesFromQ:function(){var B=this;$.each(this.imgQ.Q,function(A,D){if((D.id!=="")&&(D.id.indexOf(B.id+"_")>-1)){B.imgQ.deQueueImg(D.id)}})},displayTiles:function(G,H,I,K,J,L){this.eta=L;this.iFrom=H;this.iTo=I;this.jFrom=K;this.jTo=J;this.displayTilesType(G,H,I,K,J,this.IMG_ID_PART_MAP,null);if(G.mapType===PGMAP_TYPE_MIXED&&G.z>=0){this.displayTilesType(G,H,I,K,J,this.IMG_ID_PART_MIXED,PGMAP_TILE_OVER_MIXED)}if(G.tileOverLayers&PGMAP_TILE_OVER_STREET){this.displayTilesType(G,H,I,K,J,this.IMG_ID_PART_STREET,PGMAP_TILE_OVER_STREET)}},displayTilesType:function(o,c,k,j,X,i,p){var g=this,W=this.getTilesByType(i),f=Math.floor(c+((k-c)/2)),a=Math.ceil(j+((X-j)/2)),V=1,l=0,e=0,n=0,h,m,Y=true,b,d,Z=[];$.each(this.imgQ.Q,function(A,B){var C,E,D;if(B.id!==""){C=B.id.split("_");E=parseInt(C[C.length-2],10);D=parseInt(C[C.length-1],10);if(B.id.indexOf(g.id+"_"+i+"_")>-1&&(E<c||E>k||D>j||D>X)){g.imgQ.deQueueImg(B.id)}}});this.visiblePos={minX:c*this.opts.tileWidth,maxX:(k+1)*this.opts.tileWidth,minY:j*this.opts.tileHeight,maxY:(X+1)*this.opts.tileHeight};$.each(W,function(A,B){if((B.i<c)||(B.i>k)||(B.j<j)||(B.j>X)){B.selImg.hide()}else{if(B.selImg.attr("src")!==g.imgTrans.src){B.selImg.show()}else{B.selImg.hide()}}});for(b=c;b<=k;b+=1){for(d=j;d<=X;d+=1){Z.push({i:b,j:d,displayed:false})}}while(Y){if(f>=c&&f<=k&&a>=j&&a<=X){h=this.getATile(i,f,a);if(h===null){m=null;W=this.getTilesByType(i);$.each(W,function(A,B){if((B.i<c)||(B.i>k)||(B.j<j)||(B.j>X)){m=B;return false}});if(m!==null){this.modifyATile(o,m,f,a,p)}else{this.createATile(o,f,a,p)}}else{if(!h.selImg.is(":visible")){this.modifyATile(o,h,f,a,p)}}$.each(Z,function(A,B){if(B.i===f&&B.j==a){B.displayed=true;return false}})}if(e===0){f+=1}else{if(e===1){a-=1}else{if(e===2){f-=1}else{if(e===3){a+=1}}}}l+=1;if(l>=V){l=0;e=(e<3)?e+=1:0;if((n%2)===1){V+=1}n+=1}Y=false;$.each(Z,function(A,B){if(!B.displayed){Y=true;return false}})}},getTileId:function(D,E,F){return(this.id+"_"+D+"_"+E+"_"+F)},removeAllTiles:function(B){if(B===null){this.removeAllTilesType(this.IMG_ID_PART_MAP)}if((B===null)||!(B&PGMAP_TILE_OVER_MIXED)){this.removeAllTilesType(this.IMG_ID_PART_MIXED)}if((B===null)||!(B&PGMAP_TILE_OVER_STREET)){this.removeAllTilesType(this.IMG_ID_PART_STREET)}},removeAllTilesType:function(B){$.each(this.getTilesByType(B),function(A,D){D.selImg.remove();D.selImg=null;D.sel.remove();D.sel=null});this.removeTilesByType(B)},showZ:function(){this.sel.css({"z-index":SEAT.Map.TileLayer.ZINDEX_SHOW})},showMe:function(){this.sel.show()},showBelow:function(){this.sel.css({"z-index":SEAT.Map.TileLayer.ZINDEX_SHOW_BELOW})},hideZ:function(){this.sel.css({"z-index":SEAT.Map.TileLayer.ZINDEX_HIDE})},hide2:function(){this.sel.hide()},moveTo:function(C,D){this.x=C;this.y=D;this.sel.css({left:C,top:D})},createATile:function(H,G,E,F){if(F===null){this.createATileType(G,E,this.IMG_ID_PART_MAP,"100",this.imageSrc(H,G,E))}else{if(F===PGMAP_TILE_OVER_MIXED){this.createATileType(G,E,this.IMG_ID_PART_MIXED,"101",this.imageSrc(H,G,E,PGMAP_TILE_OVER_MIXED))}else{if(F===PGMAP_TILE_OVER_STREET){this.createATileType(G,E,this.IMG_ID_PART_STREET,"102",this.imageSrc(H,G,E,PGMAP_TILE_OVER_STREET))}}}},createATileType:function(L,M,P,R,O){var N=this.getTileId(P,L,M),K="d"+N,T='<div id="'+K+'"><img id="'+N+'" galleryimg="no"/></div>',S=$(T).appendTo(this.sel).attr({name:K}).css({top:(M*this.opts.tileHeight),left:(L*this.opts.tileWidth),width:this.opts.tileWidth,height:this.opts.tileHeight,overflow:"hidden",position:"absolute",border:"0px",padding:"0 0 0 0",margin:"0 0 0 0",zIndex:R});var Q=S.find("img").attr({name:N,src:this.imgTrans.src}).css({width:this.opts.tileWidth,height:this.opts.tileHeight}).hide();this.addTileToList(S,Q,P,L,M,K);this.imgQ.queueImg(N,O)},modifyATile:function(L,N,K,M,J){var H=(J!==null)?"otile"+J:this.IMG_ID_PART_MAP,I=this.getTileId(H,K,M);N.selImg.hide().attr({src:this.imgTrans.src});N.sel.attr({id:"d"+I,name:"d"+I}).css({left:(K*this.opts.tileWidth),top:(M*this.opts.tileHeight)});N.selImg.attr({id:I,name:I});N.i=K;N.j=M;N.id="d"+I;this.imgQ.queueImg(I,this.imageSrc(L,K,M,J))},imgLoad:function(E,F){var D=this;$.each(this.tiles,function(A,B){if(B.id==="d"+E){B.selImg.attr({src:F});if(E.indexOf("_"+D.IMG_ID_PART_STREET+"_")>-1){B.selImg.css({opacity:D.OPACITY_STREET_IMG})}D.imgShow(B.selImg)}})},imgShow:function(B){B.show()},imageSrc:function(P,Q,R,K){var M,O,L,N,J;if(Q>=0&&R>=0){O=P.zoomArrayCent[P.zIdx];L=Math.pow(2,O-1);N=this.opts.imgHost||"http://visualimages"+((Q%2)+1)+".paginegialle.it";if(K===PGMAP_TILE_OVER_MIXED){M=N+"/xmlpng_miste.php/europa-pngmix.imgi?cmd=tile&x="+Q+"&y="+R+"&z="+L+"&extra=2&ts="+this.opts.tileWidth+"&utm="+this.opts.zone+"&sito="+this.opts.sito+"&v=1"}else{if(K===PGMAP_TILE_OVER_STREET){M=N+"/streetview_get.php?x="+Q+"&y="+R+"&z="+O}else{if((P.mapType===PGMAP_TYPE_MAP)&&this.opts.imgType&&(this.opts.imgType===PGMAP_IMG_TYPE_LIGHT)){M=N+"/xmlpng.php/europa-png.imgi?cmd=tile&x="+Q+"&y="+R+"&z="+L+"&extra=2&ts="+this.opts.tileWidth+"&utm="+this.opts.zone+"&sito="+this.opts.sito+"&v=5"}else{J="europa.imgi";if(P.mapType===PGMAP_TYPE_ORTO){J="europa-orto.imgi"}else{if(P.mapType===PGMAP_TYPE_MIXED){J="europa-orto.imgi"}}N=this.opts.imgHost||"http://"+PGMAP_WWW_IMG_PFX+((Q%4)+1)+".paginegialle.it";M=N+"/xml.php/"+J+"?cmd=tile&format=jpeg&x="+Q+"&y="+R+"&z="+L+"&q="+this.opts.qualities[this.opts.quality]+"&extra=2&ts="+this.opts.tileWidth+"&sito="+this.opts.sito}}}}return M},update:function(H){var I,J=this,G,F;if(H.transType&&H.transType==="zoom"){if(H.startTrans){if(this.startSize&&this.ij&&this.ij.length>0){$.each(this.ij,function(A){this.tile.css({left:J.width*this.cox,top:J.height*this.coy,width:J.startSize.width,height:J.startSize.height});this.img.css({width:J.startSize.width,height:J.startSize.height})})}this.startSize={width:this.opts.tileWidth,height:this.opts.tileHeight};r=Math.pow(2,(H.zoomArrayCent[H.zIdx]-1)-(H.zoomArrayCent[H.newVals.zIdx]-1));G=(r>0)?(this.opts.tileWidth*r):(this.opts.tileWidth/-r);F=(r>0)?(this.opts.tileHeight*r):(this.opts.tileHeight/-r);this.chgSize={x:G-this.startSize.width,y:F-this.startSize.height};I=this.getTilesByType(this.IMG_ID_PART_MAP);this.ij=[];$.each(I,function(A,B){var C=(B.i*J.opts.tileWidth)/J.width,D=(B.j*J.opts.tileHeight)/J.height;if((B.i>=(J.iFrom+J.eta))&&(B.i<=(J.iTo-J.eta))&&(B.j>=(J.jFrom+J.eta))&&(B.j<=(J.jTo-J.eta))){J.ij.push({tile:B.sel,img:B.selImg,i:B.i,j:B.j,cox:C,coy:D});B.selImg.show()}else{B.selImg.hide()}})}else{if(H.stepTrans){this.posSizeTiles(H)}else{if(H.endTrans){this.posSizeTiles(H)}}}}else{if(H.transType&&H.transType==="pan"){}else{}}},posSizeTiles:function(G){var F,H,E=this;$.each(this.ij,function(A){F=E.startSize.width+(E.chgSize.x*G.now);H=E.startSize.height+(E.chgSize.y*G.now);this.tile.css({left:E.width*this.cox,top:E.height*this.coy,width:F,height:H});this.img.css({width:F,height:H})})}};SEAT.Map.TileLayer.ZINDEX_SHOW=100;SEAT.Map.TileLayer.ZINDEX_SHOW_BELOW=99;SEAT.Map.TileLayer.ZINDEX_HIDE=98;SEAT.Map.TileLayerMgr=function(B){this.opts=B;this.tileLayerList=[];this.inited=false};SEAT.Map.TileLayerMgr.prototype={initTileLayers:function(E){var G,H,F=E.zoomArrayCent.length;for(G=0;G<F;G+=1){H=this.getSizeForZoom(E,G);this.addTileLayer(new SEAT.Map.TileLayer(this.opts.nameContainer+"_z_"+G,this.opts,H.width,H.height))}this.inited=true},addTileLayer:function(B){this.tileLayerList.push(B)},update:function(L){var N,I,K,H,J,M;this.model=L;if(!this.inited){this.initTileLayers(L)}if(L.transType&&L.transType==="zoom"){if(L.startTrans){if(this.startLayer){this.startLayer.setSize(this.startDim.width,this.startDim.height);this.startLayer.moveTo(this.startPos.x,this.startPos.y);this.startLayer.update(L)}this.setPosLayer(this.getNewLayer(),L);this.showTileLayerHideOthers(L.zIdx,L.newVals.zIdx);this.startLayer=this.getCurrentLayer();this.startLayer.removeAllTilesFromQ();this.startDim={width:this.startLayer.width,height:this.startLayer.height};this.endDim={width:this.getNewLayer().width,height:this.getNewLayer().height};this.chgDim={x:this.endDim.width-this.startLayer.width,y:this.endDim.height-this.startLayer.height};this.zoomCoeff={cox:L.newCox,coy:L.newCoy};this.startPos={x:this.startLayer.x,y:this.startLayer.y};J=((this.zoomCoeff.cox*this.getNewLayer().width)*-1)+(this.opts.mapWidth/2);M=((this.zoomCoeff.coy*this.getNewLayer().height)*-1)+(this.opts.mapHeight/2);this.endPos={left:J,top:M};this.chgPos={x:J-this.startLayer.x,y:M-this.startLayer.y}}else{if(L.stepTrans){K=this.startDim.width+(this.chgDim.x*L.now);H=this.startDim.height+(this.chgDim.y*L.now);this.startLayer.setSize(K,H);N=this.startPos.x+(this.chgPos.x*L.now);I=this.startPos.y+(this.chgPos.y*L.now);this.startLayer.moveTo(N,I)}else{if(L.endTrans){this.startLayer.moveTo(this.endPos.left,this.endPos.top);this.startLayer.setSize(this.endDim.width,this.endDim.height)}}}this.startLayer.update(L)}else{if(L.transType&&L.transType==="pan"){}else{this.setPosAndShow(L)}}},setPosLayer:function(G,H){var E,F;E=((H.cox*G.width)*-1)+(this.opts.mapWidth/2);F=((H.coy*G.height)*-1)+(this.opts.mapHeight/2);G.moveTo(E,F)},setPosAndShow:function(G){var F,H,E=((G.oldTileOverLayers||G.oldTileOverLayers===0)&&G.oldTileOverLayers!==G.tileOverLayers);this.setPosLayer(this.getCurrentLayer(),G);if((G.oldMapType&&G.oldMapType!==G.mapType)||E){H=this.tileLayerList.length;for(F=0;F<H;F+=1){this.tileLayerList[F].removeAllTiles(E?G.tileOverLayers:null)}}this.showTileLayer()},showTileLayer:function(){var E,F,D=this.tileLayerList.length;for(E=0;E<D;E+=1){F=this.tileLayerList[E];if(E===this.model.zIdx){F.showZ();this.displayTiles()}else{F.hideZ();if((E<this.model.zIdx-1)||(E>this.model.zIdx+1)){F.removeAllTiles(null)}}}},showTileLayerHideOthers:function(G,H){var I,J,F=this.tileLayerList.length;for(I=0;I<F;I+=1){J=this.tileLayerList[I];if(I===G){J.showZ();J.showMe()}else{if(I===H){J.showBelow();J.showMe()}else{J.hideZ();J.hide2()}}}},displayTiles:function(){var B=this.getVisibleTiles();this.getCurrentLayer().displayTiles(this.model,B.minI,B.maxI,B.minJ,B.maxJ,B.eta)},getSizeForZoom:function(D,E){var F=parseFloat(D.mapWidthLevel1Pixel/(Math.pow(2,D.zoomArrayCent[E]-1)));return{width:F,height:F}},getCurrentLayerIdx:function(){return this.model.zIdx},getCurrentLayer:function(){return this.tileLayerList[this.model.zIdx]},getNewLayer:function(){return this.tileLayerList[this.model.newVals.zIdx]},getLayer:function(B){return this.tileLayerList[B]},getVisibleTiles:function(){var T,M,O,K,P,L,Q,S,R,N=this.opts.extraTilesAround;T=this.opts.tileWidth;M=this.opts.tileHeight;R=this.getCurrentLayer();O=Math.floor((-R.x/T))-N;K=Math.floor(((-R.x+this.opts.mapWidth)/T))+N;P=Math.floor((-R.y/M))-N;L=Math.floor(((-R.y+this.opts.mapHeight)/M))+N;O=(O<0)?0:O;P=(P<0)?0:P;Q=(R.width/T)-1;S=(R.height/M)-1;K=(K>Q)?Q:K;L=(L>S)?S:L;return{minI:O,maxI:K,minJ:P,maxJ:L,eta:N}}};SEAT.LayerBase=function(){};SEAT.LayerBase.prototype={init:function(){},setViewMap:function(B){this.viewMap=B},setContMap:function(B){this.contMap=B},setPGMappy:function(B){this.pgMappy=B},updateMap:function(){},updateMapSize:function(){},updateMapLanguage:function(){},remove:function(){}};SEAT.Compass=function(){};SEAT.Compass.prototype={init:function(){this.viewMap.opts.compassImgs.push(SEAT.Compass.POINTS_IMGS_DEFAULT);this.initCompassPoints();this.addCompass()},initCompassPoints:function(){var F,D=this,E=$.grep(this.viewMap.opts.compassImgs,function(A,B){return(A.lng===D.viewMap.opts.lng)});if(E.length>0){F=E[0].imgs;$.each(F,function(A,B){SEAT.Compass.POINTS[A][1]=B[0];SEAT.Compass.POINTS[A][2]=B[1];SEAT.Compass.POINTS[A][3]=E[0].urlPfx+B[2]})}},exists:function(){return($("."+this.getIdPfx()+"cls","#"+this.viewMap.opts.nameContainer).length>0)},addCompass:function(){var B=this;this.lingua=this.viewMap.opts.lng||0;if(!this.exists()){$.each(SEAT.Compass.POINTS,function(A,D){B.addCompassPoint(D[0],D[1],D[2],D[3])});this.posCompass();this.addObservers()}},addCompassPoint:function(I,H,M,N){var K=this.getIdPfx()+I,J='<div id="'+K+'"><span style="position:relative"><p style="position:relative;margin:0px;padding:0px;width:'+H+"px;height:"+M+'px;"></p></span></div>';$("#"+this.viewMap.opts.nameContainer).append(J);$("#"+K).css({width:H,height:M,position:"absolute",zIndex:"999",cursor:"pointer"}).addClass(this.viewMap.opts.classNoPrint).addClass(this.getIdPfx()+"cls");var L=$("#"+K).find("p").get(0);SEAT.PGUtil.addBckImg(L,N,"no-repeat")},getIdPfx:function(){return this.viewMap.opts.nameContainer+"_comp_"},posCompass:function(){var J,P,M,L,N,I,K,O=this;$.each(SEAT.Compass.POINTS,function(A,B){J=B[0];P=B[1];M=B[2];L=$("#"+O.getIdPfx()+J,"#"+O.viewMap.opts.nameContainer);N=(O.viewMap.opts.mapWidth/2)-(P/2);I=(O.viewMap.opts.mapHeight/2)-(M/2);K={};if(J==="n"){K.top=0;K.left=N}else{if(J==="s"){K.bottom=0;K.left=N}else{if(J==="e"){K.right=0;K.top=I}else{if(J==="w"){K.left=0;K.top=I}else{if(J==="ne"){K.top=0;K.right=0}else{if(J==="nw"){K.top=0;K.left=0}else{if(J==="se"){K.bottom=0;K.right=0}else{if(J==="sw"){K.bottom=0;K.left=0}}}}}}}}L.css(K)})},addObservers:function(){var J,O,L,M,K,P,N,I=this;$.each(SEAT.Compass.POINTS,function(A,B){J=B[0];O=$("#"+I.getIdPfx()+J,"#"+I.viewMap.opts.nameContainer);O.bind("mousedown",function(C){return false});O.bind("click",function(C){K=this.id.split("_");P=K[K.length-1];N=$.grep(SEAT.Compass.POINTS,function(D){return D[0]===P})[0];I.viewMap.panMapBy((I.viewMap.opts.mapWidth/2)*N[4],(I.viewMap.opts.mapHeight/2)*N[5]);return false})})},removeObservers:function(){var B=this;$.each(SEAT.Compass.POINTS[B.lingua],function(A,D){$("#"+B.getIdPfx()+D[0],"#"+B.viewMap.opts.nameContainer).unbind()})},remove:function(){this.removeObservers();$("."+this.getIdPfx()+"cls","#"+this.viewMap.opts.nameContainer).remove()},updateMapLanguage:function(){this.remove();this.initCompassPoints();this.addCompass()},updateMapSize:function(){this.posCompass()}};SEAT.PGUtil.augment(SEAT.Compass,SEAT.LayerBase);SEAT.Compass.POINTS=[["n",0,0,"",0,1],["e",0,0,"",-1,0],["s",0,0,"",0,-1],["w",0,0,"",1,0],["ne",0,0,"",-1,1],["se",0,0,"",-1,-1],["sw",0,0,"",1,-1],["nw",0,0,"",1,1]];SEAT.Compass.POINTS_IMGS_DEFAULT={lng:1,urlPfx:"http://img.tuttocitta.it/nuovotcol/img/cardinali/",imgs:[[70,17,"nord.png"],[17,69,"est.png"],[70,17,"sud.png"],[17,69,"ovest.png"],[23,23,"nordest.png"],[23,23,"sudest.png"],[23,23,"sudovest.png"],[23,23,"nordovest.png"]]};SEAT.PGMouseMove=function(){PGMouseMove=this};SEAT.PGMouseMove.prototype={init:function(){var B=this;this.mouseStopped=false;$(document.body).bind("mousemove",function(A){if(B.mouseStopped){B.eventFire("mouserestart",{});B.mouseStopped=false}if(B.timeout){clearTimeout(B.timeout)}B.timeout=setTimeout(function(){var D=B.calcP(A);B.eventFire("mousestopped",D);B.mouseStopped=true},500)})},calcP:function(I){var G=this.viewMap.getMapContainerPos();var J={};var F=I.pageX||(I.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var H=I.pageY||(I.clientY+(document.documentElement.scrollTop||document.body.scrollTop));if($.browser.msie){J={x:F-G.x-2,y:H-G.y-2}}else{J={x:F-G.x,y:H-G.y}}return J},remove:function(){$(document.body).unbind("mousemove")}};SEAT.PGUtil.augment(SEAT.PGMouseMove,SEAT.LayerBase);SEAT.PGUtil.augment(SEAT.PGMouseMove,SEAT.EventMgr);SEAT.PGMappy=function(D){var C=this;$(window).unload(function(){C.unloadMe()});this.map=new SEAT.Map(D);this.pointList=new PGPointList();this.pgLineList=new PGLineList();this.pgPolygonList=new SEAT.PGPolygonList();this.viewRoute=new SEAT.ViewRoute(C);this.viewRouteFormat=new SEAT.ViewRouteFormat(C);this.addLayer(this.pointList);this.addLayer(this.viewRoute);this.addLayer(this.viewRouteFormat);this.addLayer(this.pgLineList);this.addLayer(this.pgPolygonList);if(!D.radarParent){this.addLayer(new SEAT.PGMouseMove())}this.startUp()};SEAT.PGMappy.prototype={unloadMe:function(){this.map=null;this.pointList=null;this.pgLineList=null;this.pgPolygonList=null;this.viewRoute=null;this.viewRouteFormat=null;this.mouseMoveHandler=null},startUp:function(){this.map.startUp()},addLayer:function(B){B.setPGMappy(this);this.map.addLayer(B)},removeLayer:function(B){this.map.removeLayer(B)},addCompass:function(){var B=new SEAT.Compass();this.map.addLayer(B);B.addCompass()},setQuality:function(B){this.map.setQuality(B)},pointAdder:function(B){this.pointList.pointAdder(B)},removePoint:function(B){this.pointList.removePoint(B)},removeAllPoints:function(){this.pointList.removeAllPoints()},setDisabledZoom:function(B){this.map.setDisabledZoom(B)},getDisabledZoom:function(){return this.map.getDisabledZoom()},getZoom:function(){return{z:this.map.getZoom(),zDist:this.map.getZoomDist()}},setZoom:function(B){this.map.setZoom(B)},zoomIn:function(){this.map.zoomIn()},zoomOut:function(){this.map.zoomOut()},setSize:function(C,D){this.map.setSize(C,D)},getSize:function(){return this.map.getSize()},setLng:function(B){this.map.setLng(B)},getLng:function(){return this.map.getLng()},setMapType:function(B){this.map.setMapType(B)},getMapType:function(){return this.map.getMapType()},setTileOverLayers:function(B){this.map.setTileOverLayers(B)},getTileOverLayers:function(){return this.map.getTileOverLayers()},setActionType:function(B){this.map.setActionType(B)},panMapBy:function(C,D){this.map.panMapBy(C,D)},panMapTo:function(D,C){this.map.panMapTo(D,C)},getUpdated:function(){return this.map.getUpdated()},setUpdated:function(B){this.map.setUpdated(B)},setCenter:function(D,C){this.map.setCenter(D,C)},getCenter:function(){return this.map.getCenter()},setCenterPoint:function(B){this.setCenter(B.lon,B.lat)},setCenterAndZoom:function(G,E,H){var F;if(arguments.length===0){if((this.pointList).pointList.length>0){F=this.getRouteCenter((this.pointList).pointList);this.setCenterAndZoom(F.lon,F.lat,F.z)}}else{this.map.setCenterAndZoom(G,E,H)}},getRouteCenter:function(P){var S=[];var U=[];$.each(P,function(A,B){S.push(B.lon);U.push(B.lat)});var T=SEAT.PGUtil.latLong2UTM(S.min(),U.min(),this.map.getZone());var O=SEAT.PGUtil.latLong2UTM(S.max(),U.max(),this.map.getZone());var X=S.min()+((+S.max()-S.min())/2);var N=U.min()+((+U.max()-U.min())/2);var Y=O.x-T.x;var Z=O.y-T.y;var W=parseFloat(Y*430/(1609.3*(this.map.getSize().width-40)));var R=parseFloat(Z*430/(1609.3*(this.map.getSize().height-40)));var Q=(W>R)?W:R;var V=this.map.getZoomIndex(Q);return{lon:X,lat:N,z:V}},getLonLatFromPixel:function(C,D){return this.map.getLonLatFromPixel(C,D)},getPixelFromLonLat:function(D,C){return this.map.getPixelFromLonLat(D,C)},getMapBounds:function(){return this.map.getMapBounds()},disableMap:function(){this.map.disableMap()},enableMap:function(){this.map.enableMap()},pgLineAdder:function(B){this.pgLineList.pgLineAdder(B)},removeLine:function(B){this.pgLineList.removeLine(B)},removeAllPGLines:function(){this.pgLineList.removeAllPGLines()},pgPolygonAdder:function(B){this.pgPolygonList.pgPolygonAdder(B)},removeAllPGPolygons:function(){this.pgPolygonList.removeAllPGPolygons()},preventMapMouseDown:function(){this.map.preventMapMouseDown()},getRoute:function(C,D){this.viewRoute.getRoute(C,D)},getRouteFormat:function(C,D){this.viewRouteFormat.getRoute(C,D)},addRoute:function(B){this.viewRoute.addRoute(B)},addRouteFormat:function(B){this.viewRouteFormat.addRoute(B)},removeRoute:function(B){this.viewRoute.removeRoute(B)},removeRouteFormat:function(B){this.viewRouteFormat.removeRoute(B)},removeAllRoutes:function(){this.viewRoute.removeAllRoutes()},removeAllRouteFormats:function(){this.viewRouteFormat.removeAllRoutes()},addRadar:function(B){this.map.addRadar(B)},moveToCoeff:function(D,C){this.map.moveToCoeff(D,C)},eventRegisterPre:function(E,F,D){this.map.eventRegisterPre(E,F,D)},eventRegisterPost:function(E,F,D){this.map.eventRegisterPost(E,F,D)},eventRegister:function(E,F,D){this.map.eventRegister(E,F,D)},eventDeRegisterPre:function(D,C){this.map.eventDeRegisterPre(D,C)},eventDeRegisterPost:function(D,C){this.map.eventDeRegisterPost(D,C)},eventDeRegister:function(D,C){this.map.eventDeRegister(D,C)}};PGMappy=SEAT.PGMappy;PGPOINT_TYPE_CLIENT=1;PGPOINT_TYPE_NONCLIENT=2;PGPoint=function(D){var C=this;this.j=D;if(this.j.pgAddress){this.lon=this.j.pgAddress.comuneList[0].lon;this.lat=this.j.pgAddress.comuneList[0].lat}else{this.lon=this.j.lon;this.lat=this.j.lat}this.pxX=0;this.pxY=0;this.offsetX=this.j.offsetX||0;this.offsetY=this.j.offsetY||0;if(this.j.opened){this.j.opened.offsetX=this.j.opened.offsetX||0;this.j.opened.offsetY=this.j.opened.offsetY||0}$(window).unload(function(){C.unloadMe()});return this};PGPoint.prototype={unloadMe:function(){this.dragDropRemove();this.eventDeRegisterAll();this.dPointBig=null;this.dPoint=null;this.parent=null;this.viewMap=null},setModel:function(B){this.model=B},initPoint:function(){var B=SEAT.PGUtil.calcCoefficients(this.lon,this.lat,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);this.cox=B.cox;this.coy=B.coy},initVals:function(E,D,F){this.parent=E;this.viewMap=D;this.i=F},drawPoint:function(){var U,Q,V,N,M,L,S,O,T;var P=this.viewMap.opts.nameContainer+"_point_"+this.i;this.id=P;if($("#"+P).length===0){var R=this.j.zIndex||"250";U='<div id="'+P+'"></div>';this.dPoint=$(U).attr({title:this.j.title||""}).css({position:"absolute",overflow:"hidden",zIndex:R}).appendTo("#"+this.viewMap.tileLayerMgr.getCurrentLayer().id);if(this.j.html&&this.j.html!==""){this.dPoint.html(this.j.html);Q=this.j.width||null;V=this.j.height||null;if(Q===null||V===null){N=$(this.dPoint.children().get(0));Q=Q||parseInt(N.width(),10);V=V||parseInt(N.height(),10)}this.pointWidth=parseInt(Q,10);this.pointHeight=parseInt(V,10);this.dPoint.css({width:this.pointWidth,height:this.pointHeight})}else{Q=40;V=32;M="#FFF";L="http://img.tuttocitta.it/nuovotcol/img/png/icoCliente.png";if(this.j.typ&&this.j.typ===PGPOINT_TYPE_NONCLIENT){Q=36;V=30;M="#323B96";L="http://img.tuttocitta.it/nuovotcol/img/png/icoNoCliente.png"}this.dPoint.css({textAlign:"center",width:Q,height:V});S="<div></div>";O=$(S).css({textAlign:"center",width:Q,height:V}).appendTo(this.dPoint);SEAT.PGUtil.addBckImg(O.get(0),L,"no-repeat top left");T="<span></span>";$(T).css({padding:"8px 0px 0px 0px",textAlign:"center",color:M,fontWeight:"bold",fontSize:"11px",textDecoration:"none",fontFamily:"arial, verdana",display:"block",width:Q,height:V,position:"relative",zIndex:"251"}).attr({title:this.j.title||""}).html(this.j.txt||"").appendTo(O);this.pointWidth=Q;this.pointHeight=V}this.createObserverPoint()}},addDragDrop:function(){var B=this;this.destroyObserverPoint();this.dragDropAdd(this.id,{dragBefore:function(A){B.dragBefore(A)},dragging:function(A){B.dragging(A)},dragAfter:function(A){B.dragAfter(A)}})},removeDragDrop:function(){this.dragDropRemove();this.eventDeRegister("dragbefore");this.eventDeRegister("dragging");this.eventDeRegister("dragafter");this.createObserverPoint()},dragBefore:function(B){this.eventFire("dragbefore",{id:this.j.id,lon:this.lon,lat:this.lat})},dragging:function(B){this.eventFire("dragging",{id:this.j.id,chgX:B.chg.x,chgY:B.chg.y})},dragAfter:function(D){var C;if(D.chg.x!==0||D.chg.y!==0){C=this.getLonLat(D.chg.x,-D.chg.y);this.lon=C.lon;this.lat=C.lat;this.setModel(this.model);this.initPoint();this.eventFire("dragafter",{id:this.j.id,chgX:D.chg.x,chgY:D.chg.y,lon:this.lon,lat:this.lat})}},getLonLat:function(E,F){var D=SEAT.PGUtil.pixelLatLongPoint(E,F,this.lon,this.lat,parseFloat(this.model.zoomArray[this.model.zIdx]),this.model.zone);return{lon:D.lon,lat:D.lat}},setLonLat:function(D,C){this.lon=D;this.lat=C;this.initPoint();this.posPoint()},posPoint:function(){var B=this.getPos(this.viewMap);this.pxX=(B.x-(this.pointWidth/2))+this.offsetX;this.pxY=(B.y-(this.pointHeight))+this.offsetY;this.dPoint.css({left:this.pxX+"px",top:this.pxY+"px"});if(this.bigVisible){this.dispBig()}},getPos:function(H){var G=H.tileLayerMgr.getCurrentLayer();var E=G.width*this.cox;var F=G.height*this.coy;return{x:E,y:F}},removePoint:function(){if(this.dPointBig){this.closeBig();this.removeBig()}if(this.dPoint){this.destroyObserverPoint();this.dPoint.unbind();this.dPoint.remove()}this.dPointBig=null;this.dPoint=null},addOpener:function(L){var K,J,G,H;this.customBigHTML=(L)?true:false;var I=this.viewMap.opts.nameContainer+"_pointBig_"+this.i;if($("#"+I,"#"+this.viewMap.opts.nameContainer).length===0){K="<div></div>";this.dPointBig=$(K).attr({id:I}).css({position:"absolute",overflow:"hidden",zIndex:"300"}).appendTo("#"+this.viewMap.tileLayerMgr.getCurrentLayer().id);this.hideBig();if(this.customBigHTML){this.dPointBig.html(L)}else{J='<div id="'+I+'_d1"><div id="'+I+'_d2"></div><div id="'+I+'_d3"><div id="'+I+'_d4"><table><tbody><tr><td><div id="'+I+'_d5"></div><div id="'+I+'_d6"><div id="'+I+'_d7"><div id="'+I+'_a1"><img id="'+I+'_i1"></img></div></div></div></td></tr></tbody></table></div></div><div id="'+I+'_d8"></div></div>';this.dPointBig.append(J);$("#"+I+"_d1").css({position:"absolute",zIndex:"300",fontFamily:"arial, verdana, georgia, helvetica, sans-serif",fontSize:"11px"});$("#"+I+"_d2").css({width:"307px",height:"31px",padding:"0px 3px 0px 3px"});SEAT.PGUtil.addBckImg($("#"+I+"_d2").get(0),"http://img.tuttocitta.it/nuovotcol/img/fumetti/bgHeaderAltri.png","no-repeat top left","");$("#"+I+"_d3").css({width:"307px"});SEAT.PGUtil.addBckImg($("#"+I+"_d3").get(0),"http://img.tuttocitta.it/nuovotcol/img/fumetti/bgContentAltri.png","","sizingMethod=scale");$("#"+I+"_d4").css({width:"301px",marginLeft:"2px",background:"url(http://img.tuttocitta.it/nuovotcol/img/fumetti/fondinoAltri.gif)"});$("#"+I+"_d5").css({margin:"0px",padding:"0px",fontSize:"11px"});$("#"+I+"_d6").css({margin:"10px 0px 0px 0px",padding:"0px"});this.idClose=I+"_d7";$("#"+this.idClose).css({position:"absolute",top:"7px",right:"10px"});$("#"+I+"_a1").attr({cursor:"pointer",title:"Close"});$("#"+I+"_i1").attr({height:"14px",width:"14px",alt:"Close",border:"0",src:"http://img.tuttocitta.it/nuovotcol/img/fumetti/icoChiudiFumetto.gif"});$("#"+I+"_d8").css({width:"307px",height:"7px",position:"relative",fontSize:"0"});SEAT.PGUtil.addBckImg($("#"+I+"_d8").get(0),"http://img.tuttocitta.it/nuovotcol/img/fumetti/bgfooteraltribasso.png","no-repeat top left","");if(this.j.opened.name&&this.j.opened.name!==""){$("<span></span>").css({fontWeight:"bold",fontSize:"12px",color:"#323B96",margin:"0px",padding:"0px 0px 3px 0px"}).html(this.j.opened.name).appendTo("#"+I+"_d5")}if(this.j.opened.info){G=(SEAT.PGUtil.isArray(this.j.opened.info))?this.j.opened.info:[this.j.opened.info];$.each(G,function(A,B){$("<p></p>").css({fontWeight:"normal",margin:"0 0 2px 0",padding:"0",color:"#333"}).html(B).appendTo("#"+I+"_d5")})}}if(!this.j.opened.autoSize){H=$(this.dPointBig.children(0));this.dPointBig.css({width:H.width(),height:H.height()})}}},createObserverPoint:function(){var B=this;if(this.j.opened){this.evPointMouseDown=function(A){B.parent.viewMap.myParent.preventMapMouseDown()};this.evPointClick=function(A){B.eventFire("click",{event:A,id:B.j.id});B.onClickPoint(A);return false};this.dPoint.bind("mousedown",this.evPointMouseDown).bind("click",this.evPointClick).css({cursor:"pointer"})}else{this.evPointClick=function(A){B.eventFire("click",{event:A,id:B.j.id})};this.dPoint.bind("click",this.evPointClick)}this.dPoint.hover(function(A){B.eventFire("mouseover",{event:A,id:B.j.id})},function(A){B.eventFire("mouseout",{event:A,id:B.j.id})}).dblclick(function(A){B.eventFire("dblclick",{event:A,id:B.j.id});return false})},destroyObserverPoint:function(){var B=this;this.dPoint.unbind("mousedown",this.evPointMouseDown).unbind("click",this.evPointClick).unbind("dblclick").unbind("mouseover").unbind("mouseout").css({cursor:""});this.dPoint.unbind()},createObserverBig:function(){var G=this,H=this.dPointBig,F,E="#"+this.viewMap.tileLayerMgr.getCurrentLayer().id;if(this.j.opened.closeID&&$("#"+this.j.opened.closeID,E).length>0){F=$("#"+this.j.opened.closeID,E)}else{if(this.customBigHTML){F=H}else{F=$("#"+this.idClose,E)}}H.css({cursor:"auto"});F.css({cursor:"pointer"});this.evBigMouseDown=function(A){return false};this.evBigClick=function(A){G.onCloseBig(A);return false};H.bind("mousedown",this.evBigMouseDown);F.bind("click",this.evBigClick)},destroyObserverBig:function(){if(this.dPointBig){this.dPointBig.unbind("mousedown",this.evBigMouseDown).unbind("click",this.evBigClick).css({cursor:""});if(this.customBigHTML){this.dPointBig.children().unbind()}}},onClickPoint:function(B){this.openBig()},openBig:function(){var B;this.eventFire("openbefore",{id:this.j.id});this.parent.closeOpenPoints();if(this.j.opened){if(this.j.opened.html){this.addOpener(this.j.opened.html)}else{if(this.j.opened.onOpen){B=this.j.opened.onOpen.call(this.j.opened.onOpen,this.j.opened.onOpenParams);this.addOpener(B)}else{this.addOpener()}}}this.bigVisible=true;this.destroyObserverPoint();this.dispBig();this.createObserverBig();this.makeBigVisible();this.eventFire("openafter",{id:this.j.id})},makeBigVisible:function(){var K=0;var L=0;var N=this.viewMap.tileLayerMgr.getCurrentLayer();var J={x:N.x,y:N.y};var P=parseFloat(this.dPointBig.css("left"));var I=P+parseFloat(this.dPointBig.width());var O=parseFloat(this.dPointBig.css("top"));var M=O+parseFloat(this.dPointBig.height());if(P<(J.x*-1)){K=(J.x*-1)-P+10}else{if(I>((J.x*-1)+this.viewMap.opts.mapWidth)){K=((J.x*-1)+this.viewMap.opts.mapWidth)-I-10}}if(O<(J.y*-1)){L=(J.y*-1)-O+10}else{if(M>((J.y*-1)+this.viewMap.opts.mapHeight)){L=((J.y*-1)+this.viewMap.opts.mapHeight)-M+10}}if(K!==0||L!==0){this.viewMap.panMapBy(K,L)}},onCloseBig:function(B){this.closeBig()},closeBig:function(){this.destroyObserverBig();if(this.bigVisible){this.eventFire("closebefore",{id:this.j.id});this.bigVisible=false;if(this.j.opened.onOpen){this.removeBig()}else{this.hideBig()}this.createObserverPoint();this.eventFire("closeafter",{id:this.j.id})}},removeBig:function(){if(this.dPointBig){this.dPointBig.unbind();this.dPointBig.remove();this.dPointBig=null}},dispBig:function(){var F,G;var H=this.getPos(this.viewMap);var J=parseInt(this.dPointBig.width(),10);var I=parseInt(this.dPointBig.height(),10);F=(this.j.opened.left)?H.x:H.x-(J/2);if(this.j.opened.top){G=H.y}else{if(this.customBigHTML){G=H.y-(I/2)}else{G=H.y-I-5}}F+=this.j.opened.offsetX;G+=this.j.opened.offsetY;this.dPointBig.css({left:F,top:G})},hideBig:function(){this.dPointBig.css({left:-9999})},movePoint:function(B){this.dPoint.appendTo("#"+B);if(this.dPointBig){this.dPointBig.appendTo("#"+B)}}};SEAT.PGUtil.augment(PGPoint,SEAT.EventMgr);SEAT.PGUtil.augment(PGPoint,SEAT.DragDropMgr);PGPointList=function(){var B=this;this.pointList=[];this.i=0;$(window).unload(function(){B.unloadMe()})};PGPointList.prototype={unloadMe:function(){this.pointList=null;this.viewMap=null;this.contMap=null;this.pgMappy=null},pointAdder:function(B){B.initVals(this,this.viewMap,this.i+=1);this.pointList.push(B);B.setModel(this.model);B.initPoint();B.drawPoint(this.viewMap);B.posPoint(this.viewMap)},removePoint:function(B){B.removePoint();this.pointList=$.grep(this.pointList,function(D,A){return D!==B})},removeAllPoints:function(){$.each(this.pointList,function(D,C){C.removePoint()});this.pointList=[]},setModelPoints:function(){var B=this;$.each(this.pointList,function(A,D){D.setModel(B.model)})},drawPoints:function(){var B=this;$.each(this.pointList,function(A,D){D.drawPoint(B.viewMap)})},posPoints:function(){var B=this;$.each(this.pointList,function(A,D){D.posPoint(B.viewMap)})},closeOpenPoints:function(){$.each(this.pointList,function(D,C){C.closeBig()})},updateMap:function(B){this.model=B;if(B.transType&&B.transType==="zoom"){if(B.startTrans){this.closeOpenPoints()}else{if(B.stepTrans){this.posPoints()}else{if(B.endTrans){this.setModelPoints();$.each(this.pointList,function(A,D){D.movePoint(this.viewMap.tileLayerMgr.getCurrentLayer().id)})}}}}else{if(B.transType&&B.transType==="pan"){}else{if(!this.initDone){this.setModelPoints();this.drawPoints();this.posPoints()}}}this.initDone=true}};SEAT.PGUtil.augment(PGPointList,SEAT.LayerBase);SEAT.PGShapeBase=function(){};SEAT.PGShapeBase.prototype={unloadMe:function(){this.graphicsMgr=null;this.viewMap=null;this.parent=null},initShape:function(D){var C=this;if(D&&D.points&&(D.points[0].x||D.points[0].x===0)){this.pixelArray=D.points}else{this.points=D.points}this.id=D.id;this.rgb=D.rgb||{r:120,g:120,b:255};this.opacity=D.opacity||null;$(window).unload(function(){C.unloadMe()})},initVals:function(M,K,H,I){var J,L,N;this.graphicsMgr=M;this.viewMap=H;this.parent=I;if(this.points){for(J=0;J<this.points.length;J+=1){this.points[J].setModel(K);this.points[J].initPoint()}}else{if(this.pixelArray&&this.pixelArray.length>0){L=H.getMapPos();N=H.tileLayerMgr.getCurrentLayer();for(J=0;J<this.pixelArray.length;J+=1){this.pixelArray[J].cox=(-L.x+this.pixelArray[J].x)/N.width;this.pixelArray[J].coy=(-L.y+this.pixelArray[J].y)/N.height}}}},drawShape:function(L,P){var M,R,S,T,O;var Q=[];if(this.pixelArray){var N=this.observed;var K=this.viewMap.getMapPos();O=this.viewMap.tileLayerMgr.getCurrentLayer();$.each(this.pixelArray,function(A,B){Q.push({x:(B.cox*O.width)-P.x,y:(B.coy*O.height)-P.y,i:B.i});if(N){B.x=B.cox*O.width+K.x;B.y=B.coy*O.height+K.y}});this.drawShapePortions(Q)}else{if(this.points){for(M=0;M<this.points.length;M+=1){R=this.points[M].getPos(this.viewMap).x;S=this.points[M].getPos(this.viewMap).y;T={x:R-P.x,y:S-P.y};if(M===0){$.extend(T,{i:1})}Q.push(T)}this.drawShapePortions(Q)}}},drawShapePortions:function(B){}};var PGLine=function(B){this.initShape(B);this.lineWidth=B.lineWidth||10};PGLine.prototype={eventRegisterPost:function(E,F,D){this.observed=true;if(this.listenerList.length===1){PGMouseMove.eventRegister("mousestopped",this.mouseOverLine,this)}},eventDeRegisterPost:function(E,F,D){if(this.listenerList.length===0){this.observed=false;PGMouseMove.eventDeRegister("mousestopped",this.mouseOverLine,this)}},drawShapePortions:function(J){var I,F,G,H=[];F=J.length;for(I=0;I<F;I+=1){G=J[I];if(I===0||G.i===1){H=[]}H.push(G);if((I+1>=J.length)||(J[I+1].i===1)){this.graphicsMgr.drawLine(H,this.rgb,this.lineWidth,this.opacity)}}},mouseOverLine:function(I){var G=false;if(this.pixelArray){for(var K=0;K<this.pixelArray.length-1;K++){G=SEAT.PGUtil.isPointInLine(this.pixelArray[K].x,this.pixelArray[K].y,this.pixelArray[K+1].x,this.pixelArray[K+1].y,I.x,I.y,this.lineWidth);if(G){this.eventFire("mouseoverline",{id:this.id,p:I});break}}}else{if(this.points){var L=this.viewMap.getMapPos();for(var K=0;K<this.points.length-1;K++){var H=this.points[K].getPos(this.viewMap);var J=this.points[K+1].getPos(this.viewMap);G=SEAT.PGUtil.isPointInLine((H.x+L.x),(H.y+L.y),(J.x+L.x),(J.y+L.y),I.x,I.y,this.lineWidth);if(G){this.eventFire("mouseoverline",{id:this.id,p:I});break}}}}return G},remove:function(){if(this.listenerList){PGMouseMove.eventDeRegister("mousestopped",this.mouseOverLine,this);this.listenerList=null}}};SEAT.PGUtil.augment(PGLine,SEAT.PGShapeBase);SEAT.PGUtil.augment(PGLine,SEAT.EventMgr);var PGLineList=function(){this.pgLineList=[]};PGLineList.prototype={pgLineAdder:function(B){if(B){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgline")}this.addLine(B);this.prepareForDrawing();B.drawShape(this.posOffset,this.delta)}},prepareForDrawing:function(){var B=this.viewMap.tileLayerMgr.getCurrentLayer();this.posOffset={beforeX:this.viewMap.opts.mapWidth,afterX:this.viewMap.opts.mapWidth,beforeY:this.viewMap.opts.mapHeight,afterY:this.viewMap.opts.mapHeight};this.canvasWidth=this.posOffset.beforeX+this.viewMap.opts.mapWidth+this.posOffset.afterX;this.canvasHeight=this.posOffset.beforeY+this.viewMap.opts.mapHeight+this.posOffset.afterY;this.graphicsMgr.prepareCanvas(B.id,this.canvasWidth,this.canvasHeight);this.delta={x:(-B.x-this.posOffset.beforeX),y:(-B.y-this.posOffset.beforeY)};this.graphicsMgr.posCanvas(-B.x-this.posOffset.beforeX,-B.y-this.posOffset.beforeY)},addLine:function(B){if(B){B.initVals(this.graphicsMgr,this.model,this.viewMap);this.pgLineList.push(B)}},removeLine:function(B){this.pgLineList=$.grep(this.pgLineList,function(A){if((A.id&&A.id===B)){A.remove()}return(!A.id||(A.id&&A.id!==B))});if(this.graphicsMgr&&(this.pgLineList===null||this.pgLineList.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawLines()}},removeAllPGLines:function(){for(var B=0;B<this.pgLineList.length;B++){this.pgLineList[B].remove()}this.pgLineList=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}},drawLines:function(){var B=this;if(this.pgLineList.length>0){this.graphicsMgr.clearCanvas();this.prepareForDrawing();$.each(this.pgLineList,function(A,D){D.drawShape(B.posOffset,B.delta)})}},updateMap:function(B){this.model=B;if(B.transType&&B.transType==="zoom"){if(B.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(B.stepTrans){}else{if(B.endTrans){}}}}else{if(B.transType&&B.transType==="pan"){if(B.startTrans){}else{if(B.stepTrans){}else{if(B.endTrans){}}}}else{this.drawLines()}}}};SEAT.PGUtil.augment(PGLineList,SEAT.LayerBase);var PGPolygon=function(B){this.initShape(B);this.borderRgb=B.borderRgb||null;this.borderWidth=B.borderWidth||10;this.borderOpacity=B.borderOpacity||null};PGPolygon.prototype={drawShapePortions:function(B){if(this.borderRgb&&(this.borderRgb.r!==this.rgb.r||this.borderRgb.g!==this.rgb.g||this.borderRgb.b!==this.rgb.b)){B.push(B[0]);this.graphicsMgr.drawLine(B,this.borderRgb,this.borderWidth,this.borderOpacity)}this.graphicsMgr.drawPolygon(B,this.rgb,this.opacity)},remove:function(){if(this.id){this.parent.removePolygon(this.id)}}};SEAT.PGUtil.augment(PGPolygon,SEAT.PGShapeBase);SEAT.PGPolygonList=function(){var B=this;this.pgPolygonList=[];$(window).unload(function(){B.unloadMe()})};SEAT.PGPolygonList.prototype={unloadMe:function(){this.pgPolygonList=null;this.graphicsMgr=null},pgPolygonAdder:function(B){if(B){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgpolygon")}this.addPolygon(B);this.prepareForDrawing();B.drawShape(this.posOffset,this.delta)}},prepareForDrawing:function(){var B=this.viewMap.tileLayerMgr.getCurrentLayer();this.posOffset={beforeX:this.viewMap.opts.mapWidth,afterX:this.viewMap.opts.mapWidth,beforeY:this.viewMap.opts.mapHeight,afterY:this.viewMap.opts.mapHeight};this.canvasWidth=this.posOffset.beforeX+this.viewMap.opts.mapWidth+this.posOffset.afterX;this.canvasHeight=this.posOffset.beforeY+this.viewMap.opts.mapHeight+this.posOffset.afterY;this.graphicsMgr.prepareCanvas(B.id,this.canvasWidth,this.canvasHeight);this.delta={x:(-B.x-this.posOffset.beforeX),y:(-B.y-this.posOffset.beforeY)};this.graphicsMgr.posCanvas(-B.x-this.posOffset.beforeX,-B.y-this.posOffset.beforeY)},addPolygon:function(B){if(B){B.initVals(this.graphicsMgr,this.model,this.viewMap,this);this.pgPolygonList.push(B)}},removePolygon:function(B){this.pgPolygonList=$.grep(this.pgPolygonList,function(A){return(!A.id||(A.id&&A.id!==B))});if(this.graphicsMgr&&(this.pgPolygonList===null||this.pgPolygonList.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawPolygons()}},removeAllPGPolygons:function(){this.pgPolygonList=[];this.graphicsMgr.removeCanvas()},drawPolygons:function(){var B=this;if(this.pgPolygonList.length>0){this.graphicsMgr.clearCanvas();this.prepareForDrawing();$.each(this.pgPolygonList,function(A,D){D.drawShape(B.posOffset,B.delta)})}},updateMap:function(B){this.model=B;if(B.transType&&B.transType==="zoom"){if(B.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(B.stepTrans){}else{if(B.endTrans){}}}}else{if(B.transType&&B.transType==="pan"){}else{this.drawPolygons()}}}};SEAT.PGUtil.augment(SEAT.PGPolygonList,SEAT.LayerBase);var PGROUTE_URL="http://mdr-routing.paginegialle.it/route_px";var PGROUTE_IMG_PREFIX="http://routepgol.tuttocitta.it/Route_ReadDll/MapRender.aspx";var PGROUTE_TYPE_CAR="C";var PGROUTE_TYPE_PED="P";var PGROUTE_TYPE_CAR_BEST_DIST="CBN";var PGROUTE_TYPE_CAR_NO_TOLL="CNT";var PGROUTE_TYPE_CAR_NO_ECOPASS="nep";var PGRoute=function(B){this.callPer(B)};PGRoute.prototype={callPer:function(E){var F=PGRouteUtil.getItnVal(E.itn);var G="x="+E.lon+"&y="+E.lat+"&z="+E.z+"&lx="+E.startLon+"&ly="+E.startLat+"&ex="+E.endLon+"&ey="+E.endLat+"&itn="+F+"&rt="+E.rt+"&xpix="+E.xpix+"&ypix="+E.ypix+"&dz="+(parseInt(E.xpix,10)/430)+"&serv="+(E.serv||"")+"&sito="+(E.sito||"")+"&mode="+(E.mode||"")+"&format=javascript,"+escape(E.onComplete)+((E.id&&E.id!="")?","+E.id:"");var H=(E.host||PGROUTE_URL)+"?"+G;$.getScript(H)}};var PGRouteUtil=function(){return{getMainImg:function(G,I,H){var F={xpix:500,ypix:500};H=$.extend(F,(H||{}));var J=PGROUTE_IMG_PREFIX+"?x="+G.initLon+"&y="+G.initLat+"&z="+SEAT.PGUtil.zoomArray[PGUtil.getZIdx(G.initZ)]+"&lx="+G.pStart.lon+"&ly="+G.pStart.lat+"&ex="+G.pEnd.lon+"&ey="+G.pEnd.lat+"&itn="+PGRouteUtil.getItnVal(PGRouteUtil.getItnArray(G.pItn))+"&rt="+G.rt+"&serv="+I.serv+"&xpix="+H.xpix+"&ypix="+H.ypix+"&dz="+(H.xpix/430)+"&om=1&fi=jpeg";return J},getStepImg:function(K,M,I,J,L){var H={xpix:300,ypix:300,z:0.6};L=$.extend(H,(L||{}));var N=PGROUTE_IMG_PREFIX+"?x="+M.rplan[I].rleg[J].x+"&y="+M.rplan[I].rleg[J].y+"&z="+L.z+"&lx="+K.pStart.lon+"&ly="+K.pStart.lat+"&ex="+K.pEnd.lon+"&ey="+K.pEnd.lat+"&itn="+PGRouteUtil.getItnVal(PGRouteUtil.getItnArray(K.pItn))+"&rt="+K.rt+"&serv="+M.serv+"&xpix="+L.xpix+"&ypix="+L.ypix+"&dz="+(L.xpix/430)+"&om=1&fi=jpeg";return N},getItnArray:function(D){var C=[];if(D&&SEAT.PGUtil.isArray(D)){$.each(D,function(A,B){C[C.length]={lon:B.lon,lat:B.lat}})}return C},getItnVal:function(D){var C="";if(D&&SEAT.PGUtil.isArray(D)){$.each(D,function(A,B){C+=B.lon+";"+B.lat+";"})}return C}}}();var PGROUTEFORMAT_URL="http://mdr-routing.paginegialle.it/route_px";var PGRouteFormat=function(B){this.callPer(B)};PGRouteFormat.prototype={callPer:function(D){var E="id="+D.id+"&x="+(D.lon||"")+"&y="+(D.lat||"")+"&z="+(D.z||"")+"&url="+D.url+"&xpix="+D.xpix+"&ypix="+D.ypix+"&viewport="+D.viewport+"&dz="+(parseInt(D.xpix,10)/430)+"&serv="+(D.serv||"")+"&test=api&format=javascript,"+escape(D.onComplete)+((D.id&&D.id!="")?","+D.id:"");var F=(D.host||PGROUTEFORMAT_URL)+"?"+E;$.getScript(F)}};SEAT.PGRouteCallback=function(){return{register:function(D,C){this.fn=D;this.scope=C},callback:function(C,D){this.fn.call(this.scope,C,D)}}}();SEAT.ViewRoute=function(B){this.parent=B;this.idNum=0;this.routeParamsA=[]};SEAT.ViewRoute.prototype={init:function(){var B=this;PGEvent.addListener(this.pgMappy,"mousedownbefore",function(A){B.mousedown=true});PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(A){B.mousedown=false})},getRoute:function(I,G){var H=PGRouteUtil.getItnArray(I.pItn);var J=this.viewMap.opts;this.pOff={b4X:J.mapWidth,afX:J.mapWidth,b4Y:J.mapHeight,afY:J.mapHeight};this.canvasWidth=this.pOff.b4X+J.mapWidth+this.pOff.afX;this.canvasHeight=this.pOff.b4Y+J.mapHeight+this.pOff.afY;var F={id:I.id,lon:(I.initLon&&!I.initDone)?I.initLon:this.model.lon,lat:(I.initLat&&!I.initDone)?I.initLat:this.model.lat,z:((I.initZ||I.initZ===0)&&!I.initDone)?this.model.zoomArray[this.viewMap.calcZIdx(I.initZ)]:this.model.zoomArray[this.model.zIdx],startLon:I.pStart.lon,startLat:I.pStart.lat,endLon:I.pEnd.lon,endLat:I.pEnd.lat,itn:H,rt:I.rt,xpix:this.canvasWidth,ypix:this.canvasHeight,serv:(I.serv||I.serv===0)?I.serv:"",sito:J.sito,host:I.host,mode:(I.mode||""),onComplete:G};new PGRoute(F)},addRoute:function(J){var M,N,L,H=false,I,K;if(J.length>0){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgroute")}L=J[0].routeParams;if((L.initLon&&L.initLat)||(L.initZ||L.initZ===0)){H=true}for(M=0;M<J.length;M+=1){N=J[M];K=N.routeParams.lineWidth;I=N.routeParams.opacity;$.extend(N.routeParams,{id:J[M].routeParams.id||"pgroute_"+(this.idNum+=1),serv:N.route.serv,initDone:1,updateDone:1,rgb:N.routeParams.rgb||{r:255,g:0,b:0},lineWidth:(K||K===0)?K:15,opacity:(I||I===0)?I:0.6,route:N.route});this.routeParamsA.push(N.routeParams);if(!H){this.drawRoute(N.route,N.routeParams.id)}}if(H){this.firstTime=true;if(L.initLon&&L.initLat&&(L.initZ||L.initZ===0)){this.parent.setCenterAndZoom(parseFloat(L.initLon),parseFloat(L.initLat),parseInt(L.initZ,10))}else{if(L.initZ||L.initZ===0){this.parent.setZoom(parseInt(L.initZ,10))}else{this.parent.setCenter(parseFloat(L.initLon),parseFloat(L.initLat))}}}else{this.firstTime=false}}},drawRoute:function(N,I){var K,J,L=[],M,H=this;K=$.grep(H.routeParamsA,function(A){return A.id===I})[0];K.updateDone=1;K.route=N;if(this.getARoute()){this.drawAllRoutes()}},drawAllRoutes:function(){var C,D=this;if(this.graphicsMgr){this.graphicsMgr.clearCanvas();C=this.viewMap.tileLayerMgr.getCurrentLayer();this.graphicsMgr.prepareCanvas(C.id,this.canvasWidth,this.canvasHeight);this.graphicsMgr.posCanvas(-C.x-this.pOff.b4X,-C.y-this.pOff.b4Y)}$.each(this.routeParamsA,function(K,L){if(L.route.rplan.length>0&&!D.mousedown){D.drawPortions(L.route.rplan,L.rgb,L.lineWidth,L.opacity);if(L.doppioPercorso&&L.doppioPercorso==true){var B=(L.limiteZoom||L.limiteZoom===0)?L.limiteZoom:-4;if(D.pgMappy.getZoom().z>B){var J=L.rgb2||{r:255,g:255,b:255};var A=L.lineWidth2>0?L.lineWidth2:11;var I=(L.opacity2||L.opacity2===0)?L.opacity2:0.6;D.drawPortions(L.route.rplan,J,A,I)}}}})},drawPortions:function(J,N,I,O){var M,P,L,K;for(M=0;M<J.length;M+=1){L=[];K=J[M];for(P=0;P<K.coords.length;P+=1){L.push(K.coords[P])}this.graphicsMgr.drawLine(L,N,I,O)}},updateMap:function(D){var C=this;this.model=D;if(this.routeParamsA.length>0){if(D.transType&&D.transType==="zoom"){if(D.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(D.stepTrans){}else{if(D.endTrans){}}}}else{if(D.transType&&D.transType==="pan"){}else{if(!D.oldMapType){if(this.firstTime){this.drawAllRoutes()}else{this.redrawAllRoutes()}this.firstTime=false}}}}},redrawAllRoutes:function(){$.each(this.routeParamsA,function(D,C){C.updateDone=0});this.getARoute()},getARoute:function(){var E,F=true,D=this;SEAT.PGRouteCallback.register(D.drawRoute,D);for(E=0;E<this.routeParamsA.length;E+=1){if(this.routeParamsA[E].updateDone===0){this.getRoute(this.routeParamsA[E],"SEAT.PGRouteCallback.callback");F=false;break}}return F},removeRoute:function(B){this.routeParamsA=$.grep(this.routeParamsA,function(A){return(!A.id||(A.id&&A.id!==B))});if(this.graphicsMgr&&(this.routeParamsA===null||this.routeParamsA.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawAllRoutes()}},removeAllRoutes:function(){this.routeParamsA=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}};SEAT.PGUtil.augment(SEAT.ViewRoute,SEAT.LayerBase);SEAT.PGRouteFormatCallback=function(){return{register:function(D,C){this.fn=D;this.scope=C},callback:function(C,D){this.fn.call(this.scope,C,D)}}}();SEAT.ViewRouteFormat=function(B){this.parent=B;this.routeParamsA=[]};SEAT.ViewRouteFormat.prototype={init:function(){var B=this;PGEvent.addListener(this.pgMappy,"mousedownbefore",function(A){B.mousedown=true});PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(A){B.mousedown=false})},getRoute:function(G,F){var H=this.viewMap.opts;this.pOff={b4X:H.mapWidth,afX:H.mapWidth,b4Y:H.mapHeight,afY:H.mapHeight};this.canvasWidth=this.pOff.b4X+H.mapWidth+this.pOff.afX;this.canvasHeight=this.pOff.b4Y+H.mapHeight+this.pOff.afY;var E={id:G.id,lon:(G.initDone)?this.model.lon:"",lat:(G.initDone)?this.model.lat:"",z:(G.initDone)?this.model.zoomArray[this.model.zIdx]:"",url:G.url,xpix:this.canvasWidth,ypix:this.canvasHeight,viewport:this.pOff.b4X+","+this.pOff.b4Y+","+(this.pOff.b4X+H.mapWidth)+","+(this.pOff.b4Y+H.mapHeight),serv:G.serv||"",onComplete:F};new PGRouteFormat(E)},addRoute:function(I){var K,L,J,H,G=false;if(I.length>0){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgrouteformat")}for(K=0;K<I.length;K+=1){L=I[K];$.extend(L.routeParams,{serv:L.route.serv,initDone:1,updateDone:1,rgb:L.routeParams.rgb||{r:255,g:0,b:0},lineWidth:L.routeParams.lineWidth||15,opacity:L.routeParams.opacity||0.6,route:L.route});this.routeParamsA.push(L.routeParams)}J=I[0].route.metadata;H=this.viewMap.getZoomIndex(parseFloat(J.zlevel));this.firstTime=true;this.parent.setCenterAndZoom(parseFloat(J.cx),parseFloat(J.cy),H)}},drawRoute:function(N,I){var K,J,L=[],M,H=this;K=$.grep(H.routeParamsA,function(A){return A.id===I})[0];K.updateDone=1;K.route=N;if(this.getARoute()){this.drawAllRoutes()}},drawAllRoutes:function(){var C,D=this;if(this.graphicsMgr){this.graphicsMgr.clearCanvas();C=this.viewMap.tileLayerMgr.getCurrentLayer();this.graphicsMgr.prepareCanvas(C.id,this.canvasWidth,this.canvasHeight);this.graphicsMgr.posCanvas(-C.x-this.pOff.b4X,-C.y-this.pOff.b4Y)}$.each(this.routeParamsA,function(A,B){if(B.route.rplan.length>0&&!D.mousedown){D.drawPortions(B.route.rplan,B.rgb,B.lineWidth,B.opacity)}})},drawPortions:function(J,N,I,O){var M,P,L,K;for(M=0;M<J.length;M+=1){L=[];K=J[M];N=K.color||N;I=(K.width||K.width===0)?K.width:I;O=(K.opacity||K.opacity===0)?K.opacity:O;for(P=0;P<K.coords.length;P+=1){L.push(K.coords[P])}this.graphicsMgr.drawLine(L,N,I,O)}},updateMap:function(D){var C=this;this.model=D;if(this.routeParamsA.length>0){if(D.transType&&D.transType==="zoom"){if(D.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(D.stepTrans){}else{if(D.endTrans){}}}}else{if(D.transType&&D.transType==="pan"){}else{if(!D.oldMapType){if(this.firstTime){this.drawAllRoutes()}else{this.redrawAllRoutes()}this.firstTime=false}}}}},redrawAllRoutes:function(){$.each(this.routeParamsA,function(D,C){C.updateDone=0});this.getARoute()},getARoute:function(){var G,H=true,E,F;E=this;F=null;F=function(B,A){E.drawRoute.call(E,B,A)};SEAT.PGRouteFormatCallback.register(E.drawRoute,E);for(G=0;G<this.routeParamsA.length;G+=1){if(this.routeParamsA[G].updateDone===0){this.getRoute(this.routeParamsA[G],"SEAT.PGRouteFormatCallback.callback");H=false;break}}return H},removeRoute:function(B){this.routeParamsA=$.grep(this.routeParamsA,function(A){return(!A.id||(A.id&&A.id!==B))});if(this.graphicsMgr&&(this.routeParamsA===null||this.routeParamsA.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawAllRoutes()}},removeAllRoutes:function(){this.routeParamsA=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}};SEAT.PGUtil.augment(SEAT.ViewRouteFormat,SEAT.LayerBase);var PGGEO_URL="http://geo.paginegialle.it/lbs",PGGEO_OK=1,PGGEO_NOK=2,PGGEO_MULTI=3,PGGEO_NAT_ITALIA=0,PGGEO_NAT_FRANCIA=1,PGGEO_NAT_GERMANIA=2,PGGEO_NAT_TURCHIA=3;var PGGeoCod=function(B){this.callGeo(B)};PGGeoCod.prototype={callGeo:function(D){var E,F;E="nat="+encodeURIComponent(D.nazione||"")+"&prov="+encodeURIComponent(D.provincia||"")+"&open="+encodeURIComponent(D.comune||"")+"&topo="+encodeURIComponent(D.indirizzo||"")+"&civ="+encodeURIComponent(D.civico||"")+"&format=javascript,"+encodeURIComponent(D.onComplete);F=(D.host||PGGEO_URL)+"?"+E;$.getScript(F)}};var PGGEOREV_URL="http://geo.paginegialle.it/reverse";var PGGeoRevCod=function(B){this.callGeoRev(B)};PGGeoRevCod.prototype={callGeoRev:function(E){var F,D;F="&x="+escape(E.lon)+"&y="+escape(E.lat)+"&format=javascript,"+escape(E.onComplete);D=(E.host||PGGEOREV_URL)+"?"+F;$.getScript(D)}};SEAT.RadarBox=function(){var B=this;$(window).unload(function(){B.unloadMe()})};SEAT.RadarBox.prototype={unloadMe:function(){this.selBox=null},init:function(){var B=this;this.id=this.viewMap.opts.nameContainer+"_radarBox";$('<div id="'+this.id+'"></div>').appendTo("#"+this.viewMap.opts.nameContainer);this.selBox=$("#"+this.id).css({background:"#555",opacity:0.5,border:"2px solid #000",position:"absolute",zIndex:999});this.sizeMe();this.setPos(this.getPos().left,this.getPos().top);this.dragDropAdd(this.id,{dragBefore:function(A){B.dragBefore(A)},dragging:function(A){B.dragging(A)},dragAfter:function(A){B.dragAfter(A)}})},remove:function(){},sizeMe:function(){var B;B=this.getDimensions(this.viewMap.model.z,this.viewMap.opts.radarParent.getZoom());this.setDimensions(B.width,B.height)},getDimensions:function(J,G){var H=Math.pow(2,J-G+1);var I=this.viewMap.opts.radarParent.getSize().width/H;var F=this.viewMap.opts.radarParent.getSize().height/H;return{width:I,height:F}},setDimensions:function(D,C){this.width=D;this.height=C;this.selBox.css({width:this.width,height:this.height})},getPos:function(){return{left:(this.viewMap.opts.mapWidth-this.width)/2,top:(this.viewMap.opts.mapHeight-this.height)/2}},setPos:function(D,C){this.left=D;this.top=C;this.selBox.css({left:this.left,top:this.top})},dragBefore:function(B){this.mapLayerContStart=this.viewMap.getMapPos();this.chgLeft=0;this.chgTop=0},dragging:function(H){var J=this;var K=parseInt(this.selBox.css("left"),10);var I=parseInt(this.selBox.css("top"),10);var G=15;var L=2;this.cL=0;this.cT=0;if(this.width<(this.viewMap.opts.mapWidth-(G*2))){if(K<G){this.cL=L}else{if((K+this.width)>(this.viewMap.opts.mapWidth-G)){this.cL=-L}}}if(this.height<(this.viewMap.opts.mapHeight-(G*2))){if(I<G){this.cT=L}else{if((I+this.height)>(this.viewMap.opts.mapHeight-G)){this.cT=-L}}}if(this.cL!==0||this.cT!==0){if(!this.intMoveCont){this.intMoveCont=setInterval(function(){J.moveCont()},15)}}else{if(this.intMoveCont){clearInterval(this.intMoveCont);this.intMoveCont=null}}},dragAfter:function(B){if(this.intMoveCont){clearInterval(this.intMoveCont);this.intMoveCont=null}this.left+=B.chg.x;this.top+=B.chg.y;this.viewMap.recalcOffsetX=this.chgLeft;this.viewMap.recalcOffsetY=this.chgTop;this.viewMap.panMapBy(-B.chg.x,-B.chg.y)},moveCont:function(){var D,C;this.chgLeft+=this.cL;this.chgTop+=this.cT;D=this.mapLayerContStart.x+this.chgLeft;C=this.mapLayerContStart.y+this.chgTop;this.viewMap.moveToSimple(D,C)},updateMap:function(L){var I,J,K,G,H;this.model=L;if(L.transType&&L.transType==="zoom"){if(L.startTrans){this.newParentZ=this.viewMap.opts.radarParent.getNewZoom();H=this.getDimensions(L.newVals.z,this.newParentZ);if(this.width!==H.width||this.height!==H.height){this.startDim={width:this.width,height:this.height};this.chgDim={x:H.width-this.width,y:H.height-this.height}}}else{if(L.stepTrans){if(this.chgDim){K=this.startDim.width+(this.chgDim.x*L.now);G=this.startDim.height+(this.chgDim.y*L.now);this.setDimensions(K,G);this.setPos(this.getPos().left,this.getPos().top)}}else{if(L.endTrans){if(this.chgDim){H=this.getDimensions(L.z,this.newParentZ);this.setDimensions(H.width,H.height);this.setPos(this.getPos().left,this.getPos().top)}this.chgDim=null}}}}else{if(L.transType&&L.transType==="pan"){if(L.startTrans){if(this.left!==this.getPos().left||this.top!==this.getPos().top){this.startPos={left:this.left,top:this.top};this.chg={x:this.getPos().left-this.left,y:this.getPos().top-this.top}}}else{if(L.stepTrans){if(this.chg){I=this.startPos.left+(this.chg.x*L.now);J=this.startPos.top+(this.chg.y*L.now);this.setPos(I,J)}}else{if(L.endTrans){if(this.chg){this.setPos(this.getPos().left,this.getPos().top)}this.chg=null}}}}else{}}},updateMapSize:function(){this.sizeMe();this.setPos(this.getPos().left,this.getPos().top)}};SEAT.PGUtil.augment(SEAT.RadarBox,SEAT.LayerBase);SEAT.PGUtil.augment(SEAT.RadarBox,SEAT.DragDropMgr);var PGWayPoint=function(){return{addWayPoints:function(G,J,I){var H=[],F=this;I=I||{};if(J&&J.way_points&&J.way_points.length>0){$.each(J.way_points,function(B,D){var C,A;if(D.sym){if(D.sym.href&&D.sym.href!=""){C=D.sym.href}else{if(isNaN(D.sym.id)){}else{if(parseInt(D.sym.id,10)>=0){C="http://img.tuttocitta.it/api/icons/"+D.sym.id+".png"}}}}if(C){A=new SEAT.ImgQ({onImgLoad:function(E,M,N){F.addAWayPoint(E,J.way_points[E],N,I,J.way_points.length,H,G)}});A.queueImg(B,C)}else{F.addAWayPoint(B,D,null,I,J.way_points.length,H,G)}})}},addAWayPoint:function(N,R,V,Q,M,X,P){var U="",O,T,W=null,S;if(V){S=($.browser.msie)?"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true src='"+V.src+"');":"background: url("+V.src+") no-repeat;";W='<div style="'+S+"width:"+V.width+"px;height:"+V.height+'px;"></div>'}if(Q.onOpen){T="closeMe"+R.id;$.extend(R,{closeID:T});O=new PGPoint({html:W,lon:R.x,lat:R.y,opened:{onOpen:Q.onOpen,onOpenParams:R,closeID:T}})}else{U+='<div style="width:300px;background:#fff;">';U+='<div style="padding:15px 5px 5px 5px;border:2px solid #000;">';U+='<div id="closeMe'+R.id+'" style="position:absolute;top:5px;right:5px;width:14px;height:14px;"><img src="http://img.tuttocitta.it/nuovotcol/img/fumetti/icoChiudiFumetto.gif" width="14" height="14"/></div>';if(V){U+='<img src="'+V.src+'" style="margin:0 5px 5px 0;vertical-align:text-top;width:'+V.width+"px;height:"+V.height+'px;"/>'}U+=(R.name&&R.name!=="")?"<b>"+R.name+"</b>":"";U+=(R.dsc&&R.dsc!=="")?"<br/>"+R.dsc:"";U+=(R.cmt&&R.cmt!=="")?"<br/>"+R.cmt:"";U+='<div style="clear:both;height:10px;width:1px;"></div>';U+="</div>";U+="</div>";O=new PGPoint({html:W,lon:R.x,lat:R.y,opened:{html:U,closeID:"closeMe"+R.id}})}X.push(O);P.pointAdder(O);if(Q.onComplete&&X.length===M){Q.onComplete.call(Q.onComplete,{map:P,points:X})}},removeWayPoints:function(B){if(B&&B.points&&B.points.length>0){$.each(B.points,function(A,D){B.map.removePoint(D)})}}}}();SEAT.wPgZoom=function(B){if(B){$.extend(this,B)}};SEAT.wPgZoom.prototype={idZoomN:{},idZoomDisabilitati:{},idOrto:{},idInOut:{},idZoomGruppi:{},logicaGruppi:false,initGrafica:function(){},optsInitGrafica:{},adattaLingua:function(){},selezionaFinoCorrente:false,abilitaMenoUno:false,init:function(){var H=this;if(this.zoomLimit===undefined){this.zoomLimit=10}this.initGrafica(this.optsInitGrafica);$("#"+this.idInOut.out).bind("click",function(){if(H.viewMap.model.z<H.zoomLimit){var C=true;var B=H.viewMap.model.z+1;for(var A in H.idZoomDisabilitati){if(A==B){C=false;break}}if(C){H.pgMappy.zoomOut()}}}).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraZoomOut")},function(){$(this).removeClass("mouseSopraZoomOut")});$("#"+this.idInOut["in"]).bind("click",function(){if((H.abilitaMenoUno&&(H.viewMap.model.z>-1||H.viewMap.model.mapType!=1))||(H.viewMap.model.z>0||H.viewMap.model.mapType!=1)){var C=true;var B=H.viewMap.model.z-1;for(var A in H.idZoomDisabilitati){if(A==B){C=false;break}}if(C){H.pgMappy.zoomIn()}}}).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraZoomIn")},function(){$(this).removeClass("mouseSopraZoomIn")});function J(A){this.setZoom=function(){if(H.viewMap.model.z!=A&&((H.abilitaMenoUno&&!(A<-1&&H.viewMap.model.mapType==1))||!(A<0&&H.viewMap.model.mapType==1))){H.pgMappy.setZoom(A)}}}var K=[];for(var L in this.idZoomN){if(parseInt(L)<0){K[parseInt(L)+15]=new J(L);$("#"+this.idZoomN[""+L]).bind("click",K[parseInt(L)+15].setZoom).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraZoomN")},function(){$(this).removeClass("mouseSopraZoomN")})}else{K[L]=new J(L);$("#"+this.idZoomN[""+L]).bind("click",K[L].setZoom).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraZoomN")},function(){$(this).removeClass("mouseSopraZoomN")})}}var G=[];for(var L in this.idZoomDisabilitati){G.push(parseInt(L));$("#"+this.idZoomDisabilitati[""+L]).bind("click",function(A){A.stopPropagation()}).bind("dblclick",function(A){A.stopPropagation()}).addClass("zoomDisabilitati")}if(G.length>0){this.pgMappy.setDisabledZoom(G)}var I=[];for(var L in this.idOrto){I[parseInt(L)+3]=new J(L);$("#"+this.idOrto[""+L]).bind("click",I[parseInt(L)+3].setZoom).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraZoomN")},function(){$(this).removeClass("mouseSopraZoomN")})}this.updateZoom();this.updateType()},updateZoom:function(){var F=this.viewMap.model.z;var D=false;for(var E in this.idZoomN){if(E!=F){$("#"+this.idZoomN[""+E]).removeClass("zCorrente").removeClass("zFinoCorrente").addClass("zDefault")}else{$("#"+this.idZoomN[""+E]).removeClass("zDefault").removeClass("zFinoCorrente").addClass("zCorrente");D=true}}for(var E in this.idOrto){if(E!=F){$("#"+this.idOrto[""+E]).removeClass("zCorrente").removeClass("zFinoCorrente").addClass("zDefault")}else{$("#"+this.idOrto[""+E]).removeClass("zDefault").removeClass("zFinoCorrente").addClass("zCorrente");D=true}}if(!D&&this.logicaGruppi){for(var E in this.idZoomGruppi){if(E==F){$("#"+this.idZoomGruppi[""+E]).removeClass("zFinoCorrente").removeClass("zDefault").addClass("zCorrente");D=true}}}if(D&&this.selezionaFinoCorrente){for(var E in this.idZoomN){if(E>F){$("#"+this.idZoomN[""+E]).removeClass("zDefault").addClass("zFinoCorrente")}}for(var E in this.idOrto){if(E>F){$("#"+this.idOrto[""+E]).removeClass("zDefault").addClass("zFinoCorrente")}}}},updateType:function(){for(var B in this.idOrto){if(this.viewMap.model.mapType==1){$("#"+this.idOrto[""+B]).removeClass("ortoAbilitate").addClass("ortoDisabilitate")}else{$("#"+this.idOrto[""+B]).removeClass("ortoDisabilitate").addClass("ortoAbilitate")}}},updateMap:function(B){if(B.transType&&B.transType==="zoom"){if(B.endTrans){this.updateZoom()}}if(B.oldMapType){this.updateZoom();this.updateType()}},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLingua(B)}};SEAT.PGUtil.augment(SEAT.wPgZoom,SEAT.LayerBase);SEAT.wPgType=function(B){if(B){$.extend(this,B)}};SEAT.wPgType.prototype={initGrafica:function(){},optsInitGrafica:{},adattaLinguaType:function(){},idType:{},init:function(){var F=this;this.initGrafica(this.optsInitGrafica);function H(A){this.setType=function(){if(F.viewMap.model.mapType!=A){F.pgMappy.setMapType(parseInt(A))}}}var G=[];for(var E in this.idType){G[E]=new H(E);$("#"+this.idType[""+E]).bind("click",G[E].setType).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraType")},function(){$(this).removeClass("mouseSopraType")})}this.update()},update:function(){var C=this.viewMap.model.mapType;for(var D in this.idType){if(D!=C){$("#"+this.idType[""+D]).removeClass("tpCorrente").addClass("tpDefault")}else{$("#"+this.idType[""+D]).removeClass("tpDefault").addClass("tpCorrente")}}},updateMap:function(B){if(B.oldMapType){this.update()}},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLinguaType(B)}};SEAT.PGUtil.augment(SEAT.wPgType,SEAT.LayerBase);SEAT.wPgScale=function(B){if(B){$.extend(this,B)}};SEAT.wPgScale.prototype={zoom_array_desc:["100 mt","200 mt","400 mt","800 mt","1.5 km","3 km","6 km","12 km","25 km","50 km","200 km","500 km"],zoom_neg_array_desc:["50 mt","20 mt","10 mt"],adattaLingua2:function(){},css:{},init:function(){if(!this.div){this.div="wPgScaleContainer";$("#"+this.viewMap.opts.nameContainer).append('<div id="wPgScaleContainer"></div>');$("#"+this.div).css({position:"absolute","z-index":"999"})}$("#"+this.div).css(this.css);this.update()},update:function(){var B=this.viewMap.model.z;if(B<0){$("#"+this.div).html(this.zoom_neg_array_desc[-(B)-1])}else{$("#"+this.div).html(this.zoom_array_desc[B])}},updateMap:function(B){if(B.transType&&B.transType==="zoom"){if(B.endTrans){this.update()}}},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLingua2(B)}};SEAT.PGUtil.augment(SEAT.wPgScale,SEAT.LayerBase);SEAT.wPgLegend=function wPgLegend(B){if(B){$.extend(this,B)}};SEAT.wPgLegend.prototype={divId:"",css:{},url:"",title:"",adattaLinguaLegend:function(){},altro:"",init:function(){var B=this;$("#"+this.divId).css(B.css).bind("click",function(){var A=open(B.url,B.title,B.altro);A.focus()}).hover(function(){$(this).addClass("mouseSopraLegend")},function(){$(this).removeClass("mouseSopraLegend")})},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLinguaLegend(B)}};SEAT.PGUtil.augment(SEAT.wPgLegend,SEAT.LayerBase);SEAT.wPgSize=function(B){if(B){$.extend(this,B)}};SEAT.wPgSize.prototype={idSize:{},initGrafica:function(){},optsInitGrafica:{},adattaLinguaSize:function(){},init:function(){var F=this;this.initGrafica(this.optsInitGrafica);function H(A){this.setSize=function(){var C=A.h;var B=A.w;F.pgMappy.setSize(B,C)}}var G=[];for(var E in this.idSize){G[E]=new H(this.idSize[""+E])}for(var E in this.idSize){$("#"+this.idSize[""+E].id).bind("click",G[E].setSize).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraSize")},function(){$(this).removeClass("mouseSopraSize")})}this.update()},update:function(){var E=this.viewMap.opts.mapHeight;var D=this.viewMap.opts.mapWidth;for(var F in this.idSize){if((this.idSize[""+F].h!=E)||(this.idSize[""+F].w!=D)){$("#"+this.idSize[""+F].id).removeClass("szCorrente");$("#"+this.idSize[""+F].id).addClass("szDefault")}else{$("#"+this.idSize[""+F].id).removeClass("szDefault");$("#"+this.idSize[""+F].id).addClass("szCorrente")}}},updateMap:function(B){},updateMapSize:function(B){this.update()},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLinguaSize(B)}};SEAT.PGUtil.augment(SEAT.wPgSize,SEAT.LayerBase);SEAT.wPgDragZoom=function(B){if(B){$.extend(this,B)}};SEAT.wPgDragZoom.prototype={initGrafica:function(){},optsInitGrafica:{},adattaLinguaDragZm:function(){},idAction:{},init:function(){var F=this;this.initGrafica(this.optsInitGrafica);function E(A){this.setActionType=function(){if(F.viewMap.model.actionType!=A){F.pgMappy.setActionType(parseInt(A));F.update()}}}var G=[];for(var H in this.idAction){G[H]=new E(H);$("#"+this.idAction[""+H]).bind("click",G[H].setActionType).bind("dblclick",function(A){A.stopPropagation()}).hover(function(){$(this).addClass("mouseSopraActionType")},function(){$(this).removeClass("mouseSopraActionType")})}this.update()},update:function(){var C=this.viewMap.opts.actionType;for(var D in this.idAction){if(D!=C){$("#"+this.idAction[""+D]).removeClass("actionCorrente").addClass("actionDefault")}else{$("#"+this.idAction[""+D]).removeClass("actionDefault").addClass("actionCorrente")}}},updateMapLanguage:function(){var B=this.viewMap.opts.lng||0;this.adattaLinguaDragZm(B)}};SEAT.PGUtil.augment(SEAT.wPgDragZoom,SEAT.LayerBase);SEAT.PGUtilita=function(G,E,F){this.type=E;this.pgMappy=G;this.nameContainer=this.pgMappy.pgLineList.viewMap.opts.nameContainer;if(F){$.extend(this,F)}if(!this.htmlIcon||this.htmlIcon==""){var H="http://img.tuttocitta.it";this.htmlIcon='<div style="width:19px;height:19px;"><img src="'+H+"/tcolnew/img/poi_"+E+'.png" style="border:0px;"/></div>';this.heightIcon=20;this.widthIcon=20}this.vcc=SEAT.PGListaVccUtilita[E]};SEAT.PGUtilita.prototype={useFumetto:false,usePopup:true,htmlIcon:"",heightIcon:0,widthIcon:0,afterCallMotore:function(N){var K=this;this.currentJson=N;var M=N.xx.co||[];for(var O=0;O<M.length;O++){var P=M[O];if(this.vcc.indexOf(P.ca.b)!=-1){var J=P.cx;var L=P.cy;if(this.usePopup){var I=new PGPoint({id:O,lon:J,lat:L,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type});PGEvent.addListener(I,"mouseover",function(A){K.buildPopup(A)});PGEvent.addListener(I,"mouseout",function(A){K.pgMappy.PGListaUtilita.clearPopup()});this.pgMappy.pointAdder(I)}else{if(this.useFumetto){var I=new PGPoint({id:"p_"+this.type+"_"+O,lon:J,lat:L,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type,opened:{html:this.buildFumetto(P)}});this.pgMappy.pointAdder(I)}else{var I=new PGPoint({id:"p_"+this.type+"_"+O,lon:J,lat:L,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type});this.pgMappy.pointAdder(I)}}}}},clear:function(){var B=this;$.each(B.pgMappy.pointList.pointList,function(A,D){if(D.j.typ==B.type){B.pgMappy.removePoint(D)}})},buildPopup:function(X){var V=this.currentJson.xx.co[X.id];var P=V.cx;var T=V.cy;var N=V.na.content;var Q=V.ad;var O=V.cp+" "+V.lo.content+" ("+V.pr+")";var R=V.te?"Tel: "+V.te:"";var Z=V.fa?"Fax: "+V.fa:"";var U=V.em?"Email: "+V.em:"";var W="";var Y="";Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_nome">'+N+"</div>";Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_ind">'+Q+"</div>";Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_com">'+O+"</div>";if(R&&R!=""){Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_tel">'+R+"</div>"}if(Z&&Z!=""){Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_fax">'+Z+"</div>"}if(U&&U!=""){Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_mail">'+U+"</div>"}if(W&&W!=""){Y+='<div id="'+this.nameContainer+'_pgUtilitaPopup_ora">'+W+"</div>"}$("#"+this.nameContainer+"_pgUtilitaPopup").html(Y);$("#"+this.nameContainer+"_pgUtilitaPopup_nome").css({padding:"2px","font-size":"12px","font-weight":"bold","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_ind").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_com").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_tel").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_fax").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_mail").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});$("#"+this.nameContainer+"_pgUtilitaPopup_ora").css({padding:"2px","font-size":"10px","font-weight":"normal","text-align":"left"});var S={};S.lon=P;S.lat=T;S.heightIcon=this.heightIcon;this.pgMappy.PGListaUtilita.openPopup(S)},buildFumetto:function(D){var C='<div style="width:150px; height:150px; background:yellow; border:2px solid #000;">'+D.lon+"</div>";return C}};SEAT.PGUtilitaList=function(C,D){if(D){$.extend(this,D)}C.addLayer(this)};SEAT.PGUtilitaList.prototype={zoomLimit:4,maxNumPoi:70,listaLayer:null,init:function(){var D=this;if(!$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").size()>0){var C='<div id="'+this.viewMap.opts.nameContainer+'_pgUtilitaPopup"></div>';$("#"+this.viewMap.opts.nameContainer).append(C);$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").css({display:"none",position:"absolute",width:"200px","background-color":"white","z-index":"999",border:"solid 1px"})}this.listenerDrag=PGEvent.addListener(this.pgMappy,"mousemovebefore",function(){D.clearPopup()})},updateMap:function(C){if(C.transType){if(C.transType=="zoom"){if(C.startTrans){this.clearPopup();this.clear()}}else{if(C.transType=="drag"){this.clearPopup()}}}else{var D=false;if(C.z!=this.actualZ){this.actualZ=C.z;D=true}if((C.lon!=this.actualLon)||(C.lat!=this.actualLat)){this.actualLon=C.lon;this.actualLat=C.lat;D=true}if(D){if(C.z<this.zoomLimit){this.search(this.calcolaVcc(),this.calcolaParametriMappa())}}}},updateMapSize:function(){},remove:function(){PGEvent.removeListener(this.listenerDrag)},addLayer:function(F,E){if(this.listaLayer==null){this.listaLayer={}}if(!this.listaLayer[F]){var D=new SEAT.PGUtilita(this.pgMappy,F,E);this.listaLayer[F]=D;if(this.pgMappy.getZoom().z<this.zoomLimit){this.search(D.vcc,this.calcolaParametriMappa(),D)}}else{}},removeLayer:function(B){if(this.listaLayer!=null){if(this.listaLayer[B]){this.listaLayer[B].clear();delete this.listaLayer[B];if(this.listaLayerLength()==0){this.listaLayer=null}}}},listaLayerLength:function(){var C=0;for(var D in this.listaLayer){C++}return C},openPopup:function(F){var G=this;var H=this.pgMappy.getPixelFromLonLat(F.lon,F.lat);var E={};if(H.y<this.viewMap.opts.mapHeight/2){E.top=H.y}else{E.top=H.y-$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").height()-F.heightIcon}if(H.x<this.viewMap.opts.mapWidth/2){E.left=H.x}else{E.left=H.x-$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").width()}$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").css(E);if(this.popupTimeout){clearTimeout(this.popupTimeout);this.popupTimeout=null}this.popupTimeout=setTimeout(function(){$("#"+G.viewMap.opts.nameContainer+"_pgUtilitaPopup").fadeIn()},500)},clearPopup:function(B){if(this.popupTimeout){clearTimeout(this.popupTimeout);this.popupTimeout=null}$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").fadeOut()},setZoomLimit:function(B){this.zoomLimit=B},clear:function(){for(var B in this.listaLayer){this.listaLayer[B].clear()}},search:function(O,P,R){if(this.listaLayerLength()<=0){return }var J=this;var N="http://www.tuttocitta.it";var K="/tcit/search";var L="tr=1&vcc="+O+"&mr="+this.maxNumPoi+"&cy="+P.lat+"&cx="+P.lon+"&px="+P.width+"&py="+P.height+"&z="+P.zDist+"&json=1&mt=1&enc=u&callback=?";var M=N+K+"?"+L;var Q=null;if(R!=null){Q=function(A){J.listaLayer[R.type].afterCallMotore(A)}}else{Q=function(A){J.aggiornaLayers(A)}}$.getJSON(M,Q)},aggiornaLayers:function(C){this.clear();for(var D in this.listaLayer){this.listaLayer[D].afterCallMotore(C)}},calcolaParametriMappa:function(){var F=this.pgMappy.map.getCenter();var H=this.pgMappy.getZoom();var E=this.pgMappy.getSize();var G={lon:F.lon,lat:F.lat,z:H.z,zDist:H.zDist,height:E.height,width:E.width};return G},calcolaVcc:function(){var F="";var H=0;var E=this.listaLayerLength();for(var G in this.listaLayer){H++;F+=this.listaLayer[G].vcc;if(H<E){F+="@"}}return F}};SEAT.PGUtil.augment(SEAT.PGUtilitaList,SEAT.LayerBase);SEAT.PGListaVccUtilita={taxi:"008734600",park:"001111600",benz:"008536600",auto:"001103600"};SEAT.PGMappy.prototype.addLayerUtilita=function(C,D){if(!this.PGListaUtilita){this.PGListaUtilita=new SEAT.PGUtilitaList(this,D)}this.PGListaUtilita.addLayer(C,D)};SEAT.PGMappy.prototype.removeLayerUtilita=function(B){if(this.PGListaUtilita){this.PGListaUtilita.removeLayer(B)}};SEAT.PGUtilitaCheckboxManager=function(F,D,E){this.checkBoxArray=D;if(E){$.extend(this,E)}F.addLayer(this);if(!F.PGListaUtilita){F.PGListaUtilita=new SEAT.PGUtilitaList(F,{zoomLimit:this.zoomLimit,maxNumPoi:this.maxNumPoi})}if(!F.PGListaCheckboxManager){F.PGListaCheckboxManager=[]}F.PGListaCheckboxManager.push(this)};SEAT.PGUtilitaCheckboxManager.prototype={zoomLimit:4,maxNumPoi:50,useFumetto:false,usePopup:true,init:function(){var B=this;$.each(this.checkBoxArray,function(I,A){$("#"+A.id).bind("click",function(){if(this.checked){var C=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.html)?B.checkBoxArray[I].icon.html:"";var D=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.height)?B.checkBoxArray[I].icon.height:0;var E=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.width)?B.checkBoxArray[I].icon.width:0;B.pgMappy.PGListaUtilita.addLayer(B.checkBoxArray[I].type,{htmlIcon:C,heightIcon:D,widthIcon:E,useFumetto:B.useFumetto,usePopup:B.usePopup});if(B.pgMappy.PGListaCheckboxManager&&B.pgMappy.PGListaCheckboxManager.length>1){$.each(B.pgMappy.PGListaCheckboxManager,function(L,F){F.checkType(B.checkBoxArray[I].type,false)})}}else{B.pgMappy.PGListaUtilita.removeLayer(B.checkBoxArray[I].type);if(B.pgMappy.PGListaCheckboxManager&&B.pgMappy.PGListaCheckboxManager.length>1){$.each(B.pgMappy.PGListaCheckboxManager,function(L,F){F.checkType(B.checkBoxArray[I].type,true)})}}});if(B.pgMappy.map.getZoom()>=B.zoomLimit){$("#"+A.id).attr("disabled","true")}if(A.checked){$("#"+A.id).attr("checked","checked");var G=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.html)?B.checkBoxArray[I].icon.html:"";var H=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.height)?B.checkBoxArray[I].icon.height:0;var J=(B.checkBoxArray[I].icon&&B.checkBoxArray[I].icon.width)?B.checkBoxArray[I].icon.width:0;setTimeout(function(){B.pgMappy.PGListaUtilita.addLayer(B.checkBoxArray[I].type,{htmlIcon:G,heightIcon:H,widthIcon:J,useFumetto:B.useFumetto,usePopup:B.usePopup})},500)}})},updateMap:function(C){if(C.transType&&C.transType=="zoom"&&C.endTrans){for(var D=0;D<this.checkBoxArray.length;D++){if(C.z>=this.zoomLimit){$("#"+this.checkBoxArray[D].id).attr("disabled","true")}else{$("#"+this.checkBoxArray[D].id).removeAttr("disabled")}}}},remove:function(){},checkType:function(D,C){$.each(this.checkBoxArray,function(B,A){if(A.type==D){if(C){$("#"+A.id).removeAttr("checked")}else{$("#"+A.id).attr("checked","checked")}}})}};SEAT.PGUtil.augment(SEAT.PGUtilitaCheckboxManager,SEAT.LayerBase);SEAT.PGMappy.prototype.addUtilitaCheckboxManager=function(C,D){return new SEAT.PGUtilitaCheckboxManager(this,C,D)};(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);var adagioBs;SEAT.TC.banner=function(A){if($("#adagioJS").length===0){$("body").append('<div id="adagioJS"></div>')}adagioBs=new adagioBanners();adagioBs.name="adagioBs";if(A.length>0){$.each(A,function(C,B){var E=B.o,D=[];if(E.id&&E.id!==""&&$("#"+E.id).length>0){if(B.callback){SEAT.TC.bannerYesCallback=B.callback;D.JsFunc="SEAT.TC.bannerYes();"}if(B.callbackNo){SEAT.TC.bannerNoCallback=B.callbackNo;D.JsFuncNo="SEAT.TC.bannerNo();"}if(B.type==="b"){adagioBs.addBanner(E.id,E.sito||"",E.size||"",E.sezione||"",E.catgeo||"",E.catgeo2||"",E.vcc||"",E.settore||"",E.regione||"",E.provincia||"",E.comune||"",E.keyword||"",D)}else{if(B.type==="f"){adagioBs.addFormat(E.id,E.format||"",E.sito||"",E.size||"",E.sezione||"",E.catgeo||"",E.catgeo2||"",E.vcc||"",E.settore||"",E.regione||"",E.provincia||"",E.comune||"",E.keyword||"",D)}}}});adagioBs.drawNextBanner()}};SEAT.TC.bannerYes=function(){SEAT.TC.bannerYesCallback.call()};SEAT.TC.bannerNo=function(){SEAT.TC.bannerNoCallback.call()};String.prototype.tokenize=tokenize;function tokenize(){var C="";var G=" ";var A="";var B=true;try{String(this.toLowerCase())}catch(F){window.alert("Tokenizer Usage: string myTokens[] = myString.tokenize(string separator, string trim, boolean ignoreEmptyTokens);");return }if(typeof (this)!="undefined"){C=String(this)}if(typeof (tokenize.arguments[0])!="undefined"){G=String(tokenize.arguments[0])}if(typeof (tokenize.arguments[1])!="undefined"){A=String(tokenize.arguments[1])}if(typeof (tokenize.arguments[2])!="undefined"){if(!tokenize.arguments[2]){B=false}}var H=C.split(G);if(A){for(var E=0;E<H.length;E++){while(H[E].slice(0,A.length)==A){H[E]=H[E].slice(A.length)}while(H[E].slice(H[E].length-A.length)==A){H[E]=H[E].slice(0,H[E].length-A.length)}}}var D=new Array();if(B){for(var E=0;E<H.length;E++){if(H[E]!=""){D.push(H[E])}}}else{D=H}return D}if(typeof Cookie==="undefined"){var Cookie={}}Cookie.setCookie=function(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+E+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")};Cookie.readCookie=function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return""};Cookie.eraseCookie=function(A,B){Cookie.setCookie(A,"",-1,B,null,null)};function fixIeComboBug(B){if($.browser.msie&&$.browser.version.indexOf("6")==0){B.children("iframe").remove();var A=B.outerHeight()||1000;var C=B.outerWidth()||1000;B.append('<iframe frameborder="0" style="position:absolute;top:0px;left:0px;width:'+C+"px;height:"+A+'px;display:block;z-index:-1;filter:mask();"></iframe>')}}function getPar(B){var A="[\\?&]"+B+"=([^&#]*)";var E=new RegExp(A);var D=window.location.href;var C=E.exec(D);if(C==null){return""}else{return C[1]}}function buildErrorMessage(C,F,B,E){var A=$("#geocoderErrorMessage").remove();if(F&&F!=""){$("#"+F).prepend('<div id="geocoderErrorMessage"></div>')}else{$(document.body).append('<div id="geocoderErrorMessage"></div>')}A=$("#geocoderErrorMessage");if(B&&B!=""){A.addClass(B)}var D='<div><a id="geocoderErrorMessageClose" class="chiudi" href="javascript:void(0)" title="chiudi"><span class="chiusura">chiudi</span></a>';if(E==undefined||E==false){D+="<h3>ATTENZIONE!</h3>"}D+='<p id="geocoderErrorMessageCenter">'+C+'</p><span class="ombra-errore"></span></div>';A.append(D);$("#geocoderErrorMessageClose").click(function(G){G.stopPropagation();$("#geocoderErrorMessage").hide().remove()});A.show();fixIeComboBug($("#geocoderErrorMessage"))}function hideLegend(){$(".legend").hide("fast");return false}function showPgLink(A,B){hideLegend();$("#linkPagId").val(A);if(B){$("#extSiteId").val(B)}$(".link-a-pag").show();selectInput("linkPagId");return false}function getHtmlIfrExtSite(B,E,F,D,A,C){var G='<iframe width="'+B+'" height="'+E+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+F+'"></iframe>';G+='<br/><a target="_blank" title="Mappa ingrandita" style="font-size: 82%; color: #555; padding: 5px 0;" href="'+encodeURI(D)+'">Cerca nella mappa</a>';if(A&&A!=""&&C&&C!=""){G+=' - <a target="_blank" style="font-size: 82%; color: #555; padding: 5px 0;" title="Parti da qui" href="'+encodeURI(A)+'">Parti da qui</a>';G+=' - <a target="_blank" style="font-size: 82%; color: #555; padding: 5px 0;" title="Arriva qui" href="'+encodeURI(C)+'">Arriva qui</a>'}return G}function selectInput(A){document.getElementById(A).focus();document.getElementById(A).select()}function hidePgLink(){$(".link-a-pag").hide("fast");return false}$(function(){if($.browser.msie&&$.browser.version.indexOf("6")==0){$("#nav").hover(function(){$(this).find("li").addClass("over")},function(){$(this).find("li").removeClass("over")})}});function showLegend(){var B=$(".legend");if($.trim(B.html())==""){var A="";A+="<h4>LEGENDA</h4>";A+='<a class="chiudi" title="chiudi" href="javascript:void(0)" onclick="hideLegend();"><span class="chiusura">chiudi</span></a>';A+='<ul class="servizi">';A+='<li><span class="leg1">metropolitana</span>metropolitana</li>';A+='<li><span class="leg2">passante</span>passante</li>';A+='<li><span class="leg3">stazione ferroviaria</span>stazione ferroviaria</li>';A+='<li><span class="leg4">stazione autobus</span>stazione autobus</li>';A+='<li><span class="leg5">porto</span>porto</li>';A+='<li><span class="leg6">aeroporto</span>aeroporto</li>';A+="</ul>";A+='<ul class="strade">';A+='<li><span class="leg7">autostrada</span>autostrada</li>';A+='<li><span class="leg8">alta percorrenza</span>strada alta percorrenza</li>';A+='<li><span class="leg9">media percorrenza</span>strada media percorrenza</li>';A+='<li><span class="leg10">bassa percorrenza</span>strada bassa percorrenza</li>';A+='<li><span class="leg11">strada pedonale, ZTL</span>strada pedonale, ZTL</li>';A+='<li><span class="leg12">confine regionale</span>confine regionale</li>';A+='<li><span class="leg13">confine confine di stato</span>confine confine di stato</li>';A+="</ul>";A+='<ul class="aree">';A+='<li><span class="leg14">monumenti</span>monumenti</li>';A+='<li><span class="leg15">scuole</span>edifici governativi, ospedali, universit&agrave;, scuole</li>';A+='<li><span class="leg16">fiere</span>fiere, aree commerciali, centri sportivi</li>';A+='<li><span class="leg17">parchi</span>parchi</li>';A+='<li><span class="leg18">zone industriali</span>zone industriali</li>';A+='<li><span class="leg19">areoporti</span>areoporti, stazioni</li>';A+="</ul>";A+='<span class="rcSx"> </span>';A+='<span class="rcDx"> </span>';B.html(A)}hidePgLink();B.show("slow");return false}function openTraffic(A,C){var E=C.getZoom().z;var D;if(E<10){D=E+4}if(E>=10){D=E+5}var B=$("#"+A).attr("href")+"?z="+D+"&lon="+C.map.getCenter().lon+"&lat="+C.map.getCenter().lat;window.open(B);return false};var autocompleteOpened=false;SEAT.GeoCoder=function(B,A,C){this.divComune=B;this.divIndirizzo=A;if(C){$.extend(this,C)}this.init()};SEAT.GeoCoder.prototype={geoCodeServiceURL:"/lbs",popupWidth:350,popupResToShow:7,opening:"left",position:"bottom",autocomplete:false,callbackRefererObj:{},comuneErrorMessage:"Nessuna localit"+String.fromCharCode(224)+" trovata ...",indirizzoErrorMessage:"Nessun indirizzo trovato ...",fixIeBug:true,offsetTop:0,offsetLeft:0,divErrComune:"",divErrIndirizzo:"",abilitaProv:false,abilitaReg:false,activeItem:-1,init:function(){var A=this;this.bindTextBoxEvents(this.divComune);this.bindTextBoxEvents(this.divIndirizzo);$(document).bind("mousedown",function(B){if(A.opened&&B.target.id!="geoCoderVisualizer"&&B.target.id!="geoCoderVisualizerUlCont"&&B.target.id.indexOf("geoCoderVisualizerLi")!=0){setTimeout(function(){A.hideList()},300)}else{if(A.opened){$("#"+A.currentElementId).focus()}}});if(this.mappa){PGEvent.addListener(this.mappa,"click",function(B){if(A.opened){setTimeout(function(){A.hideList()},300)}})}},bindTextBoxEvents:function(A){var B=this;function C(D){switch(D.keyCode){case 9:break;case 37:break;case 38:D.preventDefault();B.move(-1);break;case 39:break;case 40:D.preventDefault();B.move(1);break;case 13:if(B.opened){D.preventDefault();B.sceltaElemento()}break;default:if(B.opened){B.hideList()}break}}$("#"+A).bind("keydown",C)},clear:function(){this.hideList();$("#"+this.divComune).val("");$("#"+this.divIndirizzo).val("")},geoCode:function(){var selfRef=this;var comune=$("#"+this.divComune).val()||"";var indirizzo=$("#"+this.divIndirizzo).val()||"";var soloCom=($.trim(indirizzo)!="")?false:true;function posizionaLista(elemId){var top=$("#"+elemId).offset().top+$("#"+elemId).outerHeight({});if(selfRef.opening=="right"){var left=$("#"+elemId).offset().left+$("#"+elemId).outerWidth({})-selfRef.popupWidth}else{var left=$("#"+elemId).offset().left}if(selfRef.offsetTop){top+=selfRef.offsetTop}if(selfRef.offsetLeft){left+=selfRef.offsetLeft}$("#geoCoderVisualizer").css({position:"absolute",top:""+top+"px",left:""+left+"px",width:""+selfRef.popupWidth+"px",display:"block"})}var pars="sito=tcol&missp=1&format=javascript&dist=10000&open="+encodeURIComponent(comune||"")+"&topo="+encodeURIComponent(indirizzo||"");$.get(this.geoCodeServiceURL+"?"+pars,function(json){eval("json="+json);if(json.ret=="0"||json.ret=="5"||(json.ret=="9"&&selfRef.abilitaProv)||(json.ret=="8"&&selfRef.abilitaReg)){var a=json.comuneList[0];var comStr="";var ind="";if(json.ret=="9"){comStr=a.prov}else{if(json.ret=="8"){comStr=a.reg}else{var com=a.com;var prov=a.prov?" ("+a.prov+")":"";if(!soloCom){if(a.civico&&a.civico!=""){ind=(a.topo||a.cTopo||"")+", "+(a.civico||"")}else{ind=(a.topo||a.cTopo||"")}}comStr=com+prov;if(json.inloc!="3"&&a.frazDesc){comStr=a.frazDesc}}}if(json.ret=="0"&&json.missp=="0"){var msg='Forse cercavi <a id="misspId">'+comStr+"</a>";buildErrorMessage(msg,selfRef.divErrComune,selfRef.classMessage,true);$("#misspId").click(function(){$("#"+selfRef.divComune).val(comStr);$("#"+selfRef.divIndirizzo).val(ind);selfRef.callbackGeocodeOK.call(selfRef.callbackRefererObj,json,soloCom)})}else{$("#"+selfRef.divComune).val(comStr);$("#"+selfRef.divIndirizzo).val(ind);selfRef.callbackGeocodeOK.call(selfRef.callbackRefererObj,json,soloCom)}}else{if(json.ret=="10"||json.ret=="40"||json.ret=="60"){selfRef.arrayScelte=[];selfRef.arrayScelteData=[];var list=(json.raggrList&&json.raggrList.length>0)?json.raggrList:json.comuneList;for(var i=0;i<list.length;i++){if(list[i].fraz){selfRef.arrayScelte.push(""+list[i].frazDesc)}else{if(list[i].com){if(list[i].prov){selfRef.arrayScelte.push(""+list[i].com+" ("+list[i].prov+")")}else{selfRef.arrayScelte.push(""+list[i].com)}}}}if($("#geoCoderVisualizer").length===0){$(document.body).append('<div id="geoCoderVisualizer" class="suggerimento none"></div>')}posizionaLista(selfRef.divComune);selfRef.buildList(selfRef.divComune,"com")}else{if(json.ret=="2"){selfRef.arrayScelte=[];selfRef.arrayScelteData=[];for(var j=0;j<json.addressList.length;j++){if(json.addressList[j].com){selfRef.arrayScelte.push("<strong>"+json.addressList[j].com.toUpperCase()+"</strong> - "+json.addressList[j].topo)}else{selfRef.arrayScelte.push(""+json.addressList[j].topo)}selfRef.arrayScelteData.push(json.addressList[j])}if($("#geoCoderVisualizer").length===0){$(document.body).append('<div id="geoCoderVisualizer" class="suggerimento none"></div>')}posizionaLista(selfRef.divIndirizzo);selfRef.buildList(selfRef.divIndirizzo,"ind")}else{selfRef.callbackGeocodeKO(json.ret)}}}})},buildList:function(A,F){var H=this;this.activeItem=-1;this.elementId=A;if(F=="ind"){var D="SELEZIONA L'INDIRIZZO CORRETTO"}else{var D="SELEZIONA LA LOCALIT"+String.fromCharCode(192)+" CORRETTA"}$("#geoCoderVisualizer").empty().append("<h4>"+D+'</h4><div id="geoCoderVisualizerUlCont" class="scroll"><ol></ol></div><a id="chiudi" title="chiudi" href="javascript:void(0)">chiudi</a>');for(var C=0;C<this.arrayScelte.length;C++){$("#geoCoderVisualizer ol").append('<li id="geoCoderVisualizerLi_'+C+'">'+this.arrayScelte[C]+"</li>")}$("#geoCoderVisualizer li").each(function(I){if(I==0){$(this).addClass("elemGeoCoderVisualizer_over");H.activeItem=0}$(this).click(function(){H.sceltaElemento(I)}).hover(function(J){$("#geoCoderVisualizer li").removeClass("elemGeoCoderVisualizer_over");$(this).addClass("elemGeoCoderVisualizer_over");H.activeItem=$("#geoCoderVisualizer li").index($(this).get(0))},function(J){})});var E=0;var G=$("#geoCoderVisualizerUlCont").offset({border:true,margin:true,padding:true,scroll:true}).top;var B=0;$("#geoCoderVisualizer li").each(function(I){B++;if(I==H.popupResToShow){E=($(this).offset({border:true,margin:true,padding:true,scroll:true}).top-G-2)}});$("#geoCoderVisualizer").hide();if(E>0&&B>=this.popupResToShow){$("#geoCoderVisualizerUlCont").css({height:""+E+"px"})}else{$("#geoCoderVisualizerUlCont").css({height:"auto","overflow-y":"hidden"})}$("#geoCoderVisualizerUlCont").css({width:""+H.popupWidth+"px"});this.visualizeList();$("#"+A).focus();this.currentElementId=A},visualizeList:function(){var A=$("#geoCoderVisualizer");A.css({"z-index":"20000"});A.show();if(this.fixIeBug){fixIeComboBug(A)}this.opened=true},hideList:function(){$("#geoCoderVisualizer").hide().html("");this.activeItem=-1;this.opened=false},move:function(C){if(this.opened){var B=$("#geoCoderVisualizerUlCont li");if(!B){return }this.activeItem+=C;if(this.activeItem<0){this.activeItem=0}else{if(this.activeItem>=B.size()){this.activeItem=B.size()-1}}B.removeClass("elemGeoCoderVisualizer_over");$(B[this.activeItem]).addClass("elemGeoCoderVisualizer_over");var D=$("#geoCoderVisualizerUlCont ol").outerHeight();if(this.activeItem+1>this.popupResToShow){var A=D*((this.activeItem-1)/B.size());$("#geoCoderVisualizerUlCont").animate({scrollTop:A},100)}else{$("#geoCoderVisualizerUlCont").animate({scrollTop:0},100)}}},sceltaElemento:function(B){if(this.opened){var A;if(B){A=B}else{A=this.activeItem}if(this.arrayScelteData.length>0&&this.arrayScelteData[A].com){$("#"+this.divIndirizzo).val(this.arrayScelteData[A].topo);$("#"+this.divComune).val(this.arrayScelteData[A].com)}else{$("#"+this.elementId).val(this.arrayScelte[A])}this.hideList();this.geoCode()}},callbackGeocodeOK:function(A){},callbackGeocodeKO:function(A){},afterAutocompleter:function(){}};SEAT.Searcher=function(A,H,C,F,E){var D=this;if(E){$.extend(this,E)}var B;var G=function(I){switch(I.keyCode){case 13:I.preventDefault();if(!B.opened&&!autocompleteOpened){if($("#"+C).val()===""){buildErrorMessage("Inserire localit&agrave;.",D.divErrComune)}else{B.geoCode()}}break;default:break}};$("#"+C).bind("keydown",G);$("#"+F).bind("keydown",G);B=new SEAT.GeoCoder(C,F,{afterAutocompleter:function(){B.geoCode()},callbackGeocodeOK:this.callbackGeocodeOK,callbackGeocodeKO:this.callbackGeocodeKO,autocomplete:this.autocomplete,callbackRefererObj:this.callbackRefererObj,mappa:this.mappa,fixIeBug:this.fixIeBug,divErrComune:this.divErrComune||"",divErrIndirizzo:this.divErrIndirizzo||"",abilitaProv:true,abilitaReg:true});$("#"+A).click(function(){if($("#"+C).val()===""){buildErrorMessage("Inserire localit&agrave;.",D.divErrComune)}else{B.geoCode()}});$("#"+H).click(function(){B.clear()})};SEAT.Searcher.prototype={callbackRefererObj:{},callbackGeocodeOK:function(B,A){},callbackGeocodeKO:function(A){if(""+A==="3"||""+A==="8"||""+A==="9"){buildErrorMessage("Localit&agrave; non riconosciuta.",this.divErrComune)}else{if(""+A==="4"){buildErrorMessage("Indirizzo non riconosciuto.",this.divErrIndirizzo)}else{buildErrorMessage("Errore durante la geocodifica dell'indirizzo.",this.divErrComune)}}}};SEAT.TC.Stat=function(){};SEAT.TC.Stat.prototype={URL_STAT:SEAT.TC.APP_PFX+"/stat",STAT_FUMETTO:38,STAT_WWW:1,STAT_EMAIL:25,STAT_LINKPG:39,STAT_PARTI:20,STAT_ARRIVA:20,STAT_INVIAA:7,STAT_STAMPA:67,STAT_VIDEO:88,initialize:function(){this.idq="";this.tsez="";this.cdoper="";this.tpuser="";this.listing=""},writeNavig:function(B,C,A,E,D){this.idq=B;this.tsez=C;this.cdoper=A;this.tpuser=E;this.listing=D;this.writeLog()},writeLog:function(){var A={tsez:this.tsez,cc:this.cdoper,tp:this.tpuser,ls:this.listing,idq:this.idq};$.get(this.URL_STAT,A,this.afterWriteLog)},afterWriteLog:function(){}};function callRedshV52(B){var A=Math.floor(Math.random()*1001);document.getElementById("redshFrame").src="http://secure-it.imrworldwide.com/cgi-bin/m?ci=paginegialle-it&cg="+B+"&rnd="+A+"&si="+escape("http://www.tuttocitta.it/"+B)}function callRedshV4(B){var A=Math.floor(Math.random()*1001);document.getElementById("redshFrame").src="http://secure-it.imrworldwide.com/cgi-bin/count?cid=it_paginegialle-it_0&rnd="+A+"&url="+escape("http://www.tuttocitta.it/"+B)}function sendClickPG(B){var A="/clickpg/"+B+"?verso=xxx";$.get(A)}function urlWithClickPG(B,A){var C="http://click.paginegialle.it/tuttocitta/"+A+"?verso="+B;return C};SEAT.TC.addZoomWidget=function(F,C,E,G){E=typeof (E)!="undefined"?E:"";var D=function(){var H=[];var I=0;var L=["Europa","Italia","Regione","Provincia","Provincia","Comune","Comune","Quartiere","Quartiere","Via","Via","Via","Via"];H[I++]='<ul class="clearfix"><li class="zoomIn"><a title="Ingrandisci" href="javascript:void(0)" class="zoomIn" id="zoomIn">Ingrandisci</a></li></ul>';H[I++]='<ul id="gauge" class="clearfix">';if(G==true){H[I++]='<li><a title="'+L[12]+'" href="javascript:void(0)" onfocus="this.blur()" id="zoom00'+E+'">Zoom livello 00</a></li>'}for(var J=1;J<13;J++){var K=(J<10)?"0"+J:J;H[I++]='<li><a title="'+L[12-J]+'" href="javascript:void(0)" onfocus="this.blur()" id="zoom'+K+E+'">Zoom livello '+K+"</a></li>"}H[I++]="</ul>";H[I++]='<ul class="zoomOut clearfix"><li class="zoomOut"><a title="Riduci" href="javascript:void(0)" class="zoomOut" id="zoomOut">Riduci</a></li></ul>';$("#"+C).html(H.join(" "))};var A={"0":"zoom01"+E,"1":"zoom02"+E,"2":"zoom03"+E,"3":"zoom04"+E,"4":"zoom05"+E,"5":"zoom06"+E,"6":"zoom07"+E,"7":"zoom08"+E,"8":"zoom09"+E,"9":"zoom10"+E,"10":"zoom11"+E,"11":"zoom12"+E};if(G==true){A["-1"]="zoom00"+E}var B=new SEAT.wPgZoom({initGrafica:D,idZoomN:A,idOrto:{},idZoomGruppi:{},logicaGruppi:false,idInOut:{out:"zoomOut","in":"zoomIn"},abilitaMenoUno:G,selezionaFinoCorrente:true,zoomLimit:12});F.addLayer(B);$("#divZoom"+E).show()};SEAT.PGMappy.prototype.arrayPointsAdder=function(E,B,D){if(E==null){E=new Array()}if(B==null||B<=0){B=10}if(D==null||D<=0){D=10}var C=this;var F=[[{x:B/2,y:0},{x:-B/2,y:0}],[{x:B/2,y:0},{x:-B/2,y:0},{x:-B/2,y:D}],[{x:B/2,y:0},{x:-B/2,y:0},{x:-B/2,y:D},{x:B/2,y:D}],[{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:-B,y:D},{x:0,y:D}],[{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:-B,y:D},{x:0,y:D},{x:B,y:D}],[{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:-B,y:3*D/2}],[{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2}],[{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2}],[{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2}],[{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2}],[{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2}],[{x:-3*B/2,y:-D},{x:-B/2,y:-D},{x:B/2,y:-D},{x:3*B/2,y:-D},{x:-3*B/2,y:0},{x:-B/2,y:0},{x:B/2,y:0},{x:3*B/2,y:0},{x:-3*B/2,y:D},{x:-B/2,y:D},{x:B/2,y:D},{x:3*B/2,y:D},{x:-3*B/2,y:2*D}],[{x:-3*B/2,y:-D},{x:-B/2,y:-D},{x:B/2,y:-D},{x:3*B/2,y:-D},{x:-3*B/2,y:0},{x:-B/2,y:0},{x:B/2,y:0},{x:3*B/2,y:0},{x:-3*B/2,y:D},{x:-B/2,y:D},{x:B/2,y:D},{x:3*B/2,y:D},{x:-3*B/2,y:2*D},{x:-B/2,y:2*D}],[{x:-3*B/2,y:-D},{x:-B/2,y:-D},{x:B/2,y:-D},{x:3*B/2,y:-D},{x:-3*B/2,y:0},{x:-B/2,y:0},{x:B/2,y:0},{x:3*B/2,y:0},{x:-3*B/2,y:D},{x:-B/2,y:D},{x:B/2,y:D},{x:3*B/2,y:D},{x:-3*B/2,y:2*D},{x:-B/2,y:2*D},{x:B/2,y:2*D}],[{x:-3*B/2,y:-D},{x:-B/2,y:-D},{x:B/2,y:-D},{x:3*B/2,y:-D},{x:-3*B/2,y:0},{x:-B/2,y:0},{x:B/2,y:0},{x:3*B/2,y:0},{x:-3*B/2,y:D},{x:-B/2,y:D},{x:B/2,y:D},{x:3*B/2,y:D},{x:-3*B/2,y:2*D},{x:-B/2,y:2*D},{x:B/2,y:2*D},{x:3*B/2,y:2*D}],[{x:-2*B,y:-D},{x:-B,y:-D},{x:0,y:-D},{x:B,y:-D},{x:2*B,y:-D},{x:-2*B,y:0},{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:-2*B,y:D},{x:-B,y:D},{x:0,y:D},{x:B,y:D},{x:-2*B,y:2*D},{x:-B,y:2*D},{x:0,y:2*D},{x:B,y:2*D}],[{x:-2*B,y:-D},{x:-B,y:-D},{x:0,y:-D},{x:B,y:-D},{x:2*B,y:-D},{x:-2*B,y:0},{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:2*B,y:0},{x:-2*B,y:D},{x:-B,y:D},{x:0,y:D},{x:B,y:D},{x:-2*B,y:2*D},{x:-B,y:2*D},{x:0,y:2*D},{x:B,y:2*D}],[{x:-2*B,y:-D},{x:-B,y:-D},{x:0,y:-D},{x:B,y:-D},{x:2*B,y:-D},{x:-2*B,y:0},{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:2*B,y:0},{x:-2*B,y:D},{x:-B,y:D},{x:0,y:D},{x:B,y:D},{x:2*B,y:D},{x:-2*B,y:2*D},{x:-B,y:2*D},{x:0,y:2*D},{x:B,y:2*D}],[{x:-2*B,y:-D},{x:-B,y:-D},{x:0,y:-D},{x:B,y:-D},{x:2*B,y:-D},{x:-2*B,y:0},{x:-B,y:0},{x:0,y:0},{x:B,y:0},{x:2*B,y:0},{x:-2*B,y:D},{x:-B,y:D},{x:0,y:D},{x:B,y:D},{x:2*B,y:D},{x:-2*B,y:2*D},{x:-B,y:2*D},{x:0,y:2*D},{x:B,y:2*D},{x:2*B,y:2*D}],[{x:-2*B,y:-3*D/2},{x:-B,y:-3*D/2},{x:0,y:-3*D/2},{x:B,y:-3*D/2},{x:2*B,y:-3*D/2},{x:-2*B,y:-D/2},{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:2*B,y:-D/2},{x:-2*B,y:D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:2*B,y:D/2},{x:-2*B,y:3*D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2},{x:2*B,y:3*D/2},{x:-2*B,y:5*D/2}],[{x:-2*B,y:-3*D/2},{x:-B,y:-3*D/2},{x:0,y:-3*D/2},{x:B,y:-3*D/2},{x:2*B,y:-3*D/2},{x:-2*B,y:-D/2},{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:2*B,y:-D/2},{x:-2*B,y:D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:2*B,y:D/2},{x:-2*B,y:3*D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2},{x:2*B,y:3*D/2},{x:-2*B,y:5*D/2},{x:-B,y:5*D/2}],[{x:-2*B,y:-3*D/2},{x:-B,y:-3*D/2},{x:0,y:-3*D/2},{x:B,y:-3*D/2},{x:2*B,y:-3*D/2},{x:-2*B,y:-D/2},{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:2*B,y:-D/2},{x:-2*B,y:D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:2*B,y:D/2},{x:-2*B,y:3*D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2},{x:2*B,y:3*D/2},{x:-2*B,y:5*D/2},{x:-B,y:5*D/2},{x:0,y:5*D/2}],[{x:-2*B,y:-3*D/2},{x:-B,y:-3*D/2},{x:0,y:-3*D/2},{x:B,y:-3*D/2},{x:2*B,y:-3*D/2},{x:-2*B,y:-D/2},{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:2*B,y:-D/2},{x:-2*B,y:D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:2*B,y:D/2},{x:-2*B,y:3*D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2},{x:2*B,y:3*D/2},{x:-2*B,y:5*D/2},{x:-B,y:5*D/2},{x:0,y:5*D/2},{x:B,y:5*D/2}],[{x:-2*B,y:-3*D/2},{x:-B,y:-3*D/2},{x:0,y:-3*D/2},{x:B,y:-3*D/2},{x:2*B,y:-3*D/2},{x:-2*B,y:-D/2},{x:-B,y:-D/2},{x:0,y:-D/2},{x:B,y:-D/2},{x:2*B,y:-D/2},{x:-2*B,y:D/2},{x:-B,y:D/2},{x:0,y:D/2},{x:B,y:D/2},{x:2*B,y:D/2},{x:-2*B,y:3*D/2},{x:-B,y:3*D/2},{x:0,y:3*D/2},{x:B,y:3*D/2},{x:2*B,y:3*D/2},{x:-2*B,y:5*D/2},{x:-B,y:5*D/2},{x:0,y:5*D/2},{x:B,y:5*D/2},{x:2*B,y:5*D/2}],[{x:-5*B/2,y:-3*D/2},{x:-3*B/2,y:-3*D/2},{x:-B/2,y:-3*D/2},{x:B/2,y:-3*D/2},{x:3*B/2,y:-3*D/2},{x:5*B/2,y:-3*D/2},{x:-5*B/2,y:-D/2},{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:-5*B/2,y:D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:-5*B/2,y:3*D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2},{x:-5*B/2,y:5*D/2},{x:-3*B/2,y:5*D/2},{x:-B/2,y:5*D/2},{x:B/2,y:5*D/2},{x:3*B/2,y:5*D/2}],[{x:-5*B/2,y:-3*D/2},{x:-3*B/2,y:-3*D/2},{x:-B/2,y:-3*D/2},{x:B/2,y:-3*D/2},{x:3*B/2,y:-3*D/2},{x:5*B/2,y:-3*D/2},{x:-5*B/2,y:-D/2},{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:5*B/2,y:-D/2},{x:-5*B/2,y:D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:-5*B/2,y:3*D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2},{x:-5*B/2,y:5*D/2},{x:-3*B/2,y:5*D/2},{x:-B/2,y:5*D/2},{x:B/2,y:5*D/2},{x:3*B/2,y:5*D/2}],[{x:-5*B/2,y:-3*D/2},{x:-3*B/2,y:-3*D/2},{x:-B/2,y:-3*D/2},{x:B/2,y:-3*D/2},{x:3*B/2,y:-3*D/2},{x:5*B/2,y:-3*D/2},{x:-5*B/2,y:-D/2},{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:5*B/2,y:-D/2},{x:-5*B/2,y:D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:5*B/2,y:D/2},{x:-5*B/2,y:3*D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2},{x:-5*B/2,y:5*D/2},{x:-3*B/2,y:5*D/2},{x:-B/2,y:5*D/2},{x:B/2,y:5*D/2},{x:3*B/2,y:5*D/2}],[{x:-5*B/2,y:-3*D/2},{x:-3*B/2,y:-3*D/2},{x:-B/2,y:-3*D/2},{x:B/2,y:-3*D/2},{x:3*B/2,y:-3*D/2},{x:5*B/2,y:-3*D/2},{x:-5*B/2,y:-D/2},{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:5*B/2,y:-D/2},{x:-5*B/2,y:D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:5*B/2,y:D/2},{x:-5*B/2,y:3*D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2},{x:5*B/2,y:3*D/2},{x:-5*B/2,y:5*D/2},{x:-3*B/2,y:5*D/2},{x:-B/2,y:5*D/2},{x:B/2,y:5*D/2},{x:3*B/2,y:5*D/2}],[{x:-5*B/2,y:-3*D/2},{x:-3*B/2,y:-3*D/2},{x:-B/2,y:-3*D/2},{x:B/2,y:-3*D/2},{x:3*B/2,y:-3*D/2},{x:5*B/2,y:-3*D/2},{x:-5*B/2,y:-D/2},{x:-3*B/2,y:-D/2},{x:-B/2,y:-D/2},{x:B/2,y:-D/2},{x:3*B/2,y:-D/2},{x:5*B/2,y:-D/2},{x:-5*B/2,y:D/2},{x:-3*B/2,y:D/2},{x:-B/2,y:D/2},{x:B/2,y:D/2},{x:3*B/2,y:D/2},{x:5*B/2,y:D/2},{x:-5*B/2,y:3*D/2},{x:-3*B/2,y:3*D/2},{x:-B/2,y:3*D/2},{x:B/2,y:3*D/2},{x:3*B/2,y:3*D/2},{x:5*B/2,y:3*D/2},{x:-5*B/2,y:5*D/2},{x:-3*B/2,y:5*D/2},{x:-B/2,y:5*D/2},{x:B/2,y:5*D/2},{x:3*B/2,y:5*D/2},{x:5*B/2,y:5*D/2}]];var A=new Array();$.each(E,function(I,K){var H=false;for(var G=0;G<A.length;G++){if(K.lon==A[G].lon&&K.lat==A[G].lat){A[G].points.push(K);H=true;break}}if(!H){var J={lat:K.lat,lon:K.lon,points:[K]};A.push(J)}});$.each(A,function(I,K){if(K.points.length==1){C.pointAdder(K.points[0])}else{var L=K.points.length-1<=F.length?K.points.length-2:F.length-1;var J=F[L];for(var H=0;H<K.points.length;H++){var G=new PGPoint(K.points[H].j);G.lon=K.lon;G.lat=K.lat;if(H<J.length){G.offsetX=J[H].x;G.offsetY=J[H].y}else{G.offsetX=J[J.length-1].x;G.offsetY=J[J.length-1].y}C.pointAdder(G)}}})};SEAT.TC.Map=function(D,F,I,C,L,N,H,P,J,K){if(P){var G="tcol-cb"}else{var G="tcol"}var M=I;if(I==""&&J!=""){M=this.getZCent(J)}var B={nameContainer:"mapcontainer",mapWidth:C,mapHeight:L,lon:D,lat:F,z:M,imgType:PGMAP_IMG_TYPE_LIGHT,mapBackground:"#F0F2E8",sito:G};this.streetZoom=K;if(K==true){B.minMapLevel=PGMAP_ZOOM_PAVEMENT_INTRA_STREET}this.pgMap=new PGMappy(B);$("#mapcontainer_WWW").hide();$("#mapcontainer_logo").css({left:"",right:"0px",width:"222px",height:"19px"});$("#mapcontainer_logo div").css({"float":"right"});$("#mapcontainer_logo img").attr("src",SEAT.TC.IMG_PFX+"/PGvisual_watermark2.gif");$("#mapcontainer_logo img").height(18);$("#mapcontainer_logo img").width(80);$("#mapcontainer_logo div:eq(0)").css({padding:"0 15px 0 14px","border-left":"1px solid #666"});$("#mapcontainer_logo div:eq(1)").css({margin:"0pt 14px 0 10px","padding-top":"5px"});SEAT.TC.addZoomWidget(this.pgMap,"widgetContainer","",K);var A=new SEAT.wPgScale({div:"wPgScaleContainer"});A.zoom_array_desc=["50 mt","100 mt","200 mt","400 mt","0,75 km","1,5 km","3 km","6 km","12,5 km","25 km","100 km","250 km"];A.zoom_neg_array_desc=["25 mt","10 mt","5 mt"];this.pgMap.addLayer(A);$("#scala").show();var O=this;var E=this.getPoiArr(N);if(H){var R={useFumetto:false,usePopup:true,zoomLimit:4,maxNumPoi:70}}else{var R={useFumetto:false,usePopup:true,zoomLimit:4,maxNumPoi:50}}var Q=this.pgMap.addUtilitaCheckboxManager(E,R)};SEAT.TC.Map.prototype={zoomArray:[0.3,0.6,1.2,2.4,4.8,9.6,19.2,38.4,76.8,153.6,614.4,1228.8],zoomArrayCent:[0,1,2,3,4,5,6,7,8,9,10,11],poiArr:[{id:"prkP",type:"park",present:true},{id:"taxP",type:"taxi",present:true},{id:"bnzP",type:"benz",present:true},{id:"autP",type:"auto",present:true}],addPoints:function(C,A,B){this.pgMap.arrayPointsAdder(C,A,B)},getZCent:function(A){var B;for(i=0;i<this.zoomArray.length;i+=1){if(A==this.zoomArray[i]){B=this.zoomArrayCent[i];break}}return B},addMarker:function(A,F,D){if(A!=-1&&F!=-1){var B=SEAT.TC.IMG_PFX;var E="mrkId";var C;if(D&&D==true){B+="/mk_mirino_sm.png";C='<div style="width:26px;height:30px;" id="'+E+'" class="mrkCls">';C+='<img  src="'+B+'"/>';C+="</div>"}else{B+="/mk_mirino.png";C='<div style="width:37px;height:43px;" id="'+E+'" class="mrkCls">';C+='<img  src="'+B+'"/>';C+="</div>"}this.mrkPnt=new PGPoint({lon:A,lat:F,html:C});this.pgMap.pointAdder(this.mrkPnt);$("div.mrkCls").pngFix()}},addMarkerPrint:function(A,F){if(A!=-1&&F!=-1){var B=SEAT.TC.IMG_PFX+"/stampa/mk_mirino_sm.gif";var E="mrkId";var C='<div style="width:26px;height:30px;" id="'+E+'"><img src="'+B+'"/></div>';var D=new PGPoint({lon:A,lat:F,html:C});this.pgMap.pointAdder(D)}},getPoiParam:function(){var B="";var A=this;$(this.poiArr).each(function(C){if(this.present===true){if($("input#"+this.id+":checked").length==1){B+="1"}else{B+="0"}}});return B},getPoiArr:function(B){var A=[];$(this.poiArr).each(function(C){var E=(B.charAt(C)=="1")?true:false;if(this.present===true){var D=$.extend(this,{checked:E});A.push(D)}});return A},getCurrCoords:function(){var A=this.pgMap.map.getCenter();var B=this.pgMap.getZoom();return"z="+B.z+"&zd="+B.zDist+"&cx="+A.lon+"&cy="+A.lat+"&poi="+this.getPoiParam()},getMrkPopHtml:function(D,B,A,C){html='<div id="'+D+'"><p class="bg-tras-map"><span class="citta">'+A+"</span>";if(C&&C!=""){html+='<span class="via">'+C+"</span>"}html+='<span class="ciudi" id="'+B+'">chiudi</span></p><div>';return html}};SEAT.TC.MapCreator=function(B,C){var A=this;this.open=1;if(B){this.tcMap=B}this.mrkPopClosed=false;if(C){$.extend(this,C)}this.init();if(this.isHp){new SEAT.Indirizzi("saveInd","viewInd",this.dvCId,this.indCId,{offTop:2,offLeft:-80})}else{new SEAT.Indirizzi("saveInd","viewInd",this.dvCId,this.indCId,{offTop:2,offLeft:-72})}new SEAT.Searcher(this.btnCrtId,this.btnClId,this.dvCId,this.indCId,{callbackGeocodeOK:A.afterGeoCod,autocomplete:false,callbackRefererObj:A,divErrComune:A.divDvCId,divErrIndirizzo:A.divIndCId})};SEAT.TC.MapCreator.prototype={btnCrtId:"btnCreate",btnClId:"btnClear",btnPrtId:"btnPrt",btnPgLkId:"btnPgLk",btnTrf:"btnTrf",dvCId:"dvC",indCId:"indC",opCId:"opC",cFrmId:"createFrm",divDvCId:"divDvC",divIndCId:"divIndC",zRegione:"9",zProvincia:"7",zSoloCom:"3",zComInd:"1",revGeoPrtUrlId:"urlRevGeoPrt",menuFocused:false,init:function(){if(this.isHp==false){var B=this;if(this.isMapHp==false){$(".CreaMappa input, .TrovaSuMappa input").focus(function(){B.menuFocused=true})}else{$("#"+this.dvCId).focus()}$("a[id^="+this.btnPrtId+"]").bind("click",function(){B.openPrint();return false});$("#"+this.btnPgLkId).bind("click",function(){B.openPgLink();return false});$("#"+this.btnTrf).bind("click",function(){B.openTrf();return false});$("#cliccami").click(function(){B.aprichiudi(300)});$("#cliccami").show();$(window).bind("resize",function(){B.resize()});$(window).bind("load",function(){B.resize()});if(B.tcMap.mrkPnt){var A={dv:$("#"+B.dvCId).val(),ind:$("#"+B.indCId).val()};this.mrkPopup=new SEAT.TC.PointPopUp(B.tcMap.mrkPnt,this.tcMap,A,"divPop")}if(this.isMapHp==false){setTimeout(function(){if(B.menuFocused==false){B.aprichiudi(1000)}},3000)}}else{$("#"+this.dvCId).focus()}},afterGeoCod:function(G,I){var B=this;var L=G.comuneList[0];if(G){var A=$("#"+B.dvCId).val();var D=$("#"+B.indCId).val();var H="";var C="";var E="";if(G.ret=="8"){H="R";C=L.codReg;E=L.reg.toLowerCase()}else{if(G.ret=="9"){H="P";C=L.codProv;E=L.prov.toLowerCase()}else{H="C";C=L.codCom;E=L.com.toLowerCase();if(L.fraz){H="F";C=L.codFraz}}}var K=$("form#"+this.cFrmId).attr("action");var J=K.indexOf("?");var F=K.substring(0,J)+"/"+E+K.substring(J);var M=F+"&cx="+L.lon+"&cy="+L.lat+"&dv="+A+"&ind="+D+"&op="+$("input#"+B.opCId).val()+"&ldv="+A+"&lpr="+(L.prov||"")+"&lre="+L.reg+"&lcn="+(L.com||"")+"&ccd="+(L.codCom||"")+"&cre="+L.codReg+"&lty="+H+"&lcd="+C;if(G.ret=="5"){M+="&cerr=5"}if(G.ret=="8"){M+="&z="+this.zRegione}else{if(G.ret=="9"){M+="&z="+this.zProvincia}else{if(I){M+="&z="+this.zSoloCom}else{M+="&z="+this.zComInd}}}if(B.tcMap){M+="&poi="+B.tcMap.getPoiParam()}document.location.href=M}},openPrint:function(){var C="";var A=this.tcMap.pgMap.map.getCenter();if((SEAT.TC.cx==A.lon&&SEAT.TC.cy==A.lat)||this.searchActive==true){C=$("#"+this.btnPrtId).attr("href")}else{C=$("#"+this.revGeoPrtUrlId).val()}C+="&"+this.tcMap.getCurrCoords();var B=window.open(C,"tcMapPrint","resizable=no,scrollbars=yes,status=no, height=600, width=600");B.focus();return false},openPgLink:function(){var F=this.tcMap.getCurrCoords()+"&lx="+SEAT.TC.cx+"&ly="+SEAT.TC.cy;var D=$("#"+this.btnPgLkId).attr("href")+"&"+F;var E=this.tcMap.pgMap.getSize();var A=E.width;var C=E.height;var B=$("#urlIfrExtSite").val()+"&"+F;showPgLink(D,getHtmlIfrExtSite(A,C,B,$("#urlIfrCerca").val(),$("#urlIfrRtFrom").val(),$("#urlIfrRtTo").val()));$("#extHelpId").click(function(){var H=$(this).attr("href")+"&url="+encodeURIComponent(B);var G=window.open(H,"tcExtHelp");G.focus();return false});return false},openTrf:function(){return openTraffic(this.btnTrf,this.tcMap.pgMap)},aprichiudi:function(A){if(this.open==1){if(this.mrkPopup&&this.isSearch==false){this.mrkPopup.visualizePopup(A)}$(".mapFormContainer").animate({width:"0px"},A);$("#divZoom").animate({left:"0px"},A);$("#cliccami").animate({left:"9px"},A);$("#cliccami").css("background-image","url("+SEAT.TC.IMG_PFX+"/linguetta-apri.png)");this.open=0}else{if(this.mrkPopup){this.mrkPopup.clearPopup(A)}$(".CreaMappa").css("border-right-width","10px");$(".mapFormContainer").animate({width:"320px"},A);$("#divZoom").animate({left:"320px"},A);$("#cliccami").animate({left:"327px"},A);$("#cliccami").css("background-image","url("+SEAT.TC.IMG_PFX+"/linguetta-chiudi.png)");this.open=1}},resize:function(){var A=$(".boxDxMappe").innerWidth();var B=Math.round(A*0.42);this.tcMap.pgMap.setSize(A,B)}};SEAT.TC.MapSearcher=function(A){this.tcMap=A;this.init();this.searchActive=false};SEAT.TC.MapSearcher.prototype={btnSrcId:"btnSearch",btnSrcGDOId:"btnSearchG",btnGDO:"btnGDO",sFrmId:"searchFrm",sgFrmId:"searchGFrm",qsSId:"qsS",opSId:"opS",gdoSId:"gdoS",gdoDivId:"divGDO",gdoLiId:"liGDO",revGeoUrlId:"urlRevGeo",idDivErrore:"TrovaSuMappa",init:function(){var A=this;$("#"+this.btnSrcId).bind("click",function(){A.search()});$("#"+this.btnSrcGDOId).bind("click",function(){A.searchGDO()});$("#"+this.btnExpId).bind("click",function(){A.openBig();return false});$("#"+this.btnGDO).bind("click",function(){A.openGDO();return false});$("#"+this.qsSId).bind("keydown",function B(C){if(C.keyCode==13){C.preventDefault();A.search()}});$("a[id^="+this.gdoSId+"]").each(function(C){var D=$(this);D.bind("click",function(E){E.preventDefault();$(".showin").removeClass("showin");D.addClass("showin");$("#"+A.gdoDivId).slideUp();A.searchGDO()})})},setSearchActive:function(A){this.searchActive=A},search:function(){var A=$("#"+this.qsSId).val();if(A==""){buildErrorMessage("Inserire stringa di ricerca.",this.idDivErrore)}else{location.href=this.getSearchUrl(false)+"&qs="+encodeURIComponent(A)}},searchGDO:function(){$("#"+this.qsSId).val("");var A="";$("a[id^="+this.gdoSId+"]").each(function(B){if($(this).hasClass("showin")){var C=this.id;var D=C.substring(C.lastIndexOf("_")+1,C.length);A+=D}});if(A==""){buildErrorMessage("Scegliere almeno un  cliente.",this.idDivErrore)}else{location.href=this.getSearchUrl(true)+"&vcc="+A}},getSearchUrl:function(B){var A=this.tcMap.pgMap.map.getCenter();var C="";if(SEAT.TC.cx==A.lon&&SEAT.TC.cy==A.lat){if(B==false){C=$("form#"+this.sFrmId).attr("action")}else{C=$("form#"+this.sFrmId).attr("action")}}else{if(B==false){C=$("#"+this.revGeoUrlId).val()}else{C=$("#"+this.revGeoUrlId).val()}}C+="&"+this.tcMap.getCurrCoords();return C},openGDO:function(){var A=$("#"+this.gdoDivId);if(A.is(":visible")){A.slideUp();$("#"+this.gdoLiId).removeClass("aperti")}else{A.slideDown();$("#"+this.gdoLiId).addClass("aperti")}}};SEAT.TC.MapListing=function(A,B,C){this.tcMap=A;this.iq=B;this.tcStat=new SEAT.TC.Stat();this.printable=C};SEAT.TC.MapListing.prototype={addPoints:function(I){this.insListObj=I;var B=this.tcMap;var O=new Array();var P=new Array();var J=new Array();var K=this.printable;var N=10;var H=10;for(var E=this.insListObj.insList.length-1;E>=0;E--){var D=I.insList[E];var G="";var F=0;var L=250;var A="pntL"+E+"Id";if(D.tp=="4"){var C=SEAT.TC.IMG_PFX+"/gdo/"+D.tpl+"_0"+D.i+".png";G='<div style="width:52px;height:38px;" id="'+A+'" class="pntLCls">';G+='<img width="52" height="38" src="'+C+'"/>';G+="</div>";F=10}else{var C=SEAT.TC.IMG_PFX+"/";if(K==true){C+="stampa/"+D.tpl+"00"+D.i+".gif"}else{C+=D.tpl+"0"+D.i+".png"}G='<div style="width:25px;height:30px;" id="'+A+'" class="pntLCls">';G+='<img src="'+C+'"/>';G+="</div>";if(D.tpl=="r"){L=270}}var M=new PGPoint({lon:D.x,lat:D.y,title:D.rgs+" "+D.te,html:G,zIndex:L});if(F!==0){M.offsetX=F}O.push(M);P.push(C);J.push(A)}B.addPoints(O,N,H);$("div.pntLCls").pngFix()},clickIns:function(E,H,D,B){var F=this.insListObj.insList[H-1];this.tcStat.writeNavig(this.iq,E,F.cc,F.tp,B);switch(E){case this.tcStat.STAT_EMAIL:location.href=D;break;case this.tcStat.STAT_WWW:if(D.substring(0,4)!="http"){D="http://"+D}window.open(D);break;case this.tcStat.STAT_LINKPG:window.open(D);break;case this.tcStat.STAT_VIDEO:window.open(D);break;case this.tcStat.STAT_PARTI:location.href=D;break;case this.tcStat.STAT_ARRIVA:location.href=D;break;case this.tcStat.STAT_STAMPA:var G=D+"&"+this.getInsParams(F)+"&pos="+H+"&tpl="+F.tpl;var A=window.open(G,"stampa_ins","resizable=no,scrollbars=yes,status=no, height=600, width=600");A.focus();break;case this.tcStat.STAT_INVIAA:var C=D+"&tp=1&"+this.getInsParams(F);var A=window.open(C,"segnala_amico","width=360,height=385");A.focus();break}},getInsParams:function(A,B){return"cat="+escape(A.ca)+"&cx="+A.x+"&cy="+A.y+"&rgs="+escape(A.rgs)+"&ind="+escape(A.ad+" "+A.lo)+"&tel="+escape(A.te)+"&fax="+escape(A.fa)+"&www="+escape(A.www)+"&mail="+escape(A.em)}};SEAT.Indirizzi=function(A,C,E,B,D){this.idSalva=A;this.idVedi=C;this.idCom=E;this.idInd=B;if(D){$.extend(this,D)}this.init()};SEAT.Indirizzi.prototype={indObjArray:new Array(),nomeCookie:"indirizzi",separatoreEntry:"|",separatoreIndirizzo:"#",expireDays:1000,cookiePath:"/",popupWidth:300,opening:"left",maxNumInd:0,fixIeBug:true,idDivCont:"",offTop:0,offLeft:0,init:function(){var A=this;$("#"+this.idSalva).bind("click",function(G){G.preventDefault();var D=$("#"+A.idCom);var F=$("#"+A.idInd);var B=D.val();var E=F.val();B=$.trim(B);E=$.trim(E);var C="";if(B&&B!=""){A.inserisciNuovoIndirizzo(B,E,C)}else{}A.vediIndirizzi()});$("#"+this.idVedi).bind("click",function(B){B.preventDefault();A.vediIndirizzi()})},inserisciNuovoIndirizzo:function(B,C,H){B=$.trim(B);C=$.trim(C);if($.browser.safari){C=C.replace(/,/g,"%")}var A=Cookie.readCookie(this.nomeCookie);if(A!=""){var J=false;var L=A.tokenize(this.separatoreEntry," ",true);for(var D=0;D<L.length;D++){var E=L[D].tokenize(this.separatoreIndirizzo," ",false);var K=E[0]?E[0]:"";var G=E[1]?E[1]:"";if(K.toLowerCase()==B.toLowerCase()&&G.toLowerCase()==C.toLowerCase()){J=true;break}}if(!J){if(this.maxNumInd>0){if(L.length==this.maxNumInd){var F="";L[0]="";for(var D=0;D<L.length;D++){var I=L[D];if(I!=""){F+=this.separatoreEntry+I}}if(F!=""){F=F.substring(1)}A=F}}A+=this.separatoreEntry+B+this.separatoreIndirizzo+C+this.separatoreIndirizzo+H}}else{A+=B+this.separatoreIndirizzo+C+this.separatoreIndirizzo+H}Cookie.setCookie(this.nomeCookie,A,this.expireDays,this.cookiePath,null,null)},eliminaIndirizzo:function(D){if(D<this.indObjArray.length){this.indObjArray[D]="";var C="";for(var A=0;A<this.indObjArray.length;A++){var B=this.indObjArray[A];if(B!=""){C+=this.separatoreEntry+B.com+this.separatoreIndirizzo+B.ind+this.separatoreIndirizzo+B.label}}if(C!=""){C=C.substring(1);Cookie.setCookie(this.nomeCookie,C,this.expireDays,this.cookiePath,null,null)}else{Cookie.eraseCookie(this.nomeCookie,this.cookiePath)}}},vediIndirizzi:function(){var E=Cookie.readCookie(this.nomeCookie);var H=E.tokenize(this.separatoreEntry," ",true);this.indObjArray.splice(0,this.indObjArray.length);for(var D=0;D<H.length;D++){var B=H[D].tokenize(this.separatoreIndirizzo," ",false);var A=B[0]?B[0]:"";var G=B[1]?B[1]:"";var C=B[2]?B[2]:"";var F={com:A,ind:G,label:C};this.indObjArray.push(F)}this.costruisciListaIndirizzi()},posizionaLista:function(){var B=$("#"+this.idSalva).offset().top+$("#"+this.idSalva).outerHeight({})+this.offTop;if(this.opening=="right"){var A=$("#"+this.idSalva).offset().left+$("#"+this.idSalva).outerWidth({})-this.popupWidth+this.offLeft}else{var A=$("#"+this.idSalva).offset().left+this.offLeft}$("#contMieiInd").css({position:"absolute",top:""+B+"px",left:""+A+"px",display:"block"})},costruisciListaIndirizzi:function(){var E=this;var A=$("#contMieiInd");if(A.length>0){A.remove()}$(document.body).append('<div id="contMieiInd" class="mindirizzi"></div>');var B='<h4>I MIEI INDIRIZZI: </h4><a id="chiudiMieiInd" class="chiudi" href="javascript:void(0)" title="chiudi"><span class="chiusura">chiudi</span></a><a id="salvaMieiInd" href="javascript:void(0)" title="salva">salva</a><table id="mieiIndTable" width="500" cellspacing="0" cellpadding="0" border="0"></table>';$("#contMieiInd").html(B);if(this.indObjArray.length>0){for(var C=0;C<this.indObjArray.length;C++){var D="";if(this.indObjArray[C].label&&this.indObjArray[C].label!=""){D='<tr><td width="100"><input class="labelSalvaInd bord" type="text" value="'+this.indObjArray[C].label+'"/></td>'}else{D='<tr><td width="100"><input class="labelSalvaInd" type="text" value=""/></td>'}var F=this.indObjArray[C].ind;if(F&&F!=""){if($.browser.safari){F=F.replace(/%/g,",")}D+='<td class="mio_indirizzo"><span class="mio_indirizzo_loc">'+this.indObjArray[C].com+'</span> - <span class="mio_indirizzo_ind">'+F+"</td></span>"}else{D+='<td class="mio_indirizzo">'+this.indObjArray[C].com+"</td>"}D+='<td width="20"><span class="elimina">elimina</span></td></tr>';$("#mieiIndTable").append(D)}}else{$("#mieiIndTable").append("<tr><td>Nessun indirizzo salvato.</td></tr>")}$(".mio_indirizzo").each(function(G){$(this).bind("click",function(H){$("#"+E.idCom).val(E.indObjArray[G].com);if(E.indObjArray[G].ind!=""){var I=E.indObjArray[G].ind;if($.browser.safari){I=I.replace(/%/g,",")}$("#"+E.idInd).val(I)}else{$("#"+E.idInd).val("")}E.chiudiLista()}).hover(function(H){$("#mieiIndTable .mio_indirizzo").removeClass("mio_indirizzo_over");$(this).addClass("mio_indirizzo_over")},function(H){$(this).removeClass("mio_indirizzo_over")})});$("#mieiIndTable .elimina").each(function(G){$(this).bind("click",function(H){E.eliminaIndirizzo(G);E.vediIndirizzi()})});$("#salvaMieiInd").click(function(G){E.salvaIndirizzi();E.chiudiLista()});$("#chiudiMieiInd").click(function(G){E.chiudiLista()});$("div.mindirizzi input").click(function(){$(this).addClass("bord")}).blur(function(){if($(this).val()==""){$(this).removeClass("bord")}});$("#link-mind").click(function(){$(this).addClass("bord")}).blur(function(){if($(this).val()==""){$(this).removeClass("bord")}});this.posizionaLista();this.visualizzaLista()},salvaIndirizzi:function(){var A=this;var B="";$(".labelSalvaInd").each(function(D){var C=$(this).val();B+=A.separatoreEntry+A.indObjArray[D].com+A.separatoreIndirizzo+A.indObjArray[D].ind+A.separatoreIndirizzo+C});if(B!=""){B=B.substring(1);Cookie.setCookie(this.nomeCookie,B,this.expireDays,this.cookiePath,null,null)}},cancellaIndirizzi:function(){Cookie.eraseCookie(this.nomeCookie,this.cookiePath)},visualizzaLista:function(){var A=$("#contMieiInd");A.show();if(this.fixIeBug){fixIeComboBug(A)}this.opened=true},chiudiLista:function(){$("#contMieiInd").hide().remove();this.opened=false}};SEAT.TC.fullScreenMapBuilder=function(D,G){this.tcMap=G;var E="";if(D=="map"){E=this.buildMapLink()}else{E=this.buildRouteLink()}var C=window.screen.availHeight;var A=window.screen.availWidth;var B="width="+A+",height="+C+",top=0,left=0,menubar=1,location=0";var F=window.open(E,"Nome",B);F.focus();F.ref=window};SEAT.TC.fullScreenMapBuilder.prototype={buildMapLink:function(){var C=$("#urlMapExpand").val();var F=this.tcMap.pgMap.map.getCenter();var E=this.tcMap.pgMap.getZoom();if($.browser.msie){var A=window.screen.availHeight-123}else{var A=window.screen.availHeight-170}var B=window.screen.availWidth-25;var D=this.tcMap.getPoiParam();C+="&cx="+F.lon+"&cy="+F.lat+"&z="+E.z+"&px="+B+"&py="+A+"&poi="+D+"&sz="+this.tcMap.streetZoom;return C},buildRouteLink:function(){var C=$("#urlMapExpand").val();var E=this.tcMap.pgMap.getZoom().z;var F=this.tcMap.pgMap.map.getCenter();var A=window.screen.availHeight-150;var B=window.screen.availWidth-25;var D=this.tcMap.getPoiParam();C+="&px="+B+"&py="+A+"&z="+E;C+="&cx="+F.lon+"&cy="+F.lat;if(typeof (p1)!="undefined"){C+="&p1x="+p1.lon+"&p1y="+p1.lat+"&p2x="+p2.lon+"&p2y="+p2.lat+"&poi="+D+"&tp="+SEAT.TC.tp}return C}};(function(A){jQuery.fn.pngFix=function(D){D=jQuery.extend({blankgif:"blank.gif"},D);var C=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var B=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(jQuery.browser.msie&&(C||B)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr("width",jQuery(this).width());jQuery(this).attr("height",jQuery(this).height());var L="";var G="";var F=(jQuery(this).attr("id"))?'id="'+jQuery(this).attr("id")+'" ':"";var M=(jQuery(this).attr("class"))?'class="'+jQuery(this).attr("class")+'" ':"";var I=(jQuery(this).attr("title"))?'title="'+jQuery(this).attr("title")+'" ':"";var J=(jQuery(this).attr("alt"))?'alt="'+jQuery(this).attr("alt")+'" ':"";var H=(jQuery(this).attr("align"))?"float:"+jQuery(this).attr("align")+";":"";var E=(jQuery(this).parent().attr("href"))?"cursor:hand;":"";if(this.style.border){L+="border:"+this.style.border+";";this.style.border=""}if(this.style.padding){L+="padding:"+this.style.padding+";";this.style.padding=""}if(this.style.margin){L+="margin:"+this.style.margin+";";this.style.margin=""}var K=(this.style.cssText);G+="<span "+F+M+I+J;G+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+H+E;G+="width:"+jQuery(this).width()+"px;height:"+jQuery(this).height()+"px;";G+="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+jQuery(this).attr("src")+"', sizingMethod='crop');";G+=K+'"></span>';if(L!=""){G='<span style="position:relative;display:inline-block;'+L+E+"width:"+jQuery(this).width()+"px;height:"+jQuery(this).height()+'px;">'+G+"</span>"}jQuery(this).hide();jQuery(this).after(G)});jQuery(this).find("*").each(function(){var F=jQuery(this).css("background-image");if(F.indexOf(".png")!=-1){var E=F.split('url("')[1].split('")')[0];jQuery(this).css("background-image","none");jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"',sizingMethod='crop')"}});jQuery(this).find("input[src$=.png]").each(function(){var E=jQuery(this).attr("src");jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"', sizingMethod='crop');";jQuery(this).attr("src",D.blankgif)})}return jQuery}})(jQuery);SEAT.TC.PointPopUp=function(C,E,B,A,D){this.pgPoint=C;this.tcMap=E;this.pgMappy=E.pgMap;this.divId=A;this.closeId=A+"Close";this.closed=false;this.visible=false;this.proxPopup=D;this.init(B);this.toLeft=false;this.toDown=false};SEAT.TC.PointPopUp.prototype={iconHeight:30,iconWidth:26,init:function(A){var C=this;this.pointObj=A;this.mapMoving=false;this.mouseMoveBeforeListener=PGEvent.addListener(this.pgMappy,"mousemovebefore",function(){C.mapMoving=true;C.clearPopup()});this.mouseMoveUpAfterListener=PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(){if(C.mapMoving==true){C.visualizePopup();C.mapMoving=false}});this.zoomAfterMapListener=PGEvent.addListener(this.pgMappy,"zoomaftermap",function(){if(C.visible==true){C.clearPopup();C.visualizePopup()}});if(!$("#"+this.divId).size()>0){var B=this.tcMap.getMrkPopHtml(this.divId,this.closeId,this.pointObj.dv,this.pointObj.ind);$("#"+this.pgMappy.pgLineList.viewMap.opts.nameContainer).append(B);$("#"+this.divId).css({display:"none",position:"absolute","z-index":"999"}).css({cursor:"auto"})}this.evBigMouseUp=function(D){return false};this.evBigMouseDown=function(D){return false};$("#"+this.divId).bind("mousedown",this.evBigMouseDown);$("#"+this.divId).bind("mouseup",this.evBigMouseUp);this.clickPointListener=PGEvent.addListener(this.pgPoint,"click",function(){if(C.visible==false){C.closed=false;C.clearPopup();C.visualizePopup()}})},getLeft:function(B,A){this.toLeft=A;if(A==true){if(this.toDown==true){return B-$("#"+this.divId).width()-14}else{return B-$("#"+this.divId).width()-4}}else{return B+5}},getTop:function(A,B){this.toDown=B;if(B==true){return A-7}else{return A-$("#"+this.divId).height()-this.iconHeight}},movePopup:function(D,A){var C=this.pgMappy.getPixelFromLonLat(this.pgPoint.lon,this.pgPoint.lat);var B={};B.top=this.getTop(C.y,D);B.left=this.getLeft(C.x,A);this.openPopup(B,0)},visualizePopup:function(A){if(this.closed==false){var B=this.pgMappy.getPixelFromLonLat(this.pgPoint.lon,this.pgPoint.lat);var P={};if(B.y<$("#"+this.divId).height()+this.iconHeight){P.top=this.getTop(B.y,true)}else{P.top=this.getTop(B.y,false)}if(this.pgMappy.getSize().width-B.x>$("#"+this.divId).width()+this.iconWidth){P.left=this.getLeft(B.x,false)}else{P.left=this.getLeft(B.x,true)}if(this.proxPopup!=undefined&&this.proxPopup.objCSS!=undefined){var L=this.proxPopup;var O=L.objCSS.left;var K=L.objCSS.top;var F=$("#"+L.divId).width();var I=$("#"+L.divId).height();var J=P.top;var N=P.left;var E=$("#"+this.divId).width();var G=$("#"+this.divId).height();var C=Number(K)+Number(I);var H=Number(O)+Number(F);var D=Number(J)+Number(G);var M=Number(N)+Number(E);if((K<J&&J<C)&&(O<N&&N<H)){L.movePopup(true,true)}if((J<K&&K<D)&&(N<O&&O<M)){P.left=this.getLeft(B.x,true)}if((J<K&&K<D)&&(O<N&&N<H)){L.movePopup(true,true)}if((K<J&&J<C)&&(N<O&&O<M)){P.top=this.getTop(B.y,true);P.left=this.getLeft(B.x,true)}}this.openPopup(P,A)}},openPopup:function(C,B){this.objCSS=C;$("#"+this.divId).css(C);var A=this;if(B){setTimeout(function(){$("#"+A.divId).fadeIn()},B)}else{$("#"+this.divId).fadeIn()}this.closed=false;this.visible=true;$("#"+this.closeId).bind("click",function(){A.clearPopup();A.closed=true;return false}).css({cursor:"pointer"});this.pgPoint.dPoint.css({cursor:""})},clearPopup:function(B){var A=this;if(B){setTimeout(function(){$("#"+A.divId).hide()},B)}else{$("#"+this.divId).hide()}this.visible=false;$("#"+this.closeId).unbind("click");this.pgPoint.dPoint.css({cursor:"pointer"})},clear:function(){this.clearPopup();PGEvent.removeListener(this.mouseMoveBeforeListener);PGEvent.removeListener(this.clickPointListener);PGEvent.removeListener(this.mouseMoveUpAfterListener);PGEvent.removeListener(this.zoomAfterMapListener)}};
