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";SEAT.TC.GEO_SERVER="http://geo.paginegialle.it:80";SEAT.TC.MAPSAPI_SERVER="http://api.visual.paginegialle.it/tcolnew";SEAT.TC.RinascenteDisabled="1";(function(){var W=this,AB,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(B,A){return new T.fn.init(B,A)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,AC=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(a,B){a=a||document;if(a.nodeType){this[0]=a;this.length=1;this.context=a;return this}if(typeof a==="string"){var C=M.exec(a);if(C&&(C[1]||!B)){if(C[1]){a=T.clean([C[1]],B)}else{var A=document.getElementById(C[3]);if(A&&A.id!=C[3]){return T().find(a)}var D=T(A||[]);D.context=document;D.selector=a;return D}}else{return T(B).find(a)}}else{if(T.isFunction(a)){return T(document).ready(a)}}if(a.selector&&a.context){this.selector=a.selector;this.context=a.context}return this.setArray(T.isArray(a)?a:T.makeArray(a))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(A){return A===AB?Array.prototype.slice.call(this):this[A]},pushStack:function(C,A,D){var B=T(C);B.prevObject=this;B.context=this.context;if(A==="find"){B.selector=this.selector+(this.selector?" ":"")+D}else{if(A){B.selector=this.selector+"."+A+"("+D+")"}}return B},setArray:function(A){this.length=0;Array.prototype.push.apply(this,A);return this},each:function(A,B){return T.each(this,A,B)},index:function(A){return T.inArray(A&&A.jquery?A[0]:A,this)},attr:function(C,A,B){var D=C;if(typeof C==="string"){if(A===AB){return this[0]&&T[B||"attr"](this[0],C)}else{D={};D[C]=A}}return this.each(function(a){for(C in D){T.attr(B?this.style:this,C,T.prop(this,D[C],B,a,C))}})},css:function(B,A){if((B=="width"||B=="height")&&parseFloat(A)<0){A=AB}return this.attr(B,A,"curCSS")},text:function(A){if(typeof A!=="object"&&A!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(A))}var B="";T.each(A||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){B+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return B},wrapAll:function(B){if(this[0]){var A=T(B,this[0].ownerDocument).clone();if(this[0].parentNode){A.insertBefore(this[0])}A.map(function(){var C=this;while(C.firstChild){C=C.firstChild}return C}).append(this)}return this},wrapInner:function(A){return this.each(function(){T(this).contents().wrapAll(A)})},wrap:function(A){return this.each(function(){T(this).wrapAll(A)})},append:function(){return this.domManip(arguments,true,function(A){if(this.nodeType==1){this.appendChild(A)}})},prepend:function(){return this.domManip(arguments,true,function(A){if(this.nodeType==1){this.insertBefore(A,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(A){this.parentNode.insertBefore(A,this)})},after:function(){return this.domManip(arguments,false,function(A){this.parentNode.insertBefore(A,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(B){if(this.length===1){var A=this.pushStack([],"find",B);A.length=0;T.find(B,this[0],A);return A}else{return this.pushStack(T.unique(T.map(this,function(C){return T.find(B,C)})),"find",B)}},clone:function(B){var D=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var b=this.outerHTML;if(!b){var a=this.ownerDocument.createElement("div");a.appendChild(this.cloneNode(true));b=a.innerHTML}return T.clean([b.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(B===true){var A=this.find("*").andSelf(),C=0;D.find("*").andSelf().each(function(){if(this.nodeName!==A[C].nodeName){return }var c=T.data(A[C],"events");for(var a in c){for(var b in c[a]){T.event.add(this,a,c[a][b],c[a][b].data)}}C++})}return D},filter:function(A){return this.pushStack(T.isFunction(A)&&T.grep(this,function(B,C){return A.call(B,C)})||T.multiFilter(A,T.grep(this,function(B){return B.nodeType===1})),"filter",A)},closest:function(C){var A=T.expr.match.POS.test(C)?T(C):null,B=0;return this.map(function(){var D=this;while(D&&D.ownerDocument){if(A?A.index(D)>-1:T(D).is(C)){T.data(D,"closest",B);return D}D=D.parentNode;B++}})},not:function(B){if(typeof B==="string"){if(AC.test(B)){return this.pushStack(T.multiFilter(B,this,true),"not",B)}else{B=T.multiFilter(B,this)}}var A=B.length&&B[B.length-1]!==AB&&!B.nodeType;return this.filter(function(){return A?T.inArray(this,B)<0:this!=B})},add:function(A){return this.pushStack(T.unique(T.merge(this.get(),typeof A==="string"?T(A):T.makeArray(A))))},is:function(A){return !!A&&T.multiFilter(A,this).length>0},hasClass:function(A){return !!A&&this.is("."+A)},val:function(C){if(C===AB){var e=this[0];if(e){if(T.nodeName(e,"option")){return(e.attributes.value||{}).specified?e.value:e.text}if(T.nodeName(e,"select")){var a=e.selectedIndex,B=[],A=e.options,b=e.type=="select-one";if(a<0){return null}for(var d=b?a:0,D=b?a+1:A.length;d<D;d++){var c=A[d];if(c.selected){C=T(c).val();if(b){return C}B.push(C)}}return B}return(e.value||"").replace(/\r/g,"")}return AB}if(typeof C==="number"){C+=""}return this.each(function(){if(this.nodeType!=1){return }if(T.isArray(C)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,C)>=0||T.inArray(this.name,C)>=0)}else{if(T.nodeName(this,"select")){var f=T.makeArray(C);T("option",this).each(function(){this.selected=(T.inArray(this.value,f)>=0||T.inArray(this.text,f)>=0)});if(!f.length){this.selectedIndex=-1}}else{this.value=C}}})},html:function(A){return A===AB?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(A)},replaceWith:function(A){return this.after(A).remove()},eq:function(A){return this.slice(A,+A+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(A){return this.pushStack(T.map(this,function(B,C){return A.call(B,C,B)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(D,A,B){if(this[0]){var a=(this[0].ownerDocument||this[0]).createDocumentFragment(),d=T.clean(D,(this[0].ownerDocument||this[0]),a),b=a.firstChild;if(b){for(var c=0,e=this.length;c<e;c++){B.call(C(this[c],b),this.length>1||c>0?a.cloneNode(true):a)}}if(d){T.each(d,E)}}return this;function C(g,f){return A&&T.nodeName(g,"table")&&T.nodeName(f,"tr")?(g.getElementsByTagName("tbody")[0]||g.appendChild(g.ownerDocument.createElement("tbody"))):g}}};T.fn.init.prototype=T.fn;function E(B,A){if(A.src){T.ajax({url:A.src,async:false,dataType:"script"})}else{T.globalEval(A.text||A.textContent||A.innerHTML||"")}if(A.parentNode){A.parentNode.removeChild(A)}}function AD(){return +new Date}T.extend=T.fn.extend=function(){var C=arguments[0]||{},a=1,D=arguments.length,d=false,b;if(typeof C==="boolean"){d=C;C=arguments[1]||{};a=2}if(typeof C!=="object"&&!T.isFunction(C)){C={}}if(D==a){C=this;--a}for(;a<D;a++){if((b=arguments[a])!=null){for(var c in b){var B=C[c],A=b[c];if(C===A){continue}if(d&&A&&typeof A==="object"&&!A.nodeType){C[c]=T.extend(d,B||(A.length!=null?[]:{}),A)}else{if(A!==AB){C[c]=A}}}}}return C};var AG=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(A){W.$=S;if(A){W.jQuery=F}return T},isFunction:function(A){return L.call(A)==="[object Function]"},isArray:function(A){return L.call(A)==="[object Array]"},isXMLDoc:function(A){return A.nodeType===9&&A.documentElement.nodeName!=="HTML"||!!A.ownerDocument&&T.isXMLDoc(A.ownerDocument)},globalEval:function(A){if(A&&/\S/.test(A)){var B=document.getElementsByTagName("head")[0]||document.documentElement,C=document.createElement("script");C.type="text/javascript";if(T.support.scriptEval){C.appendChild(document.createTextNode(A))}else{C.text=A}B.insertBefore(C,B.firstChild);B.removeChild(C)}},nodeName:function(A,B){return A.nodeName&&A.nodeName.toUpperCase()==B.toUpperCase()},each:function(a,A,b){var c,D=0,C=a.length;if(b){if(C===AB){for(c in a){if(A.apply(a[c],b)===false){break}}}else{for(;D<C;){if(A.apply(a[D++],b)===false){break}}}}else{if(C===AB){for(c in a){if(A.call(a[c],c,a[c])===false){break}}}else{for(var B=a[0];D<C&&A.call(B,D,B)!==false;B=a[++D]){}}}return a},prop:function(B,A,C,D,a){if(T.isFunction(A)){A=A.call(B,D)}return typeof A==="number"&&C=="curCSS"&&!AG.test(a)?A+"px":A},className:{add:function(B,A){T.each((A||"").split(/\s+/),function(D,C){if(B.nodeType==1&&!T.className.has(B.className,C)){B.className+=(B.className?" ":"")+C}})},remove:function(B,A){if(B.nodeType==1){B.className=A!==AB?T.grep(B.className.split(/\s+/),function(C){return !T.className.has(A,C)}).join(" "):""}},has:function(A,B){return A&&T.inArray(B,(A.className||A).toString().split(/\s+/))>-1}},swap:function(B,C,A){var a={};for(var D in C){a[D]=B.style[D];B.style[D]=C[D]}A.call(B);for(var D in C){B.style[D]=a[D]}},css:function(a,c,C,d){if(c=="width"||c=="height"){var A,b={position:"absolute",visibility:"hidden",display:"block"},B=c=="width"?["Left","Right"]:["Top","Bottom"];function D(){A=c=="width"?a.offsetWidth:a.offsetHeight;if(d==="border"){return }T.each(B,function(){if(!d){A-=parseFloat(T.curCSS(a,"padding"+this,true))||0}if(d==="margin"){A+=parseFloat(T.curCSS(a,"margin"+this,true))||0}else{A-=parseFloat(T.curCSS(a,"border"+this+"Width",true))||0}})}if(a.offsetWidth!==0){D()}else{T.swap(a,b,D)}return Math.max(0,Math.round(A))}return T.curCSS(a,c,C)},curCSS:function(a,d,c){var B,e=a.style;if(d=="opacity"&&!T.support.opacity){B=T.attr(e,"opacity");return B==""?"1":B}if(d.match(/float/i)){d=H}if(!c&&e&&e[d]){B=e[d]}else{if(Q.getComputedStyle){if(d.match(/float/i)){d="float"}d=d.replace(/([A-Z])/g,"-$1").toLowerCase();var A=Q.getComputedStyle(a,null);if(A){B=A.getPropertyValue(d)}if(d=="opacity"&&B==""){B="1"}}else{if(a.currentStyle){var D=d.replace(/\-(\w)/g,function(g,f){return f.toUpperCase()});B=a.currentStyle[d]||a.currentStyle[D];if(!/^\d+(px)?$/i.test(B)&&/^\d/.test(B)){var b=e.left,C=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=B||0;B=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=C}}}}return B},clean:function(c,B,D){B=B||document;if(typeof B.createElement==="undefined"){B=B.ownerDocument||B[0]&&B[0].ownerDocument||document}if(!D&&c.length===1&&typeof c[0]==="string"){var a=/^<(\w+)\s*\/?>$/.exec(c[0]);if(a){return[B.createElement(a[1])]}}var b=[],d=[],A=B.createElement("div");T.each(c,function(h,e){if(typeof e==="number"){e+=""}if(!e){return }if(typeof e==="string"){e=e.replace(/(<(\w+)[^>]*?)\/>/g,function(m,l,n){return n.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?m:l+"></"+n+">"});var i=e.replace(/^\s+/,"").substring(0,10).toLowerCase();var g=!i.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!i.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||i.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!i.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];A.innerHTML=g[1]+e+g[2];while(g[0]--){A=A.lastChild}if(!T.support.tbody){var f=/<tbody/i.test(e),j=!i.indexOf("<table")&&!f?A.firstChild&&A.firstChild.childNodes:g[1]=="<table>"&&!f?A.childNodes:[];for(var k=j.length-1;k>=0;--k){if(T.nodeName(j[k],"tbody")&&!j[k].childNodes.length){j[k].parentNode.removeChild(j[k])}}}if(!T.support.leadingWhitespace&&/^\s/.test(e)){A.insertBefore(B.createTextNode(e.match(/^\s*/)[0]),A.firstChild)}e=T.makeArray(A.childNodes)}if(e.nodeType){b.push(e)}else{b=T.merge(b,e)}});if(D){for(var C=0;b[C];C++){if(T.nodeName(b[C],"script")&&(!b[C].type||b[C].type.toLowerCase()==="text/javascript")){d.push(b[C].parentNode?b[C].parentNode.removeChild(b[C]):b[C])}else{if(b[C].nodeType===1){b.splice.apply(b,[C+1,0].concat(T.makeArray(b[C].getElementsByTagName("script"))))}D.appendChild(b[C])}}return d}return b},attr:function(C,b,B){if(!C||C.nodeType==3||C.nodeType==8){return AB}var a=!T.isXMLDoc(C),A=B!==AB;b=a&&T.props[b]||b;if(C.tagName){var c=/href|src|style/.test(b);if(b=="selected"&&C.parentNode){C.parentNode.selectedIndex}if(b in C&&a&&!c){if(A){if(b=="type"&&T.nodeName(C,"input")&&C.parentNode){throw"type property can't be changed"}C[b]=B}if(T.nodeName(C,"form")&&C.getAttributeNode(b)){return C.getAttributeNode(b).nodeValue}if(b=="tabIndex"){var D=C.getAttributeNode("tabIndex");return D&&D.specified?D.value:C.nodeName.match(/(button|input|object|select|textarea)/i)?0:C.nodeName.match(/^(a|area)$/i)&&C.href?0:AB}return C[b]}if(!T.support.style&&a&&b=="style"){return T.attr(C.style,"cssText",B)}if(A){C.setAttribute(b,""+B)}var d=!T.support.hrefNormalized&&a&&c?C.getAttribute(b,2):C.getAttribute(b);return d===null?AB:d}if(!T.support.opacity&&b=="opacity"){if(A){C.zoom=1;C.filter=(C.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(B)+""=="NaN"?"":"alpha(opacity="+B*100+")")}return C.filter&&C.filter.indexOf("opacity=")>=0?(parseFloat(C.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}b=b.replace(/-([a-z])/ig,function(f,e){return e.toUpperCase()});if(A){C[b]=B}return C[b]},trim:function(A){return(A||"").replace(/^\s+|\s+$/g,"")},makeArray:function(A){var C=[];if(A!=null){var B=A.length;if(B==null||typeof A==="string"||T.isFunction(A)||A.setInterval){C[0]=A}else{while(B){C[--B]=A[B]}}}return C},inArray:function(B,A){for(var D=0,C=A.length;D<C;D++){if(A[D]===B){return D}}return -1},merge:function(B,a){var D=0,C,A=B.length;if(!T.support.getAll){while((C=a[D++])!=null){if(C.nodeType!=8){B[A++]=C}}}else{while((C=a[D++])!=null){B[A++]=C}}return B},unique:function(A){var b=[],c={};try{for(var a=0,D=A.length;a<D;a++){var B=T.data(A[a]);if(!c[B]){c[B]=true;b.push(A[a])}}}catch(C){b=A}return b},grep:function(a,A,b){var D=[];for(var C=0,B=a.length;C<B;C++){if(!b!=!A(a[C],C)){D.push(a[C])}}return D},map:function(b,A){var a=[];for(var D=0,C=b.length;D<C;D++){var B=A(b[D],D);if(B!=null){a[a.length]=B}}return a.concat.apply([],a)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(A){return A.parentNode},parents:function(A){return T.dir(A,"parentNode")},next:function(A){return T.nth(A,2,"nextSibling")},prev:function(A){return T.nth(A,2,"previousSibling")},nextAll:function(A){return T.dir(A,"nextSibling")},prevAll:function(A){return T.dir(A,"previousSibling")},siblings:function(A){return T.sibling(A.parentNode.firstChild,A)},children:function(A){return T.sibling(A.firstChild)},contents:function(A){return T.nodeName(A,"iframe")?A.contentDocument||A.contentWindow.document:T.makeArray(A.childNodes)}},function(B,A){T.fn[B]=function(D){var C=T.map(this,A);if(D&&typeof D=="string"){C=T.multiFilter(D,C)}return this.pushStack(T.unique(C),B,D)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(B,A){T.fn[B]=function(d){var a=[],C=T(d);for(var D=0,c=C.length;D<c;D++){var b=(D>0?this.clone(true):this).get();T.fn[A].apply(T(C[D]),b);a=a.concat(b)}return this.pushStack(a,B,d)}});T.each({removeAttr:function(A){T.attr(this,A,"");if(this.nodeType==1){this.removeAttribute(A)}},addClass:function(A){T.className.add(this,A)},removeClass:function(A){T.className.remove(this,A)},toggleClass:function(A,B){if(typeof B!=="boolean"){B=!T.className.has(this,A)}T.className[B?"add":"remove"](this,A)},remove:function(A){if(!A||T.filter(A,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(B,A){T.fn[B]=function(){return this.each(A,arguments)}});function Y(B,A){return B[0]&&parseInt(T.curCSS(B[0],A,true),10)||0}var AA="jQuery"+AD(),I=0,R={};T.extend({cache:{},data:function(C,D,B){C=C==W?R:C;var A=C[AA];if(!A){A=C[AA]=++I}if(D&&!T.cache[A]){T.cache[A]={}}if(B!==AB){T.cache[A][D]=B}return D?T.cache[A][D]:A},removeData:function(C,D){C=C==W?R:C;var A=C[AA];if(D){if(T.cache[A]){delete T.cache[A][D];D="";for(D in T.cache[A]){break}if(!D){T.removeData(C)}}}else{try{delete C[AA]}catch(B){if(C.removeAttribute){C.removeAttribute(AA)}}delete T.cache[A]}},queue:function(C,D,A){if(C){D=(D||"fx")+"queue";var B=T.data(C,D);if(!B||T.isArray(A)){B=T.data(C,D,T.makeArray(A))}else{if(A){B.push(A)}}}return B},dequeue:function(A,B){var D=T.queue(A,B),C=D.shift();if(!B||B==="fx"){C=D[0]}if(C!==AB){C.call(A)}}});T.fn.extend({data:function(D,B){var A=D.split(".");A[1]=A[1]?"."+A[1]:"";if(B===AB){var C=this.triggerHandler("getData"+A[1]+"!",[A[0]]);if(C===AB&&this.length){C=T.data(this[0],D)}return C===AB&&A[1]?this.data(A[0]):C}else{return this.trigger("setData"+A[1]+"!",[A[0],B]).each(function(){T.data(this,D,B)})}},removeData:function(A){return this.each(function(){T.removeData(this,A)})},queue:function(B,A){if(typeof B!=="string"){A=B;B="fx"}if(A===AB){return T.queue(this[0],B)}return this.each(function(){var C=T.queue(this,B,A);if(B=="fx"&&C.length==1){C[0].call(this)}})},dequeue:function(A){return this.each(function(){T.dequeue(this,A)})}});(function(){var B=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,d=0,h=Object.prototype.toString;var j=function(n,r,AI,z){AI=AI||[];r=r||document;if(r.nodeType!==1&&r.nodeType!==9){return[]}if(!n||typeof n!=="string"){return AI}var m=[],p,w,t,s,y,q,o=true;B.lastIndex=0;while((p=B.exec(n))!==null){m.push(p[1]);if(p[2]){q=RegExp.rightContext;break}}if(m.length>1&&c.exec(n)){if(m.length===2&&g.relative[m[0]]){w=f(m[0]+m[1],r)}else{w=g.relative[m[0]]?[r]:j(m.shift(),r);while(m.length){n=m.shift();if(g.relative[n]){n+=m.shift()}w=f(n,w)}}}else{var x=z?{expr:m.pop(),set:k(z)}:j.find(m.pop(),m.length===1&&r.parentNode?r.parentNode:r,C(r));w=j.filter(x.expr,x.set);if(m.length>0){t=k(w)}else{o=false}while(m.length){var u=m.pop(),v=u;if(!g.relative[u]){u=""}else{v=m.pop()}if(v==null){v=r}g.relative[u](t,v,C(r))}}if(!t){t=w}if(!t){throw"Syntax error, unrecognized expression: "+(u||n)}if(h.call(t)==="[object Array]"){if(!o){AI.push.apply(AI,t)}else{if(r.nodeType===1){for(var l=0;t[l]!=null;l++){if(t[l]&&(t[l]===true||t[l].nodeType===1&&e(r,t[l]))){AI.push(w[l])}}}else{for(var l=0;t[l]!=null;l++){if(t[l]&&t[l].nodeType===1){AI.push(w[l])}}}}}else{k(t,AI)}if(q){j(q,r,AI,z);if(i){hasDuplicate=false;AI.sort(i);if(hasDuplicate){for(var l=1;l<AI.length;l++){if(AI[l]===AI[l-1]){AI.splice(l--,1)}}}}}return AI};j.matches=function(m,l){return j(m,null,null,l)};j.find=function(l,s,t){var m,o;if(!l){return[]}for(var p=0,q=g.order.length;p<q;p++){var n=g.order[p],o;if((o=g.match[n].exec(l))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){o[1]=(o[1]||"").replace(/\\/g,"");m=g.find[n](o,s,t);if(m!=null){l=l.replace(g.match[n],"");break}}}}if(!m){m=s.getElementsByTagName("*")}return{set:m,expr:l}};j.filter=function(y,z,v,p){var q=y,t=[],l=z,n,s,m=z&&z[0]&&C(z[0]);while(y&&z.length){for(var AI in g.filter){if((n=g.match[AI].exec(y))!=null){var r=g.filter[AI],u,w;s=false;if(l==t){t=[]}if(g.preFilter[AI]){n=g.preFilter[AI](n,l,v,t,p,m);if(!n){s=u=true}else{if(n===true){continue}}}if(n){for(var o=0;(w=l[o])!=null;o++){if(w){u=r(w,n,o,l);var x=p^!!u;if(v&&u!=null){if(x){s=true}else{l[o]=false}}else{if(x){t.push(w);s=true}}}}}if(u!==AB){if(!v){l=t}y=y.replace(g.match[AI],"");if(!s){return[]}break}}}if(y==q){if(s==null){throw"Syntax error, unrecognized expression: "+y}else{break}}q=y}return l};var g=j.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(l){return l.getAttribute("href")}},relative:{"+":function(l,s,m){var o=typeof s==="string",t=o&&!/\W/.test(s),n=o&&!t;if(t&&!m){s=s.toUpperCase()}for(var p=0,q=l.length,r;p<q;p++){if((r=l[p])){while((r=r.previousSibling)&&r.nodeType!==1){}l[p]=n||r&&r.nodeName===s?r||false:r===s}}if(n){j.filter(s,l,true)}},">":function(q,n,p){var s=typeof n==="string";if(s&&!/\W/.test(n)){n=p?n:n.toUpperCase();for(var m=0,o=q.length;m<o;m++){var r=q[m];if(r){var l=r.parentNode;q[m]=l.nodeName===n?l:false}}}else{for(var m=0,o=q.length;m<o;m++){var r=q[m];if(r){q[m]=s?r.parentNode:r.parentNode===n}}if(s){j.filter(n,q,true)}}},"":function(l,n,p){var m=d++,o=A;if(!n.match(/\W/)){var q=n=p?n:n.toUpperCase();o=D}o("parentNode",n,m,l,q,p)},"~":function(l,n,p){var m=d++,o=A;if(typeof n==="string"&&!n.match(/\W/)){var q=n=p?n:n.toUpperCase();o=D}o("previousSibling",n,m,l,q,p)}},find:{ID:function(n,m,l){if(typeof m.getElementById!=="undefined"&&!l){var o=m.getElementById(n[1]);return o?[o]:[]}},NAME:function(m,q,p){if(typeof q.getElementsByName!=="undefined"){var n=[],r=q.getElementsByName(m[1]);for(var l=0,o=r.length;l<o;l++){if(r[l].getAttribute("name")===m[1]){n.push(r[l])}}return n.length===0?null:n}},TAG:function(m,l){return l.getElementsByTagName(m[1])}},preFilter:{CLASS:function(l,n,m,o,q,p){l=" "+l[1].replace(/\\/g,"")+" ";if(p){return l}for(var s=0,r;(r=n[s])!=null;s++){if(r){if(q^(r.className&&(" "+r.className+" ").indexOf(l)>=0)){if(!m){o.push(r)}}else{if(m){n[s]=false}}}}return false},ID:function(l){return l[1].replace(/\\/g,"")},TAG:function(m,n){for(var l=0;n[l]===false;l++){}return n[l]&&C(n[l])?m[1]:m[1].toUpperCase()},CHILD:function(m){if(m[1]=="nth"){var l=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[2]=="even"&&"2n"||m[2]=="odd"&&"2n+1"||!/\D/.test(m[2])&&"0n+"+m[2]||m[2]);m[2]=(l[1]+(l[2]||1))-0;m[3]=l[3]-0}m[0]=d++;return m},ATTR:function(r,n,m,o,q,p){var l=r[1].replace(/\\/g,"");if(!p&&g.attrMap[l]){r[1]=g.attrMap[l]}if(r[2]==="~="){r[4]=" "+r[4]+" "}return r},PSEUDO:function(q,n,m,o,p){if(q[1]==="not"){if(q[3].match(B).length>1||/^\w/.test(q[3])){q[3]=j(q[3],null,null,n)}else{var l=j.filter(q[3],n,m,true^p);if(!m){o.push.apply(o,l)}return false}}else{if(g.match.POS.test(q[0])||g.match.CHILD.test(q[0])){return true}}return q},POS:function(l){l.unshift(true);return l}},filters:{enabled:function(l){return l.disabled===false&&l.type!=="hidden"},disabled:function(l){return l.disabled===true},checked:function(l){return l.checked===true},selected:function(l){l.parentNode.selectedIndex;return l.selected===true},parent:function(l){return !!l.firstChild},empty:function(l){return !l.firstChild},has:function(l,m,n){return !!j(n[3],l).length},header:function(l){return/h\d/i.test(l.nodeName)},text:function(l){return"text"===l.type},radio:function(l){return"radio"===l.type},checkbox:function(l){return"checkbox"===l.type},file:function(l){return"file"===l.type},password:function(l){return"password"===l.type},submit:function(l){return"submit"===l.type},image:function(l){return"image"===l.type},reset:function(l){return"reset"===l.type},button:function(l){return"button"===l.type||l.nodeName.toUpperCase()==="BUTTON"},input:function(l){return/input|select|textarea|button/i.test(l.nodeName)}},setFilters:{first:function(l,m){return m===0},last:function(m,n,o,l){return n===l.length-1},even:function(l,m){return m%2===0},odd:function(l,m){return m%2===1},lt:function(l,m,n){return m<n[3]-0},gt:function(l,m,n){return m>n[3]-0},nth:function(l,m,n){return n[3]-0==m},eq:function(l,m,n){return n[3]-0==m}},filter:{PSEUDO:function(q,m,l,p){var n=m[1],s=g.filters[n];if(s){return s(q,l,m,p)}else{if(n==="contains"){return(q.textContent||q.innerText||"").indexOf(m[3])>=0}else{if(n==="not"){var r=m[3];for(var l=0,o=r.length;l<o;l++){if(r[l]===q){return false}}return true}}}},CHILD:function(s,p){var m=p[1],r=s;switch(m){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(m=="first"){return true}r=s;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var q=p[2],t=p[3];if(q==1&&t==0){return true}var n=p[0],u=s.parentNode;if(u&&(u.sizcache!==n||!s.nodeIndex)){var o=0;for(r=u.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++o}}u.sizcache=n}var l=s.nodeIndex-t;if(q==0){return l==0}else{return(l%q==0&&l/q>=0)}}},ID:function(l,m){return l.nodeType===1&&l.getAttribute("id")===m},TAG:function(l,m){return(m==="*"&&l.nodeType===1)||l.nodeName===m},CLASS:function(l,m){return(" "+(l.className||l.getAttribute("class"))+" ").indexOf(m)>-1},ATTR:function(q,l){var m=l[1],o=g.attrHandle[m]?g.attrHandle[m](q):q[m]!=null?q[m]:q.getAttribute(m),p=o+"",r=l[2],n=l[4];return o==null?r==="!=":r==="="?p===n:r==="*="?p.indexOf(n)>=0:r==="~="?(" "+p+" ").indexOf(n)>=0:!n?p&&o!==false:r==="!="?p!=n:r==="^="?p.indexOf(n)===0:r==="$="?p.substr(p.length-n.length)===n:r==="|="?p===n||p.substr(0,n.length+1)===n+"-":false},POS:function(q,n,m,p){var o=n[2],l=g.setFilters[o];if(l){return l(q,m,n,p)}}}};var c=g.match.POS;for(var a in g.match){g.match[a]=RegExp(g.match[a].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var k=function(l,m){l=Array.prototype.slice.call(l);if(m){m.push.apply(m,l);return m}return l};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(b){k=function(p,l){var n=l||[];if(h.call(p)==="[object Array]"){Array.prototype.push.apply(n,p)}else{if(typeof p.length==="number"){for(var m=0,o=p.length;m<o;m++){n.push(p[m])}}else{for(var m=0;p[m];m++){n.push(p[m])}}}return n}}var i;if(document.documentElement.compareDocumentPosition){i=function(m,n){var l=m.compareDocumentPosition(n)&4?-1:m===n?0:1;if(l===0){hasDuplicate=true}return l}}else{if("sourceIndex" in document.documentElement){i=function(m,n){var l=m.sourceIndex-n.sourceIndex;if(l===0){hasDuplicate=true}return l}}else{if(document.createRange){i=function(l,n){var m=l.ownerDocument.createRange(),o=n.ownerDocument.createRange();m.selectNode(l);m.collapse(true);o.selectNode(n);o.collapse(true);var p=m.compareBoundaryPoints(Range.START_TO_END,o);if(p===0){hasDuplicate=true}return p}}}}(function(){var m=document.createElement("form"),l="script"+(new Date).getTime();m.innerHTML="<input name='"+l+"'/>";var n=document.documentElement;n.insertBefore(m,n.firstChild);if(!!document.getElementById(l)){g.find.ID=function(r,q,p){if(typeof q.getElementById!=="undefined"&&!p){var o=q.getElementById(r[1]);return o?o.id===r[1]||typeof o.getAttributeNode!=="undefined"&&o.getAttributeNode("id").nodeValue===r[1]?[o]:AB:[]}};g.filter.ID=function(p,o){var q=typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id");return p.nodeType===1&&q&&q.nodeValue===o}}n.removeChild(m)})();(function(){var l=document.createElement("div");l.appendChild(document.createComment(""));if(l.getElementsByTagName("*").length>0){g.find.TAG=function(o,p){var q=p.getElementsByTagName(o[1]);if(o[1]==="*"){var m=[];for(var n=0;q[n];n++){if(q[n].nodeType===1){m.push(q[n])}}q=m}return q}}l.innerHTML="<a href='#'></a>";if(l.firstChild&&typeof l.firstChild.getAttribute!=="undefined"&&l.firstChild.getAttribute("href")!=="#"){g.attrHandle.href=function(m){return m.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var m=j,l=document.createElement("div");l.innerHTML="<p class='TEST'></p>";if(l.querySelectorAll&&l.querySelectorAll(".TEST").length===0){return }j=function(q,r,o,n){r=r||document;if(!n&&r.nodeType===9&&!C(r)){try{return k(r.querySelectorAll(q),o)}catch(p){}}return m(q,r,o,n)};j.find=m.find;j.filter=m.filter;j.selectors=m.selectors;j.matches=m.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var l=document.createElement("div");l.innerHTML="<div class='test e'></div><div class='test'></div>";if(l.getElementsByClassName("e").length===0){return }l.lastChild.className="e";if(l.getElementsByClassName("e").length===1){return }g.order.splice(1,0,"CLASS");g.find.CLASS=function(o,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m){return n.getElementsByClassName(o[1])}}})()}function D(r,m,n,t,l,u){var v=r=="previousSibling"&&!u;for(var p=0,q=t.length;p<q;p++){var s=t[p];if(s){if(v&&s.nodeType===1){s.sizcache=n;s.sizset=p}s=s[r];var o=false;while(s){if(s.sizcache===n){o=t[s.sizset];break}if(s.nodeType===1&&!u){s.sizcache=n;s.sizset=p}if(s.nodeName===m){o=s;break}s=s[r]}t[p]=o}}}function A(r,m,n,t,l,u){var v=r=="previousSibling"&&!u;for(var p=0,q=t.length;p<q;p++){var s=t[p];if(s){if(v&&s.nodeType===1){s.sizcache=n;s.sizset=p}s=s[r];var o=false;while(s){if(s.sizcache===n){o=t[s.sizset];break}if(s.nodeType===1){if(!u){s.sizcache=n;s.sizset=p}if(typeof m!=="string"){if(s===m){o=true;break}}else{if(j.filter(m,[s]).length>0){o=s;break}}}s=s[r]}t[p]=o}}}var e=document.compareDocumentPosition?function(l,m){return l.compareDocumentPosition(m)&16}:function(l,m){return l!==m&&(l.contains?l.contains(m):true)};var C=function(l){return l.nodeType===9&&l.documentElement.nodeName!=="HTML"||!!l.ownerDocument&&C(l.ownerDocument)};var f=function(o,q){var l=[],s="",r,m=q.nodeType?[q]:q;while((r=g.match.PSEUDO.exec(o))){s+=r[0];o=o.replace(g.match.PSEUDO,"")}o=g.relative[o]?o+"*":o;for(var p=0,n=m.length;p<n;p++){j(o,m[p],l)}return j.filter(s,l)};T.find=j;T.filter=j.filter;T.expr=j.selectors;T.expr[":"]=T.expr.filters;j.selectors.filters.hidden=function(l){return l.offsetWidth===0||l.offsetHeight===0};j.selectors.filters.visible=function(l){return l.offsetWidth>0||l.offsetHeight>0};j.selectors.filters.animated=function(l){return T.grep(T.timers,function(m){return l===m.elem}).length};T.multiFilter=function(l,n,m){if(m){l=":not("+l+")"}return j.matches(l,n)};T.dir=function(m,n){var o=[],l=m[n];while(l&&l!=document){if(l.nodeType==1){o.push(l)}l=l[n]}return o};T.nth=function(p,o,m,l){o=o||1;var n=0;for(;p;p=p[m]){if(p.nodeType==1&&++n==o){break}}return p};T.sibling=function(l,m){var n=[];for(;l;l=l.nextSibling){if(l.nodeType==1&&l!=m){n.push(l)}}return n};return ;W.Sizzle=j})();T.event={add:function(C,b,D,A){if(C.nodeType==3||C.nodeType==8){return }if(C.setInterval&&C!=W){C=W}if(!D.guid){D.guid=this.guid++}if(A!==AB){var a=D;D=this.proxy(a);D.data=A}var c=T.data(C,"events")||T.data(C,"events",{}),B=T.data(C,"handle")||T.data(C,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):AB});B.elem=C;T.each(b.split(/\s+/),function(g,f){var e=f.split(".");f=e.shift();D.type=e.slice().sort().join(".");var d=c[f];if(T.event.specialAll[f]){T.event.specialAll[f].setup.call(C,A,e)}if(!d){d=c[f]={};if(!T.event.special[f]||T.event.special[f].setup.call(C,A,e)===false){if(C.addEventListener){C.addEventListener(f,B,false)}else{if(C.attachEvent){C.attachEvent("on"+f,B)}}}}d[D.guid]=D;T.event.global[f]=true});C=null},guid:1,global:{},remove:function(B,a,C){if(B.nodeType==3||B.nodeType==8){return }var b=T.data(B,"events"),c,d;if(b){if(a===AB||(typeof a==="string"&&a.charAt(0)==".")){for(var D in b){this.remove(B,D+(a||""))}}else{if(a.type){C=a.handler;a=a.type}T.each(a.split(/\s+/),function(i,g){var e=g.split(".");g=e.shift();var h=RegExp("(^|\\.)"+e.slice().sort().join(".*\\.")+"(\\.|$)");if(b[g]){if(C){delete b[g][C.guid]}else{for(var f in b[g]){if(h.test(b[g][f].type)){delete b[g][f]}}}if(T.event.specialAll[g]){T.event.specialAll[g].teardown.call(B,e)}for(c in b[g]){break}if(!c){if(!T.event.special[g]||T.event.special[g].teardown.call(B,e)===false){if(B.removeEventListener){B.removeEventListener(g,T.data(B,"handle"),false)}else{if(B.detachEvent){B.detachEvent("on"+g,T.data(B,"handle"))}}}c=null;delete b[g]}}})}for(c in b){break}if(!c){var A=T.data(B,"handle");if(A){A.elem=null}T.removeData(B,"events");T.removeData(B,"handle")}}},trigger:function(D,B,a,d){var b=D.type||D;if(!d){D=typeof D==="object"?D[AA]?D:T.extend(T.Event(b),D):T.Event(b);if(b.indexOf("!")>=0){D.type=b=b.slice(0,-1);D.exclusive=true}if(!a){D.stopPropagation();if(this.global[b]){T.each(T.cache,function(){if(this.events&&this.events[b]){T.event.trigger(D,B,this.handle.elem)}})}}if(!a||a.nodeType==3||a.nodeType==8){return AB}D.result=AB;D.target=a;B=T.makeArray(B);B.unshift(D)}D.currentTarget=a;var C=T.data(a,"handle");if(C){C.apply(a,B)}if((!a[b]||(T.nodeName(a,"a")&&b=="click"))&&a["on"+b]&&a["on"+b].apply(a,B)===false){D.result=false}if(!d&&a[b]&&!D.isDefaultPrevented()&&!(T.nodeName(a,"a")&&b=="click")){this.triggered=true;try{a[b]()}catch(A){}}this.triggered=false;if(!D.isPropagationStopped()){var c=a.parentNode||a.ownerDocument;if(c){T.event.trigger(D,B,c,true)}}},handle:function(B){var C,d;B=arguments[0]=T.event.fix(B||W.event);B.currentTarget=this;var A=B.type.split(".");B.type=A.shift();C=!A.length&&!B.exclusive;var D=RegExp("(^|\\.)"+A.slice().sort().join(".*\\.")+"(\\.|$)");d=(T.data(this,"events")||{})[B.type];for(var b in d){var a=d[b];if(C||D.test(a.type)){B.handler=a;B.data=a.data;var c=a.apply(this,arguments);if(c!==AB){B.result=c;if(c===false){B.preventDefault();B.stopPropagation()}}if(B.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(C){if(C[AA]){return C}var a=C;C=T.Event(a);for(var D=this.props.length,A;D;){A=this.props[--D];C[A]=a[A]}if(!C.target){C.target=C.srcElement||document}if(C.target.nodeType==3){C.target=C.target.parentNode}if(!C.relatedTarget&&C.fromElement){C.relatedTarget=C.fromElement==C.target?C.toElement:C.fromElement}if(C.pageX==null&&C.clientX!=null){var B=document.documentElement,b=document.body;C.pageX=C.clientX+(B&&B.scrollLeft||b&&b.scrollLeft||0)-(B.clientLeft||0);C.pageY=C.clientY+(B&&B.scrollTop||b&&b.scrollTop||0)-(B.clientTop||0)}if(!C.which&&((C.charCode||C.charCode===0)?C.charCode:C.keyCode)){C.which=C.charCode||C.keyCode}if(!C.metaKey&&C.ctrlKey){C.metaKey=C.ctrlKey}if(!C.which&&C.button){C.which=(C.button&1?1:(C.button&2?3:(C.button&4?2:0)))}return C},proxy:function(A,B){B=B||function(){return A.apply(this,arguments)};B.guid=A.guid=A.guid||B.guid||this.guid++;return B},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(B,A){T.event.add(this,A[0],AF)},teardown:function(A){if(A.length){var C=0,B=RegExp("(^|\\.)"+A[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(B.test(this.type)){C++}});if(C<1){T.event.remove(this,A[0],AF)}}}}}};T.Event=function(A){if(!this.preventDefault){return new T.Event(A)}if(A&&A.type){this.originalEvent=A;this.type=A.type}else{this.type=A}this.timeStamp=AD();this[AA]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var A=this.originalEvent;if(!A){return }if(A.preventDefault){A.preventDefault()}A.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var A=this.originalEvent;if(!A){return }if(A.stopPropagation){A.stopPropagation()}A.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var AH=function(B){var C=B.relatedTarget;while(C&&C!=this){try{C=C.parentNode}catch(A){C=this}}if(C!=this){B.type=B.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(A,B){T.event.special[B]={setup:function(){T.event.add(this,A,AH,B)},teardown:function(){T.event.remove(this,A,AH)}}});T.fn.extend({bind:function(B,A,C){return B=="unload"?this.one(B,A,C):this.each(function(){T.event.add(this,B,C||A,C&&A)})},one:function(B,A,C){var D=T.event.proxy(C||A,function(a){T(this).unbind(a,D);return(C||A).apply(this,arguments)});return this.each(function(){T.event.add(this,B,D,C&&A)})},unbind:function(A,B){return this.each(function(){T.event.remove(this,A,B)})},trigger:function(B,A){return this.each(function(){T.event.trigger(B,A,this)})},triggerHandler:function(C,A){if(this[0]){var B=T.Event(C);B.preventDefault();B.stopPropagation();T.event.trigger(B,A,this[0]);return B.result}},toggle:function(A){var C=arguments,B=1;while(B<C.length){T.event.proxy(A,C[B++])}return this.click(T.event.proxy(A,function(D){this.lastToggle=(this.lastToggle||0)%B;D.preventDefault();return C[this.lastToggle++].apply(this,arguments)||false}))},hover:function(B,A){return this.mouseenter(B).mouseleave(A)},ready:function(A){P();if(T.isReady){A.call(document,T)}else{T.readyList.push(A)}return this},live:function(A,B){var C=T.event.proxy(B);C.guid+=this.selector+A;T(document).bind(Z(A,this.selector),this.selector,C);return this},die:function(A,B){T(document).unbind(Z(A,this.selector),B?{guid:B.guid+this.selector+A}:null);return this}});function AF(A){var D=RegExp("(^|\\.)"+A.type+"(\\.|$)"),B=true,C=[];T.each(T.data(this,"events").live||[],function(c,b){if(D.test(b.type)){var a=T(A.target).closest(b.data)[0];if(a){C.push({elem:a,fn:b})}}});C.sort(function(a,b){return T.data(a.elem,"closest")-T.data(b.elem,"closest")});T.each(C,function(){if(this.fn.call(this.elem,A,this.fn.data)===false){return(B=false)}});return B}function Z(A,B){return["live",A,B.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return }G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return }try{document.documentElement.doScroll("left")}catch(A){setTimeout(arguments.callee,0);return }T.ready()})()}}}T.event.add(W,"load",T.ready)}T.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(A,B){T.fn[B]=function(C){return C?this.bind(B,C):this.trigger(B)}});T(W).bind("unload",function(){for(var A in T.cache){if(A!=1&&T.cache[A].handle){T.event.remove(T.cache[A].handle.elem)}}});(function(){T.support={};var b=document.documentElement,a=document.createElement("script"),A=document.createElement("div"),B="script"+(new Date).getTime();A.style.display="none";A.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 D=A.getElementsByTagName("*"),c=A.getElementsByTagName("a")[0];if(!D||!D.length||!c){return }T.support={leadingWhitespace:A.firstChild.nodeType==3,tbody:!A.getElementsByTagName("tbody").length,objectAll:!!A.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!A.getElementsByTagName("link").length,style:/red/.test(c.getAttribute("style")),hrefNormalized:c.getAttribute("href")==="/a",opacity:c.style.opacity==="0.5",cssFloat:!!c.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};a.type="text/javascript";try{a.appendChild(document.createTextNode("window."+B+"=1;"))}catch(C){}b.insertBefore(a,b.firstChild);if(W[B]){T.support.scriptEval=true;delete W[B]}b.removeChild(a);if(A.attachEvent&&A.fireEvent){A.attachEvent("onclick",function(){T.support.noCloneEvent=false;A.detachEvent("onclick",arguments.callee)});A.cloneNode(true).fireEvent("onclick")}T(function(){var d=document.createElement("div");d.style.width=d.style.paddingLeft="1px";document.body.appendChild(d);T.boxModel=T.support.boxModel=d.offsetWidth===2;document.body.removeChild(d).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(a,B,A){if(typeof a!=="string"){return this._load(a)}var C=a.indexOf(" ");if(C>=0){var c=a.slice(C,a.length);a=a.slice(0,C)}var D="GET";if(B){if(T.isFunction(B)){A=B;B=null}else{if(typeof B==="object"){B=T.param(B);D="POST"}}}var b=this;T.ajax({url:a,type:D,dataType:"html",data:B,complete:function(e,d){if(d=="success"||d=="notmodified"){b.html(c?T("<div/>").append(e.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(c):e.responseText)}if(A){b.each(A,[e.responseText,d,e])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(C,B){var A=T(this).val();return A==null?null:T.isArray(A)?T.map(A,function(D,a){return{name:B.name,value:D}}):{name:B.name,value:A}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(B,A){T.fn[A]=function(C){return this.bind(A,C)}});var N=AD();T.extend({get:function(D,B,A,C){if(T.isFunction(B)){A=B;B=null}return T.ajax({type:"GET",url:D,data:B,success:A,dataType:C})},getScript:function(B,A){return T.get(B,null,A,"script")},getJSON:function(C,B,A){return T.get(C,B,A,"json")},post:function(D,B,A,C){if(T.isFunction(B)){A=B;B={}}return T.ajax({type:"POST",url:D,data:B,success:A,dataType:C})},ajaxSetup:function(A){T.extend(T.ajaxSettings,A)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.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(g){g=T.extend(true,g,T.extend(true,{},T.ajaxSettings,g));var A,n=/=\?(&|$)/g,b,B,m=g.type.toUpperCase();if(g.data&&g.processData&&typeof g.data!=="string"){g.data=T.param(g.data)}if(g.dataType=="jsonp"){if(m=="GET"){if(!g.url.match(n)){g.url+=(g.url.match(/\?/)?"&":"?")+(g.jsonp||"callback")+"=?"}}else{if(!g.data||!g.data.match(n)){g.data=(g.data?g.data+"&":"")+(g.jsonp||"callback")+"=?"}}g.dataType="json"}if(g.dataType=="json"&&(g.data&&g.data.match(n)||g.url.match(n))){A="jsonp"+N++;if(g.data){g.data=(g.data+"").replace(n,"="+A+"$1")}g.url=g.url.replace(n,"="+A+"$1");g.dataType="script";W[A]=function(q){B=q;k();h();W[A]=AB;try{delete W[A]}catch(p){}if(l){l.removeChild(D)}}}if(g.dataType=="script"&&g.cache==null){g.cache=false}if(g.cache===false&&m=="GET"){var o=AD();var C=g.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+o+"$2");g.url=C+((C==g.url)?(g.url.match(/\?/)?"&":"?")+"_="+o:"")}if(g.data&&m=="GET"){g.url+=(g.url.match(/\?/)?"&":"?")+g.data;g.data=null}if(g.global&&!T.active++){T.event.trigger("ajaxStart")}var c=/^(\w+:)?\/\/([^\/?#]+)/.exec(g.url);if(g.dataType=="script"&&m=="GET"&&c&&(c[1]&&c[1]!=location.protocol||c[2]!=location.host)){var l=document.getElementsByTagName("head")[0];var D=document.createElement("script");D.src=g.url;if(g.scriptCharset){D.charset=g.scriptCharset}if(!A){var e=false;D.onload=D.onreadystatechange=function(){if(!e&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){e=true;k();h();D.onload=D.onreadystatechange=null;l.removeChild(D)}}}l.appendChild(D);return AB}var i=false;var j=g.xhr();if(g.username){j.open(m,g.url,g.async,g.username,g.password)}else{j.open(m,g.url,g.async)}try{if(g.data){j.setRequestHeader("Content-Type",g.contentType)}if(g.ifModified){j.setRequestHeader("If-Modified-Since",T.lastModified[g.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}j.setRequestHeader("X-Requested-With","XMLHttpRequest");j.setRequestHeader("Accept",g.dataType&&g.accepts[g.dataType]?g.accepts[g.dataType]+", */*":g.accepts._default)}catch(a){}if(g.beforeSend&&g.beforeSend(j,g)===false){if(g.global&&!--T.active){T.event.trigger("ajaxStop")}j.abort();return false}if(g.global){T.event.trigger("ajaxSend",[j,g])}var f=function(r){if(j.readyState==0){if(d){clearInterval(d);d=null;if(g.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!i&&j&&(j.readyState==4||r=="timeout")){i=true;if(d){clearInterval(d);d=null}b=r=="timeout"?"timeout":!T.httpSuccess(j)?"error":g.ifModified&&T.httpNotModified(j,g.url)?"notmodified":"success";if(b=="success"){try{B=T.httpData(j,g.dataType,g)}catch(p){b="parsererror"}}if(b=="success"){var q;try{q=j.getResponseHeader("Last-Modified")}catch(p){}if(g.ifModified&&q){T.lastModified[g.url]=q}if(!A){k()}}else{T.handleError(g,j,b)}h();if(r){j.abort()}if(g.async){j=null}}}};if(g.async){var d=setInterval(f,13);if(g.timeout>0){setTimeout(function(){if(j&&!i){f("timeout")}},g.timeout)}}try{j.send(g.data)}catch(a){T.handleError(g,j,null,a)}if(!g.async){f()}function k(){if(g.success){g.success(B,b)}if(g.global){T.event.trigger("ajaxSuccess",[j,g])}}function h(){if(g.complete){g.complete(j,b)}if(g.global){T.event.trigger("ajaxComplete",[j,g])}if(g.global&&!--T.active){T.event.trigger("ajaxStop")}}return j},handleError:function(C,A,D,B){if(C.error){C.error(A,D,B)}if(C.global){T.event.trigger("ajaxError",[A,C,B])}},active:0,httpSuccess:function(A){try{return !A.status&&location.protocol=="file:"||(A.status>=200&&A.status<300)||A.status==304||A.status==1223}catch(B){}return false},httpNotModified:function(B,D){try{var A=B.getResponseHeader("Last-Modified");return B.status==304||A==T.lastModified[D]}catch(C){}return false},httpData:function(A,C,D){var a=A.getResponseHeader("content-type"),b=C=="xml"||!C&&a&&a.indexOf("xml")>=0,B=b?A.responseXML:A.responseText;if(b&&B.documentElement.tagName=="parsererror"){throw"parsererror"}if(D&&D.dataFilter){B=D.dataFilter(B,C)}if(typeof B==="string"){if(C=="script"){T.globalEval(B)}if(C=="json"){B=W["eval"]("("+B+")")}}return B},param:function(D){var B=[];function A(b,a){B[B.length]=encodeURIComponent(b)+"="+encodeURIComponent(a)}if(T.isArray(D)||D.jquery){T.each(D,function(){A(this.name,this.value)})}else{for(var C in D){if(T.isArray(D[C])){T.each(D[C],function(){A(C,this)})}else{A(C,T.isFunction(D[C])?D[C]():D[C])}}}return B.join("&").replace(/%20/g,"+")}});var V={},U,AE=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(B,C){var A={};T.each(AE.concat.apply([],AE.slice(0,C)),function(){A[this]=B});return A}T.fn.extend({show:function(C,A){if(C){return this.animate(K("show",3),C,A)}else{for(var a=0,c=this.length;a<c;a++){var d=T.data(this[a],"olddisplay");this[a].style.display=d||"";if(T.css(this[a],"display")==="none"){var b=this[a].tagName,B;if(V[b]){B=V[b]}else{var D=T("<"+b+" />").appendTo("body");B=D.css("display");if(B==="none"){B="block"}D.remove();V[b]=B}T.data(this[a],"olddisplay",B)}}for(var a=0,c=this.length;a<c;a++){this[a].style.display=T.data(this[a],"olddisplay")||""}return this}},hide:function(B,A){if(B){return this.animate(K("hide",3),B,A)}else{for(var C=0,D=this.length;C<D;C++){var a=T.data(this[C],"olddisplay");if(!a&&a!=="none"){T.data(this[C],"olddisplay",T.css(this[C],"display"))}}for(var C=0,D=this.length;C<D;C++){this[C].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(A,B){var C=typeof A==="boolean";return T.isFunction(A)&&T.isFunction(B)?this._toggle.apply(this,arguments):A==null||C?this.each(function(){var D=C?A:T(this).is(":hidden");T(this)[D?"show":"hide"]()}):this.animate(K("toggle",3),A,B)},fadeTo:function(C,A,B){return this.animate({opacity:A},C,B)},animate:function(A,D,B,C){var a=T.speed(D,B,C);return this[a.queue===false?"each":"queue"](function(){var c=T.extend({},a),e,b=this.nodeType==1&&T(this).is(":hidden"),d=this;for(e in A){if(A[e]=="hide"&&b||A[e]=="show"&&!b){return c.complete.call(this)}if((e=="height"||e=="width")&&this.style){c.display=T.css(this,"display");c.overflow=this.style.overflow}}if(c.overflow!=null){this.style.overflow="hidden"}c.curAnim=T.extend({},A);T.each(A,function(k,g){var h=new T.fx(d,c,k);if(/toggle|show|hide/.test(g)){h[g=="toggle"?b?"show":"hide":g](A)}else{var i=g.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),f=h.cur(true)||0;if(i){var l=parseFloat(i[2]),j=i[3]||"px";if(j!="px"){d.style[k]=(l||1)+j;f=((l||1)/h.cur(true))*f;d.style[k]=f+j}if(i[1]){l=((i[1]=="-="?-1:1)*l)+f}h.custom(f,l,j)}else{h.custom(f,g,"")}}});return true})},stop:function(B,C){var A=T.timers;if(B){this.queue([])}this.each(function(){for(var D=A.length-1;D>=0;D--){if(A[D].elem==this){if(C){A[D](true)}A.splice(D,1)}}});if(!C){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(B,A){T.fn[B]=function(D,C){return this.animate(A,D,C)}});T.extend({speed:function(B,A,C){var D=typeof B==="object"?B:{complete:C||!C&&A||T.isFunction(B)&&B,duration:B,easing:C&&A||A&&!T.isFunction(A)&&A};D.duration=T.fx.off?0:typeof D.duration==="number"?D.duration:T.fx.speeds[D.duration]||T.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){T(this).dequeue()}if(T.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(B,A,D,C){return D+C*B},swing:function(B,A,D,C){return((-Math.cos(B*Math.PI)/2)+0.5)*C+D}},timers:[],fx:function(B,C,A){this.options=C;this.elem=B;this.prop=A;if(!C.orig){C.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(A){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var B=parseFloat(T.css(this.elem,this.prop,A));return B&&B>-10000?B:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(A,B,C){this.startTime=AD();this.start=A;this.end=B;this.unit=C||this.unit||"px";this.now=this.start;this.pos=this.state=0;var a=this;function D(b){return a.step(b)}D.elem=this.elem;if(D()&&T.timers.push(D)&&!U){U=setInterval(function(){var b=T.timers;for(var c=0;c<b.length;c++){if(!b[c]()){b.splice(c--,1)}}if(!b.length){clearInterval(U);U=AB}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(C){var D=AD();if(C||D>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var b=true;for(var a in this.options.curAnim){if(this.options.curAnim[a]!==true){b=false}}if(b){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var B in this.options.curAnim){T.attr(this.elem.style,B,this.options.orig[B])}}this.options.complete.call(this.elem)}return false}else{var A=D-this.startTime;this.state=A/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,A,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(A){T.attr(A.elem.style,"opacity",A.now)},_default:function(A){if(A.elem.style&&A.elem.style[A.prop]!=null){A.elem.style[A.prop]=A.now+A.unit}else{A.elem[A.prop]=A.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var b=this[0].getBoundingClientRect(),C=this[0].ownerDocument,c=C.body,d=C.documentElement,A=d.clientTop||c.clientTop||0,B=d.clientLeft||c.clientLeft||0,D=b.top+(self.pageYOffset||T.boxModel&&d.scrollTop||c.scrollTop)-A,a=b.left+(self.pageXOffset||T.boxModel&&d.scrollLeft||c.scrollLeft)-B;return{top:D,left:a}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var b=this[0],e=b.offsetParent,f=b,A=b.ownerDocument,C,d=A.documentElement,a=A.body,D=A.defaultView,g=D.getComputedStyle(b,null),B=b.offsetTop,c=b.offsetLeft;while((b=b.parentNode)&&b!==a&&b!==d){C=D.getComputedStyle(b,null);B-=b.scrollTop,c-=b.scrollLeft;if(b===e){B+=b.offsetTop,c+=b.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.tagName))){B+=parseInt(C.borderTopWidth,10)||0,c+=parseInt(C.borderLeftWidth,10)||0}f=e,e=b.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&C.overflow!=="visible"){B+=parseInt(C.borderTopWidth,10)||0,c+=parseInt(C.borderLeftWidth,10)||0}g=C}if(g.position==="relative"||g.position==="static"){B+=a.offsetTop,c+=a.offsetLeft}if(g.position==="fixed"){B+=Math.max(d.scrollTop,a.scrollTop),c+=Math.max(d.scrollLeft,a.scrollLeft)}return{top:B,left:c}}}T.offset={initialize:function(){if(this.initialized){return }var C=document.body,e=document.createElement("div"),c,d,A,b,B,f,a=C.style.marginTop,D='<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>';B={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(f in B){e.style[f]=B[f]}e.innerHTML=D;C.insertBefore(e,C.firstChild);c=e.firstChild,d=c.firstChild,b=c.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(d.offsetTop!==5);this.doesAddBorderForTableAndCells=(b.offsetTop===5);c.style.overflow="hidden",c.style.position="relative";this.subtractsBorderForOverflowNotVisible=(d.offsetTop===-5);C.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(C.offsetTop===0);C.style.marginTop=a;C.removeChild(e);this.initialized=true},bodyOffset:function(C){T.offset.initialized||T.offset.initialize();var A=C.offsetTop,B=C.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){A+=parseInt(T.curCSS(C,"marginTop",true),10)||0,B+=parseInt(T.curCSS(C,"marginLeft",true),10)||0}return{top:A,left:B}}};T.fn.extend({position:function(){var B=0,C=0,a;if(this[0]){var D=this.offsetParent(),A=this.offset(),b=/^body|html$/i.test(D[0].tagName)?{top:0,left:0}:D.offset();A.top-=Y(this,"marginTop");A.left-=Y(this,"marginLeft");b.top+=Y(D,"borderTopWidth");b.left+=Y(D,"borderLeftWidth");a={top:A.top-b.top,left:A.left-b.left}}return a},offsetParent:function(){var A=this[0].offsetParent||document.body;while(A&&(!/^body|html$/i.test(A.tagName)&&T.css(A,"position")=="static")){A=A.offsetParent}return T(A)}});T.each(["Left","Top"],function(B,C){var A="scroll"+C;T.fn[A]=function(D){if(!this[0]){return null}return D!==AB?this.each(function(){this==W||this==document?W.scrollTo(!B?D:T(W).scrollLeft(),B?D:T(W).scrollTop()):this[A]=D}):this[0]==W||this[0]==document?self[B?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[A]||document.body[A]:this[0][A]}});T.each(["Height","Width"],function(B,D){var b=B?"Left":"Top",C=B?"Right":"Bottom",a=D.toLowerCase();T.fn["inner"+D]=function(){return this[0]?T.css(this[0],a,false,"padding"):null};T.fn["outer"+D]=function(c){return this[0]?T.css(this[0],a,false,c?"margin":"border"):null};var A=D.toLowerCase();T.fn[A]=function(c){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+D]||document.body["client"+D]:this[0]==document?Math.max(document.documentElement["client"+D],document.body["scroll"+D],document.documentElement["scroll"+D],document.body["offset"+D],document.documentElement["offset"+D]):c===AB?(this.length?T.css(this[0],A):null):this.css(A,typeof c==="string"?c:c+"px")}})})();jQuery.log=function(){};(function(A){A.event.special.mousewheel={setup:function(){var B=A.event.special.mousewheel.handler;if(A.browser.mozilla){A(this).bind("mousemove.mousewheel",function(C){A.data(this,"mwcursorposdata",{pageX:C.pageX,pageY:C.pageY,clientX:C.clientX,clientY:C.clientY})})}if(this.addEventListener){this.addEventListener((A.browser.mozilla?"DOMMouseScroll":"mousewheel"),B,false)}else{this.onmousewheel=B}},teardown:function(){var B=A.event.special.mousewheel.handler;A(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener((A.browser.mozilla?"DOMMouseScroll":"mousewheel"),B,false)}else{this.onmousewheel=function(){}}A.removeData(this,"mwcursorposdata")},handler:function(D){var B=Array.prototype.slice.call(arguments,1);D=A.event.fix(D||window.event);A.extend(D,A.data(this,"mwcursorposdata")||{});var C=0,E=true;if(D.wheelDelta){C=D.wheelDelta/120}if(D.detail){C=-D.detail/3}if(A.browser.opera){C=-D.wheelDelta}D.data=D.data||{};D.type="mousewheel";B.unshift(C);B.unshift(D);return A.event.handle.apply(this,B)}};A.fn.extend({mousewheel:function(B){return B?this.bind("mousewheel",B):this.trigger("mousewheel")},unmousewheel:function(B){return this.unbind("mousewheel",B)}})})(jQuery);if(jQuery){(function(){$.extend($.fn,{rightClick:function(A){$(this).each(function(){$(this).mouseup(function(B){if(B.button===2){A($(this),B)}return true});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightDblClick:function(B){var A;$(this).each(function(){$(this).rightClick(function(C,D){if(A){clearTimeout(A);A=null;B($(this),D);return true}else{A=setTimeout(function(){clearTimeout(A);A=null},300);return false}})});return $(this)},rightMouseDown:function(A){$(this).each(function(){$(this).mousedown(function(B){if(B.button==2){A($(this));return true}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseUp:function(A){$(this).each(function(){$(this).mouseup(function(B){if(B.button==2){A($(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(D,C,A,B){if(D&&D.eventRegister){D.eventRegisterPre(C,A,B);D.eventRegister(C,A,B);D.eventRegisterPost(C,A,B)}return{obj:D,id:C,fn:A,scope:B}},removeListener:function(A){A.obj.eventDeRegisterPre(A.id,A.fn,A.scope);A.obj.eventDeRegister(A.id,A.fn,A.scope);A.obj.eventDeRegisterPost(A.id,A.fn,A.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(A,C){C=(C==null)?0:C;var B=this.length;for(var D=C;D<B;D++){if(this[D]==A){return D}}return -1});SEAT.PGUtil={getZone:function(D,F,E,G){var A=Math.floor((D+180)/360),C=(D+180)-A*360-180,B=32;if(C>14.1285&&C<24.143875&&F>49.003201&&F<54.8387&&E<G){B=33}return B},latLong2UTM:function(O,R,B){var F=6378137,H=0.00669438,J=0.9996,A=3.14159265,Q=A*O/180,N=A*R/180,E=((B-1)*6-180+3)*A/180,L=(H)/(1-H),M=F/Math.sqrt(1-H*Math.sin(N)*Math.sin(N)),P=Math.tan(N)*Math.tan(N),I=L*Math.cos(N)*Math.cos(N),G=Math.cos(N)*(Q-E),K=F*((1-H/4-3*H*H/64-5*H*H*H/256)*N-(3*H/8+3*H*H/32+45*H*H*H/1024)*Math.sin(2*N)+(15*H*H/256+45*H*H*H/1024)*Math.sin(4*N)-(35*H*H*H/3072)*Math.sin(6*N)),C=(J*M*(G+(1-P+I)*G*G*G/6+(5-18*P+P*P+72*I-58*L)*G*G*G*G*G/120)+500000),D=(J*(K+M*Math.tan(N)*(G*G/2+(5-P+9*I+4*I*I)*G*G*G*G/24+(61-58*P+P*P+600*I-330*L)*G*G*G*G*G*G/720)));return{x:C,y:D}},utm2LatLong:function(AK,AL,V){var AG=0.9996,D=6378137,P=6356752.3142,R=3.14159265,AF=((V-1)*6-180+3);AK=AK-500000;var AD=AL/AG,AM=0.081819,T=0.006694348761,a=AD/(D*(1-(T)/4-3*T*T/64-5*T*T*T/256)),AH=(1-Math.sqrt(1-T))/(1+Math.sqrt(1-T)),AO=(1.5*AH-27*Math.pow(AH,3)/32),AP=(21*AH*AH/16-55*Math.pow(AH,4)/32),AQ=(151*Math.pow(AH,3)/96),AR=(1097*Math.pow(AH,4)/512),AI=a+AO*Math.sin(2*a)+AP*Math.sin(4*a)+AQ*Math.sin(6*a)+AR*Math.sin(8*a),M=AM*AM/(1-AM*AM),Y=M*Math.cos(AI)*Math.cos(AI),AA=Math.tan(AI)*Math.tan(AI),X=D*(1-T)/Math.pow(1-T*Math.sin(AI)*Math.sin(AI),1.5),Q=D/Math.sqrt(1-T*Math.sin(AI)*Math.sin(AI)),AC=AK/(Q*AG),AE=Q*Math.tan(AI)/X,S=(AC*AC/2),U=(5+3*AA+10*Y-4*Y*Y-9*M)*Math.pow(AC,4)/24,W=(61+90*AA+298*Y+45*AA*AA-3*Y*Y-252*M)*Math.pow(AC,6)/720,Z=AC,b=(1+2*AA+Y)*Math.pow(AC,3)/6,AB=(5-2*Y+28*AA-3*Y*Y+8*M+24*AA*AA)*Math.pow(AC,5)/120,AJ=(AI-AE*(S-U+W))*180/R,AN=AF+((Z-b+AB)/Math.cos(AI))*180/R;return{x:AN,y:AJ}},pixelLatLong:function(D,G,L,P,E,I,K,H){var J=this.latLong2UTM(L,P,H),A=(E*1609.3)*(I/430),B=K/I*A;D=parseInt(D-I/2,10);G=parseInt(K/2-G,10);var M=((D/I)*A)+J.x,O=((G/K)*B)+J.y,C=SEAT.PGUtil.utm2LatLong(M,O,H),N=parseFloat(SEAT.PGUtil.trunc(C.x+"",5)),F=parseFloat(SEAT.PGUtil.trunc(C.y+"",5));return{lon:N,lat:F}},pixelLatLongPoint:function(E,H,K,A,F,I){var J=this.latLong2UTM(K,A,I),B=(F*1609.3)*(E/430),C=(F*1609.3)*(H/430),D=SEAT.PGUtil.utm2LatLong(J.x+B,J.y+C,I),L=parseFloat(SEAT.PGUtil.trunc(D.x+0.000005+"",5)),G=parseFloat(SEAT.PGUtil.trunc(D.y+0.000005+"",5));return{lon:L,lat:G}},trunc:function(A,C){var B=A.lastIndexOf(".");if(B<0){return A}if(C>0){B+=1+C}if(B>A.length){return A}return A.substr(0,B)},isFilters:function(A){try{if(A.filters){return true}else{return false}}catch(B){return false}},addBckImg:function(D,B,C,E){var A;if(SEAT.PGUtil.isFilters(D)){D.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true "+(E||"")+' src="'+B+'")'}else{A='url("'+B+'") '+C;D.style.background=A}},isArray:function(A){return(A.constructor.toString().indexOf("Array")!==-1)},calcCoefficients:function(K,B,A,G,F,D){var I=SEAT.PGUtil.latLong2UTM(parseFloat(K),parseFloat(B),D),H=I.x+((A/2)-G),J=F+(A/2)-I.y,C=H/A,E=J/A;return{cox:C,coy:E}},augment:function(D,E){var F=D.prototype,C=E.prototype,A=arguments,G,B;if(A[2]){for(G=2;G<A.length;G=G+1){F[A[G]]=C[A[G]]}}else{for(B in C){if(!F[B]){F[B]=C[B]}}}},purge:function(C){var E=C.attributes,D,A,B;if(E){A=E.length;for(D=0;D<A;D+=1){B=E[D].name;if(typeof C[B]==="function"){C[B]=null}}}E=C.childNodes;if(E){A=E.length;for(D=0;D<A;D+=1){SEAT.PGUtil.purge(C.childNodes[D])}}},isPointInLine:function(I,A,J,B,D,E,C){var F=C/2;J-=I;B-=A;D-=I;E-=A;var G=D*J+E*B;var K;if(G<=0){K=0}else{D=J-D;E=B-E;G=D*J+E*B;if(G<=0){K=0}else{K=G*G/(J*J+B*B)}}var H=D*D+E*E-K;if(H<0){H=0}return Math.sqrt(H)<F},getClosestPointOnLine:function(C,D,F){var E=D.x-C.x,G=D.y-C.y,A,B;if((E==0)&&(G==0)){return C}A=((F.x-C.x)*E+(F.y-C.y)*G)/(E*E+G*G);if(A<0){B=C}else{if(A>1){B=D}else{B={x:C.x+A*E,y:C.y+A*G}}}return B}};SEAT.Date={days:["Domenica","Luned&igrave;","Marted&igrave;","Mercoled&igrave;","Gioved&igrave;","Venerd&igrave;","Sabato"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],getDay:function(C,B){var A=this.days;if(B){A=B}if(C>=0&&C<A.length){return A[C]}else{return""}},getMonth:function(B,A){var C=this.months;if(A){C=A}if(B>=0&&B<C.length){return C[B]}else{return""}}};SEAT.EventMgr=function(){};SEAT.EventMgr.prototype={eventRegisterPre:function(C,A,B){},eventRegisterPost:function(C,A,B){},eventRegister:function(C,A,B){var D=true;if(!this.listenerList){this.listenerList=[]}$.each(this.listenerList,function(E,F){if(F.id===C&&F.fn===A&&F.scope===B){D=false;return false}});if(D){this.listenerList.push({id:C,fn:A,scope:B||null})}},eventFire:function(A,B){if(this.listenerList){$.each(this.listenerList,function(C,D){if(D.id===A){D.fn.call((D.scope||D.fn),B)}})}},eventDeRegisterPre:function(C,A,B){},eventDeRegisterPost:function(C,A,B){},eventDeRegister:function(C,D,A){var B=this;if(this.listenerList){$.each(this.listenerList,function(E,F){if(F&&F.id===C&&(!D||(D&&F.fn===D))&&(!A||(A&&F.scope===A))){B.listenerList.splice(E,1)}})}},eventDeRegisterAll:function(){this.listenerList=[]}};SEAT.DragDropMgr=function(){};SEAT.DragDropMgr.prototype={addDragDrop:function(){},removeDragDrop:function(){},dragDropAdd:function(C,A){var B=this;this.dragDropId=C;this.ddOpts={dragBefore:function(){},dragging:function(){},dragAfter:function(){}};$.extend(this.ddOpts,A);this.ddFnMouseDown=function(D){return B.dragDropMouseDown(D)};this.ddFnMouseMove=function(D){return B.dragDropMouseMove(D)};this.ddFnMouseUp=function(D){return B.dragDropMouseUp(D)};this.selDDEle=$("#"+C).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(A){this.dragDropping=true;this.actuallyMoved=false;this.mouseStart={x:A.pageX,y:A.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.startPos=this.selDDEle.position();this.curPos=this.startPos;this.manualChg={x:0,y:0};this.ddOpts.dragBefore.call(this.ddOpts.dragBefore,{e:A});return false},dragDropMouseMove:function(A){var B;if(this.dragDropping){this.actuallyMoved=true;B=this.dragDropGetChg(A);this.dragDropSetPos(B);this.ddOpts.dragging.call(this.ddOpts.dragging,{e:A,chg:B});return false}},dragDropMouseUp:function(A){var B;if(this.dragDropping){B=this.dragDropGetChg(A);if(B.x!==0||B.y!==0){this.dragDropSetPos(B)}this.dragDropping=false;if(this.actuallyMoved){this.ddOpts.dragAfter.call(this.ddOpts.dragAfter,{e:A,chg:B})}return false}},dragDropManualChg:function(A,B){this.manualChg.x+=A;this.manualChg.y+=B;this.curPos.left+=A;this.curPos.top+=B;this.selDDEle.css({left:this.curPos.left+A,top:this.curPos.top+B})},dragDropGetChg:function(A){var B={x:A.pageX,y:A.pageY};return{x:(B.x-this.mouseStart.x)+this.manualChg.x,y:(B.y-this.mouseStart.y)+this.manualChg.y}},dragDropSetPos:function(D){var C=this.eleStart,A=(C.left||C.left===0)?{left:C.left+D.x}:(C.right)?{right:C.right-D.x}:{},B=(C.top||C.top===0)?{top:C.top+D.y}:(C.bottom)?{bottom:C.bottom-D.y}:{};this.curPos={left:this.startPos.left+D.x,top:this.startPos.top+D.y};this.selDDEle.css(A).css(B)}};var PGDragDrop=function(){return{addDragDrop:function(A){if(A&&A.addDragDrop){A.addDragDrop()}},removeDragDrop:function(A){if(A&&A.removeDragDrop){A.removeDragDrop()}}}}();SEAT.ImgQ=function(A){this.p=A||{};this.p.concurReq=A.concurReq||4;this.p.imgTimeout=A.imgTimeout||50;this.p.onImgLoad=A.onImgLoad||function(){};this.numReq=0;this.Q=[]};SEAT.ImgQ.prototype={STS_QUEUED:"q",STS_REQUESTED:"r",STS_CALLING:"c",STS_DELETE:"d",queueImg:function(C,B){this.deQueueImg(C);var D,A=this.getAvaiable();if(A===null){D=this.Q.length;this.Q[D]={}}else{D=A}$.extend(this.Q[D],{id:C,imgName:B,sts:this.STS_QUEUED});if(this.numReq<this.p.concurReq){this.requestImg(D)}},deQueueAll:function(){var A=this;$.each(this.Q,function(C,B){A.deleteImg(C)})},deQueueImg:function(A){var B=this.isInQueue(A);if(B!==null){this.deleteImg(B)}},getAvaiable:function(){var B,A=null;for(B=0;B<this.Q.length;B+=1){if(this.Q[B].sts===this.STS_DELETE){A=B;break}}return A},isInQueue:function(A){var B;for(B=0;B<this.Q.length;B+=1){if(this.Q[B]&&this.Q[B].id===A){return B}}return null},requestImg:function(C){var A=this;this.numReq+=1;var D=function(){A.callImg(C)};var E=((this.numReq%this.p.concurReq)+1)*80;var B=window.setTimeout(D,E);$.extend(this.Q[C],{sts:this.STS_REQUESTED,tm:B})},deleteImg:function(A){if(this.Q[A].sts===this.STS_REQUESTED||this.Q[A].sts===this.STS_CALLING){this.numReq-=1}this.Q[A].id="";this.Q[A].imgName="";if(this.Q[A].tm){window.clearTimeout(this.Q[A].tm);this.Q[A].tm=null}if(this.Q[A].img){this.Q[A].img=null}this.Q[A].sts=this.STS_DELETE;this.checkQueue()},callImg:function(C){var B=this;$.extend(this.Q[C],{sts:this.STS_CALLING,tm:null,img:null});if(!this.Q[C].img){this.Q[C].img=new Image()}var A=function(){B.loadedImg(C)};this.Q[C].img.onload=A;this.Q[C].img.src=this.Q[C].imgName},loadedImg:function(A){this.p.onImgLoad(this.Q[A].id,this.Q[A].imgName,this.Q[A].img);this.deleteImg(A)},checkQueue:function(){var A;if(this.numReq<this.p.concurReq){for(A=0;A<this.Q.length;A+=1){if(this.Q[A].sts===this.STS_QUEUED&&this.numReq<this.p.concurReq){this.requestImg(A)}if(this.numReq>=this.p.concurReq){break}}}}};SEAT.GraphicsMgr=function(A){var B=this;this.id=A;$(window).unload(function(){B.unloadMe()})};SEAT.GraphicsMgr.prototype={unloadMe:function(){this.cvs=null;this.ctx=null},prepareCanvas:function(A,B,C){if(A!==this.containerId||B!==this.width||C!==this.height){this.removeCanvas()}this.containerId=A;this.width=B;this.height=C;if(!this.canvasExists()){this.createCanvas();this.ieFix();this.setContext()}},canvasExists:function(){return(this.cvs)?true:false},createCanvas:function(){var A=this,B=$("#"+this.containerId),C=B.css("z-index"),D=parseInt((C===undefined||C==="auto")?0:C,10)+1;this.cvsContId=this.containerId+"_cvsCont_"+this.id;$("<div></div>").attr({id:A.cvsContId}).css({position:"absolute",width:this.width,height:this.height,"z-index":D+""}).appendTo(B);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.height);$("#"+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(B,A){$("#"+this.cvsContId).css({left:B,top:A})},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(D,F,B,G){var E,A,C;this.setStrokeColour(F);this.setLineWidth(B);this.setOpacity(G);A=D.length;if(A>=2){this.ctx.lineJoin="round";this.ctx.beginPath();this.ctx.moveTo(D[0].x,D[0].y);for(E=0;E<A;E+=1){C=D[E];this.ctx.lineTo(C.x,C.y)}this.ctx.stroke();this.ctx.closePath()}},drawPolygon:function(D,F,A){var E,B,C;this.setFillColour(F);this.setOpacity(A);B=D.length;if(B>=2){this.ctx.beginPath();this.ctx.moveTo(D[0].x,D[0].y);for(E=0;E<B;E+=1){C=D[E];this.ctx.lineTo(C.x,C.y)}this.ctx.closePath();this.ctx.fill()}},drawCircle:function(A,B,D,E,F,C){var G=F?B-F:B;this.setOpacity(E);if(C==true){this.setFillColour(D);this.ctx.beginPath();this.ctx.arc(A.x,A.y,G,0,Math.PI*2,false);this.ctx.fill()}else{this.setStrokeColour(D);this.ctx.lineWidth=F;this.ctx.beginPath();this.ctx.arc(A.x,A.y,B-Math.ceil(F/2),0,Math.PI*2,false);this.ctx.stroke()}},setStrokeColour:function(A){this.ctx.strokeStyle="rgb("+A.r+", "+A.g+", "+A.b+")"},setFillColour:function(A){this.ctx.fillStyle="rgb("+A.r+", "+A.g+", "+A.b+")"},setLineWidth:function(A){this.ctx.lineWidth=""+A},setOpacity:function(A){if(typeof (A)!="undefined"){if(A<0||A>1){A=null}this.ctx.globalAlpha=A}}};SEAT.AnimateMgr=function(D,B,A,E,C){this.dur=D;this.cbStep=B;this.scStep=A;this.cbEnd=E;this.scEnd=C};SEAT.AnimateMgr.prototype={startAnimate:function(){var A=this;this.start=(new Date()).getTime();this.vNow=0;this.chg();this.tm=setInterval(function(){A.aStep(0,1)},15)},aStep:function(C,D){var E,A;var B=(new Date()).getTime();if(B>this.dur+this.start){if(this.tm){clearInterval(this.tm)}this.tm=null;this.vNow=D;this.chg();this.cbEnd.call(this.scEnd,this.vNow)}else{E=B-this.start;A=E/this.dur;this.vNow=((-Math.cos(A*Math.PI)/2)+0.5)*(D-C)+C;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_TYPE_ORTO_RECENTE=4;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;var PGMAP_TILE_OVER_USER=999;SEAT.Map=function(E){var D={nameContainer:"mapcontainer",tileWidth:256,tileHeight:256,mapWidth:400,mapHeight:400,lng:1,mapType:PGMAP_TYPE_MAP,actionType:PGMAP_ACTION_DRAG,cursorDrag:"url(http://api.visual.paginegialle.it/tcolnew/mapsapi/grab.cur), default",cursorDragging:"url(http://api.visual.paginegialle.it/tcolnew/mapsapi/grabbing.cur), default",cursorZoom:"crosshair",lon:12.49353,lat:41.89504,minPixelsClick:3,quality:0,qualities:["85","75","55"],pgPoint:null,x:0,y:0,z:1,tmZoom:500,tmDispTileVal:1250,sito:"",tmDisp:1,tmLnk:1,dragEnabled:1,wheelZoomEnabled:1,radarParent:null,imgHost:null,imgType:null,classNoPrint:"noprint",zone:32,zoneLevelChg:9,extraZooms:false,tileOverLayers:0,minMapLevel:PGMAP_ZOOM_STREET,streetColour:"verde",extraTilesAround:0,mapBackground:(E.imgType&&E.imgType===PGMAP_IMG_TYPE_LIGHT)?"#F0F2E8":"#DAD38F",compassImgs:[],zoomImgs:[],showEurope:(E.showEurope)?E.showEurope:false,fade:0};$.extend(D,E||{});if(!E.extraPixels){D.extraPixels={hor:D.mapWidth,ver:D.mapHeight}}if(D.pgPoint){D.lon=D.pgPoint.lon;D.lat=D.pgPoint.lat}D.zone=SEAT.PGUtil.getZone(D.lon,D.lat,D.z,D.zoneLevelChg);var G=this,A,B,F;function C(){A=new SEAT.Map.Model(D);B=new SEAT.Map.View(G,A,D);F=new SEAT.Map.Controller(B,A);B.setController(F);A.eventRegister("modelMapUpdate",B.update,B)}this.getOpts=function(){return D};this.startUp=function(){A.notifyUpdate()};this.addLayer=function(H){H.setViewMap(B);H.setContMap(F);B.addLayer(H)};this.removeLayer=function(H){B.removeLayer(H)};this.addTileLayer=function(H){A.addTileLayer(H)};this.removeTileLayer=function(H){A.removeTileLayer(H)};this.setCenter=function(H,I){F.setLonLat(H,I)};this.getCenter=function(){return{lon:A.getLonLat().lon,lat:A.getLonLat().lat}};this.setCenterAndZoom=function(H,J,I){F.setLonLatAndZoom(H,J,I)};this.setDisabledZoom=function(H){A.setDisabledZoom(H)};this.getDisabledZoom=function(){return A.getDisabledZoom()};this.setZoomStart=function(H){F.setZoomStart(H)};this.setZoomStep=function(H){F.setZoomStep(H)};this.setZoomEnd=function(H){F.setZoomEnd(H)};this.setZoom=function(H){F.setZoom(H)};this.getZoom=function(){return A.getZoom()};this.getZoomDist=function(){return B.model.zoomArray[A.getZIdx()]};this.getNewZoom=function(){return B.model.newVals.z};this.checkZoomValue=function(H){return A.checkZoomValue(H)};this.zoomIn=function(){F.zoomIn()};this.zoomOut=function(){F.zoomOut()};this.setSize=function(I,H){B.setSize(I,H)};this.getSize=function(){return{width:B.opts.mapWidth,height:B.opts.mapHeight}};this.setLng=function(H){B.setLng(H)};this.getLng=function(){return B.opts.lng};this.setMapType=function(H){F.setMapType(H)};this.getMapType=function(){return F.getMapType()};this.setTileOverLayers=function(H){F.setTileOverLayers(H)};this.getTileOverLayers=function(){return F.getTileOverLayers()};this.setActionType=function(H){B.setActionType(H)};this.setQuality=function(H){var I=parseInt(H,10);B.opts.quality=(I>=0&&I<B.opts.qualities.length)?I:0};this.panMapBy=function(I,H){B.panMapBy(I,H)};this.panMapTo=function(H,I){B.panMapTo(H,I)};this.getUpdated=function(){return B.updated};this.setUpdated=function(H){B.updated=H};this.getLonLatFromPixel=function(I,H){var J=SEAT.PGUtil.pixelLatLong(I,H,A.getLonLat().lon,A.getLonLat().lat,A.getZoomValueFromIdx(A.getZIdx()),B.opts.mapWidth,B.opts.mapHeight,B.opts.zone);return{lon:J.lon,lat:J.lat}};this.getPixelFromLonLat=function(K,L){var N=A.getConsts();var I=SEAT.PGUtil.calcCoefficients(K,L,N.mapWidthMeters,N.mapCentreUTMEasting,N.mapCentreUTMNorthing,B.opts.zone);var M=B.tileLayerMgr.getCurrentLayer();var J=M.getLeftPos(A.getCoefficients().cox)-(B.opts.mapWidth/2);var H=M.getTopPos(A.getCoefficients().coy)-(B.opts.mapHeight/2);return{x:M.getLeftPos(I.cox)-J,y:M.getTopPos(I.coy)-H}};this.pixelsBetweenTwoLonLats=function(K,L){var M=this.getPixelFromLonLat(K.lon,K.lat),H=this.getPixelFromLonLat(L.lon,L.lat),I=M.x-H.x,J=M.y-H.y;return Math.sqrt((I*I)+(J*J))};this.getMapBounds=function(){return B.getMapBounds()};this.disableMap=function(){B.opts.dragEnabled=0};this.enableMap=function(){B.opts.dragEnabled=1};this.disableWheelZoom=function(){B.opts.wheelZoomEnabled=0};this.enableWheelZoom=function(){B.opts.wheelZoomEnabled=1};this.preventMapMouseDown=function(){B.setPreventMapMouseDown(true)};this.addRadar=function(H){B.addRadar(H)};this.getZoomIndex=function(H){return A.getZoomIndex(H)};this.getZoomValueFromIdx=function(H){return A.getZoomValueFromIdx(H)};this.moveToCoeff=function(H,I){B.moveToCoeff(H,I)};this.getZone=function(){return B.opts.zone};C()};SEAT.PGUtil.augment(SEAT.Map,SEAT.EventMgr);SEAT.Map.ID_LAYER_CONTAINER="mapLayerCont";SEAT.Map.PAN_DURATION=1000;SEAT.Map.View=function(C,B,D){this.myParent=C;this.mapModel=B;this.opts=D;this.model=null;this.initedUpdated=false;this.layerList=[];this.sel=$("#"+D.nameContainer).css({position:"relative",overflow:"hidden",background:D.mapBackground});this.chgMapSize();this.updateCursor();this.initEventListeners();this.tileLayerMgr=new SEAT.Map.TileLayerMgr(D);this.initZoomBox();this.createLogoDiv();var A=this;this.eventClickMap=function(E){var F=A.getMapContainerPos();var H={x:E.pageX,y:E.pageY};var I=(H.x-F.x);var J=(H.y-F.y);var G=A.myParent.getLonLatFromPixel(I,J);A.myParent.eventFire("click",{event:E,x:I,y:J,lon:G.lon,lat:G.lat})};this.createEventClick();$("#"+D.nameContainer).bind("mousedown",function(E){return A.cont.mouseDown(E)});$(document).bind("mousemove",function(E){return A.cont.mouseMove(E)});$(document).bind("mouseup",function(E){return A.cont.mouseUp(E)});if(!this.opts.radarParent){$("#"+D.nameContainer).bind("dblclick",function(E){return A.cont.dblClick(E)}).bind("keydown",function(E){return A.cont.keyDown(E)}).bind("keyup",function(E){return A.cont.keyUp(E)});$("#"+D.nameContainer).rightDblClick(function(E,F){A.cont.dblClick(F,true);return true});$("#"+D.nameContainer).mousewheel(function(F,E){if(A.opts.wheelZoomEnabled===1){F.preventDefault();return A.cont.mouseWheel(F,E)}else{return true}})}$(window).unload(function(){A.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 A=this},setController:function(A){this.cont=A},addLayer:function(A){this.layerList.push(A);A.init()},removeLayer:function(A){A.remove();this.layerList=$.grep(this.layerList,function(B,C){return B!==A})},update:function(G){var A,M,D,I,L,B,H,J,K,C,E,F=false;this.model=G;this.tileLayerMgr.update(this.model);if(G.transType&&G.transType==="zoom"){if(G.startTrans){this.myParent.eventFire("zoombefore",{oldZ:G.z});this.oldZ=G.z;this.newLon=G.newLon;this.newLat=G.newLat;this.updated=true;if(this.radar){E={newLon:G.newLon,newLat:G.newLat,newCox:G.newCox,newCoy:G.newCoy};this.radar.setZoomStart(E)}}else{if(G.stepTrans){}else{if(G.endTrans){if(this.radar){C=G.z+3;C=this.checkZoomValue(C);K=C-this.radar.getZoom().z;this.radar.setZoomEnd(K)}this.model.lon=this.model.newLon;this.model.lat=this.model.newLat;this.model.cox=this.model.newCox;this.model.coy=this.model.newCoy;this.cont.setLonLat(this.model.lon,this.model.lat);this.mapModel.model.oldMapType=null;this.myParent.eventFire("zoomaftermap",{oldZ:this.oldZ,z:G.z})}}}}else{if(G.transType&&G.transType==="pan"){A={x:this.startPan.chgX*G.now,y:this.startPan.chgY*G.now};if(G.startTrans){this.panning=true}else{if(G.stepTrans){M=A.x+this.startPan.startX;D=A.y+this.startPan.startY;this.moveToSimple(M,D,true)}else{if(G.endTrans){this.clearTmDispTile();M=A.x+this.startPan.startX;D=A.y+this.startPan.startY;this.moveToSimple(M,D,true);this.panning=false;F=true}}}}else{if(this.initedUpdated){if(this.radar){if(!this.radar.getUpdated()){this.updated=true;this.radar.setCenter(G.lon,G.lat)}this.radar.setUpdated(false)}else{if(this.opts.radarParent){if(!this.opts.radarParent.getUpdated()){this.opts.radarParent.panMapTo(G.lon,G.lat,true);this.updated=true}this.opts.radarParent.setUpdated(false)}}}if(G.oldMapType){this.myParent.eventFire("typeaftermap",{oldMapType:G.oldMapType,mapType:G.mapType})}}}L=this.layerList.length;for(I=0;I<L;I+=1){this.layerList[I].updateMap(G)}if(F){this.cont.recalcLonLat({x:A.x+(this.recalcOffsetX||0),y:A.y+(this.recalcOffsetY||0)})}if(G.transType&&G.transType==="zoom"){if(G.endTrans){this.myParent.eventFire("zoomafter",{oldZ:this.oldZ,z:G.z})}}else{if(G.transType&&G.transType==="pan"){}else{if(G.oldMapType){this.myParent.eventFire("typeafter",{oldMapType:G.oldMapType,mapType:G.mapType})}}}this.initedUpdated=true},getMapPos:function(){var A=this.tileLayerMgr.getCurrentLayer();return{x:A.x,y:A.y}},getMapContainerPos:function(){var A=this.sel.offset();return{x:A.left,y:A.top,xTo:A.left+this.opts.mapWidth,yTo:A.top+this.opts.mapHeight}},moveTo:function(D,E,A){var F,B,C=this.tileLayerMgr.getCurrentLayer();this.moveToSimple(D,E,A);if(this.radar){F=((D*-1)+(this.opts.mapWidth/2))/C.width;B=((E*-1)+(this.opts.mapHeight/2))/C.height;this.radar.moveToCoeff(F,B)}},moveToSimple:function(D,E,B){var F,A=this;this.tileLayerMgr.showTileLayerHideOthers(this.tileLayerMgr.getCurrentLayerIdx());var C=this.tileLayerMgr.getCurrentLayer();C.moveTo(D,E);if(B&&!this.tmDispTile){F=function(){A.checkForTilesToDisplay();A.clearTmDispTile()};this.tmDispTile=window.setTimeout(F,this.opts.tmDispTileVal)}},checkForTilesToDisplay:function(){var C=this.tileLayerMgr.getCurrentLayer(),B=C.x*-1,A=C.y*-1;if(B<C.visiblePos.minX||(B+this.opts.mapWidth)>C.visiblePos.maxX||A<C.visiblePos.minY||(A+this.opts.mapHeight)>C.visiblePos.maxY){this.displayTiles()}},moveToCoeff:function(A,B){var C=this.tileLayerMgr.getCurrentLayer();this.moveToSimple(((A*C.width)-(this.opts.mapWidth/2))*-1,((B*C.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(A,B){var C={oldWidth:this.opts.mapWidth,oldHeight:this.opts.mapHeight};this.opts.mapWidth=A;this.opts.mapHeight=B;this.chgMapSize();this.model.transType=null;this.model.oldMapType=null;this.model.oldZ=null;this.model.oldZIdx=null;this.update(this.model);$.extend(C,{width:A,height:B});this.myParent.eventFire("sizeaftermap",C);if(this.radar){this.radar.setSize(this.radar.getSize().width,this.radar.getSize().height)}$.each(this.layerList,function(D,E){E.updateMapSize()});this.myParent.eventFire("sizeafter",C)},setLng:function(B){var A={oldLng:this.opts.lng};this.opts.lng=B;this.model.transType=null;this.model.oldMapType=null;this.model.oldZ=null;this.model.oldZIdx=null;this.update(this.model);$.extend(A,{lng:B});this.myParent.eventFire("languageaftermap",A);if(this.radar){this.radar.setLng(B)}$.each(this.layerList,function(C,D){D.updateMapLanguage()});this.myParent.eventFire("languageafter",A)},setActionType:function(A){this.opts.actionType=(A===PGMAP_ACTION_DRAG||A===PGMAP_ACTION_ZOOM)?A:PGMAP_ACTION_DRAG;this.updateCursor()},panMapBy:function(D,A,B){var C=this.tileLayerMgr.getCurrentLayer();this.startPan={chgX:D,chgY:A,startX:C.x,startY:C.y};this.cont.panMapBy((B||B===0)?B:SEAT.Map.PAN_DURATION)},panMapTo:function(F,A){this.cont.stopTransition();var C=SEAT.PGUtil.calcCoefficients(F,A,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone),D=this.model.cox-C.cox,G=this.model.coy-C.coy,B=(D*this.tileLayerMgr.getCurrentLayer().width),E=(G*this.tileLayerMgr.getCurrentLayer().height);this.panMapBy(B,E)},updateCursor:function(B){var A;if(this.opts.actionType===PGMAP_ACTION_ZOOM){A=this.opts.cursorZoom}else{A=(B)?this.opts.cursorDragging:this.opts.cursorDrag}this.sel[0].style.cursor=A},initZoomBox:function(){this.idZoomBox=this.opts.nameContainer+"_zoomBox";var A='<div id="'+this.idZoomBox+'"></div>';$("body").append(A);$("#"+this.idZoomBox).css({position:"absolute",display:"none",overflow:"hidden",zIndex:"250",border:"3px solid #4144AE"})},zoomBoxActivate:function(C,F){var G=(C.x<F.x)?C.x:F.x;var A=(C.x>F.x)?C.x:F.x;var B=(C.y<F.y)?C.y:F.y;var D=(C.y>F.y)?C.y:F.y;if(G<this.getMapContainerPos().x){G=this.getMapContainerPos().x}var E=parseInt($("#"+this.idZoomBox).css("borderLeftWidth"),10)*2;if((A+E)>this.getMapContainerPos().xTo){A=this.getMapContainerPos().xTo-E}if(B<this.getMapContainerPos().y){B=this.getMapContainerPos().y}var H=parseInt($("#"+this.idZoomBox).css("borderTopWidth"),10)*2;if((D+H)>this.getMapContainerPos().yTo){D=(this.getMapContainerPos().yTo-H)}if((A-G>=this.opts.minPixelsClick)||(D-B>=this.opts.minPixelsClick)){this.zoomBoxShow()}$("#"+this.idZoomBox).css({left:G+"px",top:B+"px",width:A-G+"px",height:D-B+"px"})},zoomBoxMouseUp:function(C,G){this.zoomBoxHide();var F=C.x-this.getMapContainerPos().x;var D=C.y-this.getMapContainerPos().y;var A=G.x-this.getMapContainerPos().x;var E=G.y-this.getMapContainerPos().y;if(A<0){A=0}if(A>this.opts.mapWidth){A=this.opts.mapWidth}if(E<0){E=0}if(E>this.opts.mapHeight){E=this.opts.mapHeight}var B=SEAT.PGUtil.pixelLatLong(parseInt((F+A)/2,10),parseInt((D+E)/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(B.lon,B.lat,this.zoomBoxGetNewZoom())},zoomBoxGetNewZoom:function(){var C=this.model.zIdx;var A=$("#"+this.idZoomBox).width();var D=$("#"+this.idZoomBox).height();var B=(A<D)?A:D;if(C>0){C-=1;if((C>0)&&(parseInt(B,10)<this.opts.mapWidth/3)){C-=1}}return this.cont.calcZFromIdx(C)},zoomBoxShow:function(){$("#"+this.idZoomBox).show()},zoomBoxHide:function(){$("#"+this.idZoomBox).hide()},zoomBoxCancel:function(){this.zoomBoxHide()},createLogoDiv:function(){var G=this,E,F;if(this.opts.tmDisp===1){this.idWWW=this.opts.nameContainer+"_WWW";E='<div id="'+this.idWWW+'">www.tuttocitta.it</div>';F=$(E).appendTo("#"+this.opts.nameContainer);F.css({position:"absolute",width:"150px",height:"27px",fontFamily:"verdana",fontSize:"11px",zIndex:"999",top:"5px",right:"20px"})}this.idLogo=this.opts.nameContainer+"_logo";var B="";var A="";if(this.opts.mapType===PGMAP_TYPE_MAP){B="&nbsp;&copy;2010 Navteq";A="#000"}else{if(this.opts.mapType===PGMAP_TYPE_ORTO||this.opts.mapType===PGMAP_TYPE_ORTO_RECENTE){B="&nbsp;&copy; e-GEOS";A="#fff"}else{if(this.opts.mapType===PGMAP_TYPE_MIXED){B="&nbsp;&copy;2010 Navteq<br>  &nbsp;&copy;e-GEOS";A="#fff"}}}var C='<div id="'+this.idLogo+'">'+((this.opts.tmDisp===1)?'<div style="float:left;"><img src="http://img.tuttocitta.it/tcolnew/img/PGvisual_watermark.gif" width="112" height="27" /></div>':"")+'<div id="logoName" style="float:left;padding-top:5px;color:'+A+'">'+B+"</div></div>";var D=$(C).appendTo("#"+this.opts.nameContainer);D.css({position:"absolute",width:"200px",height:"27px",fontFamily:"verdana",fontSize:"11px",zIndex:"999",bottom:"5px",left:"10px"});if(this.opts.tmDisp===1&&this.opts.tmLnk===1){F.css({cursor:"pointer"}).click(function(){G.openVisual()});D.find("img").css({cursor:"pointer"}).click(function(){G.openVisual()})}},openVisual:function(){window.open(PGMAP_WWW)},addRadar:function(D){D=D||{};D.width=D.width||150;D.height=D.height||100;var C=this.opts.nameContainer+"_radar";var E=$('<div id="'+C+'_wrap"><div id="'+C+'"></div></div>').css({position:"absolute",width:D.width,height:D.height,border:"4px solid #000","z-index":999,background:"#fff"}).appendTo(this.sel);var B={};if(D.top){$.extend(B,{top:D.top})}else{if(D.bottom){$.extend(B,{bottom:D.bottom})}else{$.extend(B,{top:20})}}if(D.left){$.extend(B,{left:D.left})}else{if(D.right){$.extend(B,{right:D.right})}else{$.extend(B,{right:10})}}E.css(B);var A=this.model.z<9?this.model.z+3:this.model.z;this.radar=new SEAT.PGMappy({nameContainer:C,radarParent:this.myParent,lon:this.model.lon,lat:this.model.lat,mapWidth:D.width,mapHeight:D.height,z:A,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(A){this.preventMapMove=A},getPreventMapMouseDown:function(){return this.preventMapMove},displayTiles:function(){this.tileLayerMgr.displayTiles()},calcZIdx:function(A){return this.cont.calcZIdx(A)},getZoomIndex:function(A){return this.cont.getZoomIndex(A)},checkZoomValue:function(A){return this.cont.checkZoomValue(A)},getMapBounds:function(){var A=this.myParent.getLonLatFromPixel(0,0),E=this.myParent.getLonLatFromPixel(this.opts.mapWidth,0),C=this.myParent.getLonLatFromPixel(0,this.opts.mapHeight),F=this.myParent.getLonLatFromPixel(this.opts.mapWidth,this.opts.mapHeight),B=this.myParent.getLonLatFromPixel(this.opts.mapWidth/2,0),D=this.myParent.getLonLatFromPixel(this.opts.mapWidth/2,this.opts.mapHeight);return{topLeft:{lon:A.lon,lat:A.lat},topRight:{lon:E.lon,lat:E.lat},botLeft:{lon:C.lon,lat:C.lat},botRight:{lon:F.lon,lat:F.lat},topMid:{lon:B.lon,lat:B.lat},botMid:{lon:D.lon,lat:D.lat}}}};SEAT.Map.Controller=function(A,B){this.view=A;this.mapModel=B};SEAT.Map.Controller.prototype={mouseDown:function(A){var B=true;if(!this.view.getPreventMapMouseDown()){this.view.myParent.eventFire("mousedownbefore",{event:A});this.view.clearTmDispTile();if(this.view.opts.actionType===PGMAP_ACTION_DRAG&&this.view.opts.dragEnabled!==1){}else{this.dragging=true;this.view.updateCursor(true);this.view.myParent.eventFire("mapposbefore",{event:A})}this.okToDrag=true;if(this.view.panning){this.view.panning=false;this.mapModel.stopTransition()}this.mouseStart={x:A.pageX,y:A.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:A});B=false}return B},mouseMove:function(C){var D=true;var E,A,B=this;if(!this.view.getPreventMapMouseDown()){if(this.dragging){if(this.okToDrag){this.view.destroyEventClick();this.view.myParent.eventFire("mousemovebefore",{event:C});if(this.view.opts.actionType===PGMAP_ACTION_ZOOM){if(this.zoomBoxing){this.view.zoomBoxActivate(this.mouseStart,{x:C.pageX,y:C.pageY})}}else{A=this.getChg(C);this.setPos(A,true)}this.okToDrag=false;setTimeout(function(){B.okToDrag=true},20);this.view.myParent.eventFire("mousemoveafter",{event:C})}D=false}}return D},mouseUp:function(C){var D,A,B=this;if(!this.view.getPreventMapMouseDown()){A=this.isMouseOverMap(C);if(A){this.view.myParent.eventFire("mouseupbefore",{event:C})}if(this.dragging){this.view.updateCursor(false);this.view.myParent.eventFire("mouseupmapbefore",{event:C});this.dragging=false;setTimeout(function(){B.view.createEventClick()},0);if(this.view.opts.actionType===PGMAP_ACTION_ZOOM){if(this.zoomBoxing){this.view.zoomBoxMouseUp(this.mouseStart,{x:C.pageX,y:C.pageY});this.zoomBoxing=false}}else{this.view.clearTmDispTile();D=this.getChg(C);if(D.x!==0||D.y!==0){this.setPos(D,false);this.recalcLonLat(D)}}this.view.myParent.eventFire("mouseupmapafter",{event:C});this.view.myParent.eventFire("mapposafter",{event:C})}if(A){this.view.myParent.eventFire("mouseupafter",{event:C})}}this.view.setPreventMapMouseDown(false);return true},dblClick:function(D,E){var G={x:D.pageX,y:D.pageY},A=G.x-(this.view.getMapContainerPos().x+this.view.opts.mapWidth/2),C=G.y-(this.view.getMapContainerPos().y+this.view.opts.mapHeight/2),B=SEAT.PGUtil.pixelLatLongPoint(A,-C,this.view.model.lon,this.view.model.lat,parseFloat(this.view.model.zoomArray[this.view.model.zIdx]),this.view.opts.zone),F=(E)?this.view.model.z+1:this.view.model.z-1;this.setLonLatAndZoom(B.lon,B.lat,F);return false},keyDown:function(A){var B=10;if(!this.keyDownStarted){this.mapLayerContStart=this.view.getMapPos();this.keyDownStarted=true;this.keyChg={x:0,y:0};this.view.myParent.eventFire("mapposbefore",{event:A})}if(this.zoomBoxing&&A.keyCode===KEY_ESC){this.zoomBoxing=false;this.view.zoomBoxCancel();return false}else{if(A.keyCode===KEY_LEFT_ARROW){this.keyChg.x+=B;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(A.keyCode===KEY_RIGHT_ARROW){this.keyChg.x-=B;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(A.keyCode===KEY_UP_ARROW){this.keyChg.y+=B;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}else{if(A.keyCode===KEY_DOWN_ARROW){this.keyChg.y-=B;this.setPos({x:this.keyChg.x,y:this.keyChg.y},true)}}}}}return true},keyUp:function(A){if(A.keyCode===KEY_LEFT_ARROW||A.keyCode===KEY_RIGHT_ARROW||A.keyCode===KEY_UP_ARROW||A.keyCode===KEY_DOWN_ARROW){this.recalcLonLat({x:this.keyChg.x,y:this.keyChg.y});this.view.myParent.eventFire("mapposafter",{event:A})}this.keyDownStarted=false},mouseWheel:function(A,C){var B=(C>0)?this.view.model.z-1:this.view.model.z+1;this.setZoom(B);return false},getChg:function(A){return{x:A.pageX-this.mouseStart.x,y:A.pageY-this.mouseStart.y}},setPos:function(E,A){var C=this.mapLayerContStart.x+E.x,D=this.mapLayerContStart.y+E.y,B=this.view.tileLayerMgr.getCurrentLayer(),F={x:C,y:D};this.view.moveTo(F.x,F.y,A);this.view.myParent.eventFire("mappos",{chg:E})},recalcLonLat:function(D){var A=(parseInt(this.view.opts.mapWidth,10)/2)-D.x,C=(parseInt(this.view.opts.mapHeight,10)/2)-D.y,B=SEAT.PGUtil.pixelLatLong(A,C,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(B.lon,B.lat)},stopTransition:function(){this.mapModel.stopTransition()},panMapBy:function(A){this.mapModel.transition(A,{transType:"pan"})},setLonLat:function(A,B){this.mapModel.setLonLat(A,B)},setLonLatAndZoom:function(C,B,A){this.mapModel.setLonLatAndZoom(C,B,A)},setZoomStart:function(A){this.mapModel.setZoomStart(A)},setZoomStep:function(A){this.mapModel.setZoomStep(A)},setZoomEnd:function(A){this.mapModel.setZoomEnd(A)},setZoom:function(A){this.mapModel.setZoom(A)},zoomIn:function(){this.mapModel.zoomIn()},zoomOut:function(){this.mapModel.zoomOut()},setMapType:function(A){this.mapModel.setMapType(A)},getMapType:function(){return this.mapModel.getMapType()},setTileOverLayers:function(A){this.mapModel.setTileOverLayers(A)},getTileOverLayers:function(){return this.mapModel.getTileOverLayers()},calcZIdx:function(A){return this.mapModel.calcZIdx(A)},calcZFromIdx:function(A){return this.mapModel.calcZFromIdx(A)},getZoomIndex:function(A){return this.mapModel.getZoomIndex(A)},checkZoomValue:function(A){return this.mapModel.checkZoomValue(A)},isMouseOverMap:function(C){var A={x:C.pageX,y:C.pageY},B=this.view.getMapContainerPos();return((A.x>=B.x)&&(A.x<=B.xTo)&&(A.y>=B.y)&&(A.y<=B.yTo))}};SEAT.Map.Model=function(A){this.model={mapWidthLevel1Pixel:33554432,mapWidthMeters:4709238.7,mapCentreUTMEasting:637855.35,mapCentreUTMNorthing:5671353.65,zoomArray:(A.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:(A.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:A.mapType,tileOverLayers:A.tileOverLayers,minMapLevel:A.minMapLevel,lon:A.lon,lat:A.lat,cox:0,coy:0,zIdx:0,z:A.z,tmZoom:A.tmZoom,zone:A.zone,zoneLevelChg:A.zoneLevelChg,extraZooms:A.extraZooms,disabledZoom:A.disabledZoom||[],tileLayers:[]};this.model.zIdx=this.calcZIdx(this.model.z);this.setZoneVals(this.model.zone);if(this.model.extraZooms){PGMAP_ZOOM_REGION_INTER_ITALY=10;PGMAP_ZOOM_ITALY=11;PGMAP_ZOOM_EUROPE=12}this.extra={};this.utid=1;this.calcCoefficients()};SEAT.Map.Model.prototype={transition:function(D,C,A){var B=this;this.stopTransition();this.newVals=A||{};this.transExtra=C;$.extend(this.extra,this.transExtra,{startTrans:true},{newVals:this.newVals});this.notifyUpdate();this.anim=new SEAT.AnimateMgr(D,B.transitionStep,B,B.transitionEnd,B);this.anim.startAnimate()},transitionStep:function(A){$.extend(this.extra,this.transExtra,{stepTrans:true,now:A},{newVals:this.newVals});this.notifyUpdate()},transitionEnd:function(A){$.extend(this.model,this.newVals);$.extend(this.extra,this.transExtra,{endTrans:true,now:A});this.transExtra=null;this.anim=null;this.notifyUpdate()},stopTransition:function(){if(this.anim){this.anim.stopAnimate();this.anim=null}this.transExtra=null},setDisabledZoom:function(A){this.model.disabledZoom=A},getDisabledZoom:function(){return this.model.disabledZoom},setZoomStart:function(A){this.chgZoomStart(A)},setZoomStep:function(A){var B=0;A=this.checkZoomValue(this.model.z+A)-this.model.z;this.chgZoomStep(A,B)},setZoomEnd:function(A){A=this.checkZoomValue(this.model.z+A)-this.model.z;var B=(A>=0)?Math.ceil(A):Math.floor(A);this.setZoomEndFinish(A,B,false)},setZoomEndFinish:function(C,B,D){var E=this,A;this.chgZ=C;this.finalChgZ=B;this.finalDiff=B-C;A=(!D||(this.finalDiff===0))?0:this.model.tmZoom;this.anim=new SEAT.AnimateMgr(A,E.zoomAnimateStep,E,E.zoomAnimateEnd,E);this.anim.startAnimate()},zoomAnimateStep:function(A){var B=this.chgZ+(this.finalDiff*A);this.chgZoomStep(B,A)},zoomAnimateEnd:function(A){this.anim=null;this.chgZoomEnd(this.finalChgZ,A)},chgZoomStart:function(A){this.stopTransition();this.newPos=A||{};if(!this.newPos.newLon||!this.newPos.newLat){this.newPos.newLon=this.model.lon;this.newPos.newLat=this.model.lat;this.newPos.newCox=this.model.cox;this.newPos.newCoy=this.model.coy}if(!this.newPos.newZone){this.newPos.newZone=this.model.zone}this.origZ=this.model.z;$.extend(this.extra,{transType:"zoom",startTrans:true},this.newPos);this.notifyUpdate()},chgZoomStep:function(A,B){$.extend(this.extra,{transType:"zoom",stepTrans:true,chgZ:A,now:B,oldZ:this.model.z,oldZIdx:this.model.zIdx,oldZone:this.model.zone});this.notifyUpdate()},chgZoomEnd:function(C,B){$.extend(this.extra,{transType:"zoom",endTrans:true,newVals:{z:this.model.z,zIdx:this.model.zIdx},oldZ:this.model.z,oldZIdx:this.model.zIdx,oldZone:this.model.zone,chgZ:C,now:B},this.newPos);var A=this.origZ+this.finalChgZ;A=this.checkZoomValue(A);$.extend(this.model,{oldZ:this.model.z,oldZIdx:this.model.zIdx,z:A,zIdx:this.calcZIdx(A)});this.setZoneVals(this.newPos.newZone);this.notifyUpdate()},setZoom:function(C,E){var A=false,D,B;$.each(this.model.disabledZoom,function(F,G){if(parseInt(G,10)===parseInt(C,10)){A=true;return false}});if(!A){this.stopTransition();C=this.checkZoomValue(C);B=this.checkZone((E&&E.newLon)?E.newLon:this.model.lon,(E&&E.newLat)?E.newLat:this.model.lat,C);E=E||{};E.newZone=B.newZone;D=C-this.model.z;this.chgZoomStart(E);this.setZoomEndFinish(0,D,true)}},zoomIn:function(){var A=this.model.z-1;this.setZoom(A)},zoomOut:function(){var A=this.model.z+1;this.setZoom(A)},checkZoomValue:function(C){var E=this,B=this.model.zoomArray.length-1-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS,D=[{a:12.225248,b:41.648857,c:12.857263,d:42.106668},{a:9.040675,b:45.399193,c:9.278047,d:45.535958},{a:7.575495,b:45.017648,c:7.770832,d:45.141136},{a:8.665256,b:44.382267,c:9.089091,d:44.519214},{a:12.152387,b:45.228948,c:12.581304,d:45.589057},{a:11.80394,b:45.348796,c:11.959782,d:45.458577},{a:11.22559,b:44.418602,c:11.421476,d:44.558825},{a:10.26749,b:43.582474,c:10.438307,d:43.751211},{a:11.147756,b:43.728345,c:11.339952,d:43.838108},{a:14.127744,b:40.790255,c:14.356175,d:40.921094},{a:13.239721,b:38.052818,c:13.460422,d:38.227123},{a:10.873612,b:45.35921,c:11.116805,d:45.54515},{a:9.226909,b:45.556359,c:9.313644,d:45.632358}],A=false;if(C<-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS){C=-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS}else{if(C>=B){C=B}}if((this.model.mapType===PGMAP_TYPE_MAP)&&(C<this.model.minMapLevel)){C=this.model.minMapLevel}if((this.model.mapType===PGMAP_TYPE_MAP)&&(C<PGMAP_ZOOM_STREET)){$.each(D,function(F,G){if((parseFloat(E.model.lon)>=parseFloat(G.a))&&(parseFloat(E.model.lon)<=parseFloat(G.c))&&(parseFloat(E.model.lat)>=parseFloat(G.b))&&(parseFloat(E.model.lat)<=parseFloat(G.d))){A=true;return false}});C=(A)?C:PGMAP_ZOOM_STREET}return C},calcZIdx:function(A){return A+SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS},calcZFromIdx:function(A){return A-SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS},calcCoefficients:function(){var A=SEAT.PGUtil.calcCoefficients(this.model.lon,this.model.lat,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);this.model.cox=A.cox;this.model.coy=A.coy},setLonLat:function(C,A){var B=this.checkZone(C,A,this.model.z);$.extend(this.extra,{oldZone:B.oldZone,newZone:B.newZone});this.setZoneVals(B.newZone);this.model.lon=C;this.model.lat=A;this.calcCoefficients();this.notifyUpdate()},setLonLatAndZoom:function(D,A,E){var C=SEAT.PGUtil.calcCoefficients(D,A,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);var B={newLon:D,newLat:A,newCox:C.cox,newCoy:C.coy};this.setZoom(E,B)},setMapType:function(D){var E,C;if((D===PGMAP_TYPE_MAP||D===PGMAP_TYPE_ORTO||D===PGMAP_TYPE_MIXED||D===PGMAP_TYPE_ORTO_RECENTE)&&D!==this.model.mapType){C=this.model.mapType;$.extend(this.extra,{oldMapType:C});this.model.mapType=D;var B="";var A="";if(D===PGMAP_TYPE_MAP){B="&nbsp;&copy;2010 Navteq";A="#000"}else{if(D===PGMAP_TYPE_ORTO||D===PGMAP_TYPE_ORTO_RECENTE){B="&nbsp;&copy; e-GEOS";A="#fff"}else{if(D===PGMAP_TYPE_MIXED){B="&nbsp;&copy;2010 Navteq<br>  &nbsp;&copy;e-GEOS";A="#fff"}}}$("#logoName").html(B).css({color:A});E=this.checkZoomValue(this.model.z);if(E!==this.model.z){this.model.oldMapType=C;this.setZoom(E)}else{this.notifyUpdate()}}},getMapType:function(){return this.model.mapType},setTileOverLayers:function(A){this.model.tileOverLayers=A},getTileOverLayers:function(){return this.model.tileOverLayers},notifyUpdate:function(){var A=$.extend({},this.model,this.extra);this.extra={};this.eventFire("modelMapUpdate",A)},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(C){var A;var B=this.model.zoomArray.length-1;for(A=3;A<this.model.zoomArray.length;A+=1){if(C<=parseFloat(this.model.zoomArray[A])){B=A;break}}return this.calcZFromIdx(B)},getZoomValueFromIdx:function(A){return parseFloat(this.model.zoomArray[A])},checkZone:function(D,A,E){var B=this.model.zone,C=SEAT.PGUtil.getZone(D,A,E,this.model.zoneLevelChg);return{oldZone:B,newZone:C}},setZoneVals:function(A){this.model.zone=A;if(A===33){this.model.mapCentreUTMNorthing=5677219.33619-117761.5;this.model.mapCentreUTMEasting=718496.723786+133922.35}else{if(A===35){this.model.mapCentreUTMNorthing=4533619.12;this.model.mapCentreUTMEasting=637855.35}else{this.model.mapCentreUTMNorthing=5671353.65;this.model.mapCentreUTMEasting=637855.35}}},addTileLayer:function(A){if(this.getIndexTileLayer(A)===-1){A.id=this.utid++;this.model.tileLayers.push(A);this.notifyUpdate()}},removeTileLayer:function(A){var C=this.getIndexTileLayer(A),B=[];if(C>=0){$.each(this.model.tileLayers,function(D,E){B.push(E)});$.extend(this.extra,{oldTileLayers:B});this.model.tileLayers.splice(C,1);this.notifyUpdate()}},getIndexTileLayer:function(A){var B=-1;$.each(this.model.tileLayers,function(C,D){if(A.id===D.id){B=C;return false}});return B}};SEAT.Map.Model.NUM_OF_NEGATIVE_ZOOM_LEVELS=3;SEAT.PGUtil.augment(SEAT.Map.Model,SEAT.EventMgr);SEAT.Map.TileLayer=function(C,D,E,B,F){var A=this,G='<div id="'+C+'"></div>';this.id=C;this.opts=D;this.parent=F;this.sel=$(G).appendTo("#"+D.nameContainer).css({position:"absolute"});this.sel.css({width:"100%",height:"100%"});this.setSize(E,B);this.origWidth=E;this.origHeight=B;this.width=E;this.height=B;this.x=0;this.y=0;this.visiblePos={minX:0,maxX:0,minY:0,maxY:0};this.ij=[];this.tiles=[];this.eta=0;this.imgQ=new SEAT.ImgQ({onImgLoad:function(H,I){A.imgLoad(H,I)}});this.hideZ();this.imgTrans=new Image();this.imgTrans.src="http://img.tuttocitta.it/nuovotcol/img/trans_point.gif";$(window).unload(function(){A.unloadMe()})};SEAT.Map.TileLayer.prototype={IMG_ID_PART_MAP:"tile",IMG_ID_PART_MIXED:"otile1",IMG_ID_PART_USER:"otileu_",unloadMe:function(){this.sel=null;this.ij=null;this.imgQ=null;this.imgTrans=null;this.tiles=null},resetSize:function(){this.setSize(this.origWidth,this.origHeight)},setSize:function(B,A){this.width=B;this.height=A},getLeftPos:function(B){var A=this.width*(this.leftAdjustCox||0);return Math.round((this.width*B)+A)},getTopPos:function(B){var A=this.height*(this.topAdjustCoy||0);return Math.round((this.height*B)+A)},addTileToList:function(D,A,E,B,C){this.tiles.push({sel:D,part:A,i:E,j:B,id:C})},getTilesByPart:function(A){return $.grep(this.tiles,function(B,C){return(B.part===A)})},getATile:function(B,D,C){var A=null;$.each(this.tiles,function(E,F){if((F.part===B)&&(F.i===D)&&(F.j===C)){A=F;return false}});return A},removeTilesByPart:function(A){this.tiles=$.grep(this.tiles,function(B,C){return(B.part!==A)})},removeAllTilesFromQ:function(){var A=this;$.each(this.imgQ.Q,function(C,B){if((B.id!=="")&&(B.id.indexOf(A.id+"_")>-1)){A.imgQ.deQueueImg(B.id)}})},displayTiles:function(A,C,D,F,E,G){var B=this;this.eta=G;this.iFrom=C;this.iTo=D;this.jFrom=F;this.jTo=E;this.displayTilesType(A,C,D,F,E,this.IMG_ID_PART_MAP,null);if(A.mapType===PGMAP_TYPE_MIXED&&A.z>=0){this.displayTilesType(A,C,D,F,E,this.IMG_ID_PART_MIXED,PGMAP_TILE_OVER_MIXED)}$.each(A.tileLayers,function(H,I){B.displayTilesType(A,C,D,F,E,B.IMG_ID_PART_USER+I.id,PGMAP_TILE_OVER_USER,I)})},displayTilesType:function(V,H,R,Q,C,O,W,P){var M=this,B=this.getTilesByPart(O),L=Math.floor(H+((R-H)/2)),F=Math.ceil(Q+((C-Q)/2)),K=1,S=0,J=0,U=0,N,T,D=true,G,I,E=[];$.each(this.imgQ.Q,function(a,A){var X,Z,Y;if(A.id!==""){X=A.id.split("_");Z=parseInt(X[X.length-2],10);Y=parseInt(X[X.length-1],10);if(A.id.indexOf(M.id+"_"+O+"_")>-1&&(Z<H||Z>R||Y>Q||Y>C)){M.imgQ.deQueueImg(A.id)}}});this.visiblePos={minX:H*this.opts.tileWidth,maxX:(R+1)*this.opts.tileWidth,minY:Q*this.opts.tileHeight,maxY:(C+1)*this.opts.tileHeight};$.each(B,function(X,A){if((A.i<H)||(A.i>R)||(A.j<Q)||(A.j>C)){A.sel.hide()}else{if(A.sel.attr("src")!==M.imgTrans.src){A.sel.show()}else{A.sel.hide()}}});for(G=H;G<=R;G+=1){for(I=Q;I<=C;I+=1){E.push({i:G,j:I,displayed:false})}}while(D){if(L>=H&&L<=R&&F>=Q&&F<=C){N=this.getATile(O,L,F);if(N===null){T=null;B=this.getTilesByPart(O);$.each(B,function(X,A){if((A.i<H)||(A.i>R)||(A.j<Q)||(A.j>C)){T=A;return false}});if(T!==null){this.modifyATile(V,T,L,F,O,W,P)}else{this.createATile(V,L,F,W,P)}}else{if(!N.sel.is(":visible")){this.modifyATile(V,N,L,F,O,W,P)}}$.each(E,function(X,A){if(A.i===L&&A.j==F){A.displayed=true;return false}})}if(J===0){L+=1}else{if(J===1){F-=1}else{if(J===2){L-=1}else{if(J===3){F+=1}}}}S+=1;if(S>=K){S=0;J=(J<3)?J+=1:0;if((U%2)===1){K+=1}U+=1}D=false;$.each(E,function(X,A){if(!A.displayed){D=true;return false}})}},getTileId:function(B,C,A){return(this.id+"_"+B+"_"+C+"_"+A)},removeAllTiles:function(B){var A=this;this.removeAllTilesPart(this.IMG_ID_PART_MAP);if(!(B&PGMAP_TILE_OVER_MIXED)){this.removeAllTilesPart(this.IMG_ID_PART_MIXED)}if(this.parent.model&&this.parent.model.tileLayers){$.each(this.parent.model.tileLayers,function(C,D){A.removeAllTilesPart(A.IMG_ID_PART_USER+D.id)})}},removeAllTilesPart:function(A){$.each(this.getTilesByPart(A),function(C,B){B.sel.remove();B.sel=null});this.removeTilesByPart(A)},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(B,A){if(!this.leftAdjustCox){this.leftAdjustCox=B/this.width;this.topAdjustCoy=A/this.height}this.x=B;this.y=A;this.cssX=B-(this.leftAdjustCox*this.width);this.cssY=A-(this.topAdjustCoy*this.height);this.sel.css({left:this.cssX,top:this.cssY})},createATile:function(F,G,I,A,J){var B,K,C,D,E,H;if(A===null){this.createATileType(G,I,this.IMG_ID_PART_MAP,"100",this.imageSrc(F,G,I),false)}else{if(A===PGMAP_TILE_OVER_MIXED){this.createATileType(G,I,this.IMG_ID_PART_MIXED,"110",this.imageSrc(F,G,I,PGMAP_TILE_OVER_MIXED),false)}else{if(A===PGMAP_TILE_OVER_USER){B=J.getTileUrl;D=F.zoomArrayCent[F.zIdx];H={i:G,j:I,z:D};K=B.call(B,H);B=J.getZIndex;C=B.call(B,H);B=J.getIsPng;E=B.call(B,H);this.createATileType(G,I,this.IMG_ID_PART_USER+J.id,C,K,E)}}}},createATileType:function(G,H,J,C,B,E){var I=this.getTileId(J,G,H),A=(E)?' class="typepng"':"",F='<img id="'+I+'" name="'+I+'" src="'+this.imgTrans.src+'" galleryimg="no"'+A+"/>",D=$(F).appendTo(this.sel).css({left:this.getLeftPos((G*this.opts.tileWidth)/this.origWidth),top:this.getTopPos((H*this.opts.tileHeight)/this.origHeight),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:C}).hide();this.addTileToList(D,J,G,H,I);this.imgQ.queueImg(I,B)},modifyATile:function(G,F,H,I,A,B,J){var L=(B===null)?this.IMG_ID_PART_MAP:A,E=this.getTileId(L,H,I),C,K,D;F.sel.hide().attr({src:this.imgTrans.src,id:E,name:E}).css({left:this.getLeftPos((H*this.opts.tileWidth)/this.origWidth),top:this.getTopPos((I*this.opts.tileHeight)/this.origHeight)});F.i=H;F.j=I;F.id=E;if(B===PGMAP_TILE_OVER_USER){C=J.getTileUrl;D=G.zoomArrayCent[G.zIdx];K=C.call(C,{i:H,j:I,z:D});this.imgQ.queueImg(E,K)}else{this.imgQ.queueImg(E,this.imageSrc(G,H,I,B))}},imgLoad:function(H,J){var A=this,I,D,E,C,G,F,B;$.each(this.tiles,function(K,L){if(L.id===H){L.sel.attr({src:J});C=H.indexOf(A.IMG_ID_PART_USER);if(C>-1){if(A.parent.model&&A.parent.model.tileLayers){G=H.substr(C).split("_");I=parseInt(G[1],10);F=G[2];B=G[3];$.each(A.parent.model.tileLayers,function(P,O){var M,N;if(O.id===I){M=A.parent.model.zoomArrayCent[A.parent.model.zIdx];N={id:H,ulid:I,i:F,j:B,z:M};D=O.getOpacity;E=D.call(D,N);if(parseInt(E,10)<1){L.sel.css({opacity:E})}D=O.onLoadImg;D.call(D,N);return false}})}}A.imgShow(L.sel)}})},imgShow:function(A){if(this.opts.fade>0){A.fadeIn(this.opts.fade,function(){})}A.show()},imageSrc:function(D,E,F,H){var J,C,I,A,G,B;if(E>=0&&F>=0){C=D.zoomArrayCent[D.zIdx];I=Math.pow(2,C-1);A=this.opts.imgHost||"http://visualimages"+((E%2)+1)+".paginegialle.it";if(H===PGMAP_TILE_OVER_MIXED){J=A+"/xmlpng_miste.php/europa-pngmix.imgi?cmd=tile&x="+E+"&y="+F+"&z="+I+"&extra=2&ts="+this.opts.tileWidth+"&utm="+this.opts.zone+"&sito="+this.opts.sito+"&v=4"}else{if((D.mapType===PGMAP_TYPE_MAP)&&this.opts.imgType&&(this.opts.imgType===PGMAP_IMG_TYPE_LIGHT)){B="/xmlpng.php/europa-png.imgi?cmd=tile";if(this.opts.showEurope&&((I===32768)||(I===16384)||(I===8192)||(I===4096))){B="/xmlpng.php/europa-png-eu.imgi?cmd=tile"}J=A+B+"&x="+E+"&y="+F+"&z="+I+"&extra=2&ts="+this.opts.tileWidth+"&utm="+this.opts.zone+"&sito="+this.opts.sito+"&v=13"}else{G="europa.imgi";if(D.mapType===PGMAP_TYPE_ORTO){G="europa-orto.imgi"}else{if(D.mapType===PGMAP_TYPE_MIXED){G="europa-orto.imgi"}else{if(D.mapType===PGMAP_TYPE_ORTO_RECENTE){G="europa-orto-recente.imgi"}}}A=this.opts.imgHost||"http://"+PGMAP_WWW_IMG_PFX+((E%4)+1)+".paginegialle.it";J=A+"/xml.php/"+G+"?cmd=tile&format=jpeg&x="+E+"&y="+F+"&z="+I+"&q="+this.opts.qualities[this.opts.quality]+"&extra=2&ts="+this.opts.tileWidth+"&sito="+this.opts.sito+"&v=1"}}}return J},update:function(C){var A,B=this;this.model=C;if(C.transType&&C.transType==="zoom"){if(C.startTrans){this.startZIdx=this.model.zIdx;this.chgBy(C,0);A=this.tiles;this.ij=[];$.each(A,function(D,E){var F=(E.i*B.opts.tileWidth)/B.origWidth,G=(E.j*B.opts.tileHeight)/B.origHeight;if((E.i>=(B.iFrom+B.eta))&&(E.i<=(B.iTo-B.eta))&&(E.j>=(B.jFrom+B.eta))&&(E.j<=(B.jTo-B.eta))){B.ij.push({tile:E.sel,i:E.i,j:E.j,cox:F,coy:G});E.sel.show()}else{E.sel.hide()}})}else{if(C.stepTrans){this.chgBy(C,C.chgZ)}else{if(C.endTrans){this.chgBy(C,C.chgZ)}}}}},chgBy:function(A,C){var B=this,D=this.getNewSizeForChange(A,this.opts.tileWidth,this.opts.tileHeight,C);$.each(this.ij,function(E,F){F.tile.css({left:B.getLeftPos(F.cox),top:B.getTopPos(F.coy),width:D.width,height:D.height})})},getNewSizeForChange:function(P,K,I,L){var B,R,A,O,C,Q,F,M,G,J,H,D=P.zoomArrayCent[this.startZIdx],E,N;if(L<0){H=L*-1;B=Math.floor(H);R=Math.ceil(H);E=D-P.zoomArrayCent[this.startZIdx-B];N=D-P.zoomArrayCent[this.startZIdx-R];A=Math.pow(2,E)*K;O=Math.pow(2,E)*I;C=Math.pow(2,N)*K;Q=Math.pow(2,N)*I;F=(C-A)*(H-B);M=(Q-O)*(H-B);G=A+F;J=O+M}else{B=Math.floor(L);R=Math.ceil(L);E=P.zoomArrayCent[this.startZIdx+B]-D;N=P.zoomArrayCent[this.startZIdx+R]-D;A=Math.pow(2,(E*-1))*K;O=Math.pow(2,(E*-1))*I;C=Math.pow(2,(N*-1))*K;Q=Math.pow(2,(N*-1))*I;F=(A-C)*(L-B);M=(O-Q)*(L-B);G=A-F;J=O-M}return{width:G,height:J}}};SEAT.Map.TileLayer.ZINDEX_SHOW=100;SEAT.Map.TileLayer.ZINDEX_SHOW_BELOW=99;SEAT.Map.TileLayer.ZINDEX_HIDE=98;var PGTileLayer=function(){};PGTileLayer.prototype={getTileUrl:function(){return null},getZIndex:function(){return"130"},getIsPng:function(){return false},getOpacity:function(){return 1},onLoadImg:function(){}};SEAT.Map.TileLayerMgr=function(A){this.opts=A;this.tileLayerList=[];this.inited=false};SEAT.Map.TileLayerMgr.prototype={initTileLayers:function(B){var D,A,C=B.zoomArrayCent.length;for(D=0;D<C;D+=1){A=this.getSizeForZoom(B,D);this.addTileLayer(new SEAT.Map.TileLayer(this.opts.nameContainer+"_z_"+D,this.opts,A.width,A.height,this))}this.inited=true},addTileLayer:function(A){this.tileLayerList.push(A)},update:function(H){var D,E,I,A,B,F,G,C;this.model=H;if(!this.inited){this.initTileLayers(H)}if(H.transType&&H.transType==="zoom"){if(H.startTrans){this.showTileLayerHideOthers(H.zIdx);this.startLayer=this.getCurrentLayer();this.startZIdx=this.model.zIdx;this.startCoeff={cox:H.cox,coy:H.coy};this.chgCoeff={cox:H.newCox-H.cox,coy:H.newCoy-H.coy};this.chgBy(0,0)}else{if(H.stepTrans){this.chgBy(H.chgZ,H.now)}else{if(H.endTrans){this.checkChgZone(H.oldZone,H.zone);C=this.getLayer(H.zIdx);C.resetSize();C.chgBy(H,0);this.showTileLayerHideOthers(H.zIdx,H.oldZIdx)}}}this.startLayer.update(H)}else{if(H.transType&&H.transType==="pan"){if(H.endTrans){this.checkChgZone(H.oldZone,H.zone)}}else{this.checkChgZone(H.oldZone,H.zone);this.setPosAndShow(H)}}},checkChgZone:function(A,B){if(A&&(A!==B)){$.each(this.tileLayerList,function(C,D){D.removeAllTiles();D.opts.zone=B})}},chgBy:function(C,G){var A=this.getNewSizeForChange(this.startZIdx,C);this.startLayer.setSize(A.width,A.height);var D=this.startCoeff.cox+(this.chgCoeff.cox*G);var E=this.startCoeff.coy+(this.chgCoeff.coy*G);var F=((D*A.width)*-1)+(this.opts.mapWidth/2);var B=((E*A.height)*-1)+(this.opts.mapHeight/2);this.startLayer.moveTo(F,B)},getNewSizeForChange:function(A,L){var E,D,I,G,K,H,F,B,J,C,M;if(L<0){M=(L*-1);E=Math.floor(M);D=Math.ceil(M);I=this.getSizeForZoom(this.model,A-E).width;G=this.getSizeForZoom(this.model,A-E).height;K=this.getSizeForZoom(this.model,A-D).width;H=this.getSizeForZoom(this.model,A-D).height;F=(K-I)*(M-E);B=(H-G)*(M-E);J=I+F;C=G+B}else{E=Math.floor(L);D=Math.ceil(L);I=this.getSizeForZoom(this.model,A+E).width;G=this.getSizeForZoom(this.model,A+E).height;K=this.getSizeForZoom(this.model,A+D).width;H=this.getSizeForZoom(this.model,A+D).height;F=(I-K)*(L-E);B=(G-H)*(L-E);J=I-F;C=G-B}return{width:J,height:C}},setPosLayer:function(D,A){var B,C;B=((D.width*A.cox)*-1)+(this.opts.mapWidth/2);C=((D.height*A.coy)*-1)+(this.opts.mapHeight/2);D.moveTo(B,C)},setPosAndShow:function(A){var B=this;this.setPosLayer(this.getCurrentLayer(),A);if(A.oldMapType&&A.oldMapType!==A.mapType){$.each(this.tileLayerList,function(C,D){D.removeAllTiles()})}if(A.oldTileLayers){$.each(A.oldTileLayers,function(D,E){var C=false;$.each(A.tileLayers,function(F,G){if(G.id===E.id){C=true;return false}});if(!C){$.each(B.tileLayerList,function(F,G){G.removeAllTilesPart(G.IMG_ID_PART_USER+E.id)})}})}this.showTileLayer()},showTileLayer:function(){var C,A,B=this.tileLayerList.length;for(C=0;C<B;C+=1){A=this.tileLayerList[C];if(C===this.model.zIdx){A.showZ();this.displayTiles()}else{A.hideZ();if(C!==this.model.oldZIdx){A.removeAllTiles()}}}},showTileLayerHideOthers:function(C,D){var E,A,B=this.tileLayerList.length;for(E=0;E<B;E+=1){A=this.tileLayerList[E];if(E===C){A.showZ();A.showMe()}else{if(E===D){A.showBelow();A.showMe()}else{A.hideZ();A.hide2()}}}},displayTiles:function(){var A=this.getVisibleTiles();this.getCurrentLayer().displayTiles(this.model,A.minI,A.maxI,A.minJ,A.maxJ,A.eta)},getSizeForZoom:function(B,C){var A=parseFloat(B.mapWidthLevel1Pixel/(Math.pow(2,B.zoomArrayCent[C]-1)));return{width:A,height:A}},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(A){return this.tileLayerList[A]},getVisibleTiles:function(){var F,I,A,G,B,H,C,E,D,J=this.opts.extraTilesAround;F=this.opts.tileWidth;I=this.opts.tileHeight;D=this.getCurrentLayer();A=Math.floor((-D.x/F))-J;G=Math.floor(((-D.x+this.opts.mapWidth)/F))+J;B=Math.floor((-D.y/I))-J;H=Math.floor(((-D.y+this.opts.mapHeight)/I))+J;A=(A<0)?0:A;B=(B<0)?0:B;C=(D.width/F)-1;E=(D.height/I)-1;G=(G>C)?C:G;H=(H>E)?E:H;return{minI:A,maxI:G,minJ:B,maxJ:H,eta:J}}};SEAT.LayerBase=function(){};SEAT.LayerBase.prototype={init:function(){},setViewMap:function(A){this.viewMap=A},setContMap:function(A){this.contMap=A},setPGMappy:function(A){this.pgMappy=A},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 A,B=this,C=$.grep(this.viewMap.opts.compassImgs,function(D,E){return(D.lng===B.viewMap.opts.lng)});if(C.length>0){A=C[0].imgs;$.each(A,function(D,E){SEAT.Compass.POINTS[D][1]=E[0];SEAT.Compass.POINTS[D][2]=E[1];SEAT.Compass.POINTS[D][3]=C[0].urlPfx+E[2]})}},exists:function(){return($("."+this.getIdPfx()+"cls","#"+this.viewMap.opts.nameContainer).length>0)},addCompass:function(){var A=this;this.lingua=this.viewMap.opts.lng||0;if(!this.exists()){$.each(SEAT.Compass.POINTS,function(C,B){A.addCompassPoint(B[0],B[1],B[2],B[3])});this.posCompass();this.addObservers()}},addCompassPoint:function(C,B,G,A){var E=this.getIdPfx()+C,D='<div id="'+E+'"><span style="position:relative"><p style="position:relative;margin:0px;padding:0px;width:'+B+"px;height:"+G+'px;"></p></span></div>';$("#"+this.viewMap.opts.nameContainer).append(D);$("#"+E).css({width:B,height:G,position:"absolute",zIndex:"999",cursor:"pointer"}).addClass(this.viewMap.opts.classNoPrint).addClass(this.getIdPfx()+"cls");var F=$("#"+E).find("p").get(0);SEAT.PGUtil.addBckImg(F,A,"no-repeat")},getIdPfx:function(){return this.viewMap.opts.nameContainer+"_comp_"},posCompass:function(){var C,A,F,E,G,B,D,H=this;$.each(SEAT.Compass.POINTS,function(I,J){C=J[0];A=J[1];F=J[2];E=$("#"+H.getIdPfx()+C,"#"+H.viewMap.opts.nameContainer);G=(H.viewMap.opts.mapWidth/2)-(A/2);B=(H.viewMap.opts.mapHeight/2)-(F/2);D={};if(C==="n"){D.top=0;D.left=G}else{if(C==="s"){D.bottom=0;D.left=G}else{if(C==="e"){D.right=0;D.top=B}else{if(C==="w"){D.left=0;D.top=B}else{if(C==="ne"){D.top=0;D.right=0}else{if(C==="nw"){D.top=0;D.left=0}else{if(C==="se"){D.bottom=0;D.right=0}else{if(C==="sw"){D.bottom=0;D.left=0}}}}}}}}E.css(D)})},addObservers:function(){var C,H,E,F,D,A,G,B=this;$.each(SEAT.Compass.POINTS,function(I,J){C=J[0];H=$("#"+B.getIdPfx()+C,"#"+B.viewMap.opts.nameContainer);H.bind("mousedown",function(K){return false});H.bind("click",function(K){D=this.id.split("_");A=D[D.length-1];G=$.grep(SEAT.Compass.POINTS,function(L){return L[0]===A})[0];B.viewMap.panMapBy((B.viewMap.opts.mapWidth/2)*G[4],(B.viewMap.opts.mapHeight/2)*G[5]);return false})})},removeObservers:function(){var A=this;$.each(SEAT.Compass.POINTS[A.lingua],function(C,B){$("#"+A.getIdPfx()+B[0],"#"+A.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 A=this;this.mouseStopped=false;$(document.body).bind("mousemove",function(B){if(A.mouseStopped){A.eventFire("mouserestart",{});A.mouseStopped=false}if(A.timeout){clearTimeout(A.timeout)}A.timeout=setTimeout(function(){var C=A.calcP(B);A.eventFire("mousestopped",C);A.mouseStopped=true},500)})},calcP:function(E){var C=this.viewMap.getMapContainerPos();var A={};var B=E.pageX||(E.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var D=E.pageY||(E.clientY+(document.documentElement.scrollTop||document.body.scrollTop));if($.browser.msie){A={x:B-C.x-2,y:D-C.y-2}}else{A={x:B-C.x,y:D-C.y}}return A},remove:function(){$(document.body).unbind("mousemove")}};SEAT.PGUtil.augment(SEAT.PGMouseMove,SEAT.LayerBase);SEAT.PGUtil.augment(SEAT.PGMouseMove,SEAT.EventMgr);SEAT.PGMappy=function(A){var B=this;$(window).unload(function(){B.unloadMe()});this.map=new SEAT.Map(A);this.pointList=new PGPointList();this.pgLineList=new PGLineList();this.pgPolygonList=new SEAT.PGPolygonList();this.pgCircleList=new SEAT.PGCircleList();this.viewRoute=new SEAT.ViewRoute(B);this.viewRouteFormat=new SEAT.ViewRouteFormat(B);this.addLayer(this.pointList);this.addLayer(this.viewRoute);this.addLayer(this.viewRouteFormat);this.addLayer(this.pgLineList);this.addLayer(this.pgPolygonList);this.addLayer(this.pgCircleList);if(!A.radarParent){this.addLayer(new SEAT.PGMouseMove())}this.startUp();this.addPGTileLayers()};SEAT.PGMappy.prototype={getVersion:function(){return"2.3.8"},unloadMe:function(){this.map=null;this.pointList=null;this.pgLineList=null;this.pgPolygonList=null;this.pgCircleList=null;this.viewRoute=null;this.viewRouteFormat=null;this.mouseMoveHandler=null},startUp:function(){this.map.startUp()},addLayer:function(A){A.setPGMappy(this);this.map.addLayer(A)},removeLayer:function(A){if(A){this.map.removeLayer(A)}},addTileLayer:function(A){this.map.addTileLayer(A)},removeTileLayer:function(A){this.map.removeTileLayer(A)},addCompass:function(){var A=new SEAT.Compass();this.map.addLayer(A);A.addCompass()},setQuality:function(A){this.map.setQuality(A)},pointAdder:function(A){this.pointList.pointAdder(A)},removePoint:function(A){this.pointList.removePoint(A)},removeAllPoints:function(){this.pointList.removeAllPoints()},setDisabledZoom:function(A){this.map.setDisabledZoom(A)},getDisabledZoom:function(){return this.map.getDisabledZoom()},getZoom:function(){return{z:this.map.getZoom(),zDist:this.map.getZoomDist()}},checkZoomValue:function(A){return this.map.checkZoomValue(A)},setZoomStart:function(A){this.map.setZoomStart(A)},setZoomStep:function(A){this.map.setZoomStep(A)},setZoomEnd:function(A){this.map.setZoomEnd(A)},setZoom:function(A){this.map.setZoom(A)},zoomIn:function(){this.map.zoomIn()},zoomOut:function(){this.map.zoomOut()},setSize:function(B,A){this.map.setSize(B,A)},getSize:function(){return this.map.getSize()},setLng:function(A){this.map.setLng(A)},getLng:function(){return this.map.getLng()},setMapType:function(A){this.map.setMapType(A)},getMapType:function(){return this.map.getMapType()},addStreetViewLayer:function(){this.addTileLayer(this.tileLayerStreet)},removeStreetViewLayer:function(){this.removeTileLayer(this.tileLayerStreet)},setTileOverLayers:function(A){if(A&PGMAP_TILE_OVER_STREET){this.addStreetViewLayer()}else{this.removeStreetViewLayer()}this.map.setTileOverLayers(A)},getTileOverLayers:function(){return this.map.getTileOverLayers()},setActionType:function(A){this.map.setActionType(A)},panMapBy:function(B,A){this.map.panMapBy(B,A)},panMapTo:function(A,B){this.map.panMapTo(A,B)},getUpdated:function(){return this.map.getUpdated()},setUpdated:function(A){this.map.setUpdated(A)},setCenter:function(A,B){this.map.setCenter(A,B)},getCenter:function(){return this.map.getCenter()},setCenterPoint:function(A){this.setCenter(A.lon,A.lat)},setCenterAndZoom:function(D,B,A){var C;if(arguments.length===0){if((this.pointList).pointList.length>0){C=this.getRouteCenter((this.pointList).pointList);this.setCenterAndZoom(C.lon,C.lat,C.z)}}else{this.map.setCenterAndZoom(D,B,A)}},adaptToPoints:function(D){var B=new PGPointList(),C;if(D.length>0){for(var A=0;A<D.length;A++){B.pointList.push(D[A])}C=this.getRouteCenter(B.pointList);this.setCenterAndZoom(C.lon,C.lat,C.z)}},getRouteCenter:function(L){var B=[];var D=[];$.each(L,function(N,O){B.push(O.lon);D.push(O.lat)});var C=SEAT.PGUtil.latLong2UTM(B.min(),D.min(),this.map.getZone());var K=SEAT.PGUtil.latLong2UTM(B.max(),D.max(),this.map.getZone());var G=B.min()+((+B.max()-B.min())/2);var J=D.min()+((+D.max()-D.min())/2);var H=K.x-C.x;var I=K.y-C.y;var F=parseFloat(H*430/(1609.3*(this.map.getSize().width-40)));var A=parseFloat(I*430/(1609.3*(this.map.getSize().height-40)));var M=(F>A)?F:A;var E=this.map.getZoomIndex(M);return{lon:G,lat:J,z:E}},getLonLatFromPixel:function(B,A){return this.map.getLonLatFromPixel(B,A)},getPixelFromLonLat:function(A,B){return this.map.getPixelFromLonLat(A,B)},pixelsBetweenTwoLonLats:function(A,B){return this.map.pixelsBetweenTwoLonLats(A,B)},getMapBounds:function(){return this.map.getMapBounds()},disableMap:function(){this.map.disableMap()},enableMap:function(){this.map.enableMap()},disableWheelZoom:function(){this.map.disableWheelZoom()},enableWheelZoom:function(){this.map.enableWheelZoom()},pgLineAdder:function(A){this.pgLineList.pgLineAdder(A)},removeLine:function(A){this.pgLineList.removeLine(A)},removeAllPGLines:function(){this.pgLineList.removeAllPGLines()},pgPolygonAdder:function(A){this.pgPolygonList.pgPolygonAdder(A)},pgCircleAdder:function(A){this.pgCircleList.pgCircleAdder(A)},pgPointAndCircleAdder:function(B,A){this.pointList.pointAdder(B);A.center=B;this.pgCircleList.pgCircleAdder(A)},removeAllPGPolygons:function(){this.pgPolygonList.removeAllPGPolygons()},preventMapMouseDown:function(){this.map.preventMapMouseDown()},getRoute:function(B,A){this.viewRoute.getRoute(B,A)},getRouteFormat:function(B,A){this.viewRouteFormat.getRoute(B,A)},addRoute:function(A){this.viewRoute.addRoute(A)},addRouteWithParams:function(A){this.viewRoute.addRouteWithParams(A)},addRouteFormat:function(A){this.viewRouteFormat.addRoute(A)},removeRoute:function(A){this.viewRoute.removeRoute(A)},removeRouteFormat:function(A){this.viewRouteFormat.removeRoute(A)},removeAllRoutes:function(){this.viewRoute.removeAllRoutes()},removeAllRouteFormats:function(){this.viewRouteFormat.removeAllRoutes()},setRouteUpToStep:function(A,B){this.viewRoute.setUpToStep(A,B)},addRadar:function(A){this.map.addRadar(A)},moveToCoeff:function(A,B){this.map.moveToCoeff(A,B)},eventRegisterPre:function(C,A,B){this.map.eventRegisterPre(C,A,B)},eventRegisterPost:function(C,A,B){this.map.eventRegisterPost(C,A,B)},eventRegister:function(C,A,B){this.map.eventRegister(C,A,B)},eventDeRegisterPre:function(A,B){this.map.eventDeRegisterPre(A,B)},eventDeRegisterPost:function(A,B){this.map.eventDeRegisterPost(A,B)},eventDeRegister:function(A,B){this.map.eventDeRegister(A,B)},addPGTileLayers:function(){var A=this;this.tileLayerStreet=new PGTileLayer();this.tileLayerStreet.getTileUrl=function(C){var B=A.map.getOpts().imgHost||"http://visualimages"+((C.i%2)+1)+".paginegialle.it";return(B+"/streetview_get.php?x="+C.i+"&y="+C.j+"&z="+C.z+"&c="+A.map.getOpts().streetColour)};this.tileLayerStreet.getOpacity=function(C){var B=1;if(A.map.getZoom()<PGMAP_ZOOM_REGION_INTER_ITALY){if(jQuery.browser.msie&&parseFloat(jQuery.browser.version)<7){}else{B=0.5}}return B};this.tileLayerStreet.getIsPng=function(){return true};this.tileLayerStreet.getZIndex=function(){return 120}}};PGMappy=SEAT.PGMappy;PGPOINT_TYPE_CLIENT=1;PGPOINT_TYPE_NONCLIENT=2;PGPoint=function(A){var B=this;this.j=$.extend({offsetX:0,offsetY:0},A);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;$(window).unload(function(){B.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(A){this.model=A},initPoint:function(){var A=SEAT.PGUtil.calcCoefficients(this.lon,this.lat,this.model.mapWidthMeters,this.model.mapCentreUTMEasting,this.model.mapCentreUTMNorthing,this.model.zone);this.cox=A.cox;this.coy=A.coy},initVals:function(C,B,A){this.parent=C;this.viewMap=B;this.i=A},initOpened:function(){var A=this.j.opened;if(A){this.j.opened=$.extend({},{offsetX:0,offsetY:0,moveOpen:{left:10,right:10,top:10,bot:10}},A)}},drawPoint:function(){var F,B,G,J,I,H,D,K,E;var A=this.viewMap.opts.nameContainer+"_point_"+this.i;this.id=A;if($("#"+A).length===0){var C=this.j.zIndex||"250";F='<div id="'+A+'"></div>';this.dPoint=$(F).attr({title:this.j.title||""}).css({position:"absolute",overflow:this.j.overflow||"hidden",zIndex:C}).appendTo("#"+this.viewMap.tileLayerMgr.getCurrentLayer().id);if(this.j.html&&this.j.html!==""){this.dPoint.html(this.j.html);B=this.j.width||null;G=this.j.height||null;if(B===null||G===null){J=$(this.dPoint.children().get(0));B=B||parseInt(J.width(),10);G=G||parseInt(J.height(),10)}this.pointWidth=parseInt(B,10);this.pointHeight=parseInt(G,10);this.dPoint.css({width:this.pointWidth,height:this.pointHeight})}else{B=40;G=32;I="#FFF";H="http://img.tuttocitta.it/nuovotcol/img/png/icoCliente.png";if(this.j.typ&&this.j.typ===PGPOINT_TYPE_NONCLIENT){B=36;G=30;I="#323B96";H="http://img.tuttocitta.it/nuovotcol/img/png/icoNoCliente.png"}this.dPoint.css({textAlign:"center",width:B,height:G});D="<div></div>";K=$(D).css({textAlign:"center",width:B,height:G}).appendTo(this.dPoint);SEAT.PGUtil.addBckImg(K.get(0),H,"no-repeat top left");E="<span></span>";$(E).css({padding:"8px 0px 0px 0px",textAlign:"center",color:I,fontWeight:"bold",fontSize:"11px",textDecoration:"none",fontFamily:"arial, verdana",display:"block",width:B,height:G,position:"relative",zIndex:"251"}).attr({title:this.j.title||""}).html(this.j.txt||"").appendTo(K);this.pointWidth=B;this.pointHeight=G}this.createObserverPoint()}},addDragDrop:function(){var A=this;this.destroyObserverPoint();this.dragDropAdd(this.id,{dragBefore:function(B){A.dragBefore(B)},dragging:function(B){A.dragging(B)},dragAfter:function(B){A.dragAfter(B)}})},removeDragDrop:function(){this.dragDropRemove();this.eventDeRegister("dragbefore");this.eventDeRegister("dragging");this.eventDeRegister("dragafter");this.createObserverPoint()},dragBefore:function(A){this.eventFire("dragbefore",{e:A.e,id:this.j.id,lon:this.lon,lat:this.lat})},dragging:function(A){this.eventFire("dragging",{e:A.e,id:this.j.id,chgX:A.chg.x,chgY:A.chg.y})},dragAfter:function(A){if(A.chg.x!==0||A.chg.y!==0){this.movePointChg(A.chg.x,A.chg.y);this.eventFire("dragafter",{e:A.e,id:this.j.id,chgX:A.chg.x,chgY:A.chg.y,lon:this.lon,lat:this.lat})}},movePointChg:function(C,A){var B=this.getLonLat(C,-A);this.lon=B.lon;this.lat=B.lat;this.setModel(this.model);this.initPoint()},getLonLat:function(C,A){var B=SEAT.PGUtil.pixelLatLongPoint(C,A,this.lon,this.lat,parseFloat(this.model.zoomArray[this.model.zIdx]),this.model.zone);return{lon:B.lon,lat:B.lat}},setLonLat:function(A,B){this.lon=A;this.lat=B;this.initPoint();this.posPoint()},posPoint:function(){var A=this.getPos(this.viewMap);this.pxX=(A.x-(this.pointWidth/2))+this.j.offsetX;this.pxY=(A.y-(this.pointHeight))+this.j.offsetY;this.dPoint.css({left:this.pxX+"px",top:this.pxY+"px"});if(this.bigVisible){this.dispBig()}},getPos:function(A){var D=A.tileLayerMgr.getCurrentLayer(),B=D.getLeftPos(this.cox),C=D.getTopPos(this.coy);return{x:B,y:C}},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(A){var F,E,B,C;this.customBigHTML=(A)?true:false;var D=this.viewMap.opts.nameContainer+"_pointBig_"+this.i;if($("#"+D,"#"+this.viewMap.opts.nameContainer).length===0){F="<div></div>";this.dPointBig=$(F).attr({id:D}).css({position:"absolute",overflow:this.j.opened.overflow||"hidden",zIndex:"300"}).appendTo("#"+this.viewMap.tileLayerMgr.getCurrentLayer().id);this.hideBig();if(this.customBigHTML){this.dPointBig.html(A)}else{E='<div id="'+D+'_d1"><div id="'+D+'_d2"></div><div id="'+D+'_d3"><div id="'+D+'_d4"><table><tbody><tr><td><div id="'+D+'_d5"></div><div id="'+D+'_d6"><div id="'+D+'_d7"><div id="'+D+'_a1"><img id="'+D+'_i1"></img></div></div></div></td></tr></tbody></table></div></div><div id="'+D+'_d8"></div></div>';this.dPointBig.append(E);$("#"+D+"_d1").css({position:"absolute",zIndex:"300",fontFamily:"arial, verdana, georgia, helvetica, sans-serif",fontSize:"11px"});$("#"+D+"_d2").css({width:"307px",height:"31px",padding:"0px 3px 0px 3px"});SEAT.PGUtil.addBckImg($("#"+D+"_d2").get(0),"http://img.tuttocitta.it/nuovotcol/img/fumetti/bgHeaderAltri.png","no-repeat top left","");$("#"+D+"_d3").css({width:"307px"});SEAT.PGUtil.addBckImg($("#"+D+"_d3").get(0),"http://img.tuttocitta.it/nuovotcol/img/fumetti/bgContentAltri.png","","sizingMethod=scale");$("#"+D+"_d4").css({width:"301px",marginLeft:"2px",background:"url(http://img.tuttocitta.it/nuovotcol/img/fumetti/fondinoAltri.gif)"});$("#"+D+"_d5").css({margin:"0px",padding:"0px",fontSize:"11px"});$("#"+D+"_d6").css({margin:"10px 0px 0px 0px",padding:"0px"});this.idClose=D+"_d7";$("#"+this.idClose).css({position:"absolute",top:"7px",right:"10px"});$("#"+D+"_a1").attr({cursor:"pointer",title:"Close"});$("#"+D+"_i1").attr({height:"14px",width:"14px",alt:"Close",border:"0",src:"http://img.tuttocitta.it/nuovotcol/img/fumetti/icoChiudiFumetto.gif"});$("#"+D+"_d8").css({width:"307px",height:"7px",position:"relative",fontSize:"0"});SEAT.PGUtil.addBckImg($("#"+D+"_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("#"+D+"_d5")}if(this.j.opened.info){B=(SEAT.PGUtil.isArray(this.j.opened.info))?this.j.opened.info:[this.j.opened.info];$.each(B,function(G,H){$("<p></p>").css({fontWeight:"normal",margin:"0 0 2px 0",padding:"0",color:"#333"}).html(H).appendTo("#"+D+"_d5")})}}if(!this.j.opened.autoSize){C=$(this.dPointBig.children(0));this.dPointBig.css({width:C.width(),height:C.height()})}}},createObserverPoint:function(){var A=this;if(this.j.opened){this.evPointMouseDown=function(B){A.parent.viewMap.myParent.preventMapMouseDown()};this.evPointClick=function(B){A.eventFire("click",{event:B,id:A.j.id});A.onClickPoint(B);return false};this.dPoint.bind("mousedown",this.evPointMouseDown).bind("click",this.evPointClick).css({cursor:"pointer"})}else{this.evPointClick=function(B){A.eventFire("click",{event:B,id:A.j.id})};this.dPoint.bind("click",this.evPointClick)}this.dPoint.hover(function(B){A.eventFire("mouseover",{event:B,id:A.j.id})},function(B){A.eventFire("mouseout",{event:B,id:A.j.id})}).dblclick(function(B){A.eventFire("dblclick",{event:B,id:A.j.id});return false})},destroyObserverPoint:function(){var A=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 D=this,A=this.dPointBig,C,B="#"+this.viewMap.tileLayerMgr.getCurrentLayer().id;if(this.j.opened.closeID&&$("#"+this.j.opened.closeID,B).length>0){C=$("#"+this.j.opened.closeID,B)}else{if(this.customBigHTML){C=A}else{C=$("#"+this.idClose,B)}}A.css({cursor:"auto"});C.css({cursor:"pointer"});this.evBigMouseDown=function(E){return false};this.evBigClick=function(E){D.onCloseBig(E);return false};A.bind("mousedown",this.evBigMouseDown);C.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(A){this.openBig()},openBig:function(){var A;this.eventFire("openbefore",{id:this.j.id});this.parent.closeOpenPoints();if(this.j.opened){this.initOpened();if(this.j.opened.html){this.addOpener(this.j.opened.html)}else{if(this.j.opened.onOpen){A=this.j.opened.onOpen.call(this.j.opened.onOpen,this.j.opened.onOpenParams);this.addOpener(A)}else{this.addOpener()}}}this.bigVisible=true;this.destroyObserverPoint();this.dispBig();this.createObserverBig();this.makeBigVisible();this.eventFire("openafter",{id:this.j.id})},makeBigVisible:function(){var G=0,H=0,E=this.viewMap.tileLayerMgr.getCurrentLayer(),I={x:E.cssX,y:E.cssY},A=parseFloat(this.dPointBig.css("left")),F=A+parseFloat(this.dPointBig.width()),C=parseFloat(this.dPointBig.css("top")),D=C+parseFloat(this.dPointBig.height()),B=this.j.opened.moveOpen;if(A<((I.x*-1)+B.left)){G=(I.x*-1)-A+B.left}else{if(F>((I.x*-1)+this.viewMap.opts.mapWidth-B.right)){G=((I.x*-1)+this.viewMap.opts.mapWidth)-F-B.right}}if(C<((I.y*-1)+B.top)){H=(I.y*-1)-C+B.top}else{if(D>((I.y*-1)+this.viewMap.opts.mapHeight-B.bot)){H=((I.y*-1)+this.viewMap.opts.mapHeight)-D-B.bot}}if(G!==0||H!==0){this.viewMap.panMapBy(G,H)}},onCloseBig:function(A){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 B,C,D=this.getPos(this.viewMap),A=parseInt(this.dPointBig.width(),10),E=parseInt(this.dPointBig.height(),10);if(this.j.opened.relX){if(this.j.opened.relX==="m"){B=D.x-(A/2)}else{if(this.j.opened.relX==="r"){B=D.x-A}else{B=D.x}}}else{B=(this.j.opened.left)?D.x:D.x-(A/2)}if(this.j.opened.relY){if(this.j.opened.relY==="m"){C=D.y-(E/2)}else{if(this.j.opened.relY==="b"){C=D.y-E}else{C=D.y}}}else{if(this.j.opened.top){C=D.y}else{if(this.customBigHTML){C=D.y-(E/2)}else{C=D.y-E-5}}}B+=this.j.opened.offsetX;C+=this.j.opened.offsetY;this.dPointBig.css({left:B,top:C})},hideBig:function(){this.dPointBig.css({left:-9999})},movePoint:function(A){this.dPoint.appendTo("#"+A);if(this.dPointBig){this.dPointBig.appendTo("#"+A)}}};SEAT.PGUtil.augment(PGPoint,SEAT.EventMgr);SEAT.PGUtil.augment(PGPoint,SEAT.DragDropMgr);PGPointList=function(){var A=this;this.pointList=[];this.i=0;$(window).unload(function(){A.unloadMe()})};PGPointList.prototype={unloadMe:function(){this.pointList=null;this.viewMap=null;this.contMap=null;this.pgMappy=null},pointAdder:function(A){A.initVals(this,this.viewMap,this.i+=1);this.pointList.push(A);A.setModel(this.model);A.initPoint();A.drawPoint(this.viewMap);A.posPoint(this.viewMap)},removePoint:function(A){A.removePoint();this.pointList=$.grep(this.pointList,function(B,C){return B!==A})},removeAllPoints:function(){$.each(this.pointList,function(A,B){B.removePoint()});this.pointList=[]},setModelPoints:function(){var A=this;$.each(this.pointList,function(C,B){B.setModel(A.model)})},drawPoints:function(){var A=this;$.each(this.pointList,function(C,B){B.drawPoint(A.viewMap)})},posPoints:function(){var A=this;$.each(this.pointList,function(C,B){B.posPoint(A.viewMap)})},closeOpenPoints:function(){$.each(this.pointList,function(A,B){B.closeBig()})},updateMap:function(A){this.model=A;if(A.transType&&A.transType==="zoom"){if(A.startTrans){this.closeOpenPoints()}else{if(A.stepTrans){this.posPoints()}else{if(A.endTrans){this.setModelPoints();this.checkChgZone(A.oldZone,A.zone);$.each(this.pointList,function(C,B){B.movePoint(this.viewMap.tileLayerMgr.getCurrentLayer().id);B.posPoint(this.viewMap)})}}}}else{if(A.transType&&A.transType==="pan"){}else{this.setModelPoints();if(this.checkChgZone(A.oldZone,A.zone)){this.posPoints()}if(!this.initDone){this.drawPoints();this.posPoints()}}}this.initDone=true},checkChgZone:function(C,B){var A=false;if(C&&(C!==B)){$.each(this.pointList,function(D,E){E.initPoint()});A=true}return A}};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(A){var B=this;if(A&&A.points&&(A.points[0].x||A.points[0].x===0)){this.pixelArray=A.points}else{this.points=A.points}this.id=A.id;this.rgb=A.rgb||{r:120,g:120,b:255};this.opacity=A.opacity||null;$(window).unload(function(){B.unloadMe()})},initVals:function(G,E,B,C){var D,F,A;this.graphicsMgr=G;this.viewMap=B;this.parent=C;if(this.points){for(D=0;D<this.points.length;D+=1){this.points[D].setModel(E);this.points[D].initPoint()}}else{if(this.pixelArray&&this.pixelArray.length>0){F=B.getMapPos();A=B.tileLayerMgr.getCurrentLayer();for(D=0;D<this.pixelArray.length;D+=1){this.pixelArray[D].cox=(-F.x+this.pixelArray[D].x)/A.width;this.pixelArray[D].coy=(-F.y+this.pixelArray[D].y)/A.height}}}},drawShape:function(H,B){var I,D,E,F,A;var C=[];if(this.pixelArray){var J=this.observed;var G=this.viewMap.getMapPos();A=this.viewMap.tileLayerMgr.getCurrentLayer();$.each(this.pixelArray,function(K,L){C.push({x:A.getLeftPos(L.cox)-B.x,y:A.getTopPos(L.coy)-B.y,i:L.i});if(J){L.x=A.getLeftPos(L.cox)+G.x;L.y=A.getTopPos(L.coy)+G.y}});this.drawShapePortions(C)}else{if(this.points){for(I=0;I<this.points.length;I+=1){D=this.points[I].getPos(this.viewMap).x;E=this.points[I].getPos(this.viewMap).y;F={x:D-B.x,y:E-B.y};if(I===0){$.extend(F,{i:1})}C.push(F)}this.drawShapePortions(C)}}},drawShapePortions:function(A){}};var PGLine=function(A){this.initShape(A);this.lineWidth=A.lineWidth||10};PGLine.prototype={eventRegisterPost:function(C,A,B){this.observed=true;if(this.listenerList.length===1){PGMouseMove.eventRegister("mousestopped",this.mouseOverLine,this)}},eventDeRegisterPost:function(C,A,B){if(this.listenerList.length===0){this.observed=false;PGMouseMove.eventDeRegister("mousestopped",this.mouseOverLine,this)}},drawShapePortions:function(A){var E,B,C,D=[];B=A.length;for(E=0;E<B;E+=1){C=A[E];if(E===0||C.i===1){D=[]}D.push(C);if((E+1>=A.length)||(A[E+1].i===1)){this.graphicsMgr.drawLine(D,this.rgb,this.lineWidth,this.opacity)}}},mouseOverLine:function(D){var B=false;if(this.pixelArray){for(var F=0;F<this.pixelArray.length-1;F++){B=SEAT.PGUtil.isPointInLine(this.pixelArray[F].x,this.pixelArray[F].y,this.pixelArray[F+1].x,this.pixelArray[F+1].y,D.x,D.y,this.lineWidth);if(B){this.eventFire("mouseoverline",{id:this.id,p:D});break}}}else{if(this.points){var A=this.viewMap.getMapPos();for(var F=0;F<this.points.length-1;F++){var C=this.points[F].getPos(this.viewMap);var E=this.points[F+1].getPos(this.viewMap);B=SEAT.PGUtil.isPointInLine((C.x+A.x),(C.y+A.y),(E.x+A.x),(E.y+A.y),D.x,D.y,this.lineWidth);if(B){this.eventFire("mouseoverline",{id:this.id,p:D});break}}}}return B},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(A){if(A){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgline")}this.addLine(A);this.prepareForDrawing();A.drawShape(this.posOffset,this.delta)}},prepareForDrawing:function(){var B=this.viewMap.tileLayerMgr.getCurrentLayer();var A=this.viewMap.opts;this.posOffset={beforeX:A.extraPixels.hor,afterX:A.extraPixels.hor,beforeY:A.extraPixels.ver,afterY:A.extraPixels.ver};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.cssX-this.posOffset.beforeX),y:(-B.cssY-this.posOffset.beforeY)};this.graphicsMgr.posCanvas(this.delta.x,this.delta.y)},addLine:function(A){if(A){A.initVals(this.graphicsMgr,this.model,this.viewMap);this.pgLineList.push(A)}},removeLine:function(A){this.pgLineList=$.grep(this.pgLineList,function(B){if((B.id&&B.id===A)){B.remove()}return(!B.id||(B.id&&B.id!==A))});if(this.graphicsMgr&&(this.pgLineList===null||this.pgLineList.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawLines()}},removeAllPGLines:function(){for(var A=0;A<this.pgLineList.length;A++){this.pgLineList[A].remove()}this.pgLineList=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}},drawLines:function(){var A=this;if(this.pgLineList.length>0){this.graphicsMgr.clearCanvas();this.prepareForDrawing();$.each(this.pgLineList,function(C,B){B.drawShape(A.posOffset,A.delta)})}},updateMap:function(A){this.model=A;if(A.transType&&A.transType==="zoom"){if(A.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(A.stepTrans){}else{if(A.endTrans){if(this.checkChgZone(A.oldZone,A.zone)){this.drawLines()}}}}}else{if(A.transType&&A.transType==="pan"){if(A.startTrans){}else{if(A.stepTrans){}else{if(A.endTrans){}}}}else{this.setModelPoints();this.checkChgZone(A.oldZone,A.zone);this.drawLines()}}},checkChgZone:function(C,B){var A=false;if(C&&(C!==B)){$.each(this.pgLineList,function(D,E){$.each(E.points,function(G,F){F.initPoint()})});A=true}return A},setModelPoints:function(){var A=this;$.each(this.pgLineList,function(C,B){$.each(B.points,function(E,D){D.setModel(A.model)})})}};SEAT.PGUtil.augment(PGLineList,SEAT.LayerBase);var PGPolygon=function(A){this.initShape(A);this.borderRgb=A.borderRgb||null;this.borderWidth=A.borderWidth||10;this.borderOpacity=A.borderOpacity||null};PGPolygon.prototype={drawShapePortions:function(A){if(this.borderRgb&&(this.borderRgb.r!==this.rgb.r||this.borderRgb.g!==this.rgb.g||this.borderRgb.b!==this.rgb.b)){A.push(A[0]);this.graphicsMgr.drawLine(A,this.borderRgb,this.borderWidth,this.borderOpacity)}this.graphicsMgr.drawPolygon(A,this.rgb,this.opacity)},remove:function(){if(this.id){this.parent.removePolygon(this.id)}}};SEAT.PGUtil.augment(PGPolygon,SEAT.PGShapeBase);SEAT.PGPolygonList=function(){var A=this;this.pgPolygonList=[];$(window).unload(function(){A.unloadMe()})};SEAT.PGPolygonList.prototype={unloadMe:function(){this.pgPolygonList=null;this.graphicsMgr=null},pgPolygonAdder:function(A){if(A){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgpolygon")}this.addPolygon(A);this.prepareForDrawing();A.drawShape(this.posOffset,this.delta)}},prepareForDrawing:function(){var B=this.viewMap.tileLayerMgr.getCurrentLayer();var A=this.viewMap.opts;this.posOffset={beforeX:A.extraPixels.hor,afterX:A.extraPixels.hor,beforeY:A.extraPixels.ver,afterY:A.extraPixels.ver};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.cssX-this.posOffset.beforeX),y:(-B.cssY-this.posOffset.beforeY)};this.graphicsMgr.posCanvas(this.delta.x,this.delta.y)},addPolygon:function(A){if(A){A.initVals(this.graphicsMgr,this.model,this.viewMap,this);this.pgPolygonList.push(A)}},removePolygon:function(A){this.pgPolygonList=$.grep(this.pgPolygonList,function(B){return(!B.id||(B.id&&B.id!==A))});if(this.graphicsMgr&&(this.pgPolygonList===null||this.pgPolygonList.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawPolygons()}},removeAllPGPolygons:function(){this.pgPolygonList=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}},drawPolygons:function(){var A=this;if(this.pgPolygonList.length>0){this.graphicsMgr.clearCanvas();this.prepareForDrawing();$.each(this.pgPolygonList,function(C,B){B.drawShape(A.posOffset,A.delta)})}},updateMap:function(A){this.model=A;if(A.transType&&A.transType==="zoom"){if(A.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(A.stepTrans){}else{if(A.endTrans){if(this.checkChgZone(A.oldZone,A.zone)){this.drawPolygons()}}}}}else{if(A.transType&&A.transType==="pan"){}else{this.setModelPoints();this.checkChgZone(A.oldZone,A.zone);this.drawPolygons()}}},checkChgZone:function(C,B){var A=false;if(C&&(C!==B)){$.each(this.pgPolygonList,function(D,E){$.each(E.points,function(G,F){F.initPoint()})});A=true}return A},setModelPoints:function(){var A=this;$.each(this.pgPolygonList,function(C,B){$.each(B.points,function(E,D){D.setModel(A.model)})})}};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="CBD";var PGROUTE_TYPE_CAR_NO_TOLL="CNT";var PGROUTE_TYPE_CAR_NO_ECOPASS="nep";var PGROUTE_TYPE_PUBLIC_TRANSPORT="pt";var PGROUTE_TRANS_PED=0;var PGROUTE_TRANS_CAR=1;var PGROUTE_TRANS_TRAM=2;var PGROUTE_TRANS_METRO=3;var PGROUTE_TRANS_RAIL=4;var PGROUTE_TRANS_BUS=5;var PGROUTE_TRANS_FERRY=6;var PGROUTE_TRANS_CABLE_CAR=7;var PGROUTE_TRANS_SUSP_CABLE_CAR=8;var PGROUTE_TRANS_FUNICULAR=9;var PGRoute=function(A){this.callPer(A)};PGRoute.prototype={callPer:function(B){var C=PGRouteUtil.getItnVal(B.itn),D="";if(B.extra){for(k in B.extra){v=B.extra[k];D+="&"+k+"="+encodeURIComponent(v)}}var E="x="+B.lon+"&y="+B.lat+"&z="+B.z+"&lx="+B.startLon+"&ly="+B.startLat+"&ex="+B.endLon+"&ey="+B.endLat+"&itn="+C+"&rt="+B.rt+"&xpix="+B.xpix+"&ypix="+B.ypix+"&dz="+(parseInt(B.xpix,10)/430)+"&serv="+(B.serv||"")+"&sito="+(B.sito||"")+"&chk="+(B.chk||"")+"&mode=tc&idx="+(B.idx||"")+"&zone="+(B.zone||"")+((B.minimap)?"&minimap="+B.minimap:"")+((B.coordsonly)?"&coordsonly="+B.coordsonly:"")+D+"&format=javascript,"+escape(B.onComplete)+((B.id&&B.id!="")?","+B.id:"");var A=(B.host||PGROUTE_URL)+"?"+E;$.getScript(A)}};var PGRouteUtil=function(){return{getMainImg:function(C,E,D){var B={xpix:500,ypix:500};D=$.extend(B,(D||{}));var A=PGROUTE_IMG_PREFIX+"?x="+C.initLon+"&y="+C.initLat+"&z="+SEAT.PGUtil.zoomArray[PGUtil.getZIdx(C.initZ)]+"&lx="+C.pStart.lon+"&ly="+C.pStart.lat+"&ex="+C.pEnd.lon+"&ey="+C.pEnd.lat+"&itn="+PGRouteUtil.getItnVal(PGRouteUtil.getItnArray(C.pItn))+"&rt="+C.rt+"&serv="+E.serv+"&xpix="+D.xpix+"&ypix="+D.ypix+"&dz="+(D.xpix/430)+"&om=1&fi=jpeg";return A},getStepImg:function(E,G,C,D,F){var B={xpix:300,ypix:300,z:0.6};F=$.extend(B,(F||{}));var A=PGROUTE_IMG_PREFIX+"?x="+G.rplan[C].rleg[D].x+"&y="+G.rplan[C].rleg[D].y+"&z="+F.z+"&lx="+E.pStart.lon+"&ly="+E.pStart.lat+"&ex="+E.pEnd.lon+"&ey="+E.pEnd.lat+"&itn="+PGRouteUtil.getItnVal(PGRouteUtil.getItnArray(E.pItn))+"&rt="+E.rt+"&serv="+G.serv+"&xpix="+F.xpix+"&ypix="+F.ypix+"&dz="+(F.xpix/430)+"&om=1&fi=jpeg";return A},getItnArray:function(B){var A=[];if(B&&SEAT.PGUtil.isArray(B)){$.each(B,function(D,C){A[A.length]={lon:C.lon,lat:C.lat}})}return A},getItnVal:function(A){var B="";if(A&&SEAT.PGUtil.isArray(A)){$.each(A,function(C,D){B+=D.lon+";"+D.lat+";"})}return B}}}();var PGROUTEFORMAT_URL="http://mdr-routing.paginegialle.it/route_px";var PGRouteFormat=function(A){this.callPer(A)};PGRouteFormat.prototype={callPer:function(B){var C="id="+B.id+"&x="+(B.lon||"")+"&y="+(B.lat||"")+"&z="+(B.z||"")+"&url="+B.url+"&xpix="+B.xpix+"&ypix="+B.ypix+"&viewport="+B.viewport+"&dz="+(parseInt(B.xpix,10)/430)+"&serv="+(B.serv||"")+"&test=api&format=javascript,"+escape(B.onComplete)+((B.id&&B.id!="")?","+B.id:"");var A=(B.host||PGROUTEFORMAT_URL)+"?"+C;$.getScript(A)}};SEAT.PGRouteCallback=function(){return{register:function(A,B){this.fn=A;this.scope=B},callback:function(B,A){this.fn.call(this.scope,B,A)}}}();SEAT.ViewRoute=function(A){this.parent=A;this.idNum=0;this.routeParamsA=[]};SEAT.ViewRoute.prototype={COORDSONLY:"yes",init:function(){var A=this;PGEvent.addListener(this.pgMappy,"mousedownbefore",function(B){A.mousedown=true});PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(B){A.mousedown=false})},getRoute:function(E,C){var D=PGRouteUtil.getItnArray(E.pItn);var A=this.viewMap.opts;this.pOff={b4X:A.extraPixels.hor,afX:A.extraPixels.hor,b4Y:A.extraPixels.ver,afY:A.extraPixels.ver};this.canvasWidth=this.pOff.b4X+A.mapWidth+this.pOff.afX;this.canvasHeight=this.pOff.b4Y+A.mapHeight+this.pOff.afY;E.idx=(E.idx)?E.idx+=1:1;var B={id:E.id,idx:E.idx,lon:(E.initLon&&!E.initDone)?E.initLon:this.model.lon,lat:(E.initLat&&!E.initDone)?E.initLat:this.model.lat,z:((E.initZ||E.initZ===0)&&!E.initDone)?this.model.zoomArray[this.viewMap.calcZIdx(E.initZ)]:this.model.zoomArray[this.model.zIdx],startLon:E.pStart.lon,startLat:E.pStart.lat,endLon:E.pEnd.lon,endLat:E.pEnd.lat,itn:D,rt:E.rt,xpix:this.canvasWidth,ypix:this.canvasHeight,serv:(E.serv||E.serv===0)?E.serv:"",sito:A.sito,host:E.host,mode:(E.mode||""),zone:this.model.zone,minimap:E.minimap,coordsonly:E.coordsonly,extra:E.extra,onComplete:C};new PGRoute(B)},addRoute:function(D){var G,A,F,B=false,C,E;if(D.length>0){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgroute")}F=D[0].routeParams;if((F.initLon&&F.initLat)||(F.initZ||F.initZ===0)){B=true}for(G=0;G<D.length;G+=1){A=D[G];E=A.routeParams.lineWidth;C=A.routeParams.opacity;$.extend(A.routeParams,{id:D[G].routeParams.id||"pgroute_"+(this.idNum+=1),serv:A.route.serv,initDone:1,updateDone:1,drawFirstTime:false,rgb:A.routeParams.rgb||{r:255,g:0,b:0},lineWidth:(E||E===0)?E:15,opacity:(C||C===0)?C:0.6,mezzi:A.routeParams.mezzi||[],upToStep:A.routeParams.upToStep||null,onRouteCall:A.routeParams.onRouteCall||function(){},onRouteRemove:A.routeParams.onRouteRemove||function(){},inizioTrattoCallback:A.routeParams.inizioTrattoCallback||function(){},route:A.route});this.routeParamsA.push(A.routeParams);if(!B){this.drawRoute(A.route,A.routeParams.id)}}if(B){this.firstTime=true;if(F.initLon&&F.initLat&&(F.initZ||F.initZ===0)){this.parent.setCenterAndZoom(parseFloat(F.initLon),parseFloat(F.initLat),parseInt(F.initZ,10))}else{if(F.initZ||F.initZ===0){this.parent.setZoom(parseInt(F.initZ,10))}else{this.parent.setCenter(parseFloat(F.initLon),parseFloat(F.initLat))}}}else{this.firstTime=false}}},addRouteWithParams:function(A){var B=this;this.saveRouteParams=A;SEAT.PGRouteCallback.register(B.afterRouteWithParams,B);this.getRoute(A,"SEAT.PGRouteCallback.callback")},afterRouteWithParams:function(B){var A=[{routeParams:this.saveRouteParams,route:B}];this.addRoute(A)},drawRoute:function(A,C){var E,D,F=[],H,B=this,G;E=$.grep(B.routeParamsA,function(I){return I.id===C})[0];if(E){if(parseInt(A.req.idx,10)===parseInt(E.idx,10)){E.updateDone=1;E.route=A;G=E.onRouteCall;G.call(G,E.id,A,E.changed,E)}else{return false}}if(!this.zooming&&this.getARoute()){this.drawAllRoutes()}},drawAllRoutes:function(){var F=this,B,E,C,D,A;if(this.routeParamsA.length>0){if(this.graphicsMgr){this.graphicsMgr.clearCanvas();B=this.viewMap.tileLayerMgr.getCurrentLayer();this.graphicsMgr.prepareCanvas(B.id,this.canvasWidth,this.canvasHeight);this.graphicsMgr.posCanvas(-B.cssX-this.pOff.b4X,-B.cssY-this.pOff.b4Y)}$.each(this.routeParamsA,function(H,I){var G;if(I.route.rplan.length>0&&!F.mousedown){F.drawPortions(I,I.route.rplan,I.rgb,I.lineWidth,I.opacity,I.mezzi,I.upToStep);if(I.doppioPercorso&&I.doppioPercorso==true){G=(I.limiteZoom||I.limiteZoom===0)?I.limiteZoom:-4;if(F.pgMappy.getZoom().z>G){E=I.rgb2||{r:255,g:255,b:255};C=I.lineWidth2>0?I.lineWidth2:11;D=(I.opacity2||I.opacity2===0)?I.opacity2:0.6;A=I.mezzi2||I.mezzi;F.drawPortions(I,I.route.rplan,E,C,D,A,I.upToStep)}}I.drawFirstTime=true}})}},drawPortions:function(Q,R,AI,AJ,AC,AG,S){var T,V,AH,N,M,W,Z,X,J,AA,j,AD=[],AB=0,U=0,K,P,AE,AF,L,O=3,Y,I;if(Q.adaptWidth){Y=this.pgMappy.getZoom().z;if(Y>=-1){I=Math.round(AJ*(13-Y)/13);AJ=(I>=O)?I:O;if(S){S.lineWidth=AJ}}}for(T=0;T<R.length;T+=1){N=R[T];$.merge(AD,N.steps_ends);U=0;K=0;for(V=0;V<N.steps_coords.length;V+=1){Z={rgb:AI,lineWidth:AJ,opacity:AC};M=parseInt(N.steps_coords[V],10);if(M>0){U+=M;W=parseInt(N.steps_type[V],10);$.each(AG,function(B,A){if(A.type===W){Z=A;return false}});P=0;AE=M;if(S){if(S.id>AD.length){P=M;AE=0}else{if((S.id>1)&&(S.id>(AB+1))){L=AD[S.id-2]+1;if(U<=L){P=M;AE=0}else{if(K<L){AE=U-L;P=M-AE}}}}}if(!Q.drawFirstTime){J=N.steps_desc[V];AA=N.steps_ll[V].x;j=N.steps_ll[V].y;X=Q.inizioTrattoCallback;X.call(X,J,AA,j,N,M,W)}AF=null;if(P>0){AF=N.coords[P-1];AH=N.coords.splice(0,P);this.graphicsMgr.drawLine(AH,S.rgb,S.lineWidth,S.opacity)}if(AE>0){AH=N.coords.splice(0,AE);if(AF!==null){AH.splice(0,0,AF)}this.graphicsMgr.drawLine(AH,Z.rgb,Z.lineWidth,Z.opacity)}K+=M}}AB+=N.steps_ends.length}},updateMap:function(A){var B=this;this.model=A;if(this.routeParamsA.length>0){if(A.transType&&A.transType==="zoom"){if(A.startTrans){this.zooming=true;if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(A.stepTrans){}else{if(A.endTrans){this.zooming=false;if(this.checkChgZone(A.oldZone,A.zone)){for(i=0;i<this.routeParamsA.length;i+=1){this.routeParamsA[i].zone=A.zone}redrawAllRoutes(true,this.COORDSONLY)}}}}}else{if(A.transType&&A.transType==="pan"){}else{if(!A.oldMapType){if(this.firstTime){this.drawAllRoutes()}else{this.redrawAllRoutes(true,this.COORDSONLY)}this.firstTime=false}}}}},checkChgZone:function(C,B){var A=false;if(C&&(C!==B)){A=true}return A},redrawAllRoutes:function(A,B){$.each(this.routeParamsA,function(C,D){D.updateDone=0;D.coordsonly=B;if(A){D.changed=false}});this.getARoute()},getARoute:function(){var C,A=true,B=this;SEAT.PGRouteCallback.register(B.drawRoute,B);for(C=0;C<this.routeParamsA.length;C+=1){if(this.routeParamsA[C].updateDone===0){this.getRoute(this.routeParamsA[C],"SEAT.PGRouteCallback.callback");A=false;break}}return A},removeRoute:function(A){var B=function(){};$.each(this.routeParamsA,function(C,D){if(D.id===A){B=D.onRouteRemove;return false}});B.call(B,A);this.routeParamsA=$.grep(this.routeParamsA,function(C){return(!C.id||(C.id&&C.id!==A))});if(this.graphicsMgr&&(this.routeParamsA===null||this.routeParamsA.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawAllRoutes()}},removeAllRoutes:function(){$.each(this.routeParamsA,function(A,B){var C=B.onRouteRemove;C.call(C,B.id)});this.routeParamsA=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}},setUpToStep:function(C,A,B){var D=this;$.each(this.routeParamsA,function(E,F){if(F.id===C){F.upToStep=A;D.redrawAllRoutes(true,B);return false}})}};SEAT.PGUtil.augment(SEAT.ViewRoute,SEAT.LayerBase);SEAT.PGRouteFormatCallback=function(){return{register:function(A,B){this.fn=A;this.scope=B},callback:function(B,A){this.fn.call(this.scope,B,A)}}}();SEAT.ViewRouteFormat=function(A){this.parent=A;this.routeParamsA=[]};SEAT.ViewRouteFormat.prototype={init:function(){var A=this;PGEvent.addListener(this.pgMappy,"mousedownbefore",function(B){A.mousedown=true});PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(B){A.mousedown=false})},getRoute:function(D,C){var A=this.viewMap.opts;this.pOff={b4X:A.extraPixels.hor,afX:A.extraPixels.hor,b4Y:A.extraPixels.ver,afY:A.extraPixels.ver};this.canvasWidth=this.pOff.b4X+A.mapWidth+this.pOff.afX;this.canvasHeight=this.pOff.b4Y+A.mapHeight+this.pOff.afY;var B={id:D.id,lon:(D.initDone)?this.model.lon:"",lat:(D.initDone)?this.model.lat:"",z:(D.initDone)?this.model.zoomArray[this.model.zIdx]:"",url:D.url,xpix:this.canvasWidth,ypix:this.canvasHeight,viewport:this.pOff.b4X+","+this.pOff.b4Y+","+(this.pOff.b4X+A.mapWidth)+","+(this.pOff.b4Y+A.mapHeight),serv:D.serv||"",onComplete:C};new PGRouteFormat(B)},addRoute:function(D){var F,A,E,C,B=false;if(D.length>0){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgrouteformat")}for(F=0;F<D.length;F+=1){A=D[F];$.extend(A.routeParams,{serv:A.route.serv,initDone:1,updateDone:1,rgb:A.routeParams.rgb||{r:255,g:0,b:0},lineWidth:A.routeParams.lineWidth||15,opacity:A.routeParams.opacity||0.6,route:A.route});this.routeParamsA.push(A.routeParams)}E=D[0].route.metadata;C=this.viewMap.getZoomIndex(parseFloat(E.zlevel));this.firstTime=true;this.parent.setCenterAndZoom(parseFloat(E.cx),parseFloat(E.cy),C)}},drawRoute:function(A,C){var E,D,F=[],G,B=this;E=$.grep(B.routeParamsA,function(H){return H.id===C})[0];E.updateDone=1;E.route=A;if(this.getARoute()){this.drawAllRoutes()}},drawAllRoutes:function(){var B,A=this;if(this.graphicsMgr){this.graphicsMgr.clearCanvas();B=this.viewMap.tileLayerMgr.getCurrentLayer();this.graphicsMgr.prepareCanvas(B.id,this.canvasWidth,this.canvasHeight);this.graphicsMgr.posCanvas(-B.cssX-this.pOff.b4X,-B.cssY-this.pOff.b4Y)}$.each(this.routeParamsA,function(C,D){if(D.route.rplan.length>0&&!A.mousedown){A.drawPortions(D.route.rplan,D.rgb,D.lineWidth,D.opacity)}})},drawPortions:function(C,G,B,H){var F,A,E,D;for(F=0;F<C.length;F+=1){E=[];D=C[F];G=D.color||G;B=(D.width||D.width===0)?D.width:B;H=(D.opacity||D.opacity===0)?D.opacity:H;for(A=0;A<D.coords.length;A+=1){E.push(D.coords[A])}this.graphicsMgr.drawLine(E,G,B,H)}},updateMap:function(A){var B=this;this.model=A;if(this.routeParamsA.length>0){if(A.transType&&A.transType==="zoom"){if(A.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(A.stepTrans){}else{if(A.endTrans){}}}}else{if(A.transType&&A.transType==="pan"){}else{if(!A.oldMapType){if(this.firstTime){this.drawAllRoutes()}else{this.redrawAllRoutes()}this.firstTime=false}}}}},redrawAllRoutes:function(){$.each(this.routeParamsA,function(A,B){B.updateDone=0});this.getARoute()},getARoute:function(){var D,A=true,B,C;B=this;C=null;C=function(F,E){B.drawRoute.call(B,F,E)};SEAT.PGRouteFormatCallback.register(B.drawRoute,B);for(D=0;D<this.routeParamsA.length;D+=1){if(this.routeParamsA[D].updateDone===0){this.getRoute(this.routeParamsA[D],"SEAT.PGRouteFormatCallback.callback");A=false;break}}return A},removeRoute:function(A){this.routeParamsA=$.grep(this.routeParamsA,function(B){return(!B.id||(B.id&&B.id!==A))});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,PGGEO_CD_STATO=0,PGGEO_CD_REGIONE=1,PGGEO_CD_PROVINCIA=2,PGGEO_CD_RAGGRUPPAMENTO=3,PGGEO_CD_COMUNE=4,PGGEO_CD_FRAZIONE=5,PGGEO_CD_STRADA=6,PGGEO_CD_CIVICO=7,PGGEO_CD_POI=8;var PGGeoCod=function(A,B){this.callGeo(A,B)};PGGeoCod.prototype={callGeo:function(A,B){var C,D;C="nat="+encodeURIComponent(A.nazione||"")+((A.dove&&A.dove!=="")?"&dv="+encodeURIComponent(A.dove):"&open="+encodeURIComponent(A.comune||"")+((A.provincia&&A.provincia!=="")?" ("+encodeURIComponent(A.provincia)+")":"")+"&topo="+encodeURIComponent(A.indirizzo||"")+"&civ="+encodeURIComponent(A.civico||""))+this.getExtra(B)+"&format=javascript,"+encodeURIComponent(A.onComplete);D=(A.host||PGGEO_URL)+"?"+C;$.getScript(D)},getExtra:function(B){var A="";if(B){for(k in B){v=B[k];if(v!==""){A+="&"+k+"="+encodeURIComponent(v)}}}return A}};var PGGEOREV_URL="http://geo.paginegialle.it/reverse";var PGGeoRevCod=function(A,B){this.callGeoRev(A,B)};PGGeoRevCod.prototype={callGeoRev:function(C,B){var D,F,E="",G,A;if(B){for(G in B){A=B[G];E+="&"+G+"="+encodeURIComponent(A)}}D="&x="+escape(C.lon)+"&y="+escape(C.lat)+E+"&format=javascript,"+escape(C.onComplete);F=(C.host||PGGEOREV_URL)+"?"+D;$.getScript(F)}};SEAT.RadarBox=function(){var A=this;$(window).unload(function(){A.unloadMe()})};SEAT.RadarBox.prototype={unloadMe:function(){this.selBox=null},init:function(){var A=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(B){A.dragBefore(B)},dragging:function(B){A.dragging(B)},dragAfter:function(B){A.dragAfter(B)}})},remove:function(){},sizeMe:function(){var A=this.getDimensions(this.viewMap.model.z,this.viewMap.opts.radarParent.getZoom());this.setDimensions(A.width,A.height)},getDimensions:function(A,C){var D=Math.pow(2,A-C+1),E=this.viewMap.opts.radarParent.getSize().width/D,B=this.viewMap.opts.radarParent.getSize().height/D;return{width:E,height:B}},setDimensions:function(A,B){this.width=A;this.height=B;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(A,B){this.left=A;this.top=B;this.selBox.css({left:this.left,top:this.top})},dragBefore:function(A){this.mapLayerContStart=this.viewMap.getMapPos();this.chgLeft=0;this.chgTop=0},dragging:function(A){var C=this;var D=parseInt(this.selBox.css("left"),10);var B=parseInt(this.selBox.css("top"),10);var F=15;var E=2;this.cL=0;this.cT=0;if(this.width<(this.viewMap.opts.mapWidth-(F*2))){if(D<F){this.cL=E}else{if((D+this.width)>(this.viewMap.opts.mapWidth-F)){this.cL=-E}}}if(this.height<(this.viewMap.opts.mapHeight-(F*2))){if(B<F){this.cT=E}else{if((B+this.height)>(this.viewMap.opts.mapHeight-F)){this.cT=-E}}}if(this.cL!==0||this.cT!==0){if(!this.intMoveCont){this.intMoveCont=setInterval(function(){C.moveCont()},15)}}else{if(this.intMoveCont){clearInterval(this.intMoveCont);this.intMoveCont=null}}},dragAfter:function(A){if(this.intMoveCont){clearInterval(this.intMoveCont);this.intMoveCont=null}this.left+=A.chg.x;this.top+=A.chg.y;this.viewMap.recalcOffsetX=this.chgLeft;this.viewMap.recalcOffsetY=this.chgTop;this.viewMap.panMapBy(-A.chg.x,-A.chg.y)},moveCont:function(){var A,B;this.chgLeft+=this.cL;this.chgTop+=this.cT;A=this.mapLayerContStart.x+this.chgLeft;B=this.mapLayerContStart.y+this.chgTop;this.viewMap.moveToSimple(A,B)},updateMap:function(A){var D,E,G,B,C,F;this.model=A;if(A.transType&&A.transType==="zoom"){if(A.startTrans){}else{if(A.stepTrans){}else{if(A.endTrans){C=this.getDimensions(A.z,this.viewMap.opts.radarParent.getZoom());this.setDimensions(C.width,C.height);this.setPos(this.getPos().left,this.getPos().top)}}}}else{if(A.transType&&A.transType==="pan"){if(A.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(A.stepTrans){if(this.chg){D=this.startPos.left+(this.chg.x*A.now);E=this.startPos.top+(this.chg.y*A.now);this.setPos(D,E)}}else{if(A.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(C,A,E){var D=[],B=this;E=E||{};if(A&&A.way_points&&A.way_points.length>0){$.each(A.way_points,function(G,I){var H,F;if(I.sym){if(I.sym.href&&I.sym.href!=""){H=I.sym.href}else{if(isNaN(I.sym.id)){}else{if(parseInt(I.sym.id,10)>=0){H="http://img.tuttocitta.it/api/icons/"+I.sym.id+".png"}}}}if(H){F=new SEAT.ImgQ({onImgLoad:function(K,L,J){B.addAWayPoint(K,A.way_points[K],J,E,A.way_points.length,D,C)}});F.queueImg(G,H)}else{B.addAWayPoint(G,I,null,E,A.way_points.length,D,C)}})}},addAWayPoint:function(J,B,F,A,I,H,L){var E="",K,D,G=null,C;if(F){C=($.browser.msie)?"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true src='"+F.src+"');":"background: url("+F.src+") no-repeat;";G='<div style="'+C+"width:"+F.width+"px;height:"+F.height+'px;"></div>'}if(A.onOpen){D="closeMe"+B.id;$.extend(B,{closeID:D});K=new PGPoint({html:G,lon:B.x,lat:B.y,opened:{onOpen:A.onOpen,onOpenParams:B,closeID:D}})}else{E+='<div style="width:300px;background:#fff;">';E+='<div style="padding:15px 5px 5px 5px;border:2px solid #000;">';E+='<div id="closeMe'+B.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(F){E+='<img src="'+F.src+'" style="margin:0 5px 5px 0;vertical-align:text-top;width:'+F.width+"px;height:"+F.height+'px;"/>'}E+=(B.name&&B.name!=="")?"<b>"+B.name+"</b>":"";E+=(B.dsc&&B.dsc!=="")?"<br/>"+B.dsc:"";E+=(B.cmt&&B.cmt!=="")?"<br/>"+B.cmt:"";E+='<div style="clear:both;height:10px;width:1px;"></div>';E+="</div>";E+="</div>";K=new PGPoint({html:G,lon:B.x,lat:B.y,opened:{html:E,closeID:"closeMe"+B.id}})}H.push(K);L.pointAdder(K);if(A.onComplete&&H.length===I){A.onComplete.call(A.onComplete,{map:L,points:H})}},removeWayPoints:function(A){if(A&&A.points&&A.points.length>0){$.each(A.points,function(C,B){A.map.removePoint(B)})}}}}();var PGCircle=function(A){this.id=A.id||null;this.center=A.center||null;this.radius=A.radius||50;this.rgb=A.rgb||{r:0,g:0,b:0};this.opacity=(A.opacity>=0&&A.opacity<=1)?A.opacity:1;this.borderRgb=A.borderRgb||{r:0,g:0,b:0};this.borderWidth=A.borderWidth||null;this.borderOpacity=(A.borderOpacity>=0&&A.borderOpacity<=1)?A.borderOpacity:1;this.inMeters=(typeof (A.inMeters)=="boolean")?A.inMeters:true};PGCircle.prototype={initCircleVals:function(A,D,B,C){this.graphicsMgr=A;this.viewMap=B;this.parent=C;this.center.setModel(D);this.center.initPoint()},remove:function(){if(this.id){this.parent.removeCircle(this.id)}},drawFullCircle:function(A){var B=this.viewMap.model.zIdx;metersPerPixel=this.viewMap.model.mapWidthMeters/(this.viewMap.model.mapWidthLevel1Pixel/Math.pow(2,B)),newRadius=this.radius,c=this.center.getPos(this.viewMap);c.x-=A.x;c.y-=A.y;if(this.inMeters==true){newRadius=Math.round(this.radius/metersPerPixel)}this.graphicsMgr.drawCircle(c,newRadius,this.rgb,this.opacity,this.borderWidth,true);if(this.borderWidth){this.graphicsMgr.drawCircle(c,newRadius,this.borderRgb,this.borderOpacity,this.borderWidth,false)}}};SEAT.PGCircleList=function(){var A=this;this.pgCircleList=[];$(window).unload(function(){A.unloadMe()})};SEAT.PGCircleList.prototype={unloadMe:function(){this.pgCircleList=null;this.graphicsMgr=null;this.delta={x:0,y:0}},pgCircleAdder:function(A){if(A){if(!this.graphicsMgr){this.graphicsMgr=new SEAT.GraphicsMgr("pgcircle")}this.addCircle(A);this.prepareForDrawing();A.drawFullCircle(this.delta)}},prepareForDrawing:function(){var B=this.viewMap.tileLayerMgr.getCurrentLayer();var A=this.viewMap.opts;this.posOffset={beforeX:A.extraPixels.hor,afterX:A.extraPixels.hor,beforeY:A.extraPixels.ver,afterY:A.extraPixels.ver};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.cssX-this.posOffset.beforeX),y:(-B.cssY-this.posOffset.beforeY)};this.graphicsMgr.posCanvas(this.delta.x,this.delta.y)},addCircle:function(A){if(A){A.initCircleVals(this.graphicsMgr,this.model,this.viewMap,this);this.pgCircleList.push(A)}},removeCircle:function(A){this.pgCircleList=$.grep(this.pgCircleList,function(B){return(!B.id||(B.id&&B.id!==A))});if(this.graphicsMgr&&(this.pgCircleList===null||this.pgCircleList.length===0)){this.graphicsMgr.removeCanvas()}else{this.drawCircles()}},removeAllPGCircles:function(){this.pgCircleList=[];if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}},drawCircles:function(){var A=this;if(A.pgCircleList.length>0){A.graphicsMgr.clearCanvas();A.prepareForDrawing();$.each(A.pgCircleList,function(C,B){B.drawFullCircle(A.delta)})}},updateMap:function(A){this.model=A;if(A.transType&&A.transType==="zoom"){if(A.startTrans){if(this.graphicsMgr){this.graphicsMgr.removeCanvas()}}else{if(A.stepTrans){}else{if(A.endTrans){if(this.checkChgZone(A.oldZone,A.zone)){this.drawCircles()}}}}}else{if(A.transType&&A.transType==="pan"){}else{this.setModelPoints();this.checkChgZone(A.oldZone,A.zone);this.drawCircles()}}},checkChgZone:function(C,B){var A=false;if(C&&(C!==B)){$.each(this.pgCircleList,function(D,E){E.center.initPoint()});A=true}return A},setModelPoints:function(){var A=this;$.each(this.pgCircleList,function(C,B){B.center.setModel(A.model)})}};SEAT.PGUtil.augment(SEAT.PGCircleList,SEAT.LayerBase);SEAT.ZoomControl=function(A){this.opts=A||{};this.opts=$.extend({type:"mini"},this.opts)};SEAT.ZoomControl.prototype={init:function(){if(this.opts.type==="mini"){this.viewMap.opts.zoomImgs.push(SEAT.ZoomControl.MINI_POINTS_IMGS_DEFAULT)}this.addZoomControlMini()},addZoomControlMini:function(){var H,A=this,F,E,G,B,C,D=$.grep(this.viewMap.opts.zoomImgs,function(I,J){return(I.lng===A.viewMap.opts.lng)});if(D.length>0){H=D[0];G=H.tooltips;B=H.ctrls;F='<a id="mmz_out_2" href="javascript:void(0)" title="'+G[1]+'" class="minizoomOut" >'+G[1]+"</a>";E='<a id="mmz_in_2" href="javascript:void(0)" title="'+G[0]+'" class="minizoomIn" >'+G[0]+"</a>";$("#"+this.viewMap.opts.nameContainer).append(F).append(E);C=this.addCtrl(B,H.urlPfx,0,"mmz_out_2");C.click(function(){A.contMap.zoomIn()});C=this.addCtrl(B,H.urlPfx,1,"mmz_in_2");C.click(function(){A.contMap.zoomOut()})}},addCtrl:function(F,C,E,J){var B,H,I,A,D,G,K;B=F[E][1];H=F[E][0];I=F[E][2];A=F[E][3];D=F[E][4];G=F[E][5];K=C+F[E][6];return $("#"+J).css({top:B,display:"block",height:A,left:H,position:"absolute","text-indent":"-5000px",width:I,"z-index":"1000",background:'url("'+K+'") no-repeat '+D+" "+G+" scroll transparent"})},remove:function(){$("#mmz_out_2, #mmz_in_2").remove()}};SEAT.PGUtil.augment(SEAT.ZoomControl,SEAT.LayerBase);SEAT.ZoomControl.MINI_POINTS_IMGS_DEFAULT={lng:1,urlPfx:"http://img.tuttocitta.it/tcolnew/img/",ctrls:[[0,20,"25px","28px","-5px","0px","controller_piu.png"],[0,45,"25px","28px","-5px","0px","controller_meno.png"]],tooltips:[["Aumenta lo zoom"],["Diminuisci lo zoom"]]};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(D,B,C){this.type=B;this.pgMappy=D;this.nameContainer=this.pgMappy.pgLineList.viewMap.opts.nameContainer;if(C){$.extend(this,C)}if(!this.htmlIcon||this.htmlIcon==""){var A="http://img.tuttocitta.it";this.htmlIcon='<div style="width:19px;height:19px;"><img src="'+A+"/tcolnew/img/poi_"+B+'.png" style="border:0px;"/></div>';this.heightIcon=20;this.widthIcon=20}this.vcc=SEAT.PGListaVccUtilita[B]};SEAT.PGUtilita.prototype={useFumetto:false,usePopup:true,htmlIcon:"",heightIcon:0,widthIcon:0,afterCallMotore:function(G){var D=this;this.currentJson=G;var F=G.xx.co||[];for(var H=0;H<F.length;H++){var A=F[H];if(this.vcc.indexOf(A.ca.b)!=-1){var C=A.cx;var E=A.cy;if(this.usePopup){var B=new PGPoint({id:H,lon:C,lat:E,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type});PGEvent.addListener(B,"mouseover",function(I){D.buildPopup(I)});PGEvent.addListener(B,"mouseout",function(I){D.pgMappy.PGListaUtilita.clearPopup()});this.pgMappy.pointAdder(B)}else{if(this.useFumetto){var B=new PGPoint({id:"p_"+this.type+"_"+H,lon:C,lat:E,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type,opened:{html:this.buildFumetto(A)}});this.pgMappy.pointAdder(B)}else{var B=new PGPoint({id:"p_"+this.type+"_"+H,lon:C,lat:E,html:this.htmlIcon,width:this.widthIcon,height:this.heightIcon,typ:this.type});this.pgMappy.pointAdder(B)}}}}},clear:function(){var A=this;$.each(A.pgMappy.pointList.pointList,function(C,B){if(B.j.typ==A.type){A.pgMappy.removePoint(B)}})},buildPopup:function(G){var E=this.currentJson.xx.co[G.id];var L=E.cx;var C=E.cy;var J=E.na.content;var M=E.ad;var K=E.cp+" "+E.lo.content+" ("+E.pr+")";var A=E.te?"Tel: "+E.te:"";var I=E.fa?"Fax: "+E.fa:"";var D=E.em?"Email: "+E.em:"";var F="";var H="";H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_nome">'+J+"</div>";H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_ind">'+M+"</div>";H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_com">'+K+"</div>";if(A&&A!=""){H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_tel">'+A+"</div>"}if(I&&I!=""){H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_fax">'+I+"</div>"}if(D&&D!=""){H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_mail">'+D+"</div>"}if(F&&F!=""){H+='<div id="'+this.nameContainer+'_pgUtilitaPopup_ora">'+F+"</div>"}$("#"+this.nameContainer+"_pgUtilitaPopup").html(H);$("#"+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 B={};B.lon=L;B.lat=C;B.heightIcon=this.heightIcon;this.pgMappy.PGListaUtilita.openPopup(B)},buildFumetto:function(A){var B='<div style="width:150px; height:150px; background:yellow; border:2px solid #000;">'+A.lon+"</div>";return B}};SEAT.PGUtilitaList=function(B,A){if(A){$.extend(this,A)}B.addLayer(this)};SEAT.PGUtilitaList.prototype={zoomLimit:4,maxNumPoi:70,listaLayer:null,init:function(){var A=this;if(!$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").size()>0){var B='<div id="'+this.viewMap.opts.nameContainer+'_pgUtilitaPopup"></div>';$("#"+this.viewMap.opts.nameContainer).append(B);$("#"+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(){A.clearPopup()})},updateMap:function(B){if(B.transType){if(B.transType=="zoom"){if(B.startTrans){this.clearPopup();this.clear()}}else{if(B.transType=="drag"){this.clearPopup()}}}else{var A=false;if(B.z!=this.actualZ){this.actualZ=B.z;A=true}if((B.lon!=this.actualLon)||(B.lat!=this.actualLat)){this.actualLon=B.lon;this.actualLat=B.lat;A=true}if(A){if(B.z<this.zoomLimit){this.search(this.calcolaVcc(),this.calcolaParametriMappa())}}}},updateMapSize:function(){this.search(this.calcolaVcc(),this.calcolaParametriMappa())},remove:function(){PGEvent.removeListener(this.listenerDrag)},addLayer:function(A,C){if(this.listaLayer==null){this.listaLayer={}}if(!this.listaLayer[A]){var B=new SEAT.PGUtilita(this.pgMappy,A,C);this.listaLayer[A]=B;if(this.pgMappy.getZoom().z<this.zoomLimit){this.search(B.vcc,this.calcolaParametriMappa(),B)}}else{}},removeLayer:function(A){if(this.listaLayer!=null){if(this.listaLayer[A]){this.listaLayer[A].clear();delete this.listaLayer[A];if(this.listaLayerLength()==0){this.listaLayer=null}}}},listaLayerLength:function(){var B=0;for(var A in this.listaLayer){B++}return B},openPopup:function(C){var D=this;var A=this.pgMappy.getPixelFromLonLat(C.lon,C.lat);var B={};if(A.y<this.viewMap.opts.mapHeight/2){B.top=A.y}else{B.top=A.y-$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").height()-C.heightIcon}if(A.x<this.viewMap.opts.mapWidth/2){B.left=A.x}else{B.left=A.x-$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").width()}$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").css(B);if(this.popupTimeout){clearTimeout(this.popupTimeout);this.popupTimeout=null}this.popupTimeout=setTimeout(function(){$("#"+D.viewMap.opts.nameContainer+"_pgUtilitaPopup").fadeIn()},500)},clearPopup:function(A){if(this.popupTimeout){clearTimeout(this.popupTimeout);this.popupTimeout=null}$("#"+this.viewMap.opts.nameContainer+"_pgUtilitaPopup").fadeOut()},setZoomLimit:function(A){this.zoomLimit=A},clear:function(){for(var A in this.listaLayer){this.listaLayer[A].clear()}},search:function(B,C,E){if(this.listaLayerLength()<=0){return }var F=this;var A="http://www.tuttocitta.it";var G="/tcit/search";var H="tr=1&vcc="+B+"&mr="+this.maxNumPoi+"&cy="+C.lat+"&cx="+C.lon+"&px="+C.width+"&py="+C.height+"&z="+C.zDist+"&json=1&mt=1&enc=u&callback=?";var I=A+G+"?"+H;var D=null;if(E!=null){D=function(J){F.listaLayer[E.type].afterCallMotore(J)}}else{D=function(J){F.aggiornaLayers(J)}}$.getJSON(I,D)},aggiornaLayers:function(B){this.clear();for(var A in this.listaLayer){this.listaLayer[A].afterCallMotore(B)}},calcolaParametriMappa:function(){var C=this.pgMappy.map.getCenter();var A=this.pgMappy.getZoom();var B=this.pgMappy.getSize();var D={lon:C.lon,lat:C.lat,z:A.z,zDist:A.zDist,height:B.height,width:B.width};return D},calcolaVcc:function(){var C="";var A=0;var B=this.listaLayerLength();for(var D in this.listaLayer){A++;C+=this.listaLayer[D].vcc;if(A<B){C+="@"}}return C}};SEAT.PGUtil.augment(SEAT.PGUtilitaList,SEAT.LayerBase);SEAT.PGListaVccUtilita={taxi:"008734600",park:"001111600",benz:"008536600",auto:"001103600"};SEAT.PGMappy.prototype.addLayerUtilita=function(B,A){if(!this.PGListaUtilita){this.PGListaUtilita=new SEAT.PGUtilitaList(this,A)}this.PGListaUtilita.addLayer(B,A)};SEAT.PGMappy.prototype.removeLayerUtilita=function(A){if(this.PGListaUtilita){this.PGListaUtilita.removeLayer(A)}};SEAT.PGUtilitaCheckboxManager=function(A,B,C){this.checkBoxArray=B;if(C){$.extend(this,C)}A.addLayer(this);if(!A.PGListaUtilita){A.PGListaUtilita=new SEAT.PGUtilitaList(A,{zoomLimit:this.zoomLimit,maxNumPoi:this.maxNumPoi})}if(!A.PGListaCheckboxManager){A.PGListaCheckboxManager=[]}A.PGListaCheckboxManager.push(this)};SEAT.PGUtilitaCheckboxManager.prototype={zoomLimit:4,maxNumPoi:50,useFumetto:false,usePopup:true,init:function(){var A=this;$.each(this.checkBoxArray,function(F,C){$("#"+C.id).bind("click",function(){if(this.checked){var G=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.html)?A.checkBoxArray[F].icon.html:"";var H=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.height)?A.checkBoxArray[F].icon.height:0;var I=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.width)?A.checkBoxArray[F].icon.width:0;A.pgMappy.PGListaUtilita.addLayer(A.checkBoxArray[F].type,{htmlIcon:G,heightIcon:H,widthIcon:I,useFumetto:A.useFumetto,usePopup:A.usePopup});if(A.pgMappy.PGListaCheckboxManager&&A.pgMappy.PGListaCheckboxManager.length>1){$.each(A.pgMappy.PGListaCheckboxManager,function(K,J){J.checkType(A.checkBoxArray[F].type,false)})}}else{A.pgMappy.PGListaUtilita.removeLayer(A.checkBoxArray[F].type);if(A.pgMappy.PGListaCheckboxManager&&A.pgMappy.PGListaCheckboxManager.length>1){$.each(A.pgMappy.PGListaCheckboxManager,function(K,J){J.checkType(A.checkBoxArray[F].type,true)})}}});if(A.pgMappy.map.getZoom()>=A.zoomLimit){$("#"+C.id).attr("disabled","true")}if(C.checked){$("#"+C.id).attr("checked","checked");var D=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.html)?A.checkBoxArray[F].icon.html:"";var E=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.height)?A.checkBoxArray[F].icon.height:0;var B=(A.checkBoxArray[F].icon&&A.checkBoxArray[F].icon.width)?A.checkBoxArray[F].icon.width:0;setTimeout(function(){A.pgMappy.PGListaUtilita.addLayer(A.checkBoxArray[F].type,{htmlIcon:D,heightIcon:E,widthIcon:B,useFumetto:A.useFumetto,usePopup:A.usePopup})},500)}})},updateMap:function(B){if(B.transType&&B.transType=="zoom"&&B.endTrans){for(var A=0;A<this.checkBoxArray.length;A++){if(B.z>=this.zoomLimit){$("#"+this.checkBoxArray[A].id).attr("disabled","true")}else{$("#"+this.checkBoxArray[A].id).removeAttr("disabled")}}}},remove:function(){},checkType:function(A,B){$.each(this.checkBoxArray,function(D,C){if(C.type==A){if(B){$("#"+C.id).removeAttr("checked")}else{$("#"+C.id).attr("checked","checked")}}})}};SEAT.PGUtil.augment(SEAT.PGUtilitaCheckboxManager,SEAT.LayerBase);SEAT.PGMappy.prototype.addUtilitaCheckboxManager=function(B,A){return new SEAT.PGUtilitaCheckboxManager(this,B,A)};jQuery.GlyphixDEBUG=false;if(!("console" in window)||!("firebug" in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];if(jQuery.GlyphixDEBUG){jQuery(document).ready(function(){$(document.body).append('<div id="DEBUG" style="position:absolute;float:left;background:#F8EFCD;overflow:auto;top:20px;right:200px;z-index:999;font-size:10px;width:200px;height:300px;"><ol></ol></div>')});window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(A){$("#DEBUG ol").append("<li>"+A+"</li>")}}}}jQuery.fn.debug=function(){return this.each(function(){$.log(this)})};jQuery.log=function(B){if(jQuery.GlyphixDEBUG){var C=B;if(!("firebug" in console)){if(typeof (B)=="object"){C="&lt;";C+=B.nodeName.toLowerCase();for(var A=0;A<B.attributes.length;A++){C+=" "+B.attributes[A].nodeName.toLowerCase()+'="'+B.attributes[A].nodeValue+'"'}C+="&gt;"}}console.debug(C)}};(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);SEAT.TC.lng=1;var msgLabel={ERR_locnf:"Nessuna localit"+String.fromCharCode(224)+" trovata ...",ERR_indnf:"Nessun indirizzo trovato ...",LBL_selind:"SELEZIONA L'INDIRIZZO CORRETTO",LBL_selloc:"SELEZIONA LA LOCALIT"+String.fromCharCode(192)+" CORRETTA",LBL_chiudi:"chiudi",ERR_insloc:"Inserire localit&agrave;.",ERR_locunk:"Localit&agrave; non riconosciuta.",ERR_indunk:"Indirizzo non riconosciuto.",ERR_geoind:"Errore durante la geocodifica dell'indirizzo.",LBL_europa:"Europa",LBL_italia:"Italia",LBL_reg:"Regione",LBL_prov:"Provincia",LBL_com:"Comune",LBL_quart:"Quartiere",LBL_via:"Via",LBL_ingrand:"Aumenta lo zoom",LBL_riduci:"Diminuisci lo zoom",LBL_zoomlev:"Zoom livello",LBL_salva:"salva",LBL_elim:"elimina",ERR_noindsav:"Nessun indirizzo salvato.",LBL_miei_ind:"I MIEI INDIRIZZI",LBL_attenz:"ATTENZIONE!",LBL_legenda:"LEGENDA",LBL_cercamp:"Cerca nella mappa",LBL_parti:"Parti da qui",LBL_arriva:"Arriva qui",LBL_metro:"metropolitana",LBL_passante:"passante",LBL_ferrovia:"stazione ferroviaria",LBL_autobus:"stazione autobus",LBL_porto:"porto",LBL_aeroporto:"aeroporto",LBL_autostrada:"autostrada",LBL_altaperc:"strada alta percorrenza",LBL_mediaperc:"strada media percorrenza",LBL_bassaperc:"strada bassa percorrenza",LBL_stradaped:"strada pedonale, ZTL",LBL_confreg:"confine regionale",LBL_confstato:"confine di stato",LBL_monum:"monumenti",LBL_scuole:"edifici governativi, ospedali, universit&agrave;, scuole",LBL_fiere:"fiere, aree commerciali, centri sportivi",LBL_parchi:"parchi",LBL_industria:"zone industriali",LBL_stazioni:"stazioni",ERR_valnosel:"valore non selezionato",ERR_cond:"E' necessario approvare le condizioni per proseguire",ERR_nolocpart:"Inserire localit&agrave; di partenza.",ERR_nolocarr:"Inserire localit&agrave; di arrivo.",ERR_locpartunk:"Localit&agrave; di partenza non riconosciuta.",ERR_locarrunk:"Localit&agrave; di arrivo non riconosciuta.",ERR_indpartunk:"Indirizzo di partenza non riconosciuto.",ERR_indarrunk:"Indirizzo di arrivo non riconosciuto.",ERR_noqs:"Inserire stringa di ricerca.",ERR_nogdo:"Scegliere almeno un  cliente.",SV_over_msg:"Sposta l'omino sulla mappa per passeggiare tra le vie della citt&agrave;.",SV_non_attivo:"Servizio non attivo su questa strada.",SV_install_flash:"Scarica e installa Adobe&reg; Flash&reg; Player per utilizzare il servizio.",LBL_sv_apri_mappa:"Apri mappa",LBL_sv_chiudi_mappa:"Chiudi mappa",LBL_sv_ingrandisci_mappa:"Ingrandisci mappa",LBL_sv_riduci_mappa:"Riduci mappa",LBL_map_type_mappa:"Mappa",LBL_map_type_foto:"Foto Aerea",LBL_map_type_mista:"Mista",LBL_mt_fonte:"fonte:",LBL_mt_sel_icona:"clicca un'icona sulla mappa per vedere le previsioni meteo",LBL_mt_no_info:"Informazioni meteo non disponibili",LBLARR_mt_times:["notte","mattino","pom","sera"],LBL_mt_um:"Umidit&agrave;",LBL_mt_min:"Min:",LBL_mt_max:"Max:",LBL_mt_vento:"Vento:",LBLARR_mt_weekdays:["Domenica","Luned&igrave;","Marted&igrave;","Mercoled&igrave;","Gioved&igrave;","Venerd&igrave;","Sabato"],LBL_ar_qualita:"qualita dell'aria",LBL_ar_sel_icona:"clicca un'icona sulla mappa per vedere la qualit&agrave; dell'aria",LBL_ar_no_info:"Informazioni sulla qualit&agrave; dell'aria non disponibili",LBLARR_ar_iqa:["Eccellente","Accettabile","Mediocre","Insalubre per i gruppi sensibili","Insalubre","Molto insalubre","Pericolosa"],TXT_ar_discl:"ATTENZIONE<br/>le previsioni della qualit&agrave; dell'aria disponibili sul sito tuttocitta.it sono i risultati di simulazioni modellistiche di fenomeni di inquinamento atmosferico. Pertanto tali previsioni, cos&igrave; come le previsioni meteorologiche, sono necessariamente affette da un'incertezza dipendente dallo stato della conoscenza scientifica e anche dalla qualit&agrave; dei dati di input necessari al funzionamento dei modelli. Inoltre si tratta di valori medi di concentrazione relativi alle maglie del grigliato di calcolo: pertanto &egrave; possibile che localmente, ad esempio in corrispondenza di una stazione di monitoraggio, la qualit&agrave; dell'aria si discosti dal valore medio della zona. Le previsioni devono quindi essere considerate con la stessa cautela con la quale si considerano le previsioni del tempo. Anzi, va considerato che prevedere l'inquinamento atmosferico &egrave; ancora pi&ugrave; difficile perch&eacute; bisogna prima prevedere le condizioni meteorologiche, poi cosa e quanto viene emesso nell'aria da automobili, industria e altre sorgenti ed infine come si distribuiscono e si trasformano gli inquinanti trasportati dal vento. Pertanto Seat e Takeair non potranno essere ritenute responsabile di eventuali conseguenze derivate da un errato utilizzo o interpretazione erronea dei dati disponibili nel sito tuttocitta.it.",LBL_sv_pass:"Passeggia per",LBL_sv_guarda:"Guarda le strade d'Italia",LBLARR_sv_int_ico:["VISITA LA CAPPELLA COLLEONI","VISITA S. GIULIA","VISITA LA CERTOSA PAVIA","VISITA LA VILLA MONASTERO","VISITA SANT'AMBROGIO","VISITA LA VILLA REALE","VISITA PALAZZO TE","VISITA IL SACRO MONTE","VISITA IL MUSEO","VISITA IL DUOMO","VISITA LA RINASCENTE"]};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="'+msgLabel.LBL_chiudi+'"><span class="chiusura">'+msgLabel.LBL_chiudi+"</span></a>";if(E==undefined||E==false){D+="<h3>"+msgLabel.LBL_attenz+"</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);$("#WebmasterDivId").show();selectInput("extSiteId")}else{$("#LinkPagDivId").show();selectInput("linkPagId")}return false}function showPgLinkDest(A){hideLegend();$("#linkPagIdDest").val(A);$("#LinkPagDivIdDest").show();selectInput("linkPagIdDest");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="'+msgLabel.LBL_cercamp+'" style="font-size: 82%; color: #555; padding: 5px 0;" href="'+encodeURI(D)+'">'+msgLabel.LBL_cercamp+"</a>";if(A&&A!=""&&C&&C!=""){G+=' - <a target="_blank" style="font-size: 82%; color: #555; padding: 5px 0;" title="'+msgLabel.LBL_parti+'" href="'+encodeURI(A)+'">'+msgLabel.LBL_parti+"</a>";G+=' - <a target="_blank" style="font-size: 82%; color: #555; padding: 5px 0;" title="'+msgLabel.LBL_arriva+'" href="'+encodeURI(C)+'">'+msgLabel.LBL_arriva+"</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")})}$(".bandie").click(function(){if($(this).is(".close")){$(this).addClass("open").removeClass("close");return false}else{$(this).addClass("close").removeClass("open")}});$(".switch-sitiseat").click(function(){if($(this).is(".opSitiSeat")){$(".switch-sitiseat ul li ul").hide();$(this).removeClass("opSitiSeat")}else{$(".switch-sitiseat ul li ul").show();$(this).addClass("opSitiSeat")}});$("body").click(function(B){if(!$(B.target).is(".bandie *")&&$(".bandie").is(".open")){var A=$(".bandie ul");$(".bandie").removeClass("open").addClass("close");A.removeClass().addClass(A.attr("id"))}if(!$(B.target).is(".switch-sitiseat *")&&$(".switch-sitiseat").is(".opSitiSeat")){$(".switch-sitiseat ul li ul").hide();$(this).removeClass("opSitiSeat")}});$(".bandie *").hover(function(){var A=$(this).attr("class");if(A=="it"||A=="fr"||A=="de"||A=="en"||A=="es"){$(this).parent().removeClass().addClass("x"+A)}})});function showLegend(){var B=$(".legend");if($.trim(B.html())==""){var A="";A+="<h4>"+msgLabel.LBL_legenda+"</h4>";A+='<a class="chiudi" title="'+msgLabel.LBL_chiudi+'" href="javascript:void(0)" onclick="hideLegend();"><span class="chiusura">'+msgLabel.LBL_chiudi+"</span></a>";A+='<ul class="servizi">';A+='<li><span class="leg1">'+msgLabel.LBL_metro+"</span>"+msgLabel.LBL_metro+"</li>";A+='<li><span class="leg2">'+msgLabel.LBL_passante+"</span>"+msgLabel.LBL_passante+"</li>";A+='<li><span class="leg3">'+msgLabel.LBL_ferrovia+"</span>"+msgLabel.LBL_ferrovia+"</li>";A+='<li><span class="leg4">'+msgLabel.LBL_autobus+"</span>"+msgLabel.LBL_autobus+"</li>";A+='<li><span class="leg5">'+msgLabel.LBL_porto+"</span>"+msgLabel.LBL_porto+"</li>";A+='<li><span class="leg6">'+msgLabel.LBL_aeroporto+"</span>"+msgLabel.LBL_aeroporto+"</li>";A+="</ul>";A+='<ul class="strade">';A+='<li><span class="leg7">'+msgLabel.LBL_autostrada+"</span>"+msgLabel.LBL_autostrada+"</li>";A+='<li><span class="leg8">'+msgLabel.LBL_altaperc+"</span>"+msgLabel.LBL_altaperc+"</li>";A+='<li><span class="leg9">'+msgLabel.LBL_mediaperc+"</span>"+msgLabel.LBL_mediaperc+"</li>";A+='<li><span class="leg10">'+msgLabel.LBL_bassaperc+"</span>"+msgLabel.LBL_bassaperc+"</li>";A+='<li><span class="leg11">'+msgLabel.LBL_stradaped+"</span>"+msgLabel.LBL_stradaped+"</li>";A+='<li><span class="leg12">'+msgLabel.LBL_confreg+"</span>"+msgLabel.LBL_confreg+"</li>";A+='<li><span class="leg13">'+msgLabel.LBL_confstato+"</span>"+msgLabel.LBL_confstato+"</li>";A+="</ul>";A+='<ul class="aree">';A+='<li><span class="leg14">'+msgLabel.LBL_monum+"</span>"+msgLabel.LBL_monum+"</li>";A+='<li><span class="leg15">'+msgLabel.LBL_scuole+"</span>"+msgLabel.LBL_scuole+"</li>";A+='<li><span class="leg16">'+msgLabel.LBL_fiere+"</span>"+msgLabel.LBL_fiere+"</li>";A+='<li><span class="leg17">'+msgLabel.LBL_parchi+"</span>"+msgLabel.LBL_parchi+"</li>";A+='<li><span class="leg18">'+msgLabel.LBL_industria+"</span>"+msgLabel.LBL_industria+"</li>";A+='<li><span class="leg19">'+msgLabel.LBL_stazioni+"</span>"+msgLabel.LBL_stazioni+"</li>";A+="</ul>";A+='<span class="rcSx"> </span>';A+='<span class="rcDx"> </span>';B.html(A)}hidePgLink();B.show("slow");return false}function readGeoIPLoc(){var D=decodeURIComponent(Cookie.readCookie("geoip"));var E=D.substring(D.lastIndexOf("~")+1,D.length);var B=E.lastIndexOf("+");var A=E.substring(0,B).toLowerCase();var C=E.substring(B+2,E.length-1);return{com:A,prov:C}}SEAT.TC.getMiniZoomImgs=function(){return[{lng:1,urlPfx:SEAT.TC.IMG_PFX+"/",ctrls:[[0,30,"25px","28px","-5px","0px","controller_piu.png"],[0,55,"25px","28px","-5px","0px","controller_meno.png"]],tooltips:[[msgLabel.LBL_ingrand],[msgLabel.LBL_riduci]]}]};SEAT.TC.addMiniZoom=function(A){A.addLayer(new SEAT.ZoomControl());$(".minizoomOut").wrap('<div class="mzOuter"/>');$(".minizoomIn").wrap('<div class="mzOuter"/>')};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:msgLabel.ERR_locnf,indirizzoErrorMessage:msgLabel.ERR_indnf,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.ret=-1;this.arrayScelte=[];this.arrayScelteData=[];$("#"+this.divComune).val("");$("#"+this.divIndirizzo).val("")},geoCode:function(listIdSelected){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";if(listIdSelected!==undefined&&this.arrayScelteData.length>0&&this.arrayScelteData[listIdSelected].codCom){pars+="&open="+this.arrayScelteData[listIdSelected].codCom+"+"+encodeURIComponent(comune||"")}else{pars+="&open="+encodeURIComponent(comune||"")}pars+="&topo="+encodeURIComponent(indirizzo||"");$.get(this.geoCodeServiceURL+"?"+pars,function(json){eval("json="+json);selfRef.ret=json.ret;selfRef.arrayScelte=[];selfRef.arrayScelteData=[];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!="4"&&a.frazDesc){comStr=a.frazDesc}}}comStr+=", "+a.stato;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"){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+", "+list[i].stato)}else{if(list[i].com){if(list[i].prov){selfRef.arrayScelte.push(""+list[i].com+" ("+list[i].prov+"), "+list[i].stato)}else{selfRef.arrayScelte.push(""+list[i].com+", "+list[i].stato)}}}selfRef.arrayScelteData.push(list[i])}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"){var insAddr=json["int"];if(insAddr){$("#"+selfRef.divComune).val(json.loc)}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{if(json.ret=="1"){for(var j=0;j<json.addressList.length;j++){selfRef.arrayScelte.push(json.addressList[j].com+" ("+json.addressList[j].prov.toUpperCase()+"), "+json.addressList[j].stato+" - "+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.divComune,"com")}else{selfRef.callbackGeocodeKO(json.ret)}}}}})},buildList:function(A,F){var H=this;this.activeItem=-1;this.elementId=A;if(F=="ind"){var D=msgLabel.LBL_selind}else{var D=msgLabel.LBL_selloc}$("#geoCoderVisualizer").empty().append("<h4>"+D+'</h4><div id="geoCoderVisualizerUlCont" class="scroll"><ol></ol></div><a id="chiudi" title="'+msgLabel.LBL_chiudi+'" href="javascript:void(0)">'+msgLabel.LBL_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.ret=="2"&&this.arrayScelteData.length>0&&this.arrayScelteData[A].com){$("#"+this.divIndirizzo).val(this.arrayScelteData[A].topo);$("#"+this.divComune).val(this.arrayScelteData[A].com)}else{if(this.ret=="1"&&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(B)}},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(msgLabel.ERR_insloc,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(msgLabel.ERR_insloc,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(msgLabel.ERR_locunk,this.divErrComune)}else{if(""+A==="4"){buildErrorMessage(msgLabel.ERR_indunk,this.divErrIndirizzo)}else{buildErrorMessage(msgLabel.ERR_geoind,this.divErrComune)}}}};SEAT.TC.Stat=function(){};SEAT.TC.Stat.STATJS_LINKPG="tc-link-a-pagina";SEAT.TC.Stat.STATJS_MAPINV="tc-map-invia";SEAT.TC.Stat.STATJS_MAPHTML="tc-map-html";SEAT.TC.Stat.STATJS_PRCINV="tc-perc-invia";SEAT.TC.Stat.STATJS_PRCHTML="tc-perc-html";SEAT.TC.Stat.STATJS_ARTE="tc-arte-in-citta";SEAT.TC.Stat.STATJS_CAMBIAARR="tc-cambia-arrivo";SEAT.TC.Stat.STATJS_CALCRIT="TC-CALCOL-RITOR";SEAT.TC.Stat.STATJS_ALBERGHI="tc-cli-alber";SEAT.TC.Stat.STATJS_RISTO="tc-cli-ristor";SEAT.TC.Stat.STATJS_STRVIEW="tc-vista-strada";SEAT.TC.Stat.STATJS_3D="tc-etoo";SEAT.TC.Stat.STATJS_STRVIEW_ICOINT="tc-svinterni";SEAT.TC.Stat.STATJS_ARIA="tc-qualitaria";SEAT.TC.Stat.STATJS_METEO="tc-meteo";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,STAT_LKSPONS_LIST:74,STAT_LKSPONS_FUMOPEN:73,STAT_LKSPONS_FUMCLICK:72,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)};SEAT.TC.addZoomWidget=function(F,C,E,G){E=typeof (E)!="undefined"?E:"";var D=function(){var H=[];var I=0;var L=[msgLabel.LBL_europa,msgLabel.LBL_italia,msgLabel.LBL_reg,msgLabel.LBL_prov,msgLabel.LBL_prov,msgLabel.LBL_com,msgLabel.LBL_com,msgLabel.LBL_quart,msgLabel.LBL_quart,msgLabel.LBL_via,msgLabel.LBL_via,msgLabel.LBL_via,msgLabel.LBL_via];H[I++]='<ul class="clearfix ulpiu"><li class="lipiu"><a title="'+msgLabel.LBL_ingrand+'" href="javascript:void(0)" class="apiu" id="zoomIn">'+msgLabel.LBL_ingrand+"</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+'">'+msgLabel.LBL_zoomlev+" 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+'">'+msgLabel.LBL_zoomlev+K+"</a></li>"}H[I++]="</ul>";H[I++]='<ul class="zoomOut clearfix"><li class="zoomOut"><a title="'+msgLabel.LBL_riduci+'" href="javascript:void(0)" class="zoomOut" id="zoomOut">'+msgLabel.LBL_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:{"-1":"zoom01"+E,"-2":"zoom01"+E,"-3":"zoom01"+E},logicaGruppi:true,idInOut:{out:"zoomOut","in":"zoomIn"},abilitaMenoUno:G,selezionaFinoCorrente:true,zoomLimit:12});F.addLayer(B);$("#divZoom"+E).show()};SEAT.TC.Map=function(F,G,J,D,N,P,I,R,K,M,S){if(S){$.extend(this,S)}this.lng=SEAT.TC.lng;this.full=I;this.withExtraLayers=!(this.isPrint==true)&&!(this.isExt==true)&&!(this.isPrintIns==true);var H="tcol";if(R){H="tcol-cb"}var O=J;if(J==""&&K!=""){O=this.getZCent(K)}else{if(this.isOneHp==true&&this.noZoom==true&&window.screen.width>1024){O=O-1}else{if(this.isMap&&M==true&&this.isCivico&&this.isCivico==true){O=O-1}}}var T=D/2;if(this.xMove&&this.isOneHp==false){T=(D-this.xMove)/2}var A=this.pixelLatLong(T,N/2,F,G,this.getZIdx(O),D,N);SEAT.TC.cx=A.lon;SEAT.TC.cy=A.lat;SEAT.TC.lx=A.lon;SEAT.TC.ly=A.lat;var C={nameContainer:"mapcontainer",mapWidth:D,mapHeight:N,lon:A.lon,lat:A.lat,z:O,imgType:PGMAP_IMG_TYPE_LIGHT,mapBackground:"#F0F2E8",sito:H};this.streetZoom=M;if(M==true){C.minMapLevel=PGMAP_ZOOM_PAVEMENT_INTRA_STREET}if(this.mapType){C.mapType=parseInt(this.mapType)}C.zoomImgs=SEAT.TC.getMiniZoomImgs();this.pgMap=new PGMappy(C);$("#mapcontainer_WWW").hide();$("#mapcontainer_logo").css({left:"",right:"10px",width:"200px",height:"19px",bottom:"5px","font-family":"verdana","font-size":"9px","z-index":"999"});$("#mapcontainer_logo div").css({"float":"right"});$("#mapcontainer_logo img").css({position:"relative",right:"18px"});$("#logoName").css({position:"relative",bottom:"4px",left:"6px"});SEAT.TC.addZoomWidget(this.pgMap,"widgetContainer","",M);var B=new SEAT.wPgScale({div:"wPgScaleContainer"});B.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"];B.zoom_neg_array_desc=["25 mt","10 mt","5 mt"];this.pgMap.addLayer(B);$("#scala").show();var Q=this;if(this.isPrintIns===undefined){var E=this.getPoiArr(P);var L=(this.isEstero?0:4);var U={useFumetto:false,usePopup:true,zoomLimit:L};if(I){U.maxNumPoi=70}else{U.maxNumPoi=50}this.pgMap.addUtilitaCheckboxManager(E,U);$(".mapCheckbox input + label").css("color",(this.pgMap.getZoom().z<L?(this.isMap?"#004D91":"#F1660D"):"#ccc"));PGEvent.addListener(this.pgMap,"zoomaftermap",function(){var V=(Q.pgMap.getZoom().z<L?(Q.isMap?"#004D91":"#F1660D"):"#ccc");$(".mapCheckbox input + label").css("color",V)})}if(!this.isEstero){this.addTypeWidget(this.pgMap)}this.init()};SEAT.TC.Map.prototype={meteoActive:"0",airActive:"0",zoomArray:[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:[-3,-2,-1,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}],init:function(){$("#artCtId").click(function(){callRedshV52(SEAT.TC.Stat.STATJS_ARTE)});if(typeof (SEAT.TC.SvInternalPromo)!="undefined"){new SEAT.TC.SvInternalPromo(this)}if(this.miniZoom){SEAT.TC.addMiniZoom(this.pgMap)}},addPoints:function(C,A,B){return 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},getZIdx:function(B){var A;for(i=0;i<this.zoomArrayCent.length;i+=1){if(B==this.zoomArrayCent[i]){A=this.zoomArray[i];break}}return A},pixelLatLong:function(I,G,C,M,H,E,D){var F=SEAT.PGUtil.latLong2UTM(C,M,32);$.log("#pixelLatLong: latLong2UTM("+C+","+M+",32): utm.x: "+F.x+" utm.y: "+F.y+" z: "+H);var L=(H*1609.3)*(E/430);var K=D/E*L;I=parseInt(I-E/2);G=parseInt(D/2-G);var B=((I/E)*L)+F.x;var A=((G/D)*K)+F.y;var J=SEAT.PGUtil.utm2LatLong(B,A,32);return{lon:parseFloat(SEAT.PGUtil.trunc(J.x+"",5)),lat:parseFloat(SEAT.PGUtil.trunc(J.y+"",5))}},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 A="";$(this.poiArr).each(function(B){if(this.present===true){if($("input#"+this.id+":checked").length==1){A+="1"}else{A+="0"}}});return A},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(D){var A=this.pgMap.map.getCenter();var C=this.pgMap.getZoom();var B=A.lon;if(D){B=this.getCorrectLon()}return"z="+C.z+"&zd="+C.zDist+"&cx="+B+"&cy="+A.lat+"&poi="+this.getPoiParam()+"&mtp="+this.pgMap.getMapType()+"&me="+this.meteoActive+"&ae="+this.airActive},getCorrectLon:function(){var C=this.pgMap.map.getCenter();var H=this.pgMap.getZoom();var M=this.pgMap.getSize().width;var F=this.pgMap.getSize().height;var I=M/2;var G=F/2;var B=this.getZIdx(H.z);if(this.xMove&&this.isOneHp==false){I=(M+this.xMove)/2}var E=SEAT.PGUtil.latLong2UTM(C.lon,C.lat,32);var L=(B*1609.3)*(M/430);var K=F/M*L;I=parseInt(I-M/2);G=parseInt(F/2-G);var D=((I/M)*L)+E.x;var A=((G/F)*K)+E.y;var J=SEAT.PGUtil.utm2LatLong(D,A,32);return parseFloat(SEAT.PGUtil.trunc(J.x+"",5))},getMrkPopHtml:function(E,C,B,D){var A='<div id="'+E+'"><p class="bg-tras-map"><span class="citta">'+B+"</span>";if(D&&D!=""){A+='<span class="via">'+D+"</span>"}A+='<span class="ciudi" id="'+C+'">chiudi</span></p><div>';return A},addTypeWidget:function(B){var A=function(){$("#mapcontainer").append("<div id='type'></div>");var E=[];E.push('<div id="typeMappa">'+msgLabel.LBL_map_type_mappa+"</div>");E.push('<div id="typeFoto">'+msgLabel.LBL_map_type_foto+"</div>");E.push('<div id="typeMista">'+msgLabel.LBL_map_type_mista+"</div>");$("#type").html(E.join(" "))};var C=new SEAT.wPgType({initGrafica:A,idType:{"1":"typeMappa","2":"typeFoto","3":"typeMista"}});B.addLayer(C);if(this.withExtraLayers==true){var D=new SEAT.TC.Builder3D(this);$("#typeMista").after('<div class="ico3d 3dlinkjs" id="3dId">3d</div>');if(D.withPalaces==false){$("#3dId").addClass("turtle")}D.init()}},dashedLine:function(F){var E=9.17038,H=9.17576,G=45.4531,A=45.45269,C=(H-E)/(F*4-1),B=(A-G)/(F*4-1);for(var D=0;D<F*4;D+=4){this.pgMap.pgLineAdder(new PGLine({id:"dashed"+D,points:[new PGPoint({lon:E+(C*D),lat:G+(B*D)}),new PGPoint({lon:E+(C*(D+3)),lat:G+(B*(D+3))})],rgb:{r:0,g:138,b:181},lineWidth:20,opacity:0.9}))}}};SEAT.TC.RouteCreator=function(B,C){var A=this;if(B){this.routeMap=B}if(C){$.extend(this,C)}this.open=1;this.init();if(this.isHp){new SEAT.Indirizzi("saveInd1","viewInd1",this.dv1Id,this.ind1Id,{offTop:2,offLeft:-80});new SEAT.Indirizzi("saveInd2","viewInd2",this.dv2Id,this.ind2Id,{offTop:2,offLeft:-80})}else{new SEAT.Indirizzi("saveInd1","viewInd1",this.dv1Id,this.ind1Id,{offTop:2,offLeft:-74});new SEAT.Indirizzi("saveInd2","viewInd2",this.dv2Id,this.ind2Id,{offTop:2,offLeft:-74})}new SEAT.TC.RouteSearcher(this.routeMap,this.btnCrtId,this.btnClId,this.dv1Id,this.ind1Id,this.dv2Id,this.ind2Id,this.tipoPercId,{callbackGeocodeOK:A.afterGeoCod,autocomplete:false,callbackRefererObj:A,divErrComuneP:A.divErrComP,divErrIndirizzoP:A.divErrIndP,divErrComuneA:A.divErrComA,divErrIndirizzoA:A.divErrIndA,classErrComuneA:A.classErrComA,classErrIndirizzoA:A.classErrIndA})};SEAT.TC.RouteCreator.prototype={opCId:"opC",cFrmId:"createRouteFrm",dv1Id:"paesePartenza",dv2Id:"paeseArrivo",ind1Id:"viaPartenza",ind2Id:"viaArrivo",btnCrtId:"btnCreaPercorso",btnClId:"btnClear",tipoPercId:"tipoPercorso",divErrComP:"divDvP",divErrIndP:"divIndP",divErrComA:"sezPercorsi",divErrIndA:"sezPercorsi",classErrComA:"errorcittapa",classErrIndA:"errorindirizzopa",menuFocused:false,locMezzi:["alba","alpignano","andezeno","asti","avigliana","balangero","beinasco","borgaro torinese","bosconero","brandizzo","bruino","caluso","cambiano","candiolo","caselle torinese","castagneto po","castellamonte","castiglione torinese","ceres","chieri","chivasso","ciri","collegno","cumiana","cunico","cuorgn","druento","favria","feletto","forno canavese","gassino torinese","germagnano","giaveno","grosso","grugliasco","ivrea","lanzo torinese","lein","mathi","mazz","mercenasco","mezzenile","moncalieri","mont","montalenghe","montanaro","nichelino","nole","oglianico","orbassano","orio canavese","ozegna","pecetto torinese","pessinetto","pianezza","pinerolo","pino torinese","piossasco","pont canavese","reano","rivalta di torino","rivarolo canavese","rivoli","rondissone","salassa","san benigno canavese","san maurizio canavese","san mauro torinese","san raffaele cimena","sangano","santena","settimo torinese","strambino","torino","torrazza piemonte","trana","traves","trofarello","valperga","vauda canavese","venaria reale","villanova canavese","villarbasse","vinovo","vische","volpiano"],init:function(){var A=this;if(this.routeMap){$(".goMapCls").bind("click",function(D){A.goToMap(D.target.href);return false});if(this.routeMap.isOneHp==false){$("#sezPercorsi input, #sezPercorsi select").focus(function(){A.menuFocused=true})}else{$("#"+this.dv1Id).focus()}$("#cliccami").click(function(){A.aprichiudi(300,true)});$("#cliccami").show();$(window).bind("resize",function(){A.resize()});$(window).bind("load",function(){A.resize()});if(this.p1&&this.p2){var C={dv:$("#"+A.dv1Id).val(),ind:$("#"+A.ind1Id).val()};var B={dv:$("#"+A.dv2Id).val(),ind:$("#"+A.ind2Id).val()};this.mrk1Popup=new SEAT.TC.PointPopUp(this.p1,this.routeMap,C,"divPop1");this.mrk2Popup=new SEAT.TC.PointPopUp(this.p2,this.routeMap,B,"divPop2",this.mrk1Popup)}}$("#calcRitId").bind("click",function(){callRedshV52(SEAT.TC.Stat.STATJS_CALCRIT);A.modifyHrefCalcRit($(this))});if($("#radio_mp").length&&A.testLocMezzi()){$("#radio_mp").fadeIn("fast")}if(A.testLocEcopass()){$("#radio_eco").fadeIn("fast")}$("#divPopClose").click(function(){$("#riassunto").hide("fast")});$("#paeseArrivo,#paesePartenza").keyup(function(){if($("#radio_mp").length&&A.testLocMezzi()){$("#radio_eco").hide();$("#radio_mp").fadeIn("fast")}if(A.testLocEcopass()){$("#radio_mp").hide();$("#radio_eco").fadeIn("fast")}})},testLocEcopass:function(){var B=$("#paesePartenza").val().toLowerCase();var A=$("#paeseArrivo").val().toLowerCase();if(B.indexOf("milano")==0||A.indexOf("milano")==0){return true}return false},testLocMezzi:function(){var D=$("#paesePartenza").val().toLowerCase();var B=$("#paeseArrivo").val().toLowerCase();var C=0;var A=this.locMezzi.length;while(A--){if(D.indexOf(this.locMezzi[A])==0){C++}if(B.indexOf(this.locMezzi[A])==0){C++}}return(C>=2?true:false)},modifyHrefCalcRit:function(C){var B=C.attr("href");var A=B+"&poi="+this.routeMap.getPoiParam()+"&mtp="+this.routeMap.pgMap.getMapType();C.attr("href",A)},goToMap:function(A){location.href=A+"&"+this.routeMap.getCurrCoords();return false},afterGeoCod:function(L,A,M){var O=L.comuneList[0];var R=A.comuneList[0];var P=this;if(O){var G=$("#"+P.dv1Id).val();var I=$("#"+P.ind1Id).val();var K=L["int"];if(I===""&&K){I=O.topo;if(O.civico!=undefined){I=I+","+O.civico}$("#"+P.ind1Id).val(I)}var F=$("#"+P.dv2Id).val();var H=$("#"+P.ind2Id).val();var J=A["int"];if(H===""&&J){H=R.topo;if(R.civico!=undefined){H=H+","+R.civico}$("#"+P.ind2Id).val(H)}var C=$("#"+P.tipoPercId).val();if(this.inDv2&&(F!=this.inDv2||H!=this.inInd2)){callRedshV52(SEAT.TC.Stat.STATJS_CAMBIAARR)}var Q=O.codCom;var B=$("form#"+this.cFrmId).attr("action");var E=B.indexOf("?");var N=B.substring(0,E)+"/"+O.com.toLowerCase()+"-"+R.com.toLowerCase()+B.substring(E);var D=N+"&cx1="+O.lon+"&cy1="+O.lat+"&dv1="+G+"&ind1="+I+"&cx2="+R.lon+"&cy2="+R.lat+"&dv2="+F+"&ind2="+H+"&tp="+M+"&ccd1="+O.codCom+"&ccd2="+R.codCom+"&lpr="+R.prov+"&cre="+R.codReg+"&lcn="+R.com;if(P.routeMap){D+="&poi="+P.routeMap.getPoiParam()+"&mtp="+P.routeMap.pgMap.getMapType()+"&me="+P.routeMap.meteoActive+"&ae="+P.routeMap.airActive}document.location.href=D}},aprichiudi:function(B,A){if(this.open==1){$(".formContainer").animate({width:"0px"},B,function(){$(".formContainer").css({"border-right-width":"0px",overflow:"hidden"})});$("#divZoom").animate({left:"0px"},B);$("#cliccami").animate({left:"9px"},B);$("#cliccami").css("background-image","url("+SEAT.TC.IMG_PFX+"/lingu-apri-gia.png)");if(this.mrk1Popup&&this.mrk2Popup){this.mrk1Popup.visualizePopup(B);this.mrk2Popup.visualizePopup(B)}this.open=0}else{if(this.mrk1Popup&&this.mrk2Popup){this.mrk1Popup.clearPopup(B);this.mrk2Popup.clearPopup(B)}$(".formContainer").animate({width:"470px"},B,function(){$(".formContainer").css({"border-right-width":"10px",overflow:"visible"})});$("#divZoom").animate({left:"480px"},B);$("#cliccami").animate({left:"480px"},B);$(".formContainer").css("border-right-width","10px");$("#cliccami").css("background-image","url("+SEAT.TC.IMG_PFX+"/lingu-chiud-gia.png)");this.open=1}},resize:function(){var B=0.33;if((screen.width>=1280)&&((screen.height/screen.width)>0.74)){B=0.45}var A=$(".boxDxPercorsi").innerWidth();var C=Math.round(A*B);if(C<391){C=391}this.routeMap.pgMap.setSize(A,C);if($.browser.msie&&$.browser.version.indexOf("8")!=-1){$(".boxDxPercorsi").height($("#mapcontainer").height())}}};SEAT.TC.RouteSearcher=function(F,D,M,J,L,E,H,I,B){if(B){$.extend(this,B)}this.routeMap=F;var G=this;var C,K;var A=function(N){switch(N.keyCode){case 13:N.preventDefault();if(!C.opened&&!K.opened&&!autocompleteOpened){if($("#"+J).val()===""){buildErrorMessage("Inserire localit&agrave; di partenza.",G.divErrComuneP)}else{if($("#"+E).val()===""){buildErrorMessage("Inserire localit&agrave; di arrivo.",G.divErrComuneA,G.classErrComuneA)}else{C.geoCode()}}}break;default:break}};$("#"+J).bind("keydown",A);$("#"+L).bind("keydown",A);$("#"+E).bind("keydown",A);$("#"+H).bind("keydown",A);C=new SEAT.GeoCoder(J,L,{afterAutocompleter:function(){$("#"+E).focus()},callbackGeocodeOK:function(N){K.geoCode();G.objGeocodeP=N},callbackGeocodeKO:function(N){G.callbackGeocodeKO(N,"P")},autocomplete:this.autocomplete,mappa:this.mappa,fixIeBug:this.fixIeBug,divErrComune:this.divErrComuneP||"",divErrIndirizzo:this.divErrIndirizzoP||""});K=new SEAT.GeoCoder(E,H,{afterAutocompleter:function(){C.geoCode()},callbackGeocodeOK:function(O){var N=$("input[name='tp']:checked").val();G.callbackGeocodeOK.call(G.callbackRefererObj,G.objGeocodeP,O,N)},callbackGeocodeKO:function(N){G.callbackGeocodeKO(N,"A")},autocomplete:this.autocomplete,mappa:this.mappa,fixIeBug:this.fixIeBug,divErrComune:this.divErrComuneA||"",divErrIndirizzo:this.divErrIndirizzoA||"",classMessage:this.classErrComuneA});$("#"+D).click(function(){$("#"+J+".example").val("");$("#"+E+".example").val("");$("#"+L+".example").val("");$("#"+H+".example").val("");if($("#"+J).val()===""){buildErrorMessage("Inserire localit&agrave; di partenza.",G.divErrComuneP)}else{if($("#"+E).val()===""){buildErrorMessage("Inserire localit&agrave; di arrivo.",G.divErrComuneA,G.classErrComuneA)}else{C.geoCode()}}});$("#"+M).click(function(){C.clear();K.clear()});this.init()};SEAT.TC.RouteSearcher.prototype={btnPrtId:"btnPrt",btnPgLkId:"btnPgLk",btnTrf:"btnTrf",btnFb:"btnFb",init:function(){var A=this;$("a[id^="+this.btnPrtId+"]").bind("click",function(){A.openPrint();return false});$("#"+this.btnPgLkId).bind("click",function(){callRedshV52(SEAT.TC.Stat.STATJS_PRCINV);A.openPgLink();return false});$("#btnPgLk2").bind("click",function(){callRedshV52(SEAT.TC.Stat.STATJS_PRCINV);A.openPgLink("dest");return false});$("#btnRisto").click(function(){callRedshV52(SEAT.TC.Stat.STATJS_RISTO)});$("#btnAlberghi").click(function(){callRedshV52(SEAT.TC.Stat.STATJS_ALBERGHI)});$("#"+this.btnFb).bind("click",function(){A.openFbLink();return false})},openPrint:function(){var A=$("#"+this.btnPrtId).attr("href")+"&frm=prc";var B=window.open(A,"tcMapPrint","resizable=no, scrollbars=yes, status=no, height=600, width=730");B.focus();B.ref=window;return false},openPgLink:function(A){var B="";B=$("#"+this.btnPgLkId).attr("href")+"&"+this.routeMap.getCurrCoords(true);if(A=="dest"){showPgLinkDest(B)}else{showPgLink(B)}return false},openFbLink:function(){var A=encodeURIComponent($("#"+this.btnFb).attr("href")+"&"+this.routeMap.getCurrCoords(true));var B=encodeURIComponent($("meta[name=description]").attr("content"));window.open("http://www.facebook.com/sharer.php?u="+A+"&t="+B,"sharer","fullscreen=no,resizable=yes,width=626,height=436,scrollbars=yes");return false},callbackRefererObj:{},callbackGeocodeOK:function(A,B,C){},callbackGeocodeKO:function(A,B){if(""+B==="P"){if(""+A==="3"||""+A==="8"||""+A==="9"){buildErrorMessage("Localit&agrave; di partenza non riconosciuta.",this.divErrComuneP)}else{if(""+A==="4"){buildErrorMessage("Indirizzo di partenza non riconosciuto.",this.divErrIndirizzoP)}else{buildErrorMessage(A)}}}else{if(""+B==="A"){if(""+A==="3"||""+A==="8"||""+A==="9"){buildErrorMessage("Localit&agrave; di arrivo non riconosciuta.",this.divErrComuneA,this.classErrComuneA)}else{if(""+A==="4"){buildErrorMessage("Indirizzo di arrivo non riconosciuto.",this.divErrIndirizzoA,this.classErrIndirizzoA)}else{buildErrorMessage(A)}}}}}};function getPrintImgURLpars(B,G,E,A,F,D,I){var J=B.replace(/amp;/g,"");J+=("&xpix="+E+"&ypix="+A);if(typeof (G)!="undefined"){var H=G.map.getCenter();var C=G.getZoom().zDist;if(C<200){C*=2}J+=("&z="+C+"&x="+H.lon+"&y="+H.lat)}else{J+=("&z="+I+"&x="+F+"&y="+D)}return J};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>"+msgLabel.LBL_miei_ind+' </h4><a id="chiudiMieiInd" class="chiudi" href="javascript:void(0)" title="'+msgLabel.LBL_chiudi+'"><span class="chiusura">'+msgLabel.LBL_chiudi+'</span></a><a id="salvaMieiInd" href="javascript:void(0)" title="'+msgLabel.LBL_salva+'">'+msgLabel.LBL_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">'+msgLabel.LBL_elim+"</span></td></tr>";$("#mieiIndTable").append(D)}}else{$("#mieiIndTable").append("<tr><td>"+msgLabel.ERR_noindsav+"</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=yes,location=no,toolbar=no";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&&$.browser.version.indexOf("6")!=-1){var A=window.screen.availHeight-150}else{if($.browser.msie&&$.browser.version.indexOf("7")!=-1){var A=window.screen.availHeight-180}else{if($.browser.msie&&$.browser.version.indexOf("8")!=-1){var A=window.screen.availHeight-172}else{if($.browser.mozilla){var A=window.screen.availHeight-180}else{var A=window.screen.availHeight-110}}}}var B=window.screen.availWidth-40;var D=this.tcMap.getPoiParam();C+="&cx="+this.tcMap.getCorrectLon()+"&cy="+F.lat+"&z="+E.z+"&px="+B+"&py="+A+"&poi="+D+"&sz="+this.tcMap.streetZoom+"&mtp="+this.tcMap.pgMap.getMapType()+"&me="+this.tcMap.meteoActive+"&ae="+this.tcMap.airActive;if(this.tcMap.isEstero&&this.tcMap.isEstero==true){C+="&est=true"}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="+this.tcMap.getCorrectLon()+"&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+"&mtp="+this.tcMap.pgMap.getMapType()}C+="&me="+this.tcMap.meteoActive+"&ae="+this.tcMap.airActive;if(this.tcMap.isEstero&&this.tcMap.isEstero==true){C+="&est=true"}return C}};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;if(C.visible==true){C.clearPopup();C.visible=true}});this.mouseMoveUpAfterListener=PGEvent.addListener(this.pgMappy,"mouseupmapafter",function(){if(C.mapMoving==true&&C.visible==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($("#svobjWrap").length>0){return false}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)}};var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();SEAT.TC.Builder3D=function(A){this.tcMap=A;if(this.tcMap.isMap==true){if(this.tcMap.full==true){this.dvF=window.opener.jQuery("#dvC").val();this.indF=window.opener.jQuery("#indC").val()}else{this.dvF=$("#dvC").val();this.indF=$("#indC").val()}if(this.dvF){this.comDv=this.getCom(this.dvF.toLowerCase())}}else{if(this.tcMap.full==true){this.dv1F=window.opener.jQuery("#paesePartenza").val();this.dv2F=window.opener.jQuery("#paeseArrivo").val();this.ind1F=window.opener.jQuery("#viaPartenza").val();this.ind2F=window.opener.jQuery("#viaArrivo").val()}else{this.dv1F=$("#paesePartenza").val();this.dv2F=$("#paeseArrivo").val();this.ind1F=$("#viaPartenza").val();this.ind2F=$("#viaArrivo").val()}if(this.dv1F&&this.dv2F){this.comDv1=this.getCom(this.dv1F.toLowerCase());this.comDv2=this.getCom(this.dv2F.toLowerCase());if($("#autRtPart")){$("#autRtPart").html(this.comDv1)}if($("#autRtArr")){$("#autRtArr").html(this.comDv2)}}}this.hasPalaces()};SEAT.TC.Builder3D.prototype={BASE_URL_3D:"http://3d.paginegialle.it/flyertc/dbmap3d.html?datasetType=seat&start_dcr=startweb&meteoActive=0",BASE_URL_SEO_3D:"/3d",init:function(){var A=this;if(this.tcMap.isMap==true){$(".3dlinkjs").click(function(){A.open3DMap()})}else{$(".3dlinkjs").click(function(){A.open3DRoute()})}},open3DMap:function(){var A=this.BASE_URL_SEO_3D;if(this.comDv){A+="/"+this.comDv;A+="?initQueryWhere="+this.dvF;if(this.indF!=""){A+="&initQueryAddress="+this.indF.toLowerCase()}}open3DWindow(A)},open3DRoute:function(){var A="";if(this.dv1F&&this.dv2F){A=this.BASE_URL_3D;A+="&initDataset="+this.datasetDv;A+="&initQueryType=route";A+="&where1="+this.dv1F;A+="&where2="+this.dv2F;if(this.ind1F!=""){A+="&add1="+this.ind1F.toLowerCase()}if(this.ind2!=""){A+="&add2="+this.ind2F.toLowerCase()}}else{A=this.BASE_URL_SEO_3D}open3DWindow(A)},getCom:function(C){var A=C.substring(0,C.indexOf(","));var B=A.indexOf("(");if(B!=-1){A=C.substring(0,B-1)}return A},hasComPalaces:function(A){return(A=="milano"||A=="mantova"||A=="torino"||A=="napoli"||A=="roma")},hasPalaces:function(){this.datasetDv="italia";this.withPalaces=false;if(this.tcMap.isMap==true){if(this.dvF){if(this.hasComPalaces(this.comDv)){this.withPalaces=true;this.datasetDv=this.comDv}}}else{if(this.dv1F&&this.dv2F){if(this.comDv1==this.comDv2&&this.hasComPalaces(this.comDv1)){this.withPalaces=true;this.datasetDv=this.comDv1}}}return this.withPalaces}};function open3DWindow(E){var A=800;var D=600;if(window.screen){A=window.screen.availWidth-15;D=window.screen.availHeight-60}var C="width="+A+",height="+D+",top=5,left=0,menubar=yes,location=no,toolbar=no,status=yes";var B=window.open(E,"tc3d",C);B.focus()};SEAT.TC.AtmosphereServices=function(D,B,C,E){var A=this;this.tcMap=D;this.jsLoadedA=false;this.jsLoadedM=false;this.seatLoadJs=SEAT.TC.seatLoadJs;if(E){$.extend(this,E)}this.jsArrayM=B;this.jsArrayA=C;if(jQuery.browser.msie&&parseFloat(jQuery.browser.version)<7){this.seatLoadJs.getScript(this.jsArrayM,function(){A.jsLoadedM=true});this.seatLoadJs.getScript(this.jsArrayA,function(){A.jsLoadedA=true})}if(this.mtEnabled&&this.mtEnabled==true){if($("#mapcontainer")){$("#type").append('<div class="bometeo">meteo</div>')}$(".bometeo").click(function(){if(A.mtActive==false){if(A.airActive==true){A.removeAirQuality()}A.loadJs("meteo")}else{A.removeMeteo()}});if(this.inMtActive&&this.inMtActive=="1"){A.loadJs("meteo")}}if(this.airEnabled&&this.airEnabled==true){if(this.isEstero==false){if($("#mapcontainer")){$("#type").append('<div class="boaria" style="cursor:pointer;">'+msgLabel.LBL_ar_qualita+"</div>")}$(".boaria").click(function(){if(A.airActive==false){if(A.mtActive==true){A.removeMeteo()}A.loadJs("aria")}else{A.removeAirQuality()}});if(this.inAirActive&&this.inAirActive=="1"){A.loadJs("aria")}}}};SEAT.TC.AtmosphereServices.prototype={mtActive:false,airActive:false,loadJs:function(B){var A=this;if(jQuery.browser==="msie"&&jQuery.browser.version<7){if(B==="aria"){if(this.jsLoadedA){this.afterJsLoad(B)}else{A.timer=setInterval(function(){if(A.jsLoadedA){A.afterJsLoad(B)}},100)}}else{if(B==="meteo"){if(this.jsLoadedM){this.afterJsLoad(B)}else{A.timer=setInterval(function(){if(A.jsLoadedM){A.afterJsLoad(B)}},100)}}}}else{if(B==="meteo"){this.seatLoadJs.getScript(this.jsArrayM,function(){A.jsLoadedM=true;if(SEAT.PGMeteo===undefined){A.timer=setInterval(function(){if(SEAT.PGMeteo){A.afterJsLoad(B)}},100)}else{A.afterJsLoad(B)}})}else{if(B==="aria"){this.seatLoadJs.getScript(this.jsArrayA,function(){A.jsLoadedA=true;if(SEAT.PGAir===undefined){A.timer=setInterval(function(){if(SEAT.PGAir){A.afterJsLoad(B)}},100)}else{A.afterJsLoad(B)}})}}}},afterJsLoad:function(B){var A=this;if(A.timer!=undefined){clearInterval(A.timer)}if(B==="meteo"){A.addMeteo()}else{if(B==="aria"){A.addAirQuality()}}},addMeteo:function(){var B=this;var A='<div class="boxbg"><table width="192" cellpadding="0" cellspacing="0"><tbody>';A+='<tr><td colspan="4"><h3 class="dove" id="dvMt"></h3></td></tr>';A+='<tr><td id="imgMt" style="display:none;"></td><td><span class="temp" id="tempMt" style="display:none;"></span></td><td colspan="2"><p class="today"><span id="minMt" style="display:none;"></span><span class="max" id="maxMt" style="display:none;"></span><span style="display:none;" id="windMt"></span></p></td></tr>';A+='<tr><td colspan="4"><h4 id="dayMt" style="display:none;"></h4></td></tr>';A+='<tr class="day" align="center" id="timesMt" style="display:none;"></tr>';A+='<tr class="week" align="center" id="daysMt" style="display:none;"></tr>';A+='<tr><td height="15" colspan="4">'+msgLabel.LBL_mt_fonte+' <span class="foot"><a href="http://www.ilmeteo.it" target="_blank">ilmeteo.it</a></span></td></tr>';A+="</tbody></table></div>";this.meteo=new SEAT.PGMeteo({boxTop:71,boxRight:10,nDays:4,draggable:false,displayClose:false,initLayout:A,dayLayout:'<td><span class="dayDescCls"></span><div class="dayImgCls"/></td>',timeLayout:'<td><span class="timeDescCls"></span><div class="timeImgCls"/></td>',msgLabel:{LBL_mt_sel_icona:msgLabel.LBL_mt_sel_icona,LBL_mt_no_info:msgLabel.LBL_mt_no_info,LBLARR_mt_times:msgLabel.LBLARR_mt_times,LBL_mt_um:msgLabel.LBL_mt_um,LBL_mt_min:msgLabel.LBL_mt_min,LBL_mt_max:msgLabel.LBL_mt_max,LBL_mt_vento:msgLabel.LBL_mt_vento,LBLARR_mt_weekdays:msgLabel.LBLARR_mt_weekdays},imgPath:"http://img.tuttocitta.it/tcolnew/img/meteo",imgMapWidth:40,imgMapHeight:40,imgBoxWidth:32,imgBoxHeight:30,initClass:"close",initLocId:B.locId});this.tcMap.pgMap.addLayer(this.meteo);B.mtActive=true;B.tcMap.meteoActive="1";$(".bometeo").addClass("off");callRedshV52(SEAT.TC.Stat.STATJS_METEO)},removeMeteo:function(){if(this.meteo){this.meteo.closeMeteo()}this.mtActive=false;this.tcMap.meteoActive="0";$(".bometeo").removeClass("off")},addAirQuality:function(){var A=this;this.air=new SEAT.PGAir({boxTop:71,boxRight:10,nDays:4,draggable:false,displayClose:false,dayLayout:'<td><span class="dayDescCls"></span><div class="dayImgCls"/></td>',timeLayout:'<td><span class="timeDescCls"></span><div class="timeImgCls"/></td>',msgLabel:{LBL_ar_sel_icona:msgLabel.LBL_ar_sel_icona,LBL_ar_no_info:msgLabel.LBL_ar_no_info,LBLARR_ar_iqa:msgLabel.LBLARR_ar_iqa,LBLARR_mt_weekdays:msgLabel.LBLARR_mt_weekdays,LBLARR_mt_times:msgLabel.LBLARR_mt_times,LBL_mt_fonte:msgLabel.LBL_mt_fonte,TXT_ar_discl:msgLabel.TXT_ar_discl},imgMapWidth:47,imgMapHeight:28,imgBoxWidth:32,imgBoxHeight:30,initClass:"close",initLocId:A.locId});this.tcMap.pgMap.addLayer(this.air);A.airActive=true;A.tcMap.airActive="1";$(".boaria").addClass("off");callRedshV52(SEAT.TC.Stat.STATJS_ARIA)},removeAirQuality:function(){if(this.air){this.air.closeAir()}this.airActive=false;this.tcMap.airActive="0";$(".boaria").removeClass("off")}};if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());SEAT.loadJs=function(){var A=this;this.jsFiles=[];$("script[src!='']").each(function(C,B){A.jsFiles.push($(B).attr("src"))})};SEAT.loadJs.prototype={exists:function(A){return($.inArray(A,this.jsFiles)>=0)},getScript:function(A,B){this.getAScript($.makeArray(A),0,B)},getAScript:function(C,B,D){var A=this;if(B<C.length){if(!this.exists(C[B])){this.jsFiles.push(C[B]);$.getScript(C[B],function(){A.getAScript(C,B+=1,D)})}else{this.getAScript(C,B+=1,D)}}else{D.call(D)}}};SEAT.TC.SvInternalPromo=function(A){this.tcMap=A;this.init()};SEAT.TC.SvInternalPromo.prototype={svIntArr:[{src:"sv_cappellacolleoni.png",lon:9.662253,lat:45.703432,bear:90,tilt:13.8},{src:"sv_sgiuliabrescia.png",lon:10.22867,lat:45.53977,bear:300,tilt:13.65},{src:"sv_certosapavia.png",lon:9.14745,lat:45.25677,bear:90,tilt:16.05},{src:"sv_monasterolecco.png",lon:9.28799,lat:46.00763,bear:90,tilt:9.3},{src:"sv_ambrogiomilano.png",lon:9.17543,lat:45.46234,bear:90,tilt:6.6},{src:"sv_villarealemonza.png",lon:9.27172,lat:45.59306,bear:90,tilt:2.7},{src:"sv_palazzotemantova.png",lon:10.785908,lat:45.14773,bear:90,tilt:-5.4},{src:"sv_sacromontevarese.png",lon:8.79632,lat:45.8531,bear:90,tilt:13.35},{src:"sv_museovaltellinese.png",lon:9.87328,lat:46.17173,bear:240,tilt:4.65},{src:"sv_duomomilano.png",lon:9.19069,lat:45.464196,bear:90,tilt:1.62,lblIdx:9},{src:"sv_duomocomo.png",lon:9.08336,lat:45.8117,bear:90,tilt:10.04,lblIdx:9},{src:"sv_duomocremona.png",lon:10.02516,lat:45.13344,bear:90,tilt:13.8,lblIdx:9},{src:"sv_duomolodi.png",lon:9.50196,lat:45.31473,bear:240,tilt:15.16,lblIdx:9},{src:"sv_larinascente.png",lon:9.191706,lat:45.464909,bear:90,tilt:17.86,lblIdx:10,dis:SEAT.TC.RinascenteDisabled}],svIntClCookie:"svintcl",svIntClExpDays:1,zoomLimit:3,init:function(){var A=this;this.svIntCl=Cookie.readCookie(this.svIntClCookie);if(this.svIntCl===""){$(this.svIntArr).each(function(){A.svIntCl+="0"})}if(this.tcMap.withExtraLayers==true&&typeof (swfobject)!="undefined"&&swfobject.getFlashPlayerVersion().major>9){this.addIntPoint();this.addIntEvents()}},addIntPoint:function(){var B=this;var C=this.tcMap.pgMap;var A=this.svIntCl;$(this.svIntArr).each(function(D){var F=B.svIntArr[D];if(A.charAt(D)!=="1"&&!(F.dis&&F.dis==="1")){var E='<div class="svIntIco"';if(C.getZoom().z>B.zoomLimit){E+=' style="display:none;"'}E+='><span class="ciudi" id="svIntIcoCl_'+D+'">chiudi</span><img src="'+SEAT.TC.IMG_PFX+"/"+F.src+'"/>';var G;if(F.lblIdx){G=msgLabel.LBLARR_sv_int_ico[F.lblIdx]}else{G=msgLabel.LBLARR_sv_int_ico[D]}E+='<div class="bg" style="display:none"><div class="sposta">'+G+"</div></div>";E+="</div>";F.point=new PGPoint({id:"sv_int_ico"+D,lon:F.lon,lat:F.lat,html:E,width:61,height:73,zIndex:245,overflow:"visible"});C.pointAdder(F.point);$("#"+F.point.id+" .svIntIco").hover(function(){$(this).parent().css("z-index",300);$(this).find(".bg").show()},function(){$(this).parent().css("z-index",245);$(this).find(".bg").hide()});PGEvent.addListener(F.point,"click",function(){callRedshV52(SEAT.TC.Stat.STATJS_STRVIEW_ICOINT);if(B.tcMap.isMap==true){SEAT.TC.streetView.displayStreetViewDirect(F.lon,F.lat,F.bear,F.tilt)}else{location.href="/tcol/mappe?svd=on&lon="+F.lon+"&lat="+F.lat+"&bear="+F.bear+"&tilt="+F.tilt+"&"+B.tcMap.getCurrCoords(true)}});$("#svIntIcoCl_"+D).click(function(){B.addSvIntClosed(D);C.removePoint(F.point)});if(C.getZoom().z>B.zoomLimit){$("#"+F.point.id).hide()}}})},removeIntPoint:function(){var A=this;var B=this.tcMap.pgMap;$(this.svIntArr).each(function(C){var D=A.svIntArr[C];if(D.point&&D.point!==null){B.removePoint(D.point)}D.point=null})},addIntEvents:function(){var A=this;var B=this.tcMap.pgMap;this.evInt1=PGEvent.addListener(B,"zoomafter",function(C){if(C.z<=A.zoomLimit&&C.oldZ>A.zoomLimit){$(".svIntIco").show().parent().show()}});this.evInt2=PGEvent.addListener(B,"zoomaftermap",function(C){if(C.z>3&&C.oldZ<=A.zoomLimit){$(".svIntIco").show().parent().hide()}})},removeIntEvents:function(){if(this.evInt1&&this.evInt1!==null){PGEvent.removeListener(this.evInt1);this.evInt1=null}if(this.evInt2&&this.evInt2!==null){PGEvent.removeListener(this.evInt2);this.evInt2=null}},addSvIntClosed:function(B){var C=this.svIntCl;var A=C.substring(0,B)+"1"+C.substring(B+1,C.length);Cookie.setCookie(this.svIntClCookie,A,this.svIntClExpDays,"/",null,null);this.svIntCl=A}};
