<!--#include file="../head.asp"-->
 <!--#include file="../checkrole.asp"-->
 <%

call checkuser("sj")
 
if issession=0 then
gsid=Replace_Text(request.Cookies("Yxmemberid"))
else
gsid=session("id")
end if
 info_id=Replace_Text(request("info_id"))
 sql="select * from Websen_Info where info_id="&info_id 
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
 if rs.eof then 
response.Redirect("edit.asp")
response.end
else
 info_id=rs("info_id")
sid=rs("sortid")
tid=rs("typeid")
tid2=rs("typeid_2")
picc0=rs("picsample_0")
picc1=rs("picsample_1")
picc2=rs("picsample_2")
draw=rs("draw")
draw1=rs("draw1")
draw2=rs("draw2")
jinji=rs("jinji")
tsbz=rs("tsbz")
set rs3=conn.execute("select Websen_class_2.*,Websen_class_1.* from Websen_class_2,Websen_class_1 where Websen_class_2.typeid="&rs("typeid")&" and Websen_class_1.sortid=Websen_class_2.sortid")
set rs5=conn.execute("select name,ch,qymc,phone,fax,email from Websen_corporation where id="&gsid&"")
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TABLE width=778 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD 
    style="BACKGROUND-POSITION: right 50%; BACKGROUND-IMAGE: url(i../mages/bg1.gif); BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #ffffff" 
    vAlign=top align=middle>
      <BR>
      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
        <TBODY>
        <TR>
              <TD width="74%"><IMG height=32 src="../images/editinfo.gif" width=578 
            border=0></TD>
              <TD width="26%" background="../images/info_bg.gif">&nbsp;</TD>
        </TR></TBODY></TABLE>
      <TABLE class=content_border cellSpacing=0 cellPadding=0 width=100% 
border=0>
        <TBODY>
        <TR>
          <TD align=middle><BR>
		    
<script language="JavaScript">
var needFeature = true;
var picWin;
var vChange = 0;
function setSubject(){
    var len = form.InfoType.length;
    catid="mm";
    
    for (j=0;j<len;j++){
        if (form.InfoType[j].checked){
            catid = form.InfoType[j].value;
            break;
        }
    }
    
    if(form.p_z_Z_Type[0].checked){
        if (catid=="14"||catid=="30"||catid=="35"){
            form.p_z_Z_Subject.value = "寻求";
        }else if (catid=="29"){
            form.p_z_Z_Subject.value = "提供";
        }else{
            form.p_z_Z_Subject.value = "求购";
        }
        form.p_z_Z_OfferExpire[3].checked = true
        document.all.jinji.style.display="none";
        document.all.putong.style.display="";
    }
    else if(form.p_z_Z_Type[1].checked){
        if(picWin) {
            picWin.close();
        }
        if (catid=="14"||catid=="30"||catid=="35"||catid=="31" ||catid=="28"){        
            form.p_z_Z_Subject.value = "提供";
        }else if (catid=="29"){
            form.p_z_Z_Subject.value = "寻求";
        }else{
            form.p_z_Z_Subject.value = "供应";
      }
        form.p_z_Z_OfferExpire[3].checked = true
        document.all.jinji.style.display="none";
        document.all.putong.style.display="";
    }
    else if(form.p_z_Z_Type[2].checked){
        form.p_z_Z_Subject.value = "紧急求购";
		form.jinj.value = "1";  
     form.p_z_Z_OfferExpire[3].checked = true
        document.all.jinji.style.display="";
        document.all.putong.style.display="none";
    }       
    else{
        if(picWin) {
            picWin.close();
        }
        form.p_z_Z_Subject.value = ""
    }
}
var str="(图)"
var str1="（图）"
function setSubjectText(){
    if((form.p_z_Z_Subject.value == "求购" || form.p_z_Z_Subject.value == "寻求")&&(form.p_z_Z_Type[0].checked)){
      alert("请先填写信息主题");
      form.p_z_Z_Subject.focus();
      return false;
    }
    if((form.p_z_Z_Subject.value == "供应" || form.p_z_Z_Subject.value == "提供")&&(form.p_z_Z_Type[1].checked)){
      alert("请先填写信息主题");
      form.p_z_Z_Subject.focus();
      return false;
    }
    if((form.p_z_Z_Subject.value == "紧急求购")&&(form.p_z_Z_Type[2].checked)){
      alert("请先填写信息主题");
      form.p_z_Z_Subject.focus();
      return false;
    }
    if((form.p_z_Z_RootCategory.value == "")&&(form.InfoType[0].checked)){
      alert("请先选择行业大类");
      form.p_z_Z_RootCategory.focus();
      return false;
    }
		if(trim(document.form.p_z_Z_CategoryId1.value) == "") {
		    alert("请先选择行业小类");
			document.form.p_z_Z_CategoryId1.focus();
		return false; 
	}
    if((form.p_z_Z_Picsample.value != "")&&(form.p_z_Z_Subject.value) != ""){
        if (form.p_z_Z_Subject.value.indexOf(str) == -1 && form.p_z_Z_Subject.value.indexOf(str1) == -1){
            form.p_z_Z_Subject.value = form.p_z_Z_Subject.value + str
        }
    }    
    var keywords = form.keywords.value;
    if(form.keywords2.value){
        keywords+=','+form.keywords2.value;
    }
    if(form.keywords3.value){
        keywords+=','+form.keywords3.value;
    }    
    form.p_z_Z_Keywords.value = keywords
    if(keywords == "") { 
      alert("请填写信息关键字");
      form.keywords.focus();
      return false;
    }
	
	if( form.beginDate.value== "") { 
      alert("请填写有效期起始时间！");
      form.beginDate.focus();
      return false;
    }
	   if( form.endDate.value== "") { 
      alert("请填写有效期结束时间！");
      form.endDate.focus();
      return false;
    }
    var pic0 = document.all.picsample_0.value;
    
           var pic1 = 0;
        
           var pic2 = 0;
    
    document.form.p_z_Z_PicsampleArray.value = pic0 + pic1 + pic2;

    
    return true;
}

function previewPost(thisform)  {
    if(setSubjectText()){
	    thisform.target="preview";
	    thisform.action="";
        area.update();
        if(area.html != "") {
           document.form.p_z_Z_Details.value = area.html;
        }
	    var win = window.open("about:blank","preview","toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500");
	    win.focus();
	    thisform.submit();
	}
}
function contentChange(){
    vChange = 1;
}
function post(thisform) {
    if(setSubjectText()){
        if(picWin) {
            picWin.close();
        }
        area.update();
        if(area.html != "") {
           document.form.p_z_Z_Details.value = area.html;
        }
        var strDetail = document.form.p_z_Z_Details.value;
        
        
        if(strDetail !=""){    
            var lxArray= new Array("联系方法","联系方式","联系人","地址：","电话：","手机：","传真：","网址：","地址:","电话:","手机:","传真:","网址:");
            var cont = 0;
            for(i=0;i<lxArray.length;i++){
                if(strDetail.indexOf(lxArray[i])>=0){
                    cont=1;
                }
            }
            if(cont>0){
               // alert("您的联系信息已经包含在您的注册资料中。\n"+                      "为了让您的联系信息具有唯一性，\n"+                      "请不要在“详细说明”中填写任何联系信息\n"+                      "（如：联系人、联系电话、传真、手机、电子邮件地址、网址等）。");
              //  document.form.p_z_Z_Details.focus()
               // return;
            }
        }
        
        //设置图片上传状态
        var pic0 = document.all.picsample_0.value;
        
                   var pic1 = 0;
                
                   var pic2 = 0;
        
        document.form.p_z_Z_PicsampleArray.value = pic0 + pic1 + pic2;
        
		//alert(form.p_z_Z_RootCategory.value+','+form.p_z_Z_CategoryId1.value);

	    thisform.target="";
	    thisform.action="save_edit.asp";
	    thisform.submit();
	}
}

