//
// Browser Detection
//
var ns = navigator.appName == "Netscape";
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
var ie  = 0;
var ns4 = 0;
var dom = 1;
var ie4 = 0;
var ie5 = 0;
var ope = 0;
var moz = 0;
var bok = 1;
var initdone = false;
var xcenter = 0;

  ie  = (document.all)?true:false;
  ns4 = (document.layers)?true:false;
  dom = (document.getElementById)?true:false;
  ie4 = (document.all && !dom)?true:false;
  ie5 = (dom && navigator.userAgent.indexOf('MSIE 5')>0);
  ope = (dom && navigator.userAgent.indexOf('Opera')>0);
  moz = (dom && navigator.userAgent.indexOf('Gecko')>0);
  bok = ns4 || ie4 || dom;

var fotofenster =null;

function getxpos()
{
  x1=0;
  var ppic=getobj("l1");

  if (ns4) {
    x1 = document.l1.pageX;

  } else {
    for (obj = ppic, x1=0;  obj.tagName != 'BODY'; obj = obj.offsetParent){
      x1 += obj.offsetLeft;
    };
  };

  return x1
}

function getypos()
{
  y1=0;
  var ppic=getobj("l1");

  if (ns4) {
    y1 = document.l1.pageY;
  } else {
    for (obj = ppic, y1=0;  obj.tagName != 'BODY'; obj = obj.offsetParent){
      y1 += obj.offsetTop;
    };
  };

  return y1
}


// WindowAttributes() creates universal accessible window attribute objects
function WindowAttributes() {
	if (ns == false) {
		this.width = document.body.clientWidth;
		this.height	= document.body.clientHeight;
		}
	else  {
		this.width = window.innerWidth
		this.height = window.innerHeight
		}
	}

function reloadPage(init) {
  if (init==true) onresize=reloadPage;
  else location.reload();
}
reloadPage(true);


// Get object by ID
function getobj(hname) {
  if (ns4) return eval("document."+hname);
  else if (ie4) return document.all[hname]
  else if (dom) return document.getElementById(hname);
};



// Make an object visible
function showObj(obj) {
  if (ns4) obj.visibility = "show"
  else obj.style.visibility = "visible";
};

// Hide an object
function hideObj(obj) {
  if (ns4) obj.visibility = "hide"

  else obj.style.visibility = "hidden";
};

// Move an object X
function moveObjX(obj,x) {
  if (ns4)
  {
    obj.left = x;
  } else
  {
    obj.style.left = x;
  };
};

function moveObjY(obj,y) {
  if (ns4)
  {
    obj.top = y;
  } else
  {
    obj.style.top = y;
  };
};


function istleer(s)
{
  for (var i = 0; i < s.length; i++)
  {
    var c = s.charAt(i);
    if ((c != ' ') && (c != '\\n') && ( c!= '\t')) return false;
  }
  return true;
}


function istzahl(s)
{
  if ((s==null) || (s=='') || istleer(s)) return false;
  var v=parseInt(s,10);
  if (isNaN(v)) return false;
  return true;
}

//--------------------------------------------------------------------
// Zeigt ein neues Fenster für Fotos an

function show_window(name,title,x,y)
{
 par ='width='+x+',height='+y+', menubar=no,resizable=no,statusbar=no,scrollbars=no;';

 if (fotofenster != null)
 {
   if (fotofenster.closed==false) { fotofenster.close()}
 }

 fotofenster=window.open('','foto',par);
 fotofenster.focus();

 fotofenster.document.writeln('<html>');
 fotofenster.document.writeln('<head>');
 fotofenster.document.writeln('<title>'+title+'</title>');

 fotofenster.document.writeln('</head>');
 fotofenster.document.writeln('<body style="margin:0px 0px 0px 0px" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" bgcolor = "#000000"><center>');
// h.document.writeln('<body style="margin:0px 0px 0px 0px" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" onload="window.resizeTo('+x+','+y+')">');

 s ='<a href="#" onClick="self.close();"><img src = "'+name+'" border="0" alt = "Anklicken zum Schliessen"></a>';
 fotofenster.document.writeln(s);
 fotofenster.document.writeln('</body>');
 fotofenster.document.writeln('</html>');
// h.resizeTo(x,y);

 fotofenster.document.close();
 fotofenster.focus();

}





