/* 
	DirtyKnickersOnline Core JavaScript Document
	October 2006
	Mike Hearfield
*/

	//============================================================== getelementbyid fix
	// fix that pesky document.all once and for, well, all...
	if(document.all && !document.getElementById) {
			document.getElementById = function(id) {
					 return document.all[id];
			}
	}
	//============================================================== 


	//============================================================== expandit function vars
	var arrowDown = new Image();
	arrowDown.src = "images/menu/arrowDown.gif";
	var arrowRight = new Image();
	arrowRight.src = "images/menu/arrowRight.gif";

  var openDivStyle = "subMenuTitleOpen";
  var closedDivStyle = "subMenuTitleClosed";
  var openSubStyle = "subMenuSubOpen";
  var closedSubStyle = "subMenuSubClosed";

	//   calls toggleSection function after a short delay so that images display correctly
	function expandIt(itemId){
		var arrowId = itemId.replace("Head", "Arrow");
		var bodyId = itemId.replace("Head", "Body");
		var contDiv = document.getElementById(itemId);
		var bodySpan = document.getElementById(bodyId);
		var arrow = document.getElementById(arrowId);

		if(bodySpan.className == closedSubStyle){
			arrow.src = arrowDown.src;
			contDiv.className = openDivStyle;
			bodySpan.className = openSubStyle;
			updateMenu('add',itemId);
		}else{
			arrow.src = arrowRight.src;
			contDiv.className = closedDivStyle;
			bodySpan.className = closedSubStyle;
			updateMenu('del',itemId);
		}
	}


	function expandIt_silent(itemId){
		var arrowId = itemId.replace("Head", "Arrow");
		var bodyId = itemId.replace("Head", "Body");
		var contDiv = document.getElementById(itemId);
		var bodySpan = document.getElementById(bodyId);
		var arrow = document.getElementById(arrowId);

		if(bodySpan.className == closedSubStyle){
			arrow.src = arrowDown.src;
			contDiv.className = openDivStyle;
			bodySpan.className = openSubStyle;
		}else{
			arrow.src = arrowRight.src;
			contDiv.className = closedDivStyle;
			bodySpan.className = closedSubStyle;
		}
	}
//============================================================== 
