
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
var mylink = mypage+'&popup=1';
win = window.open(mylink,myname,settings)
if(win.window.focus){win.window.focus();}
}

function dropdown_value(feldname)
{
var feld=document.getElementsByName(feldname)[0];
return(feld.value);
}

function dropdown_text(feldname)
{
var feld=document.getElementsByName(feldname)[0];
var x = feld.selectedIndex;
return(feld[x].text);
}

function makebild(bild,name,width,height)
	{
	var leftpos = (screen.width) ? (screen.width-width)/2 : 0;
	var toppos = (screen.height) ? (screen.height-height)/2 : 0;
        picwin = window.open("/pages/bildextern.php3?image="+bild+"&name="+escape(name),"bild","resizable=no,width="+width+",height="+height+",status=0,menubar=0,scrollbars=0,left="+leftpos+",top="+toppos+"");
        }
 
function maildecode (input)
	{
	var output=input;
	output=output.replace(/\|/, '@');
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	output=output.replace("#xxcom#", ".");
	return (output);
	}

function writemaillink ($input,$forceshow)
	{
	if ($forceshow=="")
		{
		$showmail=maildecode($input);
		$showmail=$showmail.replace('@','&#64;');
		$showmail=$showmail.replace(/\./,'&#46;');
		$showmail=$showmail.replace(/\?.*/,'');
		}
	else
		{
		$showmail=$forceshow;
		
		}
	document.write ("<a href=\"javascript:makemail('"+$input+"')\">");
	document.write($showmail);
	document.write ('</a>');
	}

function makemail($link)
	{
	$link=maildecode($link);
	this.location.href="mailto:"+$link;
	}
	
function open_calendar(feld)
	{
	var wert = document.getElementsByName(feld)[0].value;
	if ((wert.charAt(2) == ".") && (wert.charAt(5) == "."))
		{
		var my_wert = wert;
		}
	else
		{
		var my_wert = wert.substr(0,2) + "." + wert.substr(2,2) + "." + wert.substr(4,2);
		}
	NewWindow('/webcal.exe?PAGE=calendar.htm&VARNAME='+feld+'&DATE='+my_wert+'&MONTHNAME=1&SHOWHEADER=0&DFORMAT=DD.MM.YYYY', 'calendar', 240, 240, 'no', 'no');
	}
	
function holehoehe()
	{
	var winH = 0;
	if (window.innerHeight) {
	    winH =  window.innerHeight - 242;
	  } else if (document.body && document.body.offsetHeight) {
	    winH =  document.body.offsetHeight + 144;
	  } else {
	    winH = 300;
	  }
	if (winH>0) 
		{
		//alert (winH);
		var sizer=winH;
		document.write('<br><img src="../../../../images/layout/spacer.gif" alt="" width="25" height="'+sizer+'">');
		}
	}
	
function popup_bos(the_checkbox)
	{
	var win = null;
	var w = 700;
	var h = 530;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,menubar=0,toolbar=0,resizable=0,'
        win = window.open('bos-formular.html','popup',settings);
        window.document.form1.my_checkbox.value = the_checkbox;
        if(win.window.focus){win.window.focus();}
	}
	
function popup(the_page)
	{
	var win = null;
	var w = 640;
	var h = 640;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,menubar=0,toolbar=0,resizable=0,'
        win = window.open(the_page,'popup',settings);
        if(win.window.focus){win.window.focus();}
	}
