/**
 * All rights reserved
 * 
 * @author Kozicki Jakub <kuba.kozicki@gmail.com>
 */
function AjaxContent(b){this.defaultOptions={id:{content:"#content",loading:"#contentLoading",breadcrump:"#breadcrump",topmenu:"#topmenu"}};var c=$.extend(this.defaultOptions,b);$.extend(this,c);$('<div style="display: none" class="load" id="'+this.id.loading.replace("#","")+'"></div>').insertAfter($(this.id.content));var a=this;$.historyInit(a.updateContent,a,"jquery_history.html");this.addEvents(document)}AjaxContent.prototype={click:function(c){var d=c.target.getAttribute("href").replace("http://"+document.domain,"");d=d.replace(/^.*#/,"");try{var a=_gat._getTracker("UA-11756161-1");a._setDomainName(".uslugistolarskie.org");a._trackPageview(d)}catch(b){}$.historyLoad(d)},updateContent:function(url,self){var content=$(self.id.content);var loading=$(self.id.loading);var topmenu=$(self.id.topmenu);$.ajax({url:url+"?format=json",dataType:"json",beforeSend:function(xmlHttpRequest){loading.height(content.height());content.hide();loading.show()},success:function(jsonData,textStatus){if(url!="/"){content.html(jsonData.breadcrump+jsonData.content)}else{content.html(jsonData.content)}loading.hide();content.show();topmenu.html(jsonData.topmenu);self.addEvents(content);self.addEvents(topmenu);if(typeof jsonData.jsCode!="undefined"){eval(jsonData.jsCode)}}})},addEvents:function(a){var b=this;$(a).find("a").each(function(){var c=$(this).attr("href");if(c!=null&&c.length>0&&!c.match(/jpg/gi)&&!c.match(/@/gi)&&!c.match(/idealsoft\.pl/gi)){$(this).click(function(d){b.click(d);d.preventDefault()})}})}};function initializeGmaps(c){var c=document.getElementById(c);if(GBrowserIsCompatible()&&(c)!=null){var c=new GMap2(c);var d=new GLatLng(52.6655,17.9393);c.setCenter(d,9,G_NORMAL_MAP);c.setUIToDefault();var a=new GMarker(d);var b='<div class="map-info"><strong>Janex Usługi Stolarskie</strong><br />88-300 Mogilno<br />Ul.: Chopina 3 (wejście od ulicy Paderewskiego)<br />Telefon: (0) 661 181 468</div>';GEvent.addListener(a,"click",function(){a.openInfoWindowHtml(b)});c.addOverlay(a);a.openInfoWindowHtml(b)}}$.easing.custom=function(e,f,a,i,h){var g=1.70158;if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a};function initilizeSlideshow(){var b=$("div.scrollable");if(b.length>0){scrollableAutoscrollApi=b.scrollable({size:1,easing:"custom",speed:1200}).circular().autoscroll({autoplay:false,interval:4000,api:true});scrollableApi=b.scrollable({api:true});var a=true;$(".left-arrow").click(function(c){a=false;scrollableApi.prevPage();scrollableAutoscrollApi.stop();c.preventDefault()});$(".right-arrow").click(function(c){a=false;scrollableApi.nextPage();scrollableAutoscrollApi.stop();c.preventDefault()});window.setTimeout(function(){if(a){scrollableAutoscrollApi.play()}},6000)}}function initializeImageContainers(){$(".img img").each(function(){$(this).bind("load",function(){$(this).parent().parent().width($(this).width())});$(this).attr({src:this.src+"?r=1"})})}var message;function initializeContact(){$(".email").each(function(){var a=$(this);var b=a.text().replace(/\s*\[at\]\s*/,"@").replace(/\s*\[dot\]\s*/g,".");a.html('<a href="mailto:'+b+'">'+b+"</a>")});message=$("#contact-message").overlay({top:"center",api:true});new Validator("#contactForm",{preValidate:function(a){if(a){this.form.find(".form-buttons").eq(0).addClass("form-buttons-load")}},postValidate:function(a){if(a){this.form.find(".form-buttons").eq(0).removeClass("form-buttons-load")}},validateSuccess:function(a){if(a){message.load();this.form.find(":input:not(:submit):not(:reset)").val("")}}})}$(document).ready(function(){if(!$.flash.available){$(".no-flash").show()}else{$(".flash").show()}$('a[rel="external"]').attr("target","_blank")});
