jQuery(document).ready(function() { 
	// hides the slickbox as soon as the DOM is ready
	jQuery('#showhide').hide(); 
	// toggles the slickbox on clicking the noted link 
	jQuery('a#toggle').click(function() { 
		jQuery('#showhide').slideToggle(400); return false;
		});
	
jQuery('.showhide').toggle(function(){
	jQuery(this).parent().next().slideDown('slow').removeClass('hide').preventDefault;
	jQuery(this).html('Hide Comments');
	  },function(){
		jQuery(this).parent().next().slideUp('slow').addClass('hide').preventDefault;
		jQuery(this).html('Show Comments');
	})
	
	});

 
/* Textarea clear value */
var textAreaDefaultText = "";

    function textAreaFocus(textarea) {
        if (textarea.value == textAreaDefaultText) {
            textarea.value = "";
        }
    }

    function textAreaBlur(textarea) {
        if (textarea.value == "") {
            textarea.value = textAreaDefaultText;
        }
    }

    window.onload = function() {
        if ($('#comment').length) {
		var textarea = document.getElementById("comment");
	        textarea.onfocus = function() { textAreaFocus(this); };
        	textarea.onblur = function() { textAreaBlur(this); };
	}
    };


 
 
/* Comment character countdown */

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

