$(function() {

	var ap = ['22px','76px','130px'];			// arrow position
	var lp = ['0px', '-220px', '-440px'];		// list position
	var i = 0;									// animation step index
	var timeout = 4000;							// animation step timer

	// on click handler
	$('ul#wpl-questions li').click(function(e) {
		
		var id = this.id,
			index;

		switch (id)
		{
		case 'web-item':
			index = 0;
			break;
		case 'print-item':
			index = 1;
			break;
		case 'brand-item':
			index = 2;
			break;
		}

		$('div#wpl-answers ul').animate({top:lp[index]},'slow');
		$('div#wpl-arrow').animate({top:ap[index]},'slow');

		return false;
		
	});

	// animation
	function doAnimation()
	{
		i < 2 ? i++ : i = 0;
		$('div#wpl-answers ul').animate({top:lp[i]},'slow');
		$('div#wpl-arrow').animate({top:ap[i]},'slow');
		
	}

	var interval = self.setInterval(doAnimation, timeout);

	// handler to clear animation effect
	$('div#wpl').mouseover(function () {
		clearInterval(interval);
	});

});