/********************************************************************	
  function:
  parameter: hot_query_list 数据数组
		row       一行显示多少个
		caption 显示在表格顶端的字符串
  return:     无
  author:     hqbvqv
  created:
  ver:        1.0
  purpose:  显示列表界面
*********************************************************************/
var ListFlag=1;
var g_changecolor=1;
var g_dlg_cnt=0;

/************************************************************************/
/*列表背景颜色                                                        */
/************************************************************************/
var background_colorarray=[    //colorarray后面不加[],否则会出错
	'#FFF7DE',   //黄色
	'#EDF5FE',   //蓝色
	'#EFFDFE',   //绿色
];

/************************************************************************/
/*TITLE背景颜色                                                        */
/************************************************************************/
var title_colorarray=[    //colorarray后面不加[],否则会出错
	'#FAD4A4',   //黄色
	'#C7DFFD',   //蓝色
	'#9CEFD5',   //绿色
];

/************************************************************************/
/*表格线框颜色                                                        */
/************************************************************************/
var line_colorarray=[    //colorarray后面不加[],否则会出错
	'yellowdiv',   //黄色
	'bluediv',     //蓝色
	'greendiv'	   //绿色
];

/************************************************************************/
/*背景图片div                                                        */
/************************************************************************/
var pic_divarray=[    //colorarray后面不加[],否则会出错
	'yellowdiv_pic',   //黄色
	'bluediv_pic',     //蓝色
	'greendiv_pic'     //绿色
];
//function ShowList(hot_query_list,row,caption)
function showlist(hot_query_list,arrayname,row,userid,lineid)
{
  var num=hot_query_list.length-1;
  var strTemp;
  var i,j;
  var List_content='<div class='+line_colorarray[g_changecolor]+'><table  cellpadding="0"  cellspacing="0" width="100%"><tr>';
  var pos,pos1,nTemp;	
  var line;
  var PicStr="";
  var strurl;
  var strtitle;
  var strname;
  var strlistnum;
  
  if(lineid==10000)
  {
  	strlistnum="[45]";
  }
  else if(lineid==9999)
  {  	
  	strlistnum="["+recent_addlist_num_arr[0]+"]";
  }
  else
  {
  	strlistnum="["+url_list_num_arr[lineid]+"]";
  }
  strTemp=hot_query_list[0].split(",");
  //List_content+='<td bgcolor="#e5eaed" height=25 colspan='+row+'><IMG width="18" height="18" src='+PicStr+' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><font size=2>'+caption+'</font</b></td></tr>';
  List_content+='<td align=left bgcolor="'+title_colorarray[g_changecolor]+'"><div class='+pic_divarray[g_changecolor]+'><b><font size=2>'+
				'<a name=bookmark'+lineid+' target=_blank></a>'+
				'<a href=index.htm?id='+userid+strTemp[2]+' target=_blank>'+strTemp[0]+strlistnum+'</a></font></b><div></td><td bgcolor="'+title_colorarray[g_changecolor]+'" height=25 colspan='+(row-1)+'>'+
				'<a href="#top"><font color=#808080><b>返回顶端</b></font></a>'+  //strlistnum+
				'</td></tr>';
  if(num%row!=0)
  {
  	line=parseInt(num/row+1);
  }
  else
  {
  	line=parseInt(num/row);
  }
  //alert(line);
  for(i=0;i<line;i++)
  {
		List_content+='<tr>';
		for(j=0; j<row;j++)
		{	
			nTemp=i*row+j+1;
			if(nTemp>num)
			{
				break;
			}
 			if(nTemp!=0)
			{
	        	strTemp=hot_query_list[nTemp].split(",");
				arraynamestr=arrayname+j;
				if(strTemp[4]=="10000")
				{
					//alert(userid);
					strurl='index.htm?id='+userid+strTemp[2];
					strtitle=strTemp[1]+'目录';
					strname='['+strTemp[0]+']';
				}
				else
				{
					strurl=strTemp[2];
					strtitle=strTemp[1]+'\n\n'+strTemp[2];
					strname=strTemp[0];
				}
        		List_content+='<td bgcolor="'+background_colorarray[g_changecolor]+'" width=150  height=23 nowrap="nowrap" align="left" >&nbsp;·&nbsp;<a href="'+
				    strurl+'" target=_blank title="'+strtitle+'"><font color="'+strTemp[3]+'">'+
					strname+'</font></a></td>';	
			}
		}	
		for(; j<row;j++)
		{	
			List_content+='<td bgcolor="'+background_colorarray[g_changecolor]+'"width=150 nowrap="nowrap" align="middle">&nbsp;&nbsp</td>';	
		}			
		List_content+='</tr>';	
  }
  List_content+='</table></div>';
  //alert(List_content);
  document.write(List_content);
}

