$(document).ready(function() {
	// jQuery Corners
	$('.corners-top').corner("6px top");
	$('.corners').corner("6px");
	$('.corners-bot').corner("6px bottom");
	$('a[rel="corners"]').corner("6px top");
	$('body').append("<div id='news-feed-temp'/>");
	// Html includes
	$('#news-feed-temp').load('/company/media-centre/archives.php .main-col p:not(".intro"):lt(5)', function() { 
		$('#news-feed-temp p').each(
			function() {
				$('#news-feed').append('<div class="news-item"><p class="news-feed-date">' + $("span.date", this).text() + '</p><p><a href="'+$("a", this).attr("href")+'" class="feed-link" target="_blank">'+ $("a", this).text() +'</a></p><ul class="more-link"><li><a href="'+$("a", this).attr("href")+'" target="_blank">MORE</a></li></ul></div>');
			}
		)
		 // this is the DOM element
		$('#news-feed-temp').remove();
	});

	function showcaseCycle() {
		$('#showcase-internal').cycle({
			fx: 'fade',
			timeout: 12000,
			random: true
		});
	}
	function recipeCycle() {
		$('#recipe-internal').cycle({
			fx: 'fade',
			timeout: 15000,
			random: true
		});
	}
	
	// Heros
	// Half
	$('#inc-company-half').load('/company/half.html');
	
	// Full
	$('#inc-people-full').load('/people/full.html');
	$('#inc-company-full').load('/company/full.html');
	
	// Showcase
	$('#inc-showcase').load('/showcase.html', showcaseCycle);
	
	// Showcase
	$('#inc-recipes').load('/recipes.html', recipeCycle);
	
	$('.input-site-search').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	})
	
	$('a[href^="http://www.seek.com.au"]')
		.attr({
			target: "_blank"
	});
});