// ------------------------------------------------------------------
// javacript to change ccs style class 
// ------------------------------------------------------------------
// Works only on ellement with defined (id="somename") 
// Call like the element : 
// onMouseOut="chclass('this', 'def_class'); onMouseOver="change('this', 'over_class');

	function chclass(id, newClass)
	{
		identity=document.getElementById(id);
		identity.className=newClass;
	}
// ------------------------------------------------------------------

// ------------------------------------------------------------------

function blurLink(what) {}



/** Geometrien */
// script
function cshow2(thisid,subAnzahl)
{ 
	var divid = "geo"+thisid;
	if (document.getElementById(divid).style.display=="inline")
	{ 
		//document.getElementById(divid).style.display="none";
	} else { 
		document.getElementById(divid).style.display="inline";
	} 
	for (i=1; i<=subAnzahl; ++i) 
	{ 
		if ("geo"+i!=divid) 
		eval ('document.getElementById("geo' + i + '").style.display="none"'); 
	} 
} 



// ------------------------------------------------------------------
// TOGGLE FADE IN OUT
// ------------------------------------------------------------------


var startFaded = '';

function toggleFadeInElement(id,otherids) {
	var carray = otherids.split(',');
	var speed = '70';
	document.getElementById(id+'-content-new').innerHTML = document.getElementById(id+'-content').innerHTML;
// INIT THE SLIMBOX BECAUSE OF INNERHTML
	Slimbox.scanPage(); 
	if (startFaded=='') {
		startFaded=id;	
		for (var i = 0; i < carray.length; ++i) {
			var hideElements = document.getElementById(carray[i]);
//alert(document.getElementById(carray[i]).className);
//			if(document.getElementById(carray[i]).style.display=='none'){
			if(document.getElementById(carray[i]).className=='startref-content'){
//				if(document.getElementById(id).style.display == 'none'){
				if(document.getElementById(id).className=='startref-content'){
					fadeIn(id, speed);
//					startFaded=id;
//alert(id+' '+startFaded);
				}
			} 
		}
	} else if(id == startFaded){
//alert('fadeout sf '+startFaded+' ID '+id);
		startFaded='';
		fadeOut(id, speed);
	} else if(id != startFaded && startFaded!=''){
		document.getElementById(startFaded).style.display = 'none';
		document.getElementById(id).style.display = 'block';
		document.getElementById(id).style.opacity = 100;
		document.getElementById(id).style.filter = "alpha(opacity = 100)";
//		fadeOut(startFaded, '500');
//		fadeIn(id,speed);
		fadeIn(id+'-content-new', speed);
//		fadeIn2(id,speed);
		startFaded=id;
//alert('stay sf '+startFaded+' ID '+id);
	}
}



function fadeIn(id, speed) {
	startFaded=id;
    var thisE = document.getElementById(id);
    thisE.style.display = "block";
    thisE.style.zoom = 1; //needed for IE
    thisE.style.opacity = 0;
    thisE.style.filter = "alpha(opacity = 0)";
    speed = speed/20;
    var i = 0;
    var intervalId = setInterval(function() {
        if(i <= 100) {
            thisE.style.opacity = i/100;
            thisE.style.filter = 'alpha(opacity='+i+')';
            i += 5;
        } else {
            setTimeout(function() {thisE.style.display = "block";}, speed);
            clearInterval(intervalId);
            return false;
        }
    }, speed);
}
function fadeIn2(id, speed) {
	startFaded=id;
    var thisE = document.getElementById(id);
    thisE.style.display = "block";
    thisE.style.opacity = 100;
    thisE.style.filter = "alpha(opacity = 100)";

}



function fadeOut(id, speed) {
	startFaded='';
    var thisE = document.getElementById(id);
    thisE.style.zoom = 1; //needed for IE
    speed = speed/20;
    var i = 100;
    var intervalId = setInterval(function() {
        if(i>=0) {
            thisE.style.opacity = i/100;
            thisE.style.filter = 'alpha(opacity='+i+')';
            i -= 5;
        } else {
            setTimeout(function() {thisE.style.display = "none";}, speed);
            clearInterval(intervalId);
            return false;
        }
    }, speed);
}


/**
* 
**/
function openWhichTab() {
	document.getElementById('contentTabs').tabber.tabShow(4);
}