$(document).ready(function() {
	// Focus border remove
	$("a").focus (function () {
		$(this).blur ();
	});
	


	$('#lPajacyk .con').flash({
    	src: "/public/flash/pajacyk.swf",
   	 	width: 180,
    	height: 88,
		wmode: 'transparent',
    	expressInstall: true
    });

	var topActive = $("#menu A.hit");
	$("#menu A").hover(
		function () {
			topActive.removeClass("hit");
			$(this).css ("color", "#ffffff");
			Cufon.replace (this);
			Cufon.replace (topActive);
		},
		function () {
			topActive.addClass("hit");
			$(this).css ("color", "#282828");
			
			Cufon.replace (this);
			Cufon.replace (topActive);
		}
	);

	// Clear input
	clearInput = function (arg) {
		var $nam = $(arg).val();
		
		$(arg).focus(function() {
			if($(this).val() == $nam) {
				$(this).val('');
			}
		});
		
		$(arg).blur(function() {
			if($(this).val() == '') {
				$(this).val($nam);
			}
		});
	}

	// Remove margin in last element
	$("#kontakt li:last-child").css({ borderBottom: '0 none' });
	$("#links dl:last").css({ paddingRight: '0' });
});

function updateBaskerList () {
	$.ajax ({
		url: "/adds/" + lang + "catproBasketList/",
		cache: false,
		success: function (html){
			if (html) {
				$("#notes .cont").html (html);
			}
		}
	});
}

$.fn.tagName = function() {
    return this.get(0).tagName.toLowerCase();
}

function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too) {
	var e='',c=',',xf='left=',yf='top='; this.n = name;
	if (document.layers) {xf='screenX='; yf='screenY=';}
	this.f = (w?'width='+w+c:e)+(h?'height='+h+c:e)+(x>=0?xf+x+c:e)+(y>=0?yf+y+c:e)+'location='+loc+',menubar='+men+',resizable='+res+',scrollbars='+scr+',status='+sta+',toolbar='+too;
	this.opened = function ()	{return this.w && !this.w.closed;};
	this.close = function ()		{if(this.opened ()) this.w.close ();};
	this.focus = function ()		{if(this.opened ()) this.w.focus ();};
	this.load = function (sUrl) {
		if (this.opened ()) this.w.location.href = sUrl;
		else this.w = window.open (sUrl,this.n,this.f);
		this.focus ();
		return false;
	};
}

