function getLatiLongi(pplz,port,pcountry,fields, handler)
{
	//alert('call to getLatiLongi()');
	if(!pcountry) {
		var options = jQuery('#fk_country > option');
		var c = options.length;
		var country = 'Deutschland';
		if(c) {
			for(i=0; i<c; i++) {
				if(options[i].selected == true) {
					country = options[i].text;
				}
			}
		}
	} else {
		country = pcountry;
	}
	
	if(!pplz && (jQuery('#ZIP').length > 0)) {
		var plz = jQuery('#ZIP').val();
	} else if(typeof pplz != "undefined") {
		var plz = pplz;
	} else {
        plz = ""
    }

	if(!port && (jQuery('#CITY').length > 0)) {
		var ort = jQuery('#CITY').val();
	} else if(typeof port != "undefined") {
		ort = port;
	} else {
        ort = ""
    }

    if(jQuery("#STREET").length > 0) {
        var strasse = jQuery("#STREET").val();
    } else {
        var strasse = ""
    }

    jQuery.ajax({
        url: '/geolocation.htm',
        data: { STREET: strasse, ZIP: plz, CITY: ort, COUNTRY: country },
        type: 'POST',
        dataType: 'json',
        success: function(response) {
            if(response.success == true) {
                var lat = response.result.LATITUDE;
                var lon = response.result.LONGITUDE;

                if(jQuery('#LONGI')) {
                    jQuery('#LONGI').html(lon);
                    jQuery('#LATI').html(lat);
                }
                if(!fields) {
                    if(jQuery('#LONGITUDE')) {
                        //alert($('LONGITUDE') + ' :: ' + $('LATITUDE'));
                        jQuery('#LONGITUDE').val(lon);
                        jQuery('#LATITUDE').val(lat);
                        //alert($('LONGITUDE').value + ' :: ' + $('LATITUDE').value);
                    }
                } else {
                    jQuery('#'+fields.logitude).val(lon);
                    jQuery('#'+fields.latitude).val(lat);
                }
                if (typeof showPositionMarker == 'function') {
                    showPositionMarker(lat, lon);
                }
                changed = 1;

                if(typeof handler != "undefined") {
                    handler.call(this);
                }
            } else {
                jQuery('#LONGITUDE').val(0);
                jQuery('#LATITUDE').val(0);
            }
        }
    });


}



