///////////////////////////////////////////////////////
// ContactUs edit dialog 

// return true if the dialog returns values
function doRTEDialog(hiddenTextId)
{
	var p = new Object();

        p.hiddenText = document.getElementById(hiddenTextId).value;
        p.hiddenText = ResolveRelativeLinks(p.hiddenText);

        p.styleSheets = document.styleSheets;
    
	var v = window.showModalDialog(RteDlgDialogUrl , p, 
		"scroll:no;center:yes;help:no;status:no;dialogHeight:520px;dialogWidth:700px;resizable:yes");
	
	if(v) 
	{
            document.getElementById(hiddenTextId).value = v.rteText;
            return true;
	}

	return false;
}


// links like <a href='#jump'>jump</a> would get converted to <a href="domain/_layouts../rtedialog.aspx#jump">
// if we dont do the following

function ResolveRelativeLinks(rteText)
{
    hiddendiv = document.createElement("div");
    hiddendiv.style.visibility = "hidden";
    hiddendiv.innerHTML = unescape(rteText);  // this line does the conversion
    return escape(hiddendiv.innerHTML);
}

