function schliessen(element) {document.getElementById(element).innerHTML='';document.getElementById(element).outerHTML='<div id="'+element+'"></div>';}
function oeffnen(element,file,breite,hoehe,name,titlealt) {
var ausfuehren=1;
if (!document.getElementById(element)) {ausfuehren=0;alert('show media not possible. please report.');}
file.replace('%2E','.');
nPos=file.lastIndexOf('.');
var type=file.substr(nPos+1);
var divhead1='<div id="'+element+'" name="'+element+'" style="position:fixed;left:25px;top:25px;width:'+breite+'px;heigth:'+hoehe+'px;z-index:2000;';
var divhead2='"><div align="right"><span class="closeDIV"><a href="javascript:schliessen(';
switch (type) {
case "divx":
type='video/divx';
var codebase='http://go.divx.com/plugin/DivXBrowserPlugin.cab';
var pluginpage='http://go.divx.com/plugin/download/';
var classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616';
var string=divhead1+divhead2+"'"+element+"'"+')">close[x]</a></span><br><object classid="'+classid+'" width="'+breite+'" height="'+hoehe+'" codebase="'+codebase+'"><param name="previewImage" value="" /><param name="loop" value="true" /><param name="autoPlay" value="true"/><param name="allowContextMenu" value="true"/><param name="src" value="'+file+'"/><embed type="'+type+'" width="'+breite+'" src="'+file+'" height="'+hoehe+'" previewImage="" loop="true" allowContextMenu="true" autoPlay="true" pluginspage="'+pluginpage+'"></embed></object></div></div>';
break;
case "swf":
type='application/x-shockwave-flash';
var codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0';
var pluginpage='http://www.macromedia.com/go/getflashplayer';
var classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
var string=divhead1+divhead2+"'"+element+"'"+')">close[x]</a></span><br><object classid="'+classid+'" width="'+breite+'" height="'+hoehe+'" codebase="'+codebase+'"><param name="movie" value="'+file+'"><param name="quality" value="high"><param name="LOOP" value="false"><embed name="embflash" id="embflash" src="'+file+'" quality="high" loop="false" pluginspage="'+pluginpage+'" type="'+type+'" width="'+breite+'" height="'+hoehe+'"></embed></object></div></div>';
break;
case "m4v":
var divhead1='<div id="'+element+'" name="'+element+'" style="position:fixed;left:25px;top:25px;width:'+breite+'px;heigth:'+hoehe+'px;z-index:2000;border-bottom: 1px solid rgb(0,0,0);';
type='application/x-shockwave-flash';
var codebase='';
var pluginpage='';
var classid='';
var string=divhead1+divhead2+"'"+element+"'"+')">close[x]</a></span><br><embed src="'+file+'" type="'+type+'" width="'+breite+'" height="'+hoehe+'" allowscriptaccess="always" allowfullscreen="true"></embed></div></div>';
break;
case "jpg":
case "JPG":
type='image/jpg';
var string=divhead1+'cursor:-moz-zoom-out;'+divhead2+"'"+element+"'"+')">close[x]</a></span><br><img src="'+file+'" alt="'+titlealt+'" title="'+titlealt+'" onclick="javascript:schliessen('+"'"+element+"'"+')""  width="'+breite+'" height="'+hoehe+'" border=1 /></div></div>';
break;
default:
alert("unknown typ. please report.");ausfuehren=0;
break;}
if (ausfuehren == 1) document.getElementById(element).innerHTML=string;
}
