////////////////////////PRELOAD IMAGES///////////////////////////////////////////////////////////////
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
numberOfSubmenus = 5;   // security to close open submenus wich should not be open
mouseOutDelay = 1000    // ms
blindSpeed = 0.2        // sec

isOpen = 0;
effectPending = 0;
blindSpeedRetry = blindSpeed * 1000 + 330;

function submenuParallel(IDopen, IDclose) {
    var submenuOpen = document.getElementById('submenu_' + IDopen); 
    var submenuClose = document.getElementById('submenu_' + IDclose); 
    effectPending = 1;

    new Effect.Parallel([
      new Effect.BlindUp(submenuClose, { sync: true }), 
      new Effect.BlindDown(submenuOpen, { sync: true }) 
    ], { 
      duration: blindSpeed,
      delay: 0,
      afterFinish: function() { effectPending = 0 }
    });
    return false;
}
function submenuBlind(ID, typ) {
    var submenu = document.getElementById('submenu_' + ID); 
    if(effectPending == 0) {
        effectPending = 1;
        if(typ == 'BlindUp') {
            new Effect.BlindUp(submenu, { duration: blindSpeed, afterFinish: function() { effectPending = 0 } });
        } else {
            new Effect.BlindDown(submenu, { duration: blindSpeed, afterFinish: function() { effectPending = 0 } });
        }
        return false;
    } else {
        IDG = ID;
        typG = typ; 
        delayMenu = window.setTimeout("submenuBlind('"+IDG+"', '"+typG+"');", blindSpeedRetry);
    } 
}
function closeSubmenus(nowOpen) {
    numberOfSubmenus_cn = numberOfSubmenus + 1;
    for(i = 1; i < numberOfSubmenus_cn; i++) {
        if(i != nowOpen) {
            if(document.getElementById('submenu_' + i)) {
                document.getElementById('submenu_' + i).style.display = 'none';
            }
        }
    }
    if(effectPending == 1) {
        closeSubs = window.setTimeout("closeSubmenus();", 90);
    }
}
function submenuIn(ID) {
    if(window.DelayOut) { window.clearTimeout(DelayOut); }
    if(document.getElementById('submenu_' + ID)) {
        submenu  = document.getElementById('submenu_' + ID);
        if(effectPending != 1) {
            if(isOpen == 0) {
                submenuBlind(ID, 'BlindDown');
                isOpen = ID;
            }
            else {
                if(isOpen != ID) {
                    closeSubmenus(isOpen);
                    submenuParallel(ID, isOpen);
                    isOpen = ID;
                }
                else {
                    submenu.style.display = 'block';
                    isOpen = ID;
                }
            }
        } else {
            setTimeout("closeSubmenus(0);", 30);
            isOpen = 0;
            IDG = ID;
            setTimeout("submenuIn("+IDG+");", blindSpeedRetry);
        }
    } else {
        if(isOpen != 0) {
            submenuBlind(isOpen, 'BlindUp');
            isOpen = 0;
        }
    }
}
function submenuOut(ID) {
    if(document.getElementById('submenu_' + ID)) {
        IDG = ID;
        DelayOut = window.setTimeout("submenuOutDelay("+IDG+")", mouseOutDelay);
    }
}
function submenuOutDelay(ID) {
    submenu = document.getElementById('submenu_' + ID);
    submenuBlind(ID, 'BlindUp');
    setTimeout("closeSubmenus(0);", blindSpeedRetry);
    isOpen = 0;
}
function submenuStart(ID) {
    submenu = document.getElementById('submenu_' + ID);
    submenu.style.display = 'none';
}

//////////////////////////AJAX//////////////////////////////////////////////////////////////////
var myGlobalHandlers= {
        onCreate: function()
        {
                Element.show('systemWorking');
        },
        onComplete: function(){
                if (Ajax.activeRequestCount==0)
                {
                        Element.hide('systemWorking');
                }
        }
}
Ajax.Responders.register(myGlobalHandlers);
///////////////////////////////////////////////////////////////////////////////////////
Event.observe(window, 'load',

      function() {
      Element.hide('systemWorking');
     
      }

);
///////////////////////////////////GOOGLE////////////////////////////////////////////////////////
function load_mein_google()
  {
   google.load("maps", "2.x");

   
   
  // Call this function when the page has been loaded
   function initialize() 
   {
        var map = new google.maps.Map2(document.getElementById("map"));
        map.setCenter(new google.maps.LatLng(document.getElementById("x").value, document.getElementById("y").value), 13);
		map.setCenter(new GLatLng(document.getElementById("x").value,document.getElementById("y").value), 13);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.addOverlay(createMarker( new GLatLng(document.getElementById("x").value, document.getElementById("y").value), document.getElementById("googletext").value));
 }
      google.setOnLoadCallback(initialize);
   
 
  }
