//屏蔽JS错误
function killErrors()
{ 
	return true;
} 
window.onerror=killErrors;


//控制导航切换函数
function SetMenu(menu,no)
{
	for(i=0;i<menu.cells.length;i++) {
	menu.cells[i].className="bg_117_01";
	menu.cells[no].className="bg_117_02";}
}

//控制导航切换函数
function SetMenus(menu,no)
{
	for(i=0;i<menu.cells.length;i++) {
	menu.cells[i].className="bg_90_02";
	menu.cells[no].className="bg_90_01";}
}

function SetDiv(div,no){
	SetDiv_1(div,no);
}
function SetDiv_1(div,no){
	switch(no){
		case 1:
		document.getElementById(div+"1").style.display="block";
		document.getElementById(div+"2").style.display="none";
		document.getElementById(div+"3").style.display="none";
		document.getElementById(div+"4").style.display="none";
		document.getElementById(div+"5").style.display="none";
		break;
		case 2:
		document.getElementById(div+"1").style.display="none";
		document.getElementById(div+"2").style.display="block";
		document.getElementById(div+"3").style.display="none";
		document.getElementById(div+"4").style.display="none";
		document.getElementById(div+"5").style.display="none";
		break;
		case 3:
		document.getElementById(div+"1").style.display="none";
		document.getElementById(div+"2").style.display="none";
		document.getElementById(div+"3").style.display="block";
		document.getElementById(div+"4").style.display="none";
		document.getElementById(div+"5").style.display="none";
		break;
		case 4:
		document.getElementById(div+"1").style.display="none";
		document.getElementById(div+"2").style.display="none";
		document.getElementById(div+"3").style.display="none";
		document.getElementById(div+"4").style.display="block";
		document.getElementById(div+"5").style.display="none";
		break;
		case 5:
		document.getElementById(div+"1").style.display="none";
		document.getElementById(div+"2").style.display="none";
		document.getElementById(div+"3").style.display="none";
		document.getElementById(div+"4").style.display="none";
		document.getElementById(div+"5").style.display="block";
		break;
	}
}


//首页分类图片渐隐效果
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=40
} 
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
} 



//FLASH游戏加载8秒广告
//setTimeout("showswf();",8000);
function showswf(){
document.getElementById("swfdiv").style.display="block";
document.getElementById("loadimg").style.display="none";
}
function ShowAd8(){
//document.write('<iframe  src="/include/swf_ad.htm" width="600" height="400" frameborder="no" border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no" ></iframe>');
}


//加入收藏
function SetShcang()
{
javascript:window.external.AddFavorite(window.location.href, document.title);
}


//站内Flash广告简写函数
function adflash(width,height,url){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+url+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="Opaque">');
	document.write('<param name="menu" value="false">');
	document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
	document.write('</object>');
}



//评论内容字数限制
function setcount(field, countfield, maxlimit) {
// 定义函数，传入3个参数，分别为表单区的名字，表单域元素名，字符限制；
if (field.value.length > maxlimit) 
//如果元素区字符数大于最大字符数，按照最大字符数截断； 
field.value = field.value.substring(0, maxlimit);
else
//在记数区文本框内显示剩余的字符数； 
countfield.value = maxlimit - field.value.length;
}
