/**
 *
 */
function saveProfileLayout() {
    xajax_saveProfileLayout(viewport.getState());
    return false;
}


function processShoutOut() {

	document.getElementById('shout_post').disabled = true;
    document.getElementById('shout_post').value    = 'Sending ShoutOut...';
    
    var user_id   = document.getElementById('shout_user_id').value;
    var poster_id = document.getElementById('shout_poster_id').value;
    var message   = document.getElementById('shout_message').value;

    xajax_processShoutOut(user_id, poster_id, message);
    
    document.getElementById('shout_post').disabled = false;
    document.getElementById('shout_post').value    = 'Post';
    document.getElementById('shout_message').value = 'Write Something...';

    return false;
}

function processDelShoutOut(shout_id,user_id,poster_id) {
	if(!confirm('Are you sure you want to delete this Shout Out?'))
    {
        return false;
    }
    xajax_processDelShoutOut(shout_id,user_id,poster_id);
    return false;
}


/******************************************************************************************************************
    CODE BELOW THIS POINT NEEDS TO BE REVIEWED AND POSSIBLY RE-IMPLEMENTED
 *****************************************************************************************************************/

/**
 *
 */
function cancelProfileAboutForm() {

    document.getElementById('about_cancel').disabled = true;
    document.getElementById('about_cancel').value    = 'Cancelling...';

    xajax_cancelProfileAboutForm();
    return false;
}

/**
 *
 */
function cancelProfilePlatformForm() {

    document.getElementById('platform_cancel').disabled = true;
    document.getElementById('platform_cancel').value    = 'Cancelling...';

    xajax_cancelProfilePlatformForm();
    return false;
}

/**
 *
 */
function displayProfileTab(tab, mode, video_id) {
    xajax_displayProfileTab(tab, mode,video_id);
    return false;
}

/**
 *
 */
function processProfileAboutForm() {

    document.getElementById('about_submit').disabled = true;
    document.getElementById('about_submit').value    = 'Saving...';

    xajax_processProfileAboutForm(xajax.getFormValues('about_form'));//, tinyMCE.selectedInstance.getContent());
    return false;
}

/**
 *
 */
function processProfilePlatformForm() {

    document.getElementById('platform_submit').disabled = true;
    document.getElementById('platform_submit').value    = 'Saving...';

    xajax_processProfilePlatformForm(xajax.getFormValues('platform_form'));
    return false;
}

/**
 *
 */
function processProfilePlatVideosForm() {

    document.getElementById('platform_submit').disabled = true;
    document.getElementById('platform_submit').value    = 'Saving...';
    xajax_processProfileVideosForm(xajax.getFormValues('platform_form'));
    return false;
}

/**
 *
 */
function processProfileFriendsForm(page, status, action, id) {
    if (action == 'decline') {
        if (!confirm('Are you sure you want to delete this request?')) {
            return false;
        }
    }
    if (action == 'delete') {
        if (!confirm('Are you sure you want to delete this friend?')) {
            return false;
        }
    }
    xajax_processProfileFriendsForm(page, status, action, id);
    return false;
}

/**
 *
 */
function processProfileFavoritesForm(page, delete_id) {
    if (delete_id) {
        if (!confirm('Are you sure you want to delete this favorite?')) {
            return false;
        }
    }
    xajax_processProfileFavoritesForm(page, delete_id);
    return false;
}

/**
 *
 */
function actProfileFriend(friend_id, act) {
    if (friend_id) {

		if((act!='APPROVED_R') && (act!='DENIED_R')) {
			message = (act == 'APPROVED') ? 'approve' : 'remove';
			if (!confirm('Are you sure you want to ' + message + ' this friend?')) {
			  return false;
		     }
		} else {
			message = (act == 'APPROVED_R') ? 'accept' : 'deny';
			if (!confirm('Are you sure you want to ' + message + ' this friend request?')) {
			  return false;
		     }
			act = (act=='APPROVED_R') ? 'APPROVED' : 'REMOVE';
		}
    }
    xajax_actProfileFriend(friend_id, act);
    return false;
}

/**
 *
 */
function addProfileFriendFav(user_id, which) {
    xajax_addProfileFriendFav(user_id, which);
    return false;
}

/**
 *
 */
function friendsPaging(user_id,page) {
    xajax_friendsPaging(user_id,page);
    return false;
}

/**
 *
 */
function foesPaging(user_id,page) {
    xajax_foesPaging(user_id,page);
    return false;
}

/**
 *  *
 *   */
function photosPaging(user_id,page) {
    xajax_photosPaging(user_id,page);
    return false;
}


/***
to show complete listing of block ***/

function processBlogEntry(blogid,user_id){
	xajax_processBlogEntry(blogid,user_id,'blog');
	return false;
	}

	/***
to show complete listing of poll ***/

function processPollEntry(pollid,user_id){
	xajax_processPollEntry(pollid,user_id,'poll');
	return false;
	}

