/*
// Copyright (c) Thomas Ule, 2003-2007. All rights reserved
// 
// bahnen ; Last Update: 11.06.2007 
*/

function newWindow(url, title)
{
	x = screen.width;
	y = screen.height;
	
	myTitle = typeof(title) == "undefined" ? "notitle" : title; 
	
	myImg = new Image();
	myImg.src = url;				/* load image */
	myImg.onload = createWin;		/*  if ready, trigger window */ 
  
   return (myImg.src) ? false : true;
}

function createWin()
{

	xp = myImg.width;
	yp = myImg.height;     
     
     	if (myTitle == "notitle"){			/* no title present */
			    var myShort = myImg.src.split("/");
			    myTitle = myShort[myShort.length -1] + " (" + (xp) + " x " + (yp) + ")";
			    }
			    
  var x0 = (x - xp)/2; 
  var y0 = (y - yp - 17)/2;     /* header */


  if (x0 < 0)  x0 = 0; 
  if (y0 < 0)  y0 = 0; 
  var myscroll = 'no';
    
  if (xp >  x) { 
		    myscroll = 'yes';
		    yp =yp +16;        /* scrollbar */
		   }
      
   if (yp > y) { if ( myscroll == 'no' ) {myscroll = 'yes'; 
						     xp = xp +16;        /* scrollbar */
						    }
		   }
     
   var w = window.open(myImg.src, '', 'width=' + xp + ',height=' + yp + ',left=' + x0 + ',top=' + y0 + ',scrollbars=' + myscroll + ',status=no,toolbar=no,location=no,directories=no,menubar=no,dependent=yes,resizable=no');
   w.document.open();
   w.document.write('<html><head>');
   w.document.write('<title>' + myTitle + '</title>'); 
   w.document.write('</head><BODY onLoad="self.focus();" onBlur="self.close();" BGCOLOR="#FFFFFF" TEXT="#000000">');
   w.document.write('<div style="position:absolute; left:0px; top:0px">');
   w.document.write('<img src="' + myImg.src + '" alt="' + myTitle + '" title="' + myTitle + '">');
   w.document.write("</body></html>");
   w.document.close();
   myImg.src = "";			/* remove url (only IE) */
}

function output(text, color, type, cursor)
{
var length;

color = typeof(color) == "undefined" ? "#000000" : color;
type = typeof(type) == "undefined" ? "normal" : type;
cursor = typeof(cursor) == "undefined" ? "auto" : cursor;

if (text.length > 5){ length = text.length +1;}
else { length = 40;}
document.getElementById('plan').style.cursor = cursor;
if (document.getElementById("profil")) document.getElementById("profil").style.cursor = cursor;
if (document.getElementById("plan2")) document.getElementById("plan2").style.cursor = cursor;

if ( document.getElementsByName("infoline")[0] ){
document.getElementsByName("infoline")[0].style.color = color; 
document.getElementsByName("infoline")[0].style.fontWeight = type; 
document.getElementsByName("infoline")[0].size = length;
document.getElementsByName("infoline")[0].maxLength = length;
document.getElementsByName("infoline")[0].value = text; }

if ( document.getElementsByName("infoline")[1] ){
	document.getElementsByName("infoline")[1].style.color = color; 
	document.getElementsByName("infoline")[1].style.fontWeight = type; 
	document.getElementsByName("infoline")[1].size = length;
	document.getElementsByName("infoline")[1].maxLength = length;
	document.getElementsByName("infoline")[1].value = text; }

if ( document.getElementsByName("infoline")[2] ){
	document.getElementsByName("infoline")[2].style.color = color; 
	document.getElementsByName("infoline")[2].style.fontWeight = type; 
	document.getElementsByName("infoline")[2].size = length;
	document.getElementsByName("infoline")[2].maxLength = length;
	document.getElementsByName("infoline")[2].value = text; }
return true;
}


