function $(id){return document.getElementById(id);}
function $n(name){return document.getElementsByName(name);}
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function getCookie(sName){
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++){
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])	return unescape(aCrumb[1]);
	}
	return null;
}
function setCookie(sName, sValue){
	date = new Date();
	date.setMonth(date.getMonth() + 12);//12个月失效
	document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString()+"; path=/";
}
