define(["domReady","alertinfo","async!BMap"],function(n,e){var t,o,i,a,r,c,l,f,d,e=e.initModule;i=function(){var n=new BMap.Map("dituContent"),e=new BMap.Point(130.961609,45.289882);n.centerAndZoom(e,17),window.map=n},a=function(){map.disableDragging(),map.enableScrollWheelZoom(),map.enableDoubleClickZoom(),map.enableKeyboard()},r=function(){var n=new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});map.addControl(n);var e=new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});map.addControl(e);var t=new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});map.addControl(t)};var u=[{title:"龙城花园饭店",content:"鸡西市鸡冠区201国道鸡清路北&nbsp;（近鸡西烟草专卖局）",point:"130.961241|45.289362",isOpen:1,icon:{w:23,h:25,l:0,t:21,x:9,lb:12}}];return c=function(){for(var n=0;n<u.length;n++){var e=u[n],t=e.point.split("|")[0],o=e.point.split("|")[1],i=new BMap.Point(t,o),a=f(e.icon),r=new BMap.Marker(i,{icon:a}),c=(l(n),new BMap.Label(e.title,{offset:new BMap.Size(e.icon.lb-e.icon.x+10,-20)}));r.setLabel(c),map.addOverlay(r),c.setStyle({borderColor:"#808080",color:"#333",cursor:"pointer"}),function(){var t=l(n),o=r;o.addEventListener("click",function(){this.openInfoWindow(t)}),t.addEventListener("open",function(){o.getLabel().hide()}),t.addEventListener("close",function(){o.getLabel().show()}),c.addEventListener("click",function(){o.openInfoWindow(t)}),e.isOpen&&(c.hide(),o.openInfoWindow(t))}()}},l=function(n){var e=u[n],t=new BMap.InfoWindow("<b class='iw_poi_title' title='"+e.title+"'>"+e.title+"</b><div class='iw_poi_content'>"+e.content+"</div>");return t},f=function(n){var e=new BMap.Icon("http://api.map.baidu.com/img/markers.png",new BMap.Size(n.w,n.h),{imageOffset:new BMap.Size(-n.l,-n.t),infoWindowOffset:new BMap.Size(n.lb+5,1),offset:new BMap.Size(n.x,n.h)});return e},o=function(){},d=function(){require(["idcode"],function(n){$.idcode.setCode(),$(".submit").click(function(){var n=$.idcode.validateCode(),t=$("#name").val(),o=$("#tel").val(),i=$("#email").val(),a=$("#title").val(),r=$("#content").val(),c=$(".tousu").attr("data-url");if(!t)return e("姓名不能为空！"),$("#name").focus(),!1;if(!o)return e("联系电话不能为空！"),$("#tel").focus(),!1;var l=/^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;if(11!=o.length)return e("请输入有效的手机号码！"),$("#tel").focus(),!1;if(!l.test(o))return e("请输入有效的手机号码！"),$("#tel").focus(),!1;if(!i)return e("电子邮箱不能为空！"),$("#email").focus(),!1;if(!i.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/))return e("电子邮箱格式不正确！"),$("#email").focus(),!1;if(!a)return e("反馈类型不能为空！"),$("#title").focus(),!1;if(!r)return e("投诉建议不能为空！"),$("#content").focus(),!1;if(!n)return e("验证码错误！"),!1;var f={name:t,tel:o,email:i,title:a,content:r};$.post(c,f,function(n){e("118"==n.err_code?n.err_info:n.err_info)},"json")})})},t=function(e){n(function(){e(8),i(),a()})},{initModule:t,contact_index:o,contact_msg:d}});