// Blink function
(function($)
{
$.fn.blink = function(options)
{
var defaults = { delay:500, altText:'' };
var options = $.extend(defaults, options);
return this.each(function()
{
var obj = $(this);
var originalText = $(this).html();
// If we dont have alt Text, Blink
if(options.altText == '') setInterval(function(){if($(obj).css("visibility") == "visible"){$(obj).css('visibility','hidden');}else{$(obj).css('visibility','visible');}}, options.delay);
// Else swap text on delay
else setInterval(function(){if($(obj).html() == originalText){$(obj).html(options.altText);}else{$(obj).html(originalText);}}, options.delay);
});
}
}(jQuery));


function filtruj($id)
{
	//alert($id.attr("id"));
	var c = $id.attr("checked");
	var o = (c)?1.0:0.0;
	var i = $id.attr("id");
	
	switch(i){
	case 'filtr0': 
		$('input[id=filtr2],input[id=filtr3]').attr("checked",c);
		var elem = $('tr[id$=wiersz0],tr[id$=wiersz1],tr[id$=wiersz2],tr[id$=wiersz3],tr[id$=wiersz4],tr[id$=wiersz5],tr[id$=wiersz6],tr[id$=wiersz7],tr[id$=wiersz8],tr[id$=wiersz9],tr[id$=wiersz10],tr[id$=wiersz11]');
		var elem1 = $('tr[id$=wiersz0]+tr,tr[id$=wiersz1]+tr,tr[id$=wiersz2]+tr,tr[id$=wiersz3]+tr,tr[id$=wiersz4]+tr,tr[id$=wiersz5]+tr,tr[id$=wiersz6]+tr,tr[id$=wiersz7]+tr,tr[id$=wiersz8]+tr,tr[id$=wiersz9]+tr,tr[id$=wiersz10]+tr,tr[id$=wiersz11]+tr'); 

		//elem.animate({opacity: 'toggle'},"slow"); 	
		//elem1.animate({opacity: 'toggle'},"slow");
		//elem.animate({opacity: 'toggle'},1).animate({opacity: 'toggle'},"slow"); 	
		//elem1.animate({opacity: 'toggle'},1).animate({opacity: 'toggle'},"slow"); 	
		(c)? elem.fadeIn("slow"): elem.fadeOut("slow");
		(c)? elem1.fadeIn("slow"): elem1.fadeOut("slow");
	break;
	case 'filtr1': 
		var elem = $('tr[id$=wiersz12],tr[id$=wiersz13],tr[id$=wiersz14],tr[id$=wiersz15],tr[id$=wiersz16]');
		var elem1 = $('tr[id$=wiersz12]+tr,tr[id$=wiersz13]+tr,tr[id$=wiersz14]+tr,tr[id$=wiersz15]+tr,tr[id$=wiersz16]+tr'); 

		//elem.animate({opacity: 'toggle'},"slow"); 	
		//elem1.animate({opacity: 'toggle'},"slow");
		(c)? elem.fadeIn("slow"): elem.fadeOut("slow");
		(c)? elem1.fadeIn("slow"): elem1.fadeOut("slow");
	break;
	case 'filtr2': 
		$('input[id=filtr0]').attr("checked",c || $('input[id=filtr3]').attr("checked"));
		var elem = $('tr[id$=wiersz0],tr[id$=wiersz1],tr[id$=wiersz4],tr[id$=wiersz5],tr[id$=wiersz8],tr[id$=wiersz10]');
		var elem1 = $('tr[id$=wiersz0]+tr,tr[id$=wiersz1]+tr,tr[id$=wiersz4]+tr,tr[id$=wiersz5]+tr,tr[id$=wiersz8]+tr,tr[id$=wiersz10]+tr'); 

		//elem.animate({opacity: 'toggle'},"slow"); 	
		//elem1.animate({opacity: 'toggle'},"slow");
		(c)? elem.fadeIn("slow"): elem.fadeOut("slow");
		(c)? elem1.fadeIn("slow"): elem1.fadeOut("slow");
	break;
	case 'filtr3': 
		$('input[id=filtr0]').attr("checked",c || $('input[id=filtr2]').attr("checked"));
		var elem = $('tr[id$=wiersz2],tr[id$=wiersz3],tr[id$=wiersz6],tr[id$=wiersz7],tr[id$=wiersz9],tr[id$=wiersz11]');
		var elem1 = $('tr[id$=wiersz2]+tr,tr[id$=wiersz3]+tr,tr[id$=wiersz6]+tr,tr[id$=wiersz7]+tr,tr[id$=wiersz9]+tr,tr[id$=wiersz11]+tr'); 

		//elem.animate({opacity: 'toggle'},"slow"); 	
		//elem1.animate({opacity: 'toggle'},"slow");
		(c)? elem.fadeIn("slow"): elem.fadeOut("slow");
		(c)? elem1.fadeIn("slow"): elem1.fadeOut("slow");
	break;
	}
	
}
$(function() {
	
	initPage();
	$(window).resize( initPage );	
	
	$('#rzetelnaFirma').click(function(){
		window.open("http://www.rzetelnafirma.pl/36K0CDSH/1"); 
		return false;
	});
	
	$('.blink').blink(); 

	
	$('#rzetelnaFirma')
	.hover(function() {
		$(this).animate({ paddingLeft: 7 }, "fast");
		 $(this).css('cursor','pointer');		
	},function() {
		$(this).animate({ paddingLeft: 0 }, "fast");
		$(this).css('cursor','auto');		
	});
	
	$('.productHeader')
	.hover(function() {
		$(this).addClass("ui-state-hover");		
	},function() {
		$(this).removeClass("ui-state-hover");
	});

    $("div.miniMenu a, div.miniMenu input, div.miniMenu img").hover(function() {
		$(this).animate({ opacity: 0.8 }, 200);
	},function() {
		$(this).animate({ opacity: 1 }, 200);
	});


	
	/*
	$('#catfish').catfish({
					closeLink: '#catfish-close',
					height: 50
				});
	*/
	//$('#canvas').jparallax();		

	$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
/*
	$('input[id*=filtr]').click( function() { filtruj($(this)); });
	$('.lista li input').attr("checked",true);	

	$('.lista li')
	.hover(function() {
		$(this).animate({ color: "red" }, 200);
	},function() {
		$(this).animate({ color: "black"}, 200);
	});
*/

/////////////////////////////////////////////////////////////////////////////////
	var filtr = "";
	var filtrTyp = new Array();
	var filtrKolor = new Array();
	var filtrRozmiar = new Array();
		
	function filtrujProdukty(){
	$.ajax({
		type: "GET",
		dataType: 'json',
		url: "getProducts.php",
		success: function(data){
			$('tr[id*=wiersz], tr[id*=wiersz]+tr, div[id*=szczegoly]').fadeOut("fast");
			
			var mystuff = TAFFY(data);		
			
			var filtr = new Filtr();
			if(filtrTyp.length){
				filtr.typ = filtrTyp;
			}else filtr.typ={"!is":"jakistyp"};
			
			if(filtrKolor.length){
				filtr.kolor = filtrKolor;
			}else filtr.kolor={"!is":"jakiskolor"};
			
			if(filtrRozmiar.length){
				filtr.rozmiar = filtrRozmiar;
			}else filtr.rozmiar={"!is":"jakisrozmiar"};
			
			//alert(filtr);
			var przefiltrowane = mystuff.find(filtr);			
			$.each(przefiltrowane, function() { 
				$('tr[id=wiersz'+this+'], tr[id=wiersz'+this+']+tr').fadeIn("fast");			
			});			
		}
		});
	}
	
	function Filtr(typ,kolor,rozmiar) {
		this.typ=typ;
		this.kolor=kolor;
		this.rozmiar=rozmiar;		
	}
	
	Filtr.prototype.toString = function()
	{
		var ret = "Filtr " + this.nazwa + " to: [\n"
		for (var prop in this)
			ret += " " + prop + " = " + this[prop] + ";\n"
		return ret + "]"
	}	

	if(!Array.indexOf){
	    Array.prototype.indexOf = function(obj){
	        for(var i=0; i<this.length; i++){
	            if(this[i]==obj){
	                return i;
	            }
	        }
	        return -1;
	    }
	}

	Array.prototype.remove=function(s){
		var i = this.indexOf(s);
		if(i != -1) this.splice(i, 1);
	}

	Array.prototype.contains = function(obj) {
		  var i = this.length;
		  while (i--) {
			if (this[i] === obj) {
			  return true;
			}
		  }
		  return false;
	}

	$('#filtr li').toggle(function(){
		var el = $(this).attr('class').split(" ");
		var v = $(this).attr('name');
				
		if(el.contains("typ")) filtrTyp.push(v);		
		else if(el.contains("kolor")) filtrKolor.push(v);		
		else if(el.contains("rozmiar")) filtrRozmiar.push(v);		
		
		filtrujProdukty();
		$(this).addClass('ui-selected');		
		
	},function(){
		var el = $(this).attr('class').split(" ");
		var v = $(this).attr('name');
		
		if(el.contains("typ")) filtrTyp.remove(v);		
		else if(el.contains("kolor")) filtrKolor.remove(v);		
		else if(el.contains("rozmiar")) filtrRozmiar.remove(v);	
		
		filtrujProdukty();
		$(this).removeClass('ui-selected');				
	});	
	$('#faq').before($('#filtr').show());
	
	$('#filtr li)')
	.hover(function() {
		$(this).animate({ letterSpacing: "0", paddingLeft: 15 }, "fast");
	},function() {
		$(this).animate({ letterSpacing: "0", paddingLeft: 0 }, "fast");
	});
////////////////////////////////////////////////////////////


	
	$('#menu a')
	.hover(function() {
		//$(this).animate({ backgroundColor: "red", letterSpacing: "0" }, 250);
		if($.browser.msie){
			$(this).animate({ backgroundColor: "red", letterSpacing: "0" }, 250);
		}
		else{
			$(this).animate({ backgroundColor: "red", letterSpacing: "0" , backgroundPosition: "90% 50%"}, 250);
		}
	},function() {
		if($.browser.msie){
			$(this).animate({ backgroundColor: "black", letterSpacing: "0"}, 400);				
		}else{
			$(this).animate({ backgroundColor: "black", letterSpacing: "0" , backgroundPosition: "10% 50%"}, 400);
		}
		
		//$(this).animate({ backgroundColor: "black", letterSpacing: "0"}, 400);				
		
	});

	//$('#leftImage').css({opacity: 0.0});
	//$('#leftImage').animate({opacity: 1.0}, "slow");
	//$('#leftImage').hide();
	//$('#leftImage').slideUp("fast");
	//$('#leftImage').slideDown("slow");

	
	$('#faq .faqHeader')
	.hover(function() {
		$(this).animate({ letterSpacing: "0", paddingLeft: 7 }, "fast");
	},function() {
		$(this).animate({ letterSpacing: "0", paddingLeft: 0 }, "fast");
	});
	
	$('#faq .faqContent').prepend('&nbsp;&nbsp;&nbsp;').corner("tl dog 15px");
	
	
	//$('#faq').sortable();
	
	
	
	
	$("a[@rel*=lightbox] img, img[id^=img]")
	.hover(function() {
		$(this).animate({ opacity: 0.5 }, 200);
	},function() {
		$(this).animate({ opacity: 1.0 }, 200);
	});
	
	
	/*
	$('#b a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-150px 0)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-300px 0)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0"})
			}})
		});
*/
	//$("#szczegoly_suma").draggable().css({background:"white", opacity: 0.8, cursor: "pointer"});
	//$("#szczegoly_suma").draggable().css({position: "fixed", marginLeft: 0, marginTop: 0, top: "25%", left: "1%", background:"white", opacity: 0.8, cursor: "pointer"});
	$("#szczegoly_suma").css({position: "fixed", marginLeft: 0, marginTop: 0, bottom: 0, left: 0, background:"white", opacity: 0.8, cursor: "pointer"});
	$("#szczegoly_suma").hover(function() {
		$(this).animate({ opacity: 1 }, 200);
	},function() {
		$(this).animate({ opacity: 0.8 }, 200);
	});
	//$("#mailDiv").hide();
	//$("#szczegoly_suma").append(mail);
	
		
	
	
	
	//var koszyk = $('<div id="koszyk_mini"><div id="koszykText"></div><img src="index.php_pliki/shoppingcart_128x128.png"/></div>').draggable().css({position: "fixed", marginLeft: 0, marginTop: 0, top: "30%", left: "1%", background:"none", opacity: 1.0, cursor: "pointer"}).hide();
	var koszyk = $('<div id="koszyk_mini" align="center"></div>')
			//.draggable()
			.css({position: "fixed", width: 128, height: 128, marginLeft: 0, marginTop: 0, bottom: 0, left: 0, background:"url(img/shoppingcart_128x128.png)", opacity: 1.0, cursor: "pointer"}).hide();

	
	koszyk.dblclick(function(){
		//var t = $(this).css("top");
		//var l = $(this).css("left");
		
		$(orderDialog).hide("slow");
		
		$(this).hide("slow");
		//$("#szczegoly_suma").css("top",t);
		//$("#szczegoly_suma").css("left",l);		
		
		$("#szczegoly_suma").show().animate({opacity:0.8},"slow");
	}).hover(function(){ 
		$(this).animate({opacity:0.5},"fast");	
		$("#closeKoszyk").show("fast");					
		updateKoszykMini();		
		
	}, function(){
		$("#closeKoszyk").hide("fast");	
		$(this).animate({opacity:1.0},"fast");}							
	);
	
	
	
	var koszykText = $('<div id="koszykText"></div>').css({fontSize: "80%", color: "#990000", backgroundColor: "white", opacity: 0.8}).addClass("faqContent ui-corner-all");
	
	
	
	var closeKoszykButton = $('<div id="closeKoszyk" align="right"><img class="closeButton" src="images/open.png"/></div>').hide().click(function(){
		//var t = $(koszyk).css("top");
		//var l = $(koszyk).css("left");
				
		$(koszyk).hide("slow");
		//$("#szczegoly_suma").css("top",t);
		//$("#szczegoly_suma").css("left",l);		
		
		$("#szczegoly_suma").show().animate({opacity:0.8},"slow");
	}).hover(function(){$(this).find("img").animate({width: "32px"},"fast");}, function(){$(this).find("img").animate({width: "24px"},"fast");});
	
	$(koszyk).append(koszykText);
	$(koszyk).prepend(closeKoszykButton);
	$("body").append(koszyk);
	$(koszyk).hide();
	
	var toPDF = $('<img src="images/pdf_icon.png" width="48px" border="0">');
	toPDF.click(function(){
		var url = "topdf.php";		
		var html = $("#podsumowanie").html()+"<br/>"+$("#info2").html()+"<br/><hr/>"+$("#name").val()+"<br/>"+$("#email").val()+"<br/>"+$("#message").val();
		var input = "<input type='hidden' name='html' value='"+html+"' />";
		
		$('<form action="'+ url +'" method="post" target="_blank">'+input+'</form>').appendTo('body').submit().remove();
		
	});	
	$("#showKoszyk").after(toPDF);
	
	
	var printPDF = $('<img src="images/pdf.png" width="16px" border="0">');
	printPDF.click(function(){
		var url = "topdf.php";		
		var html = $("#podsumowanie").html();
		var input = "<input type='hidden' name='html' value='"+html+"' />";
		
		$('<form action="'+ url +'" method="post" target="_blank">'+input+'</form>').appendTo('body').submit().remove();
		
	});	
	$("#suma_print").after(printPDF);
	
	
	$("#showKoszyk").click(function(){
		$("#mailDiv,#info2,#suma_menu,#koszyk_mini_button").toggle();
	});
	
	var koszyk_button = $('<div id="koszyk_mini_button" align="center"><img src="img/shoppingcart_128x128.png"/ width="64px"></div>');
	koszyk_button.click(function(){
			//var t = $("#szczegoly_suma").css("top");
			//var l = $("#szczegoly_suma").css("left");
		
			document.getElementById('captcha').src="get_captcha.php?rnd=" + Math.random();
			//$("#szczegoly_suma").animate({opacity:0.0},"slow").hide();
			$("#mailDiv,#info2,#suma_menu,#koszyk_mini_button").toggle();
			
			
			//$(koszyk).css("top",Math.max(0,parseInt(t))+"px");
			//$(koszyk).css("left",Math.max(0,parseInt(l))+"px");
			//$(koszyk).show("slow");
			
			//$(orderDialog).show("slow");
	}).hover(function(){ $(this).animate({opacity:0.5},"fast"); }, function(){$(this).animate({opacity:1.0},"fast");});
	
	
	$("#szczegoly_suma").append(koszyk_button);
	
	$("#szczegoly_suma").dblclick(function(e) {
			//var t = $(this).css("top");
			//var l = $(this).css("left");		
			$(this).animate({opacity:0.0},"slow").hide();
			
			//$(koszyk).css("top",Math.max(0,parseInt(t))+"px");
			//$(koszyk).css("left",Math.max(0,parseInt(l))+"px");
			$(koszyk).show("slow");			
		e.preventDefault();
		return false;
	}); 	
	
	$("#szczegoly_suma_hide").click(function(e) {
			$("#szczegoly_suma").animate({opacity:0.0},"slow").hide();			
			$(koszyk).show("slow");			
		e.preventDefault();
		return false;
	}); 	
	
	$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : '../tinymce/jscripts/tiny_mce/tiny_mce.js',

			// General options
			theme : "simple",
			//plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

			// Theme options
			//theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			//theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			//theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			//theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,

			// Example content CSS (should be your site CSS)
			//content_css : "css/content.css",

			// Drop lists for link/image/media/template dialogs
			//template_external_list_url : "lists/template_list.js",
			//external_link_list_url : "lists/link_list.js",
			//external_image_list_url : "lists/image_list.js",
			//media_external_list_url : "lists/media_list.js",

			// Replace values for the template plugin
			//template_replace_values : {
			//	username : "Some User",
			//	staffid : "991234"
			//}
		});
		
		
	/*	
		$(".bigbag:checkbox").each(function(index){
		var t = $(this);	
		var id = $(this).attr("id");
		
		
		
		var txt = $(this).text();
		var img = $('<img width="48px" border="0" title="Koszt opakowania" alt="Koszt opakowania" src="img/bigbag.gif">');		
		
		$(img).css('cursor','pointer');		
		$(img).attr("id","bigbag_"+id);
		
		$(img).toggle(function(){
			$(this).attr("src","img/kostkabigbag.gif");
			$(this).attr("onclick", $(t).attr("onclick"));
		}, function(){
			$(this).attr("src","img/bigbag.gif");
			$(this).attr("onclick", $(t).attr("onclick"));
		});
		
		$(this).before(img);
		//$(this).wrap('<div id="big_bag_'+id+'"></div>');		
		$(this).hide();
	});
	*/
});



