/* ---------------------------------------------------------------
   FILENAME:	sl.js
   CLIENT:		Rolf Aeschlimann - Möbelagentur
   PROJECT:		JavaScript Library Slide
   AUTHOR:		Urs Tobler  uto@bluewin.ch
   HISTORY:		2008-02-25	Initial Coding
   REVISION:	

   Copyright © 2008 Urs Tobler  uto@bluewin.ch
   --------------------------------------------------------------- */

function Slide() {
	oe = 5;
	se = 5;
	og = 0.05;
	sg = 0.05;
	d = document.getElementById("neu");
	if (document.all && navigator.userAgent.indexOf("Opera")==-1) t = window.setInterval("IncOE(oe)", 33);
	else t = window.setInterval("IncOG(og)", 33);
}

function IncOE(o) {
	if (oe <= 100) {
		d.filters.alpha.opacity = o;
		oe = oe + se;
	}
	if (oe > 100) {
		window.clearInterval(t);
		t = window.setTimeout("DisOE()",1000);
	}
}

function DisOE() {
	window.clearTimeout(t);
	t = window.setInterval("DecOE(oe)", 33);
}

function DecOE(o) {
	if (oe >= 5) {
		d.filters.alpha.opacity = o;
		oe = oe - se;
	}
	if (oe < 5) {
		window.clearInterval(t);
		Slide();
	}
}

function IncOG(o) {
	if (og <= 1) {
		d.style.opacity = o;
		og = og + sg;
	}
	if (og > 1) {
		window.clearInterval(t);
		t = window.setTimeout("DisOG()",1000);
	}
}

function DisOG() {
	window.clearTimeout(t);
	t = window.setInterval("DecOG(og)", 33);
}

function DecOG(o) {
	if (og >= 0.05) {
		d.style.opacity = o;
		og = og - sg;
	}
	if (og < 0.05) {
		window.clearInterval(t);
		Slide();
	}
}

