(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 = $('#device-form').find(':input[name!=TT]').serialize();
			//window.location.href = '/services/select.php?id=37&'+get.replace(/(^|\?|&)\w+=(0|&|$)/g,'').replace(/M\d/,'M')

			getid = $('#device-form').find('.selected').attr('id');
			var getlangid = document.countries.countryselection.value;
			
			if (getid != 'other') 
			{
				window.location.href = 'live-services-speedcam.php?product='+getid+'&Lid='+getlangid; 
			}
			else
			{ 
				window.location.href = 'live-services-other.php';
			}
		
		});

		$.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);
