﻿function killerrors() {
return true;
}
window.onerror = killerrors; 
//显示flash动画//
function swf(Flash,Width,Height)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://www.macrolist.com/swflash.cab#version=9,0,0,0" width="' + Width +' " height="' + Height + ' "><param name="movie" value="' + Flash + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'); 
	document.write( '<embed src="' + Flash + '" wmode="opaque" quality="high" luginspage=http://www.macromedia.com/go/getflashplayer type="application/x-shockwave-flash" width="' + Width + '" height="' + Height + '" wmode="transparent"></embed>'); 
	document.write('</object>'); 
}
function img(src,url)
{
	document.write("<a href="+url+" target='_blank'> <img src="+src+" alt='广告'/></a>"); 
}
function GtoHtml(objid,htmlstr)
{
	var s=document.getElementById(objid);
    if(s)
	{
		s.innerHTML=htmlstr;
	}
    else
	{
		return;
	}	
}
//新闻轮换//
function swf_news()
{
	var focus_width=278; //图片宽度
	var focus_height=218; //图片高度
    var text_height=20;
     var swf_height = focus_height+text_height;
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/swf/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('</object>');
}
//菜单轮换//
function Show_Tabs(tab_name,tab_index,tab_count)
{	
	for(var i=1;i<tab_count+1;i++)
		{
			document.getElementById(tab_name+"_"+i).style.display="none";
			document.getElementById(tab_name+"_menu_"+i).className="";
		}
	document.getElementById(tab_name+"_"+tab_index).style.display="block";
	document.getElementById(tab_name+"_menu_"+tab_index).className="current";
}

//竖向滚动//
function startmarquee(lh,speed,delay,index)
{
 			var t;
			var p=false;
			var o=document.getElementById("marquee"+index);
			o.innerHTML+=o.innerHTML;
			o.onmouseover=function(){p=true}
			o.onmouseout=function(){p=false}
			o.scrollTop = 0;
			function start(){
			t=setInterval(scrolling,speed);
			if(!p) o.scrollTop += 2;
			}
			function scrolling(){
			if(o.scrollTop%lh!=0){
			o.scrollTop += 2;
			if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
			}else{
			clearInterval(t);
			setTimeout(start,delay);
			}
			}
			setTimeout(start,delay);
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  return false;
}



//图片等比例缩小显示
//参数：imgID（图片的标识ID）
//参数：maxWidth（图片的最大宽度，值为0则表示不限制宽度）
//参数：maxHeight（图片的最大高度，值为0则表示不限制高度）
function ReSizeImg(Img,width,height)
{
    var image=new Image(); 
    image.src=Img.src; 
    //width=236;//预先设置的所期望的宽的值
    //height=170;//预先设置的所期望的高的值
    if(image.width>width||image.height>height)    //现有图片只有宽或高超了预设值就进行js控制
    {
        w=image.width/width;
        h=image.height/height;
        if(w<h)
        {
            //比值比较大==>宽比高大
            //定下宽度为width的宽度
            Img.width=width;
            //以下为计算高度
            Img.height=image.height/w;
        }
        else
        {
            //高比宽大
            //定下宽度为height高度
            Img.height=height;
            //以下为计算高度
            Img.width=image.width/h;
        }
    }
}