function changeInfoType(bid){
    var len=form.InfoType.length;
    var catid="mm";
    var type="1";
	var orgSubject="";
	var bid="";
    if (form.p_z_Z_Type[1].checked){
        type = "1";
    }else{
        type = "0";
    }
        
    
    for (var i=0;i<len;i++){
        if (form.InfoType[i].checked){
            var catid = form.InfoType[i].value;
        }
    }
        
   if (catid=="29"||catid=="14"||catid=="30"||catid=="35"||catid=="31" ||catid=="28"){
        <!--当类目作调整时这里也要有调整，当“合作”，“二手”的类目名称变化时也要小心 -->
        <!-- “合作”，“二手”从类目调整为行业-->
        selectBoard(catid,bid);
        form.p_z_Z_RootCategory.disabled = true;          
   }else{
        selectBoard("","");
        form.p_z_Z_RootCategory.disabled = false;                            
   }    
    if (type == "1"){
        form.p_z_Z_Type[1].checked = true;
    }else{
        form.p_z_Z_Type[0].checked = true;
    }
    
    if (catid=="29"||catid=="14"||catid=="30"||catid=="35"||catid=="31" ||catid=="28"){
        if (catid=="29"){
            typeDispBuy.innerHTML = "提供代理";
            typeDispSale.innerHTML = "寻求代理";
        }
        if (catid=="14"){
            typeDispBuy.innerHTML = "寻求加工";
            typeDispSale.innerHTML = "提供加工";
        } 
        if (catid=="30"){
            typeDispBuy.innerHTML = "寻求项目";
            typeDispSale.innerHTML = "提供项目";
        }  
        if (catid=="35"){

            typeDispBuy.innerHTML = "寻求商务服务";
            typeDispSale.innerHTML = "提供商务服务";
        }  
        if (catid=="31"){
            typeDispBuy.innerHTML = "求购库存产品";
            typeDispSale.innerHTML = "提供库存产品";
        }  
        if (catid=="28"){
            typeDispBuy.innerHTML = "求购二手设备";
            typeDispSale.innerHTML = "提供二手设备";
        }    
    }else{
        typeDispBuy.innerHTML = "求购";
        typeDispSale.innerHTML = "供应";
    }           
    
    typeDispBuy.innerHTML = typeDispBuy.innerHTML;
    typeDispSale.innerHTML = typeDispSale.innerHTML;
  
                              
    if (type == "买"){
        if (catid=="14"||catid=="30"||catid=="35"){
            document.form.p_z_Z_Subject.value="寻求"+orgSubject;
        }else if(catid=="29"){
            document.form.p_z_Z_Subject.value="提供"+orgSubject;
        }else{
            document.form.p_z_Z_Subject.value="求购"+orgSubject;
        }
    }else{                       
        if (catid=="14"||catid=="30"||catid=="35"||catid=="31" ||catid=="28") {
            document.form.p_z_Z_Subject.value="提供"+orgSubject;
        }else if (catid=="29"){
            document.form.p_z_Z_Subject.value="寻求"+orgSubject;
        }else{
            document.form.p_z_Z_Subject.value="供应"+orgSubject;
        }
    }
	
}

//用于三张图片显示效果
function table_display(t_id){
  if (t_id == "table100" && document.all.table100.style.display == "none") {
       document.all.table100.style.display="";
       document.all.table101.style.display = "none"
       document.all.table102.style.display = "none";
       
  } else if (t_id == "table101" && document.all.table101.style.display == "none") {
       document.all.table100.style.display= "none";
       document.all.table101.style.display = "";
       document.all.table102.style.display = "none";
       
  } else if (t_id == "table102" && document.all.table102.style.display == "none") {
       document.all.table100.style.display="none";
       document.all.table101.style.display = "none"
       document.all.table102.style.display = "";
       
  } else {
  
       document.all.table100.style.display= "none";
       document.all.table101.style.display = "none"
       document.all.table102.style.display = "none";
  }

}

function delete_picture(id) {
 
     if(id == "0") {
       document.all.uploaded0.src = "../images/detail_no_pic.gif";
       document.all.uploadPicBtn0.value = "上传";
       document.all.picsample_0.value = "0";
                   form.p_z_Z_Picsample.value = "N";
            }
     if(id == "1") {
       document.all.uploaded1.src = "../images/detail_no_pic.gif";
       document.all.uploadPicBtn1.value = "上传";
       document.all.picsample_1.value = "0";
       if((document.all.picsample_0.value == "0")&&(document.all.picsample_2.value == "0")){
          form.p_z_Z_Picsample.value = "N";
       }
     }
     if(id == "2") {
       document.all.uploaded2.src = "../images/detail_no_pic.gif";
       document.all.uploadPicBtn2.value = "上传";
       document.all.picsample_2.value = "0";
       if((document.all.picsample_1.value == "0")&&(document.all.picsample_0.value == "0")){
          form.p_z_Z_Picsample.value = "N";
       }
     }
}

function set_picture(id,ImageUrl) {
 
     if(id == "0") {
       document.all.uploaded0.src = ImageUrl;
       document.all.uploadPicBtn0.value = "上传";
       document.all.picsample_0.value = "0";
       form.p_z_Z_Picsample.value = ImageUrl;
	   form.p_z_Z_TmpPictureName.value= ImageUrl;
     }
     if(id == "1") {
       document.all.uploaded1.src = ImageUrl;
       document.all.uploadPicBtn1.value = "上传";
       document.all.picsample_1.value = "0";
       if((document.all.picsample_0.value == "0")&&(document.all.picsample_2.value == "0")){
          form.p_z_Z_Picsample.value = ImageUrl;
		  form.p_z_Z_TmpPictureName.value= ImageUrl;
       }
     }
     if(id == "2") {
       document.all.uploaded2.src = ImageUrl;
       document.all.uploadPicBtn2.value = "上传";
       document.all.picsample_2.value = "0";
       if((document.all.picsample_1.value == "0")&&(document.all.picsample_0.value == "0")){
          form.p_z_Z_Picsample.value = ImageUrl;
		  form.p_z_Z_TmpPictureName.value= ImageUrl;
       }
     }
}
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 	
</SCRIPT>  <script language="JavaScript" src="../../js/calendar.js"> </script>
<script language=javascript>
function alertts(flag){
	if(flag!=1){
	alert("很抱歉，你不是网盛通会员，不能发布特色商机，请先升级成网盛通会员!");
	cancelSpeTitle();
	return ;
	}
}
function cancelSpeTitle(){
		for(i=0;i<form.p_z_Z_tsbz.length;i++){
			form.p_z_Z_tsbz[i].checked=false;
		}
	}
</script>
                  <table width="98%"  border="0" align="center" cellpadding="8" cellspacing="0" id="table103">
                    <tr>
                      <td class="s lh15" style="border:#FFCB99 1px solid; background:#FFF8EE;"> <span class="c"><font color="#ff0000">“重发”和“新发”的信息排名，享受同等待遇：</font> </span><br>
                          <font color="#000000">如果您暂时没有全新的产品推出，只需在“管理商业信息”中将以前的信息点击“重发”即可，通过更新发布时间来争取排名！</font></td>
                    </tr>
                  </table>            <FORM method="post" Action="save_edit.asp" Name="form" >
                          <input type='hidden' name='PID' value="">
                          <input type='hidden' name='catId' value="">
                          <input type='hidden' name='ruler_id' value="">
                          <input type='hidden' name='parent_id' value="">
                          <input type='hidden' name='SelectOfferId' value="">
                          <input type='hidden' name="p_z_Z_PictureName" value = "">
                          <input type='hidden' name="p_z_Z_TmpPictureName" value = "">
                          <input type='hidden' name="p_z_Z_PicsampleArray" value = "">
                          <input type='hidden' name="draw" value = "">
                          <input type='hidden' name="draw1" value = "">
                          <input type='hidden' name="draw2" value = "">
						  <input type='hidden' name='jinj' value="">
                          <input type='hidden' name='info_id' value="<%=info_id%>">
