getGeoID = function(){
	var url = '/lmsform/geoservice/getgeolmsids';
	//url= 'http://d-sfa-515969.corp.ebay.com/debug/LMS/proxy.asp?url='+escape(url);
	var geoLocationSelect = YAHOO.util.Dom.get("geoLocation");
	var handleSuccess = function(o){
	
	    if(o.responseText !== undefined){
			try {				
				geoLocation= YAHOO.lang.JSON.parse(o.responseText);
			}
			catch (e) {
			   	// alert("Geo failed!");
			}			
			
			var locations = geoLocation.GeoLocations.Locations;
			for(geo in locations){				
				OptNew = document.createElement('option');
				OptNew.text = locations[geo].GeoDescription;
   				OptNew.value = locations[geo].GeoNodeId;
			  	try {
			 	   geoLocationSelect.add(OptNew, null) // standards compliant; doesn't work in IE
			  	}
			  	catch(ex) {
			  	  geoLocationSelect.add(OptNew); // IE only
  				}
			}
						
			YAHOO.util.Event.addListener(geoLocationSelect, "change", updateGeo);
	    }
	}

	var updateGeo = function(sType, aArgs) {
		if(geoLocationSelect.selectedIndex==0){
			YAHOO.util.Dom.get("findBtn").disabled=true;
			return false;
		}
		YAHOO.util.Dom.get("eventLocation").innerHTML = geoLocationSelect.options[geoLocationSelect.selectedIndex].text; 
		if(YAHOO.util.Dom.get("eventDate").value!='' && geoLocationSelect.selectedIndex!=0){
			YAHOO.util.Dom.get("findBtn").disabled=false;
			if(YAHOO.util.Dom.get('event').style.display=="block"){
				getEvent();
			}
		}
	};
	var handleFailure = function(o){
	    if(o.responseText !== undefined){
	        //YAHOO.util.Dom.get(divid).innerHTML="Content fail to load!";
	    }
	}

	var callback =
	{
	  success:handleSuccess,
	  failure: handleFailure,
	  argument: { foo:"foo", bar:"bar" }
	};
	
	YAHOO.util.Connect.initHeader('Accept', 'application/json'); 
	var request = YAHOO.util.Connect.asyncRequest('GET', url, callback);
	
}; 	



YAHOO.util.Event.onDOMReady(getGeoID);

	
