var n=1;
function opac() {
	var p=document.getElementById("panel");
	if (n<10) {n+=1;
		p.style.opacity =n/10;
		p.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+n*10+")";
		setTimeout("opac()",40);	
		} else {n=1;}
}


show = function(i,lis) {
	for (var j=0;j<lis.length; j++) {
		lis[j].style.display="none";
	}
	document.getElementById("panel").style.opacity =0.1;
	lis[i-1].style.display="block";

opac();

	if (i==lis.length) {document.getElementById("next").style.background="url(assets/templates/kn/img/n1n.gif)";document.getElementById("next").style.cursor="default";} else {document.getElementById("next").style.cursor="pointer";};
	if (i==1) {document.getElementById("prev").style.background="url(assets/templates/kn/img/n1p.gif)";document.getElementById("prev").style.cursor="default";} else {document.getElementById("prev").style.cursor="pointer";};

}

panelClick = function() {

	var lis = document.getElementById("panel").getElementsByTagName("div");
        var next = document.getElementById("next");
        var prev = document.getElementById("prev");
	var i = 1;

	lis[i-1].style.display="block";

	next.onclick = function() {if ((i>=1) && (i<lis.length)) {++i;show(i,lis);}}
	next.onmouseover = function() {if ((i>=1) && (i<lis.length)) {this.style.background="url(assets/templates/kn/img/n2n.gif)";}}
	next.onmousedown = function() {if ((i>=1) && (i<lis.length)) {this.style.background="url(assets/templates/kn/img/n3n.gif)";}}
	next.onmouseup = function() {if ((i>=1) && (i<lis.length)) {this.style.background="url(assets/templates/kn/img/n2n.gif)";}}
	next.onmouseout = function() {if ((i>=1) && (i<lis.length)) {this.style.background="url(assets/templates/kn/img/n1n.gif)";}}


	prev.onclick = function() {if ((i>1) && (i<=lis.length)) {--i;show(i,lis);};}
	prev.onmouseover = function() {if ((i>1) && (i<=lis.length)) {this.style.background="url(assets/templates/kn/img/n2p.gif)";}}
	prev.onmousedown = function() {if ((i>1) && (i<=lis.length)) {this.style.background="url(assets/templates/kn/img/n3p.gif)";}}
	prev.onmouseup = function() {if ((i>1) && (i<=lis.length)) {this.style.background="url(assets/templates/kn/img/n2p.gif)";}}	
	prev.onmouseout = function() {if ((i>1) && (i<=lis.length)) {this.style.background="url(assets/templates/kn/img/n1p.gif)";}}
}

onload = panelClick;


