/**
 *
 * @access public
 * @return void
 **/
function showProfilePhotoAlbums(resultDiv,userId)
	{
		var resultDiv = arguments[0];
		var userId = arguments[1];
		var page_id;
		var pars = 'showProfilePhotoAlbums=true&comment_paging=true&start=0';
		pars += '&user_id='+userId;
		(arguments.length > 2) ? pars += '&page_id='+arguments[2] : false;
		setLoadingStatus(resultDiv);
		var url = SITE_URL+'members/profile_updates.php';
		getAjaxContent(url,pars,resultDiv,'POST');
	}

function showProfileVideoAlbums()
	{
		var resultDiv = arguments[0];
		var userId = arguments[1];
		var page_id;
		var pars='showProfileVideoAlbums=true&comment_paging=true&start=0';
		pars += '&user_id='+userId;
		(arguments.length > 2) ? pars += '&page_id='+arguments[2] : false;
	 	setLoadingStatus(resultDiv);
		var url = SITE_URL+'members/profile_updates.php';
		getAjaxContent(url,pars,resultDiv,'POST');
	}

function showProfileAudioAlbums()
 	{
		var resultDiv = arguments[0];
		var userId = arguments[1];
		var page_id;
		var pars='showProfileAudioAlbums=true&comment_paging=true&start=0';
		pars += '&user_id='+userId;
		(arguments.length > 2) ? pars += '&page_id='+arguments[2] : false;
	 	setLoadingStatus(resultDiv);
		var url = SITE_URL+'members/profile_updates.php';
		getAjaxContent(url,pars,resultDiv,'POST');
	}

function showProfileNotes()
 	{
 		var resultDiv = arguments[0];
		var userId = arguments[1];
		var page_id;
		var pars='showProfileNotes=true&comment_paging=true&start=0';
		pars += '&user_id='+userId;
		(arguments.length > 2) ? pars += '&page_id='+arguments[2] : false;
		setLoadingStatus(resultDiv);
		var url = SITE_URL+'members/profile_updates.php';
		getAjaxContent(url,pars,resultDiv,'POST');
	}


function showPosts()
	{
		$('selAllPostLi').className = '';
		$('selMyUpdatesLi').className = '';
		$('selFriendsUpdatesLi').className = '';

		var pars = '?post_by='+arguments[0];
		pars += '&show_updates=true';
		var url = arguments[1];
		var divId = arguments[2];
		if( arguments.length == 4 )
			{
				$(arguments[3]).className = 'clsActiveCommonProfileLink';
			}
		setLoadingStatus(divId);
		getAjaxContent(url,pars,divId,'post');

		return false;
	}
function showmyphotoAlbums(resultDiv)
{
//	$(resultDiv).innerHTML='<p class="clsLodingUpdates"><img src="../images/ajax-loading.gif" /> &nbsp;&nbsp;<span style="color:#DD6C34">Loading..</span></p>';
	var url = SITE_URL+'members/profile_updates.php';
	var pars='comment_paging=true&start=0';
	getHTML(url,pars,resultDiv,'POST');
}


function photolist(resultDiv,pars)
{
	var pars='comment_paging=true&start=0&'+pars;
	getHTML(SITE_URL+'members/photolist_ajax.php',pars,resultDiv,'POST');
}

function PostComments()
{
	var url = arguments[0];
	var parms = arguments[1];
	var textarea_id = arguments[2];
	var resultDiv = arguments[3];
	var remainingStr = ' Characters remaining';
	if( arguments.length > 4 )
		{
			var replace_id = arguments[4];
		}
	if( arguments.length > 5 )
		{
			var max_length = arguments[5];
		}
	if(arguments.length > 6)
			{
				var selLodingPostingTest = arguments[6];
			}
	if(IsBlank(textarea_id)){return false;}
	//var postValue=$(textarea_id).value;
	var postValue=jstrim($(textarea_id).value);

	if( postValue.length > max_length )
			{
				postValue = postValue.substring(0, max_length);
			}

	 parms='activity_post_comments=true&'+ parms +'&activity_comment_content='+escape(postValue);
	if(postValue==''){
			return;
		}

	if($(selLodingPostingTest))
			{
				$(selLodingPostingTest).innerHTML='<img src="../images/ajax-page_loader.gif" />&nbsp;Posting..';
			}
		else
			{
				$(resultDiv).innerHTML='<img src="../images/ajax-page_loader.gif" />&nbsp;Posting..';
			}
	//$(resultDiv).innerHTML='<img src="../images/ajax-page_loader.gif" />&nbsp;Posting..';
	new Ajax.Request(
				url,
				{
					method:'post',
					parameters:parms +"&isAjax=true&items=" + Math.random(),
					onCreate:function(req){
						//For later use
					},
					onComplete:function(resp)
					{
						//setting the text area value to  empty
						data = resp.responseText;
						tmpArr = data.split('|||');
						if($(selLodingPostingTest))
							{
								$(selLodingPostingTest).innerHTML='';
							}
						$(textarea_id).value='';
						$(resultDiv).innerHTML='';
						 resp.responseText.evalScripts();
						$(resultDiv).innerHTML=tmpArr['0'];
						setSlideDownEffect(resultDiv);
						if(replace_id && max_length)
							{
								$(replace_id).innerHTML = max_length+' '+remainingStr;
							}
						if(tmpArr['1'])
							{
								setCommentLastID(tmpArr['1'])
							}
					}
				}
			);
			return false;


}

