var iconids = "icons";
var icons_toleft="icons_toleft";
var icons_toright="icons_toright";
var showitems = 6;
var startitem = 0;

function hideothers(){
	var icons=document.getElementById(iconids).getElementsByTagName("img");
	for(var t=0; t<icons.length; t++)
	{
		if(t>(showitems-1+startitem)||(t<startitem)){icons[t].style.display="none";} /* Hide images, which must to be hided */
		icons[t].onmouseover=function() /* show active image on mouseover */
		{
			a=this.src;
			a=a.substring(0, (a.length-7))+"act"+a.substring((a.length-4),a.length);
			this.src=a;
		}
		icons[t].onmouseout=function() /* show out image on mouseout */
		{
			a=this.src;
			a=a.substring(0, (a.length-7))+"out"+a.substring((a.length-4),a.length);
			this.src=a;
		}
		if (startitem<=(icons.length-showitems-1)) /* toright arrow become active if it needs */
		{
			b=document.getElementById(icons_toright).src;
			b=b.substring(0, (b.length-7))+"act"+b.substring((b.length-4),b.length);
			document.getElementById(icons_toright).src=b;
			document.getElementById(icons_toright).style.cursor="pointer";
		}
		if (startitem>=1) /* toleft arrow become active if it needs */
		{
			b=document.getElementById(icons_toleft).src;
			b=b.substring(0, (b.length-7))+"act"+b.substring((b.length-4),b.length);
			document.getElementById(icons_toleft).src=b;
			document.getElementById(icons_toleft).style.cursor="pointer";
		}
	}

	

	document.getElementById(icons_toleft).onclick=function()
	{
		if(startitem>0)
		{
			startitem--;
			for(var l=0; l<icons.length; l++)
			{
				if((l>=startitem)&&(l<(startitem+showitems))){icons[l].style.display="inline";}
				else {icons[l].style.display="none";}
			}
			if (startitem==0) /* toleft arrow become out if it needs */
			{
				b=this.src;
				b=b.substring(0, (b.length-7))+"out"+b.substring((b.length-4),b.length);
				this.src=b;
				this.style.cursor="auto";
			}
			if (startitem<=(icons.length-showitems-1)) /* toright arrow become active if it needs */
			{
				b=document.getElementById(icons_toright).src;
				b=b.substring(0, (b.length-7))+"act"+b.substring((b.length-4),b.length);
				document.getElementById(icons_toright).src=b;
				document.getElementById(icons_toright).style.cursor="pointer";
			}
		}
	}
	
	document.getElementById(icons_toright).onclick=function()
	{
		if(startitem<(icons.length-showitems))
		{
			startitem++;
			for(var l=0; l<icons.length; l++)
			{
				if((l>=startitem)&&(l<(startitem+showitems))){icons[l].style.display="inline";}
				else {icons[l].style.display="none";}
			}
			if (startitem==icons.length-showitems) /* toright arrow become out if it needs */
			{
				b=this.src;
				b=b.substring(0, (b.length-7))+"out"+b.substring((b.length-4),b.length);
				this.src=b;
				this.style.cursor="auto";
			}
			if (startitem>=1) /* toleft arrow become active if it needs */
			{
				b=document.getElementById(icons_toleft).src;
				b=b.substring(0, (b.length-7))+"act"+b.substring((b.length-4),b.length);
				document.getElementById(icons_toleft).src=b;
				document.getElementById(icons_toleft).style.cursor="pointer";
			}
		}
	}
}
	if (window.addEventListener)
	window.addEventListener("load", hideothers, false)
	else if (window.attachEvent)
	window.attachEvent("onload", hideothers)