﻿function $(s)			{return document.getElementById(s);}
function $a(s)			{return document.getElementsByName(s);}
function trim(s)		{return s.replace(/(^[ |　]*)|([ |　]*$)/g, '');}
function bug(s)			{alert(s);}
function hide(s)		{$(s).style.display = $(s).style.display == 'none' ? '' : 'none';}//隐藏切换
function pick(v,_id,_layer)	{$(_id).value=v;hide(_layer);}//模仿select
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize(){timer=setInterval ("scrollwindow ()",20);}
function sc(){clearInterval(timer);}
function scrollwindow(){var currentpos;
if (typeof window.pageYOffset != 'undefined') {   currentpos = window.pageYOffset;}
else if (typeof document.compatMode != 'undefined' &&  document.compatMode != 'BackCompat') { currentpos= document.documentElement.scrollTop;}
else if (typeof document.body != 'undefined') {  currentpos= document.body.scrollTop;}
window.scroll(0,++currentpos);if (currentpos !=currentpos)sc();}
document.onmousedown=sc;
document.ondblclick=initialize;

//更改字体大小
var status0='';
var curfontsize=10;
var curlineheight=18;
function ZFA(fontid){if(curfontsize>8){$(fontid).style.fontSize=(--curfontsize)+'pt';}}
function ZFB(fontid){if(curfontsize<64){$(fontid).style.fontSize=(++curfontsize)+'pt';}}

//function killErrors() {return true;} window.onerror = killErrors;
function externallinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	}
}
window.onload = externallinks; 
