function fillText(ele) { jQuery(ele).each(function() { var width = jQuery(this).parent().width(); var height = jQuery(this).parent().parent().height(); var maxFont = 0.2*height; var text = jQuery(this).text().split(" "); var longestWord = 0; for(i=0;i longestWord) longestWord = text[i].length; } var prop = width/(longestWord); var fontSize = prop*1.48; if (fontSize > maxFont) fontSize = maxFont; jQuery(this).css({"font-size":fontSize}); }); } var stopAnimate = new Array(); function move(dir,ele,buttonUp,buttonDown) { var height = jQuery(ele).children().width()*jQuery(ele).children().length; var parentHeight = jQuery(ele).parent().width(); if (parentHeight >= height) { jQuery(buttonDown).css({opacity:0.5}); jQuery(buttonUp).css({opacity:0.5}); return true; } else { stopAnimate[ele] = false; if (dir == "up") { jQuery(buttonUp).css({opacity:1}); jQuery(ele).animate({"left":parentHeight-height+"px"},{ duration: 1000, complete: function() { jQuery(buttonDown).css({opacity:0.5}); stopAnimate[ele] = false; },step:function() { if (stopAnimate[ele] == true) { stopAnimate[ele] = false; jQuery(this).stop(); }} }); } if (dir == "down") { jQuery(buttonDown).css({opacity:1}); jQuery(ele).animate({"left":"0px"},{ duration: 1000, complete: function() { jQuery(buttonUp).css({opacity:0.5}); stopAnimate[ele] = false; },step:function() {if (stopAnimate[ele] == true) { stopAnimate[ele] = false; jQuery(this).stop(); }} }); } if (dir == "start") { jQuery(buttonUp).css({opacity:0.5}); jQuery(buttonUp).mouseup(function() { stopAnimate["#mapContainer .mapObjectCategoriesLinks"] = true; }); jQuery(buttonDown).mouseup(function() { stopAnimate["#mapContainer .mapObjectCategoriesLinks"] = true; }); } } } function move1(dir,ele,buttonUp,buttonDown,ajax) { var height = jQuery(ele).height(); var parentHeight = jQuery(ele).parent().height(); if (parentHeight >= height) { jQuery(buttonDown).css({opacity:0}); jQuery(buttonUp).css({opacity:0}); return true; } else { stopAnimate[ele] = false; if (dir == "up") { jQuery(buttonUp).css({opacity:1}); jQuery(ele).animate({"top":parentHeight-height+"px"},{ duration: 1000, complete: function() { jQuery(buttonDown).css({opacity:0}); stopAnimate[ele] = false; },step:function() { if (stopAnimate[ele] == true) { stopAnimate[ele] = false; jQuery(this).stop(); }} }); } if (dir == "down") { jQuery(buttonDown).css({opacity:1}); jQuery(ele).animate({"top":"0px"},{ duration: 1000, complete: function() { jQuery(buttonUp).css({opacity:0}); stopAnimate[ele] = false; },step:function() {if (stopAnimate[ele] == true) { stopAnimate[ele] = false; jQuery(this).stop(); }} }); } if (dir == "start") { jQuery(buttonUp).css({opacity:0}); jQuery(buttonUp).mouseup(function() { stopAnimate["#mapContainer .mapObjectCategoriesLinks"] = true; }); jQuery(buttonDown).mouseup(function() { stopAnimate["#mapContainer .mapObjectCategoriesLinks"] = true; }); if (ajax == true) { jQuery(ele+" a").each(function(){ jQuery(this).click(function() { $.ajax({ url: jQuery(this).attr("href")+"?ajax=true&tmpId="+ele, context: document.body }).done(function(data) { var tid = ele.replace(" .listingBlockListing",""); tid = tid.replace(".l",".f"); jQuery(tid+" .listingAjaxBox").html(data); }); jQuery(this).attr("href","javascript:void(0)"); }); }); } } } } function enlargePhoto1(type,imgi,size) { jQuery(".objectMainPhoto img").fadeTo("normal",0.5); jQuery(".objectMainPhoto").append(""); var img = new Image(); img.onLoad = setImage(type,imgi,size); img.src = "./media/uploaded_files/"+type+"/"+size+",1,"+imgi; } function setImage1(type,imgi,size) { jQuery(".objectMainPhoto").append(""); jQuery(".fadeIn").fadeTo("normal",1); jQuery(".objectMainPhoto").html(""); } function enlargePhoto(id) { jQuery("#mainPhoto"+id).css({"z-index": 101}); jQuery("#mainPhoto"+id).fadeTo("slow",1,function() { jQuery(".objectMainPhoto").not("#mainPhoto"+id).hide(); }); jQuery("#mainPhoto"+id).css({"z-index": 100}); } jQuery("document").ready(function() { jQuery(".fancyboxed[rel='fancyboxed']").fancybox(); jQuery(".objectSliderScrollUp").mousedown(function() { move("down",".objectSliderContainer .objectsSliderSidebar",".objectSliderScrollUp",".objectSliderScrollDown"); }); jQuery(".objectSliderScrollDown").mousedown(function() { move("up",".objectSliderContainer .objectsSliderSidebar",".objectSliderScrollUp",".objectSliderScrollDown"); }); }); function validateForm(id) { var error = false; jQuery('.requiredError').remove(); jQuery('#'+id+' input[required="required"]').each(function () { if (jQuery(this).val() == "") { jQuery(this).after("
Pole obowińÖzkowe
"); error = true; } }) if (error == false) { var post = jQuery('#'+id).serialize(); $.ajax({ url: "./send.php?"+post, cache: false }).done(function(html) { $('#'+id).html( html ); $(".send").parent().hide(); }); } }