/* Netscape 4 Fix */

function resizeFix(init) 

{	

	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.pgW=innerWidth; document.pgH=innerHeight; onresize=resizeFix; }}

	else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();

}

resizeFix(true);



/* FCK Editor Window: */

function rte_open(URL, width, height) 

{

	var breite = width;

	var hoehe = height;

	var positionX=((screen.availWidth / 2) - breite / 2);

	var positionY=((screen.availHeight / 2) - hoehe / 2);



	popup = window.open(URL,'WYSIWYG','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,fullscreen=no,width='+breite+',height='+hoehe+',top='+positionY+',left='+positionX);



	popup.resizeTo(breite,hoehe);

	popup.moveTo(positionX,positionY);

};



/* Druckversion Window: */

function print_open(URL) 

{

	var breite = 560;

	var hoehe = 700;

	var positionX=((screen.availWidth / 2) - breite / 2);

	var positionY=((screen.availHeight / 2) - hoehe / 2);



	popup = window.open(URL,'Druckversion','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width='+breite+',height='+hoehe+',top='+positionY+',left='+positionX);



	popup.resizeTo(breite,hoehe);

	popup.moveTo(positionX,positionY);

};



/* Tell-A-Friend Window: */

function taf_open(URL, width, height) 

{

	var breite = width;

	var hoehe = height;

	var positionX=((screen.availWidth / 2) - breite / 2);

	var positionY=((screen.availHeight / 2) - hoehe / 2);



	popup = window.open(URL,'Weiterempfehlen','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,fullscreen=no,width='+breite+',height='+hoehe+',top='+positionY+',left='+positionX);



	popup.resizeTo(breite,hoehe);

	popup.moveTo(positionX,positionY);

};

/* XMENU Drop-Down goto URL */

function xjumpMenu(targ,selObj,restore)

{

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

  	if (restore) selObj.selectedIndex=0;

};

function mt(subject,name,body,domain) {
  location.href = 'mailto:' + name + '@' + domain + '?subject=' + subject + '&body=' + body.replace(/###Zeilenschaltung###/g, "%0D%0A");
};

function mit0(n){
  return (n<10?"0"+n.toString():n.toString());
};
function clock(){
	var time = new Date (); 
	var mins = time.getMinutes();
	var hr = time.getHours(); 
  var d=time.getDate();
  var m=time.getMonth()+1;
  var wd = time.getDay();
  var y=time.getYear();
  var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch","Donnerstag", "Freitag", "Samstag");

	document.getElementById("uhr").innerHTML=" "+Wochentag[wd]+" "+mit0(d)+"."+mit0(m)+"."+mit0(y % 100)+" "+mit0(hr)+":"+mit0(mins);
	setTimeout('clock()', 10000);
};

function Add_A_Favorite() 
{ 
if (window.external) 
// if the browser is IE open the add favorite window
{
x1='http://www.stoffwechsel-muenchen.de/index.html';
location.href='http://www.stoffwechsel-muenchen.de/index.html';
external.AddFavorite(x1, 'stoffwechsel secondhand');
}
else 
{
alert("Ihr Browser unterstützt diese Funktion leider nicht." + 
"\nBenutzen Sie bitte das Menü ihres Browsers um ein Lesezeichen für diese Seite anzulegen.\nIm Nescape-Browser ist es die Tastenkombination 'Strg+D' bzw. 'Ctrl+D' oder\ndrücken Sie die rechte Maustaste und dann 'Lesezeichen hinzufügen' bzw. 'Bookmark This Page'");
}};

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_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);
};

