


/* Declare a namespace for the site */
var Site = window.Site || {};


/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	//same as $(document).ready();

jQuery(function($){
	$.datepicker.regional['pl'] = {
		closeText: 'Zamknij',
		prevText: '&laquo;Poprzedni',
		nextText: 'Następny&raquo;',
		currentText: 'Dzień',
		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
		'Lip','Sie','Wrz','Pa','Lis','Gru'],
		dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
		dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
		dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
		weekHeader: 'Tydz',
		dateFormat: 'yy-mm-dd',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['pl']);
});

$(function() {
		$( ".datepicker" ).datepicker();
	});	
	
$(function() {	
 $("#krok1").click(function(e){
	 e.preventDefault();
	 $('#regform').validate();
    if ($('#regform').valid()) { 
       	$('#strona1').hide();
        $('#strona2').show();
   
    }
 });
});


	



$(function() {
			$("div#makeMeScrollable").smoothDivScroll({ autoScroll: "onstart", 
														autoScrollDirection: "backandforth",
														autoScrollStep:1,
														autoScrollInterval: 100,
														startAtElementId: "startAtMe",
														visibleHotSpots: "always" });
 
		});
		
$(function() {
$('#wstecz2').click(function(){
$('#strona2').hide();
$('#strona1').show();	
});
$('#krok2').click(function(){
$('#strona2').hide();
$('#strona3').show();	
});
$('#wstecz3').click(function(){
$('#strona3').hide();
$('#strona2').show();	
});
$('#krok3').click(function(){
$('#strona3').hide();
$('#strona4').show();	
});
$('#wstecz4').click(function(){
$('#strona4').hide();
$('#strona3').show();	
});
});

 $(window).load(function() {
	    $('#slider').nivoSlider({
		effect:'fade',
		slices:1,
		directionNav:false,
		prevText: 'Prev', // Prev directionNav text
        nextText: 'Next',
		captionOpacity:0.8,
		pauseTime:4000,
		controlNavThumbs:true
		});

    });

$.widget( "custom.catcomplete", $.ui.autocomplete, {
		_renderMenu: function( ul, items ) {
			var self = this,
				currentCategory = "";
			$.each( items, function( index, item ) {
				if ( item.category != currentCategory ) {
					ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
					currentCategory = item.category;
				}
				self._renderItem( ul, item );
			});
		}
	});
	
$(function() {
		var data = [
			{ label: "SONDEK LP12 Majik", category: "SONDEK LP12", pid: "138" },
			{ label: "SONDEK LP12 Akurate", category: "SONDEK LP12", pid: "120" },
			{ label: "SONDEK LP12 Klimax", category: "SONDEK LP12", pid: "118" },
			{ label: "Klimax DS", category: "ŻRÓDŁA", pid: "173" },
			{ label: "Akurate DS", category: "ŻRÓDŁA", pid: "175" },
			{ label: "Majik DS", category: "ŻRÓDŁA", pid: "179" },
			{ label: "Majik DS-I", category: "ŻRÓDŁA", pid: "183" },
			{ label: "Sneaky Music DS", category: "ŻRÓDŁA", pid: "185" },
			{ label: "Sekrit DS-I", category: "ŻRÓDŁA", pid: "187" },
			{ label: "Radio DS", category: "ŻRÓDŁA", pid: "190" },
			{ label: "Klimax Kontrol", category: "KONTROLA", pid: "228" },
			{ label: "Klimax 500 Solo", category: "KONTROLA", pid: "230" },
			{ label: "Klimax Chakra 500 Twin", category: "KONTROLA", pid: "232" },
			{ label: "Akurate Kontrol Model 2011", category: "KONTROLA", pid: "234" },
			{ label: "Akurate C-Line Model 2011", category: "KONTROLA", pid: "236" },
			{ label: "Majik I", category: "KONTROLA", pid: "238" },
			{ label: "Majik C-Line", category: "KONTROLA", pid: "245" },
			{ label: "Kisto", category: "KONTROLA", pid: "247" },
			{ label: "Kinos", category: "KONTROLA", pid: "249" },
			{ label: "Klimax System", category: "NAGŁOŚNIENIE", pid: "252" },
			{ label: "Akurate System", category: "NAGŁOŚNIENIE", pid: "254" },
			{ label: "Majik System", category: "NAGŁOŚNIENIE", pid: "257" },
			{ label: "Custom 2K System", category: "NAGŁOŚNIENIE", pid: "259" },
			{ label: "Black Analogue Interconnect", category: "AKCESORIA", pid: "262" },
			{ label: "Black Balanced Interconnect", category: "AKCESORIA", pid: "264" },
			{ label: "Silver Analogue Interconnect", category: "AKCESORIA", pid: "266" },
			{ label: "Silver Balanced Interconnect", category: "AKCESORIA", pid: "268" },
			{ label: "V-Klip", category: "AKCESORIA", pid: "270" },
			{ label: "Skeet Floor Protectors", category: "AKCESORIA", pid: "272" },
			{ label: "Linn Speaker Cables", category: "AKCESORIA", pid: "274" },
			{ label: "Majik 109 Stand", category: "AKCESORIA", pid: "276" },
			{ label: "Akurate 212 Stand", category: "AKCESORIA", pid: "278" },
			{ label: "Linn Brakit", category: "AKCESORIA", pid: "280" },
			{ label: "RipNAS Cinema", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "903" },
			{ label: "RipNas Audio", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "894" },
			{ label: "HFX Touch", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "295" },
			{ label: "Aquavision", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "291" },
			{ label: "Quadraspire", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "287" },
			{ label: "Linn PuriFi", category: "PRODUKTY UZUPEŁNIĄJACE", pid: "284" },
			
		];
		
		$( "#tags" ).catcomplete({
			delay: 0,
			source: data,
			select: function( event, ui ) { 
			window.open(("?p=" + ui.item.pid), '_top') ;
			}
		});
	});



	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
