var divHoehe = 0;
var divToggle = -1;
var divHoehe = 0;
var divFinalHoehe = 0;
var count;

function startShowDiv(div) {
	if(divToggle == -1){
		count = 3;
		divHoehe = 0;
		divFinalHoehe = document.getElementById(div).scrollHeight;	
		divToggle = 1;
		showDiv(div);
	}
}

function startHideDiv(div) {
	if(divToggle == -1){	
		divFinalHoehe = document.getElementById(div).scrollHeight;		
		divHoehe = divFinalHoehe;	
		divToggle = 0;
		hideDiv(div);
	}
}
/*
function showDiv(div) {
	if(divToggle == 1) {
		document.getElementById(div + "More").style.display = "none";		
		document.getElementById(div + "Less").style.display = "block";		
		divBox = document.getElementById(div);
		if (divHoehe < (divFinalHoehe - 20)) {
			divBox.style.height = divHoehe + "px";	
			divHoehe = divHoehe + 20;
			setTimeout("showDiv('" + div + "')", 5);		
		} else {
			divHoehe = divFinalHoehe;
			divBox.style.height = divHoehe + "px";	
			divToggle = -1;
		}
	}
}
*/
function showDiv(div) {
//	alert(parseInt(40/(0.5*count)));
	if(divToggle == 1) {
		toAdd = parseInt(parseInt(divFinalHoehe/10)/(0.3*count))+1;
		document.getElementById(div + "More").style.display = "none";		
		document.getElementById(div + "Less").style.display = "block";		
		divBox = document.getElementById(div);
		if (divHoehe < (divFinalHoehe - toAdd)) {
			divBox.style.height = divHoehe + "px";	
			divHoehe = divHoehe + toAdd;
			if (navigator.appName.indexOf("Explorer") != -1){
			    divBox.style.filter = "Alpha(opacity="+2*count+")";			
			} else {
				divBox.style.opacity = 2*(count/100);
			}
			count++;
			setTimeout("showDiv('" + div + "')", 5);		
		} else {
			if (navigator.appName.indexOf("Explorer") != -1){
			    divBox.style.filter = "Alpha(opacity=100)";			
			} else {
				divBox.style.opacity = 1;
			}
			divHoehe = divFinalHoehe;
			divBox.style.height = divHoehe + "px";	
			divToggle = -1;
			count = 3;	
		}
	}
}


function hideDiv(div) {
	if(divToggle == 0) {
		toAdd = parseInt(parseInt(divFinalHoehe/10)/(0.3*count))+1;
		document.getElementById(div + "Less").style.display = "none";				
		document.getElementById(div + "More").style.display = "block";		
		divBox = document.getElementById(div);
		if (divHoehe > toAdd) {
			divBox.style.height = divHoehe + "px";	
			divHoehe = divHoehe - toAdd;
			if (navigator.appName.indexOf("Explorer") != -1){
			    divBox.style.filter = "Alpha(opacity="+2*(53-count)+")";			
			} else {
				divBox.style.opacity = 2*((53-count)/100);
			}
			count++;
			setTimeout("hideDiv('" + div + "')", 5);		
		} else {
			divHoehe = 0;
			divBox.style.height = divHoehe + "px";	
			divToggle = -1;		
			count = 3;			
		}
	}
}


