function milestones_de_window()
{
 milestones_de =
 window.open("/downloads/videos/milestones_de/milestones_de.html", "milestones_de","width=665,height=576,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=no,scrollbars=no,resizeable=no,menubar=no,status=no,directories=no,location=no");
 milestones_de.focus();
}

function milestones_en_window()
{
 milestones_en =
 window.open("/downloads/videos/milestones_en/milestones_en.html", "milestones_en","width=665,height=576,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=no,scrollbars=no,resizeable=no,menubar=no,status=no,directories=no,location=no");
 milestones_en.focus();
}

function ard_de_window()
{
 ard_de =
 window.open("/downloads/videos/europamagazin/europamagazin.html", "europamagazin","width=540,height=476,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=no,scrollbars=no,resizeable=no,menubar=no,status=no,directories=no,location=no");
 ard_de.focus();
}

function freekteamfenster()
{
 freekteam =
 window.open("ihrfreekteam.html", "freekteam","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 freekteam.focus();
}

function kerngeschaeftfenster()
{
 kerngeschaeft =
 window.open("unserkerngeschaeft.html", "kerngeschaeft","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 kerngeschaeft.focus();
}

function organisationfenster()
{
 organisation =
 window.open("unsereorganisation.html", "organisation","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 organisation.focus();
}

function wandelfenster()
{
 wandel =
 window.open("freekimwandelderzeit.html", "wandel","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 wandel.focus();
}

function faktenfenster()
{
 fakten =
 window.open("faktenundzahlen.html", "fakten","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 fakten.focus();
}

function presseunternehmenfenster()
{
 presse =
 window.open("presseunternehmen.html", "presse","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 presse.focus();
}

function agbunternehmenfenster()
{
 agb =
 window.open("AGB.html", "agb","width=750,height=460,top="+((screen.height/2)-(290))+",left="+((screen.width/2)-(375))+",toolbar=yes,scrollbars=yes,resizeable=no,menubar=no,status=yes,directories=no,location=no");
 agb.focus();
}

//Bilder vorausladen ab hier
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_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_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];}
}
//Bilder vorausladen bis hier

function PicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin)
	
{

if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}

	var agt=navigator.userAgent.toLowerCase(); 
	var is_opera = (agt.indexOf("opera") != -1); 

	if (is_opera == true){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else


	{

		newWindow = window.open("","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
		newWindow.document.open();
		newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
		newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
		newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+'height='+imageHeight+' alt="klicken um zu schließen | click to close" >'); 
		newWindow.document.write('</td></tr></table></body></html>');
		newWindow.document.close();
		newWindow.focus();
	}
}

function check()
{
	if (typeof fcolor == 'undefined') { var fcolor = "#ffffff";}
	
	if (typeof backcolor == 'undefined') { var backcolor = "#000000";}
	
	if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
	
	if (typeof width == 'undefined') { var width = "200";}

	if (typeof border == 'undefined') { var border = "1";}
	
	if (typeof offsetx == 'undefined') { var offsetx = 10;}

	if (typeof offsety == 'undefined') { var offsety = 10;}
	

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var tr = 1;
if ( (ns4) || (ie4) ) {
	if (ns4) over = document.overDiv
	if (ie4) over = overDiv.style
	document.onmousemove = mouseMove
	if (ns4) document.captureEvents(Event.MOUSEMOVE)
}
}

function freek(text) {
	dts(1,text);
}

function nd() {
	if ( cnt >= 1 ) { sw = 0 };
	if ( (ns4) || (ie4) ) {
		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
		} else {
			cnt++;
		}
	}
}

function dts(d,text) {
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
}

function disp() {
	if ( (ns4) || (ie4) ) {
		if (snow == 0) 	{
			if (dir == 2) { // Center
				moveTo(over,x+offsetx-(width/2),y+offsety);
			}
			if (dir == 1) { // Right
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 0) { // Left
				moveTo(over,x-offsetx-width,y+offsety);
			}
			showObject(over);
			snow = 1;
		}
	}

}

function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY;}
	if (ie4) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (snow) {
		if (dir == 2) { // Center
			moveTo(over,x+offsetx-(width/2),y+offsety);
		}
		if (dir == 1) { // Right
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 0) { // Left
			moveTo(over,x-offsetx-width,y+offsety);
		}
	}
}