/********************************************************************
*函 数 名： encodeURIComponentNew
*参    数： 无
*返 回 值:  无
*作    者：	hqbvqv
*日    期：2008年12月27日14时30分47秒
*版    本:  1.0
*功    能：	转换GB2312为UTF-8
*********************************************************************/
function utf8(wide) {
var c, s;
var enc = "";
var i = 0;
while(i<wide.length) {
c= wide.charCodeAt(i++);
// handle UTF-16 surrogates
if (c>=0xDC00 && c<0xE000) continue;
if (c>=0xD800 && c<0xDC00) {
if (i>=wide.length) continue;
s= wide.charCodeAt(i++);
if (s<0xDC00 || c>=0xDE00) continue;
c= ((c-0xD800)<<10)+(s-0xDC00)+0x10000;
}
// output value
if (c<0x80) enc += String.fromCharCode(c);
else if (c<0x800) enc += String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));
else if (c<0x10000) enc += String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));
else enc += String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F));
}
return enc;
}
var hexchars = "0123456789ABCDEF";
function toHex(n) {
return hexchars.charAt(n>>4)+hexchars.charAt(n & 0xF);
}
var okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
function encodeURIComponentNew(s) {
var s = utf8(s);
var c;
var enc = "";
for (var i= 0; i<s.length; i++) {
if (okURIchars.indexOf(s.charAt(i))==-1)
enc += "%"+toHex(s.charCodeAt(i));
else
enc += s.charAt(i);
}
return enc;
}

/********************************************************************
*函 数 名： show_tag_list
*参    数： 无
*返 回 值:  无
*作    者：	hqbvqv
*日    期：2008年12月22日17时41分11秒
*版    本:  1.0
*功    能：	显示便签列表,每个目录的书签名
*********************************************************************/

function show_tag_list(hot_query_list,arrayname,row,userid)
{
  var num=hot_query_list.length;
  var strTemp;
  var i,j;
  var List_content='<div class='+line_colorarray[g_changecolor]+'><table  cellpadding="0"  cellspacing="0" width="100%"><tr>';
  var pos,pos1,nTemp;	
  var line;
  var PicStr="";
  var strurl;
  var strtitle;
  var strname;
  //strTemp=hot_query_list[0].split(",");
  //List_content+='<td bgcolor="#e5eaed" height=25 colspan='+row+'><IMG width="18" height="18" src='+PicStr+' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><font size=2>'+caption+'</font</b></td></tr>';
  List_content+='<td bgcolor="'+title_colorarray[g_changecolor]+'"><div class='+pic_divarray[g_changecolor]+'><b><font size=2>'+
				'<a name=\"top\">'+arrayname+'</a></font></b><div></td><td bgcolor="'+title_colorarray[g_changecolor]+'" height=25 colspan='+(row-1)+'>'+
				'<font color=white><b>(点击标签跳转到相应的目录)</b></font>'+				
				'</td></tr>';
  if(num%row!=0)
  {
  	line=parseInt(num/row+1);
  }
  else
  {
  	line=parseInt(num/row);
  }
  //alert(line);
  for(i=0;i<line;i++)
  {
		List_content+='<tr>';
		for(j=0; j<row;j++)
		{	
			nTemp=i*row+j;
			if(nTemp>=num)
			{
				break;
			}

	        	strTemp=hot_query_list[nTemp][0].split(",");
				arraynamestr=arrayname+j;

				strurl='#bookmark'+nTemp;
				strtitle=strTemp[1]+'目录';
				strname='['+strTemp[0]+']';

        		List_content+='<td bgcolor="'+background_colorarray[g_changecolor]+'" width=150  height=23 nowrap="nowrap" align="left" >&nbsp;·&nbsp;<a href="'+
				    strurl+'"title="'+strtitle+'"><font color="'+strTemp[3]+'">'+
					strname+'</font></a></td>';	
		}	
		for(; j<row;j++)
		{	
			List_content+='<td bgcolor="'+background_colorarray[g_changecolor]+'"width=150 nowrap="nowrap" align="middle">&nbsp;&nbsp</td>';	
		}			
		List_content+='</tr>';	
  }
  List_content+='</table></div>';
  //alert(List_content);
  document.write(List_content);
}


