function changeCaption(captions, location, current) {
	var current = typeof(current) != 'undefined' ? current : 0;
	var caption = captions.split('||');
	var count = caption.length;
	
	if(count == 1) { $(location).innerHTML = caption[0]; return; }

	if(current == count) {
		$(location).innerHTML = '&nbsp;';
	} else {
		$(location).innerHTML = caption[current];
	}
	
	if (current == count) {
		current = 0;
	} else {
		current++;
	}
	
	setTimeout('changeCaption("'+captions+'","'+location+'","'+current+'")', 3000);
}

function switchFriend(count, state) {
	if(state == 1) {
		$('friendAvatar' + count).style.display = 'none';
		$('friendImage' + count).style.display = 'block';
	} else {
		$('friendAvatar' + count).style.display = 'block';
		$('friendImage' + count).style.display = 'none';
	}
}