function createResponse(id, form, dbfp, winwidth, winheight)
{	
    var dlgPath = '/' + dbfp  + "/" + form + "?readform&qnfl=blank&id=" + id;
    createComment({url:dlgPath,div:"comment-dlg"});
}
function createComment(obj)
{
	if (!obj)
	{
		$("#comment-wrapper").remove();
		$("#comment-dlg").remove();
	}else
	{
		$(document.body).append("<div id='comment-wrapper'></div>");
		
		//Get the screen height and width  
		var maskHeight = $(document).height();  
		var maskWidth = $(document).width();  
       
		//Set height and width to mask to fill up the whole screen  
		$('#comment-wrapper').css({'width':maskWidth,'height':maskHeight});  
           
		//transition effect       
		$('#comment-wrapper').fadeIn(1000);      
   		var maskHeight = $(window).height();  
		var maskWidth = $(window).width();  
		$(document.body).append("<div id='comment-dlg'></div>"); 
		dlgobj = $('#comment-dlg')
		dlgobj.css("top", ( $(window).height() - dlgobj.height()-100 ) / 2+$(window).scrollTop() + "px");
		dlgobj.css("left", ( $(window).width() - dlgobj.width() ) / 2+$(window).scrollLeft() + "px");
       	
		$('#comment-dlg').load(obj.url, function() {
                                $(".cmsinputfieldlabel").addClass("cms-comment-label")
			var name = $("#cms-comment-name")
			$("#cms-comment-table").replaceWith(name)
			$("#cms-comment-name").css("background-color","#999")
			$("#cms-comment-submit").click(function(){comitForm();return false})
			$("#cms-comment-cancel").attr("onclick",'')
			$("#cms-comment-cancel").click(function(){createComment();return false})
			$(document.body).keypress(function(event) {
				if (event.keyCode == '27') {
					createComment();
  				}
			});
		});
    
	}
}
function comitForm()
{
    str = $("#cms-comment-form").serialize()
    $.post("../frmCommentsToContentDocWeb?CreateDocument",str,function(data){
       createComment();
     } );
}

