var loadID;
function addComment(eID){
document.FormMain.entryID.value = eID;
document.FormMain.action = "/_do/comment_input";
document.FormMain.target = "_top";
document.FormMain.submit();
}
function hideEntries(objID){
show_entries = '<a href="javascript:reShowEntries(\'' + objID + '\');">'+showrecent_link_text+'</a> | ';
document.getElementById(objID).style.display = "none";
document.getElementById("hide_show_"+objID).innerHTML = show_entries;
}
function reShowEntries(objID){
hide_entries = '<a href="javascript:hideEntries(\'' + objID + '\');">'+hiderecent_link_text+'</a> | ';
document.getElementById("hide_show_"+objID).innerHTML = hide_entries;
document.getElementById(objID).style.display = "block";
}
function loadFinish(cnt){
if(typeof loadID == 'undefined'){
return;
}
if(typeof cnt != 'undefined' && typeof loadEntryID != 'undefined' ){
document.getElementById("entry_"+loadEntryID+"_commentCount").innerHTML = ""+cnt;
}

document.getElementById(loadID).innerHTML = bufferFrame.document.body.innerHTML;
document.getElementById(loadID).style.display = "block";
document.getElementById("hide_show_"+loadID).innerHTML = '<a href="javascript:hideEntries(\'' + loadID + '\');">'+hiderecent_link_text+'</a> | ';

if(typeof cnt != 'undefined' && typeof loadEntryID != 'undefined' ){
if(cnt == 0 ){
var hide_show_id = "hide_show_entry_" + loadEntryID + "_comments";
if(document.getElementById(hide_show_id)){
document.getElementById(hide_show_id).style.display="none";
}
hideEntries(loadID);
}
}
}
function editPage(eID){
document.FormMain.entryID.value = eID;
document.FormMain.action = "/_do/edit_entry";
document.FormMain.submit();
}
function sendDeleteEntry(host, eID, isYgp, imageId){
this.eID = eID;
var me = this;
this.invoke = function(){
document.FormMain.entryID.value = eID;
document.FormMain.action = "http://" + host + "/_do/delete_entry";
if(doNotAskDelEntry){
document.FormMain.doNotAskDelEntry.value = 1;
}
if(isYgp == 'true'){
document.FormMain.isYgp.value = 'true';
document.FormMain.saveYgp.value=saveYgp;
document.FormMain.imageId.value=imageId;
}
if(saveYgp){
document.FormMain.saveYgp.value='true';
}
document.FormMain.submit();
}
}
function personalize(){
document.FormMain.action = "/_do/personalize";
document.FormMain.submit();
}
function editAboutMe(){
document.FormMain.action = "/_do/edit_about_me";
document.FormMain.submit();
}
function editJournalLinks(){
document.FormMain.action = "/_do/edit_journal_links";
document.FormMain.submit();
}
function editPageLinks(){
document.FormMain.action = "/_do/edit_page_links";
document.FormMain.submit();
}
function replaceIFrame(target, URL){
var IFrameDoc;
var IFrameObj = document.getElementById(target);
if(IFrameObj.contentDocument){IFrameDoc = IFrameObj.contentDocument;
IFrameDoc.location.replace(URL);
}else if (IFrameObj.contentWindow){IFrameDoc = IFrameObj.contentWindow.document;
IFrameDoc.location.replace(URL);
}else {IFrameObj.src = URL;
}
void 0
}

function deleteEntry(host, eID, isYgp, imageId, button){
var cb1Name;
var cb2Name;
if(isYgp == 'true'){
saveYgp=false;
cb1Name='saveYgp';
cb2Name='';
}else {
cb1Name='';
cb2Name='doNotAskDelEntry';
}
var cb = new sendDeleteEntry(host, eID, isYgp, imageId);
showConfirm("",
deleteentry_title_text,
deleteentry_msg_text,
button,
cb1Name,
save_ygp_entry_album_text,
cb2Name,
dont_ask,
cb);
}

function ac(p,c){p.appendChild(c)}

function blPop(url){
window.open(url,'blPopup','width=800px,height=520px,status=0,location=0,resizable=1,scrollbars=1',0);
}
function blLink(a){
var d=document;
var p=a.parentNode, t=a.title, b=p.parentNode;
a.removeAttribute('onclick');
a.removeAttribute('href');
ac(b,d.createElement('div'));
ac(b,d.createElement('i'));
ac(b,d.createElement('pre'));
ac(b.getElementsByTagName('i')[0],d.createTextNode(t));
ac(b.getElementsByTagName('pre')[0],d.createTextNode('<a href="'+d.location.href+'">\n'+d.title+'</a>'));
}

