
    $.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };
var ismoving = false;
var automove = false;
function movelogos(dir) {
logosleft = logosleft+dir;
if (logosleft <= 0 - logoswidth) {logosleft = 0;}
$("#logos").css({"left":logosleft+"px"});
}
function startlogos() {
automove = setInterval("movelogos(-2)",50);
}
function stoplogos() {
clearInterval(automove);
}
function addtobasket(id) {
$("#ajaxload").fadeIn(200);
$("#koszykajax").load("koszyk.html?add="+id,function(){
$("#ajaxload").fadeOut(200);
});
}
function removefrombasket(id) {
$("#ajaxload").fadeIn(200);
$("#koszykajax").load("koszyk.html?remove="+id,function(){
$("#ajaxload").fadeOut(200);
});
}
function loadcategory(id) {
$("#categoryajax").slideUp(200,function() {
$("#categoryajax").html('<img src="gfx/loading.gif" width="16" height="16" alt="" hspace="15" />').slideDown(100,function() {
$("#categoryajax").load('ajaxcat,'+id+'.html',function() {
$("#categoryajax").slideDown(200);
});
});
});
}

function switchCat(id,notid,e) {
$('#switcher_'+notid).slideUp(250);
$('#switcher_'+id).slideDown(250);
$('#menuheading a').removeClass('active');
$(e).addClass('active');
}

$(document).ready(function() {
	$('a').live('click',function(){$(this).blur();});
	$(".onlynumbers").keydown(function(event) {
		// Allow only backspace and delete
		if ( event.keyCode == 46 || event.keyCode == 8 ) {
			// let it happen, don't do anything
		}
		else {
			// Ensure that it is a number and stop the keypress
			if (event.keyCode < 48 || event.keyCode > 57 ) {
				event.preventDefault();	
			}	
		}
	});
});


