
//---------------自建函数



//不显示脚本错误信息
window.onerror = function(){return true;}

String.prototype.Trim = function()
{
        return this.replace(/(^\s*)|(\s*$)/g, "");
}

function $(id, object){
	object = object || document;
	return document.getElementById ? object.getElementById(id) : document.all(id);
};

function mmm(o){
    if (o.className == "curr") return false;
    var tagCollect = o.parentNode.getElementsByTagName(o.tagName);
    for(i=0 ;i<tagCollect.length;i++)
	    tagCollect[i].className = "";
    o.className = "curr";
    return true;
}

//更改字号大小 FontSize
function font(v){
	var dv=$("div_c");
	if(parseInt(v)==1){
		var i=parseInt(dv.style.fontSize)-2;
		if(i<12){
		dv.style.fontSize="12px";
	}else{
		dv.style.fontSize=i+"px";
		}
	}
	if(parseInt(v)==2){
		dv.style.fontSize="14px";
	}
	if(parseInt(v)==3){
		var j=parseInt(dv.style.fontSize)+2;
		if(j>20){
			dv.style.fontSize="20px";
		}else{
			dv.style.fontSize=j+"px";
		}
	}   
}


function setCookie(name, value, expires, path){
    var cookie = name+"="+escape(value);
    if (expires) cookie += ";expires=" + expires.toGMTString();
    if (path) cookie += ";path=" + path;
    document.cookie = cookie;
}


function getCookie(name){
  var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
  if(arr=document.cookie.match(reg))
    return unescape(arr[2]);
  return null;
}






