/* 
** Checks the current state of the passed element (el) against the required state (state).
** Expands the height of the resourses content div to show content if state is "expand",
** Sets the height of the resources content div to 100px if state is "contract".
**
** Called from the resource toolbar using:
**		onclick="toggleResourceState(this.parentNode.parentNode,'contract');return false".
*/

function toggleResourceState(el,state){
	for(var j=0;j<el.childNodes.length;j++){
		if(el.childNodes[j].className == "dropcontent"){
			if(state == "expand"){
				el.style.height = String(el.childNodes[j].offsetHeight+68)+"px";
			}else if(state == "contract"){
				el.style.height = "80px";
			}
		break;
		}
	}
	// replace the marginalia
	placeMarginalia();
}
	
function newResourceWindow(theURL,winName){
	
	newWindow = window.open(theURL,winName,'scrollbars=yes,resizable=yes,width=545,height=500');
	newWindow.focus();
}

function launchStoryWindow(theURL,winName){
	newWindow = window.open(theURL,winName,'scrollbars=yes,resizable=yes,width=610,height=440');
	newWindow.focus();
}

function galleryImgPop(theURL,winName){
	newWindow = window.open(theURL,winName,'scrollbars=no,resizable=no,width=272,height=400');
	newWindow.focus();
}

