function getId(elementid) {
	//alert(elementid);
	return document.getElementById(elementid);
}

/*
函数功能，用与选项卡切换,带隐藏DIV功能
name,基本字符串
cursel 当前的序列
n 总个数
onSt 焦点样式
offSt 非焦点样式
*/
function setTabFocus(name,cursel,n,onSt,offSt){
 for(i=1;i<=n;i++){
  var menu=getId(name+i);
  var con=getId("con_"+name+"_"+i);
  menu.className=i==cursel? onSt:offSt;
  con.style.display=i==cursel?"block":"none";
  //self.scrollBy(0,document.body.scrollHeight)
 }
}

/*
函数功能，用与选项卡切换
name,基本字符串
cursel 当前的序列
n 总个数
onSt 焦点样式
offSt 非焦点样式
*/
function setTabFocus1(name,cursel,n,onSt,offSt){
 for(i=1;i<=n;i++){
  var menu=getId(name+i);
  //var con=getId("con_"+name+"_"+i);
  menu.className=i==cursel? onSt:offSt;
  //con.style.display=i==cursel?"block":"none";
  //self.scrollBy(0,document.body.scrollHeight)
 }
}

/*
使用形式
<div id="index_esfQ" style="WIDTH: 200px; HEIGHT: 200px; OVERFLOW: hidden">
<div id="esfqlist1">
滚动内容
</div>
<div id="esfqlist2"></div>
</div>
*/
function mquery(){
	var speed=70//速度数值越大速度越慢
	document.getElementById("esfqlist2").innerHTML=document.getElementById("esfqlist1").innerHTML
	function blogMarquee(){
	if(document.getElementById("esfqlist2").offsetHeight-document.getElementById("index_esfQ").scrollTop<=0)
		document.getElementById("index_esfQ").scrollTop-=document.getElementById("esfqlist1").offsetHeight
	else{
		document.getElementById("index_esfQ").scrollTop++
	}
	}
	var blogMyMar=setInterval(blogMarquee,speed)
	document.getElementById("index_esfQ").onmouseover=function() {clearInterval(blogMyMar)}
	document.getElementById("index_esfQ").onmouseout=function() {blogMyMar=setInterval(blogMarquee,speed)}
}



//不带询问框的关闭
function closeed(){
	window.opener=null;
	window.open('','_self');
	window.close();
}

function back()
{
  //后退一页
  window.history.go(-1);
　window.histrory.back();
}
function qian()
{
　//前进一页
   window.history.forward();
}


//图片滚动
function gundong(){
 var div = document.getElementById("div1");
 var y = parseInt(div.style.top);
 setInterval(function(){
  var cy = parseInt(div.style.top);
  var dy = document.body.scrollTop || document.documentElement.scrollTop;
  div.style.top = (cy + (dy -(cy-y))*0.1) + "px";
 },10);
}

function addfavor(url,title) {
if(confirm("网站名称："+title+"\n网址："+url+"\n确定添加收藏?")){
var ua = navigator.userAgent.toLowerCase();
if(ua.indexOf("msie 8")>-1){
external.AddToFavoritesBar(url,title,'万景新材料');//IE8
}else{
try {
window.external.addFavorite(url, title);
} catch(e) {
try {
window.sidebar.addPanel(title, url, "");//firefox
} catch(e) {
alert("加入收藏成功");
//alert("加入收藏失败，请使用Ctrl+D进行添加");
}
}
}
}
}
//收藏代码
//<a onClick="window.external.addFavorite('http://www.bosui.cn','香港宝瑞国际有限公司');return false;" href="index.asp" target="mainFrame">收藏此页</a>
//设为首页代码
//<a onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.veking.cn');" style="CURSOR: hand">设为首页</a>
