/* $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+',height='+hoehe+',resizable=0';
//		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 show_This_Img_Big(img, width, height) {
	var img = convertPictureName(img.src);
	return overlib(' ',BORDER, 2, FGBACKGROUND, img, WIDTH, width, HEIGHT, height, BGCOLOR, '#FFFFFF', HAUTO, VAUTO);
}

/* Ronald Sacher */

function newWindow(a) {
			var winprops = 'scrollbars=yes,resizable=yes,hotkeys=yes,menubar=yes,status=yes,location=yes';
			window.open(a.href,'newWindow',winprops);
			return false;
		}
function changePano(index, title, href) {
			document.ptviewer.newPanoFromList(index);
			var a = document.getElementById('object_link');
			if (a) {
				a.innerHTML = title;
				a.href = href;
			}
			return false;
		}
