$(document).ready( function( )
{
	var iLeft = $( "#content" ).offset( ).left;
	if ( iLeft <= 0 )
	{
		$("#content").css( "left" , "0px" );
		$("#content").css( "margin-left" ,"0px" );
	}
	$( "#info #link div" ).click( function( event )
	{
		event.preventDefault( );
		window.location = "mailto:info@bjornborg.be"
	});
	$( "#dropdown" ).change( function( )
	{
		$( "#locatorlist" ).stop( true, true ).fadeOut( "fast", function( )
		{
			$.ajax(
			{
				url: "shops.php?dropdown="+ $("#dropdown").val(),
				success: function( data )
				{
					$( "#locatorlist" ).html( data );
					$( "#locatorlist" ).fadeIn( "fast" );
				}
			});
		});
		
		
	});
	$("#dropdown").val("");
	$("#dropdown").change(function() {
		$("#locatorlist").stop(true,true).fadeOut("fast",function(){
			$.ajax({
				url: "shops.php?dropdown="+ $("#dropdown").val(),
				success: function(data) {
					$("#locatorlist").html(data);
					$("#locatorlist").fadeIn("fast");
				}
			});
		});
	});
	
	$( "#dealerlocator #dropdown" ).change( function( )
	{
		$( "#dealerlocatorlist" ).stop( true, true ).fadeOut( "fast", function( )
		{
			$.ajax(
			{
				url: "dealerlocations.php?dropdown="+ $("#dealerlocator #dropdown").val(),
				success: function( data )
				{
					$( "#dealerlocatorlist" ).html( data );
					$( "#dealerlocatorlist" ).fadeIn( "fast" );
				}
			});
		});
		
		
	});
	$("#dealerlocator #dropdown").val("");
	$("#dealerlocator #dropdown").change(function() {
		console.log('change');
		$("#dealerlocatorlist").stop(true,true).fadeOut("fast",function(){
			$.ajax({
				url: "dealerlocations.php?dropdown="+ $("#dealerlocator #dropdown").val(),
				success: function(data) {
					$("#dealerlocatorlist").html(data);
					$("#dealerlocatorlist").fadeIn("fast");
				}
			});
		});
	});
	
	$( "#be_dealercolumn #radiusSelect" ).change( function( )
	{
		searchLocations();	
	});

	
	$('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	

});