<input type='hidden' name='picture_summ' value="">
                        <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
              <TBODY>
              <TR>
                <TD>提示：<font color="red">*</font>为必填项</TD>
                        <TD align=right><IMG src="../images/offerfaq.gif" 
                  align=absMiddle border=0> <A 
                  href="javascript:win=window.open('<%=HOPE_InstallDir%>help/infoexample.html','contact','width=650,height=500,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');win.focus();"><B><FONT 
                  color=#ff0000>发布供求信息指导</FONT></B></A> | <A 
                  href="javascript:win=window.open('<%=HOPE_InstallDir%>help/example.html','contact','width=650,height=500,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');win.focus();">查看范例</A> | <a href="javascript:history.go(-4)">后退</a>&nbsp; 
                        </TD>
                </TR></TBODY></TABLE>
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="2" bgcolor="ff7300"></td>
                    </tr>
                  </table>
            <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <COLGROUP>
              <COL class=formtop></COLGROUP>
              <TBODY>
			      <tr> 
                              <td height="1" colspan="2"  bgcolor=#FFFCF7><input type="hidden" name="InfoType" value="mm" ></td>
                    </tr>
              <TR>
                <TD class=C width="20%" bgColor=#FFFCF7><FONT 
                  color=#ff0000>*</FONT> <B>买卖方向：</B></TD>
                <TD width="80%" bgColor=#FFF8EE class=lh15> <input type="radio" value="买" name="p_z_Z_Type" onClick="javascript:setSubject()" <%if rs("type")="买" and jinji=0 then response.write"checked"%>> 
                                <span id="typeDispBuy" > </span> <input type="radio" value="卖" name="p_z_Z_Type" onClick="javascript:setSubject()" <%if rs("type")="卖" then response.write"checked"%>> 
                                <span id="typeDispSale" > </span> <input type="radio" value="买" name="p_z_Z_Type" onClick="javascript:setSubject()" <%if   rs("type")="买" and jinji=1 then response.write"checked"%>>
                      紧急求购&nbsp;&nbsp;&nbsp; <br>
                      <img src="../images/shim.gif" width="1" height="8"></TD></TR>
					  
              <TR>
                <TD class=C bgColor=#FFFCF7><FONT color=#ff0000>*</FONT> 
                  <B>主题：</B></TD>
                <TD bgColor=#FFF8EE class=lh15><INPUT maxLength=50 size=35 
                  value="<%=rs("showname")%>" name=p_z_Z_Subject> 
                <BR>
                      <SPAN 
                  class=note>例：“供应FF-180型直流微电机”或“求购二手发电机”，注意要带动词</SPAN> </TD>
                    </TR>
                <TD class=C bgColor=#FFFCF7><FONT color=#ff0000>*</FONT> 
                  <B>行业：</B></TD>
                <TD bgColor=#FFF8EE class=lh15> <select name="p_z_Z_RootCategory" onChange="changeCategory(this)"  >
                                  <option selected>--请选择行业大类--</option>
                                </select> <select name="p_z_Z_CategoryId1" maxlength="80">
                                  <option value="0" selected>--请选择行业子类--</option>
                                </select> 
	   <BR><SPAN 
                  class=note>指您供应/求购的产品（服务）所属的行业</SPAN> </TD></TR>
              <TR>
                <TD class=C vAlign=top bgColor=#FFFCF7><FONT 
                  color=#ff0000>*</FONT> <B>关键字：</B></TD>
                <TD bgColor=#FEF1E0 class=lh15><%
				keywords=rs("keywords")
				if keywords<>"" then
				  if instr(keywords,",")>0 then
				     kwarry=split(keywords,",")
					 if ubound(kwarry)=1 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
				           elseif ubound(kwarry)=2 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 value='"&kwarry(2)&"' name=keywords3>"
                           elseif ubound(kwarry)>2 then
				           response.write"<INPUT maxLength=8 size=10 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=10 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=10 value='"&kwarry(2)&"' name=keywords3>"
                     end if
				  else
				  response.write"<INPUT maxLength=8 size=10 value='"&keywords&"' name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
                  end if
				else
				response.write"<INPUT maxLength=8 size=10 name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
				end if
				%> <INPUT type=hidden 
                  name=p_z_Z_Keywords> <SPAN 
                  class=note><BR>
                  用产品名、行业类目做关键字，可填1-3个（每个最多8个字），尽量填全；<BR>
                          例：供应发电机，可填“发电机”“发电机及电动机”“机械”为关键字<BR>
                    </SPAN></TD>
                </TR>
				     <TR>
                <TD class=c bgColor=#FFFCF7>  
                  <B>有效期:  </B></TD>
                <td bgcolor=#FFF8EE class="s"> <div id=putong style="display: none"> 
                                  <input name="p_z_Z_OfferExpire" type="radio" value="10"  checked    >
                                   
                                  <input name="p_z_Z_OfferExpire" type="radio" value="20"  checked    >
                                  
                                  <input name="p_z_Z_OfferExpire" type="radio" value="30"  checked    >
                                  
                                  <input name="p_z_Z_OfferExpire" type="radio" value="90"  checked    >
                                   <br>
                                </div>
                                <div id=jinji style="display: <%if jinji=0 then response.write"none"%>"> 
                                  <table width="100%" border="0" cellspacing="2" cellpadding="2">
                                    <tr> 
                                      <td width="1" valign="top">&nbsp;</td>
                                      <td><b><span class="s style1">3 天</span></b></td>
                                    </tr>
                                    <tr> 
                                      <td valign="top"><span class="note"><font color="#FF0000">*</font></span></td>
                                      <td><SPAN class=note>紧急采购的有效期默认为3天；</span></td>
                                    </tr>
                                    <tr> 
                                      <td valign="top"><span class="note"><font color="#FF0000">*</font></span></td>
                                      <td><SPAN class=note>采购完成后，请及时在<a href="edit.asp" class=S>管理商业信息</a>页面中撤销这条采购信息！</span></td>
                                    </tr>
                                  </table>
                       </div>
				<input type="text" name="beginDate" size="16" maxlength="16" value="<%=rs("infostartdate")%>" onFocus="calendar()" >至
					<input type="text" name="endDate" size="16" maxlength="16" value="<%=rs("infoenddate")%>" onFocus="calendar()" >有效					   </td></TR><TR>
                <TD class=C bgColor=#FFFCF7><B>产品规格：</B></TD>
                <TD bgColor=#FEF1E0 class=lh15><INPUT 
                  name="Specifications" 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" value="<%=rs("Specifications")%>" size=30 maxLength=25> </TD></TR>
              <TR>
                <TD class=C bgColor=#FFFCF7><B>产品数量</B>：</TD>
                <TD bgColor=#FEF1E0 class=lh15><INPUT 
                  name="Quantity" 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" value="<%=rs("Quantity")%>" size=30 maxLength=25></TD></TR>
              <TR>
                <TD class=C bgColor=#FFFCF7><B>包装说明：</B></TD>
                <TD bgColor=#FEF1E0 class=lh15><INPUT 
                  name="Packaging" 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" value="<%=rs("Packaging")%>" size=30 maxLength=25></TD></TR>
              <TR>
                <TD class=C bgColor=#FFFCF7><B>价格说明：</B></TD>
                <TD bgColor=#FEF1E0 class=lh15><INPUT 
                  name="PriceTerms" 
                  style="FONT-SIZE: 9pt; WIDTH: 250px" value="<%=rs("PriceTerms")%>" size=30 maxLength=25></TD></TR>
              <TR>
                <td bgcolor=#FFFCF7 class=C><font color="#FF0000">*</font>                          <b>详细说明：</b></td>

<td bgcolor=#FFF8EE class="lh15"> <div id="hyperTextEditor"> 
                                      <script language="JavaScript" type="text/javascript">
                           <!--
                           

