function jsunit()
{
	return 'it works';
}

function box_close()
{
	$("#dh_box").hide();
	$("#dh_box").remove();
}

function show_url( url )
{
	
	// add box
	
	if( $("#dh_box").length == 0 )
		$('<div id="dh_box"></div>').appendTo(document.body);
	
	// show box div
	
	$('#dh_box').html( '<p><center><img src="static/image/loading.gif"/></center></p>' );

	
	pos_it( $('#dh_box') , 'center' );
	$('#dh_box').css({ 'width':'90','height':'90','left':$(window).width()/2,'top':150 }  );
	$('#dh_box').animate( {'backgroundColor': '#fff', 'width': 650, 'height':340,'left':$(window).width()/2-335,'top':100 }, 500);
	
	$('#dh_box').load( url );
	/*$('#dh_box').css( 'top' , '120px' );
	*/


	
}



function pos_it( obj , pos )
{
	var wnd = $(window);
	doc = $(document);
	pTop = doc.scrollTop();
	pLeft = doc.scrollLeft();
	minTop = pTop;

	if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) 
	{
		pos = [
			pos == 'right' || pos == 'left' ? pos : 'center',
			pos == 'top' || pos == 'bottom' ? pos : 'middle'
		];
	}
	if (pos.constructor != Array)
	{
		pos = ['center', 'middle'];
	}
	if (pos[0].constructor == Number) 
	{
		pLeft += pos[0];
	}
	 else 
	{
		switch (pos[0]) 
		{
			case 'left':
				pLeft += 0;
				break;
			case 'right':
				pLeft += wnd.width() - $(obj).outerWidth();
				break;
			default:
			case 'center':
				pLeft += (wnd.width() - $(obj).outerWidth()) / 2;
		}
	}
	
	if (pos[1].constructor == Number) 
	{
		pTop += pos[1];
	} else 
	{
		switch (pos[1]) 
		{
			case 'top':
				pTop += 0;
				break;
			case 'bottom':
				pTop += wnd.height() - $(obj).outerHeight();
				break;
			default:
			case 'middle':
				pTop += (wnd.height() - $(obj).outerHeight()) / 2;
		}
	}

	// prevent the dialog from being too high (make sure the titlebar
	// is accessible)
	pTop = Math.max(pTop, minTop);
	$(obj).css({top: pTop, left: pLeft});
	
}





