// Example: obj = findObj("image1");

function findObj(theObj, theDoc)

{

  var p, i, foundObj;

  

  if(!theDoc) theDoc = document;

  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)

  {

    theDoc = parent.frames[theObj.substring(p+1)].document;

    theObj = theObj.substring(0,p);

  }

  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];

  for (i=0; !foundObj && i < theDoc.forms.length; i++) 

    foundObj = theDoc.forms[i][theObj];

  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 

    foundObj = findObj(theObj,theDoc.layers[i].document);

  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  

  return foundObj;

}

function getDocumentSize(){
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	var sizeArr = new Array(x,y);
	return sizeArr;
}




function placeTitle() {
	$w_size = getDocumentSize();
	var layer = findObj('Layer1');
	layer.style.left = ($w_size[0] - 180);
}

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height) {

  if(left == 1) left = (screen.width/2) - width/2;
  if(top == 1) top = (screen.height/2) - height/2;

  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  if(popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'')){
	  	popUpWin.focus();
  } else {
		alert('Diese Seite wird in einem PopUp Fenster angezeigt.\nDeaktivieren Sie bitte Ihren PopUp Blocker.');  
  }
}

