<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>

<div class="panel panel_web_domain">

  <div class="pnl_formsarea">
    <fieldset class="inlineLabels">
      <div class="ctrlHolder">
      	<label for="redirect_type">{tmpl_var name='redirect_type_txt'}</label>
        <select name="redirect_type" id="redirect_type" class="selectInput formLengthHalf">
					{tmpl_var name='redirect_type'}
				</select>
      </div>
      <div class="ctrlHolder">
      	<label for="redirect_path">{tmpl_var name='redirect_path_txt'}</label>
        <input name="redirect_path" id="redirect_path" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
		<div class="ctrlHolder">
      	<label for="seo_redirect">{tmpl_var name='seo_redirect_txt'}</label>
        <select name="seo_redirect" id="seo_redirect" class="selectInput formLengthHalf">
					{tmpl_var name='seo_redirect'}
				</select>
			</div>
    </fieldset>

    <input type="hidden" name="id" value="{tmpl_var name='id'}">

    <div class="buttonHolder buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
  
</div>
<script language="JavaScript" type="text/javascript">
		var webId = jQuery('input[name="id"]').val();
		var serverId;
		getServerId(webId);
		adjustForm(serverId);
		
		function getServerId(webId){
			jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getserverid"}, function(data) {
				serverId = data.serverid;
			});
		}
		
		function adjustForm(serverId){
			jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, type : "getservertype"}, function(data) {
				var selected = jQuery('#redirect_type').val();
				if(data.servertype == "nginx"){
					jQuery('#redirect_type option[value="R"]').hide();
					jQuery('#redirect_type option[value="L"]').hide();
					jQuery('#redirect_type option[value="R,L"]').hide();
					if(selected != "no" && selected != "" && selected != "last"  && selected != "break"  && selected != "redirect"  && selected != "permanent") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
				} else {
					jQuery('#redirect_type option[value="last"]').hide();
					jQuery('#redirect_type option[value="break"]').hide();
					jQuery('#redirect_type option[value="redirect"]').hide();
					jQuery('#redirect_type option[value="permanent"]').hide();
					if(selected != "no" && selected != "" && selected != "R"  && selected != "L"  && selected != "R,L") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
				}
			});
		}
			
</script>