function formatText(index, panel) {
  return index + "";
}

$(function () {
    $('.anythingSlider').anythingSlider({
        easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
        stopText: "Stop",               // Stop text
        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
    });
    
    $("#slide-jump").click(function(){
        $('.anythingSlider').anythingSlider(6);
    });
    
});

function animate(id){
	var str=String(id);
	var prefix=str.substring(0,1);
	$('.'+prefix+'title').attr('style', 'display:block;cursor:pointer;');
	$('.'+prefix+'lead').attr('style', 'display:none;');
	$('#'+id+'title').attr('style', 'display:none;');
	$('#'+id+'lead').attr('style', 'display:block;');							
}

function geserJS(type, max, aId, aFoto){
	if ($('#'+type+'Member').attr( 'style')!=''){
		//ambil nilai hiddenMember dan tambahkan/kurangkan dengan 1
		if (type=='right') var current = Number($('#hiddenMember').html())+1;
		else var current = Number($('#hiddenMember').html())-1;
		$('#hiddenMember').html(current);
		
		// Operasi manipulasi panah kanan dan kiri
		if (type=='right') {
			if ((current)==max) $('#rightMember').attr( 'style', '').html('');
			$('#leftMember').attr( 'style', 'cursor:pointer;').html('< ');
		}
		else {
			if ((current)==0) $('#leftMember').attr( 'style', '').html('');
			$('#rightMember').attr( 'style', 'cursor:pointer;').html(' >');	
		}
		
		
		var newHTML='';
		for (var i=current; i<current+3; i++){
			var foto ='';
			var src='http://www.qualitealife.com/img/img_no_image_member.jpg';
			if (i<=max) {
				if (aFoto[i]!='') {
					foto=aFoto[i].substring(0, 4);
					if (foto=='http') src=aFoto[i];
					else src='http://www.qualitealife.com/img/upload/user/'+aFoto[i];
				}
				newHTML += '<li style="display:inline;"><a href="http://www.qualitealife.com/memberactivity/index/'+aId[i]+'"><img src="'+src+'" width="40px" height="40px" border="0"/></a></li> ';
			}	
		}
		
		//masukkan contentMember
		$('#contentMember').html(newHTML);
	}
}