﻿// JavaScript Document
<!--

 function getDates(locale) {

if ( locale == "" ) {
locale = "de";
}

locale = locale.toUpperCase();

    var weekdays = new Array("CZ","DE","EU","RU","CH","ES","FR");
    weekdays["DE"] = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
    weekdays["RU"] = new Array("Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота");
    weekdays["CH"] = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
    weekdays["FR"] = new Array("Dimanche","Lundi","Mardi","Mercedi","Jeudi","Vendredi","Samedi");
    weekdays["ES"] = new Array("Dimanche","Lundi","Mardi","Mercedi","Jeudi","Vendredi","Samedi");
    weekdays["EU"] = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    weekdays["CZ"] = new Array("Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota");


    var dates = new Date();
    
    y = dates.getFullYear();
    m = dates.getMonth()+1;
    d = dates.getDate();
    w = weekdays[locale][dates.getDay()];

if ( m < 10 ) {
m = "0"+m;
}

if ( d < 10 ) {
d = "0"+d;
}

if ( locale != "" ) {
return document.write(w + ",  " + d + "." + m + "." + y);
}


}

function get_downloadinfo(objectsize,objecttype){

	display_filesize = Math.round((parseInt(objectsize)/1024));
        	if ( display_filesize < 1024 ) {
			output = display_filesize.toString();
			if ( output < 100 ) {
			output = '0,0' + output.substring(0,1);
			} 
			else {
			output = '0,' + output.substring(0,2);
			}
		}
		else {
			output = display_filesize / 1024;
			output = output.toString();
			point  = output.indexOf('.');
			output = output.substring(0, point) + ','  + output.substring(point+1, point + 3);
		}	

	return objecttype.toUpperCase() + '; ' + output + ' MB';
}



function kaufm(x) {
  var k = (Math.round(x * 100) / 100).toString();
  k += (k.indexOf('.') == -1)? ',00' : '00';
  return k.substring(0, k.indexOf('.') + 3);
}  


function tmt_winOpen(u,id,f,df){
	if(eval(id)==null||eval(id+".closed")){
	eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");}
	else if(df){eval(id+".focus()");}
	else{eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");}
}
var siau_win;

var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
//-->
<!--
ie = ((document.all) && (window.offscreenBuffering)) ? true : false; 
nn = ((document.captureEvents) && (!document.getElementById)) ? true : false; 
mz = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false; 
op = ((document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1)) ? true : false
if(ie){AGENT="ie";}
if(nn){AGENT="nn";}
if(mz){AGENT="mz";}
if(op){AGENT="op";}
//-->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' Muss eine g&uuml;ltige e-mail Addresse entahlten.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' muss eine Zahl enthalten.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muss eine Zahl zwischen '+min+' und '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist leer.\n'; }
  } if (errors) alert('Folgende Felder sind noch nicht ausgef&uuml;llt:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_validateForm_1() { //v4.0
	var arr_ERROR = new Array()
	var arr_NOERROR = new Array()
	var i,p,q,nm,test,num,min,max,errors='',errorEMAIL='',args=MM_validateForm_1.arguments;
  	for (i=0; i<(args.length-2); i+=3) {
		test=args[i+2]; 
		val=MM_findObj(args[i]);
		if (val) {
			nm=val.name; 
			if ((val=val.value)!="") {
				if (test.indexOf('isEmail')!=-1) { 
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)){
						arr_ERROR.push(nm)
						errors+='- '+nm+' muss eine g&uuml;ltige e-mail addresse enthalten.\n';
						errorEMAIL='- '+nm+' muss eine g&uuml;ltige e-mail addresse enthalten.\n';
					}else{
						arr_NOERROR.push(nm)
					}
				}else if (test!='R') { 
					num = parseFloat(val);
					if (isNaN(val)){ 
						arr_ERROR.push(nm)
						errors+='- '+nm+' muss eine nummer enthalten.\n';
					}else{
						arr_NOERROR.push(nm)
					}
					if (test.indexOf('inRange') != -1) { 
						p=test.indexOf(':');
						min=test.substring(8,p); 
						max=test.substring(p+1);
						if (num<min || max<num){ 
							arr_ERROR.push(nm)
							errors+='- '+nm+' muss eine nummer zwischen '+min+' und '+max+' enthalten.\n';
						}else{
							arr_NOERROR.push(nm)
						}
					} 
				}else{
					arr_NOERROR.push(nm)
				}
			}else if (test.charAt(0) == 'R'){
				errors += '- '+nm+' \n';
				arr_ERROR.push(nm)
			}else if (test.charAt(0) != 'R'){
				arr_NOERROR.push(nm)
			}
		}
	}
	
	for (i=0; i<(args.length-2); i+=3) {
		for(j=0;j<arr_ERROR.length;j++){
			if(arr_ERROR[j]==args[i]){
				document.getElementById(arr_ERROR[j]).style.backgroundColor="#7FAAD5";
				document.getElementById(arr_ERROR[j]).style.borderColor="#666666";
				document.getElementById(arr_ERROR[j]).style.borderWidth="1px";
				if(arr_ERROR[j]!="nachricht"){
					document.getElementById(arr_ERROR[j]).style.height="14px";
				}
			}
		}
	}
	for (i=0; i<(args.length-2); i+=3) {
		for(j=0;j<arr_NOERROR.length;j++){
			//alert("NO ERROR: "+arr_NOERROR[j]);
			if(arr_NOERROR[j]==args[i]){
				document.getElementById(arr_NOERROR[j]).style.backgroundColor="#FFFFFF";
				document.getElementById(arr_NOERROR[j]).style.borderColor="#999999";
				document.getElementById(arr_NOERROR[j]).style.borderWidth="1px";
				if(arr_NOERROR[j]!="nachricht"){
					document.getElementById(arr_NOERROR[j]).style.height="14px";
				}
			}
		}
	}
	if (errors){
		if(errorEMAIL){
			alert('Die farbig gekennzeichneten Felder bitte ausf&uuml;llen.\n'+errorEMAIL);
		}else{
			alert('Die farbig gekennzeichneten Felder bitte ausf&uuml;llen.\n');
		}
		document.MM_returnValue = (errors == '');
	}else{
		document.form2.submit();
	}
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
	
	if ( targ == "new" ) {
		Fenster1 = window.open(selObj.options[selObj.selectedIndex].value, "SIEGENIA_AUBI_KG","" );
  		Fenster1.focus();
	} else {

		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}

//-->