function HyperTextArea(name, html, width, height,resourcePath,styleSheetUrl,delayRender){
	this.isRichText = false;
	this.rng = null;
	this.name = name;
	this.html = html||"";
	this.width = width;
	this.height = height;
	this.resourcePath = resourcePath||"";
	this.styleSheetUrl = styleSheetUrl||null;
	if(this.resourcePath.length && this.resourcePath.substring(this.resourcePath.length-1) != "/"){
		this.resourcePath = this.resourcePath + "/";
	}
	this.delayRender = delayRender||false;
	this.controlNames = new Array();
	this.controlsByName = new Array();
	this.toolbarNames = new Array();
	this.designModeRetryCount = 0;
	this.isSrcView = false;

	this.init = function(){
		HyperTextArea.areas[this.name] = this;
		//check to see if designMode mode is available
		if (document.getElementById) {
			if (document.all) {
				//check for Internet Explorer 5+
				this.isRichText = true;
			} else {
				//check for browsers that support designmode
				//make sure that this is not safari (and perhaps other khtml based browsers)
				//which returns "inherit" for document.designMode 
				if (document.designMode && document.designMode.toLowerCase() != "inherit"){
					this.isRichText = true;
				}
			}
		}

		//this.addControl(new Toolbar("toolbar0"));
		//menus
		//styleMenu = new Menu("formatblock","formatblock");
		//styleMenu.addItems("","Style","<p>","Paragraph","<h1>","Heading 1","<h2>","Heading 2","<h3>","Heading 3","<h4>","Heading 4","<h5>","Heading 5","<h6>","Heading 6","<address>","Address","<pre>","Preformatted");
		//this.addControl(styleMenu);
		//fontMenu = new Menu("fontname","fontname");
		//fontMenu.addItems("","Font","Arial, Helvetica, sans-serif","Arial","Courier New, Courier, mono","Courier New","Times New Roman, Times, serif","Times New Roman","Verdana, Arial, Helvetica, sans-serif","Verdana");
		//this.addControl(fontMenu);
		//sizeMenu = new Menu("fontsize","fontsize");
		//sizeMenu.addItems("","Size",1,1,2,2,3,3,4,4,5,5,6,6,7,7);
		//this.addControl(sizeMenu);
	
		this.addControl(new Toolbar("toolbar1"));

		//增加功能点

        //字体大小：10号、12号、14号、18号、24号
        //字体默认为宋体
		sizeMenu = new Menu("fontsize","fontsize");
		sizeMenu.addItems("","字号",2,"1(小五)",3,"2(五号)",4,"3(小四)",5,"4(四号)",6,"5(小三)");
		this.addControl(sizeMenu);

        //颜色：褐色、黑色、红色、蓝色、绿色
		colorMenu = new Menu("foreColor","foreColor");
		colorMenu.addItems("","颜色","brown","褐色","black","黑色","red","红色","blue","蓝色","green","绿色");
		this.addControl(colorMenu);


		//第一部分
		this.addControl(new TextFormatButton("copy","复制","../images/post_button_copy.gif","copy"));
		this.addControl(new TextFormatButton("paste","粘贴","../images/post_button_paste.gif","paste"));
		this.addControl(new TextFormatButton("cut","剪切","../images/post_button_cut.gif","cut"));
		//this.addControl(new Spacer());
		//第二部分
		this.addControl(new TextFormatButton("bold","粗体","../images/post_button_bold.gif","bold"));
		this.addControl(new TextFormatButton("italic","斜体","../images/post_button_italic.gif","italic"));
		//this.addControl(new Spacer());
		//第三部分
		this.addControl(new TextFormatButton("left","左对齐","../images/post_button_left_just.gif","justifyleft"));
		this.addControl(new TextFormatButton("center","居中","../images/post_button_centre.gif","justifycenter"));
		this.addControl(new TextFormatButton("right","右对齐","../images/post_button_right_just.gif","justifyright"));
		//this.addControl(new Spacer());
		//第四部分
		this.addControl(new TextFormatButton("orderedlist","编号","../images/post_button_numbered_list.gif","insertorderedlist"));
		this.addControl(new TextFormatButton("unorderedlist","项目符号","../images/post_button_list.gif","insertunorderedlist"));
		//this.addControl(new Spacer());
		//第五部分
		this.addControl(new TextFormatButton("outdent","减少缩进量","../images/post_button_outdent.gif","outdent"));
		this.addControl(new TextFormatButton("indent","增加缩进量","../images/post_button_indent.gif","indent"));
		//this.addControl(new TextFormatButton("forecolor","字体颜色","../images/post_button_textcolor.gif","forecolor"));
		//this.addControl(new TextFormatButton("backcolor","背景颜色","../images/post_button_bgcolor.gif","backcolor"));
		//this.addControl(new Spacer());
		//第六部分
		//this.addControl(new Button("insertImage","../images/post_button_image.gif","Insert Image","addImage"));
		//this.addControl(new TextFormatButton("link","Create Link","../images/post_button_hyperlink.gif","createlink"));
		//this.addControl(new Button("insertTable","../images/post_button_table.gif","插入表格","insertTableDialog"));

		
	}
	
	this.addControl = function(control){
		control.resourcePath = this.resourcePath;
		control.area = this;
		i = this.controlNames.length
		this.controlNames[eval(i)] = control.name;
		this.controlsByName[control.name] = control;
	}
	
	this.getControl = function(name){
		return this.controlsByName[name];
	}
	
	this.replaceControl = function(oldName,newControl){
		if(this.getControl(oldName)){
			for(i=0;i<this.controlNames.length;i++){
				if(this.controlNames[i] == oldName){
					break;
				}
			}
		}else{
			i = this.controlNames.length;
		}
		newControl.area = this;
		newControl.resourcePath = this.resourcePath;
		this.controlNames[i] = newControl.name;
		this.controlsByName[newControl.name] = newControl;
	}
	
	this.insertControl = function(i,control){
		control.resourcePath = this.resourcePath;
		control.area = this;
		this.controlNames.splice(i,0, control.name);
		this.controlsByName[control.name] = control;
	}
	
	this.removeControl = function(name){
	    //alert("this.removeControl");    
		for(i=0;i<this.controlNames.length;i++){
			if(this.controlNames[i] == name){
				this.controlNames.splice(i,1);
				return true;
			}
		}
		return false;
	}

	this.render = function(html){
	    //alert("this.render");    
		HyperTextArea.activeArea = this;
		text="this.render\n\n";
		for(i=0;i<this.controlNames.length;i++){
			text = text + "\t" + this.controlNames[i] + "\n";
		}
		if (this.isRichText) {
			this._renderRTE(html);
		} else {
			this._renderDefault(html);
		}
	}

	this._renderDefault = function(html){
	    //alert("this._renderDefault");  
	    
		document.writeln('<textarea name="' + this.name + '" id="' + this.name + '" style="width: ' + this.width + 'px; height: ' + this.height + 'px;">' + html + '</textarea>');

	}

	this.getControlNames = function(lable){
		text= lable + "\n\n";
		for(i=0;i<this.controlNames.length;i++){
			text = text + "\t" + this.controlNames[i] + "\n";
		}
		return text;
		
	}
	
	this._renderControls = function(){
	    //alert("this._renderControls");    
		text = "";
		for(x=0;x<this.controlNames.length;x++){
			control = this.controlsByName[this.controlNames[x]];
			if(control){
				text = text + control.getRenderedText();
			}
		}	
		text = text + '</tr>';
		text = text + '</table>';
		document.writeln(text);
	}
	
	this._renderRTE = function(){
	    //alert("this._renderRTE");    
		document.writeln('<style type="text/css">');
		document.writeln('.btnImage {cursor: pointer; cursor: hand;}');
		document.writeln('</style>');

		this._renderControls();
		document.writeln('<iframe id="' + this.name + '" width="' + this.width + 'px" height="' + this.height + 'px"></iframe>');
		//document.writeln('<br /><input type="checkbox" id="chkSrc' + this.name + '" onclick="HyperTextArea.getArea(\''+this.name+'\').toggleHTMLSrc();" />&nbsp;查看HTML代码');
		//reimplement this so that it is not in an iframe, rather in a div.
		document.writeln('<iframe width="145" height="130" id="cp' + this.name + '" name="cp' + this.name + '" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>');
		document.writeln('<input type="hidden" id="hdn' + this.name + '" name="' + this.name + '" value="">');
		document.getElementById('hdn' + this.name).value = this.html;
		this.setContent(this.html);
		setTimeout('onHyperTextAreaLoad(\'' + this.name + '\')', 500);
	}

	this.setContent = function(html){
	    //alert("this.setContent");    
		HyperTextArea.activeArea = this;
		var frameHtml = "<html>\n";
		frameHtml += "<head>\n";
		if (this.styleSheetUrl){
			frameHtml += "<link media=\"all\" type=\"text/css\" href=\"style.css\" rel=\"stylesheet\">\n";
		}
		frameHtml += "</head>\n";
		frameHtml += "<body>\n";
		frameHtml += html;
		frameHtml += "</body>\n";
		frameHtml += "</html>";
		
		if (document.all) {
			var oRTE = frames[this.name].document;
			oRTE.open();
			oRTE.write(frameHtml);
			oRTE.close();
		} else {
			var oRTE = document.getElementById(this.name).contentWindow.document;
			oRTE.open();
			oRTE.write(frameHtml);
			oRTE.close();
			//attach a keyboard handler for Mozilla to make keyboard shortcuts for formatting text work
			oRTE.addEventListener("keypress", kb_handler, true);
		}
	}

	this.update = function(){
		//alert("this.update");
		this.setViewMode(false);
		//set message value
		var oHdnMessage = document.getElementById('hdn' + this.name);
		var oRTE = document.getElementById(this.name);
		
		if (this.isRichText) {
			if (oHdnMessage.value == null) oHdnMessage.value = "";
			if (document.all) {
				oHdnMessage.value = frames[this.name].document.body.innerHTML;
			} else {
				oHdnMessage.value = oRTE.contentWindow.document.body.innerHTML;
			}
			//if there is no content (other than formatting) set value to nothing
			if (stripHTML(oHdnMessage.value.replace("&nbsp;", " ")) == "") oHdnMessage.value = "";
			this.html = stripWordHTML(oHdnMessage.value);
		}
	}

	this.setToolbarsVisible = function(isVisible){
	        //alert("this.setToolbarsVisible");
			visibleStyle = isVisible?"visible":"hidden";
			for (x=0;x<this.toolbarNames.length;x++){
				document.getElementById(this.toolbarNames[x] + "_" + this.name).style.visibility = visibleStyle;
			}
	}

	this.setViewMode = function(isSrcView){
	    //alert("this.setViewMode");
		HyperTextArea.activeArea = this;
		//contributed by Bob Hutzel (thanks Bob!)
		var oRTE;
		if (document.all) {
			oRTE = frames[this.name].document;
		} else {
			oRTE = document.getElementById(this.name).contentWindow.document;
		}
		
		//only change the view if it is different than the current state
		if (isSrcView && !this.isSrcView){
			this.isSrcView = true;
			this.setToolbarsVisible(false);
			if (document.all) {
				oRTE.body.innerText = oRTE.body.innerHTML;
			} else {
				var htmlSrc = oRTE.createTextNode(oRTE.body.innerHTML);
				oRTE.body.innerHTML = "";
				oRTE.body.appendChild(htmlSrc);
			}
		}else if(!isSrcView && this.isSrcView){
			this.isSrcView = false;
			this.setToolbarsVisible(true);
			if (document.all) {
				oRTE.body.innerHTML = oRTE.body.innerText;
			} else {
				var htmlSrc = oRTE.body.ownerDocument.createRange();
				htmlSrc.selectNodeContents(oRTE.body);
				oRTE.body.innerHTML = htmlSrc.toString();
			}
		}
		
	}
	
	this.toggleHTMLSrc = function(){
	    //alert("this.toggleHTMLSrc");    
		if (document.getElementById("chkSrc" + this.name).checked) {
			this.setViewMode(true);
		} else {
			this.setViewMode(false);
		}
	}

	//TODO would really like to be able to plug functionality in here.  
	//This would include the ability to launch a wizard, and then insert arbitrary text at the insertion point
	this.formatText = function (command,option){
		//alert("this.formatText");
		//所有与文字处理有关的功能都会调用此方法，在这个方法里面可以添加相关的新功能
		HyperTextArea.activeArea = this;
		var oRTE;
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}
		
		if ((command == "forecolor") || (command == "backcolor")) {
			this.command = command;
			controlElement = document.getElementById(this.name +"_" + command);
			//获得颜色选择窗口
			cp = document.getElementById('cp' + this.name);
			this.cpWindow.area = this;
			cp.style.left = getOffsetLeft(controlElement) + "px";
			cp.style.top = (getOffsetTop(controlElement) + controlElement.offsetHeight) + "px";
			if (cp.style.visibility == "hidden") {
        		//打开颜色选择窗口
				cp.style.visibility="visible";
			} else {
				cp.style.visibility="hidden";
			}
			
			//get current selected range
			var sel = oRTE.document.selection; 
			if (sel != null) {
				this.rng = sel.createRange();
				//alert(this.rng.text);
			}
		} else if (command == "createlink") {
			//TODO need a way to make this more flixible.  
			//Would especially like to be able to insert a link with both the containing text and the URL
			var szURL = prompt("Enter a URL:", "");
			oRTE.document.execCommand("Unlink",false,null)
			oRTE.document.execCommand("CreateLink",false,szURL)
		} else if (command == 'paste') {
			oRTE.focus();
		  	oRTE.document.execCommand(command);
			oRTE.focus();
		} else {
			oRTE.focus();
		  	oRTE.document.execCommand(command, false, option);
			oRTE.focus();
		}

	}

	this.setColor = function(color){
	    //选择前景色与背景色时调用   
		HyperTextArea.activeArea = this;
		
		var oRTE;
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}
		
		if (document.all) {
			//得到选定矩形
			var sel = oRTE.document.selection; 
			if (sel != null) {
				var newRng = sel.createRange();
				newRng = this.rng;
				newRng.select();
			}
		} else {
			oRTE.focus();
		}
		//设置文本前景或背景颜色
		oRTE.document.execCommand(this.command, false, color);
		oRTE.focus();
		//关闭颜色选择窗口
		document.getElementById('cp' + this.name).style.visibility = "hidden";
	}
	
	this.addImage = function(imagePath){
	    //alert("this.addImage");    
		HyperTextArea.activeArea = this;
		if(!imagePath){
			imagePath = prompt('Enter Image URL:', 'http://');				
		}
		var oRTE;
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}

		if ((imagePath != null) && (imagePath != "")) {
			oRTE.focus()
			oRTE.document.execCommand('InsertImage', false, imagePath);
		}
		oRTE.focus()
	}
	
	//TODO should look into ways to make this cross browser and platform
	this.checkspell = function(){
	    //alert("this.checkspell");    
		try {
			var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
			tmpis.CheckAllLinkedDocuments(document);
		}
		catch(exception) {
			if(exception.number==-2146827859) {
				if (confirm("ieSpell not detected.  Click OK to go to download page."))
					window.open("http://www.iespell.com/download.php","DownLoad");
			} else {
				alert("Error Loading ieSpell: Exception " + exception.number);
			}
		}
		
	}
	
	this.select = function(menu,cmd){
		//alert("this.select");
		HyperTextArea.activeArea = this;
		var oRTE;
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}
		
		var idx = menu.selectedIndex;
		// First one is always a label
		if (idx != 0) {
			var selected = menu.options[idx].value;
			oRTE.document.execCommand(cmd, false, selected);
			menu.selectedIndex = 0;
		}
		oRTE.focus();
		
	}
	//用于插入表格地弹出窗口
	this.insertTableDialog = function(){
		w = window.open("","tableDialog","top=300,left=300,width=300,height=150");
		w.area = this;
		d = w.document;
		d.open();
		d.write(getTableDialogAsString());
		d.close();
	}
	
	this.insertTable = function(rows,cols,spacing,padding,border){
		rows = rows||3;
		cols = cols||3;
		spacing = spacing||2;
		padding = padding||2;
		if(border == true){
			border = 1;
		}
		border = border||0;
		
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}
		doc = oRTE.document;

		table = doc.createElement("table");
		table.setAttribute("border", border);
		table.setAttribute("cellpadding", padding);
		table.setAttribute("cellspacing", spacing);
		table.setAttribute("class", "hyperTable");
		
		for (var i=0; i < rows; i++) {
			var tr = doc.createElement("tr");
			for (var j=0; j < cols; j++) {
				var td = doc.createElement("td");
				var content = doc.createTextNode('\u00a0');
				td.appendChild(content);
				tr.appendChild(td);
			}
			table.appendChild(tr);
		}
		this.insertElement(table);
	}
	
	this.insertElement = function(el){
		if (document.all) {
			oRTE = frames[this.name];
		} else {
			oRTE = document.getElementById(this.name).contentWindow;
		}
		doc = oRTE.document;
		if (document.all) {
			selection = doc.selection;
			var html = el.outerHTML;
			var range = selection.createRange();
			try {
				range.pasteHTML(html);        
			} catch (e) {
				// catch error when range is evil for IE
			}
        }else{
        	selection = oRTE.getSelection();
			var range = selection.getRangeAt(0);
			selection.removeAllRanges();
			range.deleteContents();
			var container = range.startContainer||selection.focusNode;
			var pos = range.startOffset;
			afterNode = container.childNodes[pos];
			
			try{
				container.insertBefore(el, container.afterNode);
			}catch (e){
				//if this is a text node, then break it up into a text node, new element, text node
				if(container.nodeName.toLowerCase() == "#text"){
					text0 = container.data.substring(0,range.startOffset);
					text1 = container.data.substring(range.startOffset,container.data.length-1);
					container.data = text0;
					parent = container.parentNode;
					parent.insertBefore(el,container.nextSibling);
					newTextNode = document.createTextNode(text1);
					parent.insertBefore(newTextNode,el.nextSibling);
				}else {
					alert(el.nodeName.toLowerCase() + " cannot be placed here for the following reason:\n\n" + e);
				}
			}
        }          
		
	}
	
	this.init();
	if(!this.delayRender){
		this.render(this.html);
	}

}

