/* ------------------------------------------------------------------

Programm: CallGoogleMaps.js
Aufruf von Google Maps in einem Popup

Autor:    Klaus Tucher
Im Münzen 30
73230 Kirchheim unter Teck

Datum:    21.10.2006
-------------------------------------------------------------------- */

function CallGoogleMaps (latitude,longitude,ZoomFaktor,Controls,Adresse,Infotext,Navtext) {

   var DefaultOrt  = '73230 Kirchheim unter Teck';
   var DefaultLand = 'Deutschland';
   var Mandant     = '';
   var Verzeichnis = 'tmpGoogleMaps';



if (Controls == null) {Controls = '';}if (Adresse  == null) {Adresse = '';}if (Infotext == null) {Infotext = '';}if (Navtext == null)  {Navtext = '';}

Adresse = Adresse.replace(/str\./i,'strasse ');


Adresse = Adresse.replace(/Kirchheim\/Teck/g,'Kirchheim unter Teck');Adresse = Adresse.replace(/Kirchheim\-Teck/g,'Kirchheim unter Teck');Adresse = Adresse.replace(/  /g,' ');




if (Adresse.match(/^[0-9]*.[0-9]*,[0-9]*.[0-9]*$/) == null) {

if (Adresse.match(/,/) == null) {Adresse = Adresse + ', ' + DefaultOrt + ', ' + DefaultLand;}var Ausdruck = eval('/, *' + DefaultLand + '/');if (Adresse.match(Ausdruck) == null) {Adresse = Adresse + ', ' + DefaultLand;}}
Navtext=encodeURIComponent(Navtext);

var url = '/webios/cms/cms_ausgabe.pl?Mandant=' + Mandant + '&Verzeichnis=' + Verzeichnis
+ '&latitude=' + latitude
+ '&longitude=' + longitude
+ '&ZoomFaktor=' + ZoomFaktor
+ '&Controls=' + Controls
+ '&Adresse=' + Adresse
+ '&Infotext=' + Infotext
+ '&Navtext=' + Navtext;url=encodeURI(url);window.open(url, 'GoogleMaps','width=640,height=480,top=50,left=50,resizable=no,scrollbars=no');}


function encode_utf8(text) {

var utftext = "";for(var n=0; n<text.length; n++) {var c=text.charCodeAt(n);if (c<128) {utftext += String.fromCharCode(c);}else {if ((c>127) && (c<2048)) {utftext += String.fromCharCode((c>>6)|192);utftext += String.fromCharCode((c&63)|128);}else {utftext += String.fromCharCode((c>>12)|224);utftext += String.fromCharCode(((c>>6)&63)|128);utftext += String.fromCharCode((c&63)|128);}}}return utftext;}

      