function customizechangeAddPrivacy(value){if(value=='Customize'){if($('notes_note_privacy')){$('notes_note_privacy').value='Customize'}openModal_Window('selMsgCustomize',true)}};function customizePrivacyEdit(note_id){customizechangeAddPrivacy('Customize')};function onCustomize(cus){CheckAllCusRadio(cus);if(cus!='OnlyMe')$('selUserCustomizeValue').innerHTML='';else $('selUserCustomizeValue').innerHTML=cus;if(cus=='FriendsofFriends'){$('users_view_status').checked=true}else{$('users_view_status').checked=false}$('customize_status').value=cus};function CheckAllCusRadio(cus){var selects=document.getElementsByTagName('radio');for(var i=0;i<selects.length;i++){if(selects[i].value==cus){selects[i].checked=true}}};function unCheckAllCusRadio(frmName){var frm=eval('document.'+frmName);for(var i=0;i<frm.elements.length;i++){var e=frm.elements[i];if(e.type=='radio'){e.checked=false}}return false};var divForNoRecords='selTagNoFriends';var divSuggestionFocus='selTagSuggestionFocus';function getTagPeopleSuggestion(divs,divs1,url){var options_xml={script:function(input){return url+"?suggest="+input},varname:"suggest",div_ids:divs,div_ids1:divs1,callback:function(obj){addToTagList(obj.id)}};var as_xml=new bsn.AutoSuggest('tag_people_name',options_xml)};function addToTagList(fname){$('selTagNoFriends').style.display='none';createTagDiv(fname);addTagPeopleName(fname);updateTagPeopleDiv()};function addTagPeopleName(fname){$("notes_tag_people").value=$("notes_tag_people").value+','+fname};function deleteNoteTagPeopleName(div_id,note_id){$('tagNote_'+div_id).style.display='none';url=SITE_URL+'members/notes.php';pars='isAjax=true&remove_tag=true&tag_id='+div_id+'&note_id='+note_id+'&';getAjaxContent(url,pars,'','post')};function deleteTagPeopleName(fname){var allFname=$("notes_tag_people").value;allFname=','+allFname;var removedName=allFname.replace(","+fname,'');$("notes_tag_people").value='';$("notes_tag_people").value=removedName.substring(1,removedName.length)};function updateTagPeopleDiv(){$('tag_people_name').value='';$('tag_people_name').focus()};function createTagDiv(fname){var newdiv=document.createElement('div');var divIdName='Tag'+fname;newdiv.setAttribute('id',divIdName);newdiv.style.width="100px";newdiv.style.height="20px";newdiv.innerHTML=fname+"&nbsp;&nbsp;<a onClick=this.parentNode.parentNode.removeChild(this.parentNode);updateTagPeopleDiv();deleteTagPeopleName('"+fname+"');>Delete</a>";$('selTagPeopleNameAdded').appendChild(newdiv);return false};function updateFriendsDiv(){$('friend_name').value='';$('friend_name').focus()};function deleteCustomizeFriendsName(fname,field_name){var allFname=$(field_name).value;allFname=','+allFname;var removedName=allFname.replace(","+fname,'');$(field_name).value='';$(field_name).value=removedName.substring(1,removedName.length)};function updateFriendsValue(){updateFriendsDiv()};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]}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==''||$(textarea_id).style.fontSize=='12px'){$(textarea_id).style.fontSize='12px';$(textarea_id).value='Write a comment...';new Effect.Highlight(textarea_id,{startcolor:'#FFCFCF',endcolor:'#ffffff'});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..'}new Ajax.Request(url,{method:'post',parameters:parms+"&isAjax=true&items="+Math.random(),onCreate:function(req){},onComplete:function(resp){data=resp.responseText;tmpArr=data.split('|||');if($(selLodingPostingTest)){$(selLodingPostingTest).innerHTML=''}$(textarea_id).value='';$(resultDiv).innerHTML='';resp.responseText.evalScripts();$(resultDiv).innerHTML=tmpArr['0'];if(replace_id&&max_length){$(replace_id).innerHTML=max_length+' '+remainingStr}if(tmpArr['1']){setCommentLastID(tmpArr['1'])}}});return false};function setNotesVaule(){$('selProfileEditCustomizeShow').style.display='block';hideAllBlocks();updateFriendsValue()};function onProfileCustomizeAddCancel(){$('notes_note_privacy').value='FriendsofFriends';$('friends_select_name').value='';$('customize_status').value='';$('selUserCustomizeValue').innerHTML='';$('selFriendNameAdded').innerHTML='';$('selProfileEditCustomizeShow').innerHTML='';unCheckAllCusRadio('msgCustomizeform');updateFriendsValue();hideAllBlocks()};function resetPosition(){var photoPosition=$('notesphotoposition').value;var photoPosition=photoPosition.substr(1);var splitValue=photoPosition.split('|');if($('photoEditCount').value){i=$('photoEditCount').value;var split_length=parseInt(splitValue.length)+parseInt($('photoEditCount').value)}else{i=0;var split_length=splitValue.length}for(i;i<split_length;i++){if($('photoEditCount').value){var splitIndex=parseInt(i)-parseInt($('photoEditCount').value)}else{var splitIndex=i}if(splitValue[splitIndex]){var div_name='selViewPhoto_'+splitValue[splitIndex];if($('photoDeleteCount').value){if(parseInt($('photoEditCount').value)<parseInt($('photoDeleteCount').value)){var new_pos=parseInt(i)+1}else{var new_pos=parseInt(i)}}else{var new_pos=parseInt(i)+1}$(div_name).innerHTML=" &lt; Photo "+new_pos+" &gt; "}}};function findPhotoCheckPoxVal(val,count){var testVal=$('notes_body').value;var div_name='selViewPhoto_'+count;if(val.checked==true){$('photoName').value=$('photoName').value+'@'+val.value;var photocount=parseInt($('photocount').value)+1;$('photocount').value=photocount;$('notes_body').value=testVal+'<Photo '+photocount+'>';$(div_name).innerHTML=" &lt; Photo "+photocount+" &gt; ";$('notesphotoposition').value=$('notesphotoposition').value+'|'+count;resetPosition()}else{var photocount=parseInt($('photocount').value);$('notes_body').value=testVal.replace('<Photo '+photocount+'>',"");$('photocount').value=photocount-1;var photonameRepl=$('photoName').value;$('photoName').value=photonameRepl.replace('@'+val.value,"");var notesphotopositionRepl=$('notesphotoposition').value;var notePhotoRepl=notesphotopositionRepl.split('|');$('notesphotoposition').value=notesphotopositionRepl.replace('|'+count,"");$(div_name).innerHTML='';resetPosition()}};function noteImageBuildBody(val,position){var testVal=$('notes_body').value;var photocount=parseInt($('photocount').value);var photoDeleteCount=parseInt($('photoDeleteCount').value);$('notes_body').value=testVal.replace('<Photo '+position+'>',"");$('photocount').value=parseInt(photocount-1);$('photoDeleteCount').value=parseInt(photoDeleteCount-1);var photoEditCount=$('photoEditCount').value;resetBodyPosition(photocount,position)};function showDeletePhotoLink(type,url,note_id){var image_count=$('photoEditCount').value;for(i=1;i<=image_count;i++){var div_name='selNotesImageDelete_'+i;if(type=='hide'&&$(div_name))$(div_name).style.display='none'}if(type=='hide'){$('selIframeImageLoder').style.display='block';$('selUploadDeleteLink').style.display='none';if(url)getAjaxContent(url,'show_ifram=true&note_id='+note_id,'selIframeImageLoder','post')}};function resetBodyPosition(count,position){var testVal=$('notes_body').value;var nowPhoto='';for(i=1;i<=count;i++){if(parseInt(position)<i){var newvalue=parseInt(i)-1;$('notes_body').value=testVal.replace('<Photo '+i+'>','<Photo '+newvalue+'>');testVal=$('notes_body').value}}};function chkSelectCheckBox(thisForm){var unChkCount=0;var chkBoxCount=0;for(var i=0;i<thisForm.elements.length;i++){if(thisForm.elements[i].type=="checkbox"){chkBoxCount++;if(!thisForm.elements[i].checked){unChkCount++}}}if(unChkCount==1&&!document.selMemberForum.checkall.checked){document.selMemberForum.checkall.checked=true}else if(chkBoxCount!=unChkCount){document.selMemberForum.checkall.checked=false}};function redirectToHome(html_url){window.location=html_url};function adminCustomizePrivacyEdit(note_id){$('friends_select_name').value=$('friends_name').value;$('customize_status').value=$('customize_status_value').value;onCustomize($('customize_status_value').value);getAjaxContent(SITE_URL+'admin/ajaxManageNotes.php','ajax_page=true&action=getFriendsName&note_id='+note_id,'selFriendNameAdded','post');customizechangeAddPrivacy('Customize')};function postPreviewValue(frmName){if(frmName=='frmPreview')document.frmPreview.submit();else if(frmName=='frmDeleteNote')document.frmDeleteNote.submit()};function hideOtherAction(action_arr,action_id){for(i=0;i<action_arr.length;i++){(action_arr[i]!=action_id)?$('main_'+action_arr[i]).hide():$('main_'+action_arr[i]).show()}};function addNoteValidation(){var action_value=arguments[0].value;var action_id=arguments[0].id;var action_arr=new Array('sub_write_Publish','sub_write_Preview','sub_write_Save_Draft','sub_write_Discard');var form=arguments[1];if(arguments.length>2){$('msg').value=arguments[2];if(arguments[2]==0)hideOtherAction(action_arr,action_id)}var url=SITE_URL+'members/notes.php';var selFormWriteNote=$('selFormWriteNote').serialize();var params='view=validateValue&photocount='+'&act='+action_value+'&'+selFormWriteNote;getAjaxContent(SITE_URL+'members/notes.php',params,'selAddNote','post')};function showNoteList(url,pars,resultDiv){getAjaxContent(url,pars,resultDiv,'post')};function changeTextAreaPosition(t){t.rows=1};function goToPreviewAction(div_name,html_url){closeModal_Window_OK(div_name);window.location=html_url};