<script language="JavaScript" type="text/javascript" src="<tpl> $site_url </tpl>/js/jquery/jquery.ajaxfileupload.js"></script>
<form action="product.manage.php?action=update" method="post" enctype="multipart/form-data" name="ownaddproduct" id="ownaddproduct">
    <input type="hidden" name="slPCId" id="slPCId" value="<tpl> $slPCId </tpl>" />
    <input type="hidden" name="slPCId_save" id="slPCId_save" value="<tpl> $slPCId </tpl>" />
    <input type="hidden" name="txtPid" id="txtPid" value="<tpl> $product_array.p_code </tpl>"/>
    <input type="hidden" name="txtPcode" id="txtPcode" value="<tpl> $product_array.p_code </tpl>"/>
    <input type="hidden" name="txtPstarttime" id="txtPstarttime" value="<tpl> $product_array.p_start_time </tpl>"/>
    <input type="hidden" name="txtPendtime" id="txtPendtime" value="<tpl> $product_array.p_end_time </tpl>"/>
    <input type="hidden" name="txtPstate" id="txtPstate" value="<tpl> $product_array.p_state </tpl>"/>
    <input type="hidden" name="txtViewnum" id="txtViewnum" value="<tpl> $product_array.p_view_num </tpl>"/>
	<input type="hidden" name="pic_num" id="pic_num" value="<tpl> $pic_num|default:'0' </tpl>"/>
    <div id="product_nav"><span></span></div>

    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="from_table" id="ProductInfo">
	   <tr  style="height:6px;	background-color: #E6F5FF;">
        <td height="6px"colspan="3" style="height:6px;background-color: #E6F5FF;"></td>
      </tr>
	
	<tr><th  align="left" id="ProductInfo_tidy" class="product_tidy" style="font-size:14px">01<tpl> $langProductInfo </tpl></th>
	
	
	</tr>
      <tr>
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langSysBuyType </tpl>：</th>
        <td width="80%" height="30" style=" padding:0px 10px; line-height:20px"><input type="radio"  id="radioSelltype0"  name="radioSelltype" value="0"  onclick="changeAuctionType('0');" 
          <tpl> if $selltype==0 </tpl> checked="checked" <tpl> /if </tpl> />
          <tpl> $langPauction </tpl> 
        <input type="radio" id="radioSelltype1"  name="radioSelltype" value="1"  onclick="changeAuctionType('1');"  <tpl> if $selltype==1 </tpl> checked="checked" <tpl> /if </tpl> />
          <tpl> $langPfixprice </tpl> <input type="radio" id="radioSelltype2"  name="radioSelltype" value="2" onclick="changeAuctionType('2');"  <tpl> if $selltype==2 </tpl> checked="checked" <tpl> /if </tpl> />
        <tpl> $langPcamel </tpl> </td>
      </tr>
      <tr>
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langSysProductCate </tpl>：</th>
        <td width="80%" height="30" style=" padding:0px 10px; line-height:20px">
     	 <div id="pc_id_originality" style="display:''">
     	 <tpl> foreach item = cate_path from = $cate_path </tpl><tpl>$cate_path.name|replace:'&nbsp;':''</tpl>><tpl>/foreach</tpl>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 	<span class="btn_left">
		 <input type="button" id="edit_button" class="btn_submit" value="<tpl> $langSysEdit </tpl>" onclick="editstate()"/></span>
		 
		 
     	 </div>
         <div id="pc_id_edit" style="display:none">
          <select name="pc_c1" id="pc_c1" style="WIDTH: 110px" onchange="ajax_get_attribute(this.value);">
          	<option value=""></option>
            <tpl> foreach item = parent from = $ProductCateArray </tpl>
            <option value="<tpl>$parent.id</tpl>||<tpl>$parent[5]</tpl>" ><tpl>$parent.name</tpl></option>
            <tpl> /foreach </tpl>     
          </select>
          <select name="pc_c2" id="pc_c2" style="WIDTH: 110px" onchange="ajax_get_attribute(this.value);">
          </select>
          <select name="pc_c3" id="pc_c3" style="WIDTH: 110px" onchange="ajax_get_attribute(this.value);">
          </select>
          <select name="pc_c4" id="pc_c4" style="WIDTH: 110px" onchange="ajax_get_attribute(this.value);">
          </select>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="cancel_edit_button" value="<tpl> $langSysCancelEdit </tpl>" onclick="canceledit()"/>
          </div>		</td>
      </tr>
      <tr id="old_new" >
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langSysProductType </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px; line-height:20px">
		<input type="radio" value="0" id="radioType1" name="radioType"
		<tpl> if $product_array.p_type == 0 </tpl> checked="checked"<tpl> /if </tpl> />
              <label for="on1"><tpl> $langPnew </tpl></label>
          　    <input type="radio" value="1" name="radioType" id="radioType2" <tpl> if $product_array.p_type == 1 </tpl> checked="checked"<tpl> /if </tpl> />
          　    <label for="on6"><tpl> $langPold </tpl></label>
              <span id="restOn8">
              <input type="radio" value="2" name="radioType" id="radioType3" <tpl> if $product_array.p_type == 2 </tpl> checked="checked"<tpl> /if </tpl> />
              <label for="on8"><tpl> $langPnouse </tpl></label>
              </span>        </td>
      </tr>
	  <tr id="baby">
      <tpl> if $have_attribute == 1 </tpl>
        <th width="20%" height="98" align="center" valign="middle"><tpl> $langSysProductAttribute </tpl>：</th>
        <td width="80%" height="98" style=" padding-left:10px; padding-right:10px; line-height:20px">
		<tpl> foreach from=$product_attribute item=one </tpl>
			<tpl> $one.a_name </tpl>: 
			<tpl> if $one.a_type == 0 </tpl>
				<select name="attribute_content[]">
					<option value=""></option>
					<tpl> foreach from=$one.content item=two </tpl>
						<option value="<tpl> $two.ac_id </tpl>|<tpl> $two.a_id </tpl>" <tpl> if $two.ischecked eq 1 </tpl>selected="selected"<tpl> /if </tpl>><tpl> $two.ac_content </tpl></option>
					<tpl> /foreach </tpl>
				</select>
			<tpl> /if </tpl>
			<tpl> if $one.a_type == 1 </tpl>
				<tpl> foreach from=$one.content item=two </tpl>
					<input name="attribute_content[]" type="checkbox" value="<tpl> $two.ac_id </tpl>|<tpl> $two.a_id </tpl>" <tpl> if $two.ischecked eq 1 </tpl>selected="selected"<tpl> /if </tpl> ><tpl> $two.ac_content </tpl> 
				<tpl> /foreach </tpl>
			<tpl> /if </tpl>
			<br />
        <tpl> /foreach </tpl>
		</td>
      <tpl> /if </tpl>
	  </tr>
	   <tr>
        <th width="20%" height="85" align="center" valign="middle"><label for='txtPname'><tpl> $langSysPBrand </tpl>：</label></th>
        <td width="80%" height="85" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<input type="hidden" name="brand_id" id="brand_id" value="<tpl> $product_array.p_brand_id </tpl>"/>
        	<select id="brand_c1" class="searchformselect" name="brand_c1" style="width: 120px">
				<option valus="" selected></option>
				<tpl> foreach item = parent from = $brand_list </tpl>
				<option <tpl> if $sel_brand[0].pb_id eq $parent.pb_id </tpl>selected="selected"<tpl> /if  </tpl> value="<tpl>$parent.pb_id</tpl>||<tpl>$parent.is_parent</tpl>"><tpl> $parent.pb_name </tpl></option>
				<tpl> /foreach </tpl>
			</select>
			<select class="searchformselect" id="brand_c2" style="width: 120px" name="brand_c2">
				<option valus="<tpl> $sel_brand[1].pb_id </tpl>" selected><tpl> $sel_brand[1].pb_name </tpl></option>
			</select>
			<select class="searchformselect" id="brand_c3" style="width: 120px" name="brand_c3">
				<option valus="<tpl> $sel_brand[2].pb_id </tpl>" selected><tpl> $sel_brand[2].pb_name </tpl></option>
			</select>
		</td>
      </tr>
      <tr>
        <th width="20%" height="85" align="center" valign="middle"><label for='txtPname'><tpl> $langSysProductBabyName </tpl>：</label></th>
        <td width="80%" height="85" style=" padding-left:10px; padding-right:10px; line-height:20px"><input id="txtPname" name="txtPname"  class="txtinput"maxLength=60 size=40 value="<tpl> $product_array.p_name </tpl>" />
        　  <label style="display:block; margin:10px 0 0" for='txtPname'><tpl> $alertSysPname </tpl> </label>        </td>
      </tr>
