
$(document).ready(function(){  
	$(".inline").colorbox({
		width: '400px',
		height: '200px',
		maxWidth: '500px',
		maxHeight: '400px', 
		inline: true, 
		transition: 'none',
		opacity: '0.85',
		href:"#form_zapis_szablonu",
		title: function (){
			return $('#tytul_zapis_szablonu').html();
		}
	});
	
	
	$("#wczytanie_szablonu_colorbox").colorbox({
		width: '400px',
		height: '200px',
		maxWidth: '500px',
		maxHeight: '400px', 
		inline: true, 
		transition: 'none',
		opacity: '0.85',
		href:"#form_wczytanie_szablonu",
		title: function (){
			return $('#tytul_wczytanie_szablonu').html();
		}
	});
	
	$('#colorbox_przypomnij_haslo').colorbox({
		width: '400px',
		height: '200px',
		maxWidth: '500px',
		maxHeight: '400px', 
		inline: true, 
		transition: 'none',
		opacity: '0.85',
		href:"#szablon_zapomnialem_haslo",
		title: function (){
			return $('#tytul_generowanie_hasla').html();
		}
	});
	
	$('#colorbox_niezalogowany').colorbox({
		width: '400px',
		height: '250px',
		maxWidth: '500px',
		maxHeight: '400px', 
		inline: true, 
		transition: 'none',
		opacity: '0.85',
		href:"#uzytkownik_niezalogowany",
		title: function (){
			return $('#tytul_uzytkownik_niezalogowany').html();
		}
	});
	
	$('#button_adres_allegro').colorbox({
		width: '500px',
		height: '300px',
		maxWidth: '500px',
		maxHeight: '400px', 
		inline: true, 
		transition: 'none',
		opacity: '0.85',
		href:"#adres_allegro",
		title: function (){
			return $('#tytul_adres_allegro').html();
		}
	});
	
	// do buttonow na liscie platnosci
	var items = $('.margin_auto');
	var items_length = items.length;
	
	for (var i = 0; i < items_length; i++){
		var a = items[i];
		var id = a.id;
		var a = $('#' + id);
		a.colorbox({
			width: '500px',
			height: '300px',
			maxWidth: '500px',
			maxHeight: '400px', 
			inline: true, 
			opacity: '0.85',
			transition: 'none',
			href: function (){
				id_colorbox = (this.id).split('_');
				var indeks = id_colorbox[id_colorbox.length-1];
				var zawartosc = "#platnosc_oplac_" + indeks;
				return zawartosc;
			},
			title: function (){
				id_colorbox = (this.id).split('_');
				var indeks = id_colorbox[id_colorbox.length-1];
				var title = $('#tytul_platnosc_oplac_'+indeks).html();
				return title;
			}  
		});  
	} 
});
