
// simple hide/show functions
function hide(obj) {
	document.getElementById(obj).style.display = "none";
}
function show(obj) {
	document.getElementById(obj).style.display = "block";
}
// function that flips the visibilty between hide/show depending on the current state
function flipme(obj) {
	if (document.getElementById(obj).style.display == "none") {
		document.getElementById(obj).style.display = "block";
	} else {
		document.getElementById(obj).style.display = "none";
	}
}

// for below functions to work a list of div ids must be supplied
// it will only allow one div to be open at anyone time
// handy when u dont want to have multiple divs expanded, which can push the page height
// often neater than having all divs open
function hideAll(divs) {
	dropBoxes = divs;
	dropBoxArray = dropBoxes.split(",")
	for(i=0;i<dropBoxArray.length;i++){
		hide(dropBoxArray[i])
	}
}
function flip(obj,divs) {
	if(obj != 0) {
		if(obj.length) {
			hideAll(divs);
			show(obj);
			//alert(divs);
		} 
	} else {
		hideAll(divs);
	}
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	} else {
		el.style.display = '';
	}
}

