var IE7 = (navigator.appVersion.indexOf('MSIE 7.') != -1 );
var IE6 = (navigator.appVersion.indexOf('MSIE 6.') != -1 );
num=1;
next = 2;
var t;

	image0=new Image();
	image0.src="tristream/images/slide_ux_ix.jpg";
	image1=new Image();
	image1.src="tristream/images/slide_ui.jpg";
	image2=new Image();
	image2.src="tristream/images/slide_code.jpg";
	image3=new Image();
	image3.src="tristream/images/slide_marcom.jpg";
	
	image4=new Image();
	image4.src="tristream/images/title_ux_ix.jpg";
	image5=new Image();
	image5.src="tristream/images/title_ui.jpg";
	image6=new Image();
	image6.src="tristream/images/title_code.jpg";
	image7=new Image();
	image7.src="tristream/images/title_marcom.jpg";

function slideshow() {
	t=setTimeout("change(2)",10000);
}

function change(number) {
	clearTimeout(t);
	old = num;
	num = number;
	next = parseInt(num)+1;
	if (next > 5) { next = 1; }
	
	if (IE7 || IE6) {
		$(function(){ $('#' + "slide" + old).fadeOut('slow', function() {this.style.removeAttribute('filter'); }); });
		$(function(){ $('#' + "slide" + num).fadeIn('slow', function() {this.style.removeAttribute('filter'); }); });
		$(function(){ $('#' + "title" + old).fadeOut('slow', function() {this.style.removeAttribute('filter'); }); });
		$(function(){ $('#' + "title" + num).fadeIn('slow', function() {this.style.removeAttribute('filter'); }); });
	} else {
		$(function(){ $('#' + "slide" + old).fadeOut('slow'); });
		$(function(){ $('#' + "slide" + num).fadeIn('slow'); });
		$(function(){ $('#' + "title" + old).fadeOut('slow'); });
		$(function(){ $('#' + "title" + num).fadeIn('slow'); });
	}
	
	if (old == 1) { document.getElementById("button1").className="button_left"; }
	else { document.getElementById("button"+old).className="button"; }
	
	if (num == 1) { document.getElementById("button1").className="button_on_left"; }
	else { document.getElementById("button"+num).className="button_on"; }
	if ( document.getElementById("pausePlay").className == "pause") {
		t=setInterval("change(next)",10000);
	}
}

function pausePlay() {
	clearTimeout(t);
	if ( document.getElementById("pausePlay").className == "pause") {
		document.getElementById("pausePlay").className="play";
	}
	else {
		document.getElementById("pausePlay").className="pause";
		change(next);
	}
}