
// EXTERNAL LINKS

$(document).ready(function()
{
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
});




// VALIDATION HIDE

$(document).ready(function()
{
	if (location.hostname == "neven.ca" || location.hostname == "www.neven.ca")
	{
		$("#validation").hide();
	}
});




// ADDRESS

$(document).ready(function()
{
	var calgary = '<address>Knut Neven<br/>#509 - 205 Riverfront Avenue SW<br/>Calgary, Alberta<br/>T2P 5K4<br/>Canada<br/><br/>403.667.6960<br/><a href="mailto:postmaster@neven.ca">postmaster@neven.ca</a>';
	$("div.address[title='calgary']").html(calgary);
});




// SIDEBAR

$(document).ready(function()
{
	$("#sidebar dd").hide();
	var showThis = Math.floor(Math.random()*($("#sidebar dd").size()));
	$("#sidebar dd:eq(" + (showThis) + ")").show();
	$("#sidebar dt").mouseover(function()
	{
		$("#sidebar dd").hide('fast');
		$(this).next().toggle('slow');
		return false;
	});
	$("#sidebar h2:last").mouseover(function()
	{
		$("#sidebar dd").show('slow');
		return false;
	});
});




// CYCLE

$(document).ready(function()
{
	$("#cycle .cycleIMG").cycle(
	{
		fx: 'fade',
		pause: 3,
		after: onAfter,
		pager: '.cyclePAG',
		prev: '#cycleNAVp',
		next: '#cycleNAVn'
	});

	function onAfter(){
		$("#cycle .cycleALT").html(this.alt);
	}
});