function toggleLayer( whichLayer1, whichLayer2, whichLayer3 ){
	var elem1, vis1, elem2, vis2, elem3, vis3;
	//First element
	if( document.getElementById ) // this is the way the standards work
		elem1 = document.getElementById( whichLayer1 );
	else if( document.all ) // this is the way old msie versions work
		elem1 = document.all[whichLayer1];
	else if( document.layers ) // this is the way nn4 works
		elem1 = document.layers[whichLayer1];
	
	vis1 = elem1.style;
	
	// if the style.display value is blank we try to figure it out here
	//if(vis1.display==''&&elem1.offsetWidth!=undefined&&elem1.offsetHeight!=undefined)
		//vis1.display = (elem1.offsetWidth!=0&&elem1.offsetHeight!=0)?'block':'none';
	
	//vis1.display = (vis1.display==''||vis1.display=='block')?'none':'block';
	vis1.display = 'block';
	
	//Second element
	if( document.getElementById ) // this is the way the standards work
		elem2 = document.getElementById( whichLayer2 );
	else if( document.all ) // this is the way old msie versions work
		elem2 = document.all[whichLayer2];
	else if( document.layers ) // this is the way nn4 works
		elem2 = document.layers[whichLayer2];
	
	vis2 = elem2.style;
	vis2.display = 'none';
	
	//Third Element
	if( document.getElementById ) // this is the way the standards work
		elem3 = document.getElementById( whichLayer3 );
	else if( document.all ) // this is the way old msie versions work
		elem3 = document.all[whichLayer3];
	else if( document.layers ) // this is the way nn4 works
		elem3 = document.layers[whichLayer3];
	
	vis3 = elem3.style;
	vis3.display = 'none';
}

function toggleDocument( whichLayer1 ){
	var elem1, vis1;
	//First element
	if( document.getElementById ) // this is the way the standards work
		elem1 = document.getElementById( whichLayer1 );
	else if( document.all ) // this is the way old msie versions work
		elem1 = document.all[whichLayer1];
	else if( document.layers ) // this is the way nn4 works
		elem1 = document.layers[whichLayer1];
	
	vis1 = elem1.style;
	
	//if the style.display value is blank we try to figure it out here
	if(vis1.display==''&&elem1.offsetWidth!=undefined&&elem1.offsetHeight!=undefined)
		vis1.display = (elem1.offsetWidth!=0&&elem1.offsetHeight!=0)?'block':'none';
	
	vis1.display = (vis1.display==''||vis1.display=='block')?'none':'block';
	
	if (vis1.display==''||vis1.display=='block')
	{
		id = whichLayer1+'symbol';
		$(id).src="/public/images/lupe_minus.png";
	} 
	else 
	{
		id = whichLayer1+'symbol';
// 		alert(id);
		$(id).src="/public/images/lupe_plus.png";

	}
}




function showElement( id ) {
	element = document.getElementById( id );
	vis = element.style;
	vis.display='block';
}

function hideAllContents(myclass) {
	var idArray = $$('div.' + myclass);
	for(i=0;i<idArray.length;i++)
	{
		$(idArray[i]).style.display='none'; 
	}
}

function showAllContents(myclass) {
	var idArray = $$('div.' + myclass);
	for(i=0;i<idArray.length;i++)
	{
		$(idArray[i]).style.display='block'; 
	}
}


function confirmRecommendDocument(id,name){
//	alert (id + "  " +name);
	check = confirm("Skriptum "+ name + " wirklich empfehlen?");
	if (check) xajax_recommendDocument(id);
}

function confirmDeleteDocument(id,name){
//	alert (id + "  " +name);
	check = confirm("Skriptum "+ name + " wirklich entfernen?");
	if (check) window.location = "/document/remove/id/" + id;
	
	
}

function eval_terms_checkbox() {
	box = document.getElementById( 'terms_checkbox' );
	button = document.getElementById( 'register_submit' );
	
	if (box.checked == true) {
		button.disabled = false;
	} else {
		button.disabled = true;
	}
}


