// WinOpen-Funktion
function winOpen(theURL,winName,features) { 
var win;
win = window.open(theURL,winName,features);
win.focus();
}

//Druckfunktion

function Drucken()
{
var s;
var s1;

s = window.document.URL;
if(document.PrintInformation)
{
  if(s.indexOf("?") > 1)
    s += "&PostData=|||" + document.PrintInformation.PostData.value + "|||"
  else
    s += "?PostData=|||" + document.PrintInformation.PostData.value + "|||"
}
s1 = "";

for ( i = 0; i < s.length; i++ )
{
  if ( s.charAt(i) == "?" )
  {
  	s1 = s1 + "~";
  }
  else
  {
    if ( s.charAt(i) == "&" )
	{
		s1 = s1 + "$";
	}
	else
	{
	  if ( s.charAt(i) == "=" )
	  {
	  	s1 = s1 + "|";
	  }
	  else
	  {
	     s1 = s1 + s.charAt(i);
	  }
    }
  }
}
url = "http://www.bamaka.de/do/drucken/druck.asp?docname=" + s1;
if(document.location.href.indexOf("/gbr/") > 0) {
url += "&logo="  + 'http://www.bamaka.de/img/gbr/logo.gif';
}
else {
url += "&logo="  + 'http://www.bamaka.de/img/ag/logo.gif';
}


if ( navigator.appName.indexOf("Netscape") != -1 )
{param="location=no,menubar=no,status=no,toolbar=yes,scrollbars=yes,dependent=yes,width=643,height=600,screenX=180,screenY=30";}
else
{param="location=no,menubar=no,status=no,toolbar=yes,scrollbars=yes,dependent=yes,width=643,height=600,screenX=180,screenY=30";}
newWindow(url,"Drucken",param);
}

function Drucken_erHandler(){
alert('test')
url += "&weite=" + '323';
url += "&logo="  + 'http://ksk2001net/sysimg/homepage/spark_schrift.GIF';

if ( navigator.appName.indexOf("Netscape") != -1 )
{param="location=no,menubar=no,status=no,toolbar=yes,scrollbars=yes,dependent=yes,width=643,height=600,screenX=180,screenY=30";}
else
{param="location=no,menubar=no,status=no,toolbar=yes,scrollbars=yes,dependent=yes,width=643,height=600,screenX=180,screenY=30";}
newWindow(url,"Drucken",param);
}

function newWindow(theURL,winName,features)
{
winName = window.open(theURL,winName,features);
if(winName == null || winName.closed){window.open(theURL,winName,features);}  
else{winName.location.href = theURL;}  
if (!winName.closed) 
winName.focus();
}

function moveWindowRight(width){
window.onerror = moveWindow_erHandler;
var wi;
if(!parent.opener.parent.inhalt!=true){
  if(navigator.appName=='Netscape')wi=parent.opener.parent.innerWidth
  else wi=parent.opener.parent.document.body.offsetWidth;
  if(parseInt(navigator.appVersion) >= 4){self.moveTo(wi - width - 10,100);}
}
}
function moveWindow_erHandler(){
}

function winOpen(theURL,winName,features) { 
window.onerror = winOpen_errHandler;
if(!parent.kopf==false){
	parent.kopf.newWindow(theURL,winName,features)
	}
else{
	newWindow(theURL,winName,features)
	}
}
function winOpen_errHandler(){
newWindow(theURL,winName,features)
}