<!-- 图片列表 -->
	  <tr>
        <th width="20%" height="141" align="center" valign="middle"><tpl> $langUploadPic </tpl>：</th>
        <td width="80%" height="141" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<input name="txtPpic" type="file" id="txtPpic" size="40"/><input type="button" name="buttonUpload" id="buttonUpload" value="上传" onclick="return ajaxFileUpload();" />
			<!-- 图片名拼字符串，中间以'|'连接 -->
            <input type="hidden" name="p_pic" id="p_pic" value="<tpl> $pic_line </tpl>" />
			<div id="previewImage">
				<tpl> section name=loop loop=$pic_array </tpl>
					<li><img src=<tpl> $site_url </tpl>/<tpl> $pic_array[loop].small_pic </tpl> /><br /><a href='javascript:;' onclick=ajaxFileDel("<tpl> $pic_array[loop].small_pic </tpl>",this);><tpl> $langPDel </tpl></a></li>
				<tpl> /section </tpl>
			</div>        
			<span id="file_pic_loading" style="display:none"><img src="<tpl> $template_dir </tpl>/orange/images/loading.gif" /></span>
		</td>
      </tr>
<!-- 图片列表end -->
      <tr>
        <th width="20%" height="85" align="center" valign="middle"><label for='txtPintro'><tpl> $langProductInfo </tpl>：</label></th>
        <td width="80%" height="85" style="padding-left:10px">
			<div id="fcks">
			<tpl>php</tpl>
			include("../classes/resource/fckeditor/fckeditor.php") ;
			$oFCKeditor = new FCKeditor('content') ;
			$oFCKeditor->BasePath	= '../classes/resource/fckeditor/' ;
			$oFCKeditor->ToolbarSet = 'Simple';
			$oFCKeditor->Width	= 510 ;
			$oFCKeditor->Height	= 300 ;
			$oFCKeditor->Value		= $this->_tpl_vars['product_array']['p_intro'];
			$oFCKeditor->Create() ;
			<tpl>/php</tpl>
			</div>
			<input type="hidden" name="txtPinfo" id="txtPinfo" value='<tpl> $product_array.p_intro </tpl>' />
          <label for='txtPinfo' style=" padding-left:10px; padding-right:10px; line-height:20px"><tpl> $alertSysProductInfo </tpl> </label>        </td>
      </tr>
      <tr >
        <th width="20%" height="30" align="center" valign="middle"><label for='txtPstorage'><tpl> $langSysProductStorage </tpl>：</label></th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px; line-height:20px"><input maxLength="6" size="5"   class="txtinput_short"  name="txtPstorage" id="txtPstorage" value="<tpl> $product_array.p_storage|default:1 </tpl>" />
          <tpl> $langSysProductAPiece </tpl>
		 	<label style="display:block;" metaDone="true" generated="true" for="txtPstorage"></label>	    </td>
      </tr>
	  <tpl> if $config_predeposit eq '1' </tpl>
	  <!-- 预存款选项 -->
	  <tr >
	  	<th width="20%" height="30" align="center" valign="middle"><label for='txtPstorage'><tpl> $langPPredeposit </tpl>：</label></th>
	  	<td width="80%" height="30" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<input type="checkbox" name="pay_predeposit" id="pay_predeposit" 
			<tpl> if $product_array.p_predeposit_state eq '0' </tpl>checked="checked"<tpl> /if </tpl> value="0" /><tpl> $langPPredeposit </tpl>		</td>
      </tr>
	  <tpl> /if </tpl>
	  <tr >
        <th width="20%" height="30" align="center" valign="middle"><label for='txtPayment'><tpl> $langSysProductPayment </tpl>：</label></th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<tpl> foreach from=$payment_array item=one key=key  </tpl>
				<input 
					onclick="if(this.checked == true){select_cur('<tpl> $one.currency_line </tpl>');}else{select_no_cur('<tpl> $one.currency_line </tpl>','<tpl> $key </tpl>');}" 
					type="checkbox" 
					<tpl> if $one.check eq '1' </tpl>checked="checked"<tpl> /if </tpl> 
					value="<tpl> $key </tpl>" 
					name="txtPayment[<tpl> $key </tpl>]" 
					id="txtPayment_<tpl> $key </tpl>" 
				/><tpl> $one.name </tpl>
				<input type="hidden" name="payment_cur_<tpl> $key </tpl>" id="payment_cur_<tpl> $key </tpl>" value="<tpl> $one.currency_line </tpl>" /><!-- 该支付方式支持的货币种类 -->
			<tpl> /foreach </tpl>		</td>
      </tr>
	  <!-- 货币选择 -->
	  <tr id="tr_product_currency" >
        <th width="20%" height="30" align="center" valign="middle">
        <tpl> $langProductCurrency </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<tpl> foreach from=$exchange_array item=one key=key  </tpl>
				<input type="hidden" name="exchange_rate_<tpl> $one.exchange_name </tpl>" id="exchange_rate_<tpl> $one.exchange_name </tpl>" value="<tpl> $one.exchange_rate </tpl>" /><!-- 汇率 -->
				<div style="display:<tpl> $one.display </tpl>" id="div_cur_<tpl> $one.exchange_name </tpl>">
					<input type="checkbox" 
					<tpl> foreach item=two from=$product_currency </tpl>
						<tpl> if $two eq $one.exchange_name </tpl>
						checked="checked"
						<tpl> /if </tpl>
					<tpl> /foreach </tpl>
					name="currency[<tpl> $one.exchange_name </tpl>]" id="currency_<tpl> $one.exchange_name </tpl>" value="<tpl> $one.exchange_name </tpl>" /><tpl> $one.exchange_remark </tpl>(<tpl> $one.exchange_name </tpl>)&nbsp;&nbsp;&nbsp;
					<div id="price_rate_<tpl> $one.exchange_name </tpl>">
						<tpl> if $product_array.p_price neq '' </tpl>
							<tpl> if $product_array.p_price/$one.exchange_rate*100|string_format:"%.2f" < 0.01 </tpl>
								0.01
							<tpl> else </tpl>
								<tpl> $product_array.p_price/$one.exchange_rate*100|string_format:"%.2f" </tpl>
							<tpl> /if </tpl>
						<tpl> /if </tpl>
					</div>
				</div>
			<tpl> /foreach </tpl>		</td>
      </tr>
	  <script>
		//选中支付方式的时候，显示对应的货币种类
		function select_cur(str){
			if(str.indexOf('|') >= 0){
				line = str.split('|');
				for(i=0;i<line.length;i++){
					$("#div_cur_"+line[i]).css("display",'');
				}
			}else{
				$("#div_cur_"+str).css("display",'');
			}
		}
		//取消支付方式的时候，隐藏对应的货币种类
		function select_no_cur(str,payment_name){
			
			//取该支付方式支持的货币种类str
			cur_array = str.split('|');
			for(i=0;i<cur_array.length;i++){
				//取其他支付方式，判断是否有该种货币的信息，并且判断是否勾选，如果没有勾选，则隐藏并且取消够先该货币种类
				cur_sign = false;
				$('#ownaddproduct input[@type=hidden]').each(function(){//每种支付方式对应的货币字符串
					
					//判断其他的支付方式是否也存在该货币种类
					if('payment_cur_'+payment_name != this.name && this.name.indexOf('payment_cur_') >= 0){
						other_cur_array = this.value.split('|');
						payment_pro_name = this.name.replace('payment_cur_','txtPayment_');
						for(j=0;j<other_cur_array.length;j++){
							if(cur_array[i] == other_cur_array[j] && $('#'+payment_pro_name).attr('checked') == true){
								//存在
								cur_sign = true;
							}
						}
						payment_pro_name = '';
					}
					
				})
				
				//说明其他支付方式没有该货币种类，则可以隐藏并且取消该货币的层和复选
				if(cur_sign == false){
					$("#div_cur_"+cur_array[i]).css("display",'none');
					$("#currency_"+cur_array[i]).attr("checked",false);
				}
			}
		}
		//计算 单价和各货币种类换算的值
		function price_to_exchange(price){
			if(price == ''){
				price = 0;
			}else{
				price = price*1;
			}
			//取货币种类的汇率
			$('#ownaddproduct input[@type=hidden]').each(function(){
				if(this.name.indexOf('exchange_rate_') >= 0){
					var line = this.name.split('exchange_rate_');
					//alert(line[line.length-1]);
					//在换算区域赋值 parseFloat()
					value = $("#exchange_rate_"+line[line.length-1]).val();
					one = accDiv(price,value);
					if(Math.round(one*10000)/100 < 0.01){
						$("#price_rate_"+line[line.length-1]).html(0.01);//Math.round(one*100)/100
					}else{
						$("#price_rate_"+line[line.length-1]).html(Math.round(one*10000)/100);
					}
				}
			});
		}
		//精度乘法
		function accMul(arg1,arg2)
		{
			var m=0,s1=arg1.toString(),s2=arg2.toString();
			try{m+=s1.split(".")[1].length}catch(e){}
			try{m+=s2.split(".")[1].length}catch(e){}
			return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
		}
		function accDiv(arg1,arg2){
			var t1=0,t2=0,r1,r2;
			try{t1=arg1.toString().split(".")[1].length}catch(e){}
			try{t2=arg2.toString().split(".")[1].length}catch(e){}
			with(Math){
				r1=Number(arg1.toString().replace(".",""));
				r2=Number(arg2.toString().replace(".",""));
				return (r1/r2)*pow(10,t2-t1);
			}
		} 
		</script>
  </table>

    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="from_table" id="TradeCondition">
	<tr><th  class="product_tidy" id="TradeCondition_tidy" style="font-size:14px" >02 <tpl> $langSysTradeCondition </tpl></th>
	<td></td></tr>
    <tr id="auctionOption1">
     
      </tr>
      <tr id="auctionOption2">
        <th width="20%" height="67" align="center" valign="middle" class="fontSize14"><tpl> $langSysInceptPrice </tpl>：</th>
        <td width="80%" height="67" class="fontSize14" style=" padding-left:10px; padding-right:10px; line-height:20px"><input maxLength="12" size="12" class="txtinput_short"  id="minimumBid" name="minimumBid" value="<tpl> $product_array.p_price </tpl>" onkeyup="price_to_exchange(this.value);" >
          <tpl> $langCYuan </tpl> <br />
          <span class="posttip" style="font-size:12px"><tpl> $langSysInceptPriceSet </tpl>
          <div id="catePriceLimita"></div>
        </span> 
			<label style="display:block;" metaDone="true" generated="true" for="minimumBid"> </label>
		</td>
      </tr>
	  <tr id="auctionOption3">
        <th></th>
        <td></td>
      </tr>
      <tr id="auctionOption4">
        <th width="20%" height="83" align="center" valign="middle" class="fontSize14"><tpl> $langProductAPriceAddScope </tpl>：</th>
        <td width="80%" height="83" class="fontSize14" style=" padding-left:10px; padding-right:10px; line-height:20px">
			<input type="radio" checked="checked" name="system_step" value="1" id="inc1" onclick="document.getElementById('price_step').readOnly=true;document.getElementById('price_step').className='disabled';document.getElementById('price_step').value=0;" />
          <label><tpl> $langSysProductASystemAuto </tpl></label>
          <br /> <input type="radio"  name="system_step" value="0" id="inc2" onclick="document.getElementById('price_step').readOnly=false;document.getElementById('price_step').className=''" />
          <label for="inc2"><tpl> $langSysProductAUserDefined </tpl></label>
          <input maxLength=15 size=10 name="price_step" id="price_step" value="<tpl> $product_array.p_price </tpl>"  class="txtinput_short">
          <tpl> $langCYuan </tpl> <br />
          <span class="posttip"><tpl> $langSysProductAddPriceSelect </tpl><a href="#" target=_blank><tpl> $langSysProductASystemAutoAdd </tpl></a> </span>
          <label style="display:block;" metaDone="true" generated="true" for="price_step"></label>
		  <script type="text/javascript">
				if (document.getElementById('inc1').checked) {
					document.getElementById('price_step').readOnley=true;
					document.getElementById('price_step').className='disabled';
					document.getElementById('price_step').value = 0;
				}
			</script>
		</td>
      </tr>
	  <tr id="fixpriceOption1">
        <th></th>
        <td></td>
      </tr>
      <tr id="fixpriceOption2">
        <th width="20%" height="42" align="center" valign="middle"> <label for='txtPprice'><tpl> $langProductPrice </tpl>：</label>        </th>
        <td width="80%" height="42" style=" padding-left:10px; padding-right:10px; line-height:20px"><input type="text" id="txtPprice" maxLength="12"  class="txtinput_short" size="12" name="txtPprice" value="<tpl> $product_array.p_price </tpl>" onkeyup="price_to_exchange(this.value);"/>
          <tpl> $langCYuan </tpl>
          <label class="fontsize12" for='txtPprice' style="display:block"><tpl> $langSysProductSetFastness </tpl></label>
        <div id="catePriceLimit1"></div></td>
      </tr>
	  <tr id="camelOption1">
        <th></th>
        <td></td>
      </tr>
        <tr id="camelOption2">
          <th width="20%" height="30" align="center" valign="middle"><tpl> $langGroupPrice </tpl>：</th>
          <td width="80%" height="30" style=" padding-left:10px; padding-right:10px"><input type="text" id="txtGroupprice" maxLength="12" size="12" class="txtinput_short"  name="txtGroupprice" value="<tpl> $product_array.p_group_price </tpl>" />
            <tpl> $langCYuan </tpl> <span style="font-size:12px"><tpl> $langSysProductBuyNumMix </tpl> </span>
            <div id="catePriceLimit2"></div>
			<label style="display:block;"metaDone="true" generated="true" for="txtGroupprice"></label>
		  </td>
        </tr>
		<tr id="camelOption3">
        <th></th>
        <td></td>
      </tr>
        <tr id="camelOption5">
          <th width="20%" height="30" align="center" valign="middle"><tpl> $langOldPrice </tpl>：</th>
          <td width="80%" height="30" style=" padding-left:10px; padding-right:10px"><input type="text" id="txtPoldprice" maxLength="12" size="12" class="txtinput_short" name="txtPoldprice" value="<tpl> $product_array.p_price </tpl>" />
            <tpl> $langCYuan </tpl> <span style="font-size:12px"><tpl> $langSysProductOldGroup </tpl></span> 
			<label style="display:block;" metaDone="true" generated="true" for="txtPoldprice"></label>
		  </td>
        </tr>
        <tr id="camelOption4">
          <th width="20%" height="42" align="center" valign="middle"><tpl> $langSysProductAGroupMinCount </tpl>：</th>
          <td width="80%" height="42" style=" padding-left:10px; padding-right:10px; line-height:20px"><input type="text" id="txtGroupmincount"  class="txtinput_short" maxLength="12" size="12" name="txtGroupmincount" value="<tpl> $product_array.p_group_mincount|default:5 </tpl>" />
            <tpl> $langSysProductAPiece </tpl> <span><tpl> $langSysProductA5To100BabyNum </tpl></span> <span style="font-size:12px"><tpl> $langSysProductABuyNumGroupMixNum </tpl></span>
			<label style="display:block;"  metaDone="true" generated="true" for="txtGroupmincount"></label>
		  </td>
        </tr>
      <tr>
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langProductArea </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px">
			<input type="hidden" name="area_id" id="area_id" value="<tpl> $product_array.p_area_id </tpl>"/>
			<select id="area_c1" class="searchformselect" name="area_c1" style="width: 120px">
				<option valus="" selected></option>
				<tpl> foreach item = parent from = $area_array </tpl>
				<option <tpl> if $sel_area[0].area_id eq $parent.area_id </tpl>selected="selected"<tpl> /if  </tpl> value="<tpl>$parent.area_id</tpl>||<tpl>$parent.is_parent</tpl>"><tpl> $parent.area_name </tpl></option>
				<tpl> /foreach </tpl>
			</select>
			<select class="searchformselect" id="area_c2" style="width: 120px" name="area_c2">
				<option valus="<tpl> $sel_area[1].area_id </tpl>" selected><tpl> $sel_area[1].area_name </tpl></option>
			</select>
			<select class="searchformselect" id="area_c3" style="width: 120px" name="area_c3">
				<option valus="<tpl> $sel_area[2].area_id </tpl>" selected><tpl> $sel_area[2].area_name </tpl></option>
			</select>
			<select class="searchformselect" id="area_c4" style="width: 120px" name="area_c4">
				<option valus="<tpl> $sel_area[3].area_id </tpl>" selected><tpl> $sel_area[3].area_name </tpl></option>
			</select>
		</td>
      </tr>
      <tr>
        <th width="20%" height="109" align="center" valign="middle"><tpl> $langSysTranFee </tpl>：</th>
        <td width="80%" height="109" style=" padding-left:10px; padding-right:10px"><ul style="list-style:none">
            <li> <input name="radioTransfee" type="radio" id="whopsSeller" onclick="$('#ApplyPostage').css('display','none')" value="0" <tpl> if $product_array.p_transfee_charge eq '0' || $product_array.p_transfee_charge eq '' </tpl> checked="checked" <tpl> /if </tpl>  />
              <label for="whopsSeller"><tpl> $langSelaTranFee </tpl></label>
            </li>
            <li><input name="radioTransfee" type="radio" id="whopsBuyer" onclick="$('#ApplyPostage').css('display','block')"  value="1"  />
              <label for="whop</ul>sBuyer"><tpl> $langProductAListBear </tpl></label>
            </li>
            <ul>
              <li id="ApplyPostage" <tpl> if $product_array.p_transfee_charge eq '0' || $product_array.p_transfee_charge eq '' </tpl> style="display:none" <tpl> /if </tpl>>
                <label for="isApplyPostage_false"><tpl> $langPCommonlyPost </tpl>：</label>
                <input maxLength="12" size="8" id="pyTF" name="pyTF" value="<tpl> $product_array.p_tf_py|default:0.0 </tpl>" />
                <tpl> $langCYuan </tpl> <tpl> $langPCelerityPost </tpl>：
                <input maxLength="12" size="8" id="kdTF" name="kdTF" value="<tpl> $product_array.p_tf_kd|default:0.0 </tpl>" />
                <tpl> $langCYuan </tpl> EMS：
                <input maxLength="12" size="8" id="emsTF" name="emsTF" value="<tpl> $product_array.p_tf_ems|default:0.0 </tpl>" />
                <tpl> $langCYuan </tpl> 
				<label style="display:block;" metaDone="true" generated="true" for="pyTF"></label>
				<label style="display:block;" metaDone="true" generated="true" for="kdTF"></label>
				<label style="display:block;" metaDone="true" generated="true" for="emsTF"></label>
				</li>
            </ul>
          </ul>
          <div id="whenNotAuction"> <tpl> $langSysProductATranFeeKilter </tpl> </div>
        <div id="whenAuction" style="display:none;"> <span class="posttip"><tpl> $langSysProductASaleBabyIssue </tpl></span></div></td>
      </tr>
      <tr id="inv">
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langInvoices </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px"><input type=radio  value="0" name="radioInvoices" id="radioInvoices" 
          <tpl> if $product_array.p_have_invoices eq 0 </tpl>checked<tpl> /if </tpl> />
          <label for="invoiceN"><tpl> $langCNot </tpl></label>
          <input type=radio  value="1" name="radioInvoices" id="radioInvoices2" <tpl> if $product_array.p_have_invoices eq 1 </tpl>checked<tpl> /if </tpl> />
        <label for="invoiceY"><tpl> $langCHave </tpl></label>        </td>
      </tr>     
      <tr id="wy">
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langWarranty </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px"><input type="radio" value="0" name="radioWarranty" 
          <tpl> if $product_array.p_have_warranty eq 0 </tpl>checked<tpl> /if </tpl> />
          <label for="warrantyN"><tpl> $langCNot </tpl></label>
          <input type="radio"  value="1" name="radioWarranty" <tpl> if $product_array.p_have_warranty eq 1 </tpl>checked<tpl> /if </tpl> />
        <label for="warrantyY"><tpl> $langCHave </tpl></label>        </td>
      </tr>
      <tr id="rz">
     	 <th width="20%" height="30" align="center" valign="middle"><tpl> $langPattestation </tpl>：</th>
        <td width="80%" height="30" style=" padding-left:10px; padding-right:10px">
        	<label for="txtPgenuine"><input type="checkbox" name="txtPgenuine" id="txtPgenuine" value="1" <tpl> if $product_array.p_genuine eq '1' </tpl> checked <tpl> /if </tpl> /><img src="<tpl> $site_url </tpl>/templates/system_new/images/pic_zp.gif" align="absmiddle" alt="<tpl> $langPgenuine </tpl>" /><tpl> $langPgenuine </tpl></label>
        	<label for="txtP7day"><input type="checkbox" name="txtP7day" id="txtP7day" value="1" <tpl> if $product_array.p_7day_return eq '1' </tpl> checked <tpl> /if </tpl> /><img src="<tpl> $site_url </tpl>/templates/system_new/images/pic_7day.gif" align="absmiddle" alt="<tpl> $langP7dayreturn </tpl>" /><tpl> $langP7dayreturn </tpl></label>
        </td>
      </tr>        
  </table>
 
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="from_table" id="OtherInfo">
	<tr><th class="product_tidy" id="OtherInfo_tidy" style="font-size:14px">03<tpl> $langSysOtherInfo </tpl></th><td></td></tr>
      <tr>
        <th width="20%" height="30" align="center" valign="middle"><tpl> $langSysValidDays </tpl>：</th>
        <td width="80%">　
			 <input type="text" name="slValiddays" id="slValiddays" maxLength="3" size="8" value="<tpl> $product_array.p_valid_days|default:'7' </tpl>" /><tpl> $langPday </tpl> <span class="posttip" id="durainfo"><tpl> $langSysProductABabyInfoIssueTime </tpl> </span> </td>
      </tr>
      <tr id="republish">
        <th height="30" align="center" valign="middle"><tpl> $langProductAAutoPublish </tpl>：</th>
        <td>　<input type="checkbox" value="1" name="chxAutopublish" id="chxAutopublish" 
          <tpl> if $product_array.p_auto_publish == "1" </tpl>checked<tpl> /if </tpl><tpl> if $product_array.p_auto_publish == "" </tpl>checked<tpl> /if </tpl> />
          <label for="autoReport"><tpl> $langCYes </tpl></label>
        <span class="posttip"><tpl> $langSysProductASystemHelpYouAuto </tpl></span> </td>
      </tr>
      <tr >
        <th height="30" align="center" valign="middle"><tpl> $langRecommended </tpl>：</th>
        <td>　<input type="checkbox" value="1" name="chxRecommended" id="chxRecommended" 
          <tpl> if $product_array.p_recommended == "1" </tpl>checked<tpl> /if </tpl> />
        <label for="promoted"><tpl> $langCYes </tpl></label></td>
      </tr>
      <tr >
        <th height="97" align="center" valign="middle"><tpl> $langProductARemark </tpl>：</th>
        <td style=" padding-left:10px">
			<span class="fontSize14">
	    <textarea  id="txtRemark" name="txtRemark" class="tarea" rows="10" cols="38"><tpl> $product_array.p_remark </tpl></textarea></span> </td>
      </tr>
    <tr><td > </td>
      <td ><div style="text-align:left; "><!--  <input type="button" name="event_submit_do_preview" onclick="this.form.target='_blank';" value="  <tpl> $langbtnProductPreview </tpl>  " /> -->
	   	<span class="btn_left">
	  <input type="submit" class="btn_submit" value="  <tpl> $langCsubmit </tpl>  " />
	  </span>
	   	<span class="btn_left">
	  <input id="butt_list" class="btn_submit" type="button" value="<tpl> $langSysProductReturnlist </tpl>" />
	  </span>
    </div></td>
  </table>
