jQuery(document).ready(function($) {
	// Headline
	
	var headlineTimer = null;
	
	$('.layer-content').each(function() {
		var oStage = $(this);
		
		$('.layer-description li', oStage).hover(function() {
			if (!$(this).hasClass('item-selected')) {
				var index = $(this).parent().find('li').index($(this));
				
				$('.layer-description li.item-selected', oStage).removeClass('item-selected');
				
				$(this).addClass('item-selected');
				
				$('.listing-images li').stop(true, true);
				
				$('.listing-images li:visible').fadeOut('fast', function() {
					$('.listing-images li:eq('+index+')').fadeIn('fast');
				});
			}
			
			clearInterval(headlineTimer);
			
		}, function() {
			headlineTimer = setInterval(function() {
				if ($('.layer-description li.item-selected').is(':last-child')) $('.layer-description li:first-child').trigger('mouseover');
				else $('.layer-description li.item-selected').next().trigger('mouseover');
			}, 5000);
		}).css('cursor', 'pointer').click(function() {
			location.href = $('a:eq(0)', $(this)).attr('href');
		});
	});
	
	headlineTimer = setInterval(function() {
		if ($('.layer-description li.item-selected').is(':last-child')) $('.layer-description li:first-child').trigger('mouseover');
		else $('.layer-description li.item-selected').next().trigger('mouseover');
	}, 5000);

	$('#email').focus(function() {
		if ($(this).val() == 'Enter email address') $(this).val('');
	}).blur(function() {
		if ($(this).val() == '') $(this).val('Enter email address');
	});
	$('#name').focus(function() {
		if ($(this).val() == 'Enter name') $(this).val('');
	}).blur(function() {
		if ($(this).val() == '') $(this).val('Enter name');
	});
	$('#news-email').focus(function() {
		if ($(this).val() == 'Enter email address') $(this).val('');
	}).blur(function() {
		if ($(this).val() == '') $(this).val('Enter email address');
	});
	$('#news-name').focus(function() {
		if ($(this).val() == 'Enter name') $(this).val('');
	}).blur(function() {
		if ($(this).val() == '') $(this).val('Enter name');
	});
});


	

