/**
 * @author - deepakb
 * @created on - 2nd Dec 2009 at 6:47 PM
 * @Purpose - For handling artist profile page
 */
function readMoreBio(){
    $('#bio').slideUp(500, function(){
        $('#showButton').hide();
        $('#hideButton').show();
        $('#allbio').slideDown(500);
    });
}

function readLessBio(){
	$('#allbio').slideUp(500, function(){
        $('#hideButton').hide();
        $('#showButton').show();
        $('#bio').slideDown(500);
    });
}

/**
 * Function for refreshing the Schedule List
 * @param baseUrl - Pass the URL
 * @return - Schedule List from DB as per parameter
 */
function refreshArtistScheduleList(baseUrl, val, artistId){
	$('#show_filter').attr('value',val);
	 //Refresh Published video list
	$('#schedule_box').html('');
	$('#schedule_box_loader').show();
    $.post(baseUrl+'/ajax/refreshartistschedule',
    {
        type:'sample_music',
        artistId:artistId,
        filter:val
    },function(result){
    	$('#schedule_box').html(result);
    	$('#schedule_box_loader').hide();
    });
}

function addAsFav(baseUrl, artistID){
	$('#favLoading').show();
	$('favMsg').html();
   //Add as Favorite funtcionality
    $.post(baseUrl+'/ajax/addasfavorite',
    {
        artistId:artistID
    },function(result){
        if(result == 1)
        {   
        	$('#favLoading').hide();
        	$('#favMsg').show();
        	$('#favMsg').css('color','green');
        	$('#favMsg').html('Successfully added artist to your favorites');
        }
        if(result == 0)
        {
        	$('#favLoading').hide();
        	$('#favMsg').show();
        	$('#favMsg').css('color','red');
        	$('#favMsg').html('Unable to add as fan');
        }
        if(result == 2)
        {
        	$('#favLoading').hide();
        	$('#favMsg').show();
        	$('#favMsg').css('color','red');
        	$('#favMsg').html('You are already a fan of this Artist');
        }
    });
}

function addLikeabilityRating(baseUrl, val, videoId){
	$('#likeability_loader').show();
	$('#likeability_msg').hide();
	 //Add likeability rating
    $.post(baseUrl+'/ajax/addlikeabilityrating',
    {
        value:val,
        videoId:videoId
    },function(result){
		//alert(result);
var rr=result.split("~");
var res=rr[0];
//alert($res);
var alr=rr[1];
if(res == 1){   
        	$('#likeability_loader').hide();
        	$('#likeability_msg').show();
        	$('#likeability_msg').css('color','green');
        	$('#likeability_msg').html('Successfully added likeability rating');
        	$('#label_likeability').attr('class', 'smlGrayText');
        	$('#radiolabel').attr('class', 'medGrayBold');
        	$('.likrad').attr('disabled', true);
        }
        if(res == 0){
        	$('#likeability_loader').hide();
        	$('#likeability_msg').show();
        	$('#likeability_msg').css('color','red');
        	$('#likeability_msg').html('You already rated it');
        }			

    });
}