function getLocalization()
{
	
	var addr = $("#daddr");	
	$(addr).html('');	
	
	$.ajax({
		type: "POST",
		url: "geoloc.php",
		success: function(html){
			$(addr).val(html);
		}
	});
}


function initPage(){

	
	
	if( ($.browser.name == "msie" && $.browser.versionNumber < 7) )
	{
		var html = '<table align="center" id="maintable"><tr><td width="25%" valign="middle"><div align="center"></div></td><td width="75%" align="right" valign="bottom"><table  border="0" cellspacing="2" cellpadding="2"><tr><td><a href="index.php?lng=pl"><img src="img/pl.gif" width="22" height="16" border="0" alt="" /></a></td><td><a href="index.php?lng=en"><img src="img/en.gif" width="22" height="16" border="0" alt="" /></a></td><td><a href="index.php?lng=de"><img src="img/de.gif" width="22" height="16" border="0" alt="" /></a></td></tr></table></td></tr></table>';
			
		$('#canvas').hide();
		$('#logo').html(html).show();
	}else{
		$('#canvas').jparallax();			
	}
	
	
	initTransport();
};


function initTransport(){
	
var str='';
str+='<div id="kalkulatorTransportu">';
str+='<fieldset class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">';
str+='	<div>';
str+='		<label for="miastoId" id="miastoIdLabel">Strzegom -><\/label>';
str+='		<select id="miastoId" class="text"><\/select>';
str+='	<\/div>';
str+='	';
str+='	<div>';
str+='		<label for="iloscKm" id="iloscKmLabel">Ilosc km<\/label>';
str+='		<input id="iloscKm"  class="text" type="text">';
str+='	<\/div>';
str+='	';
str+='	<div>';
str+='		<label for="nettoWywrotka" id="nettoWywrotkaLabel">Wywrotka<\/label>';
str+='		<input id="bruttoWywrotka" readonly="true" class="text" type="text">	';
str+='		<input id="nettoWywrotka" readonly="true" class="text" type="text">		';
str+='	<\/div>';
str+='	';
str+='	<hr\/>';
str+='	<div>';
str+='		<label for="nettoPlandeka" id="nettoPlandekaLabel">Plandeka<\/label>';
str+='		<input id="bruttoPlandeka" readonly="true" class="text" type="text">		';
str+='		<input id="nettoPlandeka" readonly="true" class="text" type="text">	';
str+='	<\/div>';
str+='	';
str+='<\/fieldset>';
str+='<\/div>';	
	
	if(!$.browser.msie)	{
		$('#kalkulator').html(str);	
		if ( $('#kalkulator').length > 0  ) initmiasta();		
	}	
}