var si139CurrHighLight = document.getElementById("si139web");
var si139bntsel=0;
var si139contentsel=0;
var si139dlgmsg="si139_com_diy_your_site";

var GOOGLE_URL_ARR=
[
	"http://www.google.cn/search?hl=zh-CN&q=", //全搜索
	"http://www.google.cn/music/search?aq=f&hl=zh-CN&q=", //MP3
	"http://images.google.cn/images?hl=zh-CN&btnG=%E6%90%9C%E7%B4%A2%E5%9B%BE%E7%89%87&gbv=2&aq=f&oq=&q=", //图片搜索
	"http://video.google.cn/videosearch?q=", //视频
	"http://ditu.google.cn/maps?sa=N&tab=nl&q=", //地图
	"http://blogsearch.google.cn/blogsearch?sa=N&tab=vb&q=", //博客	
	"http://news.google.cn/news?hl=zh-CN&q=", //资讯
	"http://www.google.cn/search?sourceid=navclient&hl=zh-CN&rlz=1T4GGLS_zh-CNCN274CN274&q=site:3e%2donline%2ecom+",//bt	
];

var BAIDU_URL_ARR=
[
	"http://www.baidu.com/s?wd=", //全搜索
	"http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&lm=-1&&word=", //MP3
	"http://image.baidu.com/i?tn=baiduimage&ct=201326592&lm=-1&cl=2&t=12&word=", //图片搜索
	"http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=7&word=", //视频
	"http://map.baidu.com/#ct=10&word=", //地图
	"http://blogsearch.baidu.com/s?tn=baidublog&bsm=0&ct=2097152&cl=3&wd=", //博客	
	"http://news.baidu.com/ns?tn=news&from=news&cl=2&rn=20&ct=1&word=", //资讯
	"http://www.baidu.com/s?wd=site%3A%28cnxp.com%29+",//bt	
];
var YAHOO_URL_ARR=
[
	"http://one.cn.yahoo.com/s?v=web&ei=gbk&searchFlag=&fr=fp-tab-web-ycn&pid=ysearch&source=yahoo_yhp_0706_search_button&p=", //全搜索
	"http://one.cn.yahoo.com/s?v=music&pid=hp&p=%E8%AF%95%E8%AF%95", //MP3
	"http://one.cn.yahoo.com/s?v=image&pid=hp&p=", //图片搜索
	"NULL", //视频
	"http://ditu.google.cn/maps?sa=N&tab=nl&q=", //地图
	"http://blogsearch.google.cn/blogsearch?sa=N&tab=vb&q=", //博客	
	"http://news.google.cn/news?hl=zh-CN&gbv=2&tab=ln&ned=ccn&q=", //资讯
	"NULL",//bt	
];

var DUO_URL_ARR=
[
	"http://www.baigoohoo.com/search.asp?catalog=web&word=", //全搜索
	"http://www.baigoohoo.com/search.asp?catalog=music&word=", //MP3
	"http://www.baigoohoo.com/search.asp?catalog=photo&word=", //图片搜索
	"http://www.baigoohoo.com/search.asp?catalog=video&word=", //视频
	"http://www.baigoohoo.com/search.asp?catalog=map&word=", //地图
	"http://www.baigoohoo.com/search.asp?catalog=blog&word=", //博客	
	"http://www.baigoohoo.com/search.asp?catalog=news&word=", //资讯
	"NULL",//bt
];