function TextFormatButton(name,label,icon,command,option){
	this.name = name;
	this.label = label;
	this.icon = icon;
	this.command = command;
	this.option = option||"";
	//the next two values are set by the HyperTextArea object
	this.area = null;
	this.resourcePath = null;
		
	this.getRenderedText = function(){
		text = '<td><div id="'+this.area.name+'_'+this.name+'">'
		text = text + '<img class="btnImage" src="'+this.resourcePath+this.icon+'" width="25" height="24" alt="'+this.label+'" title="'+this.label+'" onClick="HyperTextArea.getArea(\''+ this.area.name +'\').getControl(\''+this.name+'\').execute()">';
		text = text + '</div></td>';		
		return text;
	}
	
	this.execute = function(){
		this.area.formatText(this.command,this.option);
	}
}

function Button(name,icon,title,methodName){
	this.name=name;
	this.getRenderedText = function(){
		text = '<td><div id="'+name+'">'
		text = text + '<img class="btnImage" src="'+this.resourcePath+icon+'" width="25" height="24" alt="'+title+'" title="'+title+'" onClick="HyperTextArea.getArea(\''+ this.area.name +'\').'+methodName+'()">';
		text = text + '</div></td>';		
		return text;
	}
}

function Spacer(name){
	this.name = name
	this.getRenderedText = function(){
		return '<td>&nbsp;</td>'
	}
}
function Toolbar(name, isFirstToolbar){
	this.name = name
	this.isFirstToolbar = isFirstToolbar||false;
	this.getRenderedText = function(){
		this.area.toolbarNames[this.area.toolbarNames.length] = this.name;
		text = '<table id="' + this.name + '_' + this.area.name + '" cellpadding="1" cellspacing="0"><tr>'
		if(this.isFirstToolbar){
			text = '</tr></table>\n' + text;
		} 
		return text; 
	}
}

