function custom(){
	$$('label.check').each(function(e){

		var ec = e.firstChild;
		function check(el){
			var tmp = (el.firstChild.checked)?"_on":"_off";
			return "check "+ec.type + tmp;
		}
		e.className = check(e);
		e.style.cursor = 'pointer';
		ec.style.display = 'none';
		
		e.addEvent('click',function(el){
			var chi = this.firstChild;
			if(!chi.checked || chi.type != 'radio')	chi.checked = !chi.checked;
					
			if(chi.type != 'radio'){
				this.className = check(this);
			}
			else{
			$$('label.check').each(function(j){
					if(j.firstChild.type == 'radio') j.className = check(j);
				});
			}
			if(this.firstChild.id == 'chk_all'){
				$$('.chk_all').each(function(elem){
					elem.checked = $('chk_all').checked;
					tmp = $('chk_all').checked?"_on":"_off";
					elem.parentNode.className = "check checkbox"+tmp;
				});
			}
			
		});
		
		
		if(ec.type == 'radio'){
				e.addEvent('mouseenter',function(){
					e.className = 'check '+ec.type+'_on';
				});
				e.addEvent('mouseleave',function(){
					if(!ec.checked)
						e.className = 'check '+ec.type+'_off';
				});
		}
		
		if($('idejne-rrr')){
			$$('img.cp img-ideje').each(function(elim){
				elim.addEvent('click',function(){
					if (ec.id=='amb-'+ec.value){
						if (elim.id=='img-'+ec.value){
							$('amb-'+ec.value).checked=true;
							e.className = 'check '+ec.type+'_on';
							if($('solutions_left'))
								(function(){
									new Ajax(mppath+'/template/tpl_solutions_search.php',{ data: $('solutions_form'), update: $('solutions_left') }).request();
							}).delay(100);
						}else{
							$('amb-'+ec.value).checked=false;
							e.className = 'check '+ec.type+'_off';
						}
					}
				});
				elim.addEvent('mouseenter',function(){
					if (elim.id=='img-'+ec.value){
						e.className = 'check '+ec.type+'_on';
					}
				});
				elim.addEvent('mouseleave',function(){
					if (!ec.checked){
						if (elim.id=='img-'+ec.value){
							e.className = 'check '+ec.type+'_off';
						}
					}
				});
			});
		}
	});
}
function activate_button_sr(id){
	document.getElementById('sr1').src=mppath+'/template/images/sr_butt_01_off.gif';
	document.getElementById('sr2').src=mppath+'/template/images/sr_butt_02_off.gif';
	document.getElementById('sr3').src=mppath+'/template/images/sr_butt_03_off.gif';
	document.getElementById('sr4').src=mppath+'/template/images/sr_butt_04_off.gif';
	document.getElementById('sr'+id).src=mppath+'/template/images/sr_butt_0'+id+'_act.gif';
	document.getElementById('b1x').style.display='none';
	for (i=1; i<=4; i++){
		if(i==id){
			document.getElementById('src-holder'+i).style.display='block';
		}else{
			document.getElementById('src-holder'+i).style.display='none';
		}
	}
}
step=2
topOfScroll = 0

//start updated scrolldiv
function makeScrollbar(content){//requires mootools + scrollDiv function - usage makeScrollbar(id);
			$(content).addEvent('mousewheel', function(e){
				var e = new Event(e)
				scrollDiv(content,15*(e.wheel*-1));	//15 is the scroll speed, change at your liking
				e.stop();
			});
			$(content).addEvent('mouseleave',function(){stopMe();});
}

function scrollDiv(id,nu_step){
clearTimeout(timerDown);
document.getElementById(id).scrollTop+=nu_step;
timerDown=setTimeout("scrollDiv('"+id+"',"+nu_step+")",5);
topOfScroll = document.getElementById(id).scrollTop;
} 
//end updated scrolldiv


function scrollDivDown(id){
clearTimeout(timerDown);
document.getElementById(id).scrollTop+=step;
timerDown=setTimeout("scrollDivDown('"+id+"')",5);
topOfScroll = document.getElementById(id).scrollTop;
} 


function scrollDivUp(id){
clearTimeout(timerUp),
document.getElementById(id).scrollTop-=step; 
timerUp=setTimeout("scrollDivUp('"+id+"')",5);
topOfScroll = document.getElementById(id).scrollTop;
} 

function scrollDivLeft(id){
  clearTimeout(timerLeft); 
  document.getElementById(id).scrollLeft-=step;
  timerLeft=setTimeout("scrollDivLeft('"+id+"')",5);
}

function scrollDivRight(id){
  clearTimeout(timerRight);
  document.getElementById(id).scrollLeft+=step;
  timerRight=setTimeout("scrollDivRight('"+id+"')",5);
}

timerDown=""; 
timerUp=""; 
timerLeft=""; 
timerRight=""; 

function stopMe(){
clearTimeout(timerDown); 
clearTimeout(timerUp);
}

function stopIt(){
clearTimeout(timerLeft); 
clearTimeout(timerRight);
}

document.onmousemove=function(){stopMe();}  

function comp(show,n) {
	for (var i=0; i<n; i++){
		if (i==show){
			document.getElementById('com'+i).style.display='block';
		}else{
			document.getElementById('com'+i).style.display='none';
		}
	}
}

function stevilke_revije()
{
	if($('stevilke_revije'))
	{
		var div=$('stevilke_revije');
		for(var i=0;1;i++)
		{
			var toggler=div.getFirst('h3');
			//var toggled=div.getFirst('div');
			for(var j=0;j<i;j++)
			{
				//var toggled2=toggled;
				var toggler2=toggler;
				if(toggler2.getNext('h3'))
				{
					toggler=toggler2.getNext('h3');
					//toggled=toggled2.getNext('div');	
				}
				else
				{
					var napaka=1;
					break;
				}
			}
			if(napaka==1)
			{
				break;
			}
			else
			{
				toggler.style.cursor='pointer';
				toggler.addEvent('click',function(){
					if(this.getNext('div').style.display=='block')
					{
						this.getNext('div').style.display='none';
					}
					else
					{
						this.getNext('div').style.display='block';
					}
				});
			}
		}
	}
}