/**
 *	misc.js -> http://locusonus.org/
 */


function dump( elem ) {
	document.getElementById('doc_dump').style.display = !elem ? 'none' : 'block';
	if ( elem )
		document.getElementById('doc_dump').innerHTML = 
		document.getElementById(elem).innerHTML;
}

function popup( url, win, param ) {
	window.open(
		url,
		win,
		"left="+((screen.availWidth-param.width)/2)+","+
		"top=0,"+
		"toolbar=no,"+
		"location=0,"+
		"directories=0,"+
		"resizable="+param.resizable+","+
		"menubar=0,"+
		"status=0,"+
		"scrollbars="+param.scrollbars+","+
		"width="+param.width+","+
		"height="+param.height
	);
}


/**
 * Show / hide the element defined bu the given id
 *
 * @param String	the element ID, or a list of element id
 * @param String	[ the display style : block(default), inline, etc… ]
 * @param boolean	[ force the element to stay in the given style (false by default)  ]
 */
function display( id, style, fix ) {

	if ( !style ) style = "block";
	if ( !fix ) fix = false;
	if ( typeof(id)=="string" ) id = [id];
	
	for( var i in id  )
		document.getElementById(id[i]).style.display= 
			document.getElementById(id[i]).style.display== style && !fix ? 'none' : style;
}

