$(function(){

	$("#control").bind('dblclick', function() {
		$("#control").fadeOut();
		return false;
	});
	
	if ($("#slider").length > 0) {
		$("#slider").easySlider({
			auto: true,
			continuous: true,
			controlsShow: false,
			speed: 1000,
			pause: 3000
		});
	};

	$('a[rel=lightbox]').lightBox();

	function changeCountry(countryid) {
		$.ajax({
			url: '/ajax/content.php',
			data: 'section=address&countryid=' + countryid,
			success: function(xml) {
				if ($("status", xml).text() != 1) {
					alert($("message", xml).text());
					return false;
				}
				$('#deliveryfieldset').html($("body", xml).text());
			},
			error: function() {
				alert('Communication Error');
			}
		});
	}
	
	$('#deliverycountryid').change(function() {
		changeCountry($(this).val());
	});
	
	if ($('#deliverycountryid').val()) {
		changeCountry($('#deliverycountryid').val());
	}

	if ($('h3.accessories')) { 
		setInterval(function() {
			//$('h3.accessories').toggleClass('blink');
		}, 1000);
	}	
	
	$('input.email').focus(function() {
		if ($(this).val() == 'Enter your email address...') {
			$(this).val('');
		}
	});
	$('input.email').blur(function() {
		if ($(this).val() == '') {
			$(this).val('Enter your email address...');
		}
	});	
	
	$('.productbox').click(function() {
		window.location = $('a', this).attr('href');
	});
	$('.productbox').hover(function() {
		$(this).css('cursor', 'pointer');	
	}, function() {
		$(this).css('cursor', 'auto');
	});
	
	$('#chooselanguage').toggle(function() {
		$('#languagelist').fadeIn('fast');
		$('#chooselanguage').addClass('active');
	},function() {
		$('#languagelist').fadeOut();
		$('#chooselanguage').removeClass('active');
	});	
	
});





