<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="admin/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jquery.js" type="text/javascript"></script>
<script src="include/js/admin.js" type="text/javascript"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div class="maintop">当前位置：<?php echo $toptxt ?></div>
<div class="main">
  <?php if($a==''){ ?>
  <div class="info">
    <form action="?c=ld_map&run=1" method="post">
      <div id="infos1">
        <dl>
          <dt>经度：</dt>
          <dd>
            <input name="long" id="long" type="text" class="int" value="<?php echo $d['long'] ?>" style="width:60px;"/>
          </dd>
          <dd class="t">可以直接在地图中拖拽</dd>
        </dl>
        <dl>
          <dt>纬度：</dt>
          <dd>
            <input name="lat" id="lat" type="text" class="int" value="<?php echo $d['lat'] ?>" style="width:60px;"/>
          </dd>
          <dd class="t">可以直接在地图中拖拽</dd>
        </dl>
        <dl>
          <dt>默认级别：</dt>
          <dd>
            <input name="zoom" id="zoom" type="text" class="int" value="<?php echo $d['zoom'] ?>" style="width:60px;"/>
          </dd>
          <dd class="t">越大越清晰</dd>
        </dl>
      <!--  <dl>
          <dt>形象图片：</dt>
          <dd>
            <input name="litpic" id="litpic" type="text" class="int" value="<?php echo $d['litpic'] ?>" />
          </dd>
          <dd>
            <iframe frameborder="0" width="300" height="26" scrolling="No" id="flitpic" name="flitpic" src="admin.php?c=uploads&a=loadup&inputid=litpic&fileExt=*.jpg;*.jpeg;*.gif;*.png&fileover=1"></iframe>
          </dd>
          <dd class="t">大小在300*200合适</dd>
        </dl> -->
        <dl>
          <dt>公司名称：</dt>
          <dd>
            <input name="company_name" id="company_name" type="text" class="int" value="<?php echo $d['company_name'] ?>" style="width:300px;"/>
          </dd>
          <dd class="t"></dd>
        </dl>
        <dl>
          <dt>公司地址：</dt>
          <dd>
            <input name="address" id="address" type="text" class="int" value="<?php echo $d['address'] ?>" style="width:300px;"/>
          </dd>
          <dd class="t"></dd>
        </dl>
		    <dl>
          <dt>联系人：</dt>
          <dd>
            <input name="linkuser" id="linkuser" type="text" class="int" value="<?php echo $d['linkuser'] ?>" style="width:300px;"/>
          </dd>
        </dl>
      <!--  <dl>
          <dt>联系QQ：</dt>
          <dd>
            <input name="qq" id="qq" type="text" class="int" value="<?php echo $d['qq'] ?>" style="width:300px;"/>
          </dd>
          <dd class="t">可填写多个每个用,号分开</dd>
        </dl>  -->
        <dl>
          <dt>Email：</dt>
          <dd>
            <input name="email" id="email" type="text" class="int" value="<?php echo $d['email'] ?>" style="width:300px;"/>
          </dd>
        </dl>
        <dl>
          <dt>联系电话：</dt>
          <dd>
            <input name="tel" id="tel" type="text" class="int" value="<?php echo $d['tel'] ?>" style="width:300px;"/>
          </dd>
        </dl>
        <dl style="border:0;">
          <dt>地图定位：</dt>
          <dd>
            <!-- 地图代码  -->
            <div style="height: 600px; width: 800px; margin: auto; overflow: hidden;" id="myMap"></div>
            <style>
.search_map {
	MARGIN: 10px 9px;
	WIDTH: 700px;
	DISPLAY: inline;
	FLOAT: left;
	HEIGHT: 425px;
	CLEAR: both;
	OVERFLOW: hidden
}

.map_detail {
	POSITION: relative;
	PADDING-BOTTOM: 0px;
	PADDING-LEFT: 0px;
	WIDTH: 270px;
	PADDING-RIGHT: 0px;
	BACKGROUND: #fff;
	HEIGHT: 120px;
	OVERFLOW: hidden;
	PADDING-TOP: 15px
}

.map_detail .close {
	POSITION: absolute;
	LINE-HEIGHT: 50px;
	WIDTH: 12px;
	BACKGROUND: url(images/imgs.png) #fff no-repeat -47px 0px;
	HEIGHT: 12px;
	CLEAR: both;
	OVERFLOW: hidden;
	TOP: 9px;
	RIGHT: 9px
}

.map_detail H3 {
	FONT-SIZE: 14px;
	FONT-WEIGHT: 700;
	text-align: left;
}

.map_detail H3 EM {
	FONT-WEIGHT: 700
}

.map_detail UL LI {
	WHITE-SPACE: nowrap;
	float: left;
	clear: both;
}

.map_detail UL LI LABEL {
	COLOR: #999
}

.map_detail UL LI SPAN.tel400 {
	PADDING-RIGHT: 20px;
	FONT-FAMILY: arial;
	BACKGROUND: url(images/imgs.png) no-repeat 80px -245px;
	COLOR: #c00;
	FONT-WEIGHT: 700
}

.map_detail UL LI.d_dealer_contact {
	PADDING-LEFT: 0px;
	BACKGROUND: none transparent scroll repeat 0% 0%
}

.map_detail UL LI.d_dealer_contact A {
	MARGIN-RIGHT: 10px
}

.map_detail UL LI.d_dealer_contact A.s_ask {
	PADDING-LEFT: 17px;
	BACKGROUND: url(images/imgs.png) no-repeat 0px -218px
}
</style>
            <div id="Template1" style="width: 0; height: 260px; visibility: hidden;">
              <div class="map_detail">
                <h3><em id=""><a id='show_companyname' target='_blank'></a>
               </h3>
			  <!-- <div id="show_litpic"></div> -->
                <ul>
                  <li>
                    <label>联系人：</label>
                    <em id="show_linkuser"></em></li>
                  <li>
                    <label>联系地址：</label>
                    <em id="show_address"></em></li>
				  <li>
                    <label>联系电话：</label>
                    <em id="show_tel"></em></li>	
                  <li>
                    <label>Email：</label>
					 <em id="show_email"></em></li>	
				 <li>
                    <label>Q&nbsp;&nbsp;Q：</label>
					 <em id="show_qq"></em></li>	
                </ul>
              </div>
            </div>
       
<!-- /地图代码  -->
          </dd>
        </dl>
      </div>
      <dl>
        <dt>&nbsp;</dt>
        <dd>
          <input type="button" value="查看效果" class="btnbig" onclick="setInfoWindows();" />
        </dd>
        <dt>&nbsp;</dt>
        <dd>
          <input type="submit" value="提 交" class="btnbig" />
        </dd>
      </dl>
    </form>
  </div>
  <?php } ?>
