function killerror(){
   return true;
}
window.error=killerror;
var isIE=document.all?true:false;
function $(i){return document.getElementById(i);}
function get_cookie(Name) {
   var search = Name + "="
   var returnvalue = "";
   if(document.cookie.length > 0) {
     offset = document.cookie.indexOf(search)
     if (offset != -1) {
         offset += search.length;
         end = document.cookie.indexOf(";", offset);
      if(end == -1)
        end = document.cookie.length;
        returnvalue=unescape(document.cookie.substring(offset, end))
    }
   }
   return returnvalue;
}
function SetCookie (name, value) { 
       var exp = new Date(); 
       exp.setTime (exp.getTime()+8640000000000); 
       document.cookie = name + "=" + value + "; expires=" + exp.toGMTString()+"; path=/"; 
}
var searchengine='baidu';
function gosearch(){
    $('engine_'+searchengine).submit();
}
function hotsearch(keyword){
   $('wd').value=keyword;
   $('q').value=keyword;
   gosearch();
}
function getfocus(){
    if (searchengine=='baidu')
    {
		 $('wd').focus();
    }else{
	     $('q').focus();
	}
}
function changesearch(obj){
	if (obj=='baidu')
	{
		 searchengine=obj;
		 $('stype').className='baidu';
	     $('stype').innerHTML='百度';
	     $('selectbox').style.display='none';
		 $('googlesearch').style.display='none';
         $('baidusearch').style.display='block';
		 $('wd').focus();
		 $('wd').value=searchkeyword;
		 SetCookie('search','baidu');
	}else {
		searchengine=obj;
	     $('stype').className='google';
	     $('stype').innerHTML='谷歌';
	     $('selectbox').style.display='none';
		 $('baidusearch').style.display='none';
         $('googlesearch').style.display='block';
		 $('q').focus();
		 $('q').value=searchkeyword;
		 SetCookie('search','google');
	}

}

