"use strict";(function(a){var c=a.jQuery14;c.isEPIEditMode=(function(){return(document.location.search&&(/idkeep=True/).test(document.location.search))}());c.log=function(d){if(a.console&&a.console.debug){a.console.debug(arguments)}else{if(a.console&&a.console.log){a.console.log(arguments)}else{alert(d)}}};c.uniqueId=function(f){var d=0,e;if(document.getElementById(f+d)){while(document.getElementById(f+d)){d+=1}}e=f+d;return e};c.fn.replaceClass=function(d,e){var f=this;f.removeClass(d);f.addClass(e);return f};c.create=function(B){var j=B,k=j?(j.length?j.length:0):0,q=(j&&j.tagName)?j.tagName:"div",r=document.createElement(q),n=r,x,o=0,m=null,d=j?(j.repeat?true:false):false,w=document.createDocumentFragment(),v=null,l=false,A=[],y;if(!B){return n}if(typeof B==="string"){return document.createElement(B)}if(j.type){n.setAttribute("type",j.type)}if(j.src){n.setAttribute("src",j.src)}if(j){if(c.isArray(j)){w=document.createDocumentFragment();for(o=0;o<k;o+=1){try{w.appendChild(c.create(j[o]))}catch(u){alert(u+"\n\ntagName = "+q+"\n\n"+x+":\n"+j[x]+"\n\ncreate loop (isArray)");break}}r=w}else{for(x in j){if((/(string|function|object|number)/).test(typeof j[x])){if((/^((un)?load|(dbl)?click|change|resize|scroll|select|submit|focus(in|out)?|blur|mouse(enter|leave|over|out|move|down|up)|key(press|down|up))$/).test(x)&&typeof j[x]==="function"){c(n).bind(x,j[x]);if(x==="load"){A.push(j[x])}}else{if(typeof j[x]==="function"){v=j[x]();if(v){if(typeof n.style[x]==="string"){n.style[x]=v}else{n[x]=v}}}else{if(x==="data"){for(y in j[x]){if((/^(object|function|number|string|boolean)$/).test(typeof j[x][y])){c.data(n,y,j[x][y])}}}else{if(!(/(tagName|append(Child(ren)?)?|type|repeat|src)/).test(x)){if(typeof n.style[x]==="string"){n.style[x]=j[x]}else{if(x==="opacity"&&typeof n.style[x]!=="string"){c.alert("Do not use Opacity here","Do it with CSS or the JS lib of your choise")}else{try{if(!((/^(className)$/).test(x)&&!j[x])){n[x]=j[x]}}catch(s){alert(s+"\n\ntagName = "+q+"\n\n"+x+":\n"+j[x]+"\n\nattribute");l=true}}}}else{if((/^(append)(Child(ren)?)?$/).test(x)){if(typeof j[x]==="object"&&j[x].length){for(o=0;o<j[x].length;o+=1){try{n.appendChild(c.create(j[x][o]))}catch(t){alert(t+"\n\ntagName = "+q+"\n\n"+x+":\n"+j[x]+"\n\ncreate loop");l=true}}}else{if(typeof j[x]==="object"){try{n.appendChild(c.create(j[x]))}catch(z){alert(z+"\n\ntagName = "+q+"\n\n"+x+":\n"+j[x]+"\n\ncreate");l=true}}}}}}}}if(l){break}}}}}if(d){w=document.createDocumentFragment();for(o=0;o<j.repeat;o+=1){m=r.cloneNode(true);w.appendChild(m)}r=w}if(A.length){setTimeout(function(){for(o=0;o<A.length;o+=1){A[o].apply(r)}},10)}return r};c.runWhenExists=function b(j,f){var k=0,g=0,d=100,i=0,h=50,e=function(){g+=1;i+=1;if(i>=h){clearInterval(k);try{f()}catch(l){}}if(j()){clearInterval(k);setTimeout(f,100)}if(g===5){clearInterval(k);d=(d*2);g=0;k=setInterval(e,d)}};k=setInterval(e,d)};c.objectWalk=function(e,f,h){var d,g=h?h:[];if(typeof f!=="function"){throw new Error("file: custom.js, Error: "+f+" is not a function")}f.apply(e,g);for(d in e){if(e[d]&&typeof e[d]==="object"&&(!e[d].length&&e[d].length!==0)){c.objectWalk(e[d],f,g)}}};c.runAll=function(){var d=this;c.objectWalk(d,function(){if(this[arguments[0]]){if(typeof this[arguments[0]]==="function"){this[arguments[0]]()}else{if(typeof this[arguments[0]]==="object"&&(!this[arguments[0]].length&&this[arguments[0]].length!==0)){var f,e=this[arguments[0]];for(f in e){if(typeof e[f]==="function"){e[f]()}}}}}},[arguments[0]])};c.runInit=function(d){c.runAll.apply(d,["init"])}}(window));"use strict";(function(a){var b=a.jQuery14;b.CustomCollection=function(){var d=this,e=a.__defineGetter__?true:false,f=function(){if(!d[0]){return 0}else{var h=0;while(d[h]){h+=1}return h}};if(!e){d.getLength=f;d.length=d.getLength()}else{d.__defineGetter__("length",f)}d.addItem=function g(h){d[d.getLength?d.getLength():d.length]=h};d.each=function c(k,n){var j=0,m=d.getLength?d.getLength():d.length,h=false;if(n&&(typeof n==="object"&&((n.length||n.length===0)&&typeof n.length==="number"))){h=true}if(typeof k!=="function"){throw new Error([k+" is not a function"])}for(j=0;j<m;j+=1){if(n&&h){k.apply(d[j],n)}else{k.apply(d[j])}}}}}(window));"use strict";(function(a){var b=a.jQuery14;b.DropDownCollection=function(i){b.CustomCollection.apply(this);var j=this,m=null,l=i?(i.type?i.type:"click"):"click",f=i?(i.align?i.align:"center"):"center",e=i?(i.minWidth?i.minWidth:0):0,o=b("body"),g=i?(i.activeClass?i.activeClass:"active"):"active",k=function(s,r,u){var q=0,t=0,v=0,p=0;if(j[s].length){t=j[s].length;for(q=0;q<t;q+=1){if(j[s][q]&&j[s][q][0]===r&&typeof j[s][q][2]==="function"){j[s][q][2](r,u)}else{if(j[s][q]&&j[s][q][0]===r){p=j[s][q][2].length;for(v=0;v<p;v+=1){j[s][q][2][v](r,u)}}}}}},d=function(p,q){k("onShow",p,q)},n=function(p,q){k("onLeave",p,q)};j.onShow=[];j.onLeave=[];j.setPosition=function(p,s,q){var r={};if(p.hasClass("hide")){p.replaceClass("hide","hidden")}if(!q&&p.ddPos){q=p.ddPos}if(q&&!p.ddPos){p.ddPos=q}r={position:"absolute",minWidth:function(){var t=parseInt(s.width(),10),v=parseInt(s.css("padding-left"),10),w=parseInt(s.css("padding-right"),10),u=parseInt(t+v+w,10);if(e&&u<e){u=e}return u+"px"},top:function(){var u=s.offset(),t=parseInt(s.offsetHeight?s.offsetHeight:s.height(),10);return parseInt(parseInt(u.top,10)+t,10)+"px"},left:function(){var u=s.offset(),t=parseInt(u.left,10),y=parseInt(s.get(0).offsetWidth,10),w=parseInt(this.offsetWidth,10),x=t,A=w,v=y,z=0;if(w>=document.body.offsetWidth){setTimeout(function(){j.setPosition(p,s,q)},100);return z}if(q==="right"){z=parseInt(t+(y-w),10)+"px"}else{if(q==="left"){z=parseInt(u.left,10)+"px"}else{z=parseInt(x+((v/2)-(A/2)),10)+"px"}}return z}};p.css(r);if(p.hasClass("hidden")){p.replaceClass("hidden","hide")}};j.hideOthers=function(p,q){j.each(function(){if(this[0]!==p&&this[1]!==q){this[0].addClass("hide");this[1].removeClass(g)}})};j.hideAll=function(){j.each(function(){this[0].addClass("hide");this[1].removeClass(g)});if(j.type==="click"){o.unbind("click",j.hideAll)}if(m){clearTimeout(m);m=null}};j.type={mouseover:function c(p,u,r){var t=function(){if(m){clearTimeout(m);m=null}},q=function(v){m=setTimeout(function(){j.hideAll();n(p,u)},100)},s=function(v){t();j.hideOthers(p,u);j.setPosition(p,u,r);p.removeClass("hide");u.addClass(g);d(p,u)};u.hover(s,q).mousemove(t);p.hover(s,q).mousemove(t)},click:function h(p,r,q){b(r).click(function(s){s.preventDefault();j.hideOthers(p,r);j.setPosition(p,r,q);b(p).toggleClass("hide");b(this).toggleClass(g);o.unbind("click",j.hideAll);d(p,r)});b(r,p).hover(function(){o.unbind("click",j.hideAll)},function(){setTimeout(function(){o.bind("click",j.hideAll)},30)})}};j.addDropDown=function(r,u,t){var s=t?(t.align?t.align:f):f,q=function(A,y,B){if(typeof t[A]==="function"){j[A].push([y,B,t[A]])}else{var w=0,z=t[A].length,x=[];for(w=0;w<z;w+=1){x.push(t[A][w])}j[A].push([y,B,x])}},v=t?(t.onShow?function(){q("onShow",r,u)}:null):null,p=t?(t.onLeave?function(){q("onLeave",r,u)}:null):null;if(v){v()}if(p){p()}j.addItem([r,u]);o.append(r);j.hideAll();j.setPosition(r,u,s);b(r,u).addClass("dropDownCollection");if(t&&t.type){j.type[t.type](r,u,s)}else{j.type[l](r,u,s)}}}}(window));"use strict";(function(e){var f=e.jQuery14,a={},b=new f.DropDownCollection({type:"mouseover",align:"left",activeClass:"selected",minWidth:150});a={googleMaps:{init:function(){if((/MSIE\s\d/).test(e.navigator.userAgent)){f.runWhenExists(function(){if(e.google&&e.google.maps&&e.google.maps.Load){e.google.maps.Load();return false}if(e.google&&e.google.maps&&e.google.maps.LatLng){return true}else{return false}},a.googleMaps.initMap)}else{f.runWhenExists(function(){if(e.google&&e.google.maps&&e.google.maps.LatLng){return true}else{return false}},a.googleMaps.initMap)}},initMap:function d(n){if(e.google&&document.getElementById("map_canvas")){var i=new google.maps.LatLng(63.0748656905866,16.5234375),j=f("#coords").val()?(function(){var o=f("#coords").val().split(",");return new google.maps.LatLng(o[0],o[1])}()):i,m={zoom:11,center:j,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}},k=new google.maps.Map(document.getElementById("map_canvas"),m),l=new google.maps.Marker({icon:new google.maps.MarkerImage("/UI/Images/VW/poi.png"),map:k,position:j,visible:true});google.maps.event.addListener(l,"click",function(){f("#mapsDialog").remove();f(f.create({id:"mapsDialog"})).dialog({position:["center","top"],width:"600px",height:"400px"});f("#mapsDialog").css({width:"600px",height:"400px"});var r=new google.maps.Map(document.getElementById("mapsDialog"),m),o=new google.maps.Marker({icon:new google.maps.MarkerImage("/UI/Images/VW/poi.png"),map:r,position:j,visible:true}),q=function(){var s=this,u=s.offsetWidth,t=document.body.offsetWidth;return parseInt((t/2)-(u/2),10)+"px"},p=function(){var s=e.pageYOffset?e.pageYOffset:document.documentElement.scrollTop;return parseInt(s+100,10)+"px"};f("body > .ui-dialog").css({padding:"10px",border:"solid 1px #000",background:"#fff",position:"absolute",top:p,left:q});f(e).resize(function(){f("body > .ui-dialog").css({top:p,left:q})});google.maps.event.addListener(o,"click",function(s){})})}}},clickablePuff:{init:function(){f("body").find("div.clickable, div.click").delegate("*","click",function(j){j.preventDefault();var k=this,l=f(k),m=l.closest("div.clickable, div.click"),i=m.find("a.getLink"),n=i.get(0)?(i.get(0).rel?(/(^|\s)external(\s|$)/).test(i.get(0).rel):false):false;if(j){j.stopPropagation();j.preventDefault()}if(n){if((/^a$/i).test(k.tagName)){e.open(k.href)}else{e.open(i.attr("href"))}}else{if((/^a$/i).test(k.tagName)){document.location=k.href}else{document.location=i.attr("href")}}})}},dropDownMenus:{init:function(){f("div.header > ul.nav > li").each(function(){var j=this,k=f(j),l=k,i=k.find("> ul.nav");b.addDropDown(i,l)})}},region:{init:function(){f("div.header").find("> p > a").each(function(){var m=this.innerHTML.split(" "),n="",j=0,k=m.length;for(j=0;j<k;j+=1){if(!j){n+="<span>"+m[j]+"</span>"}else{if(j===1){n+=m[j]}else{n+=" "+m[j]}}}this.innerHTML=n})}},imageSlider:{init:function(){var l=f(".smallImageSlider"),A=f(".imageSlider"),u=A.find("li"),t=A.find("li"),m=true,i=null,p=false,n=false,y=0,w="-940px",v=1000,r=1000,z=5000,j=parseInt(f("#hiddenSlideShow").val(),10),q=j?(j*1000):z,k={tagName:"ul",className:"slideCounter",append:[]},x=function x(B){var C=parseInt(B+1,10);f(this).addClass("slide"+C);k.append.push({tagName:"li",click:function(){clearTimeout(i);p=true;var F=this,I=f(F),H=A.find("ul"),D=H.find("li"),E=0,G=D.length;for(E=0;E<G;E+=1){if(f(D[E]).hasClass("slide"+C)){break}H.append(D[E])}I.parent().find("li").removeClass("active");I.addClass("active")},className:(!B)?"active":"",append:{tagName:"span",innerHTML:function(){if(!B){return'<span class="bracket">[</span> '+C}else{if(B===(t.length-1)){return C+' <span class="bracket">]</span>'}else{return C}}}}})},o=function o(E){var B=l.find("ul"),C=B.find("li:last-child"),D=B.find("li:first-child");if(E==="left"){m=false;B.find("li:first-child").clone().insertAfter(B.find("li:last-child"));l.find("ul").animate({left:"-275px"},r,function(){B.find("li:first-child").remove();B.css("left","0px");m=true})}else{m=false;B.find("li:last-child").clone().insertBefore(B.find("li:first-child"));B.css("left","-275px");l.find("ul").animate({left:0},r,function(){B.find("li:last-child").remove();B.css("left","0px");m=true})}},s=function s(){A.find("ul").animate({left:w},v,function(){if(p){clearTimeout(i);p=false}else{var B=A.find("ul"),C=B.find("li:first-child").get(0),D="";B.append(C);B.css("left","0");D=B.find("li:first-child").attr("class").replace(/\D/g,"");f("ul.slideCounter").find("li").removeClass("active").parent().find("li:nth-child("+D+")").addClass("active");i=setTimeout(s,q)}})};l.find("ul").each(function(){var B=this,C=parseInt(B.parentNode.offsetWidth*u.length,10);B.style.width=C+"px"});f(".smallImageSliderLeft").click(function(){if(m){o("left")}});f(".smallImageSliderRight").click(function(){if(m){o("right")}});if(t.length>1){A.after(f.create({tagName:"span",className:"play",cursor:"pointer",innerHTML:" <!-- --> ",click:function(){p=false;s()}}));t.each(x);A.parent().find(".play").after(f.create(k));A.find("ul").each(function(){var B=this,C=parseInt(B.parentNode.offsetWidth*t.length,10);B.style.width=C+"px"});i=setTimeout(s,q)}}},init:{relExternal:function g(){f("body").delegate("a","click",function(j){var k=this,i=/(^|\s)(external|popup)(\s|$)/;if(k.rel&&(i).test(k.rel)){j.preventDefault();e.open(k.href,"","")}})},removeEmptyTags:function(){f("div").each(function(){var j=this,i=f.trim(j.innerHTML.replace(/\n/g,""));if((!j.className&&!j.id&&!i)||(j.className&&(/(^|\s)(main(Intro|Body))(\s|$)/).test(j.className)&&!i)){f(j).remove()}});f("p:empty").remove()},startPageIEFix:function(){f.runWhenExists(function(){return f(".slideCounter + input + *").length},function(){f(".slideCounter + input + *").addClass("afterSlider")})},paging:function(){f("div.paging").find("a:first-child, a:last-child").each(function(){var i=this,j=(/\D/).test(f.trim(i.innerHTML));if(j){f(i).addClass("icon").append("<span> <!-- --> </span>")}})},"2000":function h(){try{delete e.jQuery14}catch(i){}},"3000":function c(){f("body").addClass("ready")}}};if(f.view){f.extend(true,f.view,a)}else{f.extend({view:a})}f(document).ready(function(){f.runInit(a)})}(window));