function showUpdateDiv(divName,resultDiv)
{
	document.getElementById('wall_2').style.display='none';
	document.getElementById('wall_1').style.display='none';
	document.getElementById(resultDiv).style.display='';
	//$(resultDiv).innerHTML='';

	var pars='comment_paging=true&start=0';
	getHTML(SITE_URL+'members/profile_updates.php',pars,resultDiv,'POST');
}



function showCommentsDiv(divName)
{
	document.getElementById('commentsPhotos').style.display='none';
	document.getElementById('commentsVideos').style.display='none';
	document.getElementById('commentsBlogs').style.display='none';
	document.getElementById(divName).style.display='block';
}

function showVideoTab(divName,li_id)
{
	document.getElementById('showMyvideoTab').style.display='none';
	document.getElementById('showCommonvideoTab').style.display='none';
	document.getElementById('showFeaturedvideoTab').style.display='none';
	$('test').className='';
	$('test1').className='';
	$('test2').className='clsRayzzFeatured';

	if(li_id!='test2'){
		$(li_id).className='clsActiveRayzzVideosLink';
	}
	else{
		$(li_id).className='clsActiveRayzzVideosLink clsRayzzFeatured';
	}
	document.getElementById(divName).style.display='block';
}


/**
 *
 * @access public
 * @return void
 **/
function writeNoteSubmit(resultDiv){
	var url = SITE_URL+'members/profile_updates.php';
	var notes_title = escape($('notes_title').value);
	var notes_body = escape($('notes_body').value);
	var notes_note_privacy = escape($('notes_note_privacy').value);
	var notes_tag_people = escape($('notes_tag_people').value);
	var some_friends_name = escape($('friends_select_name').value);
	var friends_select_name = escape($('friends_filter').value);
	var customize_status = escape($('customize_status').value);
	var formHiddenValueShow = escape($('formHiddenValueShow').value);
	var page_id = escape($('page_id').value);
	var notes_title_lenght = notes_title.length;
	notesUpdateDiv = 'selUpdates';
	if(!notes_title || !notes_body || parseInt(notes_title_lenght)>150 )
		{
			notesUpdateDiv = 'selFormWriteNote';
		}
	//$(notesUpdateDiv).innerHTML='<img src="../images/ajaxLoadingRed.gif" />&nbsp;Posting..';
	setLoadingStatus(notesUpdateDiv);
	var pars='chkValidateNote=true&showProfileWriteNotes=true&notes_title='+notes_title+'&notes_body='+notes_body+'&notes_tag_people='+notes_tag_people+'&notes_note_privacy='+notes_note_privacy+'&friends_select_name='+friends_select_name+'&some_friends_name='+some_friends_name+'&customize_status='+customize_status+'&formHiddenValueShow='+formHiddenValueShow+'&comment_paging=true&start=0';
	if(page_id)
		pars = pars+'&page_id='+page_id;
	getAjaxContent(SITE_URL+'members/profile_updates.php',pars,notesUpdateDiv,'POST');
	if(notesUpdateDiv=='selUpdates')
		{
			$('notes_title').value='';
			$('notes_body').value='';
			$('notes_note_privacy').value='EveryOne';
			if(formHiddenValueShow=='yes')
			{
				$('notes_tag_people').value='';
				$('friends_select_name').value='';
				$('friends_filter').value='';
				$('customize_status').value='';
				$('notes_note_privacy').value=''
				$('selTagPeopleNameAdded').innerHTML='';
				$('selUserCustomizeValue').innerHTML='';
				$('selFriendNameAdded').innerHTML='';
				$('selFriendNameAdded1').innerHTML='';
			}
			$('wall_6').hide();
		}
}

//home page tap function start from here
/**
 *
 * @access public
 * @return void
 **/
