$(document).ready(function() {

	//#cienie dla IE
	$('.blackShadow').textShadow({ x:1, y:1, radius:0, color:'#000000' });
	$('.whiteShadow').textShadow({ x:1, y:1, radius:0, color:'#FFFFFF' });

	$('.leftMenu a').mouseenter(function() {
		$(this).find('.whiteShadow').textShadow({ x:0, y:0, radius:0, color:'#FFFFFF' });
	}).mouseleave(function() {
		$(this).find('.whiteShadow').textShadow({ x:1, y:1, radius:0, color:'#FFFFFF' });
	});


	//# zmien system
	$('.zmienSystem').click(function() {
	});


	//# szukaj w serwisie
	$('form[name=formSzukaj] input[name=ZnajdzFraze]').InputDefValue({
		inputValue: 'Szukaj w serwisie'
	});


	//# Pomoc, Regulamin
	if ( $('.pRegulaminPomoc .Lista').length > 0 ) {
		var hash = location.hash;
		var name = hash.replace('#', '');

		if ( name && name != 'null' ) {
			$('a[name='+name+']').parents('li').addClass('Open');
			$('li.Open').find('.Arrow').html('&laquo;'); /* nc */
		}
	}

	$('.Lista .Row-1 a').click(function() {
		var thisName = $(this).attr('name');

		if ( $(this).parents('li').hasClass('Open') ) {
			$(this).parents('li').removeClass('Open');
			$(this).parents('li').find('.Arrow').html('&raquo;'); /* nc */
			getHash('null');
		}
		else {
			$('.Lista li').removeClass('Open');
			$(this).parents('li').addClass('Open');
			$(this).parents('li').find('.Arrow').html('&laquo;'); /* nc */
			getHash(thisName);
		}

		function getHash(_str) {
			window.location.hash = _str;
		}
	});


	//# Systemy operacyjne
	if ( $('.systemList').length > 0 ) {
		$('.iLink').click(function() {
			if ( $(this).parent('.boxLink').hasClass('Open') ) {
				$(this).parent('.boxLink').removeClass('Open');
				$(this).find('.colorBlue').html('&raquo;'); /* nc */
			}
			else {
				$('.systemList .boxLink').removeClass('Open');
				$(this).parent('.boxLink').addClass('Open');
				$(this).find('.colorBlue').html('&laquo;'); /* nc */
			}
		});
	}



	//---testy ------------------------------------------------------------------------------------------------//
	$('.testAlert').click(function() {
		geAlertPopup('Komunikat ze strony', 'Nieprawidlowy format numeru telefonu ...', 'OK', false);
		return false;
	});

});
