/* popups */
function naviPopup(chartname)
  {
    window.open(chartname , "Navigation", "width=230,height=30,left=20,top=20,scrollbars=NO");
  }
function anfahrtPopup(chartname)
  {
    window.open(chartname , "Anfahrt", "width=500,height=560,left=40,top=40,scrollbars=NO");
  }
function stadtplPopup(chartname)
  {
    window.open(chartname , "Standorte", "width=314,height=360,left=20,top=20,scrollbars=NO");
  }
function startPopup(chartname)
  {
    window.open(chartname , "Angebot", "width=600,height=400,left=20,top=20,scrollbars");
  }
function fensterAnpassen(xi,yi,xs,ys){
	//alert(xs+","+ys+","+xi+","+yi);
	if(ys!=""){
		if(ys!=yi){
			if(ys>yi){
				
				window.resizeTo(xs,ys);
				
			}
			if(ys<yi){
				
					window.resizeTo(xs,ys);
					
				
			}
		}
		if(xs!=xi){
			if(xs<xi){
				
					window.resizeTo(xs,ys);
				
			}
			if(xs>xi){
				
					window.resizeTo(xs,ys);
				
			}
		}
	
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function ausloggen() {
window.open ("agentur3.htm","inhalt")
window.open ("menue.php","menue")
}
function recallfenster() {
window.open ("projektmanagement/e_projekt.php","inhalt")
window.open ("menue.php","menue")
window.open ("login.php","hinzu")
}
function recallfenster2(i) {
window.open ("../kontakte/kontakt.php?firma_id="+i,"inhalt")
window.open ("../menue.php","menue")
window.open ("../login.php","hinzu")
}
function recallfenster3(i) {
window.open ("../kontakte/kontaktpp.php?person_id="+i,"inhalt")
window.open ("../menue.php","menue")
window.open ("../login.php","hinzu")
}
function einloggen() {
window.open ("menue.php","menue")
}
var counter=75;
var countert=255;
var counter1=counter;
var counter2=countert;
var teaser3=0;
function eintrag() {
if(window.document.form.Teaser.value.length != 0) {teaser3=1;} else {teaser3=0;} }
function zeichen() {
if (counter1 == 0) {window.document.countdown.Betreff2.value = counter1;} else {counter1 = counter - (window.document.form.Betreff.value.length);document.countdown.Betreff2.value = counter1;}
}
function zeichen4() {
if (counter1 == 0) {window.document.countdown.dateilink2.value = counter1;} else {counter1 = counter - (window.document.form.dateilink.value.length);document.countdown.dateilink2.value = counter1;}
}
function zeichen5() {
if (counter1 == 0) {window.document.countdown.bildlink2.value = counter1;} else {counter1 = counter - (window.document.form.bildlink.value.length);document.countdown.bildlink2.value = counter1;}
}
function zeichen2() {
if (counter2 == 0) {
	window.document.countdown.Teaser2.value = counter2;
} else {
	counter2 = countert - (window.document.form.Teaser.value.length);
	window.document.countdown.Teaser2.value = counter2;}
}
function zeichen3() {
counter3 = window.document.form.Inhalt.value.length;
window.document.countdown.Inhalt2.value = counter3;
}
function inhalt() {
if(teaser3 == 0) {
window.document.form.Teaser.value = window.document.form.Inhalt.value;}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function zoomPopup(chartname)
  {
    window.open(chartname , "Details", "width=400,height=320,left=10,top=10,scrollbars=NO");
  }
function NewsPopup(chartname)
  {
    window.open(chartname , "Details", "width=490,height=490,left=50,top=50,scrollbars");
  }
function GaleriePopup(chartname)
  {
    window.open(chartname , "Galerie", "width=490,height=490,left=50,top=50,scrollbars=NO");
  }
var xi, yi;
function Galerie2Popup(chartname,xi,yi){
  
	
    window.open(chartname , "Galerie", "width=" + xi + ",height=" + yi + ",left=50,top=50");
  }
function NewsTempPopup(chartname)
  {
    window.open(chartname , "Temp", "width=800,height=580,left=10,top=10,scrollbars");
  }
function TelefonPopup(chartname)
  {
    window.open(chartname + ".php", "Telefonnotiz", "width=600,height=600,left=50,top=50,scrollbars");
  }
function ChartPopup(chartname)
  {
    window.open(chartname + ".html", "ChartPopup", "width=450,height=600,left=50,top=50,scrollbars");
  }
function kartePopup(chartname)
  {
    window.open(chartname + ".html", "Karte", "width=450,height=750,left=50,top=0,scrollbars");
  }
function sfs2Popup(chartname)
  {
    window.open(chartname + ".html", "SFS2", "width=500,height=500,left=50,top=20,scrollbars");
  }
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_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_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();
}

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_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_swapImage2() { //v3.0
  var i,j=0,x,a=MM_swapImage2.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 ZeigePLZ(){
	if(window.document.form1.plz.value.length>=1){
		var plzz=window.document.form1.plz.value.charAt(0);
		var plzz2=window.document.form1.plz.value;
		if(isNaN(plzz2) == true){
  			alert(plzz2 + " ist keine Zahl!");
  			return false;
 		}else{
			plzx=parseInt(plzz);
			MM_showHideLayers('plz'+plzx,'','show');
		
			plzy=0;
			while(plzy <= 9) {
				if(plzx!=plzy){
   					MM_showHideLayers('plz'+plzy,'','hide');
   				}
				plzy++;
 			}
			window.document.form1.bl.value=0;
			ZeigeBl();
			window.document.form1.plz.focus();
		
		}

	}
	if(window.document.form1.plz.value.length==0){
		
		plzx=0;
		while(plzx <= 9) {
   			MM_showHideLayers('plz'+plzx,'','hide');
   			plzx++;
 		}
		
	}
}
function ZeigeBl(){
	if(window.document.form1.bl.value>=1){
		blx=window.document.form1.bl.value;
		MM_showHideLayers('bl'+blx,'','show');
		window.document.form1.bl.focus();
		bly=0;
		while(bly <= 17) {
			if(blx!=bly){
   				MM_showHideLayers('bl'+bly,'','hide');
   			}
			bly++;
 		}
		window.document.form1.plz.value="";
		ZeigePLZ();
	}
	if(window.document.form1.bl.value<1){
		
		blx=0;
		while(blx <= 17) {
   			MM_showHideLayers('bl'+blx,'','hide');
   			blx++;
 		}
		window.document.form1.bl.blur();
	}
}
function ZeigeMaske(){
	if(window.document.form2.maske.value>0){
		maske=window.document.form2.maske.value;
		MM_showHideLayers('maske'+maske,'','show');
		
		maske2=0;
		while(maske2 <= 2) {
			if(maske!=maske2){
   				MM_showHideLayers('maske'+maske2,'','hide');
   			}
			maske2++;
 		}
		window.document.form2.maske.blur();
		
		

	}else{
		
		maske=0;
		while(maske <= 2) {
   			MM_showHideLayers('maske'+maske,'','hide');
   			maske++;
 		}
		window.document.form2.maske.blur();
	}
}

function timer2() {
	//document.zeit.sec.value=counter3;
	URL=document.zeit.loc.value;
	if (counter3 == 0) {
		location.href=URL;
	} else {
		counter3 = counter3 - 1;
		setTimeout("timer()",1000);
	}
}
function MM_timelineStop(tmLnName) { //v1.2
  //Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  if (tmLnName == null)  //stop all
    for (var i=0; i<document.MM_Time.length; i++) document.MM_Time[i].ID = null;
  else document.MM_Time[tmLnName].ID = null; //stop one
}

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}
