// code by ricardo küster
// www.asgardcommunications.ch
// oct 2009

// SYSTEM

var xmlHttp

function GetXmlHttpObject() {
	var xmlHttp=null;
	try { // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest(); }
	catch (e) { //Internet Explorer
		try {
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }	
	}
	return xmlHttp;
}

var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
	browserType = "gecko"
}

// -----

function montrer(where) {
	if (document.getElementById(where).style.display == "none") {
		fade_in(where);
	} else {
		fade_out(where);
	}
}

function cacher(where) {
	document.getElementById(where).style.display = 'none';
}

// -----

var tempo = 15;

primeira_vez = true;

function fade_in(where) {
	i = 0;
	document.getElementById(where).style.opacity = 0;
	if (document.getElementById(where).style.display == 'none') {
		document.getElementById(where).style.display = "";
	}
	fade_in_var = window.setInterval("fade_in_app('"+where+"')", tempo);
}
function fade_in_app(where) {
	document.getElementById(where).style.opacity = i / 10;
	i++;
	if (i==10) {
		clearInterval(fade_in_var); 
		document.getElementById(where).style.opacity = 1;
	}
}

// -----

function fade_out(where) {
	i = 10;
	document.getElementById(where).style.opacity = 1;
	fade_out_var = window.setInterval("fade_out_app('"+where+"')", tempo);
}
function fade_out_app(where) {
	document.getElementById(where).style.opacity = i / 10;
	i--;
	if (i<=0) {
		clearInterval(fade_out_var);
		document.getElementById(where).style.display = "none";
		document.getElementById(where).style.opacity = 0;
	}
}

// -----