function Menu(name,cmd){
	this.name = name;
	this.cmd = cmd;
	this.area = null;
	this.items = new Array();
	this.addItem = function(value,lable){
		this.items[this.items.length] = new MenuItem(value,lable);
	}
	this.addItems = function(){
		for (i=0;i<arguments.length;i=i+2){
			this.addItem(arguments[i],arguments[i+1]);
		}
	}
	this.getRenderedText = function(){
		text = "<td><select name='"+this.name+"' id='"+this.name+"_"+this.area.name+"' onchange='HyperTextArea.getArea(\""+ this.area.name +"\").select(this,\""+this.cmd+"\");'>\n";
		for (i=0;i<this.items.length;i++){
			thisItem = this.items[i]
			text = text + "<option value='"+thisItem.value+"'>"+thisItem.lable+"</option>\n";
		}
		text = text + "</select></td>";
		return text;
	}
}

function MenuItem(value,lable){
	this.value = value;
	this.lable = lable;
}

HyperTextArea.areas = new Array();
HyperTextArea.getArea = function(name){
	return HyperTextArea.areas[name];
}
HyperTextArea.activeArea = null;
HyperTextArea.about = function(){
	var area;
	for(i in HyperTextArea.areas){
		area = HyperTextArea.getArea(i);
		break;
	}
	window.open(area.resourcePath + "about.html");
}
HyperTextArea.updateAllAreas = function(){
	//iterate over all areas and call update
	for(i in HyperTextArea.areas){
		area = HyperTextArea.areas[i];
		area.update();
	}
}
HyperTextArea.forms = new Array();

function getOffsetTop(elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	
	while(mOffsetParent){
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	
	return mOffsetTop;
}

function getOffsetLeft(elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	
	while(mOffsetParent) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	
	return mOffsetLeft;
}

function kb_handler(evt, rte) {
	//contributed by Anti Veeranna (thanks Anti!)
	if (evt.ctrlKey) {
		var key = String.fromCharCode(evt.charCode).toLowerCase();
		var cmd = '';
		switch (key) {
			case 'b': cmd = "bold"; break;
			case 'i': cmd = "italic"; break;
			case 'u': cmd = "underline"; break;
		};

		if (cmd) {
			evt.target.ownerDocument.execCommand(cmd,false,true);
			// stop the event bubble
			evt.preventDefault();
			evt.stopPropagation();
		}
 	}
}

function stripWordHTML(oldString) {
	var newString = oldString;
	
	//清理word，excel里面复制过来的table html垃圾代码
	newString = newString.replace("x:str", "");
	newString = newString.replace("border=0", "border=1");
    newString = newString.replace(/<(\w[^>]*) style="([^"]*)"/gi,  "<$1")
    newString = newString.replace(/<\/?SPAN[^>]*>/gi,  ""  ); //Remove  all  SPAN  tags  
    newString = newString.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;//  Remove Lang attributes  
    newString = newString.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");//  Remove Class attributes 
	//newString = newString.replace(/'/g, "&#39;");
	//trim string
	newString = trim(newString);
	return newString;
}

function stripHTML(oldString) {
	var newString = oldString.replace(/(<([^>]+)>)/ig,"");
	
	//replace carriage returns and line feeds
	newString = escape(newString)
	newString = newString.replace("%0D%0A"," ");
	newString = newString.replace("%0A"," ");
	newString = newString.replace("%0D"," ");
	newString = unescape(newString)
	
	//trim string
	newString = trim(newString);
	return newString;
}


function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
}

function getPaletteAsString(){
	hexArray = new Array("00","55","AA","FF");
	out = "";
	out2 = "";
	line = ""
	row = 1;
	count = 1;
	for(i=hexArray.length-1;i>=0;i--){
		val0 = hexArray[i];
		for(j=hexArray.length-1;j>=0;j--){
			val1 = hexArray[j];
			for(k=hexArray.length-1;k>=0;k--){
				val2 = hexArray[k];
				hexVal = val0+val1+val2;
				line = line + "\n <td id='#"+hexVal+"' bgcolor='#"+hexVal+"' width='15' height='15' onmouseover='this.style.border=\"1px dotted white\"' onclick='area.setColor(this.id)'><img width='1' height='1'></td>";
				if(count==1 || (row % 2) == 0){
					if(((count - 1) % 8) == 0){
						out = out + "\n<tr>";
						row++
					}
					out = out + line;
					if((count % 8) == 0){
						out = out + "\n</tr>";
					}
				}else{
					if(((count - 1) % 8) == 0){
						out2 = out2 + "\n<tr>";
						row++
					}
					out2 = out2 + line;
					if((count % 8) == 0){
						out2 = out2 + "\n</tr>";
					}
				}
				line = "";
				count++;
			}
		}
	}
	out = '<table cellpadding="0" cellspacing="1" border="1" align="center">' + out + out2 + "</table>";
	return out;
}