</form>   
<script language="javascript">
function changeAuctionType(type){

	var ele = document.ownaddproduct.elements["radioType"];
	//chgType(type);

	var newRestSpan = document.getElementById('restOn8');
	if(newRestSpan){
		if(type == '2'){
			newRestSpan.style.display = 'none';  //不显示闲置属性
			removeRestTitle(mytitle);
		}else{
			newRestSpan.style.display = '';   //显示闲置属性
			if(radOn8 && radOn8.checked){ //选择了闲置 标题加入" 个人闲置"
				addRestTitle(mytitle);
			}
		}
	}

	if(type == '0') {
		document.getElementById('whopsSeller').checked = 'checked';
		document.getElementById('whopsBuyer').disabled = true;
		document.getElementById('whenAuction').style.display = '';
		document.getElementById('whenNotAuction').style.display = 'none';
		auction();
	}else{
		if (type == '1'){
			fixprice();
		}else{
			camel();
		}
		document.getElementById('whopsBuyer').disabled = false;
		document.getElementById('whenAuction').style.display = 'none';
		document.getElementById('whenNotAuction').style.display = '';
		
	}
}

//判断是否是选择了团购
var myAuctionType = document.getElementById('radioSelltype2');
var newRestSpan = document.getElementById('restOn8');

var mytitle = document.getElementById('txtPname');