var BTCHINA_URL_ARR=
[
	"NULL", //全搜索
	"NULL", //MP3
	"NULL", //图片搜索
	"NULL", //视频
	"NULL", //地图
	"NULL", //博客	
	"NULL", //资讯
	"http://search3.btchina.net/btsearch.php?type=0&query=", //bt
];

var DIDAI_URL_ARR=
[
	"NULL", //全搜索
	"NULL", //MP3
	"NULL", //图片搜索
	"NULL", //视频
	"NULL", //地图
	"NULL", //博客	
	"NULL", //资讯
	"http://m.didai.com/search/?q=", //bt
];

var TUDOU_URL_ARR=
[
	"NULL", //全搜索
	"NULL", //MP3
	"NULL", //图片搜索
	"http://so.tudou.com/isearch/", //视频
	"NULL", //地图
	"NULL", //博客	
	"NULL", //资讯
	"NULL", //bt
];

var YOUKU_URL_ARR=
[
	"NULL", //全搜索
	"NULL", //MP3
	"NULL", //图片搜索
	"http://so.youku.com/search_video/q_", //视频
	"NULL", //地图
	"NULL", //博客	
	"NULL", //资讯
	"NULL", //bt
];

var ROOM6_URL_ARR=
[
	"NULL", //全搜索
	"NULL", //MP3
	"NULL", //图片搜索
	"http://6.cn/search.php?t=v&ko=1&k=", //视频
	"NULL", //地图
	"NULL", //博客	
	"NULL", //资讯
	"NULL", //bt
];
var TOTAL_ARR=
[
	GOOGLE_URL_ARR,
	BAIDU_URL_ARR,
	YAHOO_URL_ARR,
	DUO_URL_ARR,
	BTCHINA_URL_ARR,
	DIDAI_URL_ARR,
	YOUKU_URL_ARR,
	TUDOU_URL_ARR,
	ROOM6_URL_ARR
];


var searchbntvalue="搜索网站:si139.com";
function si139_bnt_init(sel)
{
	var i=0;
	si139contentsel=sel;
	var bnt_arr=
	[
		form1.google_bnt,
		form1.baidu_bnt,
		form1.yahoo_bnt,
		form1.duo_bnt,
		form1.btchina_bnt,
		form1.didai_bnt,
	    form1.youku_bnt,
		form1.tudou_bnt,
		form1.room6_bnt		
	];	
	
	for(i=0; i<bnt_arr.length; i++)
	{
		if(TOTAL_ARR[i][sel]=="NULL")
		{
			bnt_arr[i].style.visibility="hidden";
			bnt_arr[i].style.width=0;
			bnt_arr[i].style.height=0;
		}
		else
		{
			bnt_arr[i].style.visibility="visible";	
			bnt_arr[i].style.width=60;
			bnt_arr[i].style.height=24;
		}
		
	}
	form1.searchsite.value=searchbntvalue;
}

function si139SubSearch(sc,sel)
{
	var i=0;
	si139_bnt_init(sel);
	changePage(sc);
}

function changePage(sc)
{
	if(si139CurrHighLight == null)
	{
		si139CurrHighLight = document.getElementById("si139web");
	}
	si139CurrHighLight.className = "searchfod2";
	si139CurrHighLight = document.getElementById("si139"+sc);
	si139CurrHighLight.className = "searchfod1";
}


 
function searchpublic(searchsel,sel,value)
{
	var urlstr;
	var titlestr=si139dlgmsg+g_dlg_cnt;

	if(searchsel==0 || searchsel==5 || searchsel==8)
	{
		urlstr=TOTAL_ARR[searchsel][sel]+encodeURIComponentNew(value);
	}
	else
	{
		urlstr=TOTAL_ARR[searchsel][sel]+value;
	}
	if(form1.searchsite.value!="" &&　form1.searchsite.value!=searchbntvalue && sel==0)
	{
		if(searchsel==0)
		{
			urlstr+=" site:"+form1.searchsite.value;
		}
		else if(searchsel==1)
		{
			urlstr+=" site:("+form1.searchsite.value+")";
		}
	}
	window.open(urlstr,titlestr);
	g_dlg_cnt++;
	return true;
}