/*
jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
    return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 
};
*/
jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
	if($.browser.name == "msie"){	 
		return this.animate({opacity: 'toggle'}, speed, easing, callback);
	}
	else return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 
};

function showHide(id)
{
	var s = '#szczegoly'+id;
	//$(s).slideToggle("fast");
	$(s).slideFadeToggle("slow");
}

function randomShow()
{
	//showHide(Math.floor(Math.random()*PRODUCTS_COUNT));	

	var id = Math.floor(Math.random()*PRODUCTS_COUNT);
	//var s = '#szczegoly'+id;
	//$(s).animate({opacity: 'toggle', height: 'toggle'}, "slow"); 
	//showHide(id);
	showHide(0);
}

function updateKoszykMini()
	{
		var netto = $("#koszykSumaNetto").html();
		var brutto = $("#koszykSumaBrutto").html();
		
		var nettoTxt = $("#koszykSumaNettoTxt").html();
		var bruttoTxt = $("#koszykSumaBruttoTxt").html();
		
		$("#koszykText").html(nettoTxt+":<br/><b>"+netto+"</b><br/>"+bruttoTxt+":<br/><b>"+brutto+"</b>");			


		//var text = $("#info2").html();
		//$("#order").html(text);
	}
function showHideSuma(show)
{
	updateKoszykMini();
	if ( $('#koszyk_mini').is(':hidden'))
	{
		if(show)
		{
			$("#szczegoly_suma").show("slow");
		}
		else	
		{
			$("#szczegoly_suma").hide("slow");
		}
	}
}

function __showN(name,s,e)
{
	var name1 = "";
	for(i=s;i<e;i++)
	{
		name1 = "#"+name+""+i;		
		$(name1).animate({opacity: '1.0', height: 'toggle'},"fast"); 
	}
}