var radOn1 = document.getElementById('on1');
var radOn6 = document.getElementById('on6');
var radOn8 = document.getElementById('on8');

function removeRestTitle(title){
	if(title){
		var titleValue = title.value;

		if(titleValue.indexOf(" <tpl> $langProductASelf </tpl>") != -1){
			titleValue = titleValue.replace(" <tpl> $langProductASelf </tpl>","");
		}
		title.value = titleValue;
	}
}

function addRestTitle(title){
	if(title){
		var titleValue = title.value;

		if(titleValue.indexOf(" <tpl> $langProductASelf </tpl>")==-1){
			titleValue = titleValue +" <tpl> $langProductASelf </tpl>";
		}
		title.value = titleValue;
	}
}

if(newRestSpan){
	if(myAuctionType && myAuctionType.checked){
		newRestSpan.style.display = 'none';  //不显示闲置属性

		if(radOn8 && radOn8.checked){
			radOn8.checked = false;
		}
	}else{
		newRestSpan.style.display = '';   //显示闲置属性
	}
}

function fixprice() {

	var isSeniorShop = "true";
	document.getElementById('auctionOption1').style.display = 'none';
	document.getElementById('auctionOption2').style.display = 'none';
	//document.getElementById('auctionOption3').style.display = 'none';
	document.getElementById('auctionOption4').style.display = 'none';

	//document.getElementById('camelOption1').style.display = 'none';
	document.getElementById('camelOption2').style.display = 'none';
	//document.getElementById('camelOption3').style.display = 'none';
	document.getElementById('camelOption4').style.display = 'none';
	document.getElementById('camelOption5').style.display = 'none';

	//document.getElementById('fixpriceOption1').style.display = '';
	document.getElementById('fixpriceOption2').style.display = '';

	/* document.getElementById('txtPprice').name = 'txtPprice';
	document.getElementById('minimumBid').name = 't';
	document.getElementById('txtGroupprice').name = 't'; */document.getElementById('txtPoldprice').value = document.getElementById('txtPprice').value;

	//重发
	document.getElementById('republish').style.display = '';

	currentIsFixPrice = true;
}

