function leftmenu(rootid,menucodel1,menucodel2,menucodel3){
	var root=document.getElementById(rootid);
	function rplks(str,keywords,newkey) {
			var re=new RegExp(eval("/"+keywords+"/g"));
			var value1=str.replace(re,newkey);
			return value1;
		}
	function curh(obj){
			$(">li>a",$(obj.parentNode.parentNode)).each(function (){
				$(">img:first",this).attr('src',rplks($(">img:first",this).attr('src'),"_.gif",".gif"));
			})
			$(">img:first",$(obj)).attr('src',rplks($(">img:first",obj).attr('src'),".gif","_.gif"));
		}
	function cur(obj){
		curh(obj);

		if(obj.parentNode.parentNode.getElementsByTagName('ul').length>0){
			$(" ul",$(obj.parentNode.parentNode)).each(function (){
				$(this).hide();
			})
		}
		if(obj.parentNode.getElementsByTagName('ul').length>0){
			$(">ul:first",obj.parentNode).show();
		}
	}
	function sethover(){
		if(typeof(menucodel1)=='undefined'||menucodel1==''){
			cur(root.getElementsByTagName('a')[0]);
		}else{
			$(">li>a",$(root)).each(function (i){
				if(i==menucodel1-1){
					cur(this);
					$(">ul>li>a",$(this.parentNode)).each(function (i){
						if(i==menucodel2-1){
								cur(this);
						}
					})
				}
			})
			
		}
	}
	if(root){
		for(var i=0; i<root.getElementsByTagName('a').length; i++){
			root.getElementsByTagName('a')[i].onclick=function(){
				cur(this);
			};
			root.getElementsByTagName('a')[i].onfocus=function(){
				cur(this);
			};
			root.getElementsByTagName('a')[i].onmouseover=function(){
				cur(this);
			};
		}
		$(root).hover(function (){},function (){
		//	sethover();
		})
		sethover();
	}
}
