/* Functions for manipulating DIV layers. */

function moveDIV( id, x, y ) {

	document.getElementById( id ).style.left = x;
	document.getElementById( id ).style.top = y;
}

function hideDIV( id ) {
	if ( document.getElementById( id ) != null ) {
		document.getElementById( id ).style.visibility="hidden";
	}
}

function showDIV( id ) {
	if ( document.getElementById( id ) != null ) {
		document.getElementById( id ).style.visibility="visible";
	}
}

// NOTICE THAT height argument is passed as string! e.g. '150'.
function sizeyDIV( id, height ) {
	document.getElementById( id ).style.height = height + 'px';
}


// Hides/shows relatively positioned layer. Does not work for absolutely positioned layers! 
// Show: layer is relative positioned and visible.
// Hide: layer is absolute positioned and hidden.
function toggleDIV( id ) {
	var obj = document.getElementById( id );

	if( (obj.style.position != 'relative') && (obj.style.position != 'absolute') ){
		obj.style.position = 'absolute';
	}	

	if ( obj.style.position == 'relative' ) {
		// currently shown, so take out of layers flow and not disturb page layout
		obj.style.position = 'absolute';
		hideDIV( id );
	}
	else {
		// currently hidden, so make relative to display in proper flow location
		obj.style.position = 'relative';
		showDIV( id );
	}

}

/* NOT SURE THIS WORKS 
function setDIVHTML( id, html ) {
	document.getElementById( id ).innerHTML = html;
}
*/

