{#include file="sys/admin_header.htm"#}
<script src="{#$QISHI.site_dir#}data/cache_classify.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/tc.all.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
	showmenu("#nature_cn","#menu1","#nature");
	showmenu("#trade_cn","#menu2","#trade");
  showmenu("#tag","#menut","#tag");
	showmenulayer("#district_cn","#menu3","#district","#sdistrict",QS_city);
	showmenu("#scale_cn","#menu4","#scale");	
  // 企业福利弹出框
  $("#trad_window_tag").live("click",function() {
    popWin("highlights");
  });
  // 企业福利填充数据
  tag_filldata("#jobtag_list", QS_jobtag, "#highlights", "#determine_tag", "#deselect_tag", "#added-list", "#tag", "#show_tag");
  /*职位亮点弹出层填充数据*/
  function tag_filldata(fillID, data_resources, showID, determinebtn, deselectbtn, resultlist, resulthidId, resultshowID) {
    var taghtm = '', result_datapool = new Array();
    for (var j = 0; j < data_resources.length; j++) {
      if (data_resources[j]) {
        var tag_array = data_resources[j].split(",");
        taghtm += '<span data-code="'+tag_array[0]+','+tag_array[1]+'" title="'+tag_array[1]+'" class="tag">'+tag_array[1]+'</span>';
      };
    }
    $(fillID).html(taghtm);
    // 全部恢复
    if ($(resulthidId).val().length > 0) {
      result_datapool = $(resulthidId).val().split("|");
      var cata_array = $(fillID + " span");
      $.each(cata_array, function() {
        var catcobj = $(this), catcheckedval = catcobj.attr("data-code");
        $.each(result_datapool, function(indexdp,valdp) {
          if (valdp == catcheckedval) {
            catcobj.addClass('tag-disabled');
          }
        })
      })
      copyitem();
      copy_selected();
    }
    $(fillID + " span").unbind().on("click",function() {
      var sdata = $(this).attr("data-code");
      if ($(this).hasClass('tag-disabled')) {
        $(this).removeClass('tag-disabled');
        result_datapool.splice($.inArray(sdata,result_datapool),1);
        copyitem();
      } else {
        if (isexceed()) {
          $(this).addClass('tag-disabled');
          result_datapool.push(sdata);
          copyitem();
        }
      }
    });
    // 复制选中项
    function copyitem() {
      var resulthtm = '';
      resulthtm += '<p class="no-tag muted text-center"';
      result_datapool.length > 0 ? resulthtm += ' style="display: none;"' : resulthtm += ' style="display: block;"';
      resulthtm += '>暂无亮点</p>';
      $.each(result_datapool, function(indexrd,valrd) {
        var result_data_array = valrd.split(",");
        resulthtm += '<span class="tag"><cite>'+result_data_array[1]+'</cite><i title="移除" class="icn-close" data-code="'+result_data_array[0]+','+result_data_array[1]+'">×</i></span>';
      });
      $(resultlist).html(resulthtm);
      var spi = $(resultlist + " span i");
      spi.unbind().bind('click', function() {
        var spidata = $(this).attr("data-code");
        result_datapool.splice($.inArray(spidata,result_datapool),1);
        var catchecked_array = $(fillID + " span.tag-disabled");
        $.each(catchecked_array, function() {
          if(spidata == $(this).attr("data-code")){
            $(this).removeClass('tag-disabled');
          }
        })
        copyitem();
      });
    }
    // 复制选中 赋值
    function copy_selected() {
      var selectedhtm = "";
      var selectedid_array = new Array();
      if(result_datapool.length > 0) {
        selectedhtm+='<article class="tag-list" style="display: block;">';
        for (var i = 0; i < result_datapool.length; i++) {
          if (result_datapool[i]) {
            var data_array = result_datapool[i].split(",");
            selectedhtm += '<span title="'+data_array[1]+'" class="tag">'+data_array[1]+'</span>';
            selectedid_array[i]=result_datapool[i];
          };
        }
        selectedhtm+='<a class="edit-tag" id="trad_window_tag" data-selector="oprator-tag" href="javascript:;">编辑</a></article>';
      } else {
        selectedhtm+='<span class="fuli link_blue">增加亮点可以吸引求职者快速应聘职位，<a id="trad_window_tag" href="javascript:;">立即增加亮点</a></span>';
      }
      $(resultshowID).html(selectedhtm);
      $(resulthidId).val(selectedid_array.join("|"));
    }
    // 分割data 返回数组
    function splitdata(arr) {
      var arrs_array = arr.split(",");
      return arrs_array;
    }
    // 判断选择数量是否超出
    function isexceed() {
      if(result_datapool.length >= 6) {
        alert("最多可选6个");
        return false;
      } else {
        return true;
      }
    }
    // 确定
    $(determinebtn).unbind().click(function() {
      copy_selected();
      close_dialog();
    });
    // 取消
    $(deselectbtn).unbind().click(function() {
      close_dialog();
    });
    // 弹出框关闭
    function close_dialog() {
      $("#maskLayer").remove();
      $(showID).hide();
    }
  }
  // 所属行业填充数据
  trade_filldata("#trad_list", QS_trade, "#determine", "#deselect", "#aui_outer", "#trade_result_show", "#trade", "#trade_cn");
  // 所属行业弹出框
  $("#trade_result_show").click(function() {
    popWin("aui_outer");
  });
  /*所属行业选择弹出层填充数据*/
  function trade_filldata(fillID, data_resources, determinebtn, deselectbtn, showID, resultshowID, resultID, resultCN) {
    var tradhtm = '';
    var sourse_length = parseInt(data_resources.length);
    var rows = 0;
    var subscriptnum = 0;
    if((sourse_length%3) == 0) {
      rows = sourse_length / 3;
    } else {
      rows = (sourse_length / 3) + 1;
    }
    for (var i = 0; i < rows; i++) {
      tradhtm += '<tr>';
      for (var j = 0; j < 3; j++) {
        if (data_resources[subscriptnum]) {
          var trad_array = data_resources[subscriptnum].split(",");
          tradhtm += '<td><label><input type="checkbox" data="'+trad_array[0]+','+trad_array[1]+'" name="item-list" class="input-checkbox">'+trad_array[1]+'</label></td>';
          subscriptnum ++;
        };
      };
      tradhtm += '</tr>';
    };
    $(fillID).html(tradhtm);
    // 恢复选中
    if ($(resultID).val().length > 0) {
      var idarray = $(resultID).val().split(",");
      $.each(idarray, function(index, val) {
        $(fillID+" :checkbox").unbind().each(function() {
          var boxdata_array = $(this).attr("data").split(",");
          if(val == boxdata_array[0]) {
            $(this).attr('checked',true);
          }
        });
      });
      copy_selected();
      isexceed($(fillID+" :checkbox[checked]").length);
    };
    // 单选
    $(fillID+" label :checkbox").unbind().on("click",function(event) {
      if ($(this).find(":checkbox").attr('checked')) {
        $(this).find(":checkbox").attr('checked',false);
        isexceed($(fillID+" :checkbox[checked]").length);
      } else {
        $(this).find(":checkbox").attr('checked',true);
        isexceed($(fillID+" :checkbox[checked]").length);
      }
    });
    /*判断选中的数量是否超出最大限制*/
    function isexceed(num) {
      if(num >= 3) {
        $(fillID+" :checkbox").each(function(index, el) {
          if (!$(this).attr('checked')) {
            $(this).attr('disabled',"disabled");
          }
        });
      } else {
        $(fillID+" :checkbox").each(function(index, el) {
          $(this).attr('disabled',false);
        });
      }
    }
    // 确定
    $(determinebtn).unbind().click(function() {
      copy_selected();
      close_dialog();
      searchHistory();
    });
    // 取消
    $(deselectbtn).unbind().click(function() {
      close_dialog();
    });
    // 弹出框关闭
    function close_dialog() {
      $("#maskLayer").remove();
      $(showID).hide();
    }
    // 复制选中 赋值
    function copy_selected() {
      var selectedhtm = "";
      var selectedid_array = new Array();
      var selectedcn_array = new Array();
      $(fillID+" :checkbox[checked]").unbind().each(function(index) {
        var data_array = $(this).attr("data").split(",");
        selectedhtm += '<span data-id="'+data_array[0]+'">'+data_array[1]+'<a class="close" style="top: 2px;"></a></span>';
        selectedid_array[index]=data_array[0];
        selectedcn_array[index]=data_array[1];
      });
      $(resultshowID + " .items").html(selectedhtm);
      var spanwidth = 0, itemswidth = $(resultshowID).width()-28, widtharray = new Array();
      if($(resultshowID + " .items span")) {
        $(resultshowID + " .items span").each(function(index) {
          spanwidth = spanwidth + $(this).outerWidth(true);
          widtharray[index] = $(this).outerWidth(true);
        })
      }
      var difwidth=spanwidth-itemswidth;
      if (widtharray.length == 2) {
        if(widtharray[0] + widtharray[1] > itemswidth) {
          setHeightCss(40);
        } else {
          setHeightCss(20);
        }
      } else if (widtharray.length == 3) {
        if(widtharray[0] + widtharray[1] + widtharray[2] > itemswidth) {
          if(widtharray[0] + widtharray[1] > itemswidth) {
            if(widtharray[1] + widtharray[2] > itemswidth) {
              setHeightCss(60);
            } else {
              setHeightCss(40);
            }
          } else {
            setHeightCss(40);
          }
        }
      } else {
        setHeightCss(20);
      }
      function setHeightCss (val) {
        $(resultshowID).css("height",val+"px");
        $(resultshowID + " .items").css("height",val+"px");
        $(resultshowID + " em").css("height",val+10+"px");
      }
      $(resultshowID + " span").unbind().click(function() {
        var dtid = $(this).attr("data-id");
        $(fillID+" :checkbox[checked]").unbind().each(function() {
          var dt_array = $(this).attr("data").split(",");
          if(dtid == dt_array[0]) {
            $(this).attr('checked',false);
          }
        });
        isexceed($(fillID+" :checkbox[checked]").length);
        copy_selected();
      });
      $(resultshowID).val(selectedcn_array.join(","));
      $(resultID).val(selectedid_array.join(","));
      $(resultCN).val(selectedcn_array.join(","));
    }
  }
});
</script>
<div class="admin_main_nr_dbox">
<div class="pagetit">
	<div class="ptit"> {#$pageheader#}</div>
  <div class="clear"></div>
</div>
<div class="toptit">修改企业资料 - <span style="color:#0066CC">{#$company_profile.companyname#}</span></div>
<form id="Form1" name="Form1" method="post" action="?act=company_profile_save" >
{#$inputtoken#}
<table width="100%" border="0" cellpadding="4" cellspacing="0"   >
<tr>
          <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed">所属会员：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed">
{#$company_profile.user.username#}
		 </td>
      </tr>
	  <tr>
          <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed">添加时间：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed">
		  {#$company_profile.addtime|date_format:"%Y-%m-%d"#}
		 </td>
        </tr>
		<tr>
          <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed">添加方式：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed">
		  {#if $company_profile.robot == "0"#}人工{#/if#}
		{#if $company_profile.robot == "1"#}采集{#/if#}
		 </td>
        </tr>
		<tr>
          <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed">营业执照：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed" class="link_lan">
		  {#if $company_profile.license#}
		  <a href="{#$certificate_dir#}{#$company_profile.certificate_img#}" target="_blank" title="点击查看"> {#$company_profile.license#}</a>		 
		  {#else#}
		  未上传
		  {#/if#}
		 </td>
        </tr>
        <tr>
          <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"> 认证状态：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed">
		  <label><input name="audit"  type="radio" value="1" {#if $company_profile.audit eq "1"#}checked="checked"{#/if#} />认证通过</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 <label><input name="audit"  type="radio" value="2" {#if $company_profile.audit eq "2"#}checked="checked"{#/if#} />等待认证</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		  <label><input name="audit"  type="radio" value="3" {#if $company_profile.audit eq "3"#}checked="checked"{#/if#} />认证未通过</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		   <label><input name="audit"  type="radio" value="0" {#if $company_profile.audit eq "0"#}checked="checked"{#/if#} />未认证</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 </td>
        </tr>
		
  <tr>
    <td width="110" height="30" align="right"   style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>企业名称：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="companyname" type="text" class="input_text_200" id="companyname" maxlength="30"  style="width:350px;" value="{#$company_profile.companyname#}" /></td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>企业性质：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
	<div>
	{#qishi_get_classify set="类型:QS_company_type,列表名:li"#}
		<input type="text" value="{#$company_profile.nature_cn|default:"请选择"#}"  readonly="readonly" name="nature_cn" id="nature_cn" class="input_text_200 input_text_selsect"/>
		<input name="nature" id="nature" type="hidden" value="{#$company_profile.nature#}" />
		<div id="menu1" class="menu">
			<ul>
			{#foreach from=$li item=list#}
			<li id="{#$list.id#}" title="{#$list.categoryname#}">{#$list.categoryname#}</li>
			{#/foreach#}
			</ul>
		</div>
		  </div>
		  
		 </td>
  </tr>
  <tr>
    <td height="30" align="right" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>公司规模：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
  <div>
  {#qishi_get_classify set="类型:QS_scale,列表名:li"#}
    <input type="text" value="{#$company_profile.scale_cn|default:"请选择"#}"  readonly="readonly" name="scale_cn" id="scale_cn" class="input_text_200 input_text_selsect"/>
    <input name="scale" id="scale" type="hidden" value="{#$company_profile.scale#}" />
    <div id="menu4" class="menu">
      <ul>
      {#foreach from=$li item=list#}
      <li id="{#$list.id#}" title="{#$list.categoryname#}">{#$list.categoryname#}</li>
      {#/foreach#}
      </ul>
    </div>
      </div>
   </td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold;">*</span>所属行业：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
      <div>
        <input type="text" id="trade_result_show" value="{#$company_profile.trade_cn|default:"请选择所属行业"#} " readonly="readonly" name="trade_cn" id="trade_cn" class="input_text_200 input_text_selsect"/>
        <input name="trade" id="trade" type="hidden" value="{#$company_profile.trade#}" />
        <input name="trade_cn" id="trade_cn" type="hidden" value="{#$company_profile.trade_cn#}" />
      </div>
	 </td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold;">*</span>企业福利：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
      <span id="show_tag">
        <p class="pro_p link_blue">增加亮点可以吸引求职者快速应聘职位，<a id="trad_window_tag" href="javascript:;">立即增加亮点</a></p>
      </span>
      <input name="tag" id="tag" type="hidden" value="{#$company_profile.tag#}" />
   </td>
  </tr>
  <tr>
    <td height="30" align="right" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>所在地区：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
	<div>
		<input type="text" value="{#$company_profile.district_cn|default:"请选择"#}"  readonly="readonly" name="district_cn" id="district_cn" class="input_text_200 input_text_selsect"/>
		<input name="district" id="district" type="hidden" value="{#$company_profile.district#}" />
		<input name="sdistrict" id="sdistrict" type="hidden" value="{#$company_profile.sdistrict#}" />
		<div id="menu3" class="dmenu shadow">
			<ul>
			{#qishi_get_classify set="列表名:c_province,类型:QS_district,id:0"#}
			{#foreach from=$c_province item=list#}
			<li id="{#$list.id#}" title="{#$list.categoryname#}">{#$list.categoryname#}</li>
			{#/foreach#}
			</ul>
		</div>
		<div id="menu3_s" class="dmenu shadow" style="display:none"></div>
		  </div>
 
	</td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>详细地址：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="address" type="text" class="input_text_200" id="address" maxlength="80"  style="width:447px;" value="{#$company_profile.address#}"/></td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>联 系 人：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="contact" type="text" class="input_text_200" id="contact" maxlength="25" value="{#$company_profile.contact#}"/></td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>联系电话：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="telephone" type="text" class="input_text_200" id="telephone" maxlength="25" value="{#$company_profile.telephone#}"/></td>
  </tr>
  <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>联系邮箱：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="email" type="text" class="input_text_200" id="email" maxlength="25" value="{#$company_profile.email#}"/></td>
  </tr>
  <tr>
    <td height="30" align="right" style=" border-bottom:1px #CCCCCC dashed">企业网址：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><input name="website" type="text" class="input_text_200" id="website" maxlength="80" value="{#$company_profile.website#}"/></td>
  </tr>
  <tr>
    <td align="right" valign="top"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 企业地图：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
      <div style="width:635px;height:312px;border:3px solid  #CCCCCC; float:left; cursor:" id="container"></div>
      <input name="x" type="hidden" id="x" value="{#$company_profile.map_x#}">
      <input name="y" type="hidden" id="y" value="{#$company_profile.map_y#}">
      <input name="zoom" type="hidden" id="zoom" value="{#$company_profile.map_zoom#}">
    </td>
  </tr> 
  <tr>
    <td align="right" valign="top"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 企业介绍：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed"><textarea name="contents" class="company_mb_textarea" id="introduction" style="width:635px; height:150px;"onpropertychange="if(this.value.length&gt;2000){this.value=this.value.slice(0,2000)}">{#$company_profile.contents#}</textarea>
        <br />
        <div style="line-height:30px; height:30px;"> <span style="color:#333333">请将字数控制在2000字以内进行填写</span></div></td>
  </tr> 
  <tr>
            <td height="30" align="right"   >&nbsp;</td>
            <td height="120"   >
              <input type="hidden" name="id"  value="{#$company_profile.id#}" />
			  <input type="hidden" name="cuid"  value="{#$company_profile.uid#}" />
			  <input type="hidden" name="url"  value="{#$url#}" />
              <input name="submit3" type="submit" class="admin_submit"    value="保存修改"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="submit22" type="button" class="admin_submit"    value="返 回" onclick="window.location.href='{#$url#}'"/>
            </span></td>
          </tr>
  </table>
  </form>
</div>
<!-- 企业福利弹出框 -->
  <div class="aui_outer" id="highlights">
    <table class="aui_border"><tbody>
      <tr><td class="aui_nw"></td><td class="aui_n"></td><td class="aui_ne"></td></tr>
      <tr>
        <td class="aui_w"></td>
        <td class="aui_c">
          <div class="aui_inner">
            <table class="aui_dialog"><tbody>
              <tr><td class="aui_header" colspan="2"><div class="aui_titleBar"><div class="aui_title" style="cursor: move;">企业福利</div><a href="javascript:;" class="aui_close">×</a></div></td></tr>
              <tr>
                <td class="aui_main" style="width: auto; height: auto; visibility: visible;">
                  <div class="aui_content" style="padding: 20px 25px;">
                    <div id="highli">
                      <h5>已添加亮点<span class="text-warning">（最多可选择6个亮点）</span></h5>
                      <div class="added-list clearfix" id="added-list">
                        <p class="no-tag muted text-center" style="display: block;">暂无亮点</p>
                      </div>
                      <div class="add-tags"></div>
                      <h5>选择常用亮点</h5>
                      <div class="use-tag clearfix" id="jobtag_list">
                        
                      </div>
                      <div class="action">
                        <input type="button" id="determine_tag" value="确定" class="btn btn-primary"> <input id="deselect_tag" type="button" value="取消" class="btn cancel">
                      </div>
                    </div>
                  </div>
                </td>
              </tr>
              <tr><td class="aui_footer" colspan="2"><div class="aui_buttons" style="display: none;"></div></td></tr>
            </tbody></table>
          </div>
        </td>
        <td class="aui_e"></td>
      </tr>
      <tr><td class="aui_sw"></td><td class="aui_s"></td><td class="aui_se" style="cursor: se-resize;"></td></tr>
    </tbody></table>
  </div>
  <!-- 企业福利弹出框 End-->
  <!-- 所属行业弹出框 -->
<div class="aui_outer" style="display:none;" id="aui_outer">
  <table class="aui_border">
    <tbody>
      <tr><td class="aui_nw"></td><td class="aui_n"></td><td class="aui_ne"></td></tr>
      <tr>
        <td class="aui_w"></td>
        <td class="aui_c">
          <div class="aui_inner">
            <table class="aui_dialog">
              <tbody>
                <tr><td class="aui_header" colspan="2"><div class="aui_titleBar"><div class="aui_title" style="cursor: move;">选择所属行业</div><a href="javascript:;" class="aui_close">×</a></div></td></tr>
                <tr>
                  <td class="aui_main" style="width: auto; height: auto; visibility: visible;">
                    <div class="aui_content" style="padding: 20px 25px;">
                      <div class="items jquery-localdata">
                        <p class="tips">最多可以选择 3 项</p>
                        <div style="height:410px" class="item-table">
                          <table style="width:700px;" class="options-table">
                            <tbody class="item-list"><tr class=""><td><table><tbody id="trad_list">
                              <!-- 列表内容 -->
                            </tbody></table></td></tr>
                            </tbody>
                          </table>
                        </div>
                      </div>
                    </div>
                  </td>
                </tr>
                <tr><td class="aui_footer" colspan="2"><div class="aui_buttons" style=""><button class="aui-btn aui-btn-primary" id="determine" type="button">确定</button><button class="aui-btn aui-btn-light" id="deselect" type="button">取消</button></div></td></tr>
              </tbody>
            </table>
          </div>
        </td>
        <td class="aui_e"></td>
      </tr>
      <tr><td class="aui_sw"></td><td class="aui_s"></td><td class="aui_se" style="cursor: se-resize;"></td></tr>
    </tbody>
  </table>
</div>
<!-- 所属行业弹出框 End-->
{#include file="sys/admin_footer.htm"#}
</body>
</html>
<script src="http://api.map.baidu.com/api?v=1.1" type="text/javascript"></script>
      <script type="text/javascript">
var map = new BMap.Map("container");
//假如已经设置了标注
var opts = {   
  width : 250,     // 信息窗口宽度   
  height: 80,     // 信息窗口高度   
  title : "{#$company_profile.companyname#}"  // 信息窗口标题   
}
var infoWindow = new BMap.InfoWindow("{#$company_profile.address#}", opts);  // 创建信息窗口对象 
//假如有设置的，显示参数
{#if $company_profile && $company_profile.map_x && $company_profile.map_y#}
var point = new BMap.Point({#$company_profile.map_x#}, {#$company_profile.map_y#});
map.centerAndZoom(point, {#$company_profile.map_zoom#}); 
var qs_marker = new BMap.Marker(point);        // 创建标注   
map.addOverlay(qs_marker);  
map.openInfoWindow(infoWindow,point);
map.setCenter(point);
document.getElementById("x").value={#$company_profile.map_x#}; 
document.getElementById("y").value= {#$company_profile.map_y#}; 
document.getElementById("zoom").value=  {#$company_profile.map_zoom#}; 
{#else#}
var point = new BMap.Point({#$QISHI.map_center_x#},{#$QISHI.map_center_y#});
map.centerAndZoom(point, {#$QISHI.map_zoom#}); 
map.setCenter(point);
{#/if#}
map.addControl(new BMap.NavigationControl());//添加鱼骨
map.enableScrollWheelZoom();//启用滚轮放大缩小，默认禁用。
var myPushpin = new BMap.PushpinTool(map,{
cursor : "crosshair"  
});   // PushpinTool创建标注工具实例
myPushpin.addEventListener("markend", function(e){//添加题地图监控
// 打开信息窗口
map.openInfoWindow(infoWindow,e.marker.getPoint());   
document.getElementById("x").value=e.marker.getPoint().lng; 
document.getElementById("y").value= e.marker.getPoint().lat; 
document.getElementById("zoom").value= map.getZoom(); 
});
// 定义一个控件类，即function   
function ZoomControl(){   
  // 设置默认停靠位置和偏移量   
  this.defaultAnchor = BMAP_ANCHOR_TOP_RIGHT;   
  this.defaultOffset = new BMap.Size(10, 10);   
} 
// 通过JavaScript的prototype属性继承于BMap.Control   
ZoomControl.prototype = new BMap.Control();
  
// 自定义控件必须实现自己的initialize方法，并且将控件的DOM元素返回   
// 在本方法中创建个div元素作为控件的容器，并将其添加到地图容器中   
ZoomControl.prototype.initialize = function(map){   
  // 创建一个DOM元素   
  var div = document.createElement("div");   
  // 添加文字说明   
  div.appendChild(document.createTextNode("标记我的位置"));   
  // 设置样式  
  div.style.cursor = "pointer";   
  div.style.padding = "6px"; 
  div.style.color = "#FFFFFF"; 
  div.style.border = "1px solid #003300";   
  div.style.backgroundColor = "#009900";   
  div.onclick = function(e){ 
  map.clearOverlays();//清楚地图上所有覆盖物
  myPushpin.open();//打开标注工具
  }   
  // 添加DOM元素到地图中   
  map.getContainer().appendChild(div);   
  // 将DOM元素返回   
  return div;   
}
  
// 创建控件   
var myZoomCtrl = new ZoomControl(); 
// 添加到地图当中   
map.addControl(myZoomCtrl);

</script>