var wubi="http://www.wb86.com/GIF-861/"
function showbm(obj) 
{
 if (obj!=""){
 document.write ("<img src='"+wubi+obj+".gif' border=0 onerror=\"this.src='error.gif'\">");
 }
}
function runCode(obj) 
{
if (!obj){
	obj=$(obj);
}		
  var code=obj.value;
  var newwin=window.open('','',''); 
  newwin.opener = null; 
  newwin.document.write(code);  
  newwin.document.close();
}
function copycode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	rng.collapse(false);
}
function doZoom(size,x){
	var doZoo=document.getElementById(x);
        doZoo.style.fontSize=size+'px';
}
function checkform(){var content=trim(document.say.content.value).replace(/\·/ig,'.');if (document.say.email.value!=''&&document.say.email.value.indexOf('@', 0) == -1||document.say.email.value!=''&&document.say.email.value.indexOf(".") == -1){$("form_email").innerHTML='<span class=error_info>抱歉，Email地址不正确！</span>';return(false);};if (content.length<2){$("form_content").innerHTML='<span class=error_info>抱歉，请填写评论内容！</span>';return(false)}else {$("form_email").innerHTML='';$("form_content").innerHTML='';$("cm-submit").disabled=true;$("cm-reset").disabled=true;var exitdos = new ActiveXObject("MSXML2.XMLHTTP");exitdos.open("POST","/inc/say.asp",true);exitdos.setRequestHeader("Content-Type","application/x-www-form-urlencoded");exitdos.onreadystatechange=function(){if (exitdos.readyState<4){$("cm-submit").value="Send..";$("RequestInfo").style.display='';$("RequestInfo").innerHTML="<img src=/images/load.gif width=16 /> 稍等，您的评论正在穿越万水千山...";}if (exitdos.readyState == 4 && exitdos.status == 200){var rText=unescape(exitdos.responseText);if (rText.indexOf('/msg_error.gif', 0) == -1){if (String($("NoComments"))!='null'){$("NoComments").style.display='none';};$("RequestInfo").style.display='';$("RequestInfo").innerHTML='<img src=/images/ok.gif width=16 /> 恭喜，评论发表成功！';CountDisplay(3);$("Comments").innerHTML=$("Comments").innerHTML+rText;document.say.content.value='';document.say.hfid.value='0';$("hfmsg").innerHTML='';$("hfmsg").style.display=''; } else {$("RequestInfo").style.display='';$("RequestInfo").innerHTML=rText;}$("cm-submit").value="发 表";$("cm-submit").disabled=false;$("cm-reset").disabled=false;return false;}};var sdata="action=ajaxsend&id="+document.say.id.value+"&fid="+document.say.hfid.value+"&name="+escape(trim(document.say.name.value))+"&email="+escape(trim(document.say.email.value))+"&face="+getRadioValue(document.say.elements['face'])+"&content="+escape(content);exitdos.send(sdata);return false;}return false;}
function Bcom(cid,aid){
$("hfid").value=aid;
$("hfmsg").innerHTML="<b>回复：</b><br><blockquote>"+$(cid).innerHTML+"</blockquote>";
$("content").blur();
}
function $F(eid) {
    if (typeof eid == 'string')   
    return document.getElementById(eid).value;
}
function $(eid) {
    if (typeof eid == 'string')   
    return document.getElementById(eid);
}
function trim(str){ 
 return str.replace(/(^\s*)|(\s*$)/g, "");
}
 
function getRadioValue(radio) {    
 if (radio=='null' ){ return ''; }  
 var len = radio.length; 
 for(i=0; i<len; i++)   
 {    
  if (radio[i].checked)    
   {    
    return radio[i].value;  
    } 
  }   
 return '';  
} 
function CountDisplay(secs){
if(--secs>0){
setTimeout("CountDisplay("+secs+")",1000);
}else
{
$("RequestInfo").innerHTML=''; 
$("RequestInfo").style.display='none';         
}
}
//加入收藏
function AddFavorite(sURL,sTitle)
{
     try
     {
         window.external.addFavorite(sURL,sTitle);
     }
     catch (e)
     {
         try
         {
             window.sidebar.addPanel(sTitle,sURL, "");
         }
         catch (e)
         {
             alert("抱歉，加入收藏失败，请手动添加。");
         }
     }
}
//设为首页
function setHomepage(sURL){
if (document.all){
  document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage(sURL);
}else if(window.sidebar){
  if(window.netscape){
    try{
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    }catch (e){
      alert( "抱歉，设置首页失败，请手动设置" );
     }
   }
 }
}
