
<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
{include file="$incpath/other/validate_js.tpl"}
$.validator.setDefaults({ldelim}
	submitHandler: function() 
	{ldelim}
		document.forms['koobiform'].submit();
	{rdelim}
});

$().ready(function() 
{ldelim}
	$("#koobiform").validate({ldelim}
	rules: {ldelim}
				Name: {ldelim}required: true{rdelim},
				Url_Direct: {ldelim}{rdelim},
				Size_Direct: {ldelim}number:true{rdelim}
				
			{rdelim}, 
	messages: 
			{ldelim}
				Url: {ldelim}url:'{#InserURL#}'{rdelim}
			{rdelim}
	{rdelim});
{rdelim});

$(function() {ldelim}
	 $('#container-options ul').tabs({ldelim} {rdelim});
{rdelim});



function ajaxFileUpload(updir,divid,resize)
{ldelim}
	$("#loading_" + divid)
	.ajaxStart(function(){ldelim}
		$(this).show();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Wait#}';
		document.getElementById('buttonUpload_' + divid).disabled = true;
		
	{rdelim})
	.ajaxComplete(function(){ldelim}
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{#Global_Upload#}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
	{rdelim});

	if(divid==1) 
		var up = 'index.php?do=downloads&sub=iconupload' + updir + '&divid=' + divid + '&resize=' + resize;
	else
		var up = 'index.php?do=downloads&sub=fileupload' + updir + '&divid=' + divid + '&resize=' + resize;
				
	
	$.ajaxFileUpload
	(
		
		{ldelim}
			url: up,
			secureuri:false,
			fileElementId:'fileToUpload_' + divid,
			dataType: 'json',
			success: function (data, status)
			{ldelim}
				if(typeof(data.error) != 'undefined')
				{ldelim}
					if(data.error != '')
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML  = data.error;
					}else
					{ldelim}
						document.getElementById('UpInf_' + divid).innerHTML = data.msg;
						document.getElementById('newFile_' + divid).value =  data.html;
						
					{rdelim}
				{rdelim}
			{rdelim},
			error: function (data, status, e)
			{ldelim}
				document.getElementById('UpInf_' + divid).innerHTML = e;
			{rdelim}
		{rdelim})
	return false;
{rdelim}
// -->
</script>


