"); var content_value = parent.document.getElementById(getArgs("cid")).value; if(!content_value){ content_value = " "; } editor.document.writeln(content_value); editor.document.writeln(" "); editor.document.close(); editor.document.charset="gb2312"; function getArgs(sArgName) { var sHref = window.location.href; var args = sHref.split("?"); var retval = ""; if(args[0] == sHref) { return retval; } var str = args[1]; args = str.split("&"); for(var i = 0; i < args.length; i ++) { str = args[i]; var arg = str.split("="); if(arg.length <= 1) continue; if(arg[0] == sArgName) retval = arg[1]; } return retval; }; function getParentNode() { if (parentNode==null) { var h = window.location.href; var pos = h.lastIndexOf('/') h = h.substring(pos+1); var pNode=parent.document.getElementsByTagName('iframe'); for (var i=pNode.length-1;i>=0;i--) { var source=pNode[i].src; var pos = source.lastIndexOf('/') source = source.substring(pos+1); if (source==h) { parentNode= pNode[i]; } } } return parentNode; } function adapt(){ var totalHeight = parseInt(getParentNode().offsetHeight); var toolBarHeight = parseInt(document.getElementById("toolBar").offsetHeight); //var statueBarHeight = parseInt(document.getElementById("statueBar").offsetHeight); var ht = totalHeight-toolBarHeight-27; //alert ("toolBarHeight : " + toolBarHeight); document.getElementById("MsgFrame").style.height = ht + "px"; } function init() { //adapt(); //f = parent.document.getElementById(getArgs("fid")); var sub = function (){ parent.document.getElementById(getArgs("cid")).value = editor.document.lastChild.lastChild.innerHTML; return true; } //if (window.addEventListener) // f.addEventListener("submit",sub,false); //else f.attachEvent("onsubmit",sub); } function get_value(){ parent.document.getElementById(getArgs("cid")).value = editor.document.lastChild.lastChild.innerHTML; return true; } function set_value(obj){ if(!-[1,]){ editor.focus(); } editor.document.lastChild.lastChild.innerHTML = obj; return true; } function cmd(s,opt) { if(opt==null) editor.document.execCommand(s,false,null); else editor.document.execCommand(s,"",opt); editor.focus(); } function myCreateLink() { if (window.getSelection)//for firefox { var theURL=prompt('please input the URL','HTTP://'); if (theURL!=null) editor.document.execCommand('CreateLink',false,theURL); }else{ var sText = editor.document.selection.createRange(); var theURL=prompt('please input the URL','HTTP://'); if (theURL!=null) //theURL = theURL+" 'target=_blank' "; editor.document.execCommand('CreateLink',false,theURL); sText.parentElement().outerHTML=sText.parentElement().outerHTML.replace("300) { height = height-100; getParentNode().style.height=height+"px"; adapt(); } }; function insertHTML(html) { if (editor.document.selection.type.toLowerCase() != "none"){ editor.document.selection.clear() ; } editor.document.selection.createRange().pasteHTML(html) ; }; function insertFace(nFaceNum) { var FacePath = "http://hs.douding.cn/images_cn/editor/face/"; this.Msgiframe.contentWindow.focus(); this.Msgiframe.contentWindow.document.execCommand("InsertImage", false, FacePath + nFaceNum + ".gif"); this.Msgiframe.contentWindow.focus(); document.getElementById("EDiaryEditorfaceItem").style.display = "none"; } function showFace(){ var face = document.getElementById("EDiaryEditorfaceItem"); face.style.display = face.style.display == "block"?"none":"block"; }