function load_mein_google_small()
  {
   google.load("maps", "2.x");

   var anzahl = document.getElementById("ganzahl").value;
   
  // Call this function when the page has been loaded
   function initialize() 
   {
        var map = new google.maps.Map2(document.getElementById("mapsm"));
        map.setCenter(new google.maps.LatLng(document.getElementById("x0").value, document.getElementById("y0").value), 4);
		//map.setCenter(new GLatLng(document.getElementById("x").value,document.getElementById("y").value), 13);
        map.addControl(new GLargeMapControl());
    	map.addControl(new GMapTypeControl());
    	map.addControl(new GScaleControl());
		map.setCenter(new GLatLng(50.40116, 10.53613), 4, G_HYBRID_MAP);
    	

		for (var i=0;i<anzahl;i++)
        map.addOverlay(createMarker( new GLatLng(document.getElementById("x"+i).value, document.getElementById("y"+i).value), document.getElementById("googletext"+i).value));
 }
      google.setOnLoadCallback(initialize);
   
 
  }
 function createMarker(point, mtext) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "mouseover", function() {
		marker.openInfoWindowHtml( mtext );
	});
	GEvent.addListener(marker, "mouseout", function(){
    marker.closeInfoWindow();
  }); 
	return marker;
 }
 function load_mein_google_more()
  {
   google.load("maps", "2.x");

   var anzahl = document.getElementById("ganzahl").value;
   
  // Call this function when the page has been loaded
   function initialize() 
   {
        var map = new google.maps.Map2(document.getElementById("map"));
        map.setCenter(new google.maps.LatLng(document.getElementById("x0").value, document.getElementById("y0").value), 11);
		//map.setCenter(new GLatLng(document.getElementById("x").value,document.getElementById("y").value), 13);
        map.addControl(new GLargeMapControl());
    	map.addControl(new GMapTypeControl());
    	map.addControl(new GScaleControl());
    	map.addControl(new GOverviewMapControl());

		for (var i=0;i<anzahl;i++)
        map.addOverlay(createMarker( new GLatLng(document.getElementById("x"+i).value, document.getElementById("y"+i).value), document.getElementById("googletext"+i).value));
 }
      google.setOnLoadCallback(initialize);
   
 
  }
 function createMarker(point, mtext) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "mouseover", function() {
		marker.openInfoWindowHtml( mtext );
	});
	GEvent.addListener(marker, "mouseout", function(){
    marker.closeInfoWindow();
  }); 
	return marker;
 }

function get_url_ajax(t)
{
var url = '';
for (var i=1;i<=t;i++)
{
url+="../";	
}
return url;
}
//////////////////////////////////EMAIL ERWEITERT///////////////////////////////////////////////
function validE(land_id,email) {
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(email));
 }
 else
 {
  res = (email.search('@') >= 1 &&
         email.lastIndexOf('.') > email.search('@') &&
         email.lastIndexOf('.') >= email.length-5)
 }
 if (res==true)
 {

 } else {
	 if (land_id==1)
 error+="\nBitte geben Sie eine korrekte Emailadresse ein!";
 else if (land_id==2)
  error+="\nKérjük, hogy létező e-mail címet adjon meg!";
 }
}
/////international
function validE_int(land_id,email) {
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(email));
 }
 else
 {
  res = (email.search('@') >= 1 &&
         email.lastIndexOf('.') > email.search('@') &&
         email.lastIndexOf('.') >= email.length-5)
 }
 if (res==true)
 {

 } else {
	 if (land_id==1)
 error+="\nBitte geben Sie eine korrekte Email-Adresse ein!/Please enter a guilty e-mail-adress!";
 else if (land_id==2)
  error+="\nKérjük, hogy létező e-mail címet adjon meg!";
 }
}
///////////////////////////////////////////////////DATUM PRÜFEN////////////////////////////////
function datumtest (land_id,t, m, j) {
        if (t>31 || m>12  || j>2020 || t<1 || m <1 || j<1920)
		{
			     if (land_id==1)
                 error+="\nBitte geben Sie ein korrektes Datum ein!";
				 else if (land_id==2)
				 error+="\nKérjük, hogy helyes dátumot adjon meg!";
		}
                 if (m==4 || m ==6 || m== 9 || m==11)
                {
                if (t >30){
            if (m==4)
                {
					if (land_id==1)
                	mon="April";
					else if (land_id==2)
					mon="április";
                } else if (m==6)
                {
                    if (land_id==1)
                	mon="Juni";
					else if (land_id==2)
					mon="június";
                } else if (m==9)
                {
                    if (land_id==1)
                	mon="September";
					else if (land_id==2)
					mon="szeptember";
                } else {
                        if (land_id==1)
                	mon="November";
					else if (land_id==2)
					mon="november";
                }
				if (land_id==1)
                error+="\nBitte geben Sie ein korrektes Datum ein, der Monat "+mon+" hat nur 30 Tage!";
				else if (land_id==2)
				error+="\nKérjük, hogy helyes dátumot adjon meg, a "+mon+" csak 30 napos!";
                }
                } else if (m==2 || m==02)
                {

                 if (j%4==0 && t>29)
                 {
					 	 if (land_id==1)
                         error+="\nBitte geben Sie ein korrektes Datum ein, der Monat Februar hat in dem gewählten Jahr nur 29 Tage!";
						 else if (land_id==2)
						 error+="\nKérjük, hogy helyes dátumot adjon meg, a február az Ön által megadott évben 29 napos!";
                         } else  if(j%4!=0 && t>28)
                 {
                         if (land_id==1)
                         error+="\nBitte geben Sie ein korrektes Datum ein, der Monat Februar hat in dem gewählten Jahr nur 28 Tage!";
						 else if (land_id==2)
						 error+="\nKérjük, hogy helyes dátumot adjon meg, a február az Ön által megadott évben 28 napos!";

                         }
                }


};

