/* 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();
    


$(function() {
$('#menu-item-25 > a').mouseenter(function() {
$('#menu-item-25 > .sub-menu').fadeIn(150);
$('#menu-item-24 > .sub-menu').hide();
});
});
$(function() {
$('#menu-item-22 > a').mouseenter(function() {
$('#menu-item-22 > .sub-menu').fadeIn(150);
$('#menu-item-24 > .sub-menu').hide();
$('#menu-item-23 > .sub-menu').hide();
});
});
$(function() {
$('#menu-item-23 > a').mouseover(function() {
$('#menu-item-23 > .sub-menu').fadeIn(150);
$('#menu-item-22 > .sub-menu').hide();
$('#menu-item-25 > .sub-menu').hide();
});
});
$(function() {
$('#menu-item-24 > a').mouseover(function() {
$('#menu-item-24 > .sub-menu').fadeIn(150);
$('#menu-item-25 > .sub-menu').hide();
$('#menu-item-22 > .sub-menu').hide();
});
});
$(function() {
$('#header').mouseenter (function() {
$('.sub-menu').hide();
});
});

$(function() {
$('#menu-item-26 > a').mouseenter (function() {
$('.sub-menu').hide();
});
});

$(function() {
$('#content').mouseenter (function() {
$('.sub-menu').hide();
});
});

$.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: "O firmie", category:" ", pid: "4" },
			{ label: "Technik farmaceutyczny", category: "KIERUNKI", pid: "214" },
			{ label: "Technik usług kosmetycznych", category: "KIERUNKI", pid: "212" },
			{ label: "Asystentka stomatologiczna", category: "KIERUNKI", pid: "204" },
			{ label: "Higienistka stomatologiczna", category: "KIERUNKI", pid: "209" },
			{ label: "Gimnazjum", category: "INNE", pid: "207" },
			{ label: "Rekrutacja", category:" ", pid: "9" },
			{ label: "Druki do pobrania", category:"REKRUTACJA", pid: "662" },
			{ label: "Płatności", category:"REKRUTACJA", pid: "664" },
			{ label: "Promocje", category:"REKRUTACJA", pid: "40" },
			{ label: "Biuro LCE OMEGA", category: "GALERIA", pid: "734" },
			{ label: "Sale i laboratoria", category: "GALERIA", pid: "740" },
			{ label: "Gabinet stomatologiczny", category: "GALERIA", pid: "736" },
			{ label: "Gabinet kosmetyczny", category: "GALERIA", pid: "738" },
			{ label: "Targi edukacyjne", category: "GALERIA", pid: "742" },
			{ label: "Główna siedziba", category: "KONTAKT", pid: "481" },
			{ label: "Kielce", category: "KONTAKT", pid: "265" },
			{ label: "Kraków", category: "KONTAKT", pid: "267" },
			{ label: "Lublin", category: "KONTAKT", pid: "269" },
			{ label: "Miechów", category: "KONTAKT", pid: "271" },
			{ label: "Piotrków Tryb.", category: "KONTAKT", pid: "273" },
			{ label: "Rzeszów", category: "KONTAKT", pid: "275" },
			{ label: "Stalowa Wola", category: "KONTAKT", pid: "277" },
			{ label: "Tarnów", category: "KONTAKT", pid: "279" },
			{ label: "Warszawa", category: "KONTAKT", pid: "281" },
			{ label: "Zamość", category: "KONTAKT", pid: "283" }
		];
		
		$( "#tags" ).catcomplete({
			delay: 0,
			source: data,
			select: function( event, ui ) { 
			window.open(("?page_id=" + ui.item.pid), '_top') ;
			}
		});
	});

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