var l18n = {
	
	taxCategories: 'Kategorie',
	taxTags: 'Tags',
	quickToggle: 'Zmaksymalizuj panel',
	quickToggleOff: 'Zminimalizuj panel',
	areaResize: 'Click and drag to extend the body area',
	selectAll: 'Zaznacz wszystkie',
	deselectAll: 'Odznacz wszystkie',
	showMiniblog: 'Rozwi\u0144 \u00BB',
	htmlSwitch: 'Wy\u0142\u0105cz HTML',
	htmlSwitchOff: 'W\u0142\u0105cz HTML',
	hideMiniblog: 'Zwi\u0144  \u00AB',
	invertSelection: 'Odwr\u00F3\u0107 zaznaczenie',
	uploadOptions: 'Ilo\u015B\u0107 plik\u00F3w',
	chooseFile: 'Wybierz plik:',
	uploadDelete: 'Usu\u0144',
	fileType: 'Typ pliku',
	passwordShowHide: 'Show password during typing',
	bricksMini: 'Poka\u017C opis szablon\u00F3w',
	bricksMiniOff: 'Ukryj opis szablon\u00F3w',
	entryPreviewSwitch: 'Ukryj podgl\u0105d',
	entryPreviewSwitchOff: 'Poka\u017C podgl\u0105d',
	addReader: 'Dodaj czytelnika',
	addReaderType: 'Typ:',
	addReaderAcc: 'Expatica.com',
	addReaderPass: 'Spoza Expatica.com',
	
	addNewLink: 'Dodaj link',
	addNewLinkNot: 'Cacnel',
	addNewLinkDesc: 'Dodaj opis tekstowy +',
	addNewLinkDescNot: 'Usu\u0144 opis tekstowy',
	addNewLinkXFN: 'Dodaj relacj\u0119 (XFN) +',	
	addNewLinkXFNNot: 'Usu\u0144 relacj\u0119 (XFN)',	
	
	qtSortTags: 'Sort tags',
	qtSortTagsOff: 'Ok, sko\u0144czone',
	qtShowMore: 'More tags',
	qtShowLess: 'Less tags',
	qtCloseTags: 'Close all tags',
	qtCompactForm: 'Compact mode on',
	qtCompactFormOff: 'Compact mode off',
	qtReorderTags: 'Change tags order',
	
	qtH3title: 'Quicktags',
	qtAddNew: 'Dodaj nowy tag',
	qtDelTag: 'Usu\u0144 tag',
	
	qtInfoTitle: 'Opis, tytu\u0142, accesskey:',	
	qtInfoExtra: 'Dodatkowy',
	
	qtTagsInfo: 'Tags:',
	qtTagsOpen: 'Otwieraj\u0105cy',
	qtTagsClose: 'Zamykaj\u0105cy',
	qtTagsSingle: 'To jest pojedynczy tag',
	
	qtAttrsRow: 'Atrybuty:',
	qtAttrsName: 'Nazwa atrybutu',
	qtAttrsDefault: 'Domy\u015Blny tekst',
	qtAttrsReq: 'Wymagany',
	qtAttrsNew: 'Dodaj nowy atrybut',
	qtAttrsDel: 'Usu\u0144'
	
};

var Expatica = {
	
	userLogged: false,

	start: function() {
		this.isLogged();
		this.enhanceAccounts();
		this.minorTweaks();
		/*@cc_on
		/*@if (@_win32)
		this.fixIEFocus();
		/*@end@*/
	},
	
	isLogged: function() {
		if (document.body.className == 'logged') this.userLogged = true;
	},

	enhanceAccounts: function() {
		var acc = $('#actions li.accounts');
		var accul = acc.find('ul');
		if (accul.size() > 0) {
			acc.attr('id', 'accounts-js').children('a')
				.addClass('js')
				.toggle(function() {
					$(this).addClass('selected');
					accul.show();
				}, function() {
					$(this).removeClass('selected');
					accul.hide();
				});
			accul
				.css('minWidth', acc.width() + 'px')
				.find('a').css('minWidth', acc.width() + 'px')
				/*@cc_on
				/*@if (@_win32)
				.css('width', acc.width() + 'px')
				/*@end@*/
		}
	},

	minorTweaks: function() {
		$('#footer p a').bind('click', function(e) {
			$('#top').ScrollTo('normal', function() {
				$(this).focus();
			});
			e.preventDefault();
		});
	},
	
	fixIEFocus: function() {
		$('#access-content a').add('#access-sidebar a').bind('focus', function() {
			this.className = 'focus';
		}).bind('blur', function() {
			this.className = '';
		});
	}

}

function initialize() {
	Expatica.start();
	if (typeof ExpaticaHome != 'undefined') ExpaticaHome.start();
	if (typeof ExpaticaFrontend != 'undefined') ExpaticaFrontend.start();
}

$().ready(initialize);