﻿function SetReply(ID)
{            
        
    var Comment;    
    try
    {
        var CommentDiv = document.getElementById("CommentDiv_"+ID);    
        var Clone = document.createElement("div");
        Clone.innerHTML = CommentDiv.innerHTML;        
        if (Clone.childNodes.length>1)
        {
            Clone.removeChild(Clone.childNodes[1]);  
        }        
        Comment = rtrim(ltrim(Clone.innerHTML));    
    }
    catch(ex)
    {
        alert(ex);
    }
          
        
    var Quote = "[Quote]"+Comment+"[/Quote]";    
    document.getElementById("ctl00_ContentPlaceHolder1_TextBox1").innerHTML = Quote;
    document.getElementById("ctl00_ContentPlaceHolder1_TextBox1").innerText = Quote; 
}

function ltrim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) 
{
	return stringToTrim.replace(/\s+$/,"");
}
