function insertAnImage(button)
{
//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance
var editor=CuteEditor_GetEditor(button);
//show the dialog page , and pass the editor as newwin.dialogArguments
//(handler,url,args,feature)
var newwin=showModalDialog("intImage.asp?fd=<%=iLink%>&sitename=<%=siteName%>"
,editor,"dialogWidth:420px;dialogHeight:500px");
}
=================================================================
function button_click(imgName)
{
var editor=Window_GetDialogArguments(window);
//alert(imgName);
editor.ExecCommand("InsertImage","",imgName);
window.close();
}
=================================================================
function Window_GetDialogArguments(win)
{
var top=win.top;
if(top.dialogArguments)
return top.dialogArguments;
var opener=top.opener;
if(opener==null)
return top.document._dialog_arguments;
return opener.document._dialog_arguments;
}