seat=(typeof (seat)==="undefined")?{}:seat;seat.utils=(typeof (seat.utils)==="undefined")?{}:seat.utils;seat.utils.refreshAjaxContent=function(A){var B={};if(typeof (A)==="string"){B=jQuery(A);}else{B=A;}jQuery(document).trigger("ajax.loaded",B);};seat.utils.checkboxLabelActivation=function(){jQuery("body").delegate(".seat_formelement_checkbox_withrichtext div.seat_label_checkbox","click",function(){$(this).parent().children(".seat_checkbox").eq(0).click();});};seat.utils.imageCache=[];seat.utils.preLoadImages=function(){var A=jQuery(".seat_mainnav_flyout");jQuery.each(A,function(B,C){if((jQuery(C).metadata()!=undefined)&&(jQuery(C).metadata().url!=undefined)){seat.utils.imageCache[B]=new Image();seat.utils.imageCache[B].src=jQuery(C).metadata().url;}else{}});};seat.utils.imagePath=function(){faviconElements=jQuery("link[rel='shortcut icon']");imagePath="";if(faviconElements.length>0&&faviconElements.attr("href")!=undefined){imagePath=faviconElements.attr("href").replace("favicon.ico","");
}return imagePath;};seat.utils.log=function(){var B="[log] "+Array.prototype.join.call(arguments,"");var A=$.query.get("displayconsole");if(A=="true"){if($("#seat_logging_console").length==0){$("<div>").attr("id","seat_logging_console").css("background-color","white").css("float","left").css("width","95%").css("height","150px").css("padding","20px").css("color","black").css("overflow","scroll").appendTo("body");$("#seat_logging_console").append("<div class='seat_logging_console_header'>Logging Console</div>");}$("#seat_logging_console").append("<br />"+B);}else{if(window.console&&window.console.log){window.console.log(B);}else{if(window.opera&&window.opera.postError){window.opera.postError(B);}else{}}}};if(typeof (cufon_inactive)==="undefined"||!cufon_inactive){jQuery(".seat_mainnav ul").eq(0).hide();$(document).bind("ajax.loaded.cufon",function(A,B){Cufon.replace($(".seat_font_regular",B).get(),{fontFamily:"Seat Meta Normal Roman",hover:true});Cufon.replace($(".seat_font_medium",B).get(),{fontFamily:"Seat Meta Normal Roman",hover:true});
Cufon.replace($(".seat_font_bold",B).get(),{fontFamily:"Seat Meta Bold Roman",hover:true});Cufon.now();});$(document).trigger("ajax.loaded",document);}(function(B){var A={pager:function(C,F){var E=jQuery(F).parent().children().length,D=(0==C)?"seat_slideshow_pager":"seat_slideshow_pager activeSlide";return'<li class="'+D+'">'+(C+1)+" / "+E+"</li>";},previous:function(C){C.data.slideshow.cycle("prev");return false;},next:function(C){C.data.slideshow.cycle("next");return false;},resume:function(C){jQuery(this).parent().removeClass("seat_slideshow_pause");C.data.slideshow.cycle("resume");return false;},pause:function(C){jQuery(this).parent().addClass("seat_slideshow_pause");C.data.slideshow.cycle("pause");return false;},after:function(E,D,G,C){var H=(true===C)?E:D,F=jQuery(E).closest(".seat_slideshow").parent().find(".seat_slideshow_controls_download ul"),I=jQuery(H).metadata(),J="";F.empty();if(undefined===I.download||0===I.download.length){F.parent().hide();return ;}jQuery.each(I.download,function(){J+='<li><a href="'+this.url+'" target="_blank">'+this.title+"</a></li>";
});F.append(J).parent().show();},fullscreen:function(){var G="960px";var C="720px";if(jQuery(this).closest(".seat_slideshow_controls").parent().hasClass("seat_media_header")){C="540px";}var D=jQuery(this).closest(".seat_slideshow_controls").parent().clone(),F={width:G,height:C},H;var E=jQuery(this).closest(".seat_slideshow_controls").parent().find(".seat_slideshow").data("cycle.opts");if(null!=E){H=E.currSlide;}else{H=0;}if(undefined===H){H=0;}D.find(".seat_slideshow_slide img").each(function(){var J=jQuery(this),I=J.metadata();if(I.fullscreen){J.attr({src:I.fullscreen}).removeAttr("width").removeAttr("height");}});if(D.hasClass("seat_media_header_big")){F.height="540px";}D.find("li.seat_slideshow_controls_fullscreen a").bind("click",B.colorbox.close);B.colorbox({html:D,innerWidth:F.width,innerHeight:F.height});jQuery("#cboxContent .seat_slideshow").seat_slideshow(H).css({width:F.width,height:F.height});if(true===jQuery(this).hasClass("seat_slideshow_controls_download")){jQuery("#cboxContent .seat_slideshow_controls_download ul").css("visibility","visible").hover(function(){},function(){jQuery("#cboxContent .seat_slideshow_controls_download ul").css("visibility","");
});}addthis.button(".seat_addthis_button");return false;}};B.fn.seat_slideshow=function(D){var C={fx:"fade",pagerAnchorBuilder:A.pager,before:A.after,startingSlide:0,autoSlide:false,timeout:4000,speed:1000};return B(this).each(function(){var I=jQuery(this),E="seat_slideshow_controls_pager",F=I.parent(),H=F.find(".seat_slideshow_controls"),G=new Date().getTime().toString();jQuery('<ul class="seat_slideshow_controls_pager"></ul>').prependTo(H);C.pager=E+G+Math.floor(Math.random()*10000).toString();F.find("."+E).addClass(C.pager);C.pager="."+C.pager;if(I.metadata().transitionEffect){C.fx=I.metadata().transitionEffect;}if(I.metadata().transitionEffectDuration){C.speed=I.metadata().transitionEffectDuration;}if(I.metadata().autoSlide){C.autoSlide=I.metadata().autoSlide;}if(I.metadata().autoSlideInterval){C.timeout=I.metadata().autoSlideInterval;}if(undefined!==D){C.startingSlide=D;}if(C.autoSlide==true){I.cycle(C).cycle("resume");}else{jQuery(this).parent().find("a.seat_slideshow_controls_pause").parent().addClass("seat_slideshow_pause");
if(I.children().length>1){I.cycle(C).cycle("pause");}else{A.after(I.children(":first"),I.children(":first"),C,false);}}F.find("a.seat_slideshow_controls_previous").bind("click",{slideshow:I},A.previous);F.find("a.seat_slideshow_controls_next").bind("click",{slideshow:I},A.next);F.find("a.seat_slideshow_controls_resume").bind("click",{slideshow:I},A.resume);F.find("a.seat_slideshow_controls_pause").bind("click",{slideshow:I},A.pause);F.find("li.seat_slideshow_controls_fullscreen a").bind("click",{slideshow:I},A.fullscreen);if(true===F.parent().hasClass("seat_content_media_small")){F.parent().find("li.seat_slideshow_controls_download").bind("click",{slideshow:I},A.fullscreen);}});};})(jQuery);seat_sitemap=function(){jQuery("ul.seat_sitemap > li.seat_has_submenu > a").click(seat_sitemap_openSubmenu);jQuery("ul.seat_sitemap > li > a").eq(0).trigger("click");};seat_sitemap_resetSubmenus=function(){jQuery(".seat_subcol_sitemap .seat_sitemap_thirdcolumn").html("");};seat_sitemap_setColumnHeader=function(B){var A=jQuery(B).children("a");
jQuery(".seat_subcol_sitemap .seat_sitemap_category").text(A.text());};seat_sitemap_openSubmenu=function(A){parentMenu=jQuery(A.target).parent();seat_sitemap_resetSubmenus();seat_sitemap_setColumnHeader(parentMenu);jQuery(parentMenu).children("ul").eq(0).clone().appendTo(jQuery(".seat_subcol_sitemap .seat_sitemap_thirdcolumn"));return false;};seat_mainnav=function(){var A;seat_mainnav_reformatMainNav();jQuery(".seat_template_homepage .seat_mainnav li").mouseover(function(B){clearTimeout(A);A=setTimeout(function(){seat_mainnav_handleMouseOver(B);},500);});jQuery(".seat_template_homepage .seat_mainnav").mouseleave(function(B){clearTimeout(A);A=setTimeout(function(){seat_mainnav_handleMouseOut(B);},500);});jQuery(".seat_template_homepage .seat_mainnav ul").mouseleave(function(B){clearTimeout(A);});};function seat_mainnav_handleMouseOver(C){if(jQuery(C.currentTarget).hasClass("seat_mainnav_flyout")){var D=jQuery(C.currentTarget).metadata().url;var A=jQuery(C.currentTarget).metadata().backgroundcolor;
var E=jQuery(".seat_template_homepage #seat_mainnav_flyout_container").eq(0);var B=jQuery(".seat_template_homepage .seat_mainnav_flyout_content").eq(0);E.show();E.css({backgroundImage:"url("+D+")"});B.html("");B.css({backgroundColor:A});jQuery(C.currentTarget).children("ul.seat_mainnav_secondlevel").clone().appendTo(B);}else{seat_mainnav_handleMouseOut(C);}}function seat_mainnav_handleMouseOut(A){jQuery(".seat_template_homepage #seat_mainnav_flyout_container").eq(0).hide();}function seat_mainnav_reformatMainNav(){jQuery(".seat_mainnav ul").eq(0).show();jQuery(".seat_justify_fix").eq(0).remove();var I=jQuery(".seat_mainnav").eq(0);var G=I.children("ul").eq(0);var B=G.children("li");var K=0;var A=0;var F=I.width()-1;jQuery.each(B,function(M){if(($(this).text())&&($(this).text()!="")){K+=$(this).width();A+=1;}});var E=F-K;var C=A*2;var D=E/C;var J=Math.round(D);var H=F-((J*C)+K);var L=J;jQuery.each(B,function(M){if(($(this).text())&&($(this).text()!="")){if(H>0){L=J+1;H-=1;}else{if(H<0){L=J-1;
H+=1;}else{L=J;}}$(this).children("a").eq(0).css({paddingLeft:L+"px"});$(this).children("a").eq(0).css({paddingRight:J+"px"});}});}seat=(typeof (seat)==="undefined")?{}:seat;seat.dealer_search=(typeof (seat.dealer_search)==="undefined")?{}:seat.dealer_search;seat.dealer_search.mapmarker_path=seat.utils.imagePath()+"google-maps/";seat.dealer_search.mapmarker_prefix="googlemap_marker";seat.dealer_search.mapmarker_extension="png";seat.dealer_search.mapmarker_maxcount=20;seat.dealer_search.phone_text="Phone";seat.dealer_search.fax_text="Fax";seat.dealer_search.map_targetdiv="";seat.dealer_search.map;seat.dealer_search.markerArray={};seat.dealer_search.googleMap=function(A){if((jQuery("#seat_dealersearch_form").length>0)&&(jQuery(".seat_dealersearch_step1").length==0)){seat.dealer_search.map_targetdiv=A;$.ajax({url:"http://maps.googleapis.com/maps/api/js?sensor=false&async=2&callback=seat.dealer_search.renderGoogleMap",dataType:"script",error:function(B,D,C){seat.dealer_search.renderGoogleMapError();
},timeout:6000});jQuery(".seat_dealersearch_maplink").click(function(B){seat.dealer_search.openInfoWindow(B);return false;});}};seat.dealer_search.renderGoogleMapError=function(){if(seat.dealer_search.result_list!=undefined){$("<div>").attr("class","seat_richtext").html(seat.dealer_search.result_list.googleNotAvailableMessage).appendTo(jQuery("#"+seat.dealer_search.map_targetdiv));}};seat.dealer_search.renderGoogleMap=function(){var C=[];var G=false;if(seat.dealer_search.result_list!=undefined&&seat.dealer_search.result_list.displaymode!=undefined&&seat.dealer_search.result_list.displaymode=="details"){G=true;}try{if(seat.dealer_search.result_list){C=seat.dealer_search.result_list.result_list;}}catch(E){}if(C.phone_text!=undefined){seat.dealer_search.phone_text=C.phone_text;}if(C.fax_text!=undefined){seat.dealer_search.fax_text=C.fax_text;}var D=seat.dealer_search.midpoint(C);var A=seat.dealer_search.mapboundaries(C);var B=seat.dealer_search.mapOptions(G,D);try{seat.dealer_search.map=new google.maps.Map(document.getElementById(seat.dealer_search.map_targetdiv),B);
}catch(E){}try{if(C.length>1){seat.dealer_search.map.fitBounds(A);}}catch(E){}var F=new google.maps.InfoWindow({content:""});jQuery(C).each(function(J,L){try{var H=seat.dealer_search.marker(L);var M=seat.dealer_search.contentString(L);var I=seat.dealer_search.mapLink(L);}catch(K){}seat.dealer_search.markerArray["marker_"+L.partner_id]={marker:H,infowindow:M,trackingdata:I};google.maps.event.addListener(seat.dealer_search.markerArray["marker_"+L.partner_id].marker,"click",function(N){F.close();F=new google.maps.InfoWindow({content:seat.dealer_search.markerArray["marker_"+L.partner_id].infowindow});F.open(seat.dealer_search.map,seat.dealer_search.markerArray["marker_"+L.partner_id].marker);if(N.manually_triggered!="true"&&I!=undefined){$("body").trackClick({callback:seat.config.onClickTrack,target:I});}});});};seat.dealer_search.openInfoWindow=function(B){parent_id=jQuery(B.target).parents(".seat_dealer_details").attr("id");try{google.maps.event.trigger(seat.dealer_search.markerArray["marker_"+parent_id].marker,"click",{manually_triggered:"true"});
}catch(A){}return false;};seat.dealer_search.mapLink=function(A){var B=undefined;var D=A.partner_id;if((D!=undefined)&&(jQuery("#"+D).length>0)){var C=jQuery("#"+D+" button.seat_dealersearch_maplink");if(C.hasClass("seat_track_click")){B=jQuery("#"+D+" button.seat_dealersearch_maplink").clone(true).attr("id",("seat_dealersearch_marker_"+D));}}return B;};seat.dealer_search.contentString=function(B){var A=$("<div>");A.attr("class","seat_dealersearch_infowindow");var C=$("<div>").attr("class","seat_dealer_detaildata");if(B.name!=undefined){C.append($("<div>").attr("class","seat_dealersearch_infowindow_name").text(B.name));}if(B.street!=undefined){C.append($("<div>").attr("class","seat_dealersearch_infowindow_street").text(B.street));}if((B.zip_code!=undefined)&&(B.city!=undefined)){C.append($("<div>").attr("class","seat_dealersearch_infowindow_zip_city").text(B.zip_code+" "+B.city));}if(B.phone1!=undefined&&B.phone1!=""){C.append($("<div>").attr("class","seat_dealersearch_infowindow_phone1").text(seat.dealer_search.phone_text+": "+B.phone1));
}if(B.fax1!=undefined&&B.fax1!=""){C.append($("<div>").attr("class","seat_dealersearch_infowindow_fax1").text(seat.dealer_search.fax_text+": "+B.fax1));}if((B.partner_id!=undefined)&&(jQuery("#"+B.partner_id).length>0)){jQuery("#"+B.partner_id+" button.seat_dealersearch_detaillink").clone(true).attr("id",("infoWindowId"+B.partner_id)).appendTo(C);}C.appendTo(A);if(jQuery("#"+B.partner_id+" .seat_dealer_detailicons").length>0){jQuery("#"+B.partner_id+" .seat_dealer_detailicons").clone().appendTo(A);}return A.get(0);};seat.dealer_search.marker=function(B){var D="";if(B.result_ranking<=seat.dealer_search.mapmarker_maxcount){D="_"+B.result_ranking;}var C=new google.maps.Size(33,32);var A=new google.maps.Marker({position:new google.maps.LatLng(B.mapcoordinate.latitude,B.mapcoordinate.longitude),map:seat.dealer_search.map,title:B.name,icon:new google.maps.MarkerImage(seat.dealer_search.mapmarker_path+seat.dealer_search.mapmarker_prefix+D+"."+seat.dealer_search.mapmarker_extension,C,null,null,C)});
return A;};seat.dealer_search.findGeographicCorners=function(B){var C={maxLatitude:-999,maxLongitude:-999,minLatitude:999,minLongitude:999,midLatitude:0,midLongitude:0};try{jQuery(B).each(function(G,I){var F=parseFloat(I.mapcoordinate.latitude);var H=parseFloat(I.mapcoordinate.longitude);if(F>C.maxLatitude){C.maxLatitude=F;}if(F<C.minLatitude){C.minLatitude=F;}if(H>C.maxLongitude){C.maxLongitude=H;}if(H<C.minLongitude){C.minLongitude=H;}});}catch(E){}var A=C.maxLongitude-C.minLongitude;var D=C.maxLatitude-C.minLatitude;if(A<0.002){C.maxLatitude=C.maxLatitude+0.004;C.minLatitude=C.minLatitude-0.004;}if(D<0.002){C.maxLongitude=C.maxLongitude+0.004;C.minLongitude=C.minLongitude-0.004;}C.midLongitude=seat.dealer_search.precisionRound(((C.maxLongitude+C.minLongitude)/2),7);C.midLatitude=seat.dealer_search.precisionRound(((C.maxLatitude+C.minLatitude)/2),7);return C;};seat.dealer_search.precisionRound=function(C,A){A=Math.abs(parseInt(A))||0;var B=Math.pow(10,A);return Math.round(C*B)/B;};seat.dealer_search.mapOptions=function(D,B){try{var E=new google.maps.LatLng(B.latitude,B.longitude);
}catch(C){}var A={zoom:8,center:E,mapTypeId:google.maps.MapTypeId.ROADMAP,scaleControl:true};if(D==true){A.mapTypeControl=false;A.zoom=15;}else{A.disableDoubleClickZoom=true;A.scrollwheel=false;A.draggable=false;A.disableDefaultUI=true;}return A;};seat.dealer_search.mapboundaries=function(B){var C=seat.dealer_search.findGeographicCorners(B);var A=new google.maps.LatLngBounds(new google.maps.LatLng(C.minLatitude,C.minLongitude),new google.maps.LatLng(C.maxLatitude,C.maxLongitude));return(A);};seat.dealer_search.midpoint=function(A){var B;if(A.length>1){B={latitude:A[0].mapcoordinate.latitude,longitude:A[0].mapcoordinate.longitude};}else{var C=seat.dealer_search.findGeographicCorners(A);B={latitude:C.midLatitude,longitude:C.midLongitude};}return B;};$(document).ready(function(){$(".seat_language_container").supersleight();$(".seat_popup").seat_popup();$(document).bind("ajax.loaded.popup",function(A,B){$(".seat_popup",B).seat_popup();});jQuery(".seat_slideshow").seat_slideshow();$(document).bind("ajax.loaded.slideshow",function(A,B){$(".seat_slideshow",B).seat_slideshow();
});$(".seat_flash").seat_flash();$(document).bind("ajax.loaded.flash",function(A,B){$(".seat_flash",B).seat_flash();});seat_sitemap();$(document).bind("ajax.loaded.seat_sitemap",function(A,B){seat_sitemap();});seat.utils.checkboxLabelActivation();seat.dealer_search.googleMap("seat_dealersearch_maparea");$(document).bind("ajax.loaded.seat_dealersearch_form",function(A,B){seat.dealer_search.googleMap("seat_dealersearch_maparea");});seat.utils.preLoadImages();$(document).bind("ajax.loaded.seat_mainnav",function(A,B){seat.utils.preLoadImages();});Cufon.CSS.ready(function(){seat_mainnav();});$(".seat_video").seat_video();if($.tracking){$(".seat_track_click").trackClickListener({callback:seat.config.onClickTrack});$(document).bind("ajax.loaded.clicktracking",function(A,B){$(".seat_track_click",B).trackClickListener({callback:seat.config.onClickTrack});});}});
