// JavaScript Document

function togglecomments (postid) { 

   var whichpost = document.getElementById(postid); 
   
   if (whichpost.className=="commentshown") { 
      whichpost.className="commenthidden"; 
   } 
   else { 
      whichpost.className="commentshown"; 
   } 
} 


function viewComments(n) {
commentWindow=window.open('http://piggybank.sepiamoons.com/comments.php?' + n, 'comments' + n, 'directories=0,height=480,location=0,resizable=1,scrollbars=1,toolbar=0,width=515');
}
function countcomments(){
if (document.childNodes){
if(typeof(commentID) != "undefined"){
for (i=0;i<commentID.length;i++){
oSpan = document.getElementById(commentID[i]);
if(oSpan){
oSpanText = oSpan.firstChild;
while(oSpanText.nodeType != "3"){
if(oSpanText.hasChildNodes)
oSpanText = oSpanText.firstChild;
else
return false;
}
oSpanText.nodeValue = commentCount[i];
}
}
}
}
}


function expandcollapse (postid) { 

   whichpost = document.getElementById(postid); 
   
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
   } 
   else { 
      whichpost.className="postshown"; 
   } 
} 
