// JavaScript Document
function $(id)
{
    return document.getElementById(id);
}
//换验证码
//换一张验证码
function changecode(id,code)
{
    $(id).src=code+"?id="+Math.random();
}
//去flash的虚边框
function showFlash(d,u,w,h,p,r,v){
var o=document.getElementById(d);
p=(!p)?'Transparent':'Opaque';
r=(!r)?true:false;
v=(!v)?'':v;
if (o!=null)
{
o.innerHTML='<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="'+w+'" height="'+h+'"><param name="movie" value="'+u+'"><param name="wmode" value="'+p+'"><param name="menu" value="'+r+'"><param name="flashvars" value="'+v+'"><embed src="'+u+'" width="'+w+'" height="'+h+'" wmode="'+p+'" flashvars="'+v+'" menu="'+r+'" type="application/x-shockwave-flash"></embed></object>';
}
}

//设为主页
function SetHome(url){
    var obj=document.getElementById("indexpage");
    try{
        obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);
    }
    catch(e){
        if(window.netscape) {
        try {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        }
        catch (e) {
        alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',url);
        }
    }
}
//添加到收藏夹
function AddFavorite(name,url)
{
    try
    {
        window.external.addFavorite(url, name);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(name, url, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}
function $(id)
{
	return document.getElementById(id);
}
<!--过滤ie6中的png图片阴影-->
<!--DD_belatedPNG.fix('类名')-->
<!--显示列表-->
var show=function(id)
{
	var dds=$(id).getElementsByTagName("dd");
	for(var i=0;i<dds.length;i++)
	{
		dds[i].style.display="block";
	}
}
var hidden=function(id)
{
	var dds=$(id).getElementsByTagName("dd");
	for(var i=0;i<dds.length;i++)
	{
		dds[i].style.display="none";
	}
}
var showcontent=function(id)     {     document.getElementById(id).style.display="block";$('moban').style.height=$('main').offsetHeight;     }  
var showcontent1=function(id)     {     document.getElementById(id).style.display="block"; $('main').style.height="auto";$('moban').style.height=$('main').offsetHeight;    }   
var hiddencontent=function(id)     {     document.getElementById(id).style.display="none"; $('moban').style.height=$('main').offsetHeight;    }
window.onload=function()
{
	try
	{
		$("middle_1_2_2_m").innerHTML=listimg;
	}catch(e)
	{
		
	}
	try
	{
		var h=$('main').offsetHeight;
		if(h<500)
		{
			$('main').style.height="500px";
		}
		var hh=$('moban').offsetHeight;
		if(hh<$('main').offsetHeight)
		{
			$('moban').style.height=$('main').offsetHeight;
		}
	}catch(e)
	{}
}
function showover(id)
{
	var lis=$('yw').getElementsByTagName('li');
	for(var j=0;j<lis.length;j++)
	{
		if(id==lis[j].id)
		{
			$(id).style.backgroundColor="#fce4f1";
		}else{
			lis[j].style.backgroundColor='';
		}
	}
}
function hiddenout()
{
	var lis=$('yw').getElementsByTagName('li');
	for(var j=0;j<lis.length;j++)
	{
		lis[j].style.backgroundColor='';
	}
}
function showyw(id)
{
	var lis=$('ywc').getElementsByTagName('div');
	for(var j=0;j<lis.length;j++)
	{
		if(id==lis[j].id)
		{
			$(id).style.display="block";
		}else{
			lis[j].style.display="none";
		}
	}
}