<div class="popbox">
<div class="header">{#Download_add#}</div>
<br />


<form method="post" action="" enctype="multipart/form-data"  name="koobiform" id="koobiform">
<div id="container-options">
<ul>
<li><a href="#opt-1"><span>{#Download_tabDescr#}</span></a></li>
<li><a href="#opt-2"><span>{#Download_tabDownload#}</span></a></li>
<li><a href="#opt-3"><span>{#Download_sysother#}</span></a></li>
</ul>
</div>


<div id="opt-1">
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<td>
<fieldset>
<legend><label for="t">{#Global_Name#}</label></legend>
<input name="Name" type="text" class="input" id="t" style="width:200px" value="{$res->Name}" /> 
</fieldset>
</td>
<td>
<fieldset>
<legend><label for="c">{#Global_Categ#}</label></legend>
<select class="input" style="width:250px" name="Kategorie">
{foreach from=$Categs item=c}{if $c->Parent_Id==0}<option style="font-weight:bold" value="{$c->Id}" {if $c->Id==$res->Kategorie}selected="selected"{/if}>{$c->Name}</option>{else}<option value="{$c->Id}" {if $c->Id==$res->Kategorie}selected="selected"{/if}>{$c->visible_title}</option>{/if}{/foreach}
</select>
</fieldset>
</td>

<td><fieldset>
    <legend>{#News_Status#}</legend>
    <label><input type="radio" name="Aktiv" value="1" checked="checked" />{#Global_online#}</label>
    <label><input type="radio" name="Aktiv" value="0" />{#Global_offline#}</label>
    </fieldset></td>
<td><fieldset>
    <legend><label for="spr">{#Links_ccode#}</label><span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Links_ccodeInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span></legend>
    <input name="Sprache" type="text" class="input" id="spr" style="width:50px" value="de" maxlength="2" /> 
    </fieldset>
    </td>
</tr>
</table>




<fieldset>
<legend>{#Global_imgNew#}</legend>
{if $wrietable_img==1}
<div id="UpInf_1"></div><div id="loading_1" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
<input id="fileToUpload_1" type="file" size="30" name="fileToUpload_1" class="input" />
<input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('','1','{#DownloadsLinks_maxwidth_img#}');" value="{#Global_Upload#}" />
<input type="hidden" name="newImg_1" id="newFile_1" />
{else}
<strong style="color:#FF0000">{#Download_nwIMG#}</strong>
{/if}
<!-- Uploadform -->  
</fieldset>

<fieldset>
<legend>{#Content_text#}</legend>
{$Beschreibung}
</fieldset>
</div>




<div id="opt-2">
  <table width="100%" border="0" cellpadding="2" cellspacing="0">
    <tr>
      <td valign="top">
        <fieldset style="height:160px">
          <legend>{#Download_upn#} </legend>

        <strong>{#Download_upnew#} (max. {$post_maxMb})</strong>
          
          <span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Download_upnewInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
          
          {if $wrietable==1}
          <div id="UpInf_2"></div><div id="loading_2" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
    		<input id="fileToUpload_2" type="file" size="38" name="fileToUpload_2" class="input" />
          <input type="button" class="button" id="buttonUpload_2" onclick="return ajaxFileUpload('','2','0');" value="{#Global_Upload#}" />
          <input type="hidden" name="newImg_2" id="newFile_2" />
          {else}
          <br />
          <strong style="color:#FF0000">{#Download_nwDL#}</strong>
          {/if}
          <!-- Uploadform -->  
          
          <br /><br />
          <strong>{#Download_manu#}</strong> 
          <span {popup sticky=$config_vars.POPSTICKY  width=400 text=$config_vars.Download_manuInf}><img class="absmiddle" src="{$imgpath}/help.png" alt="" /></span>
          <br />
          <input class="input" name="q" type="text" id="q" style="width:300px" value="" /> 
          </fieldset></td>
    
<td width="50%" valign="top">
  
  
  <fieldset style="height:160px">
    <legend>{#Download_manu2#}</legend>
{#Download_manu2Inf#}
    <br />
    <br />
    <table width="100%" border="0" cellspacing="1" cellpadding="1">
      <tr>
        <td>{#Download_url#}:</td>
        <td><input name="Url_Direct" type="text" class="input" id="url" style="width:200px" value="{$res->Url_Direct}" /></td>
        </tr>
      <tr>
        <td>{#Download_size#}:</td>
        <td><input name="Size_Direct" type="text" class="input" id="url" style="width:50px" value="{$res->Size_Direct}" />
          {#Download_sizeInf#}</td>
      </tr>
      </table>
    </fieldset>    
    </td>
    </tr>
   </table>
  <fieldset>
  <legend>{#Download_mirrors#}</legend>
  {#Download_mirrorsInf#}
  <br />
  <br />
<textarea name="Mirrors" style="width:99%; height:77px">{$res->Mirrors}</textarea>
  </fieldset>
</div>

<div id="opt-3">
<fieldset>
<legend>{#Download_version#}</legend>
<input name="Version" type="text" class="input" style="width:200px" value="{$res->Version}" />
</fieldset>

<fieldset>
<legend>{#Download_os#}</legend>
<select name="BetriebsOs[]" size="8" multiple="multiple" class="input"  style="width:200px">
{foreach from=$BetriebsOs item=o}
<option value="{$o}">{$o}</option>
{/foreach}
</select>
</fieldset>

<fieldset>
<legend>{#Download_softtype#}</legend>
<input name="SoftwareTyp" type="text" class="input" style="width:200px" value="" />
</fieldset>
</div>

<input onclick="$('#container-options > ul').tabs('select', 0);" type="submit" class="button big" value="{#Save#}" />
<input type="button" onclick="window.close();" class="button big" value="{#Close#}" />
<input type="hidden" name="save" value="1" />
<input type="hidden" name="langcode" value="{$smarty.request.langcode|default:1}" />
</form>
</div>