function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}

function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}

// borrowed from the best online mag ever A List Apart http://www.alistapart.com/articles/alternate/
function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function load() {
  if (GBrowserIsCompatible()) {
  function createMarker(point,html) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
	  marker.openInfoWindowHtml(html);
	});
	return marker;
  }
  var map    = new GMap(document.getElementById("map"));
  var point  = new GPoint(-81.580883, 28.551079);
  
  var html   = '<br /><strong>Cressman Law Firm, P.A.</strong><br />13350 West Colonial Drive, Suite 350<br />Winter Garden, FL 34787';
  html += '<form action="http://maps.google.com/maps" method="get" target="_blank">';
  html += '<em>Directions to here from</em>: <br />';
  html += '<input type="text"   name="saddr" value="" size="25"><br />';
  html += '<input type="hidden" name="daddr" value="13330 West Colonial Dr, 34787" />';
  html += '<input type="hidden" name="hl" value="en">';
  html += '<input type="submit" value="Directions"/></form>'; 
  
  var marker = new createMarker(point, html);
  
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  
  map.centerAndZoom(point, 4);    
  
  map.addOverlay(marker);
  
  marker.openInfoWindowHtml(html);
  
  }
}

sfHover = function() {
	var sfEls = document.getElementById("topNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

