<!--

function createSiteFromForm () {
		//creates Site Object from information in the form - not the lat long
		var theForm=document.forms["Site Information"];
		var theSite = createSite(theForm.elements["Name"].value,
									theForm.elements["Address1"].value,
									theForm.elements["Address2"].value,
									theForm.elements["City"].value,
									//theForm.elements["County"].value,
									theForm.elements["State"].value,
									theForm.elements["Zip"].value,
									theForm.elements["OrgType"].value);
		return theSite
		};

function clearSiteInfoFromForm () {
	// clears the field information from the form fields
		var theForm=document.forms["Site Information"];
			theForm.elements["Name"].value='';
			theForm.elements["Address1"].value='';
			theForm.elements["Address2"].value='';
			theForm.elements["City"].value='';
			theForm.elements["County"].value='';
			theForm.elements["State"].value='';
			theForm.elements["Zip"].value='';
			theForm.elements["OrgType"].value="VITA"
		};

function createSite(Name,Address1,Address2,City,State,Zip,Organization)
	{var temp= new site("",Name,Address1,Address2,City,State,Zip,Organization,"0.0","0.0","");
	return temp}	

    
function showAddress2() {
   	      if (geocoder) { 
   	      	var theSite = createSiteFromForm();
   	        var address=theSite.address_string();
   	       	geocoder.getLatLng(
          			address,
          			function(point) {
          				  if (!point) { alert(address + " not found"); } 
          				  	else {var ii = gmarkers.length
          				  			theSite.Lat=point.lat();
          				  			theSite.Lon=point.lng();          				  			
           						var theMarker = makeNewDraggableMarker (theSite,ii)	
          				  		setActiveMarker(theMarker);
          	//			  		setDocDiv("CanonicalAddress", theGGeocodeCache.toCanonical(address))
          				  		theSite.CanonicalAddress=theGGeocodeCache.toCanonical(address)
          				  		myclick(ii);}
			         		 }        );
     		 } ;
       }

function addNewSite()
{	clearSiteInfoFromForm();
	
};

//-->


