 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="21"
	dir="../err.asp" 
 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../rolecheck.asp"-->

<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 <LINK href="../css/style.css" rel=stylesheet type=text/css> 
<title>添加专项商机</title>
<table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">专项商机管理 </th> 
  </tr> 
  <tr> 
     <td colspan="2" height="20"  ><font color="#666666">温馨提示：①类别直接与发布的信息相关联，删除类别可能会影响到以前发布的专项商机信息。</font> </td> 
  </tr> 
  <tr bgcolor="#DAEAF3"> 
     <td width="12%" height=25  > <B>操作选项</B></td> 
     <td width="88%"  ><a href="index.asp">管理专项商机</a> | <a href="add_vipinfo.asp">添加专项商机</a> | <a href="type.asp">管理商机类别</a> | <a href="class_ok.asp?action=add_class_1">添加专项类别</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td> 
  </tr> 
</table>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
   <form name="form" method="POST" action="save_vipinfo.asp"   >
  <tr>
      <th align=left height=23>商机信息</th>
    </tr>
    <tr>
      <td>
<SCRIPT language=javascript>
<!--
function admin_Size(num,objname)
{
	var obj=document.getElementById(objname)
	if (parseInt(obj.rows)+num>=3) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	if (num>0)
	{
		obj.width="90%";
	}
}
//--> 
</SCRIPT>
<SCRIPT language=JavaScript>
function setSubjectText(){
   var keywords = form.keywords.value;
   for(i=0;i<keywords.length;i++){keywords=keywords.replace(',','，');}
    if(form.keywords2.value){
        for(i=0;i<form.keywords2.value.length;i++){form.keywords2.value=form.keywords2.value.replace(',','，');}
        keywords+=','+form.keywords2.value;
    }
    if(form.keywords3.value){
        for(i=0;i<form.keywords3.value.length;i++){form.keywords3.value=form.keywords3.value.replace(',','，');}
        keywords+=','+form.keywords3.value;
    }    
    form.p_z_Z_Keywords.value = keywords

  //  return true;
	document.form.submit()
    }
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>
<table border="0" width="100%" cellspacing="1"> 
                          <tr> 
                            <td width="15%" class=forumRow>信息主题：</td> 
                            <td width="85%" class=forumRow> <input name="showname" type="text" style="border-style: solid; border-width: 1" size="45" maxlength="20">
                              <font color="#CC3300"> * </font>                              </td> 
                          </tr> 
                          
                          <tr>
                            <td class=forumRow>是否推荐：</td>
                            <td width="85%" class=forumRow><input type="checkbox" name="checkbox" value="1"></td>
                          </tr> 
                          
                          <tr> 
                            <td width="15%" class=forumRow>有 效 期：</td> 
                            <td width="85%" class=forumRow> <select size="1" name="period" class="f11" style="border-style: solid; border-width: 1"> 
                                <option value="一周">一周</option> 
                                <option value="半月">半月</option> 
                                <option value="一个月">一个月</option> 
                                <option value="三个月">三个月</option> 
                                <option value="六个月">六个月</option> 
                                <option value="一年">一年</option> 
                                <option value="长期">长期</option> 
                              </select> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
						  <tr> 
                            <td width="15%" class=forumRow>价格说明：</td> 
                            <td width="85%" class=forumRow> <input name="jgsm" type="text" style="border-style: solid; border-width: 1" value="详谈" size="20" maxlength="15"> 
                              <font color="#CC3300"> *</font></td> 
                          </tr>
						  <tr> 
                            <td width="15%" class=forumRow>交易类别：</td> 
                            <td width="85%" class=forumRow> <select name="type" size="1"> 
<option selected value="">--请选择交易类别--</option> 
<%
set rs1=conn.execute("select * from Websen_vipinfo_class")
do while not rs1.eof
response.write "<option value='"&rs1("typeid")&"'>"&rs1("type")&"</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
%>
</select> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
						   <tr> 
                            <td class=forumRow>上传图片：</td> 
                            <td class=forumRow>
							
							 <!----------------------------------------------------文件上传----------------------------------------------->
  <iframe id="d_file" frameborder="0" src="../../inc/upload.asp?tMode=8&istwo=0&utype=vipinfo&" width="300" height="40" scrolling="no"></iframe>
  <!--------------------------------------------------------------------------->
