<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>{#MpTitle#}</title>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="imagetoolbar" content="no" />
<meta name="generator" content="Koobi">
<meta name="copyright" content="dream4">
<meta name="Expires" content="Mon, 06 Jan 1990 00:00:01 GMT"> 
<link href="{$tpl_dir}css/style.css" rel="stylesheet" type="text/css">
<script src="{$tpl_dir}js/cpcode.js" type="text/javascript"></script>
<script src="{$tpl_dir}overlib/overlib.js" type="text/javascript"></script>

</head>
<body class="mediapool_body" oncontextmenu="return false">
<form style="display:inline;" name="dat" onSubmit="return false;">
  <input type="hidden" name="dateiname" />
  <table width="100%"  border="0" cellspacing="2" cellpadding="2">
    <tr valign="top">
      <td width="100%">
	  
	  <div class="mediapool_leftframe">
          <iframe frameborder="0" name="zf" id="zf" width="100%" style="height:520px" src="?noout=1&do=browser&pop=1&typ={$smarty.request.typ}&dir=/&action=list"></iframe>
        </div></td>
      {if $smarty.request.typ!='all'}
      <td width="1%">
	  <div class="mediapool_rightframe">
      <div class="header">{#MpPreview#}</div>

		<iframe frameborder="0" width="100%" style="height:497px; background:#fff" name="vs" id="vs"></iframe>
        </div>
	  </td>
      {/if} </tr>
  </table>

{if $smarty.request.typ!=''}
<table width="100%" border="0" cellpadding="2" cellspacing="1">
  <tr>
    <td width="100"><input type="button" class="button" onClick="submitTheForm();" value="{#MpGetFile#}" /></td>
    <td>
	<span class="mediapool_selected_file"  id="arbeitsverzeichnis"></span>
	<input type="text" name="fn" size="20" style="width:200px;"  readonly="readonly" disabled="disabled" class="mediapool_selected_file" />    </td>
    <td align="right">
	{if perm('mediapool_folder')}<input type="button" class="button" onClick="NewFolder();" value="{#NewFolder#}"  />{/if}
   {if perm('mediapool_upload')}<input type="button" class="button" onClick="updlg();" value="{#FileUpload#}" />{/if}
	</td>
  </tr>
</table>





{/if}

</form>

<script language="JavaScript" type="text/javascript">
	function submitTheForm()
	{ldelim}
		if (document.dat.fn.value == '') 
		{ldelim}
			alert('{#MpNoFile#}');
		{rdelim} 
		else 
		{ldelim}
		
		{if $smarty.request.fillout=='textfield'}
		window.opener.document.dokument['{$smarty.request.target}'].value = document.dat.dateiname.value + document.dat.fn.value;
		{else}
			{if $smarty.request.target=='filename'}
				// ALT --> {$koobipath}
				window.opener.document.target['f_href'].value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				//window.opener.updatePreview();
			{elseif $smarty.request.target=='link'}
			//txtLnkUrl // ALT --> {$koobipath}
			window.opener.document.getElementById('txtUrl').value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				setTimeout("self.close();", 100);	
				window.opener.UpdatePreview();
			
			{elseif $smarty.request.target=='txtUrl'}
				{if $smarty.request.nosource=='1'}
				{if $smarty.request.typ=='datei'}
					window.opener.document.getElementById('Datei_' + {$smarty.request.elemid}).value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				{else}
					window.opener.document.getElementById('Vorschau_' + {$smarty.request.elemid}).innerHTML = '<img style="margin-botton:2px" src="{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value + '">';
					window.opener.document.getElementById('Icon_' + {$smarty.request.elemid}).value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
					
				{/if}
				setTimeout("self.close();", 100);
				{else}
				window.opener.document.getElementById('txtUrl').value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				setTimeout("self.close();", 100);	
				window.opener.UpdatePreview();
				{/if}
			
			{elseif $smarty.request.target=='navi'}
			window.opener.document.getElementById('{$smarty.request.id}').value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
			setTimeout("self.close();", 100);	
			
			{* ---------------- ES HANDELT SICH UM EIN BILDFELD  START ---------------- *}
			{elseif $smarty.request.target=='img_feld' || $target_img=='img_feld'}
			
				window.opener.document.getElementById('img_feld__{$pop_id}').value = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				window.opener.document.getElementById('span_feld__{$pop_id}').style.display = '';
				window.opener.document.getElementById('_img_feld__{$pop_id}').src = '{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				setTimeout("self.close();", 100);	
			{* ---------------- ES HANDELT SICH UM EIN BILDFELD  ENDE ---------------- *}
			
			{elseif $smarty.request.target=='f_url'}
				
				window.opener.document.target['f_url'].value='{$koobipath}uploads/media' + document.dat.dateiname.value + document.dat.fn.value;
				setTimeout("self.close();", 50);	
				
				
			{elseif $smarty.request.target!='all'}
					window.opener.updatePreview();
			
			
			{else}
				
				window.opener.document.dokument['img_{$smarty.request.target}'].{if $smarty.request.target=='vide'}dyn{/if}src = '{$koobipath}uploads/media/' + document.dat.dateiname.value + document.dat.fn.value;
				window.opener.document.dokument['{$smarty.request.target}'].value = document.dat.dateiname.value + document.dat.fn.value;
			
			{/if}
		{/if}
			setTimeout("self.close();", 100);	
		{rdelim}
	{rdelim}
	function UpDir(){ldelim}if(document.dat.dateiname.value!='/'){ldelim}parent.frames['zf'].location.href='?noout=1&do=browser&pop=1&typ={$smarty.request.typ}&dir=' + document.dat.dateiname.value + '../&SID={$sess}&action=list';{rdelim}{rdelim}
	function NewFolder() {ldelim}var dname = window.prompt('{#NewFolderInf#}', 'Neues Verzeichnis');if (dname=='' || dname==null) {ldelim}{rdelim} else {ldelim}parent.frames['zf'].location.href='?noout=1&do=browser&pop=1&typ={$smarty.request.typ}&dir=' + document.dat.dateiname.value + '&action=list&newdir=' + dname;{rdelim}{rdelim}
	function updlg() {ldelim}var url = '?noout=1&do=browser&pop=1&action=upload&pfad=' + document.dat.dateiname.value + '&typ={$smarty.request.typ}';var winWidth = 500;var winHeight = 300;var w = (screen.width - winWidth)/2;var h = (screen.height - winHeight)/2 - 60;var name = 'upload2mp';var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;window.open(url,name,features);{rdelim}
	</script>
</body></html>
