var Core = {	controller: '',	action: '',	webHost: '',	webView: '',	webImg: '',	dateTime: '',	lang: '',	init : function() {		// PngFix        $('#inner').pngFix();		        // Reset search		$('.search').bind({			focus: function() {				if($(this).val()=="szukaj w serwisie..."){					$(this).val('');				}			},			focusout: function() {				if($(this).val()==""){					$(this).val('szukaj w serwisie...');				}			}		});				//SwfObject - header main page		if (Core.lang != 'ru') { // chwilowo nie mamy czcionki z cyrylicą			$('.swfHeader').each(function(){				var text = $(this).html();				var flashvars = {tekst: text,kolor: "#444444",size: "14px"};				var params = {menu: "false",wmode: "transparent",scale: "noscale",salign: "lt" };				var idFlash = $(this).attr("id");				var attributes = {id: idFlash,name: ""};				swfobject.embedSWF(Core.webView+'flash/textbox.swf', idFlash, "300", "28", "9.0.0","expressInstall.swf", flashvars, params, attributes);			});		}		// Hide / Show for download and gallery box		$('.imgArrowDown').hide();		$('.imgArrowUp').show();				$('.toggleMultimediaHref').bind({			click: function() {				if($(this).hasClass("hidden")){					$(this).find('.toogleText').html('ukryj');					$('.imgArrowDown').hide();					$('.imgArrowUp').show();					$(this).parent().parent().parent().find('.centerMultimediaContent').show("slow");					$(this).removeClass("hidden");				}else{					$(this).find('.toogleText').html('pokaż');					$('.imgArrowDown').show();					$('.imgArrowUp').hide();					$(this).parent().parent().parent().find('.centerMultimediaContent').hide("hide");					$(this).addClass("hidden");				}			}		});							/* Carousel */		$(".carousel").jCarouselLite({			btnNext: ".imageNext",			btnPrev: ".imagePrev",			divSize: 550 ,			visible: 3		});				/* Carousel dla strony głównej - główni klienci */		$(".carouselMainPage").jCarouselLite({			btnNext: ".imageNext",			btnPrev: ".imagePrev",			divSize: 200,			visible: 1		});				// Poleć znajomemu.		Core.dialog('dlgRecommend', '#btnOpenRecommend');		// Zakładki.		Core.tabs();		// Zmiana zdjęcia po wskazaniu kursorem.		Core.hoverImage();		// Drukowanie stron.		Core.print();				// Fancybox.		$('.fancybox').fancybox({			'titlePosition'	: 'inside'		});	},	print: function() {		$('.btnPrint').click(function(){			xferWindow = Core.openWindow(Core.webHost + 'print,index.html', 640, 280);			xferWindow.opener = self;			return false;		});	},	gallery: function() {					},		hoverImage: function() {		$('img.hoverImage, input.hoverImage').mouseenter(function(){			if ($(this).hasClass('active') === false) {				$(this).attr('src', $(this).attr('src').replace('.gif', '_on.gif'));				$(this).attr('src', $(this).attr('src').replace('.jpg', '_on.jpg'));				$(this).attr('src', $(this).attr('src').replace('.png', '_on.png'));			}		}).mouseleave(function(){			if ($(this).hasClass('active') === false) {				$(this).attr('src', $(this).attr('src').replace('_on.gif', '.gif'));				$(this).attr('src', $(this).attr('src').replace('_on.jpg', '.jpg'));				$(this).attr('src', $(this).attr('src').replace('_on.png', '.png'));			}		});	},	inputDescription: function(formName, elementName, description) {		var form = $(formName), element = $(elementName);		if (element.val() === '')			element.val(description);		element.focus(function(){			if ($(this).val() === description)				$(this).val('');		}).blur(function(){			if ($(this).val() === '')				$(this).val(description);		});		form.submit(function(){			if (element.val() === description)				element.val('');		});	},	dialog: function(dialogName, buttonOpenName) {		var dialog = $('#' + dialogName),			form = dialog.find('form'),			messages = dialog.find('.messageList'),			inputs = dialog.find('input.text, textarea');		dialog.submit(function(){			// Komunikat lub animacja ładowania.			messages.html('<p>Proszę czekać...</p>');			messages.show();			// Przeskaluj okno.			$.fancybox.resize();			// Wyślij żądanie.			$.post(form.attr('action'), form.serialize(), function(data){				if ('OK' === data.status) {					inputs.not('input[type="checkbox"]').val('');					inputs.removeAttr('checked');				}				else if ('ERROR' === data.status) {					$.each(data.fields, function(k, v){						dialog.find('[id*=' + k + ']').addClass('error');					});				}				var html = '';				for (var i in data.messages) {					html += '<p class="' + data.status + '">' + data.messages[i] + '</p>';				}				messages.html(html);				// Przeskaluj okno.				$.fancybox.resize();			}, 'json');			return false;		});		inputs.blur(function(){			$(this).removeClass('error');		});		$(buttonOpenName).fancybox({			href: '#' + dialogName,			titleShow: false,			margin: 0,			padding: 0,			onStart: function() {				// Usuń poprzednio wpisane wartości.				inputs.not('input[type="checkbox"]').val('');				inputs.removeAttr('checked');				// Usuń poprzednie komunikaty.				messages.html('');				messages.hide();			}		});		form.find('.btnClose').click(function(){			$.fancybox.close();			return false;		});	},	tabs: function () {		// Zakładki.		$('.buttons.ajax a').click(function() {			// Pobierz zapamiętane zakładki.			var activeTabs = $.cookie('ACTIVE_TABS');			if (activeTabs)				activeTabs = activeTabs.split(',');			else				activeTabs = new Array();			var id = activeTabs.indexOf($(this).parent().children('a.active').attr('href'));			if (typeof id != 'undefined')				activeTabs.splice(id, 1);			// Zmień zakładki.			$(this).parent().next('.tabs').children('div.tab').hide();			$($(this).attr('href')).show();			$(this).parent().children('a').removeClass('active');			$(this).addClass('active');			// Zapamiętaj aktywane zakładki.			activeTabs.push($(this).attr('href'));			$.cookie('ACTIVE_TABS', activeTabs.join(','));			return false;		});		// Przywróć zakładki.		var activeTabs = $.cookie('ACTIVE_TABS');		if (activeTabs)			activeTabs = activeTabs.split(',');		else			activeTabs = new Array();		for (var i in activeTabs) {			var button = $('.buttons.ajax a[href="' + activeTabs[i] + '"]');			button.parent().next('.tabs').children('div.tab').hide();			$(button.attr('href')).show();			button.parent().children('a').removeClass('active');			button.addClass('active');		}	},	openWindow : function( href, width, height ) {		return window.open(href, 'window', 'width=' + (width | 650) + ', height=' + (height | 650) +			', menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no');	}}$(document).ready(function() {	// Zamień pierwszą literę oraz każdą przed "_" na wielkie.	var controller = Core.controller.replace(/(^|_)([a-z])/g, function(m, p1, p2) {		return p1 + p2.toUpperCase();	});	Core.init();	if (window[controller] != undefined) {		if (typeof window[controller]['init'] == 'function') {			window[controller]['init']();		}		if (typeof window[controller][Core.action] == 'function') {			window[controller][Core.action]();		}	}});