/////international
function datumtest_int (land_id,t, m, j) {
        if (t>31 || m>12  || j>2020 || t<1 || m <1 || j<1920)
		{
			     if (land_id==1)
                 error+="\nBitte geben Sie ein korrektes Datum ein!/Please enter a gulity date!";
				 else if (land_id==2)
				 error+="\nKérjük, hogy helyes dátumot adjon meg!";
		}
                 if (m==4 || m ==6 || m== 9 || m==11)
                {
                if (t >30){
            if (m==4)
                {
					if (land_id==1)
                	mon="April";
					else if (land_id==2)
					mon="április";
                } else if (m==6)
                {
                    if (land_id==1)
                	mon="Juni";
					else if (land_id==2)
					mon="június";
                } else if (m==9)
                {
                    if (land_id==1)
                	mon="September";
					else if (land_id==2)
					mon="szeptember";
                } else {
                        if (land_id==1)
                	mon="November";
					else if (land_id==2)
					mon="november";
                }
				if (land_id==1)
                error+="\nBitte geben Sie ein korrektes Datum ein, der Monat "+mon+" hat nur 30 Tage!/Please enter a gulity date!";
				else if (land_id==2)
				error+="\nKérjük, hogy helyes dátumot adjon meg, a "+mon+" csak 30 napos!";
                }
                } else if (m==2 || m==02)
                {

                 if (j%4==0 && t>29)
                 {
					 	 if (land_id==1)
                         error+="\nBitte geben Sie ein korrektes Datum ein, der Monat Februar hat in dem gewählten Jahr nur 29 Tage!/Please enter a gulity date!";
						 else if (land_id==2)
						 error+="\nKérjük, hogy helyes dátumot adjon meg, a február az Ön által megadott évben 29 napos!";
                         } else  if(j%4!=0 && t>28)
                 {
                         if (land_id==1)
                         error+="\nBitte geben Sie ein korrektes Datum ein, der Monat Februar hat in dem gewählten Jahr nur 28 Tage!/Please enter a gulity date!";
						 else if (land_id==2)
						 error+="\nKérjük, hogy helyes dátumot adjon meg, a február az Ön által megadott évben 28 napos!";

                         }
                }


};
///////////////////NUMMERN PRÜFEN////////////////////////////////////////////////////////////
function checke_nummern_int(land_id,name,mind,maxi,par,notwendig,bedingung,bname,bpar)
{

if (
        (notwendig=='ja' || ((notwendig=='nein' && par!='') || bpar!=''))
        && (
        (mind!='' && maxi!='' && (isNaN(par) || par.length>maxi || par.length<mind)) ||
        (mind=='' && isNaN(par)) || (bpar!='' && (isNaN(par) || par==''))) )
{
if (land_id==1)
error+="\nBitte verwenden Sie nur Ziffern beim Feld "+name+"./Please enter only numbers at "+name+".";
else if (land_id==2)
error+="\nKérjük, csak betűket írjon a "+name+" mezőbe!";
if (mind!='')
{
if (land_id==1)
error+=" Mindestens "+mind+" und maximal "+maxi+" Ziffern dürfen eingetragen werden./Please enter at least  "+mind+" and at max "+maxi+" chars at  "+name+".";
else if (land_id==2)
error+=" Legalább "+mind+" és maximum "+maxi+" számjegy írható be.";
}

if (notwendig=="nein")
{
if (land_id==1)
error+=" Oder lassen Sie das Feld leer./Or leave the field empty.";
else if (land_id==2)
error+=" Vagy hagyja a mezőt üresen.";
}
if (notwendig=="nein" && bedingung!='' && par!='')
{
if (land_id==1)
error+=" In diesem Fall muss aber auch das Feld "+bname+" leer sein.";
else if (land_id==2)
error+=" IEbben az esetben azonban a "+bname+" mezőt is üresen kell hagyni.";
}
}

}
function checke_nummern(land_id,name,mind,maxi,par,notwendig,bedingung,bname,bpar)
{

if (
        (notwendig=='ja' || ((notwendig=='nein' && par!='') || bpar!=''))
        && (
        (mind!='' && maxi!='' && (isNaN(par) || par.length>maxi || par.length<mind)) ||
        (mind=='' && isNaN(par)) || (bpar!='' && (isNaN(par) || par==''))) )
{
if (land_id==1)
error+="\nBitte verwenden Sie nur Ziffern beim Feld "+name+".";
else if (land_id==2)
error+="\nKérjük, csak betűket írjon a "+name+" mezőbe!";
if (mind!='')
{
if (land_id==1)
error+=" Mindestens "+mind+" und maximal "+maxi+" Ziffern dürfen eingetragen werden.";
else if (land_id==2)
error+=" Legalább "+mind+" és maximum "+maxi+" számjegy írható be.";
}

if (notwendig=="nein")
{
if (land_id==1)
error+=" Oder lassen Sie das Feld leer.";
else if (land_id==2)
error+=" Vagy hagyja a mezőt üresen.";
}
if (notwendig=="nein" && bedingung!='' && par!='')
{
if (land_id==1)
error+=" In diesem Fall muss aber auch das Feld "+bname+" leer sein.";
else if (land_id==2)
error+=" IEbben az esetben azonban a "+bname+" mezőt is üresen kell hagyni.";
}
}

}
function checke_anzahl(land_id,name,par,mind,maxi)
{
        if (par.length<mind || par.length>maxi)
		{
		if (land_id==1)	
        error+="Mindestens "+mind+" und maximal "+maxi+" Zeichen dürfen beim Feld "+name+" verwendet werden.";
		else if (land_id==2)
		error+="Legalább "+mind+" és maximum "+maxi+" karakter írható be a "+name+" mezőbe.";
		}
}
function checke_anzahl_int(land_id,name,par,mind,maxi)
{
        if (par.length<mind || par.length>maxi)
		{
		if (land_id==1)	
        error+="Mindestens "+mind+" und maximal "+maxi+" Zeichen dürfen beim Feld "+name+" verwendet werden./Please enter at least  "+mind+" and at max "+maxi+" chars at  "+name+".";
		else if (land_id==2)
		error+="Legalább "+mind+" és maximum "+maxi+" karakter írható be a "+name+" mezőbe.";
		}
}
function benoetigt(land_id,name,par)
{

if (par=='' || par==0)
{
	if (land_id==1)	
    error+="\nDas Feld "+name+" darf nicht leer sein!";
	else if (land_id==2)
    error+="\nA "+name+" mező nem lehet üres!";
}

}
function benoetigt_int(land_id,name,par)
{

if (par=='' || par==0)
{
	if (land_id==1)	
    error+="\nDas Feld "+name+" darf nicht leer sein!/"+name+" is required!";
	else if (land_id==2)
    error+="\nA "+name+" mező nem lehet üres!";
}

}
/////////////////////TOOLTIP//////////////////////////////////////////////////////////////
wmtt = null;
document.onmousemove = updateWMTT;
function updateWMTT(e) {
        x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
        y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
        if (wmtt != null) {
                wmtt.style.left 	   = (x	+ 2) + "px";
                wmtt.style.top         = (y + 10) + "px";

        }
}
function showWMTT(id) {
        wmtt = document.getElementById(id);
        wmtt.style.display = "block"

}

function hideWMTT() {
        wmtt.style.display = "none";
}


fmg = null;
document.onmousemove = updatefmg;
function updatefmg(e) {
        x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
        y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
        if (fmg != null) {
                fmg.style.left = (x+5) + "px";
                fmg.style.top         = (y + 5) + "px";

        }
}
function showfmg(id) {
        fmg = document.getElementById(id);
        fmg.style.display = "block"

}

function hidefmg() {
        fmg.style.display = "none";
}


function gehezu(url)
{
document.location=url;	
	
}

function updateKalender(url,jahr,monat,tag) {
  document.location=url+'&jahr='+jahr+'&monat='+monat+'&tag='+tag;
}



