
function loadPage()
{
	// breakFrame();
	loadEvents();
	if (window.externalOnLoad) externalOnLoad();
}

function breakFrame()
{
	if (window.top != window.self)
	{
		window.top.location = window.self.location;
	}
}

function loadEvents()
{
	// find-q
	if (document.getElementById)
	{
		document.getElementById('find-q').onfocus = function()
		{
			document.getElementById('find-q').style.color = '#000000';
			document.getElementById('find-q').select();
		}
		document.getElementById('find-q').style.color = '#999999';
		document.getElementById('find-q').value = 'Postal Code or City, State';
	}
}

function ifJsUrl(a, url)
{
	a.href = url;
}

function raw_popup(url, target, width, height, features)
{
	if (isUndefined(width))
		width = 720;
	if (isUndefined(height))
		height = 580;
	if (isUndefined(features))
		features = 'alwaysRaised=yes, dependent=yes, directories=no, location=no,  menubar=no, resizable=no, statusbar=no, scrollbars=no, toolbar=no';
	if (isUndefined(target))
		target   = '_blank';
	var x = (screen.availWidth - 12 - width) / 2;
	var y = (screen.availHeight - 48 - height) / 2;
	var theWindow = window.open(url, target, features + ', width=' + width + ', height=' + height + ', left=' + x + ', top=' + y);
	theWindow.focus();
	return theWindow;
}

function enlarge(src, width, height, features)
{
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', width, height, features);
}

function isUndefined(v) {
    var undef;
    return v===undef;
}