function update_search_box (focused) {
	if (focused == '1') {
		if (document.getElementById("q").value == 'Search the Web' || document.getElementById("q").value == 'Search this Site') {
			document.getElementById("q").value = '';
		}
	} else {
		if (document.getElementById("q").value == '') {
			if (document.getElementById("search_type").value == 'Web') document.getElementById("q").value = 'Search the Web';
			if (document.getElementById("search_type").value == 'Site') document.getElementById("q").value = 'Search this Site';
		}
	}
}

function update_direction_box (focused) {
	if (focused == '1') {
		if (document.getElementById("qs").value == 'Your Address' || document.getElementById("qs").value == 'Your Address') {
			document.getElementById("qs").value = '';
		}
	} else {
		if (document.getElementById("qs").value == '') {
			if (document.getElementById("search_type").value == 'Web') document.getElementById("qs").value = 'Your Address';
			if (document.getElementById("search_type").value == 'Site') document.getElementById("qs").value = 'Your Address';
		}
	}
}

function constrain () {
	var w;
	if (window.innerWidth) w = window.innerWidth;
	if (document.body.clientWidth) w = document.body.clientWidth;
	if (w >= '980') {
		document.getElementById("search_holder").className = 'constraint_lg';
		document.getElementById("footer_holder").className = 'constraint_lg';
		document.getElementById("content_extension").className = 'displayed';
	} else {
		document.getElementById("search_holder").className = 'constraint_sm';
		document.getElementById("footer_holder").className = 'constraint_sm';
		document.getElementById("content_extension").className = 'hidden';
	}
}

function validate_contact () {
	with (document.getElementById("contact_form")) {
		if (!document.getElementById("ef_recipient").value) {
			alert ('Please choose a recipient for your message.');
			return false;
		} else if (!document.getElementById("ef_name").value) {
			alert ('Please provide your name.');
			return false;
		} else if (!document.getElementById("ef_subject").value && !document.getElementById("ef_message").value) {
			alert ('Please include either a subject or a message in the provided space.');
			return false;
		} else {
			return true;
		}
	}
}

function validate_directions () {
	if (!document.getElementById("qs").value || document.getElementById("qs").value == "Your Address") {
		alert ('Please provide your address.');
		return false;
	} else {
		return true;
	}
}

function initMap() {
  //
  // frb
  //

  myMap = new _Map(document.getElementById("container_frb"),
		   null,
		   null,
		   null,
		   false, // true,
		   false,
		   null,
		   false,
		   false
		   );

  myMap.showSmallMapControl();

  /*
  if(_m.mapTypes.length > 1) {
    var _e=document.getElementById('maptoggle');
    if (_e) {
      _m.createSpecToggleLinks(_e, true);
    }
  }

  var _lm=document.getElementById('largerlink');
  if(_lm) {
    var _href=_lm.href;
    _m.addStateListener(function() {var _ll=_m.getCenterLatLng();var _spn=_m.getSpanLatLng();var _t=_m.spec.getURLArg();_lm.href=_href + "&ll=" + _ll.y + "," + _ll.x +"&spn=" + _spn.height + "," + _spn.width +(_t ? "&t=" + _t : "");});}
  */

  /* Note: All XML & XSL files must be on same domain.
     Note: Can load string with `loadVPageStr` method.
  */
  //myMap.asyncLoadVPageFromURL("http://stuff.rancidbacon.com/gmaps-standalone/demo1.xml");

  var dt = _DocumentTransport.create();
  dt.continueWith("map.xml",
		   function (responseText) {myMap.loadVPageStr(responseText);})


}

function goog_search () {
	document.getElementById("goog_search").submit();
}