function show_pic(id) {
	var element = document.getElementById('main_pic');
	element.style.visibility = 'visible';

	switch(id) {
		case '1':
			element.innerHTML = '<img src="images/kloth.jpg">';
			break;
		case '2':
			element.innerHTML = '<img src="images/treppenmeister.jpg">';
			break;
		case '3':
			element.innerHTML = '<img src="images/reisebuero.jpg">';
			break;
		case '4':
			element.innerHTML = '<img src="images/burgapo.jpg">';
			break;

		default:
			element.innerHTML = '';
	}

	return true;
}

function del_pic() {
	var element = document.getElementById('main_pic');
	element.style.visibility = 'hidden';

	return true;
}

 function openFenster(URLtoOpen, f, w_width, w_height) {
        if ((Fenster[f] == null) || (Fenster[f].closed)) {
          if (f == 0) {
            Fenster[f] = open(URLtoOpen,"_blank","toolbar=no,width="+w_width+",height="+w_height+",screenX=137,screenY=134,resizable=no,scrollbars=no,menubar=no,directories=no,location=no");
          }
          else {
            Fenster[f] = open(URLtoOpen,"_blank","toolbar=no,width="+w_width+",height="+w_height+",screenX=137,screenY=134,resizable=no,scrollbars=yes,menubar=no,directories=no,location=no");
          }
        }
        Fenster[f].moveTo((screen.width - 750) / 2, (screen.height - 500) / 2);
        Fenster[f].focus();
  }

  function openGalerieFenster(bild,titel,text, w_width, w_height) {
	openGalerieFensterMain(bild,titel,text, w_width, w_height);
  }

  function openGalerieFensterMain(bild,titel,text, w_width, w_height) {
	openFenster("", 0, w_width, w_height);
	//titel = document.images[bild].src.substring(0,document.images[bild].src.length - 3);
	//alert(titel);
	if (bild.indexOf(".") == -1) {
	  thumb = document.images[bild].src;
	  bildsrc = thumb.substring(0,thumb.length - 4) + "XL" + thumb.substring(thumb.length - 4,thumb.length);
	  thumbW = document.images[bild].width;
	  thumbH = document.images[bild].height;
	  if ((thumbW / 700) > (thumbH / 400)) {
		bildW = 700;
		bildH = Math.floor(thumbH / (thumbW/700));
	  }
	  else {
		bildH = 400;
		bildW = Math.floor(thumbW / (thumbH/400));
	  }
	  bildWstr = " width='" + String(bildW) + "' ";
	  bildHstr = " width='" + String(bildH) + "' ";
	}
	else {
	  bildsrc = bild;
	  bildWstr = "";
	  bildHstr = "";
	}
	Fenster[0].document.writeln("<html>");
	Fenster[0].document.writeln("  <head>");
	Fenster[0].document.writeln("    <title>" + titel + "</title>");
	Fenster[0].document.writeln("    <style type='text/css'>");
	Fenster[0].document.writeln("      .titel {font-family:georgia,times,serif; font-size:9pt; color:#ffffff;}");
	Fenster[0].document.writeln("      a:link,a:visited,a:active {font-family:georgia,times,serif; font-size:9pt; color:#CCCCCC; text-decoration:none;}");
	Fenster[0].document.writeln("      a:hover {font-family:georgia,times,serif; font-size:9pt; color:#ffffff; text-decoration:underline;}");
	Fenster[0].document.writeln("    </style>");
	Fenster[0].document.writeln("  </head>");
	Fenster[0].document.writeln("  <body bgcolor='#E0FF9F' style='margin:0px;'>");
	Fenster[0].document.writeln("   <table border='0' bgcolor='#5A6640' cellpadding='1' cellspacing='0'><tr><td>");
	Fenster[0].document.writeln("    <table border='0' cellpadding='0' cellspacing='0'>");
	Fenster[0].document.writeln("      <tr>");
	Fenster[0].document.writeln("        <td colspan='3' align='center' valign='middle' bgcolor='#EBFFBF'>");
	Fenster[0].document.writeln("          <img src='" + bildsrc + "' border='0' " + bildWstr + bildHstr + "><br>");
	Fenster[0].document.writeln("        </td>");
	Fenster[0].document.writeln("      </tr>");
	Fenster[0].document.writeln("      <tr>");
	Fenster[0].document.writeln("        <td height='20' width='50' align='center' valign='middle' bgcolor='#5A6640' class='titel'>");
	Fenster[0].document.writeln("          &nbsp;");
	Fenster[0].document.writeln("        </td>");
	Fenster[0].document.writeln("        <td height='20' width='400' align='center' valign='middle' bgcolor='#5A6640' class='titel'>");
	Fenster[0].document.writeln("          " + text);
	Fenster[0].document.writeln("        </td>");
	Fenster[0].document.writeln("        <td height='20' width='50' align='center' valign='middle' bgcolor='#5A6640'>");
	Fenster[0].document.writeln("          <a href='javascript:window.close();' class='header'><img src='images/back2.gif' border='0'></a>&nbsp;&nbsp;");
	Fenster[0].document.writeln("        </td>");
	Fenster[0].document.writeln("      </tr>");
	Fenster[0].document.writeln("    </table>");
	Fenster[0].document.writeln("   </td></tr></table>");
	Fenster[0].document.writeln("  </body>");
	Fenster[0].document.writeln("</html>");
  }


function openWin(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=no,width=" + w + ",height=" + h)
  newWin.focus()
}