function getTableDialogAsString(){
	out = '<html><body><form name="tableDialog">';
	out = out + '<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BDD7F7"><tr><td>';
	out = out + '<table width="100%" cellpadding="2" cellspacing="2" border="0" bgcolor="#FFFFFF">';
	out = out + '<tr bgcolor="#eff7ff">';
	out = out + '<td colspan=2 align=center><font size=2px>插入表格</font></td>';
	out = out + '</tr>';
	out = out + '<tr bgcolor="#ffffde">';
	out = out + '<td align=center><font size=2px>行数:</font></td><td align=center><font size=2px>列数:</font></td>';
	out = out + '</tr>';
	out = out + '<tr bgcolor="#ffffde">';
	out = out + '<td align=center><input type="text" name="rows" size="7" value="3"/></td>';
	out = out + '<td align=center><input type="text" name="cols" size="7" value="3"/></td>';
	out = out + '<tr bgcolor="#ffffde">';
	out = out + '<td colspan=2 align=center><input type="button" name="button" value="确定" onclick="window.opener.HyperTextArea.activeArea.insertTable(this.form.rows.value,this.form.cols.value,2,2,true);self.close()"/>&nbsp;<input type="button" name="cancel" value="取消" onclick="self.close()"/></td>';
	out = out + '</tr>';
	out = out + '</table>';
	out = out + '</td></tr></table>';
	out = out + '</form></body></html>';
	return out;
}
function enableDesignMode(areaName){
	try{
		if (document.all) {
			frames[areaName].document.designMode = "On";
		}else{
			contentDocument = document.getElementById(areaName).contentDocument;
			contentDocument.designMode = "on";
		}	
		self.status = "";
		area.setContent(area.html)
	}catch(e){
		//attempt to recover from any exceptions
		exp = "enableDesignMode('"+areaName+"')";
		area = HyperTextArea.getArea(areaName);
		area.designModeRetryCount++
		self.status = "Error in setting designMode property on attempt number "+ area.designModeRetryCount +".  Retrying.";
		if(area.designModeRetryCount <= 10){
			t = setTimeout(exp,100);
		}else{
			self.status = areaName + " failed to initialize properly";
			throw e;
		}
	}
}

function onHyperTextAreaLoad(areaName) {
	self.status = "attempting to set designMode property";
	area = HyperTextArea.getArea(areaName);
	area.cpWindow = frames['cp' + areaName].window;
	
	//enables the area to determine what form it belongs to
	area.form = document.getElementById("hdn"+areaName).form;
	
	//attaches to the forms submit handler only once
	formAlreadyStored = false;
	for(i=0;i<HyperTextArea.forms.length;i++){
		if(area.form == HyperTextArea.forms[i]){
			formAlreadyStored = true;
			break;
		}
	}
	if(!formAlreadyStored){		
              onSubmitFunc = area.form.onsubmit;
  	      area.form.onsubmit = function(){
	  	   HyperTextArea.updateAllAreas();
		   if(onSubmitFunc){
			onSubmitFunc();
		   }	
	      }		
              HyperTextArea.forms[HyperTextArea.forms.length] = area.form;
	}	
	area.setContent(area.html)
	if (document.all) {
		cp = frames["cp" + areaName];
		cp.document.write(getPaletteAsString());
	} else {
		cp = document.getElementById("cp"+areaName);
		d = cp.contentDocument;
		d.open();
		d.write(getPaletteAsString());
		d.close()
	}
	enableDesignMode(areaName);
	area.setContent(area.html)
}
//-->
</script>
							   <script>
								var details = '<%=changechr(rs("content"))%>';
							    area = new HyperTextArea("area1", details, 450, 200,"");
							   </script>
                                </div>
                                <textarea style="display:none" name="p_z_Z_Details" cols=50 rows=10></textarea> 
                                <table width="100%" cellPadding="0" cellSpacing="0" border="0">
                                  <tr> 
                                    <td class="S"><br>
                                    <SPAN class=note>说明尽可能详细，以提高信息的可信度，促使您做成生意；<BR><FONT 
                  color=red>注意：请不要在详细说明中留下公司名称和任何联系方式。</FONT></SPAN></td>
                                  </tr>
                      </table></td>
</TR>
        </TABLE>
            <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <TBODY>
				   <script language = "JavaScript" src = "../../file_ico/file_js.js" type="text/javascript"></script>
				<tr>
				  <TD class=C vAlign=top width="20%" 
                bgColor=#FFFCF7><B>产品图片一：</B></TD>
                  <td height="30" bgcolor="#FFF8EE"><input name="draw" type="text" size="40" maxlength="48" onClick="lookmagic(1)" ID="magicfacepic(1)" readonly value="<%=trim(rs("draw"))%>"> <font onclick="lookmagic(1)" style="CURSOR:hand">选择图片</font>&nbsp;<a href="../myfiles.asp" target="_blank">统一上传图片</a>
	<div id="magicframe(1)" style="visibility:hidden; position: absolute;width:10; left: 2px; top: 479px;"><iframe src="../inc_file.asp?action=1" width="380" height="210" frameborder="0" scrolling="no"></iframe></div></td>
  </tr>
               <tr>
				  <TD class=C vAlign=top width="20%" 
                bgColor=#FFFCF7><B>产品图片二：</B></TD>
                  <td height="30" bgcolor="#FFF8EE"><input name="draw1" type="text" size="40" maxlength="48" onClick="lookmagic(2)" ID="magicfacepic(2)" readonly value="<%=trim(rs("draw1"))%>"> <font onclick="lookmagic(2)" style="CURSOR:hand">选择图片</font>&nbsp;<a href="../myfiles.asp" target="_blank">统一上传图片</a>
	<div id="magicframe(2)" style="visibility:hidden; position: absolute;width:10; left: 2px; top: 479px;"><iframe src="../inc_file.asp?action=2" width="380" height="210" frameborder="0" scrolling="no"></iframe></div></td>
  </tr>
   <tr>
				  <TD class=C vAlign=top width="20%" 
                bgColor=#FFFCF7><B>产品图片三：</B></TD>
                  <td height="30" bgcolor="#FFF8EE"><input name="draw2" type="text" size="40" maxlength="48" onClick="lookmagic(3)" ID="magicfacepic(3)" readonly value="<%=trim(rs("draw2"))%>"> <font onclick="lookmagic(3)" style="CURSOR:hand">选择图片</font>&nbsp;<a href="../myfiles.asp" target="_blank">统一上传图片</a>
	<div id="magicframe(3)" style="visibility:hidden; position: absolute;width:10; left: 2px; top: 479px;"><iframe src="../inc_file.asp?action=3" width="380" height="210" frameborder="0" scrolling="no"></iframe></div></td>
  </tr>
				  <tr bgcolor="#FFFCF7"> 
                              <td width="20%" valign="top"  class=C><b>产品图片：</b>
                                <input type="hidden" value="0" name="picsample_0">
                              <input type='hidden' name='p_z_Z_Picsample' value="">
                              <input type="hidden" value="0" name="picsample_1">
                              <input type="hidden" value="0" name="picsample_2"></td>
                              <td  bgcolor=#FFF8EE class=lh15 style="position: relative; clip: rect( )"><table cellSpacing=0 cellPadding=0 width="100%" height="100%" border=0 id="table100" style=display:"none">
                                  <tr> 
                                    <td>&nbsp;</td>
                                  </tr>
                                </table>                      </td>
				  </tr>
              </TBODY></TABLE>
 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="2" bgcolor="ff7300"></td>
                    </tr>
                  </table>
              <BR>
            <TABLE width="95%">
              <TBODY>
              <TR>
                <TD class=lh15><SPAN class=C><FONT 
                  color=#ff0000><STRONG>最后一步很重要！<BR>
                          </STRONG></FONT></SPAN><STRONG>请确保联系资料是完整准确的，以保证客户找到您。如要修改，<A 
                  href="../modify/modify_info.asp" 
                  target=_blank>点此修改联系资料</A></STRONG></TD>
                    </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width="95%" border=0>
              <TBODY>
              <TR>
                <TD bgColor=#cccccc>
                  <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD style="PADDING-LEFT: 10px" align=right width="25%" 
                      bgColor=#ffffff>姓名：</TD>
                      <TD style="PADDING-LEFT: 10px" bgColor=#ffffff><%=rs5("name")%>&nbsp; 
                        <%=rs5("ch")%> </TD></TR>
                    <TR>
                      <TD style="PADDING-LEFT: 10px" align=right 
                        bgColor=#ffffff>公司名称：</TD>
                      <TD style="PADDING-LEFT: 10px" bgColor=#ffffff><%=rs5("qymc")%> </TD></TR>
                    <TR>
                      <TD style="PADDING-LEFT: 10px" align=right 
                        bgColor=#ffffff>电话：</TD>
                      <TD style="PADDING-LEFT: 10px" bgColor=#ffffff><%=rs5("phone")%> </TD></TR>
                    <TR>
                      <TD style="PADDING-LEFT: 10px" align=right 
                        bgColor=#ffffff>传真：</TD>
                      <TD style="PADDING-LEFT: 10px" bgColor=#ffffff><%=rs5("fax")%> </TD></TR>
                    <TR>
                      <TD style="PADDING-LEFT: 10px" align=right 
                        bgColor=#ffffff>电子邮件：</TD>
                      <TD style="PADDING-LEFT: 10px" 
                        bgColor=#ffffff><%=rs5("email")%> 
                </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
            <TABLE cellSpacing=0 cellPadding=4 border=0>
              <TBODY>
              <TR>
                
                <TD vAlign=top noWrap><input type="button" name="Post" value="一切完成，我要发布！"  onclick="javascript:post(this.form)" style="width:160px" class="subbutton"> 
                </TD></TR></TBODY></TABLE></FORM><BR>
				<script>
