imgout=new Image(9,9);
imgin=new Image(9,9);
   imgout.src="graphics/show.gif";
imgin.src="graphics/hide.gif";

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			//filter(("img"+id),'imgin');			
		} else {
			//filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				//filter(("img"+id),'imgin');
			} else {
				//filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				//filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

/* 	DHTML expand and collapse div menu 
	*** in HTML ***
	<script src="scripts/expand.js"></script>
	<style type="text/css">
	a{
	cursor:pointer;
	}
	</style>
	<a onclick="switchMenu('myvar');">Show me...</a>
	<div style="display: none;" id="myvar">>
		Blah, blah, blah...
		Blah, blah, blah...
		Blah, blah, blah...
	</div>
*/
function switchMenu(obj) {
	var el = document.getElementById(obj);
	if (el.style.display != 'none'){
		el.style.display = 'none';
	}else{
		el.style.display = '';
	}
}


/* 	How to collapse all on page ‘load’
	If you’re wondering how to collapse any given amount of particular elements, 
	you can simply use this function in combination with the prototype $() dollar function and addEvent: */
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function collapseAll(objs) {
	var i;
	for (i=0;i<objs.length;i++ ) {
		objs[i].style.display = 'none';
	}
}
function pageLoad() {
	collapseAll($('myDiv1','myDiv2','myDiv3'));
}
addEvent(window,'load',pageLoad);

function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}