if ($('.flash')) {
	setInterval(function() {
		$('.flash').toggle();
	}, 500);
}

$(document).ready(function(){
//	$(".flash").fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);

	$('.morelinkspanel').hide();
	var randNum = Math.floor(Math.random() * 4);
	//$('.image' + randNum).fadeIn('slow');
	$('#cycleimages').fadeIn('slow').cycle({
		fx:     'scrollDown',
		speed:   800,
		timeout: 12000,
		pause:   1,
		startingSlide: randNum,
		before: function() {
			$('.morelinkspanel').hide('slow').hide();
		}
	});

	$('.morelinks').click(function() {
		$('.morelinkspanel').fadeIn('slow');
	});

	$('#cycleimages a').hover(
		function () {
			$(this).stop().animate({marginLeft: '6px', marginRight: '-6px'}, 200);
		},
		function () {
			$(this).stop().animate({marginLeft: '0', marginRight: '0'}, 200);
		}
	);

});


function popup(theURL,winName,features)
{window.open(theURL,winName,features);}

function elementByID(elementID) {
	if (document.getElementById) {
		return document.getElementById(elementID);
	} else if (document.all) {
		return document.all[elementID];
	} else {
		return eval("document." + elementID);
	}
}


function swapImage(id, image) {
	elementByID(id).src = image;
}

Cufon.replace('h1');