<!--
//去除JS错误提示,整站做好后再用
function killErrors() { 
return true; 
} 
window.onerror = killErrors; 


//插入flash代码
function flash(url,w,h,bg,win,vars){
	var s=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://www.yongtu.net/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='quality' value='high' />"+
	"<param name='FlashVars' value='"+vars+"' />"+    //注意一下: 参数FlashVars ???
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='menu' value='false'>"+
	"<param name='allowfullscreen' value='true'>"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high'  allowfullscreen='true' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(s);
}



//兼容IE6的导航JS代码
stuHover = function() {
	var cssRule;
	var newSelector;
	for (var i=0; i< document.styleSheets.length; i++)
		for (var x=0; x< document.styleSheets[i].rules.length; x++)
			{
			cssRule = document.styleSheets[i].rules[x];
			if (cssRule.selectorText.indexOf("LI:hover") >= 0)
			{
				 newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
				document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
			}
		}
	var getElm = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<getElm.length; i++) {
		getElm[i].onmouseover=function() {
			this.className+=" iehover";
		}
		getElm[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", stuHover);


/*按比例生成缩略图*/
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){  
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){  
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;     
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
  }
} 


//选项卡
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
//本功能非常OK,兼容IE7,FF,IE6;
for(var i=1;i<=2;i++){g('tb_'+i).className='normaltab';g('tbc_0'+i).className='undis';}g('tbc_0'+n).className='dis';g('tb_'+n).className='hovertab';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;


//首页选项卡
function setTab(m,n){
var tli=document.getElementById("menu"+m).getElementsByTagName("li");
var mli=document.getElementById("main"+m).getElementsByTagName("ul");
	for(i=0;i<tli.length;i++){
		tli[i].className=i==n?"hover":"";
		mli[i].style.display=i==n?"block":"none";
	}
}


//判断搜索框是否为空
function search(){
	if( document.Search.Keyword.value==''){alert('请输入关键字！');return false;}
}
function checknull(){
	if(isBlank(document.loginform2.userid.value)||isBlank(document.loginform2.password.value)){
			alert("用户名或密码不能为空!");
			return false;
		}
		document.loginform2.submit();
}



//返回顶部代码
var myID;
var speed = 30;
function s2top(){
    myID = setInterval(s,speed);
}
function s(){
    scrollT = document.documentElement.scrollTop;
    document.documentElement.scrollTop += (0-scrollT)/5 ;
    if(scrollT == 0){
        document.documentElement.scrollTop = 0;
        clearInterval(myID);
    }
}

//底部友情链接代码
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function gotoUrl(sel){
	var u=sel.options[sel.selectedIndex].value;
	if(u!="")
		window.open(u);
}

//电邮分享
function sendtofriend(idx)
{
var surl = "mailto:?body="+unescape("嗨！我在矩网科技形象网站上找到了一些有趣的信息，一起分享吧！")+location.href; 
var awin = window.open ('', '', 'height=0, width=0, top=3000, left=3000, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, statu s=no');
awin.document.write(surl); 
awin.window.navigate(surl); 
awin.close();
}




//分类节点展开和折叠-------------------------------------------------------------------
function EndSortChange(a,b)
{
	if(eval(a).style.display=='')
	{
		eval(a).style.display='none';
		eval(b).className='SortEndFolderOpen';
	}
	else
	{
		eval(a).style.display='';
		eval(b).className='SortEndFolderClose';
		
	}
}
function SortChange(a,b)
{
	if(eval(a).style.display=='')
	{
		eval(a).style.display='none';
		eval(b).className='SortFolderOpen';
	}
	else
	{
		eval(a).style.display='';
		eval(b).className='SortFolderClose';
	}
}

//-->