function si139_bnt_submit(bntnum)
{
	si139bntsel=bntnum;
	var value=form1.key.value;
	searchpublic(si139bntsel,si139contentsel,value);
	//form1.submit();  //加了就会出现窗口重叠的问题.
}

function show_leftlist(hot_query_list,title_str,more_str)
{

  var num=hot_query_list.length;   //注意数组最后面不能有逗号,否则算一个
	//alert(num);
  var i,j=0;
  var List_content='<div class=\"BS1\"><div class=\"titBar\"><h3>'+title_str+'</h3><em><a href='+more_str+' target=\"_blank\">更多&gt;&gt;</a></em></div><div class=\"txtBox listX2\">';
//alert(List_content);
  var strarr=
  [
  	'<ul class=\"bg0\">',
  	'<ul class=\"bg1\">'
  ];
  for(i=0;i<num;i++)
  {
  	//alert(strarr[j]);
		List_content+=strarr[j];
		//alert(hot_query_list[i][0]);
		List_content+='<li><a href='+hot_query_list[i][1]+' target=\"_blank\">'+hot_query_list[i][0]+'</a></li>';
		i++;
		if(i>=num)
		{
			List_content+='<li>&nbsp;</li></ul>';
			break;
		}
		//alert(hot_query_list[i][0]);
		List_content+='<li><a href='+hot_query_list[i][1]+' target=\"_blank\">'+hot_query_list[i][0]+'</a></li></ul>';
		if(j==0) 
		{
			j=1;
		}
		else
		{
			j=0;
		}
  }
  List_content+='</div></div>';
  //alert(List_content);
  document.write(List_content);
}



function DaysNumberofDate(DateGL) {
    return parseInt((Date.parse(DateGL) - Date.parse(DateGL.getYear() + "/1/1")) / 86400000) + 1;
}

