var $LASTCAT="";
CATEGORYUSER=function(){}
CATEGORYUSER.prototype.list=function(){
	var fncSuc = XHR.Delegate(this,this.listSuc);
	var param = {act: "listCategory"};
	new XHR("post",fncSuc).send($PN+"/Proc",param);	
}
CATEGORYUSER.prototype.listSuc=function(r){
	var xml = new XML(r);
	var html = "";
	if (xml.value){
		var html="";
		var cat = xml.get("cat");
		for(var i=0; i < cat.length; i++){
			html+=this.gen1Block(cat[i]);
		}
		if(html!=""){
			$("categorylistuser").innerHTML = html;
			try{$("catuser_"+$CATIDPRO).style.fontWeight="bold";}catch(e){}
		}
		try{
			var t = xml.get("title");
			if(t.length>0){
				t = t[0].getAttribute("value");
			}else{
				t="";
			}
			try{$N("common_title_product")[0].value = t;}catch(e){}
			try{$("common_title_product").innerHTML = t;}catch(e){}
		}catch(e){}
	}
}
CATEGORYUSER.prototype.gen1Block=function(cat){
	try{
		var id = cat.getAttribute("id");
		var html = "<div id=\"catuser_"+id+"\" class=\"categorylist\"><a class=\"colorcategory\" href='?act=productlist&catid="+cat.getAttribute("id")+"&id=-1&lang="+$LANG+"'>"+cat.getAttribute("catname")+"</a></div>";
		return html;
	}catch(e){
		return "";
	}
}

