var colLast = 1;
var num = 0;
var act = 1;
var t = 0;

function sliding(col,action) {
	if(action=="1") {
		stopSlideshow();
	}
	document.getElementById("l"+colLast).style.backgroundPosition = "0 0";
	document.getElementById("l"+col).style.backgroundPosition = "0 -12px";
	colLast = parseInt(col);
	var x = ((col-1)*-516)
	if (col =="1") var slider = new Fx.Tween('np', {duration:0});
		else var slider = new Fx.Tween('np', {duration:600});
	slider.start('left',x);
	var cur = "trigger"+col;
	$(cur).addClass('current');
	for(i=1;i<=8;i++) {
		var loopLI = "trigger"+i;
		if(cur==loopLI){}else{
				$(loopLI).removeClass('current');
		}
	}
}

var newwindow;
function chatwindow(url) {
  newwindow = window.open(url,"","height=400,width=400");
  if (window.focus) {newwindow.focus()}
}

var newwin;
function videoplayer(url,width,height) {
	newwin = window.open(url,"","height="+height+",width="+width);
  if (window.focus) {newwin.focus()}
}


function slide() {
	if(act<num) {
		act++;
	} else {
		act = 1;
	}
	sliding(act,'0');
}
function startSlideshow(nm) {
	num = parseInt(nm);
	t = setInterval("slide()",5000);
}
function stopSlideshow() {
	clearInterval(t);
}

