/* 

Author: Adv.pl

*/
$(document).ready(function() {
	
	$('.faq #page-content li h4').click(function() {
		flag = true;
		if (!($(this).parent().hasClass('selected-question'))) {
			$(this).parent().addClass('selected-question');
			flag = false;
		}
		$(this).next().slideToggle(200, function() {
			if ($(this).parent().hasClass('selected-question') && flag) {
				$(this).parent().removeClass('selected-question');
			}
		});
	});
	
	// pytania hashowane...
	// mozna jeszcze sprawdzac czy hash jako string sklada sie z 'pytania' i inta.
	// ale chyba nie ma wiekszego sensu.
	link = window.location.hash;
	link = link.substr(1);
	if (link != 'undefined' && link != '') {
		$('#page-content ol li').filter(function() {
			for (var i = 0; i < $(this).length; i++) {
				if ($(this).attr('id') == link) {
					return $(this);
				}
			}
		}).find('h4').click();
	}
	
	$('input[placeholder], textarea[placeholder]').placeholder();
	
	// rowne kolumny...
	hcs = $('#home-content-shadow');
	hfaq = $('#home-faq');
	if (hcs.outerHeight() < hfaq.outerHeight()) {
		hcs.css('height', hfaq.outerHeight());
	}

});