function auction() {

	var isSeniorShop = "true";
	document.getElementById('auctionOption1').style.display = '';
	document.getElementById('auctionOption2').style.display = '';
	//document.getElementById('auctionOption3').style.display = '';
	document.getElementById('auctionOption4').style.display = '';

	//document.getElementById('camelOption1').style.display = 'none';
	document.getElementById('camelOption2').style.display = 'none';
	//document.getElementById('camelOption3').style.display = 'none';
	document.getElementById('camelOption4').style.display = 'none';
	document.getElementById('camelOption5').style.display = 'none';

	//document.getElementById('fixpriceOption1').style.display = 'none';
	document.getElementById('fixpriceOption2').style.display = 'none';


	/* document.getElementById('minimumBid').name = 'txtPprice';
	document.getElementById('txtPprice').name = 't';
	document.getElementById('txtGroupprice').name = 't'; */document.getElementById('txtPoldprice').value = document.getElementById('txtPprice').value;

	//重发
	document.getElementById('republish').style.display = '';

	currentIsFixPrice = false;

}

function camel() {
	var isSeniorShop = "true";
	document.getElementById('auctionOption1').style.display = 'none';
	document.getElementById('auctionOption2').style.display = 'none';
	//document.getElementById('auctionOption3').style.display = 'none';
	document.getElementById('auctionOption4').style.display = 'none';

	//document.getElementById('fixpriceOption1').style.display = 'none';
	document.getElementById('fixpriceOption2').style.display = 'none';

	//document.getElementById('camelOption1').style.display = '';
	document.getElementById('camelOption2').style.display = '';
	//document.getElementById('camelOption3').style.display = '';
	document.getElementById('camelOption4').style.display = '';
	document.getElementById('camelOption5').style.display = '';

	/* document.getElementById('txtGroupprice').name = 'txtGroupprice';
	document.getElementById('minimumBid').name = 't';
	document.getElementById('txtPprice').name = 'txtPprice'; *///重发
	document.getElementById('republish').style.display = 'none';

	currentIsFixPrice = false;

}

