function myBox(text)
{
	var box=newElement('div');
	var pre=newElement('pre');
	var button=newElement('button');

	pre.innerHTML=text;
	button.innerHTML='OK';
	cls.add(box,'box');
	evt.add(button,'click',myBoxClose,false);

	box.appendChild(pre);
	box.appendChild(newElement('br'));
	box.appendChild(button);
	document.body.appendChild(box);
}

function myBoxClose(e)
{
	e=evt.fix(e);
	var box=e.target.parentNode;
	if(!cls.has(box,'box'))return false;

	box.parentNode.removeChild(box);
	return false;
}

function alertProps(obj,useAlert)
{
	var type=typeof obj;
	var str='Properties of '+obj+'('+(type)+')'+'\n';
	if(type=='string')
		str+=obj;
	else
	{
		for(var prop in obj)
		{
			try{str+=prop+'('+(typeof obj[prop])+')='+obj[prop]+'\n';}
			catch(e){str+='<span class="error exception">exception(obj '+prop+') '+e+'</span>\n';}
		}
	}
	if(useAlert)alert(str);
	else myBox(str);
}

