//function imgshow(url, width, height)
//{
// LeftPosition=(screen.width)?(screen.width-width)/2:100;
// TopPosition=(screen.height)?(screen.height-height)/2:100;
// var win = window.open(url,'showpic','width=' + width + ',height=' + height + ',top=' + TopPosition + ',left=' + LeftPosition + ',resizable=0,scrollbars=no,menubar=no,toolbar=no,status=no');
//}


function imgshow(url, width, height)
{
  LeftPosition=(screen.width)?(screen.width-width)/2:100;
  TopPosition=(screen.height)?(screen.height-height)/2:100;
  var win = window.open(url,'showpic','width=' + width + ',height=' + height + ',top=' + TopPosition + ',left=' + LeftPosition + ',resizable=0,scrollbars=no,menubar=no,toolbar=no,status=no');
 }





function $( id )  {
  return document.getElementById( id );
}

function PokazGalerie( id )  {
  var oldStatus = $( 'gal_'+id ).style.display;
  switch( oldStatus )  {
    case 'none':
      $('gal_'+id).style.display = 'block';
      break;
    case 'block':
      $('gal_'+id).style.display = 'none';
      break;
  }
}

function InitGoogleMap() {
  
  var positioning = 0;
  var zoom = 15;
  var startNorth = 51.769876;
  var startEast = 19.44716;
  var iconFile = 'http://omega.sns.pl/projekty/profimedic/css/img/ico-map.gif';
  var iconW = 29;
  var iconH = 29;
  
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng( startNorth, startEast ), zoom);
    if( positioning == 1 )  {
      GEvent.addListener(map, "moveend", function() {
        var center = map.getCenter();
        document.getElementById("message").innerHTML = center.toString();
      });
    }
    else  {
      if( iconFile != '' && iconW != '' && iconH != '' )  {
        var icon = new GIcon();
        icon.image = iconFile;
        icon.iconSize = new GSize( iconW, iconH );
        icon.iconAnchor = new GPoint(1, 1);
        icon.infoWindowAnchor = new GPoint(5, 1);
      }
      function createMarker(point, number) {
        var marker = new GMarker(point, icon );
        GEvent.addListener(marker, "click", function() {
          switch ( number )  {
            case 1:
              text = '<div style=\'padding-left: 25px;\'>ul. ¯eromskiego 52<br />90-626 £ód¼<br />tel. 042 632 82 00<br /><a href=\'mailto:profimedic@profimedic.pl\'>profimedic@profimedic.pl</a></div>';
              break;
            case 2:
              text = '<div style=\'padding-left: 25px;\'>ul. Próchnika 51<br />90-626 £ód¼<br />tel. 0 42 630 26 25<br /><a href=\'mailto:profimedic@profimedic.pl\'>profimedic@profimedic.pl</a></div>';
              break;
          }
          marker.openInfoWindowHtml( text );
        });
        return marker;
      }
      var point = new GLatLng(51.7664,19.4469);
      map.addOverlay(createMarker(point,  1));
    
      var point2 = new GLatLng(51.77398,19.4438);
      map.addOverlay(createMarker(point2, 2));
    }
  }
}
