//window.onload = function(){document.getElementById("f1").focus();}//焦点在哪儿？
//收藏
function bookmarkit(){
	try{
	if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
		{ 
		window.sidebar.addPanel('中国有色网','http://www.cnmn.com.cn','中国有色网'); 
		} 
	else
		{ 
		window.external.AddFavorite('http://www.cnmn.com.cn','中国有色网'); 
		} 
	}catch(e){}
	return false;
}

//切换标签
function tabit(btn){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btn.parentNode.childNodes.length;
	for(i=0;i<tabNumber;i++){
			document.getElementById(tabName+"_div_"+i).style.display = "none";
			document.getElementById(tabName+"_btn_"+i).className = "";
		};
		document.getElementById(tabName+"_div_"+id).style.display = "block";
		btn.className = "curr";
};
//日期
function showDate()
{
var d = new Date();  
document.write("<div class=\"date_div\">"+d.getFullYear()+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日");
switch(d.getDay())
{
 case 0:
  document.write("  <font color=#FF0000>星期日");
  break;
 case 1:
  document.write("  <font color=#000000>星期一");
  break;
 case 2:
  document.write("  <font color=#000000>星期二");
  break;
 case 3:
  document.write("  <font color=#000000>星期三");
  break;
 case 4:
  document.write("  <font color=#000000>星期四");
  break;
 case 5:
  document.write("  <font color=#000000>星期五");
  break;
 case 6:
  document.write("  <font color=#FF0000>星期六");
  break;
}
 document.write("</font></div>");
}

//搜索
function search()
{
var st = document.getElementById('searchtext').value;
var url = "search/search.aspx?q=" + escape(st);
window.open(url, "_blank");
}

//搜索处快速连接
function searchClick()
{
	var url = "http://www.cnmn.com.cn/Search/col/searchcol.aspx";
	window.open(url,"_blank");
}

function  EnterRedirect(obj)
{
    if(event.keyCode==13)
        obj.click();
}
