/* $Id: popup.js 10 2006-06-13 06:41:20Z sacher $ */

function PopThisUp(a,breite,hoehe){return PopUp(a.href,breite,hoehe);}

function PopUp(link, breite, hoehe) {
	if (navigator.appName == 'Netscape') {
		var url=link;
		var win='left=290,top=150,toolbar=0,directories=0,menubar=0,scrollbars=0,width='+(breite+15)+',height='+(hoehe+15)+',resizable=0';
		open(url,'Panorama', win);
	}
	else {//internet explorer oder andere
		var url=link;
		var win='left=290,top=150,toolbar=0,directories=0,menubar=0,scrollbars=0,width='+breite+',height='+hoehe+',resizable=0';
		open(url,'Panorama', win);
	}
}

function ScrollPopUp(link, breite, hoehe) {
	if (navigator.appName == 'Netscape') {
		var url=link;
		var win='left=290,top=150,toolbar=0,directories=0,menubar=0,scrollbars=yes,width='+(breite+15)+',height='+(hoehe+15)+',resizable=0';
		open(url,'Panorama', win);
	}
	else {//internet explorer oder andere
		var url=link;
		var win='left=290,top=150,toolbar=0,directories=0,menubar=0,scrollbars=yes,width='+breite+',height='+hoehe+',resizable=0';
		open(url,'Panorama', win);
	}
}

function CenterPopUp(link, breite, hoehe) {
    var h_size = screen.availWidth;
    var v_size = screen.availHeight;

     if (navigator.appName == 'Netscape') {
		var url=link;
		var win='left='+(h_size-breite)/2+',top='+(v_size-hoehe)/2+' ,toolbar=0,directories=0,menubar=0,scrollbars=0,width='+(breite+15)+',height='+(hoehe+15)+',resizable=0';
		open(url,'Panorama', win,  onBlur="self.close()");
	}
	else {//internet explorer oder andere
		var url=link;
		var win='left='+(h_size-breite)/2+',top='+(v_size-hoehe)/2+' ,toolbar=0,directories=0,menubar=0,scrollbars=0,width='+breite+',height='+hoehe+',resizable=0';
		open(url,'Panorama', win,  onBlur="self.close()");
	}
}

function ScrollCenterPopUp(link, breite, hoehe) {
    var h_size = screen.availWidth;
    var v_size = screen.availHeight;

     if (navigator.appName == 'Netscape') {
		var url=link;
		var win='left='+(h_size-breite)/2+',top='+(v_size-hoehe)/2+' ,toolbar=0,directories=0,menubar=0,scrollbars=yes,width='+(breite+15)+',height='+(hoehe+15)+',resizable=0';
		open(url,'Panorama', win);
	}
	else {//internet explorer oder andere
		var url=link;
		var win='left='+(h_size-breite)/2+',top='+(v_size-hoehe)/2+' ,toolbar=0,directories=0,menubar=0,scrollbars=yes,width='+breite+',height='+hoehe+',resizable=0';
		open(url,'Panorama', win);
	}
}

var pictureWindowFever = false;
var pictureWindowFeverBildwechselId = false;
function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop+",status=no");
	newWindow.document.open();
	newWindow.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');
	newWindow.document.write('<html><title>'+alt+'</title><body style="background-color: #FFFFFF; margin:0 ; padding:0;" onBlur="self.close()">');
	newWindow.document.write('<img id="pictureWindowFever" src="'+imageName+'" width="'+imageWidth+'" height="'+imageHeight+'" alt="'+alt+'">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
	pictureWindowFever = newWindow;
	pictureWindowFeverBildwechselId = false;
}

/* ronald sacher */
function openPictureWindow_Fever2(img, imageWidth,imageHeight,alt,posLeft,posTop) {
	file = convertPictureName(img.src);
	if (typeof alt=="undefined") alt = img.alt;
	if (typeof posLeft=="undefined") posLeft = '200';
	if (typeof posTop=="undefined") posTop = '200';
	openPictureWindow_Fever(file,imageWidth,imageHeight,alt,posLeft,posTop)
	pictureWindowFeverBildwechselId = img.id;
}

function openPictureWindow_FeverCenter(img, imageWidth,imageHeight) {
	var left = (screen.availWidth-imageWidth)/2;
	var top = (screen.availHeight-imageHeight)/2;
	if (navigator.appName == 'Netscape') {
	 	imageWidth = (imageWidth+15);
		imageHeight = (imageHeight+15);
	}
	openPictureWindow_Fever(img,imageWidth,imageHeight,'',left,top);
}

function convertPictureName(imgsrc) {   return(imgsrc.replace(/(\d*)[n,m,k](\d*)\./, '$1g$2.'));	}

/*Steffen Quade - Popup Funktion von Dreamweaver*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showDescrCT(caption, text) {
	return overlib(text, CAPTION, caption, HAUTO, VAUTO);
}

/* Steffen Quade / Ronald Sacher */
function showDescrOVL(text1, text2) {
	var headlineFirst = text1.length<text2.length;
	if ( headlineFirst ) { var caption = text1; var text = text2; }
	else { var caption = text2; var text = text1; }
	return showDescrCT(caption, text);
}

function showDescrOVLHeadFirst(caption, text) { return showDescrCT(caption, text); }
function showDescrOVLTextFirst(text, caption) { return showDescrCT(caption, text); }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