<br />							 <input type="hidden" size="45" name="picture" maxlength="100"  value=""/>
							</td> 
                          </tr>
						  <tr> 
                            <td class=forumRow>所属网站行业类别：</td> 
                            <td class=forumRow>	
							
							<select name="p_z_Z_RootCategory" onchange="changeCategory(this)"  >
                                  <option selected value="">--请选择行业大类--</option>
                              </select>                               <select name="p_z_Z_CategoryId1" maxlength="80" value="">
                                  <option value="0" selected>--请选择行业子类--</option>
                                </select> 
								
								
                              *</font></td> 
                          </tr> 
                          <tr> 
                            <td class=forumRow>关 键 字：</td>
                            <td width="85%" class=forumRow><INPUT maxLength=8 size=20 
                  name=keywords>, <INPUT maxLength=8 size=20 name=keywords2>, 
                  <INPUT maxLength=8 size=20 name=keywords3> <INPUT type=hidden 
                  name=p_z_Z_Keywords><font color="#CC3300"> *</font></td> 
                          </tr> 
                         
                          <tr>
                            <td class=forumRow>信息内容：</td>
                            <td class=forumRow><textarea rows="10" cols="80" name="content" class="f11" id="conter"></textarea>
                              <a href="javascript:admin_Size(-5,'conter')"><img src="../images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'conter')"><img src="../images/plus.gif" unselectable="on" border='0'></a>							</td>
                          </tr> 
      </table></td>
    </tr>
	  <tr>
      <th height=23 align=left>联系信息</th>
    </tr>
	<tr>
      <td><table width="100%" height="121" border="0" cellpadding="0" cellspacing="1"> 
                          <tr> 
                            <td width="15%" valign="top" height="22" class=forumRow>联 系 人：</td> 
                            <td width="34%" valign="top" height="22" class=forumRow> <input name="linkman" type="text" class="f11" value="空" size="25" maxlength="10"> 
                              <font color="#CC3300"> *</font></td> 
                            <td width="16%" valign="top" height="22" class=forumRow>联系电话：</td> 
                            <td width="35%" valign="top" height="22" class=forumRow> <input name="phone" type="text" value="空" size="25" maxlength="50" > 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
                          <tr> 
                            <td width="15%" valign="top" height="19" class=forumRow>公司名称：</td> 
                            <td width="34%" valign="top" height="19" class=forumRow> <input name="company" type="text" value="空" size="25" maxlength="20"></td> 
                            <td width="16%" valign="top" height="19" class=forumRow>联系地址：</td> 
                            <td width="35%" valign="top" height="19" class=forumRow> <input name="address" type="text" value="空" size="25" maxlength="50"> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
                          <tr> 
                            <td width="15%" valign="top" height="22" class=forumRow>所在区域：</td> 
                            <td width="34%" valign="top" height="22" class=forumRow> <input name="country" type="text" value="未填" size="25" maxlength="50"> 
                              <font color="#CC3300"> *</font></td> 
                            <td width="16%" valign="top" height="22" class=forumRow>所属城镇：</td> 
                            <td width="35%" valign="top" height="22" class=forumRow> <input name="city" type="text" value="空" size="25" maxlength="20"> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
                          <tr> 
                            <td width="15%" valign="top" height="19" class=forumRow>电子邮件：</td> 
                            <td width="34%" valign="top" height="19" class=forumRow> <input name="email" type="text" value="空" size="25" maxlength="30"> 
                              <font color="#CC3300"> *</font></td> 
                            <td width="16%" valign="top" height="19" class=forumRow>邮政编码：</td> 
                            <td width="35%" valign="top" height="19" class=forumRow><input name="postcode" type="text" value="空" size="25" maxlength="10"> 
                              <font color="#CC3300">&nbsp; </font></td> 
                          </tr> 
                          <tr> 
                            <td width="15%" valign="top" height="19" class=forumRow>公司传真：</td> 
                            <td width="34%" valign="top" height="19" class=forumRow> <input name="fax" type="text" value="空" size="25" maxlength="25"></td> 
                            <td width="16%" valign="top" height="19" class=forumRow>公司网址：</td> 
                            <td width="35%" valign="top" height="19" class=forumRow> <input name="web" type="text" value="空" size="25" maxlength="50" ></td> 
                          </tr> 
      </table></td>
	</tr>
	<tr>
      <td class="forumRow">
	  <TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
              <TBODY>
              <TR>
                <TD height="30" align=center noWrap><INPUT class=subbutton style="WIDTH: 160px" onclick=javascript:setSubjectText() type=button value=一切完成，我要发布！ name=Post>        </TD></TR></TBODY></TABLE></td></tr></form></table>
				
				<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);
        }
  
                      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>
 
<%
set rs1=nothing
conn.close
set conn=nothing
%>
<!--#include file="../copy.asp" -->