/*
* javascript functions
* - mail_zerlegen_link ()
*   maskiert email adressen
* - NeuesFenster()
*   öffnet Fenster für Detailansicht
* programs by Andreas Gonell  mail@surium.de
*/

function mail_zerlegen_link (mailto, name, name_rep, at, at_rep, domain, domain_rep, link)
{
  if (mailto!="") {
    document.write("<a href='" + mailto + name + at + domain + "'" + ">");
  }
  if (link!="") {
    document.write("<a href='" + link + "'" + ">");
  }
  document.write(name_rep + at_rep + domain_rep);
  if (mailto!="" | link!="") {
    document.write("<\/a>");
  }
}

/*  // alt
function fenster(content,breite,hoehe) {
	var links=screen.width/2-breite/2;
	var oben=screen.height/2-hoehe/2;
	NewWin = window.open(content, "graph", "toolbar=no,status=no,resizable=no,width="+breite+",height="+hoehe+",top="+oben+",left="+links);
	NewWin.focus();
}
*/

function NeuesFenster(media, mediatyp, headline) {
  var breite=800;
  var hoehe=495;
  var links=screen.width/2-breite/2;
	var oben=screen.height/2-hoehe/2;
	fenster = open("", "graph", "menubar=yes,toolbar=no,status=no,resizable=yes,width="+breite+",height="+hoehe+",top="+oben+",left="+links);
	fenster.document.open();
	fenster.document.write('<html>\n');
	fenster.document.write('<head>\n');
	fenster.document.write('<title>Pepperl+Fuchs // DART // Media</title> \n');
	fenster.document.write('<style type="text/css"> \n');
	fenster.document.write('body { margin:0; padding:0; } \n');
	fenster.document.write('div { font-family:arial, sans-serif; font-size:12px; } \n');
	fenster.document.write('a { color:#5A6E78; text-decoration:none; } \n');
	fenster.document.write('#headline { color:#5A6E78; font-weight:bold; margin:10px 10px 0 10px; } \n');
	fenster.document.write('#content { width:'+breite+'px; } \n');
	fenster.document.write('#media { margin:10px; } \n');
	fenster.document.write('#close { clear:both; padding-right:50px; text-align:right; } \n');
	fenster.document.write('</style> \n');
	fenster.document.write('</head> \n');
	fenster.document.write('<body> \n');
	fenster.document.write('<div id="content"> \n');
  if (headline) {
  	fenster.document.write('  <div id="headline"> \n');
    fenster.document.write('    '+headline+' \n');
  	fenster.document.write('  </div> \n');
  }
	fenster.document.write('  <div id="media"> \n');
  if (mediatyp=="swf") {
    //fenster.document.write(media);
    fenster.document.write('    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n');
    fenster.document.write('            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" \n');
    fenster.document.write('            width="780" \n');
    fenster.document.write('            height="430" \n');
    fenster.document.write('            id="dart_flash" \n');
	  fenster.document.write('      <param name="allowScriptAccess" value="sameDomain" > \n');
	  fenster.document.write('      <param name="allowFullScreen" value="false" > \n');
	  fenster.document.write('      <param name="movie" value="'+media+'" > \n');
    fenster.document.write('      <param name="wmode" value="window" > \n');
    fenster.document.write('      <param name="quality" value="high" > \n');
    fenster.document.write('      <param name="bgcolor" value="#FFFFFF" > \n');
    fenster.document.write('      <embed src="'+media+'" \n');
    fenster.document.write('             quality="high" \n');
    fenster.document.write('             wmode="window" \n');
    fenster.document.write('             bgcolor="#FFFFFF" \n');
    fenster.document.write('             width="780" \n');
    fenster.document.write('             height="430" \n');
    fenster.document.write('             name="dart_flash" \n');
    fenster.document.write('             allowScriptAccess="sameDomain" \n');
    fenster.document.write('             allowFullScreen="false" \n');
    fenster.document.write('             type="application/x-shockwave-flash" \n');
    fenster.document.write('             pluginspage="http://www.macromedia.com/go/getflashplayer"> \n');
	  fenster.document.write('    </object> \n');
	  //fenster.document.write('    <br> \n');
	  //fenster.document.write('    <br> \n');
  }
  else {
    fenster.document.write('    <img src="'+media+'">\n');
  }
	fenster.document.write('  </div> \n');
	fenster.document.write('  <div id="close"> \n');
	fenster.document.write('    <a href="javascript:window.close()" title="close window">[X]</a>\n');
	fenster.document.write('  </div> \n');
	fenster.document.write('</div> \n');
	fenster.document.write('</body> \n</html> \n');
	fenster.document.close();
	fenster.focus();
}

