function pr(obj)
{
	var s = '';
	if ((typeof obj !== "object") || (obj == null))
	{
//		if (typeof(obj) != "function")
			s += obj + '\n';
		// else
			// s += 'function()...\n';
	}
	else
		for(var i in obj)
		{
			s += i + ' = ' + obj[i] + '\n';
		}
	return s;
}

function prr(objct)
{
	var body_alert = document.getElementById('body_alert');
	var res = pr(objct);
	if(!body_alert)
		document.getElementById('head').innerHTML += '<div id="body_alert" style="padding: 7px; position:absolute; background:#fff; text-align:center; display:block; width:100%; zoom:1; border:2px solid black; z-index:5000; top:500px;"><a href="#" onclick="this.parentNode.style.display = \'none\';this.parentNode.inerHTML = \'\';">закрыть</a><br/><br/></div>';
	else
		if(body_alert.style.display == 'none')
		{
			body_alert.style.display = 'block';
			body_alert.innerHTML = '<a href="#" onclick="this.parentNode.style.display = \'none\';this.parentNode.inerHTML = \'\';">закрыть</a><br/><br/>';
		}
	document.getElementById('body_alert').innerHTML += '<div style="position:relative; background:#fff; display:block; text-align:center; padding: 5px; zoom:1; margin: -2px; border:2px solid black;"><a href="#" onclick="this.parentNode.style.display = \'none\';this.parentNode.inerHTML = \'\';">закрыть</a><pre style="text-align:left;">'+res+'</pre><a href="#" onclick="this.parentNode.style.display = \'none\';this.parentNode.inerHTML = \'\';">закрыть</a></div>';
}

function openVideo(obj,w,h)
{	
	var path = obj.href;
	wins.open(
	{
		ajaxfile:path,
		width:w,
		height:h,
		beforeclose:function(){ wins.clearContent() },
		title:'Видео'
	});
	return false;
};

function openScreenshots(path,w,h)
{
	scr_sh.open(path,w);
//alert(path);
/*	var mwh;
	wins.open({
		ajaxfile:path,
		width:w,
		height:h,
		aftershow:function(){				
			var div = document.getElementById('portscreens');
			mwh = new c_MouseWheel(document.body, function(wd){div.scrollLeft -= wd*15;});

			var s_int = false;
			var as = document.getElementById('screenshots').getElementsByTagName('a');
			var btns = [];
			for(var i=0; i<as.length; i++)
				if(as[i].className == 'bttn')			
					btns[btns.length] = as[i];

			btns[0].onmouseover = function(){ if(s_int) s_int = clearInterval(s_int); s_int = setInterval(function(){ div.scrollLeft -= 10},10)};
			btns[1].onmouseover = function(){ if(s_int) s_int = clearInterval(s_int); s_int = setInterval(function(){ div.scrollLeft += 10},10)};
			btns[0].onmouseout = btns[1].onmouseout = function(){clearInterval(s_int)};
							
		},
		beforeclose:function(){
			mwh.remove();
			delete mwh;
		},
		title:'Скриншоты'
	});
	
	/*return false;*/
}

