function do_search( url )
{
    var city = $("#search_city").val();
    var street = $("#search_street").val();
    var zipcode = $("#search_zipcode").val();


    var redirect_address = '/' + url +'/(miasto)/'+city;
    if(street!=''){redirect_address+='/(ulica)/'+street}
    //if(zipcode!=''){redirect_address+='/(kod)/'+zipcode}
    this.location.href=redirect_address;
}


$(document).ready( function(){

$('#simple_search').attr('value','szukaj...');
$('#simple_search').click(function(){
    $(this).val('');
})
$('#simple_search').bind('keypress',function(event){
    if(event.which==13){
        window.location.href='/content/advancedsearch/?SearchText='+encodeURIComponent($('#simple_search').val());
    }
});

$('.renderedtable tr:first-child td').addClass('headerGreen');

 // Colorbox - lightbox
        colorboxOptions = {
		current: 	"zdjęcie {current} z {total}",
		previous:	"previous",
		next:		"nastepne",
		close:		"Zamknij",
		transition:	"elastic"
	}
	galleryCounter = 1;
	$(".class-gallery").each(function() {
		$(this).find('.content-view-children a').attr('rel', 'gallery'+galleryCounter);
		$(this).find('.content-view-children img').each(function() {
			$(this).attr('alt', $(this).attr('alt') + ' - Obraz wyĹ›wietlany na dodatkowej warstwie');
		});
		$("a[rel='gallery"+galleryCounter+"']").colorbox(colorboxOptions);

		galleryCounter++;
	})
        
	$(".colorboxShow").find('a').attr('rel', 'colorbox');
	$(".colorboxShow").find('img').each(function() {
		$(this).attr('alt', $(this).attr('alt') + ' - Obraz wyświetlany na dodatkowej warstwie');
	});
	$("a[rel='colorbox']").colorbox(colorboxOptions);
	$("a[class='embed_image_link']").colorbox({transition:"elastic"});

});
