/*	ColorBox v1.3.3 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */
(function(c){var s="colorbox",B="hover",o=true,g=false,e,E=!c.support.opacity,N=E&&!window.XMLHttpRequest,O="click.colorbox",fa="cbox_open",J="cbox_load",P="cbox_complete",Q="cbox_cleanup",aa="cbox_closed",R="resize.cbox_resize",u,j,x,p,S,T,U,V,h,r,n,K,L,ba,W,y,F,G,M,C,D,z,A,m,k,a,H,I,X,Y={transition:"elastic",speed:350,width:g,height:g,innerWidth:g,innerHeight:g,initialWidth:"400",initialHeight:"400",maxWidth:g,maxHeight:g,scalePhotos:o,scrolling:o,inline:g,html:g,iframe:g,photo:g,href:g,title:g, rel:g,opacity:0.9,preloading:o,current:"Zdj\u0119cie {current} z {total}",previous:"previous",next:"next",close:"close",open:g,overlayClose:o,slideshow:g,slideshowAuto:o,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",preloadIMG:o};function v(b,d){d=d==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function Z(b){return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)} function ca(){for(var b in a)if(typeof a[b]==="function")a[b]=a[b].call(m)}e=c.fn.colorbox=function(b,d){this.length?this.each(function(){var i=c(this).data(s)?c.extend({},c(this).data(s),b):c.extend({},Y,b);c(this).data(s,i).addClass("cboxelement")}):c(this).data(s,c.extend({},Y,b));c(this).unbind(O).bind(O,function(i){m=this;a=c(m).data(s);ca();X=d||g;var l=a.rel||m.rel;if(l&&l!=="nofollow"){h=c(".cboxelement").filter(function(){var f=c(this).data(s).rel||this.rel;return f===l});k=h.index(m);if(k< 0){h=h.add(m);k=h.length-1}}else{h=c(m);k=0}if(!H){I=H=o;c().bind("keydown.cbox_close",function(f){if(f.keyCode===27){f.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(f){if(f.keyCode===37){f.preventDefault();G.click()}else if(f.keyCode===39){f.preventDefault();F.click()}});a.overlayClose&&u.css({cursor:"pointer"}).one("click",e.close);m.blur();c.event.trigger(fa);M.html(a.close);u.css({opacity:a.opacity}).show();a.w=v(a.initialWidth,"x");a.h=v(a.initialHeight,"y");e.position(0); N&&r.bind("resize.cboxie6 scroll.cboxie6",function(){u.css({width:r.width(),height:r.height(),top:r.scrollTop(),left:r.scrollLeft()})}).trigger("scroll.cboxie6")}e.slideshow();e.load();i.preventDefault()});b&&b.open&&c(this).triggerHandler(O);return this};e.init=function(){function b(d){return c('<div id="cbox'+d+'"/>')}r=c(window);j=c('<div id="colorbox"/>');u=b("Overlay").hide();x=b("Wrapper");p=b("Content").append(n=b("LoadedContent").css({width:0,height:0}),K=b("LoadingOverlay"),L=b("LoadingGraphic"), ba=b("Title"),W=b("Current"),y=b("Slideshow"),F=b("Next"),G=b("Previous"),M=b("Close"));x.append(c("<div/>").append(b("TopLeft"),S=b("TopCenter"),b("TopRight")),c("<div/>").append(T=b("MiddleLeft"),p,U=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),V=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});c("body").prepend(u,j.append(x));if(E){j.addClass("cboxIE");N&&u.css("position","absolute")}p.children().addClass(B).mouseover(function(){c(this).addClass(B)}).mouseout(function(){c(this).removeClass(B)}).hide(); C=S.height()+V.height()+p.outerHeight(o)-p.height();D=T.width()+U.width()+p.outerWidth(o)-p.width();z=n.outerHeight(o);A=n.outerWidth(o);j.css({"padding-bottom":C,"padding-right":D}).hide();F.click(e.next);G.click(e.prev);M.click(e.close);p.children().removeClass(B)};e.position=function(b,d){var i=document.documentElement.clientHeight;i=Math.max(i-a.h-z-C,0)/2+r.scrollTop();var l=Math.max(document.documentElement.clientWidth-a.w-A-D,0)/2+r.scrollLeft();b=j.width()===a.w+A&&j.height()===a.h+z?0:b; x[0].style.width=x[0].style.height="9999px";function f(q){S[0].style.width=V[0].style.width=p[0].style.width=q.style.width;L[0].style.height=K[0].style.height=p[0].style.height=T[0].style.height=U[0].style.height=q.style.height}j.dequeue().animate({width:a.w+A,height:a.h+z,top:i,left:l},{duration:b,complete:function(){f(this);I=g;x[0].style.width=a.w+A+D+"px";x[0].style.height=a.h+z+C+"px";d&&d()},step:function(){f(this)}})};e.resize=function(b){if(H){function d(w){e.position(w,function(){if(H){if(E){q&& n.fadeIn(100);j[0].style.removeAttribute("filter")}p.children().show();if(a.iframe)n.append("<iframe id='cboxIframe'"+(a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+(a.href||m.href)+"' />");K.hide();L.hide();y.hide();if(h.length>1){W.html(a.current.replace(/\{current\}/,k+1).replace(/\{total\}/,h.length));F.html(a.next);G.html(a.previous);a.slideshow&&y.show()}else{W.hide();F.hide();G.hide()}ba.html(a.title||m.title);c.event.trigger(P);X&&X.call(m); a.transition==="fade"&&j.fadeTo(t,1,function(){E&&j[0].style.removeAttribute("filter")});r.bind(R,function(){e.position(0)})}})}function i(){a.h=a.h||n.height();return a.h}function l(){a.w=a.w||n.width();return a.w}var f,q,t=a.transition==="none"?0:a.speed;r.unbind(R);if(b){n.remove();n=c('<div id="cboxLoadedContent"/>').html(b);n.hide().appendTo(u).css({width:l(),overflow:a.scrolling?"auto":"hidden"}).css({height:i()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});N&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!== "hidden"}).css({visibility:"hidden"}).one(Q,function(){this.style.visibility="inherit"});a.transition==="fade"&&j.fadeTo(t,0,function(){d(0)})||d(t);if(a.preloading&&h.length>1){b=k>0?h[k-1]:h[h.length-1];f=k<h.length-1?h[k+1]:h[0];f=c(f).data(s).href||f.href;b=c(b).data(s).href||b.href;Z(f)&&c("<img />").attr("src",f);Z(b)&&c("<img />").attr("src",b)}}else b=setTimeout(function(){var w=n.wrapInner("<div style='overflow:auto'></div>").children();a.h=w.height();n.css({height:a.h});w.replaceWith(w.children()); e.position(t)},1)}};e.load=function(){var b,d,i,l=e.resize;I=o;function f(q){var t=c(q),w=t.find("img"),$=w.length;function da(){var ea=new Image;$-=1;if($>=0&&a.preloadIMG){ea.onload=da;ea.src=w[$].src}else l(t)}da()}m=h[k];a=c(m).data(s);ca();c.event.trigger(J);a.h=a.height?v(a.height,"y")-z-C:a.innerHeight?v(a.innerHeight,"y"):g;a.w=a.width?v(a.width,"x")-A-D:a.innerWidth?v(a.innerWidth,"x"):g;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=v(a.maxWidth,"x")-A-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh= v(a.maxHeight,"y")-z-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href||c(m).attr("href");K.show();L.show();M.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(J+" "+Q,function(){c(this).replaceWith(n.children())});l(c(b))}else if(a.iframe)l(" ");else if(a.html)f(a.html);else if(Z(b)){d=new Image;d.onload=function(){var q;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){i=function(){d.height-=d.height* q;d.width-=d.width*q};if(a.mw&&d.width>a.mw){q=(d.width-a.mw)/d.width;i()}if(a.mh&&d.height>a.mh){q=(d.height-a.mh)/d.height;i()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";l(d);h.length>1&&c(d).css({cursor:"pointer"}).click(e.next);if(E)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").load(b,function(q,t){t==="success"?f(this):l(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!I){k=k<h.length-1?k+1:0;e.load()}};e.prev=function(){if(!I){k=k>0?k-1:h.length- 1;e.load()}};e.slideshow=function(){var b,d,i="cboxSlideshow_";y.bind(aa,function(){y.unbind();clearTimeout(d);j.removeClass(i+"off "+i+"on")});function l(){y.text(a.slideshowStop).bind(P,function(){d=setTimeout(e.next,a.slideshowSpeed)}).bind(J,function(){clearTimeout(d)}).one("click",function(){b();c(this).removeClass(B)});j.removeClass(i+"off").addClass(i+"on")}b=function(){clearTimeout(d);y.text(a.slideshowStart).unbind(P+" "+J).one("click",function(){l();d=setTimeout(e.next,a.slideshowSpeed); c(this).removeClass(B)});j.removeClass(i+"on").addClass(i+"off")};if(a.slideshow&&h.length>1)a.slideshowAuto?l():b()};e.close=function(){c.event.trigger(Q);H=g;c().unbind("keydown.cbox_close keydown.cbox_arrows");r.unbind(R+" resize.cboxie6 scroll.cboxie6");u.css({cursor:"auto"}).fadeOut("fast");j.stop(o,g).fadeOut("fast",function(){n.remove();j.css({opacity:1});p.children().hide();c.event.trigger(aa)})};e.element=function(){return c(m)};e.settings=Y;c(e.init)})(jQuery);

function newWindow(a){window.open(a.replace(/\&amp;/g,"&"),"","");return false}var maxCommLength=0;function comments_init(b){maxCommLength=b;var a=$("#c-content").val().length;$("#comm-left-chars").text(maxCommLength-a);$("#c-content").keydown(function(){var c=$(this).val().length;if(c>maxCommLength){$("#comm-left-chars").text(0);$(this).val($(this).val().substr(0,maxCommLength));alert("Otrzymano maksymaln\u0105 d\u0142ugo\u015b\u0107 komentarza.")}else{$("#comm-left-chars").text(maxCommLength-c)}})}function delUserPhoto(a){if(confirm("Czy jeste\u015b pewny/a, \u017ce chcesz usun\u0105\u0107 to zdj\u0119cie?")){$("#photo"+a).fadeOut("normal");$.get("index.php?m=doDeleteUserPhoto&ajax=true&id="+a,"",function(){})}}var currentNewRimVisible=0;function newRims(){var a=$(".random");a.filter(":eq("+currentNewRimVisible+")").fadeTo(1500,0.1,function(){currentNewRimVisible++;if(currentNewRimVisible>(a.length-1)){currentNewRimVisible=0}$(this).hide();a.filter(":eq("+currentNewRimVisible+")").show().fadeTo(3000,1)})}function selCarModelValues(e){var d=$("#s-cmodel");var c=$("#s-cmodel-repl");var a;if(oStorage[e].length>2){a=c.children("div.selected").text("-- Wybierz --").parent().children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz --").click(function(f){f.stopPropagation();selLiClick(this)}))}else{if(oStorage[e].length>1){a=c.children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove()}}for(var b=0;b<oStorage[e].length;b+=2){a.append($("<li />").text(oStorage[e][b+1]).attr("value",oStorage[e][b]).click(function(f){f.stopPropagation();selLiClick(this)}))}if((oStorage[e].length>1)&&(oStorage[e].length<=2)){a.children("li:not(.top):eq(0)").click()}}function selCarModelValuesDopasowanie(e){var d=$("#s-model2");var c=$("#s-model2-repl");var a;if(oStorage[e].length>2){a=c.children("div.selected").text("-- Wybierz --").parent().children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz --").click(function(f){f.stopPropagation();selLiClick(this)}))}else{if(oStorage[e].length>1){a=c.children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove()}}for(var b=0;b<oStorage[e].length;b+=2){a.append($("<li />").text(oStorage[e][b+1]).attr("value",oStorage[e][b]).click(function(f){f.stopPropagation();selLiClick(this)}))}if((oStorage[e].length>1)&&(oStorage[e].length<=2)){a.children("li:not(.top):eq(0)").click()}}function selCarTypeValues(e){var d=$("#s-ctype");var c=$("#s-ctype-repl");var a;if(oStorage[e].length>2){a=c.children("div.selected").text("-- Wybierz --").parent().children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz --").click(function(f){f.stopPropagation();selLiClick(this)}))}else{if(oStorage[e].length>1){a=c.children("div.options").children("ul");d.html("");a.children("li:not(.top)").remove()}}for(var b=0;b<oStorage[e].length;b+=2){a.append($("<li />").text(oStorage[e][b+1]).attr("value",oStorage[e][b]).click(function(f){f.stopPropagation();selLiClick(this)}))}if((oStorage[e].length>1)&&(oStorage[e].length<=2)){a.children("li:not(.top):eq(0)").click()}}function selCarBrandChangeDopasowanie(b){if(b>0){$("#s-model2").html($('<option value="" />').val("-1").text("Trwa wczytywanie..."));$("#s-model2-repl").children("div.selected").text("Trwa wczytywanie...").parent().children("div.options").children("ul").children("li:not(.top)").remove();if((typeof oStorage["b"+b])!="undefined"){selCarModelValuesDopasowanie("b"+b)}else{oStorage["b"+b]=new Array();$.get("index.php?m=searcher&ajax=true&a=cmodel&id="+b,{},function(c){$(c).find("el").each(function(){oStorage["b"+b].push($(this).attr("id"),$(this).text())});selCarModelValuesDopasowanie("b"+b)},"xml")}}else{$("#s-model2").html($('<option value="" />').val("-1").text("-- Wybierz wpierw markę --"));var a=$("#s-model2-repl").children("div.selected").text("-- Wybierz wpierw markę --").parent().children("div.options").children("ul");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz wpierw markę --"))}}function selCarBrandChange(b){$("#s-ctype").html($('<option value="" />').val("-1").text("-- Wybierz wpierw model --"));$("#s-ctype-repl div.selected").text("-- Wybierz wpierw model --").parent().children("div.options").children("ul").children("li:not(.top)").remove().parent().append($('<li class="selected" />').text("-- Wybierz wpierw model --"));if(b>0){$("#s-cmodel").html($('<option value="" />').val("-1").text("Trwa wczytywanie..."));$("#s-cmodel-repl").children("div.selected").text("Trwa wczytywanie...").parent().children("div.options").children("ul").children("li:not(.top)").remove();if((typeof oStorage["b"+b])!="undefined"){selCarModelValues("b"+b)}else{oStorage["b"+b]=new Array();$.get("index.php?m=searcher&ajax=true&a=cmodel&id="+b,{},function(c){$(c).find("el").each(function(){oStorage["b"+b].push($(this).attr("id"),$(this).text())});selCarModelValues("b"+b)},"xml")}}else{$("#s-cmodel").html($("<option />").val("-1").text("-- Wybierz wpierw markę --"));var a=$("#s-cmodel-repl").children("div.selected").text("-- Wybierz wpierw markę --").parent().children("div.options").children("ul");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz wpierw markę --"))}}function selCarModelChange(b){if(b>0){$("#s-ctype").html($('<option value="" />').val("-1").text("Trwa wczytywanie..."));$("#s-ctype-repl").children("div.selected").text("Trwa wczytywanie...").parent().children("div.options").children("ul").children("li:not(.top)").remove();if((typeof oStorage["m"+b])!="undefined"){selCarTypeValues("m"+b)}else{oStorage["m"+b]=new Array();$.get("index.php?m=searcher&ajax=true&a=ctype&id="+b,{},function(c){$(c).find("el").each(function(){oStorage["m"+b].push($(this).attr("id"),$(this).text())});selCarTypeValues("m"+b)},"xml")}}else{$("#s-ctype").html($("<option />").val("-1").text("-- Wybierz wpierw model --"));var a=$("#s-ctype-repl div.selected").text("-- Wybierz wpierw model --").parent().children("div.options").children("ul");a.children("li:not(.top)").remove();a.append($('<li class="selected" value="-1" />').text("-- Wybierz wpierw model --"))}}function selLiClick(c){$(c).parent().children().removeClass("selected");var d=$(c).addClass("selected").text();var b=$(c).attr("value");if(b<=0){b=-1}$(c).parent().parent().parent().parent().children("select").html("").append($("<option />").attr("value",b));$(c).parent().css("overflow","hidden").parent().parent().children("div.selected").text(d);var a=$(c).parent().parent().parent().attr("id");if(a=="s-cbrand-repl"){selCarBrandChange(b)}else{if(a=="s-cmodel-repl"){selCarModelChange(b)}else{if(a=="s-marka2-repl"){selCarBrandChangeDopasowanie(b)}}}$("div.select ul").css("overflow","hidden").parent().slideUp("normal")}function checkboxClick(a){if($(a).hasClass("checked")){$(a).removeClass("checked");$(a).parent().children("input.checkbox").removeAttr("checked")}else{$(a).addClass("checked");$(a).parent().children("input.checkbox").attr("checked",true)}}function fileInputClick(b){var a=$(b).parent().parent().children("input.file");a.click();if(b.tagName.toLowerCase()=="input"){$(b).val(a.val())}else{$(b).parent().children("input.value").val(a.val())}}var map=false;var marker=false;var geocoder=false;var pos=false;$(document).ready(function(){$("div.select").each(function(){$(this).parent().parent().children("dt").children("label").click(function(c){c.stopPropagation();$(this).parent().parent().children("dd").children("div.select").children("div.sel-repl").children("div.selected").click();return false});$(this).children().children("div.selected").click(function(d){d.stopPropagation();var c=$(this).parent().children("div.options");if(c.is(":visible")){$("div.select ul").css("overflow","hidden").parent().slideUp("normal")}else{$("div.select ul").css("overflow","hidden").parent().slideUp("normal");c.slideDown("normal",function(){$(this).children("ul").css("overflow","auto")})}return false});$(this).children().children("div.options").children().children("li:not(.top)").click(function(c){c.stopPropagation();selLiClick(this)})});$("div.checkbox div.checkbox-replace").click(function(){checkboxClick(this)});$("div.file-input input.file").change(function(){var c=$(this).val();$(this).parent().parent().children("input.text.value").val(c)}).fadeTo("normal",0);$(document).click(function(){$("div.select ul").css("overflow","hidden").parent().slideUp("normal")});currentNewRimVisible=$(".random").length-1;if(currentNewRimVisible>0){$(".random:hidden").fadeTo(0,0.1);setInterval(newRims,10000)}$("#searcher-option").click(function(){if($(".box-searcher div.line3").is(":visible")){$(this).text("Zmie\u0144 na zaawansowan\u0105");$(".box-searcher input.submit").hide();$(".box-searcher div.line3").css("visibility","hidden").slideUp("normal",function(){$(".box-searcher input.submit").show()})}else{$(this).text("Zmie\u0144 na prost\u0105");$(".box-searcher input.submit").hide();$(".box-searcher div.line3").slideDown("normal",function(){$(this).css("visibility","visible");$(".box-searcher input.submit").show()})}return false});$("a.image-animation").colorbox({current:"Zdj\u0119cie {current} z {total}",previous:"Poprzednie",next:"Nast\u0119pne",close:"Zamknij"});$("div.images .list").each(function(){var c=190;var g;var e=false;var d=$(this).find("ul.images");var f=d.children("li").length*c;d.width(f);d.children("li").children("a").click(function(){var j=$(this).attr("href");var k=$(this).attr("rel").split(",");var l=d.parent().parent().parent().children("a.main").attr("href",j).attr("title",$(this).attr("title"));var i=new Image();i.src=j;i.onload=function(){l.children("img").fadeOut(300,function(){var h=$("<img />").attr("title","[Kliknij aby powi\u0119kszy\u0107]").attr("src",j).css({"margin-top":k[2]+"px",width:k[0]+"px",height:k[1]+"px"}).load(function(){l.children("img").replaceWith(h)})})};return false});if(f>$(this).children(".images-container").width()){$(this).children("a.m-right").hover(function(i){i.stopPropagation();var h=function(){var j=parseInt(d.css("left"))-c;if(Math.abs(j)<=(f-2*c)){d.animate({left:j+"px"},1000)}else{d.animate({left:-(f-2*c)+"px"},1000)}};h();g=setInterval(h,1005);e=true},function(h){d.stop();h.stopPropagation();if(e){clearInterval(g)}e=false;return false});$(this).children("a.m-left").hover(function(i){i.stopPropagation();var h=function(){var j=parseInt(d.css("left"))+c;if(j<=2){d.animate({left:j+"px"},1000)}else{d.animate({left:"0px"},1000)}};h();g=setInterval(h,1005);e=true},function(h){d.stop();h.stopPropagation();if(e){clearInterval(g)}e=false;return false})}});$("a.rating").mousemove(function(d){if($(this).hasClass("disabled")){return false}var c=Math.round(Math.round(d.pageX-$(this).offset().left)/15)*15;if(c<30){c=30}$(this).children().css("width",c+"px")}).hover(function(){},function(){if($(this).hasClass("disabled")){return false}var c=$(this).attr("rel").split(",");$(this).children().css("width",c[1]+"px")}).click(function(g){g.stopPropagation();if($(this).hasClass("disabled")){alert("Nie mo\u017cna dwukrotnie g\u0142osować na to samo zdj\u0119cie!");return false}$(this).addClass("disabled");var c=Math.round(Math.round(g.pageX-$(this).offset().left)/15);if(c<2){c=2}var d=$(this).attr("rel").split(",");var f=this;$.get("?m=doRateUserPhoto&id="+d[0]+"&ajax=true&val="+c,"",function(e){$(e).find("mssg").each(function(){if($(this).text().length>0){alert($(this).text())}});if($(e).find("reset")){$(f).children().css("width",d[1]+"px")}var h=$(e).find("rating");if(h.length){$(f).parent().parent().children(".text-right").text("("+h.children("rate").text()+", g\u0142osów "+h.children("rate-number").text()+")");$(f).children().css("width",h.children("width").text()+"px")}},"xml");return false});$("#seller-searcher").submit(function(){$("#dist-content").html($('<p class="not-found" />').text("Trwa wyszukiwanie..."));$.get("index.php?m=dystrybutorzy&ajax=true&wojewodztwo="+$("#seller-searcher").find("select#states option").attr("value")+"&marka="+$("#seller-searcher input#marka").attr("value"),"",function(c){$("#dist-content").html(c);$("#dist-content a.image-animation").colorbox({current:"Zdj\u0119cie {current} z {total}",previous:"Poprzednie",next:"Nast\u0119pne",close:"Zamknij"})},"html");return false});$("#car-searcher").submit(function(){if($("#s-rozmiar option").val()<1){alert("Wybierz rozmiar felgi!");return false}$("#car-content").html($('<p class="not-found" />').text("Trwa wyszukiwanie..."));var c=$("#car-searcher select#s-marka2 option").attr("value");if(c===undefined){c=-1}var d=$("#car-searcher select#s-marka2 option").attr("value");if(d===undefined){d=-1}$.get("index.php?m=samochody&ajax=true&model="+d+"&marka="+c+"&id="+$("#car-searcher select#s-rozmiar option").attr("value"),"",function(e){$("#car-content").html(e)},"html");return false});if($("#gposition").length>0){geocoder=new google.maps.Geocoder();var b={scrollwheel:false,zoom:6,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById("gposition"),b);if($("#posX").length&&$("#posY").length){$("#delMarker").show();var a=new google.maps.LatLng(parseFloat($("#posX").val()),parseFloat($("#posY").val()));pos="("+$("#posX").val()+","+$("#posY").val()+")";marker=new google.maps.Marker({map:map,position:a,draggable:true});map.setCenter(a);map.setZoom(15);google.maps.event.addListener(marker,"dragend",function(c){pos=marker.get_position().toString()})}else{geocoder.geocode({address:"Polska"},function(d,c){if(c==google.maps.GeocoderStatus.OK){map.setCenter(d[0].geometry.location)}})}}});function getMap(c){c=c.split("|",3);var a={zoom:6,mapTypeId:google.maps.MapTypeId.ROADMAP};var b='<div id="map-'+c[0]+"."+c[1]+'" style="width: 600px; height: 400px;"></div>';$.fn.colorbox({open:true,close:"Zamknij",html:b},function(){var f=new google.maps.Map(document.getElementById("map-"+c[0]+"."+c[1]),a);var d=new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1]));var e=new google.maps.Marker({map:f,position:d,title:c[2]});f.setCenter(d);f.setZoom(13)})}function getPosition(){if((marker!==false)&&(pos!==false)){var a=pos.substr(1,pos.length-2).split(",");if($("#posX").length&&$("#posY").length){$("#posX").val(a[0]);$("#posY").val(a[1])}else{$(".form.seller").append($('<input type="hidden" name="posX" id="posX" value="" />').val(a[0])).append($('<input type="hidden" name="posY" id="posY" value="" />').val(a[1]))}}else{$("#posX,#posY").remove()}}function delMarker(){if(marker!==false){marker.setMap(null);marker=false}$("#delMarker").hide()}function showPoint(){var c=$("#a-street").val();var b=$("#a-city").val();var a=$("#states").parent().find("div.selected").text();if(a=="-- Wybierz --"){a=""}if((b.length<1)||(c.length<1)||(a.length<1)){alert("Wypełnij pola [Miasto], [Ulica], [Województwo]!");return false}if(marker!==false){marker.setMap(null);marker=false}if(!geocoder){geocoder=new google.maps.Geocoder()}geocoder.geocode({address:c+", "+b+", "+a+", Polska"},function(f,e){if(e==google.maps.GeocoderStatus.OK){if(f[0].geometry.location!==undefined){var d=new google.maps.LatLng(f[0].geometry.location);pos=f[0].geometry.location.toString();map.setCenter(f[0].geometry.location);marker=new google.maps.Marker({map:map,position:f[0].geometry.location,draggable:true});map.setZoom(15);$("#delMarker").show();google.maps.event.addListener(marker,"dragend",function(g){pos=marker.get_position().toString()})}else{alert("Nie znaleziono lokalizacji!")}}else{alert("Nie można określić lokalizacji ze względu na: "+e)}});return true};