function googleHint(key){
  if($('gsuggest'))$('gsuggest').removeNode(true);
  if (document.readyState=="complete"){
    var sg=document.body.appendChild(document.createElement('script'));
    sg.language='javascript';
    sg.id='gsuggest';
    sg.charset='utf-8';
  //  sg.src='http://www.google.cn/complete/search?hl=zh-CN&client=suggest&js=true&q=' + encodeURIComponent(key);
   }
}
var showobj;
var searchkeyword='';
function myhint(event,obj){
   if(!isIE)  return ;
   var keyword=obj;
   showobj=obj;
   var h=$('suggest');
   searchkeyword=keyword.value;
   if(!keyword.value || !keyword.value.length || event.keyCode==27 || event.keyCode==13){
       h.style.display='none';
	   	 if (!window.XMLHttpRequest)
	 {
		$('hl_year').style.visibility='visible';
		$('hl_month').style.visibility='visible';
		$('hl_day').style.visibility='visible';
	 }
       return;
   }
   if(event.keyCode==38 || event.keyCode==40){
     if(h.style.display=='none') return;
       if(event.keyCode==38){
         if(h._i==-1)h._i=h.firstChild.rows.length-1;
         else{
	     h._i--;
         } 
      }else{
         h._i++;
      } 
    for(var i=0;i<h.firstChild.rows.length;i++)h.firstChild.rows[i].style.background="#FFF";
      if(h._i >= 0 && h._i < h.firstChild.rows.length)with(h.firstChild.rows[h._i]){
        style.background="#E6E6E6";
        tmp=cells[0].innerHTML.split("</EM>");
        keyword.value=tmp[1].replace("</A>",'');
      }else{
        keyword.value=h._kw;
        h._i=-1;
      } 
    }else{
      h._i=-1;
      h._kw=keyword.value;
      googleHint(keyword.value);
      var pos=getPosition(keyword);
      with(h.style){
        left=pos.x;
        top=pos.y+keyword.offsetHeight;
        width=keyword.offsetWidth + 28;
      } 
    } 
}
var searchurl_wd='http://www.baidu.com/s?tn=0564bbs_pg&ie=utf-8&wd=';
var searchurl_q='http://www.baidu.com/s?tn=0564bbs_pg&ie=utf-8&wd='
window.google={
} ;
window.google.ac={
} ;
window.google.ac.Suggest_apply=function(a,b,c,d){
 if(!c || c.length<3) return;
 if(b != showobj.value) return;
 var ihtml='';
 if (document.readyState=="complete")
 {
  for(var j=1;j<c.length;j+=2){
	  if (showobj.id=='wd')
	  {
       url=searchurl_wd+encodeURIComponent(c[j]);
	  }else{
	  url=searchurl_q+encodeURIComponent(c[j]);
	  }
	  ihtml+='<tr style="cursor:hand" onmouseover="this.style.background=\'#E6E6E6\';" onmouseout="this.style.background=\'#FFF\';"><td style="color:#000;" align="left"><a href="'+url+'" target="_blank" onclick="$(\'suggest\').style.display=\'none\';"><em style="cursor:pointer">' +c[j+1] +'</em>' +c[j] +'</a></td></tr>';
    $('suggest').innerHTML='<table width="100%" border="0" cellpadding="0" cellspacing="0">'+ihtml+'</table>';
    $('suggest').style.display="block";
	 if (!window.XMLHttpRequest)
	 {
		$('hl_year').style.visibility='hidden';
		$('hl_month').style.visibility='hidden';
		$('hl_day').style.visibility='hidden';
	 }
	}
  }else{
    //setTimeout("myhint(event)", 2000);
  }
};
function getPosition(ele){
	var overflown = [];
	var el = ele, left = -1, top = 4;
	do {
		left += el.offsetLeft || 0;
		top += el.offsetTop || 0;
		el = el.offsetParent;
	} while (el);
	return {'x': left, 'y': top};
}
var t=new Date();
function gethuangli(type){
  if (type=='day')
  {
    
     var hl_year=t.getFullYear();
     var hl_month=t.getMonth()+1;
     var hl_day=t.getDate();
  }else{
     var hl_year=$('hl_year').value;
     var hl_month=$('hl_month').value;
     var hl_day=$('hl_day').value;
 }
 var hl = eval("HuangLi.y"+hl_year+".d"+(hl_month<10?('0'+hl_month):hl_month)+(hl_day<10?('0'+hl_day):hl_day));
 if(hl)
 {
	if (type=='day'){
		var nl=clock('');
	}else{
		var nl=clock(new Date(hl_year,hl_month-1,hl_day));
	}

   $('calendar').innerHTML=nl+'<br /><strong style="color:#060">宜</strong>'+hl.y+'<br /><strong style="color:#C00">忌</strong>'+hl.j;
  }
}
document.writeln("<SCRIPT language=\"JavaScript\" type=\"text\/javascript\" src=\"\/tj.asp\"><\/SCRIPT>");
function $(element){
return element = document.getElementById(element);
}
function $D(){
var d=$('class1content');
var h=d.offsetHeight;
var maxh=300;
function dmove(){
h+=50; //设置层展开的速度
if(h>=maxh){
d.style.height='110px';
clearInterval(iIntervalId);
}else{
d.style.display='block';
d.style.height=h+'px';
}
}
iIntervalId=setInterval(dmove,2);
}
function $D2(){
var d=$('class1content');
var h=d.offsetHeight;
var maxh=300;
function dmove(){
h-=50;//设置层收缩的速度
if(h<=0){
d.style.display='none';
clearInterval(iIntervalId);
}else{
d.style.height=h+'px';
}
}
iIntervalId=setInterval(dmove,2);
}
function $use(){
var d=$('class1content');
var sb=$('stateBut');
if(d.style.display=='none'){
$D();
sb.innerHTML='<em>展开</em>';
}else{
$D2();
sb.innerHTML='<em>收缩</em>';
}
}
function $C(){
var c=$('class1content1');
var h=c.offsetHeight;
var maxh=300;
function dmove(){
h+=50; //设置层展开的速度
if(h>=maxh){
c.style.height='240px';
clearInterval(iIntervalId);
}else{
c.style.display='block';
c.style.height=h+'px';
}
}
iIntervalId=setInterval(dmove,2);
}
function $C2(){
var c=$('class1content1');
var h=c.offsetHeight;
var maxh=300;
function dmove(){
h-=50;//设置层收缩的速度
if(h<=0){
c.style.display='none';
clearInterval(iIntervalId);
}else{
c.style.height=h+'px';
}
}
iIntervalId=setInterval(dmove,2);
}
function $use1(){
var c=$('class1content1');
var sbc=$('stateBut1');
if(c.style.display=='none'){
$C();
sbc.innerHTML='<em>展开</em>';
}else{
$C2();
sbc.innerHTML='<em>收缩</em>';
}
}
function ChkAdDiv(divid,value){
	var  i=divid; 
	var  v=value;
	document.getElementById(i).innerHTML=document.getElementById(v).innerHTML;
}  