
function displayComments(entryID) {
	if(document.getElementById('comment'+entryID).className=="none"||document.getElementById('comment'+entryID).className!="block"){
		document.getElementById('comment'+entryID).className="block";
	}else{
		document.getElementById('comment'+entryID).className="none";
	}

/*    var width=420;
   var height=420;
   var left=(screen.availWidth - width) / 2;
   var top=(screen.availHeight - height) / 2;
   window.open('comments.cfm?entryID='+entryID, 'comments', 'top=' + top + ', left=' + left + ', scrollbars=yes,resizable=yes,toolbar=no,location=no,width='+width+',height='+height+''); */
}

/* all mailto: links have their email addresses reversed. this function finds them all and reverses them back */
function initSpamFree() {
	if (!document.getElementsByTagName) return;

    var tags = new Array('a','area');

    for (var j=0; j<tags.length; j++) {
    	//alert(tags[j]);
	    var anchors = document.getElementsByTagName(tags[j]);

	    for (var i=anchors.length-1; i>=0; i--) {
		    var anchor = anchors[i];
			var email = '';
			var newEmail = '';
			var href = '';
			var alerts = '';

		    if (anchor.getAttribute('href')) {
				href = anchor.getAttribute('href');

				//alert(href);

		    	if (href.substring(0,7)=='mailto:') {
		    		email = href.substring(7);

		    		alerts += email +'\n';

		    		for (var x=email.length; x>=0; x--) {
		    			alerts += email.charAt(x) +'\n';

		    			newEmail += email.charAt(x);
		    		}

		    		newEmail = newEmail.replace('$$#64;', '@');
		    		anchor.onmouseover = 'window.status=\'mailto:'+ newEmail +'\'';
		    		anchor.href = 'mailto:'+ newEmail;

		    		//alert(alerts);
		    	}
	    	}
	    }
    }
}

/* finds all comment forms and adds a hidden input field to prevent spambots from using them */
function initCommentSpam() {
	if (!document.getElementsByTagName) return;

	var forms = document.getElementsByTagName('form');
	for (var i=0; i<forms.length; i++) {
		if ((forms[i].getAttribute('class') && forms[i].getAttribute('class')=='commentsclass') || forms[i].className=='commentsclass') {
				var input = document.createElement('input');
		    input.setAttribute('type', 'hidden');
		    input.setAttribute('name', 'checkup');
		    input.setAttribute('value', '79F1F0CA-99CE-40A7-6EB938207A32709F');
		
		    forms[i].appendChild(input);			
		}
	}
}
	
window.onload = function() {
//	initSpamFree();
//	initCommentSpam();
}

