// JavaScript Document /***** 			UTF-8 Letnik.pl ŻŹĆŃĄŚŁĘÓ żźćńąśłęó€			****/
// 2011 02 15

/* Poshy Tip jQuery plugin v1.0 */
(function(e){var a=[],d=/^url\(["']?([^"'\)]*)["']?\);?$/i,c=/\.png$/i,b=e.browser.msie&&e.browser.version==6;function f(){e.each(a,function(){this.refresh(true)})}e(window).resize(f);e.Poshytip=function(h,g){this.$elm=e(h);this.opts=e.extend({},e.fn.poshytip.defaults,g);this.$tip=e(['<div class="',this.opts.className,'">','<div class="tip-inner tip-bg-image"></div>','<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',"</div>"].join(""));this.$arrow=this.$tip.find("div.tip-arrow");this.$inner=this.$tip.find("div.tip-inner");this.disabled=false;this.init()};e.Poshytip.prototype={init:function(){a.push(this);this.$elm.data("title.poshytip",this.$elm.attr("title")).data("poshytip",this);switch(this.opts.showOn){case"hover":this.$elm.bind({"mouseenter.poshytip":e.proxy(this.mouseenter,this),"mouseleave.poshytip":e.proxy(this.mouseleave,this)});if(this.opts.alignTo=="cursor"){this.$elm.bind("mousemove.poshytip",e.proxy(this.mousemove,this))}if(this.opts.allowTipHover){this.$tip.hover(e.proxy(this.clearTimeouts,this),e.proxy(this.hide,this))}break;case"focus":this.$elm.bind({"focus.poshytip":e.proxy(this.show,this),"blur.poshytip":e.proxy(this.hide,this)});break}},mouseenter:function(g){if(this.disabled){return true}this.clearTimeouts();this.$elm.attr("title","");this.showTimeout=setTimeout(e.proxy(this.show,this),this.opts.showTimeout)},mouseleave:function(){if(this.disabled){return true}this.clearTimeouts();this.$elm.attr("title",this.$elm.data("title.poshytip"));this.hideTimeout=setTimeout(e.proxy(this.hide,this),this.opts.hideTimeout)},mousemove:function(g){if(this.disabled){return true}this.eventX=g.pageX;this.eventY=g.pageY;if(this.opts.followCursor&&this.$tip.data("active")){this.calcPos();this.$tip.css({left:this.pos.l,top:this.pos.t});if(this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow}}},show:function(){if(this.disabled||this.$tip.data("active")){return}this.reset();this.update();this.display()},hide:function(){if(this.disabled||!this.$tip.data("active")){return}this.display(true)},reset:function(){this.$tip.queue([]).detach().css("visibility","hidden").data("active",false);this.$inner.find("*").poshytip("hide");if(this.opts.fade){this.$tip.css("opacity",this.opacity)}this.$arrow[0].className="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"},update:function(i){if(this.disabled){return}var h=i!==undefined;if(h){if(!this.$tip.data("active")){return}}else{i=this.opts.content}this.$inner.contents().detach();var g=this;this.$inner.append(typeof i=="function"?i.call(this.$elm[0],function(j){g.update(j)}):i=="[title]"?this.$elm.data("title.poshytip"):i);this.refresh(h)},refresh:function(h){if(this.disabled){return}if(h){if(!this.$tip.data("active")){return}var k={left:this.$tip.css("left"),top:this.$tip.css("top")}}this.$tip.css({left:0,top:0}).appendTo(document.body);if(this.opacity===undefined){this.opacity=this.$tip.css("opacity")}var l=this.$tip.css("background-image").match(d),m=this.$arrow.css("background-image").match(d);if(l){var i=c.test(l[1]);if(b&&i){this.$tip.css("background-image","none");this.$inner.css({margin:0,border:0,padding:0});l=i=false}else{this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>').css({border:0,padding:0,"background-image":"none","background-color":"transparent"}).find(".tip-bg-image").css("background-image",'url("'+l[1]+'")').end().find("td").eq(3).append(this.$inner)}if(i&&!e.support.opacity){this.opts.fade=false}}if(m&&!e.support.opacity){if(b&&c.test(m[1])){m=false;this.$arrow.css("background-image","none")}this.opts.fade=false}var o=this.$tip.find("table");if(b){this.$tip[0].style.width="";o.width("auto").find("td").eq(3).width("auto");var n=this.$tip.width(),j=parseInt(this.$tip.css("min-width")),g=parseInt(this.$tip.css("max-width"));if(!isNaN(j)&&n<j){n=j}else{if(!isNaN(g)&&n>g){n=g}}this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")}else{if(o[0]){o.width("auto").find("td").eq(3).width("auto").end().end().width(this.$tip.width()).find("td").eq(3).width("100%")}}this.tipOuterW=this.$tip.outerWidth();this.tipOuterH=this.$tip.outerHeight();this.calcPos();if(m&&this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow;this.$arrow.css("visibility","inherit")}if(h){this.$tip.css(k).animate({left:this.pos.l,top:this.pos.t},200)}else{this.$tip.css({left:this.pos.l,top:this.pos.t})}},display:function(h){var i=this.$tip.data("active");if(i&&!h||!i&&h){return}this.$tip.stop();if((this.opts.slide&&this.pos.arrow||this.opts.fade)&&(h&&this.opts.hideAniDuration||!h&&this.opts.showAniDuration)){var m={},l={};if(this.opts.slide&&this.pos.arrow){var k,g;if(this.pos.arrow=="bottom"||this.pos.arrow=="top"){k="top";g="bottom"}else{k="left";g="right"}var j=parseInt(this.$tip.css(k));m[k]=j+(h?0:this.opts.slideOffset*(this.pos.arrow==g?-1:1));l[k]=j+(h?this.opts.slideOffset*(this.pos.arrow==g?1:-1):0)}if(this.opts.fade){m.opacity=h?this.$tip.css("opacity"):0;l.opacity=h?0:this.opacity}this.$tip.css(m).animate(l,this.opts[h?"hideAniDuration":"showAniDuration"])}h?this.$tip.queue(e.proxy(this.reset,this)):this.$tip.css("visibility","inherit");this.$tip.data("active",!i)},disable:function(){this.reset();this.disabled=true},enable:function(){this.disabled=false},destroy:function(){this.reset();this.$tip.remove();this.$elm.unbind("poshytip").removeData("title.poshytip").removeData("poshytip");a.splice(e.inArray(this,a),1)},clearTimeouts:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}},calcPos:function(){var n={l:0,t:0,arrow:""},h=e(window),k={l:h.scrollLeft(),t:h.scrollTop(),w:h.width(),h:h.height()},p,j,m,i,q,g;if(this.opts.alignTo=="cursor"){p=j=m=this.eventX;i=q=g=this.eventY}else{var o=this.$elm.offset(),l={l:o.left,t:o.top,w:this.$elm.outerWidth(),h:this.$elm.outerHeight()};p=l.l+(this.opts.alignX!="inner-right"?0:l.w);j=p+Math.floor(l.w/2);m=p+(this.opts.alignX!="inner-left"?l.w:0);i=l.t+(this.opts.alignY!="inner-bottom"?0:l.h);q=i+Math.floor(l.h/2);g=i+(this.opts.alignY!="inner-top"?l.h:0)}switch(this.opts.alignX){case"right":case"inner-left":n.l=m+this.opts.offsetX;if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}if(this.opts.alignX=="right"||this.opts.alignY=="center"){n.arrow="left"}break;case"center":n.l=j-Math.floor(this.tipOuterW/2);if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}else{if(n.l<k.l){n.l=k.l}}break;default:n.l=p-this.tipOuterW-this.opts.offsetX;if(n.l<k.l){n.l=k.l}if(this.opts.alignX=="left"||this.opts.alignY=="center"){n.arrow="right"}}switch(this.opts.alignY){case"bottom":case"inner-top":n.t=g+this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="top"}if(n.t+this.tipOuterH>k.t+k.h){n.t=i-this.tipOuterH-this.opts.offsetY;if(n.arrow=="top"){n.arrow="bottom"}}break;case"center":n.t=q-Math.floor(this.tipOuterH/2);if(n.t+this.tipOuterH>k.t+k.h){n.t=k.t+k.h-this.tipOuterH}else{if(n.t<k.t){n.t=k.t}}break;default:n.t=i-this.tipOuterH-this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="bottom"}if(n.t<k.t){n.t=g+this.opts.offsetY;if(n.arrow=="bottom"){n.arrow="top"}}}this.pos=n}};e.fn.poshytip=function(g){if(typeof g=="string"){return this.each(function(){var i=e(this).data("poshytip");if(i&&i[g]){i[g]()}})}var h=e.extend({},e.fn.poshytip.defaults,g);if(!e("#poshytip-css-"+h.className)[0]){e(['<style id="poshytip-css-',h.className,'" type="text/css">',"div.",h.className,"{visibility:hidden;position:absolute;top:0;left:0;}","div.",h.className," table, div.",h.className," td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}","div.",h.className," td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:",h.bgImageFrameSize,"px;width:",h.bgImageFrameSize,"px;overflow:hidden;}","div.",h.className," td.tip-right{background-position:100% 0;}","div.",h.className," td.tip-bottom{background-position:100% 100%;}","div.",h.className," td.tip-left{background-position:0 100%;}","div.",h.className," div.tip-inner{background-position:-",h.bgImageFrameSize,"px -",h.bgImageFrameSize,"px;}","div.",h.className," div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}","</style>"].join("")).appendTo("head")}return this.each(function(){new e.Poshytip(this,h)})};e.fn.poshytip.defaults={content:"[title]",className:"tip-yellow",bgImageFrameSize:10,showTimeout:500,hideTimeout:100,showOn:"hover",alignTo:"cursor",alignX:"right",alignY:"top",offsetX:-22,offsetY:18,allowTipHover:true,followCursor:false,fade:true,slide:true,slideOffset:8,showAniDuration:300,hideAniDuration:300}})(jQuery);

/*ScrollTo*/
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

jQuery.fn.customInput = function(){
	$(this).each(function(i){	
		if($(this).is('[type=checkbox],[type=radio]')){
			var input = $(this);
			var input = $(this);
			var label = $('label[for='+input.attr('id')+']');
			var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio';
			$('<div class="custom-'+ inputType +'"></div>').insertBefore(input).append(input, label);
			var allInputs = $('input[name='+input.attr('name')+']');
			label.hover(
				function(){ 
					$(this).addClass('hover'); 
					if(inputType == 'checkbox' && input.is(':checked')){ 
						$(this).addClass('checkedHover'); 
					} 
				},
				function(){ $(this).removeClass('hover checkedHover'); }
			);
			input.bind('updateState', function(){	
				if (input.is(':checked')) {
					if (input.is(':radio')) {				
						allInputs.each(function(){
							$('label[for='+$(this).attr('id')+']').removeClass('checked');
						});		
					};
					label.addClass('checked');
				}
				else { label.removeClass('checked checkedHover checkedFocus'); }
										
			})
			.trigger('updateState')
			.click(function(){ 
				$(this).trigger('updateState'); 
			  //alert($(this).attr("class"));
			})
			.focus(function(){ 
				label.addClass('focus'); 
				if(inputType == 'checkbox' && input.is(':checked')){ 
					$(this).addClass('checkedFocus'); 
				} 
			})
			.blur(function(){ label.removeClass('focus checkedFocus'); });
		}
	});
};



var udo = { "łazienka":"up_a", "lodówka":"up_b", "sprzęt plażowy":"up_c", "tv":"up_d", "radio":"up_e", "telefon":"up_f", "Internet - Ethernet":"up_g", "Internet - WiFi":"up_h", "parking na posesji":"uo_a", "świetlica":"uo_b", "plac zabaw dla dzieci":"uo_c", "stołówka":"uo_d", "sala konferencyjna":"uo_e", "boisko":"uo_f", "basen":"uo_g", "udostępnione rowery":"uo_h", "sauna":"uo_i", "kawiarnia":"uo_j", "akceptujemy zwierzęta":"uo_k", "dostęp do kuchni":"uo_l", "restauracja":"uo_m", "sprzęt wodny":"uo_n", "grill":"uo_o", "udogodnienia dla niepełnosprawnych":"uo_p"};




/*zapytania*/
function sh(obj) {
	var result = "";
	for (var i in obj)
		result += "." + i + " = " + obj[i] + "\n";
	alert(result);
	}

var tit = 'Za pomocą formularza można skierować zapytanie drogą email jednocześnie do kilku ofert zaznaczając je na powyższej liście z ofertami.<br /> Poprawne wysłanie zapytania do obiektów zostanie potwierdzone w zwrotnej wiadomości przesłanej na Państwa email. <br />Państwa zapytanie trafi bezpośrednio od właścicieli ofert.';

var che = '<p id="fz_zaznacz">Na powyższej liście ofert: <label for="fz_zaz" id="fz_zaz_label">zaznacz oferty</label><input type="checkbox" name="fz[przelacznik]" value="" class="fz_ster_zaz" id="fz_zaz" /></p>';
var fz = '<div id="fz_ng">Wysyłanie zapytania <img src="_t/l/q1.png" class="tip_rig" title="'+tit+'" /></div>'+che+'<div class="komunikat" id="statusprzesylania"></div><table id="fz_tabela"><tbody><tr><th>Twój email:</th><td><input class="fz_pf" name="fz[email]" id="fz_email"></td></tr><tr><th>Przedstaw się:<p>np. imię, nazwisko, kontakt tel., miejscowość</p></th><td><textarea class="fz_pf" name="fz[kto]" id="fz_kto"></textarea></td></tr><tr><th>Termin pobytu:<p>np. 1 lipiec 2011 do 14.07.11r.</div></th><td><input class="fz_pf" name="fz[termin]" id="fz_termin"></td></tr><tr><th>Ilość osób:<p>np. 3 os. dorosłe oraz niemowle;</p></th><td><input class="fz_pf" name="fz[ile]" id="fz_ile"></td></tr><tr><th>Dodatkowe:<p>wymagania odnośnie pokoju, udogodnienia w obiekcie,<br />kto ma być adresatem oferty: rodzina z dziećmi, młode małżeństwo itp.</p></th><td><textarea class="fz_pf" name="fz[uwagi]" id="fz_opis"></textarea></td></tr><tr><td colspan="2"><div class="submit_op"><input value="wyślij" name="submit" class="submit_input_size submit_input_tlo zaokragl_all" type="submit"></div></td></tr></tbody></table>';

var notestxt = '<p class="notes_tekst"><b>Witaj!</b><br />Twój notes <b>jest pusty</b>. <br />Aby tu pojawiły się wybrane oferty kliknij polecenie <b>"Notes ofert"</b> przy ofercie.<br />Zarządzanie jest proste!</p>';

$(function(){
$("#jqAjaxZap").submit(function(){
var dataString = $("#jqAjaxZap").serialize();
$.ajax({
type: "POST",
url: "ajax_zapytania.php",
data: dataString,
dataType: "json",
success: function(data) {
	if (data['status']==0)
		$('#statusprzesylania').html('<div class="status_0">Wystąpiły błędy w formularzu:<ul><li>'+data['tablica'].join("</li><li>")+'</li><ul></div>');
	if (data['status']==1){
		$('#statusprzesylania').html('<div class="status_1">wysłano zapytania do następujących obiektów:<ul><li>'+data['tablica'].join("</li><li>")+'</li><ul></div>');
		$('#fz_tabela').html('');
	}
}
});
return false;            
});
});

/*end zapytania*/

/*notes*/
function wyslij_do_notesu(idofe){
//alert (idofe)
$.ajax({
type: "POST",
url: "ajax_notes.php",
data: {"notes":{"id":idofe}},
dataType: "json",
success: function(data) {
	if (data['status']==1){
		stworz_liste_dl_notesu(data['tablica']);
	}
	else
		$('#notes_lista').html(notestxt);
}
});
	
};
function stworz_liste_dl_notesu(notes){
	var noteslista = '';
	for (var i in notes){
		noteslista += '<li><img src="_t/l/remove_v.png" class="notes_usun" rel="'+notes[i][0]+'"/> &nbsp; <a href="_id'+notes[i][0]+'" title="'+notes[i][1]+' '+notes[i][2]+'">'+notes[i][3]+'</a></li>';
		}
	$('#notes_lista').html('<ul class="notes_ul_lista">'+noteslista+'</ul><a href="Noclegi/notes:view" class="notes_do_listy">lista &raquo;</a>');
	$(".notes_usun").click(function() {/**/
var id = $(this).attr('rel');
wyslij_do_notesu(id);
$('#no'+id).attr('checked', 'false');
$('label[for=no'+id+']').toggleClass('checked');});

}

/*google maps*/
var gmarkers = new Array();
var idmarkers = new Array();

function google_maps_dla_ofert(){
myCenter = new google.maps.LatLng(52.02, 19.88);
var myOptions = {
	zoom: 6,
	center: myCenter,
	mapTypeId: google.maps.MapTypeId.TERRAIN
	};

var shadow= new google.maps.MarkerImage('_t/l/markery/99.png',	new google.maps.Size(22, 10),new google.maps.Point(0,0),new google.maps.Point(4, 9));
var bounds = new google.maps.LatLngBounds();
var infowindow = new google.maps.InfoWindow({size: new google.maps.Size(150,90)});

var map = new google.maps.Map(document.getElementById("lo_mapa"), myOptions);


for (var klucz in markery){
	if (markery[klucz] != undefined){
		var image = new google.maps.MarkerImage("_t/l/markery/"+klucz+".png",		new google.maps.Size(14, 20),new google.maps.Point(0,0),new google.maps.Point(7, 20));
		var daneM= markery[klucz];
		var  myLatLng = new google.maps.LatLng(daneM[1][0], daneM[1][1]);
		bounds.extend(myLatLng);
		map.fitBounds(bounds);
		f_marker (klucz,myLatLng,map,image,shadow,infowindow);
		}
	}
// uaktywnienie na liście 

$(".lo_namapie").click(function() {
	myclick($(this).attr('rel'));
	$.scrollTo( $('#lo_mapa'), 100,{offset: {top:-25} } );
});


}

function myclick(i) {
google.maps.event.trigger(gmarkers[i], "click");
}

function f_marker(klucz, myLatLng, maps,image,shadow,infowindow){
	if(klucz>=0){
			var marker = new google.maps.Marker({
			position: myLatLng,
			map: maps,
			icon: image,
			animation: google.maps.Animation.DROP,
			shadow: shadow,
			title: markery[klucz][0][1]
			});
			nr = klucz;
		    gmarkers[nr] =marker;
		    idmarkers[nr] = marker;

	
			var tresc2 = '<div class="lo_gmToltip_txt"><h3>'+markery[klucz][0][1]+'</h3>'+markery[klucz][0][2]+'</div>';
			var tresc = '<div class="lo_gmToltip_zdj"><a href="./_id'+markery[klucz][0][0]+'" class="lo_op_zdj_gmToltip zaokragl_all"><img src="0w/'+markery[klucz][0][0]+'/1a.jpg" /></a></div>';
	
			var nawiguj = '';
	if (nr>=1)
		nawiguj += '<a href="javascript:myclick(' + (nr*1-1) + ')" class="lo_gm_laquo">&laquo; poprzednia</a>';

	if (nr<(markery.length-1))
		nawiguj += '<a href="javascript:myclick(' + (((nr*1)+1)) + ')" class="lo_gm_raquo">kolejna &raquo;</a>';

	nawiguj = '<p class="lo_gmToltip_Nav"> '+nawiguj+'</p>';
	google.maps.event.addListener(marker, 'click', function() {
		infowindow.setContent('<div class="lo_gmToltip">'+tresc+tresc2+nawiguj+'<br clear="all" /></div>'); 
		infowindow.open(maps,marker);
		});
/*	*/}

}


$(document).ready(function() {

ab = '<input type="hidden" name="fz[ab][0]" value="'+antybot[0]+'"><input type="hidden" name="fz[ab][1]" value="'+antybot[1]+'"><input type="hidden" name="fz[ab][2]" value="'+antybot[2]+'">';
$('#zapytanie').html(fz+ab);

// udogodnienia
$('.lo_udo').each(function(){
	var el = $(this).html().split(", "); 
	var rh = '';
	for (var i in el){
		rh +='<div class="'+udo[el[i]]+'" title="'+el[i]+'"></div>';
		}
	$(this).html(rh)
   });



$("#fz_zaz").click(function() {
var s = $(this).attr('checked');
$('#fz_zaz_label').html(((s==true)?'odznacz oferty':'zaznacz oferty'));
$(".fz_checkbox").each(function(){
		$(this).attr('checked', s);
		$('label[for='+$(this).attr('id')+']').toggleClass('checked');
	})
});


$(".notes").click(function() {
	wyslij_do_notesu($(this).attr('value'));
});


$('#notes_lista').html(notestxt);

if ( typeof notes !== "undefined" && notes) {
	stworz_liste_dl_notesu(notes);
};

if ( typeof fflo !== "undefined" && fflo) {
	for (var i in fflo){
		$('#fflo_'+i).attr('value', fflo[i]);
		}
};
$('.lo_udo div').poshytip({
className: 'tip-yellowsimple',
showTimeout: 1,
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetY: 5,
allowTipHover: false
});

$('.tip_rig').poshytip({
className: 'tip-yellowsimple',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5
});


$('.fz_checkbox, .notes').customInput();

// dodanie title dla ikonki na mapie
$(".lo_namapie").each(function(){
var nazwa = $(this).parents().find('.nazwaobj').attr('title');
$(this).attr('title',nazwa+'<br /><b>Pokaż obiekt na mapie</b>');
$(this).poshytip({
className: 'tip-yellowsimple',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5
});
	});


google_maps_dla_ofert();
});