function showHomePageSelectTap(select_tap_id){
	Sortable.create("dragdropWeemHome");
	$('selNewFeedsLi').className = 'clsInActive';
	$('selStatusUpdatesLi').className = 'clsInActive';
	if($('selActivityPhotosLi'))
		$('selActivityPhotosLi').className = 'clsInActive';
	$('selPostedItemsLi').className = 'clsInActive';
	$('selLiveFeedLi').className = 'clsInActive';

	if( select_tap_id == 'home_news_feeds' )
		{
			$('selActivityUpdatesMain').className = 'clsProfileNavLeft clsProfileNavActiveLeft';
			$('selNewFeedsLi').className = 'clsActive clsFirstLink';
		}
	else if( select_tap_id == 'home_status_updates' )
		{
			$('selActivityUpdatesMain').className = 'clsProfileNavLeft';
			$('selStatusUpdatesLi').className = 'clsActive';
		}
	else if( select_tap_id == 'home_photos' )
		{
			$('selActivityUpdatesMain').className = 'clsProfileNavLeft';
			$('selActivityPhotosLi').className = 'clsActive';
		}
	else if( select_tap_id == 'home_posted_items' )
		{
			$('selActivityUpdatesMain').className = 'clsProfileNavLeft';
			$('selPostedItemsLi').className = 'clsActive';
		}
	else if( select_tap_id == 'home_live_feed' )
		{
			$('selActivityUpdatesMain').className = 'clsProfileNavLeft';
			$('selLiveFeedLi').className = 'clsActive';
		}

	setLoadingStatus('selHomePageTapHeader');
	pars = 'selectedHomePageTap='+select_tap_id+'&header_tap_link=true';
	var url =SITE_URL+'members/profile_updates.php';
	getHTML(url,pars,'selHomePageTapHeader','POST');
}

/**
 *
 * @access public
 * @return void
 **/
function showHomeCommentShowCancel(showId){
	$('selShowCancel_'+showId).hide();
	$('selHideCancel_'+showId).show();
}

/**
 *
 * @access public
 * @return void
 **/
function showHomeCommentHideCancel(showId){
	$('comment_content_'+showId).value='';
	$('selShowCancel_'+showId).show();
	$('selHideCancel_'+showId).hide();
}

/**
 *
 * @access public
 * @return void
 **/
function hieAllProfileEditTap()
	{
		var taps = new Array("wall","profileBasics","profilePhotos","profileVideos","profileAudios","profileNotes");
		var show_name = 'Show';
		var hide_name = 'Hide';
		for(i=0;i<taps.length;i++)
			{
				var div_show_name = 'sel'+taps[i]+show_name;
				var div_hide_name = 'sel'+taps[i]+hide_name;
				if($(div_show_name))
					{
						$(div_show_name).show();
					}
				if($(div_hide_name))
					{
						$(div_hide_name).hide();
					}
			}
	}

/**
 *
 * @access public
 * @return void
 **/
function showProfileEdit(show_type,final_name)
	{
		var div_name = 'sel'+show_type+final_name;
		$(div_name).show();
	}
/**
 *
 * @access public
 * @return void
 **/
function hideProfileEdit(show_type,final_name)
	{
		var div_name = 'sel'+show_type+final_name;
		$(div_name).hide();
	}

/**
 *
 * @access public
 * @return void
 **/
function showProfileTextField(show_type,show_name,hide_name,field_name)
	{
		hieAllProfileEditTap();
		var div_show_name = 'sel'+show_type+show_name;
		var div_hide_name = 'sel'+show_type+hide_name;
		$(div_show_name).show();
		$(div_hide_name).hide();
		$(field_name).focus();
	}

/**
 *
 * @access public
 * @return void
 **/
function updateProfileTap(url,type,div_name)
	{
		var pars = 'action_profile=update_profile_tap&'+type+'='+$(type).value;
		getAjaxContent(url,pars,div_name,'POST','updateProfileTapResponse');
	}

/**
 *
 * @access public
 * @return void
 **/
function updateProfileTapResponse(originalRequest,div_name)
	{
		var tap_value = trim(originalRequest.responseText);
		$(div_name).innerHTML = tap_value;
		hieAllProfileEditTap();
	}

/**
 *
 * @access public
 * @return void
 **/
function addProfileTaps(module,profile_taps_order)
	{
		var pars = 'action_profile=update_taps_order&module='+module+'&profile_taps_order='+profile_taps_order;
		var url = SITE_URL+'members/profile_updates.php';
		getAjaxContent(url,pars,'','POST','addProfileTapsResponse');
	}
/**
 *
 * @access public
 * @return void
 **/
function addProfileTapsResponse(originalRequest)
	{
		var url = trim(originalRequest.responseText);
		if(url)
			{
				window.location = url;
			}
	}
function moreTapLink(div_name,active_div,hite_tap_name){
	if($(div_name).style.display=='')
		{
			$(div_name).hide();
			$(active_div).className = 'clsInActive';
		}
	else
		{
			$(div_name).show();
			$(hite_tap_name).hide();
			$(active_div).className = 'clsInActive clsMoreActiveBdr';
		}

}