fixprice();

//选择交易类型
changeAuctionType(<tpl> $selltype </tpl>);

if(<tpl> $product_array.p_transfee_charge </tpl> == '1') {
	document.getElementById('whopsBuyer').checked = true;
	document.getElementById('ApplyPostage').style.display = 'block';
}

</script>

<script type="text/javascript">
$(document).ready(function() {
	tonext_edit('#pc_c1');
	hideMessage();
	<tpl> if $list_class_error != '' </tpl>
	//输出后台程序错误信息
	showMessage(<tpl> $list_class_error </tpl>);
	<tpl> /if </tpl>
	//返回列表
	$("#butt_list").click(function(){
		ShowDiv = "result_content";
		getPageContent("product.manage.php?action=ajax_list&curpage=<tpl>$curpage</tpl>");
	});
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		type:      'post',
		dataType:  'json',
		success:   function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == 1){
							ShowDiv = 'result_content';
							getPageContent("product.manage.php?action=ajax_list&curpage=<tpl>$curpage</tpl>");
						}
					}
	};
	//对添加表单做的验证定义
	$("#ownaddproduct").validate({
		errorClass: "wrong",
		rules: {
			txtPname: {required:true},
			txtPstorage: {
				required:true,
				number:true,
				min: function(){
						if($("#radioSelltype2").attr('checked')==true){
							return 5;
						}else{
							return 1;
						}
					}
			},
			minimumBid: {
				required: "#radioSelltype0:checked",
				number: true,
				min: function(){
						if($("#radioSelltype0").attr('checked')==true){
							return 0.01;
						}else{
							return 0;
						}
					}
			},
			price_step: {
				required: "#radioSelltype0:checked",
				number: true,
				min: function(){
					if($("#radioSelltype0").attr('checked')==true && $("#inc2").attr('checked')==true){
						return 1;
					}else{
						return 0;
					}
				}
			},
			txtPprice: {required: "#radioSelltype1:checked",number: true,min: 0.01},
			txtGroupprice: {required:"#radioSelltype2:checked",number:true,min: 0.01},
			txtPoldprice: {required: "#radioSelltype2:checked",number: true,min: function(){return $("#txtGroupprice").val();}},
			txtGroupmincount: {
				required: "#radioSelltype2:checked",
				number: true,
				min: function(){
					if($("#radioSelltype2").attr('checked')==true){
						return 5;
					}else{
						return 0;
					}
				},
				max:function(){
					if($("#radioSelltype2").attr('checked')==true){
						if($("#txtPstorage").val() >= 100){
							return 100;
						}else{
							return $("#txtPstorage").val();
						}
					}else{
						return 10000000;
					}
				}
			},
			area_id: {required: true},
			pyTF: {
				required: "#whopsBuyer:checked",
				number: true,
				min: function(){
					if($("#whopsBuyer").attr('checked')==true){
						return 1;
					}else{
						return 0;
					}
				}
			},
			kdTF: {
				required: "#whopsBuyer:checked",
				number: true,
				min: function(){
					if($("#whopsBuyer").attr('checked')==true){
						return 1;
					}else{
						return 0;
					}
				}
			},
			emsTF: {
				required: "#whopsBuyer:checked",
				number: true,
				min: function(){
					if($("#whopsBuyer").attr('checked')==true){
						return 1;
					}else{
						return 0;
					}
				}
			},
			slValiddays: {
				required: true,
				number: true,
				min: 1,
				max: 30
			}
		},
		messages: {
			txtPname: {required: "<tpl> $errProductNameEmpty </tpl>"},
			txtPstorage: {
				required: "<tpl> $errPstorage </tpl>",
				number: "<tpl> $errPstorage </tpl>",
				min: function(){
					if($("#radioSelltype2").attr('checked')==true){
						return "<tpl> $errPstorageByGroup </tpl>";
					}else{
						return "<tpl> $errPstorage </tpl>";
					}
				}
			},
			minimumBid: {required: "<tpl> $errMinimumbidWrong </tpl>",number: "<tpl> $errMinimumbidWrong </tpl>",min: "<tpl> $errMinimumbidWrong </tpl>"},
			price_step: {required: "<tpl> $langProductAUserDefinedUppriceIsEmpty </tpl>",number: "<tpl> $langProductAUserDefinedUppriceIsEmpty </tpl>",min: "<tpl> $langProductAUserDefinedUppriceIsEmpty </tpl>"},
			txtPprice: {required: "<tpl> $errPprice </tpl>",number: "<tpl> $errPprice </tpl>",min: "<tpl> $errPprice </tpl>"},
			txtGroupprice: {required: "<tpl> $errGroupprice </tpl>",number: "<tpl> $errGroupprice </tpl>",min: "<tpl> $errGroupprice </tpl>"},
			txtPoldprice: {required: "<tpl> $errPoldprice </tpl>",number: "<tpl> $errPoldprice </tpl>",min: "<tpl> $errPoldprice </tpl>"},
			txtGroupmincount: {required: "<tpl> $errGroupmincount </tpl>",number: "<tpl> $errGroupmincount </tpl>",min:"<tpl> $errGroupmincount </tpl>",max:"<tpl> $errGroupmincount </tpl>"},
			area_id: {required: "<tpl> $errProvince </tpl>"},
			pyTF: {required: "<tpl> $langProductPyTFIsEmpty </tpl>",number: "<tpl> $langProductPyTFIsEmpty </tpl>",min: "<tpl> $langProductPyTFIsEmpty </tpl>"},
			kdTF: {required: "<tpl> $langProductKdTFIsEmpty </tpl>",number: "<tpl> $langProductKdTFIsEmpty </tpl>",min: "<tpl> $langProductKdTFIsEmpty </tpl>"},
			emsTF: {required: "<tpl> $langProductEMSTFIsEmpty </tpl>",number: "<tpl> $langProductEMSTFIsEmpty </tpl>",min: "<tpl> $langProductEMSTFIsEmpty </tpl>"},
			slValiddays: {required: "<tpl> $errValiddays </tpl>",number: "<tpl> $errValiddays </tpl>",min: "<tpl> $errValiddays </tpl>",max: "<tpl> $errValiddays </tpl>"}
		},
		submitHandler: function() {
			var check_sign = false;//货币选择状态标识
			var payment_check = false;//支付方式选择状态标识
			var predeposit_check = false;//预存款选择状态标识
			var payment_alert_sign = false;//支付方式是否抛出错误信息标识
			
			//判断预存款选择状态
			if($('#pay_predeposit').attr('checked') == true){
				predeposit_check = true;
			}
			//验证支付方式的复选验证，是否全选，选中的支付方式是否选择了支付货币种类
			$("#ownaddproduct input[@type=hidden]").each(function(){
				if(this.name.indexOf('payment_cur_') == 0){
					//判断支付方式是否被选择
					str = this.name.split('payment_cur_');//取支付方式名称 str[1]
					if($('#txtPayment_'+str[1]).attr('checked') == true){
						//取该支付方式的货币种类字符串
						str2 = $('#payment_cur_'+str[1]).val().split('|');
						payment_check = true;//标识有选择的支付方式
						//判断该选中的支付方式起码有一个支持的货币种类被选择
						for(i=0;i<str2.length;i++){
							if($('#currency_'+str2[i]).attr('checked') == true){
								check_sign = true;
								break;
							}
						}
						if(check_sign == false){//没有选择货币
							payment_alert_sign = true;
						}
					}
				}
				check_sign = false;
			});
			
			if(predeposit_check == true){//选择预付款
				if(payment_alert_sign == false){//判断是否有错误抛出:没有
					var oEditor = FCKeditorAPI.GetInstance('content');
					$('#txtPinfo').val(oEditor.GetXHTML(true));
					$('#ownaddproduct').ajaxSubmit(options);
				}else{
					alert('<tpl> $errPaymentSelCur </tpl>');
					return false;
				}
			}else{//没有选择预存款
				if(payment_alert_sign == false && payment_check == true){//判断是否有错误抛出并且选择了起码一种支付方式:没有
					var oEditor = FCKeditorAPI.GetInstance('content');
					$('#txtPinfo').val(oEditor.GetXHTML(true));
					$('#ownaddproduct').ajaxSubmit(options);
				}else{
					alert('<tpl> $errPaymentSelCur </tpl>');
					return false;
				}
			}
		}
	});
});
/* 删除图片 */function ajaxFileDel(pic_url,obj){
	$.ajax({
		url: "product.manage.php",
		data: 'action=pic_del&pic_name='+pic_url,
		type:'post',
		dataType:"json",
		success: function(msg){
			if(msg.type == '0'){
				alert(msg.message);
			}else{
				$(obj).parents("li").remove();
				arr = $('#p_pic').val().split('|');
				for(i=0;i<arr.length;i++){
					if(arr[i] == pic_url){
						delete(arr[i]);
					}
				}
				$('#p_pic').val(arr.join('|'));
				//图片数量-1
				$("#pic_num").val(parseInt($("#pic_num").val())-1);
			}
		}
	});
	return false;
}

