function List3 (n) {
	
	this.pl			= 10;
	this.tno		= 3;
	this.pid		= 'pager1';
	this.lid		= 'list';
	this.pager		= 1;
	this.p1			= 1;
	this.p2			= 1;
	this.name		= n;
	this.orientation	= 'horizontal';
	this.alignment		= 'bottom';
	this.logo_width		= '150px';
	this.class_box_list	= 'box_list3';
	this.class_box		= 'list_box3';
	this.class_logo		= 'list_logo';
	this.class_content	= 'list_content3';
	this.class_brief	= 'list_brief';
	this.class_title_line	= 'list_title_line';
	this.class_stats	= 'list_stats3';
	this.class_pager	= 'box_pager3';
	this.class_vertical	= 'brief_box_vertical';
	this.class_horizontal	= 'brief_box_horizontal';
	this.class_left		= 'brief_text_normal'	;
	this.class_right	= 'brief_text_right'	;
	this.def_nophoto	= '/img/nophoto.jpg';
	this.pid2		= 'pager2';
	this.type		= 'full';
	this.cat		= 1;
	this.headings		= new Array();

	this.img_title		= '';
	this.linkp		= '';
	this.link1		= '';
	this.link2		= '';
	this.link3		= ''; 
	this.filter		= '';
	this.count		= 'fn=groups_count';
	this.query		= 'fn=groups_list';
	this.extra		= '';
	this.cases 		= null;
	this.person		= 0;
	this.fixed_height	= 0;
	this.fixed_width	= 0;
	this.stats		= 0;
	this.stats_float	= '';
	this.stats_top		= '';
	this.stats_left		= '';
	this.stats_bottom	= '';
	this.stats_right	= '';
	this.array		= '';
	this.empty		= '';
	this.imode		= 0;
	this.rich		= 0;

	var list;
	var a = new Array();
	var t;
	var pindex;

	this.len = function () {
		return list.length;
	}

	this.init = function () {

		if (!getid(this.lid)) {
			alert('Container: '+this.lid+' does not exist!');
			return;
		}
		list			= getid(this.lid);
		list.pno		= 1;
		list.sum		= 0;
		list.st			= 0;	
		list.ttl		= 0;	
		list.length		= 0;
	
		list.lid		= this.lid;
		list.pl			= this.pl;
		list.orientation	= this.orientation	;
		list.alignment		= this.alignment	;
		list.tno		= this.tno	;
		list.pid		= this.pid	;
		list.pager		= this.pager	  ;
		list.p1			= this.p1		  ;
		list.p2			= this.p2		  ;
		list.cat		= this.cat	  ;
		list.name		= this.name	  ;
		list.logo_width		= this.logo_width	  ;
		list.class_box_list	= this.class_box_list	;
		list.class_box		= this.class_box	  ;
		list.class_logo		= this.class_logo	  ;
		list.class_report	= this.class_report  ;
		list.class_content	= this.class_content;
		list.class_brief	= this.class_brief;
		list.class_title_line	= this.class_title_line	;
		list.class_stats	= this.class_stats	;
		list.class_pager	= this.class_pager	;
		list.class_vertical	= this.class_vertical	;
		list.class_horizontal	= this.class_horizontal	;
		list.class_left		= this.class_left	;
		list.class_right	= this.class_right	;
		list.def_nophoto	= this.def_nophoto	;
		list.pid2		= this.pid2	;	
		list.type		= this.type	;
		list.img_title		= this.img_title	;
		list.linkp		= this.linkp	;	
		list.link1		= this.link1	;	
		list.link2		= this.link2	;	
		list.link3		= this.link3	;	
		list.filter		= this.filter	;	
		list.count		= this.count	;	
		list.query		= this.query	;	
		list.extra		= this.extra	;	
		list.cases		= this.cases	;	
		list.headings		= this.headings	;
		list.person		= this.person	;
		list.fixed_height	= this.fixed_height;
		list.fixed_width	= this.fixed_width;
		list.stats		= this.stats	;
		list.stats_float	= this.stats_float	;
		list.stats_top		= this.stats_top	;
		list.stats_left		= this.stats_left	;
		list.stats_bottom	= this.stats_bottom	;
		list.stats_right	= this.stats_right	;
		list.array		= this.array	;
		list.empty		= this.empty	;
		list.imode		= this.imode	;
		list.rich		= this.rich	;

		list.clear = function () {
			list.style.height = 'auto';
			for (var s=list.getElementsByTagName('table');
				       	s.length; list.removeChild(s[0]) );
		}
	
		list.destroy = function () {
			for (var s=list.getElementsByTagName('table');
				       	s.length; list.removeChild(s[0]) );
		}

		list.make_query = function (s, l) {
			var q;
			q = list.query + '&s='+_sess+'&start='+s+'&limit='+l;
			if (list.filter) {
				q += '&filter=' + list.filter;
			}
			return q;
		}

		list.bar_clear = function () {
			if (list.pager) 
				clear_child(getid(list.pid));
			if (list.pid2)
				clear_child(getid(list.pid2));

		}

		list.get_page_count = function () {

			var q = list.count;
			if ((q-0) > 0) {
				list.ttl = q-0;
			} else {
				a.length = 0;
				if (list.filter != ' ') {
					q += '&filter=' + list.filter;
				}
				fetch_lists (q, a);	
				if	(a && a[0])	list.ttl = a[0][0];
				else			list.ttl = 0;
			}
			list.psum=Math.ceil(list.ttl / list.pl);        
		}

		list.page_bar = function (p2){
			
			if (list.pager == 0) return;

			var aa, ah, c, o, p, x, y, ot;
			this.get_page_count();

			if (p2 == 2 && this.pid2) {
				o = getid(this.pid2);
				if (ie4) {}
			       	else o.style.textAlign = 'right;';
			} else {
				o = getid(this.pid);
			}
			o.innerHTML ='';
			o.className = this.class_pager;
			
			if (!p2) {
				x = (list.st-0)+1;
				y = (list.st-0)+(list.pl-0);
				if (y>list.ttl) y=list.ttl;
				aa= addobj ('span');
		ot = list.ttl>500 ? '500+':list.ttl;
				aa.innerHTML=_lang['displaying'] +x+' - '+y+' '+_lang['of']+' '+ot+' '+_lang['results'];
				o.appendChild(aa);
			}

			
			aa = addobj ('a');
			aa.first = function ()	{ list.showpage (1)	};
			aa.onclick = aa.first;
			aa.innerHTML = "[&lt;&lt;]";
		//	o.appendChild(aa);
		      
			aa = addobj ('a');
			aa.prev = function () {
				list.pno = (list.pno<1) ? list.pno=1:list.pno-=1;
				list.showpage (list.pno);
			}
			aa.onclick = aa.prev;
//			aa.innerHTML = "[&lt;]";
		
			if(list.pno ==1 ){
				aa.innerHTML = "";
			} else {
				aa.innerHTML = "Prev";
			}
			o.appendChild(aa);

			x = list.pno-1;
			y = list.pno+1;
			if ( x < 1 )		x = 1;
			if ( y > list.psum )	x--;
	
			for (i=0; i<list.tno; i++) {
				list.pindex = x+i;
				if (list.pindex>0 && list.pindex<=list.psum) {
					if (list.pno == list.pindex) {
						aa = addobj ('p');
						aa.innerHTML  = list.pindex;
					} else {
						aa = addobj ('a');
						aa.innerHTML  = list.pindex;
						aa.pageNo     = list.pindex;
						aa.onclick = function () {
							list.showpage(this.pageNo);
						}
					}
					o.appendChild(aa);
				}
			}
		 
			aa = addobj ('a');
			aa.next = function () {list.pno=(list.pno>list.psum)?list.pno=list.psum:list.pno+=1;list.showpage(list.pno)};
			aa.onclick=aa.next;
		//	aa.innerHTML = "[&gt;]";
			if(list.pno == list.psum){
				aa.innerHTML = "";
			} else {
				aa.innerHTML = _lang['Next']+" 	&nbsp;&nbsp;&nbsp;";
			}
			o.appendChild(aa);

			aa = addobj ('a');
			aa.last = function ()	{ list.showpage (list.psum)	};
			aa.onclick = aa.last;
			aa.innerHTML = "[&gt;&gt;]";
		//	o.appendChild(aa);

			if (this.cat) {
				aa = new Categories ('','',function (c1,c2,c3) {});
				aa.style.display = "inline";
				aa.style.marginLeft = '10px';
				o.appendChild (aa);
			}
		}

		list.detail = function () {
		}

		list.brief = function () {

		}

		list.full_html = function (a) {

			var s, c, box, logo, content, stats;
			var a = new Array();
			var lp, l1, l2, l3;
			if (list.array) {
				a = list.array;
			} else  {
				fetch_lists (this.make_query(list.st, list.pl), a);
			}

			list.className = 'box_list';
		//	var li = "<div class='box_list'><div class='box_list'>";	
			var li = "<div style='float: left; width: 100%;'><div id='list_body' style='margin: 0px 10px 0px 10px;'>";	


			list.get_page_count();
			list.length = a.length;

			for(var i=0; i<list.ttl; i++) {

				if (!a[i] || !a[i][0]) continue;

				lp=list.linkp;
				if (lp.indexOf('###')>-1) lp=lp.replace(/###/g,a[i][7]);
				if (lp.indexOf('##')>-1) lp=lp.replace(/##/g,a[i][0]);
				l1=list.link1;
				if (l1.indexOf('###')>-1) l1=l1.replace(/###/g,a[i][7]);
				if (l1.indexOf('##')>-1) l1=l1.replace(/##/g,a[i][0]);
				l2=list.link2;
				if (l2.indexOf('###')>-1) l2=l2.replace(/###/g,a[i][7]);
				if (l2.indexOf('##')>-1) l2=l2.replace(/##/g,a[i][0]);
				l3=list.link3;
				if (l3.indexOf('###')>-1) l3=l3.replace(/###/g,a[i][7]);
				if (l3.indexOf('##')>-1) l3=l3.replace(/##/g,a[i][0]);
	
				logo = '';
		
				if (a[i][1] != -1) {

					a[i][1] = thumbnail (a[i][1]);
					if (list.person ==1) {
						c = get_photo (a[i][1], a[i][6]);
					} else if (list.person==2) {
						if(a[i][7]==2){
							c = get_photo (a[i][1],'',1);
						} else if(a[i][7]==1){
							c = get_photo (a[i][1], a[i][6]);
						} else {
							c = get_photo (a[i][1],'',1);
						}
					} else if (list.person==3) {
                                        	c.src = get_photo (a[i][1],'',3);
                                        } else if (list.person==4) {
                                       		c.src = get_photo (a[i][1],'',4);
                                        } else if (list.person==5) {
                                        	c.src = get_photo (a[i][1],'',2);
                                        } else {
						c = get_photo (a[i][1], 0);
					}
					
					c = "src='"+c+"'";
					if (list.img_title) c = c + " title='"+list.img_title+"'";
				//	logo = "<a href='"+lp+a[i][0]+"'><img border='0' class='"+list.class_logo+"' "+c+" style='border: 0px solid red; width: 100px; height: auto;'></a>";
					logo = "<a href='"+lp+a[i][0]+"'><img "+c+" style='border: 0px solid red; width: 100px; height: auto;'></a>";
				}
				content = "<div class='"+list.class_title_line+"'><a href='"+l1+a[i][0]+"'>"+a[i][2]+"</a></div>";

				a[i][3] = rich_unescape(a[i][3]);
				if (a[i][3]!=null && a[i][3].length > 300) {
					a[i][3] = a[i][3].substring(0,300) + ' ...';
				}

				if (a[i][3] == null) a[i][3] = "";
				if(list.imode==5&&top._desktop.query){var g1_cr = top._desktop.query['new_grp_info'][0][12]}else{var g1_cr='' }
				content += "<div class='list_content_real'><p style='color:"+g1_cr+"' href='"+l2+a[i][0]+"'>"+a[i][3]+"</p></div>";
				c = '';
				if (list.cases) {
					if (a[i][5]>list.cases.length-1) {
						a[i][5] = list.cases.length-1;
					}
					c = list.cases[a[i][5]];
					if (c.indexOf('##') > -1) 
						c = c.replace (/##/g,a[i][0]);

				} else 	if (list.extra) {

					if(a[i][7] == 1){
                                                list.extra = "<div id='extra' style='margin-top:0px;'><a onclick='javascript:jump_dialog(1,"+a[i][0]+");'>"+_lang['AddasFriend']+"</a></div><div id='extra'><a onclick='javascript:jump_dialog(2,"+a[i][0]+");'>"+_lang['SendaMessage']+"</a></div><div id='extra'><a onclick='javascript:jump_dialog(3,"+a[i][0]+");'>"+_lang['ViewFriends']+"</a></div>";
					}else if(a[i][7] == 2){
                                                list.extra = "<div id='extra'><a onclick='javascript:jump_dialog(0,"+a[i][0]+");'>"+_lang['JoinGroup']+"</a></div>";
					}else if(a[i][7] == 3){
						list.extra = "";
					}else{
						list.extra = list.extra;
					}

					c = list.extra;
					if (c.indexOf('##') > -1) 
						c = c.replace (/##/g,a[i][0]);
				}
			
				var o;
				if (list.stats) {
					o = addobj ('div');
					s = addobj ('div', ['class', 'list_brief_stats']);
					if (list.stats_float) s.style.cssFloat= list.stats_float;
					if (list.stats_top) s.style.top       = list.stats_top;
					if (list.stats_left) s.style.left     = list.stats_left;
					if (list.stats_bottom) s.style.bottom = list.stats_bottom;
					if (list.stats_right) s.style.right   = list.stats_right;
					s.appendChild (
						Slide_Bar('p'+i,list.stats,a[i][8],a[i][9],'') );
					o.appendChild(s);
					c += o.innerHTML;
				}	
				if(list.imode==5&&top._desktop.query){var g_cr = top._desktop.query['new_grp_info'][0][12]}else{var g_cr='' }	
				a[i][4] = rich_unescape(a[i][4]);
				stats = "<div><p style='color:"+g_cr+"' href='"+l3+a[i][0]+"'>"+a[i][4]+"</p>"+c+"</div>";
				if (a[i][1] == -1) {
				//	box = "<div id='listbox' class='"+list.class_box+"'><div style='width: 0px;'></div><div class='"+list.class_content+"'>"+content+"</div><div class='"+list.class_stats+"'>"+stats+"</div></div>";
					box = "<div style='border: 1px solid silver; margin: 10px 0px 10px 0px; background-color: white;'><div style='float: left; margin: 10px; width: 100px; display: none;'>"+logo+"</div><div style='float: left; width: 360px; margin: 10px 0px 10px 0px;'>"+content+"</div><div style='float: right; margin: 0px 0px 10px 0px; width: 130px;'>"+stats+"</div><div style='clear: both;'></div></div>";
				} else {
				//	box = "<div id='listbox' class='"+list.class_box+"'><div class='"+list.class_logo+"'>"+logo+"</div><div class='"+list.class_content+"'>"+content+"</div><div class='"+list.class_stats+"'>"+stats+"</div></div>";
					box = "<div style='border: 1px solid silver; margin: 10px 0px 10px 0px; background-color: white;'><div style='float: left; margin: 10px; width: 100px;'>"+logo+"</div><div style='float: left; width: 360px; margin: 10px 0px 10px 0px;'>"+content+"</div><div style='float: right; margin: 0px 0px 10px 0px; width: 130px;'>"+stats+"</div><div style='clear: both;'></div></div>";
				}

				li += box;

			}

			li += "<div style='clear: both;'></div></div></div>";
			list.innerHTML = li;
		}

		list.full_report = function () {

		}

		list.showpage = function (pn) {
			if (pn > list.psum) {
				pn = list.psum;
			} else if (pn < 1) {
				pn = 1;
			}
			list.pno = pn;
			list.st = (pn-1) * list.pl;
			if (this.pager) {
				this.bar_clear();
				this.page_bar();
			}

			if (this.pid2) {
				this.page_bar(2);
			}

			list.clear();

			if	(list.type == 'brief')		{ list.brief (); }
			else if	(list.type == 'report')		{ list.full_report (); }
			else					{ list.full_html (); }

		}

		list.prev = function () {
			list.pno = (list.pno<1) ? list.pno=1:list.pno-=1;
			list.showpage (list.pno);
		}

		list.next = function () {
			list.pno = (list.pno>list.psum) ? list.pno=list.psum:list.pno+=1;
			list.showpage (list.pno);
		}


		if (list.pager) list.page_bar  ();
		if (list.type == 'brief') {
			list.brief ();
		} else if (list.type == 'report') {
			list.full_report ();
		} else {
			list.full_html ();
		}
		if (list.pager && list.pid2) list.page_bar  (2);
	}

}


