var Comment = {
    submit:function()
    {
        var user_id = LoginStatus.UserId;
        var item_id = Dialog.productID;
        var cur_filter = Dialog.curAction;
        var data =  "action=comment" +
                    "&Filter=" + $("filter").value +
                    "&Comment=" + $("userComment").value +
                    "&ItemID=" + item_id +
					"&CommentLocation=" + cur_filter +
	                "&UserID=" + user_id;

		if(typeof(Expert)!="undefined"){
			data += "&date=" + Expert.YearMonthValue;
		}
		
        //$("widgetSubmitCommentButton").disabled = true;
        
		//alert(data);
		AjaxObject.startRequest("comment",data,"widgetSubmitCommentPanel");
        return;
    },
    validateComment:function()
    {
        var valComment = new Validate("commentErrorSummary");
		valComment.isEmpty("userComment","commentValidationError","Comment is empty.");
		if(valComment.isValid())
		{
	        this.submit();
		}
		else
		{
			valComment.yield(true);
		}
		return;
    },
    handleSuccess:function(o)
    {
       Utility.swap("screen1","thanksscreen");
       //$("commentValidationError").innerHTML = "Thank you for your comment!";
       //$("widgetSubmitCommentButton").disabled = false;
       //setTimeout("$('widgetContainer').style.display = 'none';",2000);
       return;
    }
}
