var left_navlist=function(){
	var obj = $("left_navlist");
	var _this = this;
	_this.showDiv=function(list){
		var lastClassName = "";
		for(var i=0;i<list.length;i++){
			if(list[i].parentNode==obj){
				list[i].onmouseover=function(event){
					var node = this.getElementsByTagName("DIV")[0];
					if(node!=undefined){
						lastClassName = node.className;
						node.className = "on";
					}
				};
				list[i].onmouseout=function(event){
					var node = this.getElementsByTagName("DIV")[0];
					if(node!=undefined){
						node.className = lastClassName;
					}
				};
				//鼠标点击事件
				var ulNode = list[i].getElementsByTagName("UL")[0];
				if(ulNode!=undefined){
					var aNode = list[i].getElementsByTagName("A")[0];
					if(aNode!=undefined){
						aNode.href="javascript:;";//屏蔽掉超链接
					}
					var divNode = list[i].getElementsByTagName("DIV")[0];
					divNode.onclick=function(event){
						var node = this.parentNode.getElementsByTagName("UL")[0];
						if(node.style.display.toLowerCase()=="block"){
							node.style.display="none";//收缩
						}else{
							node.style.display="block";//展开
						}
					};//divNode
				}
			}//end if
		}//exit for
	};
	if(obj!=undefined){
		var divList = obj.getElementsByTagName("DIV");
		_this.showDiv(divList);//初始化
		var _links = obj.getElementsByTagName("A");
		var href = window.location.href;
		if(_currPage!=undefined && _currPage!=null) href=_currPage;
		for(var i=0;i<_links.length;i++){
			if(_links[i].href.toLowerCase().indexOf(href.toLowerCase())!=-1){
				_links[i].parentNode.className="on";
				if(_links[i].parentNode.tagName.toLowerCase()=="li"){
					_links[i].parentNode.parentNode.style.display="block";
				}
				break;//退出
			}
		}
		//初始化结束
		var _liNodes = obj.getElementsByTagName("LI");
		var _lastClassName = "";
		for(var i=0;i<_liNodes.length;i++){
			_liNodes[i].onmouseover=function(event){
				_lastClassName = this.className;
				this.className = "on";
			};
			_liNodes[i].onmouseout=function(event){
				this.className = _lastClassName;
				//_this.showDiv(divList);//纠正
			};
		}
	}
};

var msgBox=function(obj){
	var _this = this;
	var _msgBoxStates = false;//默认完全收缩
	_this.speed = 10;//移动的速度
	_this.startPoint = 638;//起始位置
	_this.endPoint = 830;//终点位置
	_this.move=function(){
		//var x = parseInt(obj.style.left);
		if(!_msgBoxStates){//隐藏状态
			obj.style.left = _this.endPoint + "px";
			_msgBoxStates = true;
		}else{
			obj.style.left = _this.startPoint + "px";
			_msgBoxStates = false;
		}
	}
};

var postmsg=function(){
	var truename = $("truename").value;
	var phone = $("phone").value;
	var content = $("msgcontent").value;
	if(!isTruename(truename)){
		$cdot.error("您填写的姓名格式不正确...");return false;
	}
	var reg = /^\d{1,20}$/;
	if(!reg.test(phone) && phone.length>0){
		$cdot.error("电话号码请填写数字...");return false;
	}
	if(content.length>3000){
		$cdot.error("留言内容字符过长(不能超过3000字)...");return false;
	}
	var postData = "truename=" + escape(truename)
					+ "&phone=" + escape(phone)
					+ "&content=" + escape(content);
	$ajaxPost("postmsg.asp",
				postData,
				function(xmlHttp){
					$cdot.error(xmlHttp.responseText);
				}
			);
	return false;
};