<!-- init 方向-->
     typeDispBuy.innerHTML = "求购";
     typeDispSale.innerHTML = "供应";
 <!-- init 主题 -->
                        document.form.p_z_Z_Subject.value="<%=rs("showname")%>";
                 //document.form.p_z_Z_Type[1].checked = true;
	var len=form.InfoType.length;
    var catid="<%=sid%>";
	//var type="<%=rs("type")%>"
	//var type="1"
	var ExpireDays="<%=rs("period")%>";
    for (var i=0;i<len;i++){
        if (catid==form.InfoType[i].value){
            form.InfoType[i].checked=true;
			break;
        }
    }
	for (i=0;i<form.p_z_Z_OfferExpire.length;i++){       
		if (ExpireDays==form.p_z_Z_OfferExpire[i].value){ 
			form.p_z_Z_OfferExpire[i].checked=true;			
        }
    }

	<%if picc0=1 then%>
	 set_picture("0","/Vipcom/<%=draw%>");
	 <%else%>
	 <%end if%>
	 <%if picc1=1 then%>
	 set_picture("1","/Vipcom/<%=draw1%>");
	 <%else%>
	 <%end if%>
	 <%if picc2=1 then%>
	 set_picture("2","/Vipcom/<%=draw2%>");
	 <%else%>
	 <%end if%>
   </script>

           <script>

        //category methods
        function Category(id,title) {
                this.id = id;
                this.title=title;
                this.boardlist=new Array();
                this.addBoard=addBoard;
                this.getOptions = getOptions;
        }        
        
        function addBoard(board) {
                this.boardlist = this.boardlist.concat(board);
        }
        
        function getOptions() {
                var tmp = new Array();
                for(var i=0; i < this.boardlist.length;i++) {
                        var b = this.boardlist[i];
                        tmp[i]= b.getOption();
                }
                return tmp;
        }
        
        //board methods
        function Board(catid,id,title,total) {                
                this.catid=catid;
                this.id=id;
                this.title=title;
                this.getOption=getOption;
        }
                
        function getOption() {
                return new Option(this.title,this.id);                
        }
                
        function changeCategory(list) {
        if (list.selectedIndex<=0) {
                catForm.options[0].selected=true;
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                                        
         }
        else {
                var boards = catArr[list.selectedIndex-1].getOptions();
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                
                for (var i=0;i<boards.length;i++) {
                        boardForm.options[i+1]=boards[i];
                }
                }
                boardForm.options[0].selected=true;
        }
                
        function selectBoard(catid,bid,list) {
                var isExist = false; //是否是叶子类目
                for(var i=0;i<catForm.length;i++) {
                        if (catForm.options[i].value==catid) {
                                //alert("get Category");
                                catForm.options[i].selected=true;
                                changeCategory(catForm);
                                break;                        
                        }                        
                }                                
                for(var i=0;i<boardForm.length;i++) {
                        if (boardForm.options[i].value==bid) {
                                //alert("get Board");
                                boardForm.options[i].selected=true;  
                                isExist = true;                              
                                break;
                        }                        
                }   
                
                if (!isExist) {//如果是二级类目，则下拉框只显示该二级类目下所有类目                   
                    var boards = catArr[catForm.selectedIndex-1].getOptions();
                    var len = boardForm.options.length;
                    for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                    }     
                    var locate = 1;           
                    for (var i=0;i<boards.length;i++) {                                                              
                        if(boards[i].text.indexOf(bid) == 0){
                            boardForm.options[locate]=boards[i];
                            locate++;
                        }                                                
                    }
                
                    boardForm.options[0].selected=true;   
                }            
        }        
        
        //static methods        
        var catArr = new Array();
        var cur;
        //init catform
        var catForm = document.form.p_z_Z_RootCategory;
        var boardForm = document.form.p_z_Z_CategoryId1;
        
        
        
        function showCategorys() {
            var catId = catForm.value
            if(boardForm.value){
                catId = boardForm.value
            }else if(catForm.value){
                catId = catForm.value
            }
            window.open('/tradeinfo/smalllist.asp?sortid='+catId,'newwin','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500')            
        }
        for (var i=0;i<catArr.length;i++) {
                catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
        }
        changeCategory(catForm);
        //设置初始值  vilia wang 2004-3-29日添加
        catid = document.form.catId.value;
         for(var i=0;i<catForm.length;i++) {
                        if (catForm.options[i].value==catid) {
                                //alert("get Category");
                                catForm.options[i].selected=true;
                                changeCategory(catForm);
                                break;                        
                        }                        
                }    
                                     function initRootCategorys(){
	    for (var i=0;i<catArr.length;i++) {
		 catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
	    }
	}  
        //init                
</script>
<script src="../../js/allCategorys.js"></script>
<script>
initRootCategorys(); 
</script>
<script>
selectBoard("<%=sid%>","<%=tid%>,<%=tid2%>");
</script>
            <TABLE class=bdr1 cellSpacing=0 cellPadding=0 width="95%" 
              border=0><TBODY>
              <TR>
                <TD height=103>
                  <TABLE class=bdr2 cellSpacing=0 cellPadding=0 width="100%" 
                  border=0>
                    <TBODY>
                    <TR>
                      <TD class=lh13 height=91><SPAN 
                        class=M>重要提醒：</SPAN><BR><BR>
                                1、只要两小时！您发布的信息就能被百万商人看到！（工作日8：00-17：30） <BR>
                                · 节假日发布的信息顺延至工作日上网；<BR>· 
                        信息发布高峰期上网时间稍有延后，敬请谅解！<BR><BR>2、发布信息后，为保证客户及时与您联系，请确保您的联系信息（特别是电话、电子邮箱地址）准确无误。<BR><BR>3、请勿一天内重复提交相同内容的信息，否则将不被审核通过。<BR><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR>
    
      <BR><BR></TD></TR></TBODY></TABLE><BR><BR></TD></TR>
</TABLE>
<%
end if
rs.close
set rs=nothing
rs5.close
set rs5=nothing
conn.close
set conn=nothing
%>
