<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="js/gmap3-min.js"></script>

 
<script type="text/javascript">
$(document).ready(function() {

	
	var map1;
	//var infowindow1, infowindow2;
	<?php
	$latlng = ''; $count = 0;
	if($content && $content->num_rows() > 0)
		foreach($content->result() as $row) {
			if($count == 0) $latlng .= 'center:['.$row->mapa_lat.','.$row->mapa_lng.'],';
				
			echo 'var infowindow'.$row->ID_mapa.';
			'; 
			$count++;
		}
	?>
	
	$('#test')
	.show()
	  .gmap3(
	  { action:':init',
	    options:{

	      <?=$latlng?>
	      zoom: 15
	    },
	    callback: function($e, map){
	      map1 = map;
	    }
	  },
  <?php if($content && $content->num_rows() > 0)
		foreach($content->result() as $row) { ?>
		{
			action: ':addMarker',
			latLng:[<?=$row->mapa_lat?>,<?=$row->mapa_lng?>],
			marker:{
				options:{
					draggable: true
				},
				events:{
					click: function($e, marker){
						infowindow<?=$row->ID_mapa?>.open(map1, marker);
					}
				}
			},
			infowindow: {
				open: true,
				options:{
					content: '<h3><?=$row->mapa_tytul?></h3><p><?=$row->mapa_opis?></p>'
				},
				callback: function($e, infowindow){
					infowindow<?=$row->ID_mapa?> = infowindow;
				}
			}
		},
	<?php } ?>
	 
	  
	  {action: 'setOptions', args:[{scrollwheel:true}]}
	);

		
});

</script>

<?php /*?><div id="test" style="width: 500px; height: 500px;"></div><?php */ ?>


<br>
                            <div class="kontakt_map">
                            <br>
                            <div class="dane_kon">
                            	<div class="contact-address">
                                        <span class="jicons-icons" ><img src="images/con_address.png"  alt="Address: "  /></span>
                                    <address>
                                            <span class="contact-street">
                                        <strong><?=$contact->name?></strong></span>
                                            <?=$contact->address ?>
                                	</address>
                                </div>

                                <div class="contact-contactinfo">
                                    <p>
                                        <span class="jicons-icons" ><img src="images/con_tel.png" alt="Phone: "  /></span>
                                        <span class="contact-telephone">Telefon: <?=$contact->phone?></span>
                                    </p>
                                    <p>
                                        <span class="jicons-icons" ><img src="images/con_fax.png" alt="Fax: "  /></span>
                                        <span class="contact-fax">E-mail: <a href="mailto:<?=$contact->mail ?>"><?=$contact->mail?></a></span>
                                    </p>
                                </div>
                            </div>
                            <div class="mapa_kon" >
                            	<div id="test" style="width: 500px; height: 200px; border:#CCC solid 1px;"></div>
                            </div>
                            <div class="clear"></div>
                            </div>  
                        	<div class="clear"></div>

