function OpenFoto(img){
foto= new Image();
foto.src=(img);
ControlFoto(img);
}

function ControlFoto(img){
if((foto.width!=0)&&(foto.height!=0)){
ViewFoto(img);
}
else{
interval_a="ControlFoto('"+img+"')";
interval_b=setTimeout(interval_a,20);
}
}
function ViewFoto(img){
width=foto.width+20;
height=foto.height+24;

try {
if (output.closed == false) throw "offen";
}
catch (e) {
if (e=="offen") {
output.close();
}
}
output=window.open("","output","left=40,top=40,width="+width+",height="+height+",location=no,toolbar=no,menubar=no,status=no,scrol lbars=no,resizable=no");
output.document.writeln("<html><head><title>   Foto   <\/title><\/head>");
output.document.writeln("<body bgcolor=\"white\" text=\"white\" link=\"white\" vlink=\"white\" alink=\"white\" leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\">");
output.document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">");
output.document.writeln("<tr><td width=\"100%\" height=\"100%\" align=\"left\" valign=\"top\"><p><a href=\"javascript:self.close()\"><img src=\""+img+"\" width=\""+foto.width+"\" height=\""+foto.height+"\" border=\"10\" alt=\"click here to close the window\"></a><\/p><\/td><\/tr>");
output.document.writeln("<\/table><\/body><\/html>");
output.focus();
}
//----fertig bilderscript----////

var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;


//Formularfelder des Loginfensters
function loginUserClick() {

	if(document.login.txtUsername.value == "Benutzername") 
	{
		document.login.txtUsername.value = ("");
	}
	else
	{
		if(document.login.txtUsername.value == "")
		{
			document.login.txtUsername.value = ("Benutzername");
		}
	}

}

function loginUserBlur() {
	if(document.login.txtUsername.value == "") 
	{
		document.login.txtUsername.value = ("Benutzername");
	}
}

function loginPasswordClick() {
	if(document.login.txtPassword.value == "Passwort") 
	{
		document.login.txtPassword.value = ("");
	}
	else
	{
		if(document.login.txtPassword.value == "")
		{
			document.login.txtPassword.value = ("Passwort");
		}
	}

}

function loginPasswordBlur() {
	if(document.login.txtPassword.value == "") 
	{
		document.login.txtPassword.value = ("Passwort");
	}
}
