/***
document.writeln(" ");
/***/
document.domain ="chinadaily.com.cn";
function preg_replace(search, replace, str, regswitch) {
var regswitch = !regswitch ? 'ig' : regswitch;
var len = search.length;
for(var i = 0; i < len; i++) {
re = new RegExp(search[i], regswitch);
str = str.replace(re, typeof replace == 'string' ? replace : (replace[i] ? replace[i] : replace[0]));
}
return str;
}
function Rfilter(str) {
return preg_replace(['\'','"', '<\/?[^>]*>'], ['','', ''], str);
}
function getCookie(name) {
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg)) {
return unescape(arr[2]);
} else {
return null;
}
}
function SetCommentiframeHeight(obj) {
var win=obj;
setInterval(function(){setIntervalSetCommentiframeHeight(win);},1000);
}
function setIntervalSetCommentiframeHeight(win){
var IframeBodyHeight=getCookie('IframeBodyHeight');
win.height = IframeBodyHeight;
}
function makeFrameReply() {
var hash = Math.random();
var comments = document.body.innerHTML ;
var iscommentobj = null;
iscommentobj = document.getElementById('iscomment');
if(!iscommentobj) {
return false;
}
if(iscommentobj.value != 1) {
return false;
}
var articleid ="";
var articleid = document.getElementsByTagName("meta")['contentid'].getAttribute("content");
//var articleid = document.getElementById("contentid").content
var url = encodeURIComponent(window.location.href+'#'+articleid);
document.getElementById('hiddenDivReply').innerHTML = '
';
}
function addLoadEvent(func){
var oldonload = window.onload,
sta;
if (typeof window.onload!='function'){
window.onload = func;
sta = 0;
} else {
sta = 1;
}
window.onload = function(){
if (sta == 1){
oldonload();
}
func();
}
}
addLoadEvent(makeFrameReply);
startInit('commentiframe', 360);
var browserVersion = window.navigator.userAgent.toUpperCase();
var isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
var isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
var isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
var isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
var isIE = (!!window.ActiveXObject || "ActiveXObject" in window);
var isIE9More = (! -[1, ] == false);
function reinitIframe(iframeId, minHeight) {
try {
var iframe = document.getElementById(iframeId);
var bHeight = 0;
if (isChrome == false && isSafari == false)
bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = 0;
if (isFireFox == true)
dHeight = iframe.contentWindow.document.documentElement.offsetHeight + 2;
else if (isIE == false && isOpera == false)
dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
else if (isIE == true && isIE9More) {//ie9+
var heightDeviation = bHeight - eval("window.IE9MoreRealHeight" + iframeId);
if (heightDeviation == 0) {
bHeight += 3;
} else if (heightDeviation != 3) {
eval("window.IE9MoreRealHeight" + iframeId + "=" + bHeight);
bHeight += 3;
}
}
else//ie[6-8]、OPERA
bHeight += 3;
var height = Math.max(bHeight, dHeight);
if (height < minHeight) height = minHeight;
iframe.style.height = height + "px";
} catch (ex) { }
}
function startInit(iframeId, minHeight) {
eval("window.IE9MoreRealHeight" + iframeId + "=0");
window.setInterval("reinitIframe('" + iframeId + "'," + minHeight + ")", 100);
}