function submitGeoKeywordForm(){
			if(validateGeo(document.forms.geoSearchForm)) {
			pageTracker._trackPageview('tracking=US-lander-geo-tracking');
			document.forms.geoSearchForm.submit();
			}
		}

function validateGeo(form){	
		var city = $('city').value;
		var area = $('area').value;
		var country = $('country');
		var diverr = $('errorGeo');
        var validRegexp = /^[a-zA-Z\-,. ]{1,}$/;
		var kw = document.geoSearchForm.geoKeywords.value;
		var diverrKeywords = $('errorGeoKeywords');
		diverr.innerHTML = '';
		diverr.style.display = 'none';
		diverrKeywords.innerHTML = '';
		diverrKeywords.style.display = 'none';
		kw = kw.replace(/^\s+|\s+$/, '');
		if (city != '' && !validRegexp.exec(city)) {
			$('city').focus();
			diverr.style.display = 'block';
			diverr.style.marginBottom = '10px';
			diverr.innerHTML = 'City/Town has wrong input format.';
			return false;
		}
		if (area != '' && !validRegexp.exec(area)) {
			$('area').focus();
			diverr.style.display = 'block';
			diverr.style.marginBottom = '10px';
			diverr.innerHTML = 'Region/State has wrong input format.';
			return false;
		}
    	
		
		if(kw == '' || kw == 'ENTER KEYWORD(S)...ie: finance, golf'){
			diverrKeywords.innerHTML = 'Keywords field is required';
			diverrKeywords.style.display = 'block';
			clearbox1 = 0;
			clearit1();
			$('geoKeywords').focus();
			return false;
		}
		var regexp = /^[0-9a-zA-Z\-]+([.][a-zA-Z]+){0,2}$/;
		var pattern = /,|\s/;
		var keywords = kw.split(pattern);
		for(var i=0; i < keywords.length;i++){
			var s = keywords[i].replace(/^\s+|\	s+$/, '');
			if(s != '' && !regexp.exec(s)){
				diverrKeywords.innerHTML = 'Wrong input format.';
				diverrKeywords.style.display = 'block';
				clearbox1 = 0;
				clearit1();
				$('geoKeywords').focus();
				return false;
			}
		}
		$('geoLocation.city').innerHTML = city;
        $('geoLocation.area').innerHTML = area;
        $('geoLocation.countryName').innerHTML = country.options[country.selectedIndex].text;
        setCookie("geoParams", city + '@' + area + '@' + country.value, null, "/", ".buydomains.com", null);    
		
		return true;
	}



var on = false;
function fill_text() {
    if (!on) {
		$('city').value = "<%=geoLocation.getCity()%>";
		$('area').value = "<%=geoLocation.getArea()%>";
		$('geoKeywords').value = "ENTER KEYWORD(S)...ie: finance, golf";       
        on = true;
    } else {
		$('city').value = "";
		$('area').value = "";
		$('geoKeywords').value = "";      
        on = false;
	}
}

var clearbox1 = 0;
// global variable
function clearit1() {
    if (clearbox1 == 0) {
        $('geoKeywords').value = "";
        $('geoKeywords').style.color = "#333333";
        clearbox1 = 1;
    }
}


var clearboxGeoCity = 0;
// global variable
function clearitGeoCity() {
	var geoInput = $('city');
    if (clearboxGeoCity == 0) {
        geoInput.value = "";
        geoInput.style.color = "#333333";
		geoInput.focus();
		clearboxGeoCity = 1;
    }
}

var clearboxGeoArea = 0;
// global variable
function clearitGeoArea() {
	var geoInput = $('area');
    if (clearboxGeoArea == 0) {
        geoInput.value = "";
        geoInput.style.color = "#333333";
		geoInput.focus();
		clearboxGeoArea = 1;
    }
}

function initialize(){
		var parentCity = $('geoLocation.city');
		var parentArea = $('geoLocation.area');
		var parentCountry = $('geoLocation.countryName');
		var city = $('city');
		var area = $('area');
		var country = $('country');
		city.value = parentCity.innerHTML;
		area.value = parentArea.innerHTML;
		var indx=0;
		for(var i=0; i < country.options.length; i++) {
			if (country.options[i].text==parentCountry.innerHTML) {
				indx=i;
				break;
			}
		}
		country.selectedIndex = indx;
	}	
	
	 function getGeoLocationArray(){
	 	var result = new Array();
		result[0]=document.getElementById('geoLocation.city').value;
		result[1]=document.getElementById('geoLocation.area').value;
		result[2]=document.getElementById('geoLocation.countryId').value;
	 	return result;
 }