function c_Portfolio(pf, def_y, def_p, path, titles)
{
	var he = false;
	var cur_hash;
	var filter_number;
	var years = {};
	var loaded = false;
	var last_year;
	var y, s_y, p, pf_hide,prev_s_y;
	var logo_img;	
	var c_ul;
	var pf_c = document.getElementById('portfolio_container');
	var div_y, div_p, div_p_btm, div_p_top, div_desc, div_preimg;
	pf_c.style.top = "-100px";
	pf_c.style.marginBottom	 = "-100px";
	if(pf_c.className!='hidden')
		init();
	
	function nullProj() {
	window.location.hash = 'pfpr:nf:p:0:';
	years['top'].as['0_top'].on_click();
	}
	
	function initHashHandler() {
		setInterval(function()
		{
			if((window.location.hash != "#"+cur_hash) && (window.location.hash != ""))
			{
				var res = window.location.hash.split(":");
				if((res) && (res.length == 5) && (res[0] == '#pfpr'))
				{
					if(!loaded) init();
					pf_c.className = '';
					document.cookie = 'pf_hide=' + pf_c.className;

//					res[1] = res[1].replace("%20"," ");
					if(res[2] == 'p')
						res[2] = 'top';
					else
						res[2] = '200'+res[2];
						
					if((!years[res[2]]) || (res[2]==''))
					{
						nullProj();
						return;
					}
					else
					{
						if(res[2] != s_y)
							years[res[2]].select();

						if(res[1] == 'nf')
							if(!years[res[2]].as[res[3]+'_'+res[2]])
							{
								nullProj();
								return;
							}
							else
							{
								years[res[2]].as[res[3]+'_'+res[2]].on_click();
								document.getElementById('pf_filter_close').onclick('no');
							}
						else
						{
							years['filter'].loaditems(function(){
								if(years['filter'].item_click(res[1], function(){
									if(res[3]!= '')
									{	
										if(!years['filter'].as[res[3]+'_'+res[2]])
										{
											nullProj();
											return;
										}
										else
											years['filter'].as[res[3]+'_'+res[2]].on_click();
									}
									else
									{
										nullProj();
									}
								}))
									nullProj();
							});
						}
						cur_hash = window.location.hash.replace("#","");
					}
				}
			}
		},100);

	}
	this.toggle = function()
	{
		if(!loaded)
			init();
		document.getElementById('pf_menumark').className = (document.getElementById('pf_menumark').className=='visible'?'':'visible');
		document.getElementById('portfolio_mark').className = (document.getElementById('portfolio_mark').className=='on'?'':'on');
		if(pf_c.className == 'hidden')
		{
			pf_c.className = '';
//			document.getElementById('portfolio_container').style.height = "490px";
		}
		else
		{
			pf_c.className = 'hidden';
//			document.getElementById('portfolio_container').style.height = "0px";
		}
		document.cookie = 'pf_hide=' + pf_c.className;
	}

	this.gotoPrj = function(prjyear,prjidx)
	{
		years[prjyear].as[prjidx+'_'+prjyear].on_click();
	}
	
	function init()
	{
		create_html();
		
		div_y   = document.getElementById('years');
		div_p   = document.getElementById('projects');
		div_p_btm = document.getElementById('arrow_bttm');
		div_p_top = document.getElementById('arrow_top');
		div_desc = document.getElementById('desc');
		div_preimg = document.getElementById('desc_bg');			
	
		initcookies();

		if(div_preimg.previousSibling.tagName!='A') 
		{
			logo_img = document.createElement('a'); 
			logo_img.href="javascript: void(0)";
			div_preimg.parentNode.insertBefore(logo_img,div_preimg); 
		}
		else logo_img = div_preimg.previousSibling;
		
		init_y_links();
		init_arrows();
		years['filter'] = new create_filter();
		loaded = true;
		if(window.wins)
			window.wins = new Wins();
	}

	function Year(year)
	{
		var cont_div = div_y.appendChild(document.createElement('div')); cont_div.appendChild(document.createElement('div'));
		var a = cont_div.appendChild(document.createElement('a'));
		var img = a.appendChild(document.createElement('img'));
		var prj_ul = false;
		var imgs = [];
		var as = {};
		//this.as = as;
		a.title = titles[year]?titles[year].title:year; a.href='#';		
		a.onclick = _year_click;
		imgs[0] = new Image();
		imgs[0].src = img.src = path + year + '/image.gif';
		img.alt = titles[year] ? (titles[year].alt?titles[year].alt:titles[year].title) : year;
		imgs[1] = new Image();
		imgs[1].src = path + year + '/selected.gif';
		switch(year)
		{
			case 'top': cont_div.className='first';break;
			case '2009' : cont_div.className='top';break;
			case '2007' : cont_div.className='bottom';break;
			case '2002': cont_div.className='last';break;
		}

		if(s_y == year) select();

		function unselect()		
		{ 
			a.previousSibling.className = '';
			img.src = imgs[0].src;
			prj_ul.className += ' hidden';			
		}

		function select()
		{
			document.getElementById('years').childNodes[0].childNodes[0].className = "";
			document.getElementById('years').childNodes[0].childNodes[1].childNodes[0].src = "portfolio/ru/top/image.gif";

			if(years[s_y]) years[s_y].unselect();
			a.previousSibling.className = 'selected';
			div_y.className = (last_year==year)?'lastyearsel':'';
			 
			img.src = imgs[1].src;

			if(!prj_ul) get_p_list();

			prj_ul.className = prj_ul.className.replace('hidden', '');
//prj_ul.childNodes[0].on_click();
			s_y = year;
			c_ul = prj_ul;
			}

/*		function inspect()
		{
			if(c_ul.childNodes[p+'_filter']) c_ul.childNodes[p+'_filter'].className = 'selected';
		}
*/
		function _year_click()
		{
			select();
			document.getElementById('pf_filter_field').style.display = 'none';

			if(af = document.getElementById('active_filter')) af.id = '';
			if(pff = document.getElementById('pf_filter')) pff.className = '';
prj_ul.childNodes[0].childNodes[0].onclick();
			return false;
		}

		function get_p_list()
		{			
			prj_ul = div_p.insertBefore(document.createElement('ul'), div_p_btm);
			prj_ul.id = 'list-'+year;
			var li;			
			if(s_y != year)
				prj_ul.className = 'hidden';

			/*****************************************************************************************/

			for(var k=0; k<pf[year].length; k++)			
				as[ k+'_'+year ] = new Prj(k,year,prj_ul);

			init_prjcs_links();	  
		}																							

		function init_prjcs_links()
		{
			var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			xml.open("GET", path+"pf.php?m=1&y=" + year, true);
			xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
			xml.setRequestHeader("Accept","*/*");
			xml.onreadystatechange = function(){
				if ( xml.readyState == 4 ) 
					if ( xml.status == 200)
					{	
						var tmp = eval(xml.responseText);
						if(!tmp) return false;
						for(var i=0; i<tmp.length; i++)						
						{								
							as[i+'_'+year].aj_init(tmp[i]);
							if(year==y && i==p) as[i+'_'+year].on_click();
						}
					}
			};
			xml.send(null);
		}		
		return {'select':select, 'unselect':unselect,'as':as/*,'inspect':inspect*/};
	}
	
	function Prj(idx,year,prj_ul)  //
	{
	   	var li = prj_ul.appendChild(document.createElement('li'));
	   	var a = li.appendChild(document.createElement('a'));
	   	var aimg = a.appendChild(document.createElement('img'));
	   	var desc = false;
	   	var img = new Image();
		img.id = 'pf_c_img';
	   	if (document.body.filters)
	   		img.src = path + '/' + year + '/' + pf[year][idx] + '/shot.jpg';	
	   	aimg.src = path + '/' + year + '/' + pf[year][idx] + '/logo.gif';
	   	a.href ='javascript: void(0)';
			//if(year==y && idx==p) on_click();
		a.onclick = on_click;

	   	this.unselect = unselect;
	   	function unselect()
	   	{
	   		a.className = '';
	   	}

   		function select()
		{			
			if(!prev_s_y) {prev_s_y = s_y;}
			if(years[prev_s_y].as[p+'_'+y]) years[prev_s_y].as[p+'_'+y].unselect();
			
			prev_s_y = s_y;
			if(years[prev_s_y].getcuritem) years[prev_s_y].getcuritem();
			 	a.className = 'selected';
			p = idx;

			if(s_y!='filter')
			{
				s_y = y = year;
			}
			else y = year;
			
			document.cookie = 'pf_pos=[\'' + y + '\',' + p + ']';
		}

		this.on_click = on_click;
		this.select = select;
		function on_click()
		{				
			if(!desc) loadDesc();
			else showDesc();
			if(img.src=='')			
				img.src = path + '/' + year + '/' + pf[year][idx] + '/shot.jpg';
			if(img.alt == '')
				img.alt = 'ПОРТФОЛИО: '+ aimg.alt;
			
			logo_img.innerHTML = '<img src="'+img.src + '" alt="' + img.alt + '" id="pf_c_img"/>';
			logo_img.id = 'pf_c_a';
			logo_img.onclick = function(){document.getElementById('shots'+year+'-'+idx).onclick();};
			select();
			prev_year = year;
			writeHash();
		}
// HASH		
		function writeHash() 
		{
			if(he)
			{
				if(years[prev_s_y].getcuritem)
					cur_hash = "pfpr:"+years[prev_s_y].getcuritem()+":";
				else
					cur_hash = "pfpr:nf:";
			
				cur_hash += year.substr(year.length-1,1)+":"+idx+":";

				window.location.hash = cur_hash;
			}
			he = true;
		}
// HASH

		function loadDesc()
		{
			var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			xml.open("GET", path+"pf.php?m=2&y=" + year + "&i=" + idx , true);
			xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
			xml.setRequestHeader("Accept","*/*");
			xml.onreadystatechange = function(){
				if ( xml.readyState == 4 ) 
					if ( xml.status == 200)
					{
						desc = document.createElement('div');
						some = xml.responseText.search('<!--priv_info-->');
						if(some>0)
							getDesc(xml.responseText.substring(0,some+16),xml.responseText.substring(some+16));
						else
							getDesc(xml.responseText);
					}
			};
			xml.send(null);
		}
		this.aj_init=aj_init;
		function aj_init(opt)
		{			
			a.title = 'Узнать о проекте <'+opt.title+'>';
			opt.alt = opt.alt || opt.title || opt.logo_alt;
			aimg.alt = 'Проект <'+opt.alt+'>';
			opt.logo_alt = opt.logo_alt || opt.title || opt.alt; 
			img.alt = 'ПОРТФОЛИО: скриншот проекта <'+opt.logo_alt+'>';
		}			

		function getDesc(txt,priv)
	   	{
			var tmp = 	'<table width="100%" cellspacing="0" cellpadding="0">'+
					'<tr><td><img src="' + path + '/' + year + '/' + pf[year][idx] +'/logo_rgb.gif" alt="'+aimg.alt+' &mdash; логотип "/></td></tr>'+
					'</table><br/>'+ txt + '<a id="shots'+year+'-'+idx+'" href="javascript: void(0);" onclick="openScreenshots(\'';
				if(priv)
					tmp += priv+'\',\'aii\');">'+
					'Смотреть 3D-модель</a>';
				else
					tmp += path+'pf.php?m=3&y='+year+'&i='+idx+'\',621,350);">'+
					'Смотреть дизайн</a>';
			desc.innerHTML = tmp;
			showDesc();	
		}

		function showDesc()
		{
			div_desc.innerHTML = desc.innerHTML;
		}
	}
	function init_y_links()
	{
		var year;
		var tmp = [];
		for(year in pf)
			tmp[tmp.length] = year;
		tmp = tmp.sort();
		for(var i=tmp.length-1;i>=0;i--)
			years[tmp[i]] = new Year(tmp[i]);
		last_year = tmp[0];
	}

	function initcookies()
	{
		if (document.cookie.length>0)
		{
			var c_start = document.cookie.indexOf('pf_pos=') + 7;//'pos='.length			
			if (c_start != 6)
			{ 
				var c_end = document.cookie.indexOf(";", c_start);
				if (c_end==-1) c_end = document.cookie.length;
				var tmp = eval( document.cookie.substring(c_start,c_end));
				s_y = y = tmp[0];
				p = tmp[1];
				return;
		  	} 
		}		
		s_y = y = def_y;
		p = def_p;
	}

	function init_arrows()
	{
		var top = div_p_top.getElementsByTagName('a')[0];
		var tomimg = top.getElementsByTagName('img')[0];
		var btm = div_p_btm.getElementsByTagName('a')[0];
		var btmimg = btm.getElementsByTagName('img')[0];
		top.title = "Прокрутить вверх";
		btm.title = "Прокрутить вниз";
		var s_int;
		var ati = document.getElementById("arrow_top_img");
		var abi = document.getElementById("arrow_bttm_img");
		var abr = document.getElementById("arrow_bttm_reflect");
		var mw = new c_MouseWheel(div_p,function(wd){
			c_ul.scrollTop -= wd*5;
			if (c_ul.scrollTop == (c_ul.scrollHeight-299)) abi.className = abr.className = "disabled";
			else if (c_ul.scrollTop == 0) ati.className = "disabled";
			else ati.className = abi.className = abr.className = "active";
		});
		btm.onclick = function() { c_ul.scrollTop = c_ul.scrollHeight-299; return false;};
		top.onclick = function() { c_ul.scrollTop = 0; return false;};
		btm.onmouseover = function(){ if(s_int) s_int = clearInterval(s_int); s_int = setInterval(function(){ c_ul.scrollTop += 3;abr.className = "hovered";if (c_ul.scrollTop == (c_ul.scrollHeight-299)){abi.className = "disabled";abr.className = "disabled";};ati.className = "active"},10)};
		top.onmouseover = function(){ if(s_int) s_int = clearInterval(s_int); s_int = setInterval(function(){ c_ul.scrollTop -= 3;if (c_ul.scrollTop == 0){ati.className = "disabled"};abi.className = "active";abr.className = "active"},10)};
		btm.onmouseout = top.onmouseout = function(){clearInterval(s_int); if (c_ul.scrollTop != (c_ul.scrollHeight-299))abr.className = "active"};
	}
	function create_html()
	{
		var cre_html = document.createElement('div');
		cre_html.innerHTML = '<div id="grass_container"><table><tr><td id="grass1"><div></div></td><td id="grass2"><div></div></td></tr></table></div><div id="portfolio"><div id="years"></div><div id="projects_bg"></div><div id="projects"><div id="arrow_top"><a href="#"><span id="arrow_top_img" class="disabled"></span></a></div><div id="arrow_bttm"><a href="#"><span id="arrow_bttm_img" class="active"></span></a><div id="arrow_bttm_reflect" class="active"></div></div></div><div id="projects_shadow"></div><div id="desc_bg"></div><div id="desc"></div></div>';

		for(var i=0;i<cre_html.childNodes.length;i++)
			pf_c.appendChild(cre_html.childNodes[i].cloneNode(true));
		delete cre_html;


/*filter field  |  begin*/
		add_html = document.getElementById('portfolio').appendChild(document.createElement('div'));
		add_html.id = 'pf_filter_field';
		add_html.style.display = 'none';
		close_btn = add_html.appendChild(document.createElement('a'));
		close_btn.id = 'pf_filter_close';
		close_btn.onclick = function(param)
		{
			if(document.getElementById('active_filter'))
				document.getElementById('active_filter').id = '';
			document.getElementById('pf_filter').className = '';
			add_html.style.display = 'none';
			if(param != 'no'){
				year='top';
				years[year].select();
				nullProj();
			}
			return false;
		};
		close_btn.style.cursor = 'pointer';
		close_btn.title = 'Выключить фильтр';
		set_filter = add_html.appendChild(document.createElement('div'));
		set_filter.id = 'pf_filter_name';
/*filter field  |  end*/

	}
	
	function create_filter()
	{
		var cre_html = document.getElementById('portfolio').appendChild(document.createElement('div'));
		cre_html.innerHTML ='<a href="#">фильтр</a>'; /*КУКИ НАДА для selected!!!*/
		cre_html.id = 'pf_filter';
		var pf_items = cre_html.appendChild(document.createElement('div'));
		pf_items.id = 'pf_items_id';
		pf_items.className = 'pf_items';
		pf_items.style.display = 'none';
		var button = cre_html.getElementsByTagName('a')[0];
		var items = false;
		var curentitem = false;
		var prj_ul = false;		
		var self=this;
		var filter_close_flag;
		var filter_items = {};
		self.as = {};
		
		//prj_ul = div_p.insertBefore(document.createElement('ul'), div_p_btm);
		
		button.onclick = function(){ return false; }
		button.onmouseover = pf_items.onmouseover = function(){ clearTimeout(filter_close_flag); show(); return false; }
		button.onmouseout = pf_items.onmouseout = function(){ filter_close_flag = setTimeout(hide,200); return false; }

		this.loaditems = loaditems;
		function loaditems(func)
		{
			var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			xml.open("GET", path + "pf.php?m=5" , true);
			xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
			xml.setRequestHeader("Accept","*/*");
			xml.onreadystatechange = function(){
			if ( xml.readyState == 4 ) 
				if ( xml.status == 200)
				{
					items=true;
					pf_items.innerHTML='<div class="t"></div><div class="m">'+xml.responseText+'</div><div class="b"></div>';					
					show();
					inititems();
					if(func) func();
				}
			};
			xml.send(null);
		}
		
		function inititems()
		{
			var a = pf_items.getElementsByTagName('a');
			for(var i=0;i<a.length;i++){
				a[i].onclick = function(){ 					
					return item_click(this.attributes['group'].value, function(){self.as[pf['filter'][0][0]+'_top'].on_click();}, this.attributes);
				};
				a[i].onmousedown = function(){
					return false;
				};
//				filter_items[a[i].innerHTML] = a[i];
				filter_items[a[i].attributes['group'].value] = a[i];
			}
		}
		this.item_click = item_click;
		function item_click(name,func,attr)
		{
			if(years[s_y] && s_y!='filter') years[s_y].unselect();
			prev_s_y = s_y;
			s_y = 'filter';

			hide();
			if(document.getElementById('pf_filter').className == 'filter_active')
				if(document.getElementById('active_filter'))
					document.getElementById('active_filter').id = '';


			if((!filter_items[name]) || (name == ''))
			{
				document.getElementById('pf_filter_close').onclick();
				nullProj();
				return false;
			}
			
			filter_items[name].parentNode.id = 'active_filter';
			document.getElementById('pf_filter').className = 'filter_active';

			if(!prj_ul)
				prj_ul = div_p.insertBefore(document.createElement('ul'), div_p_btm);

			if(attr === false){
				prj_ul.innerHTML ='';
				get_pf_list(name,func);
				attr['group'].value = curentitem;
			}

			if(!attr){
				prj_ul.innerHTML ='';
				get_pf_list(name,func);
			}
			else
			if(curentitem != attr['group'].value)
			{
				prj_ul.innerHTML ='';
				get_pf_list(name,func);
				curentitem = attr['group'].value;
			}
			prj_ul.className = prj_ul.className.replace(/hidden/ig, '');
			c_ul = prj_ul;
			
			
			document.getElementById('years').childNodes[0].childNodes[0].className = "selected";
			document.getElementById('years').childNodes[0].childNodes[1].childNodes[0].src = "portfolio/ru/top/selected.gif";

			document.getElementById('pf_filter_field').style.display = 'block';

//			switch (attr['cat'].value)
			switch (filter_items[name].attributes['cat'].value)
			{
				case "prj":
					fill = '<span class="red">Тип проекта:</span> '; break;
				case "otr":
					fill = '<span class="red">Отрасль:</span> '; break;
				default: fill = '';
			}

			document.getElementById('pf_filter_name').innerHTML = fill+filter_items[name].innerHTML;
			filter_close_flag = true;
			return false;
		}
		
		function init_prjcs(func)
		{
			/*for(var k=0; k<as.length; k++)
				delete as[k];*/
			delete self.as;
			self.as = {};
			for(var k=0; k<pf['filter'].length; k++) {
				self.as[ pf['filter'][k][0]+'_'+pf['filter'][k][1] ] = new Prj(pf['filter'][k][0], pf['filter'][k][1], prj_ul);
				self.as[ pf['filter'][k][0]+'_'+pf['filter'][k][1] ].aj_init(pf['filter'][k][2]);
			}
			if(func) func();
		}
		
		function get_pf_list(name,func)
		{
			var ieshit = '&br=norm';
			if ('\v'=='v') ieshit = "&br=ie";
			var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			xml.open("GET", path + "pf.php?m=6"+ieshit+"&name="+name, true);
			xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
			xml.setRequestHeader("Accept","*/*");
			xml.onreadystatechange = function(){
				if ( xml.readyState == 4 ) 
					if ( xml.status == 200)
					{
						var tmp = eval(xml.responseText);						
						if(!tmp) return false;
						pf['filter'] = tmp;
//pr(pf['filter']);								
						init_prjcs(func);
					}
			};
			xml.send(null);
		}
		
		/*function get_p_list()
		{						
			var li;								
			for(var k=0; k<pf[year].length; k++)			
				as[ as.length ] = new Prj(as.length);
							
			init_prjcs_links();	  
		}*/
		
		function show()
		{
			if(!items) 
				loaditems();
			else
			{
				pf_items.style.display='';
//				button.className='selected';
			}	
		}
		function hide()
		{
			clearTimeout(filter_close_flag);
			document.getElementById('pf_items_id').style.display='none';		
		}
		
		this.unselect = unselect; function unselect()		
		{ 
//			button.className = '';
			//if(prj_ul.className.search('hidden'))
			prj_ul.className +=' hidden';
		}
		this.getcuritem = gcu; function gcu() {return curentitem;}
	}
	this.create_filter = create_filter;
	initHashHandler();
}

function c_MouseWheel(dome,func)
{
	if(typeof(dome) == "string")
		dome = document.getElementById(dome);
	if(!dome) return;

	if(dome.addEventListener)
	{

		dome.addEventListener('DOMMouseScroll', callback, false);
		dome.addEventListener('mousewheel', callback, false);
	}
	else if(dome.attachEvent)
	{
		dome.attachEvent("onmousewheel", callback);
	}
	function callback(e)
	{
		e = e ? e : window.event;
		var wd = e.detail ? e.detail * -1 : e.wheelDelta / 40;
		func(wd, dome);
		return cancelEvent(e);
	}

	function cancelEvent(e)
	{
		e = e ? e : window.event;
		if(e.stopPropagation) e.stopPropagation();
		if(e.preventDefault) e.preventDefault();
		e.cancelBubble = true;
		e.cancel = true;
		e.returnValue = false;
		return false;
	}
	
	this.remove = remove;
	function remove()
	{
		if(dome.removeEventListener)
		{
			dome.removeEventListener('DOMMouseScroll', callback, false);
			dome.removeEventListener('mousewheel', callback, false);
		}else if(dome.detachEvent)
		{
			dome.detachEvent("onmousewheel", callback);
		}
	}
}