function nextTeaser(current) {
	var next = current + 1;
	
	if (!$('tes' + next)) {
		next = 1;
	}
	
	$('tes' + next).show();
	$('tes' + next).style.zIndex = '1';
	$('tes' + current).show();
	$('tes' + current).style.zIndex = '2';
	
	new Effect.Fade('tes' + current);	
}

function automaticTeaser() {
	nextTeaser(currentTeaser)
	currentTeaser++;
					
	if (!$('tes' + currentTeaser)) {
		currentTeaser = 1;
	}
								
	setTimeout('automaticTeaser()', 7 * 1000);
}

function tagShow(tag) {
	$$('.start_tags').each(function(item) {
		item.hide(); 
	})
	$$('.tag_topnav').each(function(item) {
		item.removeClassName('active');
	})
	
	$('tag_topnav_' + tag).addClassName('active')
	$('tags_' + tag).show();
}

function selectTag(type, value, style) {
	
	if (type == 1) type = 'genre';
	if (type == 7) type = 'mood_sm';
	if (type == 8) type = 'soundslike_sm';
	
	params = 'query=&facet['+type+']='+value;

	if (typeof (pageTracker) == 'object') {
		pageTracker._trackPageview('/start-tagcloud-click/'+type+'/'+value+'/'+style+'/');	
	}	

	//in case a style tag was selected
	if (style != '') {
		params += '&facet[style]='+style;
	}

	var now = new Date ();
	var expires = new Date (now.getTime () + 600 * 1000);
	
	document.cookie = 
		'param=' + params + '; path=/; expires=' + expires.toGMTString() + ';';
	document.location = '/music/';
}