<script language="javascript">
	function edit_dialog(url,w,h){
		url	=	url;
		var input_img 	=	$('input_img_url').value;
		if(input_img){
			var src_url	=	Dialog(url,input_img,w,h);
			if(src_url){
				$('input_img_url').value	=	src_url;
				$('preview').src			=	"/"+src_url;
			}
		}
		else{
			alert('<?=$this->lang->line('please_upload_images')?>');
		}
	}
</script>
<div class="col width-40">
  <fieldset class="adminform">
  <legend>
  <?=$this->lang->line('slider_base');?>
  </legend>
  <input type="hidden" name="channel_id" value="<?=$channel_id?>">
  <input type="hidden" name="slider_id" value="<?=$slider->slider_id?>" />
  <table class="admintable" cellspacing="1">
    <tr>
      <td class="key"><?=$this->lang->line('slider_title')?></td>
      <td><input type="text" name="slider_title" value="<?=$slider->slider_title?>" dataType="Require" msg="<?=$this->lang->line('slider_title_require')?>" /></td>
    </tr>
    <tr>
    	<td class="key"><?=$this->lang->line('slider_link')?></td>
        <td><input type="text" name="slider_link" value="<?=$slider->slider_link?>"></td>
    </tr>
    <tr>
    	<td class="key"><?=$this->lang->line('slider_img_url')?></td>
        <td>
        	<input readonly="readonly" type="text" name="slider_img_url" value="<?=$slider->slider_img_url?>" id="input_img_url" dataType="Require" msg="<?=$this->lang->line('slider_img_url_error')?>"/>
            <input type="button" name="upload" value="<?=$this->lang->line('upload')?>"  onclick="window.open('<?=base_url?><?=URI_MODEL?>admin/upload/uploadimage','',500,400)"/>
            <input type="button" name="upload" value="<?=$this->lang->line('edit_image')?>" onclick="edit_dialog('<?=base_url?><?=URI_MODEL?>admin/onlineimage/index',600,500)"/>
        </td>
    </tr>
    <tr>
    	<td class="key"><?=$this->lang->line('order')?></td>
        <td><input type="text" name="slider_order" value="<?=$slider->slider_order?>" /></td>
    </tr>
    <tr>
    	<td class="key"><?=$this->lang->line('slider_status')?></td>
        <td>
			<?=$this->lang->line('allow')?><input type="radio" name="slider_status" value="1" checked/>
            <?=$this->lang->line('disabled')?><input type="radio" name="slider_status" value="0" />
        </td>
    </tr>
  </table>
  </fieldset>
</div>
<div class="col width-60">
  <fieldset class="adminform">
  <legend>
  <?=$this->lang->line('image_preview');?>
  </legend>
   <div><img src="<?=base_url?><?=$slider->slider_img_url?>" id='preview' onload="setpicWH(this,400,400)"/></div>
  </fieldset>
</div>
