(function($){

	$.fn.unselectable = function(object) {
		return this.each(function() {

			if(typeof(this.onselectstart) != 'undefined') {
				$(this).bind('selectstart',function(event){return false;});
			} else if (typeof(this.style.MozUserSelect) != 'undefined') {
				$(this).css('MozUserSelect','none');
			} else {
				$(this).css('cursor','default');
				$(this).mousedown(function(event){return false;});
			}
		});
	};

	$(function()
	{
		$.select(function(select) {
			var get = $('#mapshop-form').find(':input[name!=TT]').serialize();
			window.location.href = '/products/maps/select.php?'+get.replace(/(^|\?|&)\w+=(0|&|$)/g,'').replace(/M\d/,'M')
		});

		$.popup();

		$('.step.current').each(function() {
			var step = $(this);

			if(step.is('#maps')) {
				var top = $('.step.prev#devices').position().top;
			} else if (step.is('#products')) {
				var top = $('.step.prev#maps').position().top;
			} else {
				return true;
			}

			$('html,body').animate({scrollTop:(top - 5 )},500);

		});
	});



})(jQuery);