<!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" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>{#$title#}</title>
	<meta name="author" content="骑士CMS" />
	<meta name="copyright" content="74cms.com" />
	<link rel="shortcut icon" href="{#$QISHI.site_dir#}favicon.ico" />
	<link rel="stylesheet" href="{#$QISHI.site_template#}css/user_common.css" />
	<link rel="stylesheet" href="{#$QISHI.site_template#}css/user_company.css" />
	<script src="{#$QISHI.site_template#}js/png24fix.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.dropdown.js"></script>
	<script src="{#$QISHI.site_dir#}data/cache_classify.js" type="text/javascript" charset="utf-8"></script>
	<script src="{#$QISHI.site_template#}js/jquery.user.selectlayer.js" type="text/javascript" charset="utf-8"></script>
	<script src="{#$QISHI.site_template#}js/tc.all.js"></script>
	<script src="{#$QISHI.site_template#}js/ajaxfileupload.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.jcrop.js"></script>
	<script src="{#$QISHI.site_template#}js/Validform.min.js"></script>
	<script src="{#$QISHI.site_template#}js/jquery.artDialog.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".pro_name_tips").hover(function(){
				$(this).find(".name_tips_box").stop().show();
			},function(){
				$(this).find(".name_tips_box").stop().hide();
			});
			{#if $super#}
			// 上传企业logo
			$('a[data-selector="link-upload"]').bind('click', function() {
				var logo_size = {#$QISHI.logo_max_size#}+"kb";
				$.dialog({
			        title: false,
			        content: $("#logo_crop").html(),
			        lock: true,
			        padding: 0,
			        left: "25%"
			    });
			    $("#company_logo_size").html("（仅支持JPG、JPEG、GIF、BMP、PNG格式，图片小于"+logo_size+"）");
			});
			$(".up_but").click(function(){
				$("#up_img").click();
				$("#up_img").change(function(event) {
					var img_name=$("#up_img").val();
					$("#img_name").val(img_name);
				});
			});
			// 下拉
			dropdownform("#company_nature", "#company_nature_name", "#nature", "#nature_cn"); // 企业性质
			dropdownform("#company_scale", "#company_scale_name", "#scale", "#scale_cn"); // 企业规模
			// 填充行业弹出层数据
			trade_filldata("#trad_list", QS_trade, "#determine", "#deselect", "#aui_outer", "#trade_result_show", "#trade", "#trade_cn");
			// 行业弹出框
			$("#trad_window").click(function() {
				popWin("aui_outer");
			});
			//验证测试用
			//$("input").attr("value","");
			// 所在地区填充数据
			city_filldata_alone("#city_list", QS_city_parent, QS_city, "#result-list-city", "#determine_city", "#deselect_city", "#aui_outer_city", "#trad_window_city", "#district", "#sdistrict", "#district_cn", "#city_result_show");
			// 所在地区弹出框
			$("#trad_window_city").click(function() {
				popWin("aui_outer_city");
			});
			// 企业福利弹出框
			$("#trad_window_tag").live("click",function() {
				popWin("highlights");
			});
			// 企业福利填充数据
			tag_filldata("#jobtag_list", QS_jobtag, "#highlights", "#determine_tag", "#deselect_tag", "#added-list", "#tag", "#show_tag");
			
			{#/if#}
			$(".view").click(function(){
				{#if $company_nature=="0"#}
				alert("请先保存基本信息！");
				{#else#}
				// window.open("?act=company_preview&id={#$company_profile.id#}");
				window.open("{#$company_url#}");
				// window.open('你所要跳转的页面');
				{#/if#}
			});
			// 验证
			$("#companyProfileForm").Validform({
				tiptype:2
			});
		});
	</script>
</head>
<body>
	<!-- 会员中心header -->
	{#include file="member_company/header.htm"#}
	{#include file="member_company/company_info_category.htm"#}
	<!-- 企业资料填写 -->
	<form id="companyProfileForm" name="companyProfileForm" method="post" action="?act=company_profile_save">
	<div class="container">
		<div class="compnay_profile">
			<div class="need_tips"><span>*</span>&nbsp;为必填项</div>
			<div class="profile_form">
				<table cellspacing="0">
					<tbody>
						<tr>
							<td class="pro_tit" align="right">企业LOGO</td>
							<td colspan="2">
					            <img src="{#$company_profile.logo#}" class="tinyELogo">
					            {#if $super#}
					            <a href="javascript:;" data-selector="link-upload" class="btn btn-light btn-small">重新上传</a>
					            {#/if#}
							</td>
							{#if $super#}
							<td style="display: none;"><input name="logo" type="file" class="input_text_360" onkeydown="alert('请点击右侧“浏览”选择您电脑上的图片！');return false" id="up_img"/></td>
							{#/if#}
						</tr>
						<tr>
							<td class="pro_tit" align="right">企业名称</td>
							<td colspan="2">
								<span class="pro_com_name">{#$company_profile.companyname#}</span>
								<span class="pro_name_tips">
									<div class="name_tips_box link_blue" style="display:none;z-index:5;">
										<img src="{#$QISHI.site_template#}images/11.gif" alt="" />
										{#if $company_profile.audit==1#}
										营业执照已认证，如需修改企业名称，请联系您的客服专员<a href="javascript:void(0);">【{#$consultant.name#}】</a>
										{#elseif $company_profile.audit==2#}
										您的营业执照正在审核中，请您耐心等待！
										{#else#}
										您的营业执照审核未通过，请您联系您的客服专员【{#$consultant.name#}】咨询原因。
										{#/if#}
									</div>
								</span>
							</td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 企业性质</td>
							<td width="155" colspan="1">
								<span class="optionlist w_150">
									{#if $super#}
									<span id="company_nature_name" data-name="industries" class="LocalDataUIC simulation-text LocalDataUIC-simulation-text" style="font-size: 12px; height: 20px; width: 136px;" id="city_result_show">
										<span class="items" style="left: 6px; height: 20px;">{#$company_profile.nature_cn|default:"请选择企业性质"#}</span>
										<em class="selectui-drop" style="height: 30px; margin-top: -1px;" id="company_nature"></em>
									</span>
									<ul class="droplist">
										{#qishi_get_classify set="列表名:c_nature,类型:QS_company_type"#}{#foreach from=$c_nature item=list#}
										<li><a id="{#$list.id#}" dataid="{#$list.id#}" title="{#$list.categoryname#}" href="javascript:;">{#$list.categoryname#}</a></li>
										{#/foreach#}
									</ul>
									{#else#}
									{#$company_profile.nature_cn#}
									</div>
									{#/if#}
								</span>
								<input type="hidden" value="{#$company_profile.nature#}" name="nature" id="nature"/>
								<input type="hidden" value="{#$company_profile.nature_cn#}" name="nature_cn" id="nature_cn" datatype="*" sucmsg="&nbsp;" nullmsg="请选择企业性质" errormsg="请选择企业性质"/>
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 企业规模</td>
							<td width="155" colspan="1">
								<span class="optionlist w_150">
									{#if $super#}
									<span id="company_scale_name" data-name="industries" class="LocalDataUIC simulation-text LocalDataUIC-simulation-text" style="font-size: 12px; height: 20px; width: 136px;" id="city_result_show">
										<span class="items" style="left: 6px; height: 20px;">{#$company_profile.scale_cn|default:"请选择公司规模"#}</span>
										<em class="selectui-drop" style="height: 30px; margin-top: -1px;" id="company_scale"></em>
									</span>
									<ul class="droplist">
										{#qishi_get_classify set="类型:QS_scale,列表名:c_scale"#}{#foreach from=$c_scale item=list#}
										<li><a id="{#$list.id#}" dataid="{#$list.id#}" title="{#$list.categoryname#}" href="javascript:;">{#$list.categoryname#}</a></li>
										{#/foreach#}
									</ul>
									{#else#}
									{#$company_profile.scale_cn#}
									{#/if#}
								</span>
								<input type="hidden" value="{#$company_profile.scale_cn#}" name="scale_cn" id="scale_cn" datatype="*" sucmsg="&nbsp;" nullmsg="请选择企业规模" errormsg="请选择企业规模"/>
								<input type="hidden" value="{#$company_profile.scale#}" name="scale" id="scale"/>
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 所属行业</td>
							<td colspan="3" width="450">
								{#if $super#}
								<span data-name="industries" class="LocalDataUIC simulation-text LocalDataUIC-simulation-text" style="font-size: 12px; height: 20px; width: 302px;" id="trade_result_show">
									<span class="items" style="left: 6px; height: 20px;">请选择所属行业</span>
									<em class="drop" style="height: 30px; margin-top: -1px;" id="trad_window"></em>
								</span>
								<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#}" datatype="*" sucmsg="&nbsp;" nullmsg="请选择所属行业" errormsg="请选择所属行业"/>
								{#else#}
								{#$company_profile.trade_cn#}
								{#/if#}
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 企业福利</td>
							<td colspan="3">
								<span id="show_tag">
								{#if $super#}
								<p class="pro_p link_blue">增加亮点可以吸引求职者快速应聘职位，<a id="trad_window_tag" href="javascript:;">立即增加亮点</a></p>
								{#else#}
								<article style="display: block;" class="tag-list">
									{#foreach from=$company_profile.tag item=tag_li#}
									<span class="tag" title="{#$tag_li.1#}">{#$tag_li.1#}</span>
									{#/foreach#}
								</article>
								{#/if#}
								</span>
								<input name="tag" type="hidden" id="tag" value="{#$company_profile.tag#}" datatype="*" sucmsg="&nbsp;" nullmsg="请选择企业福利" errormsg="请选择企业福利" />
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 所在地区</td>
							<td colspan="1" >
								{#if $super#}
								<span data-name="industries" class="LocalDataUIC simulation-text LocalDataUIC-simulation-text" style="font-size: 12px; height: 20px; width: 135px;" id="city_result_show">
									<span class="items" style="left: 6px; height: 20px;">请选择所在地区</span>
									<em class="drop" style="height: 30px; margin-top: -1px;" id="trad_window_city"></em>
								</span>
								<input name="district" id="district" type="hidden" value="{#$company_profile.district#}" />
								<input name="sdistrict" id="sdistrict" type="hidden" value="{#$company_profile.sdistrict#}" />
								<input name="district_cn" id="district_cn" type="hidden" value="{#$company_profile.district_cn#}" datatype="*" sucmsg="&nbsp;" nullmsg="请选择所在地区" errormsg="请选择所在地区"/>
								{#else#}
								{#$company_profile.district_cn#}
								{#/if#}
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="pro_tit" align="right">企业网址</td>
							<td colspan="4">
								{#if $super#}
								<input value="{#$company_profile.website#}" name="website" id="website" class="text input-medium span480">
								{#else#}
								{#$company_profile.website#}
								{#/if#}
							</td>
						</tr>
						<tr>
							<td class="pro_tit" align="right"><span class="must">*</span> 详细地址</td>
							<td colspan="4">
								{#if $super#}
								<input value="{#$company_profile.address#}" name="address" id="address" class="text input-medium span480" datatype="*" sucmsg="&nbsp;" nullmsg="请选填写详细地址" errormsg="请选填写详细地址">
								{#else#}
								{#$company_profile.address#}
								{#/if#}
							</td>
							<td></td>
						</tr>
						<table cellspacing="0">
							<tbody>
								<tr height="400">
									<td class="pro_tit" align="right" valign="top"><div class="empty18"></div><span class="must">*</span> 企业地图</td>
									<td>
										<div style="width:635px;height:312px;border:1px solid  #CCCCCC; float:left; cursor:" id="container"></div>
										<input name="x" type="hidden" id="x" datatype="*" nullmsg="请请标记位置" errormsg="标记位置出错">
										<input name="y" type="hidden" id="y">
										<input name="zoom" type="hidden" id="zoom">
										
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="pro_tit" align="right" valign="top"><div class="empty18"></div><span class="must">*</span>企业介绍</td>
									<td>
										{#if $super#}
										<div class="profile_textarea_box link_blue">
											<div class="empty15"></div>
											 <textarea name="contents" class="pro_textarea" id="contents" datatype="*" tip="请在输入企业介绍" value="请在输入企业介绍" nullmsg="请输入企业介绍" errormsg="请填写有效内容">{#$company_profile.contents#}</textarea>
											<div class="empty15"></div>
										</div>
										{#else#}
										<style>.content{ font-size:12px; color:#333; text-indent:20px; line-height:25px;width:645px; margin:16px 0 0 0;float:left;}</style>
										<div class="content">{#$company_profile.contents|nl2br#}</div>
										{#/if#}
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="pro_tit" align="right">&nbsp;</td>
									<td>
										<div class="empty15"></div>
										{#if $super#}
										<input type="submit"  name="Submit" value="保存" class="but75lan" />&nbsp;&nbsp; 
										{#/if#}
										<input type="button" name="view" value="预览主页" class="but110hui view" />
									</td>
								</tr>
							</tbody>
						</table>
					</tbody>
				</table>
				
			</div>
		</div>
	</div>
	</form>
	<!-- 所属行业弹出框 -->
	<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-->
	<!-- 所在地区弹出框 -->
	<div class="aui_outer" style="display:none;" id="aui_outer_city">
		<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: 0px;">
												<div style="width:660px" class="LocalDataMultiC">
													<div class="data-row-head"><div class="data-row"><div class="data-row-side"><i class="data-icon data-icon-info"></i>最多可以选择 <strong class="text-warning">1</strong> 项</div><div style="margin-left:160px" id="result-list-city" class="result-list"><strong class="result-name">请选择</strong></div></div></div>
													<div style="height:auto;" class="data-row-list data-row-main" id="city_list">
														<!-- 列表内容 -->
													</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_city" type="button">确定</button><button class="aui-btn aui-btn-light" id="deselect_city" 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-->
	<!-- 企业福利弹出框 -->
	<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-->
	<!-- 上传企业LOGO弹出框-->
	<div id="logo_crop" style="display:none">
		<div id="ROOT">
		  <h2>企业Logo上传</h2>
		  <div class="preview">
		    <div class="uploader">
		      <div class="status"></div>
		      <div class="file-field">
		        <input class="local-file" type="file" name="upload_file" id="photo_uploader" />
		        <a href="javascript:;" class="button">上传Logo</a>
		      </div>
		      <p id="company_logo_size"></p>
		    </div>
		    <div class="source_box">
		      <div class="photo_cols">
		        <div class="photo photo_source jcrop-default"></div>
		      </div>
		    </div>
		    <div class="result_box">
		      <div class="photo_thumb">
		        <table class="photo_table"><tr><td><div class="photo photo_large"></div></td></tr></table>
		      </div>
		      <div class="btn-save"><a href="javascript:;" class="button">保存LOGO</a></div>
		    </div>
		  </div>
		</div>
		<script type="text/javascript">
		$(function(){
		  var rate = "2:1";
		  var _rate = rate.split(":"), _zoom = 1;
		      _rate = _rate[0]/_rate[1],
		      server_img = { url: "", name: "" };
		  var cropBox = ROOT,
		      sourceBox = $(".source_box", cropBox),
		      resultBox = $(".result_box", cropBox),
		      sourcePhoto = $(".photo",sourceBox),
		      status = $(".uploader .status",cropBox),
		      saveButton = $(".btn-save .button",resultBox),
		      uploader = $(".uploader .file-field .local-file",cropBox), _uploader = uploader.clone();
		  var showStatus = function(msg){
		        status.html(msg).hide().fadeIn();
		      },
		      hidetatus = function(msg){
		        status.html(msg).fadeOut();
		      };
		  $(".photo_thumb",resultBox).css("height",function(){
		    return $(this).width() / _rate;
		  });
		  function initJcrop(){
		    showStatus("正在加载图片...");
		    sourcePhoto.removeClass("jcrop-default").addClass("jcrop-loading");
		    var image = new Image();
		    image.src = server_img.url;
		    if(image.complete){
		      initCropBox(image);
		    } else {
		      image.onload = function(){
		        initCropBox(image);
		      };
		    }
		    function initCropBox(img){
		      var _Size = { width: sourcePhoto.width(), height: sourcePhoto.height() },
		          _size = { width: img.width, height: img.height },
		          _attr = { width: img.width, height: img.height };
		      if(_attr.width > _Size.width){
		        _zoom = _Size.width / _size.width;
		        _attr.width = _Size.width;
		        _attr.height = _attr.height * _zoom;
		      }
		      if(_attr.height > _Size.height){
		        _zoom = _Size.height / _size.height;
		        _attr.width = _size.width * _zoom;
		        _attr.height = _Size.height;
		      }
		      var showPreview = function(coords){
		        var source = $("img",sourcePhoto).data("coords", coords),
		            rotate = source.data("rotate") || {},
		            vertical = rotate._vertical,
		            canvas = rotate._canvas;
		        $(".photo",resultBox).each(function(){
		          var thumb = $(this).closest(".photo_thumb"),
		              thumbsize = { width: thumb.width(), height: thumb.height() },
		              newsize = { width: coords.w, height: coords.h },
		              _temp = thumbsize.width / newsize.width;
		          newsize.width = thumbsize.width;
		          newsize.height = newsize.height * _temp;
		          if(newsize.width > thumbsize.width){
		            _temp = thumbsize.width / newsize.width;
		            newsize.width = thumbsize.width;
		            newsize.height = newsize.height * _temp;
		          }
		          if(newsize.height > thumbsize.height){
		            _temp = thumbsize.height / newsize.height;
		            newsize.width = newsize.width * _temp;
		            newsize.height = thumbsize.height;
		          }
		          $(this).css({
		            width: newsize.width,
		            height: newsize.height
		          });
		          var rx = newsize.width / coords.w,
		              ry = newsize.height / coords.h;
		          $(this).find("img,canvas").css({
		            width: Math.round(rx * (vertical && canvas ? img.height : img.width) * _zoom) + 'px',
		            height: Math.round(ry * (vertical && canvas ? img.width : img.height) * _zoom) + 'px',
		            marginLeft: '-' + Math.round(rx * coords.x) + 'px',
		            marginTop: '-' + Math.round(ry * coords.y) + 'px'
		          });
		        });
		      };
		      hidetatus("图片加载成功");
		      sourcePhoto.removeClass("jcrop-loading");
		      saveButton.show();
		      $(".photo",cropBox).empty().append($("<img src='"+ server_img.url +"' width='"+ _attr.width +"' height='"+ _attr.height +"' />"));
		      $(sourcePhoto).Jcrop({
		        //bgColor: "#fcfcfc",
		        //setSelect: [ 0, 0, 120, 60 ],
		        
		        boxWidth:300,
		        boxHeight:260,
		       
		       //setSelect: [ 0, 0, 20, 20 ],
		        maxSize: [300,260],
		       // bgColor: "#f00",
		        minSize: [ 10, 10 ],
		        onChange: showPreview,
		        onSelect: showPreview
		        //aspectRatio: _rate
		      });
		    }
		  }
		  uploader.bind("change",function(){
		    var filepath = $(this).val(),
		        fileext = filepath.toLowerCase().substring(filepath.lastIndexOf(".") + 1);
		    if(["jpg","jpeg","gif","bmp","png"].indexOf(fileext) === -1){
		      showStatus("文件格式不正确，请重新选择文件。");
		    } else {
		      showStatus("正在上传图片...");
		        $.ajaxFileUpload({
		          url: "?act=company_logo_preloading",
		          secureuri: false,
		          fileElementId: "photo_uploader",
		          dataType: "text",
		          success: function(data, status){
		            switch(data){
		              case "-1":showStatus("上传图片失败：上传目录不存在!");return false;break;
		              case "-2":showStatus("上传图片失败：上传目录无法写入!");return false;break;
		              case "-3":showStatus("上传图片失败：你选择的文件无法上传！");return false;break;
		              case "-4":showStatus("上传图片失败：文件大小超过限制");return false;break;
		              case "-5":showStatus("上传图片失败：文件类型错误！");return false;break;
		              case "-6":showStatus("上传图片失败：文件上传出错！");return false;break;
		              default:break;
		            }
		            server_img.url = data;
		            initJcrop();
		          },
		          error: function(data, status, e){
		            showStatus(e);
		          }
		        });
		        uploader.replaceWith(_uploader.clone());
		    }
		  }).live("click",function(){
		    if(jQuery.browser.msie){
		      var timer, self = this;
		      timer = window.setInterval(function(){
		        if(document.activeElement == self){
		          $(self).blur();
		        } else {
		          window.clearInterval(timer);
		        }
		      }, 20);
		    }
		  }).live('change', function(event) {
		      var filepath = $(this).val(),
		        fileext = filepath.toLowerCase().substring(filepath.lastIndexOf(".") + 1);
		      if(["jpg","jpeg","gif","bmp","png"].indexOf(fileext) === -1){
		        showStatus("文件格式不正确，请重新选择文件。");
		      } else {
		        showStatus("正在上传图片...");
		          $.ajaxFileUpload({
		            url: "?act=company_logo_preloading",
		            secureuri: false,
		            fileElementId: "photo_uploader",
		            dataType: "text",
		            success: function(data, status){
		              switch(data){
		                case "-1":showStatus("上传图片失败：上传目录不存在!");return false;break;
		                case "-2":showStatus("上传图片失败：上传目录无法写入!");return false;break;
		                case "-3":showStatus("上传图片失败：你选择的文件无法上传！");return false;break;
		                case "-4":showStatus("上传图片失败：文件大小超过限制");return false;break;
		                case "-5":showStatus("上传图片失败：文件类型错误！");return false;break;
		                case "-6":showStatus("上传图片失败：文件上传出错！");return false;break;
		                default:break;
		              }
		              server_img.url = data;
		              initJcrop();
		            },
		            error: function(data, status, e){
		              showStatus(e);
		            }
		          });
		          uploader.replaceWith(_uploader.clone());
		      }
		    });
		  _uploader = uploader.clone();

		  //save
		  saveButton.bind("click",function(){
		    var source = $("img",sourcePhoto),
		        coords = source.data("coords"),
		        rotate = source.data("rotate") || { _x:1, _y:1, _rotate: 0 };
		    if(!coords) {
		      showStatus("您没有对任何图片进行剪裁");
		      return false;
		    }
		    var datas = {
		      "url": server_img.url,
		      "x1": parseInt(coords.x / _zoom),
		      "x2": parseInt(coords.x2 / _zoom),
		      "y1": parseInt(coords.y / _zoom),
		      "y2": parseInt(coords.y2 / _zoom),
		      "_x": rotate._x,
		      "_y": rotate._y,
		      "_rotate": rotate._rotate
		    };
		    $.ajax({
		      url: "?act=company_logo_save",
		      type: "POST",
		      data: datas,
		      cache: false,
		      dataType: "text",
		      success: function(data){
		        $("img.tinyELogo").attr("src", data);
		        $.dialog.focus.close();
		        $.dialog.alert("企业Logo上传成功！");
		      },
		      error: function(data){
		        showStatus("保存失败！");
		      }
		    });
		  });
		});
		</script>
	</div>
	<!-- 上传企业LOGO弹出框 End-->
{#include file="./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(); 
//alert(map.getZoom());//地图缩放级别
//map.zoomIn();地图放大一个级别
//alert("您标注的位置：" + e.marker.getPoint().lng + ", " + e.marker.getPoint().lat);
//打开提示层
});
//myPushpin.setIcon(icon:Icon);
// 定义一个控件类，即function   
function ZoomControl(){   
  // 设置默认停靠位置和偏移量   
  this.defaultAnchor = BMAP_ANCHOR_TOP_RIGHT;   
  this.defaultOffset = new BMap.Size(10, 10);   
}
// function SaveMap(){   
//   // 设置默认停靠位置和偏移量   
//   this.defaultAnchor = BMAP_ANCHOR_TOP_RIGHT;   
//   this.defaultOffset = new BMap.Size(10, 10);   
// }  
// 通过JavaScript的prototype属性继承于BMap.Control   
ZoomControl.prototype = new BMap.Control();
// SaveMap.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;   
}
// SaveMap.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 #990000";   
//   div.style.backgroundColor = "#FF6600";   
//   div.onclick = function(e){ 
//   chk_form();//验证
//   }   
//   // 添加DOM元素到地图中   
//   map.getContainer().appendChild(div);   
//   // 将DOM元素返回   
//   return div;   
// }   
  
// 创建控件   
var myZoomCtrl = new ZoomControl(); 
// var SaveMapsub = new SaveMap(); 
// 添加到地图当中   
map.addControl(myZoomCtrl);
// map.addControl(SaveMapsub);
//验证表单
// function chk_form()
// {
// if (document.form1.x.value=="" || document.form1.y.value=="")
// 	{
// 	alert("请先在地图上标记您的位置")
// 	return (false);
// 	}
// 	else
// 	{
// 	document.form1.submit();
// 	}	
// }
</script>