	 <div class="form-horizontal">
	 	<div class="control-group">
	  <label class="control-label" >Email<span style="color:red"> *</span></label>
		<div class="controls">
		  <input form="form_author_edit" type="text" id="a_email" name="a_email" placeholder="Email" value="<?php echo isset($author)?$author->a_email:false; ?>" >
		</div>
	  </div>	  
	  <div class="control-group">
	  <label class="control-label" >English name<span style="color:red"> *</span></label>
		<div class="controls">
		  <input form="form_author_edit" type="text" id="a_name" name="a_name" placeholder="First Name" value="<?php echo isset($author)?$author->a_name:false; ?>" >
		  <input form="form_author_edit" type="text" id="a_name_cn" name="a_name_cn" placeholder="Last Name" value="<?php echo isset($author)?$author->a_name_cn:false; ?>" >
		</div>
	  </div>

	  <div class="control-group">
		<label class="control-label" >Bank acoount<span style="color:red"> *</span></label>
		<div class="controls">
		  	<input form="form_author_edit" type="text" id="a_bank" name="a_bank" placeholder="bank name or 'paypal'" value="<?php echo isset($author)?$author->a_bank:false; ?>" >
			<input form="form_author_edit" class="input-xlarge" type="text" id="a_bank_card" name="a_bank_card" placeholder="Bank account number or paypal number" value="<?php echo isset($author)?$author->a_bank_card:false; ?>" >
		</div>
	  </div>
</div>
	  <legend></legend>
	  <div class="form-horizontal">
	  <div class="control-group">
		<label class="control-label" >Gender</label>
		<div class="controls">
		<?php 
		$ms_check='';
		$mr_check='';
		if (isset($author))
		{
			$author->a_gender=='Ms.'?$ms_check=' checked ':$mr_check=' checked ';
		}
		?>
			<label class="radio inline">
				<input form="form_author_edit" type="radio" name="a_gender" id="a_gender" value="Ms." <?php echo $ms_check; ?> >Female
			</label>
			<label class="radio inline">
				<input form="form_author_edit" type="radio" name="a_gender" id="a_gender" value="Mr." <?php echo $mr_check; ?> >Male
			</label>
		</div>
	  </div>
		  
	  <div class="control-group">
	  <input type="hidden" name="a_photo" form="form_author_edit"  value="<?php if(!empty($author->a_photo)) echo $author->a_photo; ?>">
	  <input type="hidden" name="profile_url" id="profile_url" form="form_author_edit"  value="">
	  <label class="control-label" >Profile Photo</label>
		<div class="controls" style="position:relative;">
		   <img src="<?php echo get_photo_url($author->a_photo);?>" class="img-polaroid span3" name="a_photo_img" id="a_photo_img">
			<form action="<?php echo site_url('author/upload_ID_file/Profile_file') ?>" 
	        method="post" 
	        target="ifm1"
	        class="form-horizontal"
	        enctype="multipart/form-data" style="position:absolute;z-index:10;">
				<input class="span12" style="filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0; height:115px;width:180px;cursor: pointer;" type="file" name="Profile_file" id="Profile_file" onChange="this.form.submit()" />
	  		</form>
		</div>
	  </div>	  
	  
	  <div class="control-group">
	  <label class="control-label" >Address</label>
		<div class="controls">
		  <input form="form_author_edit" class="input-xlarge" type="text" id="a_address" name="a_address" placeholder="Address" value="<?php echo isset($author)?$author->a_address:false; ?>" >
		</div>
	  </div>
	  
	  <div class="control-group">
	   <label class="control-label" >身份证号码(For Chinese only)</label>
		<div class="controls">
		  <input form="form_author_edit" class="input-xlarge" type="text" id="a_id_card" name="a_id_card" placeholder="身份证号ID card number" value="<?php echo isset($author)?$author->a_id_card:false; ?>" >
		</div>
	  </div>

	  <input type="hidden" name="ID_file_name" id="ID_file_name" form="form_author_edit"  value="">
	  <form action="<?php echo site_url('author/upload_ID_file') ?>" 
	        method="post" 
	        target="ifm1"
	        class="form-horizontal"
	        enctype="multipart/form-data">
	        <div class="control-group">
			  <label class="control-label" >身份证复印件(For Chinese Only)</label>
			  <div class="controls">
				  <input class="span12" type="file" name="ID_file" id="ID_file" onChange="this.form.submit()" />
			  	  <div id="a_idcard_img" class="">
			  	  	<?php if(isset($author->a_email)){ ?>
						<img src="<?php echo ('/author/document/ID_CARD/id_card_'.$author->a_email.'.jpg'); ?>" class="img-polaroid span3" style="margin-left:0"> 
					<?php } ?>
			  	  </div>
				</div>
			  </div>
	  </form>
	  <div id="upload_status1">
	       <iframe class="ifm1 hide" name="ifm1"></iframe>
	  </div>

	  
	  <div class="control-group">
	  <label class="control-label" >Graduate school</label>
		<div class="controls">
		  <input form="form_author_edit" class="input-xlarge" type="text" id="a_school" name="a_school" placeholder="毕业院校" value="<?php echo isset($author)?$author->a_school:false; ?>" >
		</div>
	  </div>	
	  
	  <div class="control-group">
	  <label class="control-label" >Mobilie phone and Tel</label>
		<div class="controls">
		  <input form="form_author_edit" type="text" id="a_mobile_phone" name="a_mobile_phone" placeholder="Mobile phone" value="<?php echo isset($author)?$author->a_mobile_phone:false; ?>" >
		  <input form="form_author_edit" type="text" id="a_phone" name="a_phone" placeholder="Telephone" value="<?php echo isset($author)?$author->a_phone:false; ?>" >
		</div>
	  </div>

	  <div class="control-group">
		  <label class="control-label" >职称</label>
		  <div class="controls">
			<input class="span8" form="form_author_edit" type="text" id="a_title" name="a_title" placeholder="职称" value="<?php echo isset($author)?$author->a_title:false; ?>" >
		  </div>
	  </div>
	  
	  <div class="control-group">
		<label class="control-label" >Introduction(50 -100 words)</label>
		<div class="controls">
		  <textarea form="form_author_edit" rows="5" class="input-xxlarge" id="a_resume" name="a_resume" placeholder="Eg. Hi. I'm Gavin Van Hinsbergh from the UK. I've been living in Guilin since 2005 and working at China Highlights since 2008.  I enjoy my job editing web content as I learn a lot of interesting things about China. I hope the information we provide is useful to you and you will come and discover China for yourself."><?php echo isset($author)?$author->a_resume:false; ?></textarea>
		</div>
	  </div>
	  
	<input form="form_author_edit" type="hidden" id="a_id" name="a_id" value="<?php echo isset($author)?$author->a_id:false; ?>" >
	<div class="control-group">
		<div class="controls">
		  <button form="form_author_edit" type="button" onclick="$('#form_author_edit').attr('action','<?php echo site_url('author/profile_submit'); ?>');submitForm('form_author_edit');" class="btn">Submit</button>
		</div>
	</div>
</div>

<script language="javascript">
	function get_id_card_file(text){
		$("#ID_file_name").val(text);
		$("#a_idcard_img>img").attr('src','/author/document/ID_CARD/'+text);
		$("#a_idcard_img").removeClass('hide');
	}
	function get_photo_url(text){
		$("#profile_url").val(text);
		$("#a_photo_img").attr('src','/author/document/profile_photo/'+text);
	}

</script>	  