//多图片上传操作
function ajaxFileUpload()
{
	$("#file_pic_loading")
	.ajaxStart(function(){
		$(this).show();
	})
	.ajaxComplete(function(){
		$(this).hide();
	});
	//如果图片数量超过3 则返回信息，不允许添加
	if($("#pic_num").val() >= 3){
		alert("<tpl> $langPPicNumOne </tpl>3<tpl> $langPPicNumTwo </tpl>");
		return false;
	}

	$.ajaxFileUpload
	(
		{
			url:'product.manage.php?action=pic_add',
			secureuri:false,
			fileElementId:'txtPpic',
			dataType: 'json',
			success: function (data, status)
			{
				if(typeof(data.type) != 'undefined')
				{
					if(data.type == '0')
					{
						alert(data.message);
					}else
					{
						$("#previewImage").append("<li>"+"<img src=<tpl> $site_url </tpl>/"+data.message+" /><br /><a href='javascript:;' onclick=ajaxFileDel(\'"+data.message+"\',this);><tpl> $langPDel </tpl></a></li>");
						if($('#p_pic').val() == ''){
							$('#p_pic').val(data.message);
						}else{
							$('#p_pic').val($('#p_pic').val()+'|'+data.message);
						}
						//图片数量+1
						$("#pic_num").val(parseInt($("#pic_num").val())+1);
					}
				}
			},
			error: function (data, status, e)
			{
				alert('<tpl> $errSysPUploadFileFail </tpl>');
			}
		}
	)
	return false;
}

