function innerText(a){return document.all?a.innerText:a.textContent}function PasteImgHTML(d){var a=document.getElementById("EditorClientId").value,b=document.getElementById(a),c="<img src='"+d+"' alt='' />";b.PasteHTML(c)}function PasteATagHTML(c){var a=document.getElementById("EditorClientId").value,b=document.getElementById(a);b.PasteHTML(c)}function saveJournalEntry(c,j,g){displayInSituMsg("",0);if(c.id=="btnSaveAndPublish")if(!confirm("You will not have the opportunity to unpublish this entry once it has been published to the public.\r\nPlease Confirm that you wish to publish this entry to the public.")){document.forms[0].ITEM_IS_PUBLISHED.value="False";return false}var n=document.forms[0].ITEM_ID.value,h=document.getElementById("EditorClientId").value,f=document.getElementById(h);document.getElementById("ITEM_DESC").value=f.getHTML();var b=true,a=document.getElementById("err");for(i=a.rows.length;i>1;i--)a.deleteRow(a.rows.length-1);var l=f.GetDocument(),k=innerText(l.body);if(k.length==0){var e=a.insertRow(-1),d=e.insertCell(-1);d.innerHTML="<b>You must enter a &quot;Post&quot;.</b>.";a.style.visibility="visible";a.style.display="block";b=false}if(!checkSelected(document.getElementById("categoryDiv"))){var e=a.insertRow(-1),d=e.insertCell(-1);d.innerHTML="<b>You must select at least one &quot;Category&quot;.</b>.";a.style.visibility="visible";a.style.display="block";b=false}if(!checkSelected(document.getElementById("tagDiv"))){var e=a.insertRow(-1),d=e.insertCell(-1);d.innerHTML="<b>You must select at least one &quot;Search Tag&quot;.</b>.";a.style.visibility="visible";a.style.display="block";b=false}if(!b){displayInSituMsg("Errors encountered.  Please see top of form.",1);return false}else{var m=hsiFolder+"UpdateJournalEntry.aspx";!submitContainer(c,j,g,m,getJournalItemIdCB,c.id)&&displayInSituMsg("Errors encountered.  Please see top of form.",1)}}function getJournalItemIdCB(b,a){if(a=="btnSave"){document.forms[0].ITEM_ID.value=b;displayInSituMsg("Changes Saved.",1)}else window.location.href=document.getElementById("rd").value}function doRate(a){var c=hsiFolder+"RateMemberJournalItem.aspx",b="itemId="+itemId+"&journalType="+jtype+"&rating="+a.value;postRequest(c,b);window.location.href=document.getElementById("rd").value}function updatePassphrase(a){var b=a.name.split("_"),d=b[1],e=hsiFolder+"UpdateRelationshipPassphrase.aspx",c="relationshipId="+d+"&phrase="+a.value;postRequest(e,c)}function postRequest(b,a){try{httpRequestPOST(b,a)}catch(c){alert(c)}}function updateCaption(a,b){var c=document.getElementById(b);c.innerHTML=a}function enableRelationTable(e){var f=document.getElementById("relateTbl"),a=f.getElementsByTagName("INPUT"),d=a.length;if(e.checked)for(var c=0;c<d;c++)a[c].disabled="";else for(var b=0;b<d;b++){a[b].disabled="disabled";if(a[b].type=="checkbox")a[b].checked=""}}function deleteJournalEntry(a,b){var d=hsiFolder+"DeleteJournalEntry.aspx",c="itemId="+a+"&journalType="+b;window.confirm("Are you sure you want to delete this journal entry and any comments?")&&asynchHttpRequestPOST(d,c,getDeleteJournalEntryCB,getDeleteJournalEntryExceptionCB,a)}function getDeleteJournalEntryExceptionCB(a){alert(a.responseText)}function getDeleteJournalEntryCB(){var a=hostMemberJournalHomePageUrl;window.location.href=a}function deleteJournalComment(d,a){var c=hsiFolder+"DeleteJournalItemComment.aspx",b="id="+d+"&journalType="+a;window.confirm("Are you sure you want to delete this comment?")&&asynchHttpRequestPOST(c,b,getDeleteJournalCommentCB,getDeleteJournalCommentExceptionCB)}function getDeleteJournalCommentCB(){var a="http://"+window.location.hostname+window.location.pathname;window.location.href=a}function getDeleteJournalCommentExceptionCB(a){alert(a.responseText)}function editJournalComment(c){var a=document.getElementById("div_"+c),b=document.getElementById("tbl_"+c);if(a.style.display=="block"){a.style.display="none";b.style.display="block"}else{a.style.display="block";b.style.display="none"}}function cancelEditJournalComment(a){var c=document.getElementById("div_"+a),b=document.getElementById("tbl_"+a);c.style.display="block";b.style.display="none"}function updateJournalComment(c,b,a){var d=hsiFolder+"UpdateJournalItemComment.aspx";submitContainer(c,b,a,d,getUpdateJournalCommentCB)}function getUpdateJournalCommentCB(){var b=window.location.href.indexOf("#"),a="";if(b!=-1)a=window.location.href.substring(0,b);else a=window.location.href;window.location.href=a}function journalCommentSubscribe(f,c){var a=document.getElementById("btnSubscribe"),b=document.getElementById("btnSubscribe2");if(a.value=="Subscribe"){a.value="Unsubscribe";a.title="Unsubscribe to this post";b.value="Unsubscribe";b.title="Unsubscribe to this post"}else{a.value="Subscribe";a.title="Subscribe to this post";b.value="Subscribe";b.title="Subscribe to this post"}var e=hsiFolder+"UpdateJournalCommentSubscription.aspx",d="itemId="+f+"&journalType="+c;try{httpRequestPOST(e,d)}catch(g){alert(g)}}var currEquipCatId=0,currEquipCat=0,currEquipClassId=0;function cgEquipClass(b){var a=b.options[b.selectedIndex].value;if(a==currEquipCat)return;currEquipClassId=a;getEquipCatsForClass(a)}function getEquipCatsForClass(a){var b="equipClassId="+a;try{asynchHttpRequestPOST(hsiFolder+"GetEquipmentCategoriesForEquipmentClassification.aspx",b,getEquipCatsCB,exceptCB)}catch(c){alert(c);return false}}function getEquipCatsCB(f){var g=createObjectFromXml(f.responseXML),b=g.dataTables[0].dataRows;if(b.length==0)return;var e=document.getElementById("eCatCell"),d="EQUIPMENT_CATEGORY_ID",a=document.getElementById(d);if(a==null){a=document.createElement("SELECT");a.setAttribute("id",d);e.appendChild(a)}else a.options.length=0;a.length=b.length;for(var c=0;c<b.length;c++){dataRow=b[c];a.options[c]=new Option(dataRow.DESCRIPTION,dataRow.ID)}}function exceptCB(a){alert("Problem: "+a.responseText)};
