// JavaScript Document
/* function showhideID(elementid) {
	if (document.getElementById(elementid).style.display == 'none') {
		document.getElementById(elementid).style.display='';
	} else {
		document.getElementById(elementid).style.display='none';
	}
}*/

// show hide one div
function showhideID(elementid) {
	if ($(elementid).style.display == 'none') {
		$(elementid).style.display='';
	} else {
		$(elementid).style.display='none';
	}
}



function showhidechildren(elementid, styledisplay, depth) {
	var allChildren = elementid.childNodes;
	for (var counter = 0; counter <= allChildren.length-1; counter++) {
		if (allChildren[counter].nodeName == 'DIV') {
			// set the starting element id values of the div's we want to expand
			if (allChildren[counter].id.indexOf("groupInfo") == 0 || allChildren[counter].id.indexOf("groupCommunication") == 0 || allChildren[counter].id.indexOf("hw") == 0 || allChildren[counter].id.indexOf("news") == 0) {
				allChildren[counter].style.display = styledisplay;
			}
			showhidechildren(allChildren[counter], styledisplay, depth + 1);
		}
	}
	return true;
}



// show hide all client divs
function showhideallID(elementid, caller) {
	// check in what state is the current node, and then we will set all children to the same value
/*	if ($(elementid).style.display == 'none') {
		styledisplay = '';
	} else {
		styledisplay = 'none';		
	} */
	if (caller.innerHTML == '+') {
		caller.innerHTML = '-';
		styledisplay = '';		
	} else if (caller.innerHTML == '-') {
		caller.innerHTML = '+';
		styledisplay = 'none';				
	} else if (caller.innerHTML == 'Samo kazalo') {
		styledisplay = 'none';						
	}
	// we set visibility of the called element
	/*$(elementid).style.display = styledisplay;	*/
	var maxlevel = 0;
	return showhidechildren($(elementid), styledisplay, 0);
}