function CnDateofDate(DateGL) {
    var CnData = new Array(0x16, 0x2a, 0xda, 0x00, 0x83, 0x49, 0xb6, 0x05, 0x0e, 0x64, 0xbb, 0x00, 0x19, 0xb2, 0x5b, 0x00, 0x87, 0x6a, 0x57, 0x04, 0x12, 0x75, 0x2b, 0x00, 0x1d, 0xb6, 0x95, 0x00, 0x8a, 0xad, 0x55, 0x02, 0x15, 0x55, 0xaa, 0x00, 0x82, 0x55, 0x6c, 0x07, 0x0d, 0xc9, 0x76, 0x00, 0x17, 0x64, 0xb7, 0x00, 0x86, 0xe4, 0xae, 0x05, 0x11, 0xea, 0x56, 0x00, 0x1b, 0x6d, 0x2a, 0x00, 0x88, 0x5a, 0xaa, 0x04, 0x14, 0xad, 0x55, 0x00, 0x81, 0xaa, 0xd5, 0x09, 0x0b, 0x52, 0xea, 0x00, 0x16, 0xa9, 0x6d, 0x00, 0x84, 0xa9, 0x5d, 0x06, 0x0f, 0xd4, 0xae, 0x00, 0x1a, 0xea, 0x4d, 0x00, 0x87, 0xba, 0x55, 0x04);
    var CnMonth = new Array();
    var CnMonthDays = new Array();
    var CnBeginDay;
    var LeapMonth;
    var Bytes = new Array();
    var I;
    var CnMonthData;
    var DaysCount;
    var CnDaysCount;
    var ResultMonth;
    var ResultDay;
    var yyyy = DateGL.getYear();
    var mm = DateGL.getMonth() + 1;
    var dd = DateGL.getDate();
    if (yyyy < 100) yyyy += 1900;
    if ((yyyy < 1997) || (yyyy > 2020)) {
        return 0;
    }
    Bytes[0] = CnData[(yyyy - 1997) * 4];
    Bytes[1] = CnData[(yyyy - 1997) * 4 + 1];
    Bytes[2] = CnData[(yyyy - 1997) * 4 + 2];
    Bytes[3] = CnData[(yyyy - 1997) * 4 + 3];
    if ((Bytes[0] & 0x80) != 0) {
        CnMonth[0] = 12;
    } else {
        CnMonth[0] = 11;
    }
    CnBeginDay = (Bytes[0] & 0x7f);
    CnMonthData = Bytes[1];
    CnMonthData = CnMonthData << 8;
    CnMonthData = CnMonthData | Bytes[2];
    LeapMonth = Bytes[3];
    for (I = 15; I >= 0; I--) {
        CnMonthDays[15 - I] = 29;
        if (((1 << I) & CnMonthData) != 0) {
            CnMonthDays[15 - I]++;
        }
        if (CnMonth[15 - I] == LeapMonth) {
            CnMonth[15 - I + 1] = -LeapMonth;
        } else {
            if (CnMonth[15 - I] < 0) {
                CnMonth[15 - I + 1] = -CnMonth[15 - I] + 1;
            } else {
                CnMonth[15 - I + 1] = CnMonth[15 - I] + 1;
            }
            if (CnMonth[15 - I + 1] > 12) {
                CnMonth[15 - I + 1] = 1;
            }
        }
    }
    DaysCount = DaysNumberofDate(DateGL) - 1;
    if (DaysCount <= (CnMonthDays[0] - CnBeginDay)) {
        if ((yyyy > 1901) && (CnDateofDate(new Date((yyyy - 1) + "/12/31")) < 0)) {
            ResultMonth = -CnMonth[0];
        } else {
            ResultMonth = CnMonth[0];
        }
        ResultDay = CnBeginDay + DaysCount;
    } else {
        CnDaysCount = CnMonthDays[0] - CnBeginDay;
        I = 1;
        while ((CnDaysCount < DaysCount) && (CnDaysCount + CnMonthDays[I] < DaysCount)) {
            CnDaysCount += CnMonthDays[I];
            I++;
        }
        ResultMonth = CnMonth[I];
        ResultDay = DaysCount - CnDaysCount;
    }
    if (ResultMonth > 0) {
        return ResultMonth * 100 + ResultDay;
    } else {
        return ResultMonth * 100 - ResultDay;
    }
}
function CnYearofDate(DateGL) {
    var YYYY = DateGL.getYear();
    var MM = DateGL.getMonth() + 1;
    var CnMM = parseInt(Math.abs(CnDateofDate(DateGL)) / 100);
    if (YYYY < 100) YYYY += 1900;
    if (CnMM > MM) YYYY--;
    YYYY -= 1864;
    return CnEra(YYYY) + "年";
}
function CnMonthofDate(DateGL) {
    var CnMonthStr = new Array("零", "正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "冬", "腊");
    var Month;
    Month = parseInt(CnDateofDate(DateGL) / 100);
    if (Month < 0) {
        return "闰" + CnMonthStr[ - Month] + "月";
    } else {
        return CnMonthStr[Month] + "月";
    }
}
function CnDayofDate(DateGL) {
    var CnDayStr = new Array("零", "初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十");
    var Day;
    Day = (Math.abs(CnDateofDate(DateGL))) % 100;
    return CnDayStr[Day];
}
function DaysNumberofMonth(DateGL) {
    var MM1 = DateGL.getYear();
    MM1 < 100 ? MM1 += 1900 : MM1;
    var MM2 = MM1;
    MM1 += "/" + (DateGL.getMonth() + 1);
    MM2 += "/" + (DateGL.getMonth() + 2);
    MM1 += "/1";
    MM2 += "/1";
    return parseInt((Date.parse(MM2) - Date.parse(MM1)) / 86400000);
}
function CnEra(YYYY) {
    var Tiangan = new Array("甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"); //var Dizhi=new Array("子(鼠)","丑(牛)","寅(虎)","卯(兔)","辰(龙)","巳(蛇)",
    //"午(马)","未(羊)","申(猴)","酉(鸡)","戌(狗)","亥(猪)");
    var Dizhi = new Array("子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥");
    return Tiangan[YYYY % 10] + Dizhi[YYYY % 12];
}
function CnDateofDateStr(DateGL) {
    if (CnMonthofDate(DateGL) == "零月") return "　请调整您的计算机日期!";
    else return "农历" + CnYearofDate(DateGL) + " " + CnMonthofDate(DateGL) + CnDayofDate(DateGL);
}
function SolarTerm(DateGL) {
    var SolarTermStr = new Array("小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至");
    var DifferenceInMonth = new Array(1272060, 1275495, 1281180, 1289445, 1299225, 1310355, 1321560, 1333035, 1342770, 1350855, 1356420, 1359045, 1358580, 1355055, 1348695, 1340040, 1329630, 1318455, 1306935, 1297380, 1286865, 1277730, 1274550, 1271556);
    var DifferenceInYear = 31556926;
    var BeginTime = new Date(1901 / 1 / 1);
    BeginTime.setTime(947120460000);
    for (; DateGL.getYear() < BeginTime.getYear();) {
        BeginTime.setTime(BeginTime.getTime() - DifferenceInYear * 1000);
    }
    for (; DateGL.getYear() > BeginTime.getYear();) {
        BeginTime.setTime(BeginTime.getTime() + DifferenceInYear * 1000);
    }
    for (var M = 0; DateGL.getMonth() > BeginTime.getMonth(); M++) {
        BeginTime.setTime(BeginTime.getTime() + DifferenceInMonth[M] * 1000);
    }
    if (DateGL.getDate() > BeginTime.getDate()) {
        BeginTime.setTime(BeginTime.getTime() + DifferenceInMonth[M] * 1000);
        M++;
    }
    if (DateGL.getDate() > BeginTime.getDate()) {
        BeginTime.setTime(BeginTime.getTime() + DifferenceInMonth[M] * 1000);
        M == 23 ? M = 0 : M++;
    }
    var JQ;
    if (DateGL.getDate() == BeginTime.getDate()) {
        JQ = "　 今天是<font color='#FF9999'><b>" + SolarTermStr[M] + "</b></font>";
    } else if (DateGL.getDate() == BeginTime.getDate() - 1) {
        JQ = "　 明天是<font color='#FF9999'><b>" + SolarTermStr[M] + "</b></font>";
    } else if (DateGL.getDate() == BeginTime.getDate() - 2) {
        JQ = "　 后天是<font color='#FF9999'><b>" + SolarTermStr[M] + "</b></font>";
    } else {
        JQ = " "
        if (DateGL.getMonth() == BeginTime.getMonth()) {
            JQ += "　 本月";
        } else {
            JQ += "　 下月";
        }
        JQ += BeginTime.getDate() + "日" + "<font color='#FF9999'><b>" + SolarTermStr[M] + "</b></font>";
    }
    return JQ;
}

function RunGLNL()
{
    var today = new Date();
    var d = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
    var DDDD = "<div class=div_center>"+(today.getYear() < 100 ? today.getYear() + 1900 : today.getYear()) + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日";
    DDDD = DDDD + " " + d[today.getDay()]+"</div>";  //2009年1月6日 星期二
    DDDD = DDDD + "<div class=div_center>" + (CnDateofDateStr(today))+"</div>"; //农历 //DDDD = DDDD+ " " + SolarTerm(today);
    document.write(DDDD);
    document.write("<div id=time class=div_center></div>");
}

function CurentTime()
{ 
	var now = new Date(); 
	var hh = now.getHours(); 
	var mm = now.getMinutes(); 
	var ss = now.getTime() % 60000; 
	ss = (ss - (ss % 1000)) / 1000; 
	var clock = hh+':'; 
	if (mm < 10) clock += '0'; 
	clock += mm+':'; 
	if (ss < 10) clock += '0'; 
	clock += ss; 
	return(clock); 
} 

function time_rota()
{
	var dobj = document.getElementById('time');
	dobj.innerHTML =CurentTime();
　　setTimeout( 'time_rota()', 1000)
}