function tonext_edit(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');	
			$('#slPCId').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected"><tpl> $langCDataToLoading </tpl></option>');
				$.get('../member/own_productcate.php',{action:'list',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) 
						{
							att=DataArray[i].split("||");
							id=att[0];cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						};
						$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
						tonext_edit($(whos).next());
					}
				)
			}
			else {
				$(whos).nextAll().html('').attr('disabled','true');
				$('#cancel_edit_button').attr('disabled','');
			};	
	})
};

function editstate(){
	$("#pc_id_originality").css("display","none");
	$("#pc_id_edit").css("display","");
}

function canceledit(){
	$("#pc_id_originality").css("display","");
	$("#pc_id_edit").css("display","none");
	var str = $("#slPCId_save").val();
	$("#slPCId").val(str);
	
	$("#pc_c1").val("");
	$("#pc_c2").val("");
	$("#pc_c3").val("");
	$("#pc_c4").val("");
}
//根据商品类别ID取商品属性
function ajax_get_attribute(pc_id){
	array=pc_id.split('||');
	if(array[1] == 0){//没有下级分类
		$.get('product.manage.php',{action:'ajax_get_attribute',pc_id:array[0],random_number:Math.random()},function(data){
			if(data != ''){
				$('#baby').html(data);
			}else{
				$('#baby').html('');
			}
		})
	}else{
		return false;
	}
}
//地区选择
function tonext_area(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');	
			$('#area_id').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected"><tpl> $langCDataToLoading </tpl></option>');
				$.get(
					'../home/tohtml.php',
					{action:'get_area',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) {
							att=DataArray[i].split("||");
							id=att[0];
							cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						}
						
					$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
					tonext_area($(whos).next());
					}
				)
			} else {
				$(whos).nextAll().html('').attr('disabled','true');
			};
		}
	)
};
//品牌选择
function tonext_brand(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');	
			$('#brand_id').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected"><tpl> $langCDataToLoading </tpl></option>');
				$.get(
					'../home/tohtml.php',
					{action:'get_brand',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) {
							att=DataArray[i].split("||");
							id=att[0];
							cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						}
						
					$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
					tonext_brand($(whos).next());
					}
				)
			} else {
				$(whos).nextAll().html('').attr('disabled','true');
			};
		}
	)
};

$(document).ready(function() {
	tonext_area('#area_c1');
	tonext_brand('#brand_c1');
});
</script>