</div>
</body>
     <script type="text/javascript">

var marker=null;
var map=null;

  function showMap()
  {
 	 document.getElementById('showMapTable').style.display="";
  	 initialize($("#lat").val(),$("#long").val());
  }

  function setInfoWindows()
  {  
	 $("#show_companyname").text($("#company_name").val());
	 $("#show_qq").text($("#qq").val());
	 $("#show_email").text($("#email").val());
	 $("#show_address").text($("#address").val());
	
	 $("#show_linkuser").text($("#linkuser").val());
	 $("#show_tel").text($("#tel").val());
	 if($("#litpic").val()!=null)
	 {
	 	var str="<img src='"+$("#litpic").val()+"' width='100px' height='80px' />";
		$("#show_litpic").html(str);
	 }
	  var str=document.getElementById("Template1").innerHTML;
	  var infowindow = new google.maps.InfoWindow({
 	 	content: str,
		height:300
  		});
		  google.maps.event.addListener(marker, 'click', function() {
		  infowindow.open(map,marker);
	  	});
  		infowindow.open(map,marker);
  }
  function initialize(lat,long) {
		var zoom=$("#zoom").val();
		zoom=	parseInt(zoom);
	  var myOptions = {
	  zoom: zoom,
	  center: new google.maps.LatLng(lat,long),
	  mapTypeId: google.maps.MapTypeId.ROADMAP
	  };
	  map = new google.maps.Map(document.getElementById('myMap'),
	  myOptions);
		 var myLatlng = new google.maps.LatLng(lat,long);	
		  //alert(myLatlng);
		 placeMarker(myLatlng,map);
    setInfoWindows();
  }
 
  function placeMarker(position, map) {
	 
      marker = new google.maps.Marker({
      position: position,
      title: $("#company_name").val(),
      map: map,
      draggable: true
    });
      google.maps.event.addListener(marker, "dragend", function(latlng) {
    	  $("#lat").val(latlng.latLng.lat());
		  $("#long").val(latlng.latLng.lng());
     });
    map.panTo(position);
  }
  $(function(){
  	initialize($("#lat").val(),$("#long").val());
  });
</script>
</html>
