function $(str) 
{
  if(document.getElementById && document.getElementById(str)) return document.getElementById(str);
  else if (document.all && document.all(str)) return document.all(str);
  else if (document.layers && document.layers[str]) return document.layers[str];
  return false; 
}
/**
var XMLHttpReq;

//创建XMLHttpRequest对象       
function createXMLHttpRequest() {
	if (window.XMLHttpRequest) { //Mozilla 浏览器
		XMLHttpReq = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) { // IE浏览器
			try {
				XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) {
				try {
					XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {
				}
			}
		}
	}
}

//发送请求函数
function sendRequest(url) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", url, true);
	XMLHttpReq.onreadystatechange = processResponse;//指定响应函数
	XMLHttpReq.send(null);  // 发送请求
}

// 处理返回信息函数
function processResponse() {

	if (XMLHttpReq.readyState == 4) { // 判断对象状态
		if (XMLHttpReq.status == 200) { // 信息已经成功返回，开始处理信息
			var arr = XMLHttpReq.responseText;
			var username = arr.split(",");
			var path = $('headpath').value;
			
			if (username[0] == 1)
			{
				if($('headli1')) $('headli1').style.display = 'none';
				if($('headli2')) $('headli2').style.display = 'none';
				if($('headli3')) $('headli3').className="leftbg";
				if($('user')) $('user').value=username[1];
				if($('userid')) $('userid').value=username[2];
				if($('usertype')) $('usertype').value=username[3];
				
				var msg = username[1]+"&nbsp;你好!&nbsp;&nbsp;<a class=\"clr2\" href=\""+path+"sys/index.jsp?v="+Math.random()+"\">我的助手</a><a class=\"clr2\" onclick=\"javascript:js_exit();\">退出</a>";
				if(username[3] == 1){
				 	msg = username[1]+"&nbsp;你好!&nbsp;&nbsp;<a class=\"clr2\" href=\""+path+"sys/index.jsp?v="+Math.random()+"\">我的助手</a><a class=\"clr2\" href=\""+path+"stow/stowproduct.jsp\">收藏夹</a><a class=\"clr2\" onclick=\"javascript:js_exit();\">退出</a>";
			    }
			    if($('getname')) $('getname').innerHTML = msg;
			    
			}
		} else { //页面不正常
			window.alert("\u60a8\u6240\u8bf7\u6c42\u7684\u9875\u9762\u6709\u5f02\u5e38\u3002");
		}
	}
}
**/
function init_getname() {
	/**
	if($('headpath')){
		var path = $('headpath').value;
		sendRequest(path+"htmlctrl?f=20");
	}
	**/
}
//头上的登陆信息
function init_info(arr1,arr2,arr3,arr4){
			var path = $('infopath').value;
			if (arr1 == 1)
			{
				if($('headli1')) $('headli1').style.display = 'none';
				if($('headli2')) $('headli2').style.display = 'none';
				if($('headli3')) $('headli3').className="leftbg";
				if($('user')) $('user').value=arr2;
				if($('userid')) $('userid').value=arr3;
				if($('usertype')) $('usertype').value=arr4;
				var msg = arr2+"&nbsp;你好!&nbsp;&nbsp;<a class=\"clr2\" href=\""+path+"sys/index.jsp?v="+Math.random()+"\">我的助手</a><a class=\"clr2\" onclick=\"javascript:js_exit();\">退出</a>";
				if(arr4 == 1){
				 	msg = arr2+"&nbsp;你好!&nbsp;&nbsp;<a class=\"clr2\" href=\""+path+"sys/index.jsp?v="+Math.random()+"\">我的助手</a><a class=\"clr2\" href=\""+path+"stow/stowproduct.jsp\">收藏夹</a><a class=\"clr2\" onclick=\"javascript:js_exit();\">退出</a>";
			    }
			    if($('getname')) $('getname').innerHTML = msg;
			    
			}
}