function gb_now(){
	var now = new Date();
	var day = ['日','一','二','三','四','五','六'];
	var week = '星期' + day[now.getDay()];
	document.write(now.getFullYear() + '年' + (now.getMonth() + 1) + '月' + now.getDate() + '日&nbsp;&nbsp;' + week);
}

function show_dv2(id){
	var menu = ['me2_1','me2_2','me2_3','me2_4'];
	var arra = ['dv2_1','dv2_2','dv2_3','dv2_4'];
	for(var i = 0; i < arra.length; i++){
	 	document.getElementById(arra[i]).style.display = 'none';
		document.getElementById(menu[i]).className = 'unslt';
	 }
	document.getElementById('dv2_' + id).style.display = '';
	document.getElementById('me2_' + id).className = 'slt';
	if (id==1)
		document.getElementById('link2').href = 'onelist_b308.htm';
	else if (id==2)
		document.getElementById('link2').href = 'onelist_b307.htm';
	else if (id==3)
		document.getElementById('link2').href = 'onelist_b306.htm';
	else 
		document.getElementById('link2').href = 'onelist_b305.htm';
}
function show_dv3(id){
	var menu = ['me3_1','me3_2','me3_3','me3_4'];
	var arra = ['dv3_1','dv3_2','dv3_3','dv3_4'];
	for(var i = 0; i < arra.length; i++){
	 	document.getElementById(arra[i]).style.display = 'none';
		document.getElementById(menu[i]).className = 'unslt';
	 }
	document.getElementById('dv3_' + id).style.display = '';
	document.getElementById('me3_' + id).className = 'slt';
	if (id==1)
		document.getElementById('link3').href = 'onelist_b316.htm';
	else if (id==2)
		document.getElementById('link3').href = 'onelist_b315.htm';
	else if (id==3)
		document.getElementById('link3').href = 'onelist_b314.htm';
	else 
		document.getElementById('link3').href = 'onelist_b313.htm';
}

function checkDiscuss(theForm) {
	if(theForm.content.value==""){
        alert("请输入评论内容。");
        theForm.content.focus();
        return false;
    }
}

function checkSearch(theForm) {
	if(theForm.searchcontent.value==""){
        alert("请输入查询关键字。");
        theForm.searchcontent.focus();
        return false;
    }
}

function onlyStr(sub,str) {
	var newStr = delPic(str);
	subStr(sub,newStr);
}

function subStr(sub,str) {
    var len = str.length
    if (len>sub) {
        var str1 = str
        var str2 = ""
        var i = 0
        var n = 0
        while ( (str2.length<sub) && (sub<8) ) {
            i++
            var aa = str1.substring(0,1)
            if ( isW(aa) ) {
                if (n % 2 == 0) 
                    sub++
                n++
            }
            str1 = str1.substring(1)
            str2 = str2 + aa
        }
        if (len>sub) {
            document.write(str.substring(0,(sub-2))+"...")
        }
        else {
            document.write(str)
        }
    }
    else {
        document.write(str)
    }
}

function delPic(con) {
	var tmp = "";
	var back = "";
	if (con.indexOf("<img")!=-1) {
		tmp = con.substring(0,con.indexOf("<img"));
		back = con.substring(con.indexOf("<img"));
		back = back.substring(back.indexOf(">")+1);
	}
	else {
		tmp = con;
	}
	if (tmp.length<50 && back.length>0)	{
		tmp = tmp+delPic(back);
	}
	//alert(tmp)
	return tmp;
}

function AllNumber(str) {
   text="1234567890";
   if(str=="")return false;
   for(i=0;i<str.length;i++) {
      char1=str.charAt(i);
      index=text.indexOf(char1);
      if(index==-1)  {
       	return false;
      }
   }
   return true;
}

function goURI(str) {
	if (str.indexOf("<a")>-1) {
		var tmp = str.substring(str.indexOf(">"));
		str=tmp.substring(0,tmp.indexOf("</a>"));
		str = "http://"+str;
	}
	else if (str.indexOf("http://")==-1) {
		str = "http://"+str;
	}
	location=str;
}
