{literal}
<script language="javascript">
function usedefaultwhois(id) {
	jQuery("."+id.substr(0,id.length-1)+"customwhois").attr("disabled", true);
	jQuery("."+id.substr(0,id.length-1)+"defaultwhois").attr("disabled", false);
	jQuery('#'+id.substr(0,id.length-1)+'1').attr("checked", "checked");
}
function usecustomwhois(id) {
	jQuery("."+id.substr(0,id.length-1)+"customwhois").attr("disabled", false);
	jQuery("."+id.substr(0,id.length-1)+"defaultwhois").attr("disabled", true);
	jQuery('#'+id.substr(0,id.length-1)+'2').attr("checked", "checked");
}
</script>
{/literal}

		<div class="bigheader">
			<h2>{$LANG.domaincontactinfo}</h2>
		</div><!-- .bigheader -->


<div class="table-responsive table-grey">
<table>

<tr>
	<td width="20%"><strong>{$LANG.domainname}</strong></td>
	<td>{$domain}</td>
</tr>

</table>
</div>



{if $successful}
	<div class="notice notice-success">
		<div class="inside">
			<p>{$LANG.changessavedsuccessfully}</p>
		</div>
	</div>
{/if}


{if $error}
	<div class="notice notice-error">
		<div class="inside">
			<p>{$error}</p>
		</div>
	</div>
{/if}



<form method="post" action="{$smarty.server.PHP_SELF}?action=domaincontacts">
  <input type="hidden" name="sub" value="save">
  <input type="hidden" name="domainid" value="{$domainid}">
  {foreach from=$contactdetails name=contactdetails key=contactdetail item=values}
  
		<div class="bigheader">
			<h2>{$LANG.contactdetail}</h2>
		</div><!-- .bigheader -->   
  
  		<div class="feildset">
		
			<div class="col1">
			
				<div>
					<input type="radio" name="wc[{$contactdetail}]" id="{$contactdetail}1" value="contact" onclick="usedefaultwhois(id)"{if $defaultns} checked{/if} /> <label for="{$contactdetail}1">{$LANG.domaincontactusexisting}</label>
				</div>
				
				
				<div id="{$contactdetail}defaultwhois">
					<label>
						<span>{$LANG.domaincontactchoose}:</span>						
						<select name="sel[{$contactdetail}]" id="{$contactdetail}3" class="{$contactdetail}defaultwhois" onclick="usedefaultwhois(id)">
            <option value="u{$clientsdetails.userid}">{$LANG.domaincontactprimary}</option>
            {foreach key=num item=contact from=$contacts}
            <option value="c{$contact.id}">{$contact.name}</option>
            {/foreach}
          </select>
					</label>
				</div>
				
				
				<div>
					<input type="radio" name="wc[{$contactdetail}]" id="{$contactdetail}2" value="custom" onclick="usecustomwhois(id)"{if !$defaultns} checked{/if} /> <label for="{$contactdetail}2">{$LANG.domaincontactusecustom}</label>
				</div>				
											
			
			</div>
			
		</div>  
  
 
  		<div class="feildset" id="{$contactdetail}customwhois">
		
			<div class="col1">
			
  
    {foreach key=name item=value from=$values}
    
    
				<div>
					<label>
						<span>{$name}:</span>						
						<input type="text" name="contactdetails[{$contactdetail}][{$name}]" value="{$value}" size="30" class="{$contactdetail}customwhois" placeholder="Enter your {$name}" />
					</label>
				</div>    
    {/foreach}

			</div>
			
		</div>  


  {/foreach}
  
  
  <p class="center">
    <input type="submit" value="{$LANG.clientareasavechanges}" class="button1 color2" />
  </p>
  
</form>

<form method="post" action="{$smarty.server.PHP_SELF}?action=domaindetails">
  <input type="hidden" name="id" value="{$domainid}" />
  <div class="floatleft">
    <input type="submit" value="{$LANG.clientareabacklink}" class="button1 color1" />
  </div>
  <div class="clear">&nbsp;</div>
</form>