/*
	© 2003-2008 by www.undef.de, Michael Diekmann
	Do not remove or change these copyright!

	If you wish to use this javascript-code, so feel free to contact
	us!
*/

  //---------------------------------------------------------------------//
 // Bubbles								//
//---------------------------------------------------------------------//

	function init_bubble(wait) {
		interval = wait * 1000;

		activ = false;
		open_bubble = false;

		isNetscape4 = false;
		isNetscape5 = false;
		isOpera7 = false;
		isExplorer4 = false;
		isSupported = true;

		BrowserVar = parseFloat(navigator.appVersion);

//		alert(navigator.userAgent +" - "+ BrowserVar +" - "+ navigator.appName);
		if (navigator.appName == "Netscape") {
			if ((BrowserVar > 4) && (BrowserVar < 5)) {
				isNetscape4 = true;
			}
			else if (BrowserVar >= 5) {
				isNetscape5 = true;
			}
			else {
				isSupported = false;
			}
		}
		else if (navigator.appName == "Opera") {
			if (BrowserVar >= 7) {
				isOpera7 = true;
			}
			else {
				isSupported = false;
			}
		}
		else if ((navigator.appName == "Microsoft Internet Explorer") || (navigator.appName == "MSIE")) {
			if (BrowserVar >= 4) {
				isExplorer4 = true;
			}
			else {
				isSupported = false;
			}
		}
		else {
			isSupported = false;
		}
		bubble_off();
	}

	function bubble_on(design_class,text) {
		x_position = (document.body.offsetWidth ? document.body.offsetWidth : document.body.style.pixelWidth) - 230;
		y_position = 10;

		var html_out = '<table border="0" width="200" cellspacing="0" cellpadding="2" bgcolor="E7E6CB" onMouseOver="open_bubble=1" onMouseOut="open_bubble=0"><tr><td><table border="0" width="100%" cellspacing="0" cellpadding="5" class="'+ design_class +'"><tr><td class="bubble">'+ text +'</td></tr></table></td></tr></table>';
		if (isNetscape4) {
			with (document.bubble.document) {
				open();
				write(html_out);
				close();
			}
			document.bubble.left = x_position;
			document.bubble.top  = y_position;
			document.bubble.visibility = "SHOW";
		}
		else if (isNetscape5) {
			document.getElementById("bubble").firstChild.deleteData(0, 50000);
			document.getElementById("bubble").firstChild.insertData(0, html_out);
			document.getElementById("bubble").style.left = x_position;
			document.getElementById("bubble").style.top  = y_position;
			document.getElementById("bubble").style.visibility = "SHOW";
		}
		else if (isOpera7) {
			bubble.style.left = x_position;
			bubble.style.top  = y_position;
			document.all.bubble.innerHTML = html_out;
			bubble.style.visibility = "visible";
		}
		else if (isExplorer4) {
			bubble.style.left = x_position;
			bubble.style.top  = y_position;
			document.all.bubble.innerHTML = html_out;
			bubble.style.visibility = "visible";
		}

		if (isSupported == true) {
			open_bubble = 1;
			if (activ) {
				window.clearInterval(activ);
			}
			activ = window.setInterval("bubble_off()",interval);
		}
	}

	function bubble_off() {
		if ((open_bubble == 0) && (isSupported == true)) {
			if (isNetscape4) {
				document.bubble.visibility = "HIDE";
			}
			else if (isNetscape5) {
				document.getElementById("bubble").firstChild.deleteData(0,50000);
				document.getElementById("bubble").style.visibility = "HIDE";
			}
			else if (isOpera7) {
				bubble.style.visibility = "hidden";
			}
			else if (isExplorer4) {
				bubble.style.visibility = "hidden";
			}
			window.clearInterval(activ);
		}
	}

	function cancel_bubble() {
		open_bubble = 0;
	}

  //---------------------------------------------------------------------//
 // Beats								//
//---------------------------------------------------------------------//

	function startbeats() {
		taddr = 0;
		if (navigator.appVersion.substring(0,1) >= 4) {
			if (taddr == 0) {
				prttime();
				taddr = setInterval("prttime()",125);
			}
		}
	}

	function stopbeats() {
		if (taddr != 0) {
			clearInterval(taddr);
			taddr = 0;
		}
	}

	function prttime() {
		time = new Date();
		year = time.getYear();
		if (year < 1900) {
			year += 1900;
		}
		mon = time.getMonth();
		date = time.getDate();
		diffmin = time.getTimezoneOffset();
		time2 = new Date(year,mon,date);
		time2 = time - time2;
		beats = (time2 + diffmin * 60000 + 3600000) / 86400;
		if (beats < 0) {
			beats += 1000;
		}
		beats = Math.round(beats * 100);
		beats2 = beats % 100;
		beats = (beats - beats2) / 100;
		if (beats == 1000) {
			beats = 0;
		}
		if ((beats < 100 ) && (beats >= 10)) {
			beats = "0" + beats;
		}
		if (beats < 10 ) {
			beats = "00" + beats;
		}
		if (beats2 < 10) {
			beats2 = "0" + beats2;
		}
		document.getElementById("beats").firstChild.nodeValue = "@" + beats + "://" + beats2;
	}

