// JavaScript Document
function verifySearchForm()
{
	if (searchForm.q.value == '')
	{
		alert('Please type a postal code or city and state (or province) into the search box.');
		return false;
	}
	else
	{
		return true;
	}
}

function raw_popup(url, target, width, height, features)
{
	if (isUndefined(width))
		width = 400;
	if (isUndefined(height))
		height = 200;
	if (isUndefined(features))
		features = 'alwaysRaised=yes, dependent=yes, directories=no, location=no,  menubar=no, resizable=yes, statusbar=no, scrollbars=yes, 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 link_popup(src, width, height, features)
{
    return raw_popup(src.getAttribute('href') + '&popup=1', src.getAttribute('target') || '_blank', width, height, features);
}

function isUndefined(v) {
    var undef;
    return v===undef;
}