<%@ page language="C#" autoeventwireup="true" inherits="user_mall_do, ZKCMS" maintainscrollpositiononpostback="true" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register TagName="meta" TagPrefix="UC" Src="~/s/include/meta.ascx" %>
<%@ Register TagName="head" TagPrefix="UC" Src="~/s/include/head.ascx" %>
<%@ Register TagName="tip_bar" TagPrefix="UC" Src="~/s/include/tip_bar.ascx" %>
<%@ Register TagName="foot" TagPrefix="UC" Src="~/s/include/foot.ascx" %>
<%@ Register TagName="side_menu" TagPrefix="UC" Src="~/user/side_menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>会员中心_
        <%=ZK.config("sitetitle") %></title>
    <meta name="keywords" content="<%=ZK.config("sitekeywords") %>" />
    <meta name="description" content="<%=ZK.config("sitedescription") %>" />
    <UC:meta ID="meta1" runat="server" />
</head>
<body>
    <div class="wrap">
        <a name="pagetop" id="pagetop"></a>
        <UC:head ID="head1" runat="server" />
        <UC:tip_bar ID="tip_bar1" runat="server" />
        <form id="form1" runat="server" autocomplete="off">
        <div class="box">
            <div class="hot">
                <div class="fl" style="width: 180px">
                    <div class="c1 mt5">
                        <div class="b">
                            <div class="fl">
                            </div>
                            <div class="con" style="width: 80px">
                                功能菜单</div>
                            <div class="fr">
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="v">
                            <UC:side_menu ID="side_menu1" runat="server" />
                        </div>
                    </div>
                </div>
                <div class="fr flow" style="width: 765px">
                    <div class="c1 mt5">
                        <div class="b">
                            <div class="fl">
                            </div>
                            <div class="con">
                                <asp:Literal ID="PathTitleActType" runat="server">发布</asp:Literal>商品信息</div>
                            <div class="fr">
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="v">
                            <div class="do1">

                                <script type="text/javascript">var ContinueMake=1;                
            function check(){if(ContinueMake!=1){setTimeout(check,1000);return false;} 
            if(document.getElementById("HiddenField_classid").value==""){alert("请选择商品类别！");return false;}            
            if(document.getElementById("title").value==""){alert("请填写商品名称！");return false;}
            if(document.getElementById("title").value.length<4){alert("商品名称太短！");return false;}
            if(document.getElementById("areaid").value==""){alert("请选择所在区域！");return false;}
            
                if(document.getElementById("oldprice").value.replace(/ /g,"").replace(/　/g,"")==""){alert("原价不能为空！");return false;}
                if(document.getElementById("buyprice").value.replace(/ /g,"").replace(/　/g,"")==""){alert("商城价格不能为空！");return false;}
                if (/[^\d]/.test(document.getElementById("oldprice").value.replace(".",""))){alert("原价输入不正确！");return false;}
                if (/[^\d]/.test(document.getElementById("buyprice").value.replace(".",""))){alert("商城价输入不正确！");return false;}
                if(parseInt(document.getElementById("buyprice").value)<0){alert("商城价格不能小于0元！");return false;}
                if(parseInt(document.getElementById("buyprice").value)>99999){alert("商城价格不能大于99999元！");return false;}
                if(!self_comparePrice(document.getElementById("oldprice").value,document.getElementById("buyprice").value)){alert("商城价必须小于原价！");return false;}
            
            if(document.getElementById("contact").value==""){alert("请填写联系人！");return false;}
            if(document.getElementById("phone").value==""&&document.getElementById("qq").value=="")if(document.getElementById("tel").value==""){alert("请填写联系手机！");return false;}           
            if(document.getElementById("tel").value!=""){if (!telReg.test(document.getElementById("tel").value)){alert("请输入正确的手机号码！");return false;}}   
            if(document.getElementById("qq").value!=""){if (!qqReg.test(document.getElementById("qq").value)){alert("请输入正确的QQ号！");return false;}} 
            if(<%=ZK.config("switchvalidatecode1") %>==1)if(document.getElementById("vc").value==""){alert("验证码不能为空！");return false;}else{if(document.getElementById("msg_vc").innerHTML!=""&&document.getElementById("msg_vc").innerHTML.indexOf("请输入")==-1){alert("验证码不正确！");return false;}}   
if(document.getElementById("CustomArea").style.display!="none"){
var strTemp="";var list=document.getElementById("CustomArea").getElementsByTagName("input");
for(var i=0;i<list.length && list[i];i++){ if(i%2==0)strTemp+= (list[i].value+"：").replace("：：","：");else strTemp+= list[i].value+"_";}
document.getElementById("customcode").value=strTemp;
}
if(document.getElementById("sonclass").value=="")document.getElementById("HiddenField_sonclass").value="";
}
function self_comparePrice(p1,p2)
{
    return(parseFloat(p1)>=parseFloat(p2));
}
/*-----------------*/
function self_createXMLHttpRequest(){
if (window.ActiveXObject){try{self_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch (e1){self_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}}else if (window.XMLHttpRequest) {self_xmlhttp = new XMLHttpRequest();}
return self_xmlhttp;
}
function self_ajax(method,strUrl,strPar,OnHandler){
var self_xmlhttp = self_createXMLHttpRequest();
if(method=="get")self_xmlhttp.open("GET",strUrl,true);else {self_xmlhttp.open("POST",strUrl,true);self_xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");}
self_xmlhttp.onreadystatechange = OnHandler;
if(method=="get")self_xmlhttp.send(null);else self_xmlhttp.send(strPar);
}

function setDropDownListSonClass(id,obj,ajaxexecfile,type,classid,obj2)
{
document.getElementById(obj).options.length=0;
if(id==""||isNaN(id))document.getElementById(obj).style.display="none";
else{
document.getElementById(obj).style.display="";document.getElementById(obj).options[0] = new Option("loading...","");
self_ajax("get",ajaxexecfile+"&id="+id+"&rd="+Math.random(),"",function OnHandler(){if(self_xmlhttp.readyState == 4){setDropDownListSonClass_(obj,ajaxexecfile,self_xmlhttp.responseText,type,classid,obj2);}});
}
}
function setDropDownListSonClass_(obj,ajaxexecfile,ids,type,classid,obj2)
{
var arr1=ids.split(",");for(var i=0;i<arr1.length;i++){if(arr1[i]!=""){document.getElementById(obj).options[i+1] = new Option(arr1[i].split("|")[1],arr1[i].split("|")[0]);}}
if(type==1){
if (navigator.userAgent.indexOf('Firefox')!=-1)document.getElementById(obj).remove(document.getElementById(obj).options[0].index);else document.getElementById(obj).options.remove(document.getElementById(obj).options[0].index);if(classid=="")document.getElementById(obj).options[0] = new Option("请选择子级细类","");
document.getElementById("sonclass").style.display="";
for(var i=0;i<document.getElementById(obj2).length;i++)if(document.getElementById(obj2).options[i].value==classid){document.getElementById(obj2).selectedIndex=i;}
}else{if(document.getElementById(obj).options.length==1){self_fun1();}else {document.getElementById(obj).style.display="";} document.getElementById(obj).options[0] = new Option("请选择子级细类(可选)","");document.getElementById(obj).selectedIndex=0;}
}
function self_fun1()
{
document.getElementById("sonclass").options.length=0;document.getElementById("sonclass").style.display="none";document.getElementById("HiddenField_sonclass").value="";
}


</script>

                                <table border="0" cellpadding="0" cellspacing="0" class="table1">
                                    <tr>
                                        <td class="tt">
                                            <b>商品类别：</b>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="parentclassid" runat="server" Width="200" CssClass="sel1" onchange="setDropDownListSubClass(this.value,'classid','mall_do.aspx?act=ajax&type=getsubclass',0,0,'classid',0,0);self_fun1()">
                                            </asp:DropDownList>
                                            <asp:DropDownList ID="classid" runat="server" Width="195" CssClass="sel1" Style="display: none"
                                                onchange="document.getElementById('HiddenField_classid').value=this.value;setCustomCode(this.value,0,'mall_do.aspx?act=ajax&type=custom');setDropDownListSonClass(this.value,'sonclass','mall_do.aspx?act=ajax&type=getsonclass',0,0,'sonclass')">
                                            </asp:DropDownList>
                                            <asp:DropDownList ID="sonclass" runat="server" Width="195" CssClass="sel1" Style="display: none" onchange="document.getElementById('HiddenField_sonclass').value=this.value"></asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            <b>商品名称：</b><asp:HiddenField ID="HiddenField_AddSwitch" runat="server" Value="0" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="title" runat="server" MaxLength="200" CssClass="inp4" Width="392" onmouseover="document.getElementById('HiddenField_AddSwitch').value='1'"></asp:TextBox><span
                                                style="margin-left: 10px"><span class="msgon">请填写商品名称！</span></span><asp:HiddenField
                                                    ID="HiddenField_enable" runat="server" />
                                        </td>
                                    </tr>
                                     <tr>
                                        <td class="tt">
                                           <b>商品原价：</b>
                                        </td>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                            <td><asp:TextBox ID="oldprice" runat="server" MaxLength="8" CssClass="inp4" Width="100"></asp:TextBox></td>
                                               <td class="tt">
                                            <b>本站网购价格：</b>
                                        </td> <td><asp:TextBox ID="buyprice" runat="server" MaxLength="8" CssClass="inp4" Width="102"></asp:TextBox><span style="margin-left: 10px"><span class="msgon">请填写商品价格！</span></span>
                                        </td>
                                            </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    
                                    
                                    
                                    <tr>
                                        <td class="tt">
                                            代表图片：
                                        </td>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0" style="cursor: default">
                                                <tr>
                                                    <td>
                                                        <div class="abs" style="*display: none">
                                                            <table width="400" border="0" cellspacing="0" cellpadding="0" height="24">
                                                                <tr>
                                                                    <td id="upimg1_txt" width="322" style="border: solid 1px #ccc">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                    </td>
                                                                    <td width="72" style="border: solid 1px #ccc" class="ce" style="color: #333">
                                                                        浏览...
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                        <asp:FileUpload ID="upimg1" runat="server" size="55" CssClass="inp4 self_inp4" ToolTip="jpg,jpeg,gif,bmp,png" />
                                                    </td>
                                                    <td style="padding-left: 8px">
                                                        <div id="thumbnailviewbox">
                                                            <asp:Literal ID="thumbnailview" runat="server"></asp:Literal></div>
                                                        <asp:HiddenField ID="thumbnail" runat="server" />
                                                    </td>
                                                </tr>
                                            </table>
                                            <style type="text/css">
                                                .self_inp4
                                                {
                                                    width: 393px; *width:400px;height:20px;*height:24px;filter:-moz-opacity:0;opacity:0;font-size:12px;}
                                                #CustomArea td
                                                {
                                                    padding-top: 5px;
                                                }
                                                #CustomArea .self_custom_inp
                                                {
                                                    font-size: 12px;
                                                    padding-left: 6px;
                                                }
                                            </style>

                                            <script type="text/javascript">
                                     if (navigator.userAgent.indexOf('Firefox') >= 0){document.getElementById("upimg1").style.width="400px";  document.getElementById("upimg1").style.height="24px";}
                                            </script>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            <b>所在区域：</b>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="areaid" runat="server" Width="200" CssClass="sel1">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                     
                                    <tr id="CustomAreaTr" style="display: none">
                                        <td class="tt">
                                            属性描述：
                                        </td>
                                        <td>
                                            <div id="CustomArea">
                                            </div>
                                            <div class="clear">
                                            </div>
                                            <asp:HiddenField ID="customcode" runat="server" />
                                            <asp:HiddenField ID="HiddenField_classid" runat="server" /><asp:HiddenField ID="HiddenField_sonclass" runat="server" />
                                            <asp:Literal ID="JS_classid" runat="server"></asp:Literal><asp:Literal ID="JS_sonclass" runat="server"></asp:Literal>
                                            <asp:Literal ID="JS_css1" runat="server"><style type="text/css">
                                                                                         #CustomArea .self_custom_inp
                                                                                         {
                                                                                             width: 508px;
                                                                                             margin-left: 4px;
                                                                                         }
                                                                                     </style></asp:Literal>

                                            <script type="text/javascript">if(location.href.indexOf("act=mod")!=-1){if(document.getElementById("classid").length==0)window.location="control.aspx";}</script>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            <b>商品介绍：</b>
                                        </td>
                                        <td>
                                            <%@ register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
                                            <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/s/tool/fck/" Height="500"
                                                Width="620" ToolbarSet="Edit1">
                                            </FCKeditorV2:FCKeditor>
                                        </td>
                                    </tr>
                                    
                                     <tr>
                                        <td class="tt">
                                            购物说明：
                                        </td>
                                        <td>
                                        <FCKeditorV2:FCKeditor ID="FCKeditor2" runat="server" BasePath="~/s/tool/fck/" Height="350"
                                                Width="620" ToolbarSet="Edit1">
                                            </FCKeditorV2:FCKeditor>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            使用说明：
                                        </td>
                                        <td>
                                               <FCKeditorV2:FCKeditor ID="FCKeditor3" runat="server" BasePath="~/s/tool/fck/" Height="350"
                                                Width="620" ToolbarSet="Edit1">
                                            </FCKeditorV2:FCKeditor>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            售后服务：
                                        </td>
                                        <td>
                                             <FCKeditorV2:FCKeditor ID="FCKeditor4" runat="server" BasePath="~/s/tool/fck/" Height="350"
                                                Width="620" ToolbarSet="Edit1">
                                            </FCKeditorV2:FCKeditor>
                                        </td>
                                    </tr>
                                    
                                    
                                 
                                    <tr>
                                        <td class="tt">
                                            <b>联系人：</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="contact" runat="server" MaxLength="15" CssClass="inp4" Width="192"></asp:TextBox><span style="margin-left: 10px"><span
                                                                class="msgon"><a href="company_store_contact.aspx" target="_blank" style="color:#f30;">点击这里完善常用联系信息！</a></span></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            联系地址：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="address" runat="server" MaxLength="80" CssClass="inp4" Width="392"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                               <b>联系电话：</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="phone" runat="server" MaxLength="50" CssClass="inp4" Width="192"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            联系手机：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="tel" runat="server" MaxLength="11" CssClass="inp4" Width="192"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            联系QQ：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="qq" runat="server" MaxLength="15" CssClass="inp4" Width="192"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            醒目设置：
                                        </td>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:DropDownList ID="istop" runat="server" Width="98" CssClass="">
                                                            <asp:ListItem></asp:ListItem>
                                                            <asp:ListItem Value="1">商品置顶</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td style="padding-left: 5px">
                                                        <asp:DropDownList ID="isred" runat="server" Width="98" CssClass="">
                                                            <asp:ListItem></asp:ListItem>
                                                            <asp:ListItem Value="1">标题套红</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td width="440" style="padding-left: 8px">
                                                        <div style="margin-top: -12px">
                                                            <span class="msgon" style="float: none">
                                                                <asp:Literal ID="Literal_remaining" runat="server" Visible="false"><a href="chongzhi.aspx" style="color:#ff6600" target="_blank">您的余额不足，请充值！</a></asp:Literal>商品置顶需花费<%=ZK.isTopMoneyCost %>金币，标题套红需花费<%=ZK.isRedMoneyCost %>金币。</span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr id="VCBOX">
                                        <td class="tt">
                                            <b>验证码：</b><%=WMcompare.IsEqual(ZK.config("switchvalidatecode1"), "0", "<script type=\"text/javascript\">document.getElementById(\"VCBOX\").style.display=\"none\";</script>", "")%>
                                        </td>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="vc" runat="server" MaxLength="4" CssClass="inp4" Width="60" onkeyup="if(this.value.length>0)check_vc();" onmouseover="if(document.getElementById('ValidateCodeImage').style.visibility!='visible')document.getElementById('ValidateCodeImage').style.visibility='visible';" onfocus="document.getElementById('ValidateCodeImage').style.visibility='visible';"></asp:TextBox>
                                                    </td>
                                                    <td style="padding-left: 5px; width: 300px">
                                                        <img id="ValidateCodeImage" src="/s/tool/fun/ValidateCode.aspx?type=en&len=4&height=24&str=&cookie=vc_user_mall_do"
                                                            title="点击刷新验证码" onclick="this.src='/s/tool/fun/ValidateCode.aspx?type=en&len=4&height=24&str=&cookie=vc_user_mall_do&rd'+Math.random()"
                                                            style="cursor: pointer;visibility: hidden" align="absmiddle" /><span id="msg_vc" style="margin-left: 10px"><span
                                                                class="msgon">请输入验证码！</span></span>
                                                    </td>
                                                </tr>
                                            </table>

                                            <script type="text/javascript">
function check_vc(){if(document.getElementById("vc").value!=""){
ContinueMake=0;ajax("get","/s/tool/fun/ValidateCode.aspx?act=check&cookie=vc_user_mall_do&value="+base64en(document.getElementById("vc").value)+"&msg="+encodeURI("验证码输入不正确！")+"&rd="+Math.random(),"",function OnHandler(){if(xmlHttp.readyState == 4){if(xmlHttp.responseText.indexOf("验证码输入不正确！")!=-1)document.getElementById("msg_vc").innerHTML=xmlHttp.responseText;else document.getElementById("msg_vc").innerHTML="";ContinueMake=1;}});
}}
                                            </script>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tt">
                                            &nbsp;
                                        </td>
                                        <td>
                                            <asp:Button ID="ButtonSubmit" runat="server" CssClass="but4" Text="确定发布" OnClick="ButtonSubmit_Click"
                                                OnClientClick="return check()" onmouseover="hover(this,0.8)" onmouseout="hover(this,1)" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
      </form><UC:foot ID="foot1" runat="server" /></div></body></html><script src="city.aspx"></script>
