var busy = new YAHOO.widget.SimpleDialog('pleaseWait', {
	width: '20em',
	height: '5em',
	fixedcenter: true,
	modal: false,
	draggable: false
	});

function show_busy()
{
	busy.setBody('Loading Preset...');
	busy.render(document.body);
	busy.show();
}


function dba_base_url()
{
	return document.getElementById('baseURL').value;
}


function load_preset() {
	show_busy();
	var p;
	try {
		p = document.getElementById('preset').value;
	}
	catch (e) {
		p = '';
	}

	if (p) {
		window.location.href = dba_base_url() + '/preset/?p=' + p + '&target=customize#customize' ;
		return true;
	} else {
		return false;
	}
}

function dbas_check_load() {
	try {
		var target = window.location.href.match(/target=([^#&]*)/i);
		if (target) {
			window.location.href = '#' + target[1];
		} else if (target = document.getElementById('dbas_target')) {
			window.location.href = '#' + target.value;
		}
	}
	catch (e) {
	}
}

var mozilla = true;
if (navigator.userAgent.indexOf('MSIE') != -1) {
	mozilla = false;
}

if (mozilla) {
	window.addEventListener('load', dbas_check_load, false);
} else {
	window.attachEvent('onload', dbas_check_load);
}