function layerWrite(txt) {
        if (ns4) {
                var lyr = document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) document.all["overDiv"].innerHTML = txt
		if (tr) { trk(); }
}

function showObject(obj) {
        if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}

function hideObject(obj) {
        if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
}

function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

function trk() {
	if ( (ns4) || (ie4) ) {
			nt=new Image(32,32); nt.src="http://www.nedstat.nl/cgi-bin/nedstat.gif?name=ol2t";
			bt=new Image(1,1); bt.src="http://www.bosrup.com/web/overlib/o2/tr.gif";
			refnd=new Image(1,1); refnd.src="http://www.nedstat.nl/cgi-bin/referstat.gif?name=ol2t&refer="+escape(top.document.referrer);
			
	}
	tr = 0;
}
function chkFormular()
{
 if(document.inquiry.Firma.value == "")  {
   alert("Bitte den Namen der Firma eingeben!");
   document.inquiry.Firma.focus();
   return false;
  }
 if(document.anfrage.Strasse.value == "") {
   alert("Bitte die Straße eingeben!");
   document.anfrage.Strasse.focus();
   return false;
  }
 if(document.anfrage.PLZ.value == "") {
   alert("Bitte die PLZ eingeben!");
   document.anfrage.PLZ.focus();
   return false;
  }
 if(document.anfrage.Ort.value == "") {
   alert("Bitte den Ort eingeben!");
   document.anfrage.Ort.focus();
   return false;
  }
 if(document.anfrage.Telefon.value == "") {
   alert("Bitte Ihre Telefonnummer eingeben!");
   document.anfrage.Telefon.focus();
   return false;
  }
 if(document.anfrage.Ansprechpartner.value == "") {
   alert("Bitte Ihren Namen eingeben!");
   document.anfrage.Ansprechpartner.focus();
   return false;
  }
}

function chkFormular_e()
{
 if(document.anfrage_e.Firma_e.value == "")  {
   alert("Please fill in the name of your company!");
   document.anfrage_e.Firma_e.focus();
   return false;
  }
 if(document.anfrage_e.Strasse_e.value == "") {
   alert("Please fill in the name of the street!");
   document.anfrage_e.Strasse_e.focus();
   return false;
  }
 if(document.anfrage_e.PLZ_e.value == "") {
   alert("Please fill in your ZIP!");
   document.anfrage_e.PLZ_e.focus();
   return false;
  }
 if(document.anfrage_e.Ort_e.value == "") {
   alert("Please fill in your town!");
   document.anfrage_e.Ort_e.focus();
   return false;
  }
 if(document.anfrage_e.Telefon_e.value == "") {
   alert("Please fill in your telephone number!");
   document.anfrage_e.Telefon_e.focus();
   return false;
  }
 if(document.anfrage_e.Ansprechpartner_e.value == "") {
   alert("Please fill in the contact person!");
   document.anfrage_e.Ansprechpartner_e.focus();
   return false;
  }
}

//ÜBERPRÜFUNG DER EMAIL-ADRESSE

function isValidEmail(pStr) {
    var validEmailFormat = /^[a-zA-z][\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/;
    return validEmailFormat.test(pStr);
}

function checkForm() {
    
    var f = document.weiterempfehlung;

    if ( !isValidEmail(f.empfaengeremail.value) ) {
        self.alert('Bitte korrekte Empfänger eMail-Adresse eingeben!');
        f.empfaengeremail.focus();
        return false;
    }
	
    if ( !isValidEmail(f.senderemail.value) ) {
        self.alert('Bitte korrekte Absender eMail-Adresse eingeben!');
        f.senderemail.focus();
        return false;
    }

   return true;
}

function checkForm_e() {
    
    var f = document.weiterempfehlung;

    if ( !isValidEmail(f.empfaengeremail.value) ) {
        self.alert('Please fill in the correct email receiver!');
        f.empfaengeremail.focus();
        return false;
    }
	
    if ( !isValidEmail(f.senderemail.value) ) {
        self.alert('Please fill in the correct enail sender!');
        f.senderemail.focus();
        return false;
    }

   return true;
}
