/**
 * @author Dariusz Pobożniak, http://pobozniak.pl
 */ 

$(function() {
    tabSlide();
    googleMap();
    newTab();
    $('a.lightbox, .gallery_box a').lightBox();
});

function tabSlide() {
    $('#kitchen-tab').click(function() {
		$(this).children('ul').slideToggle('fast');
	});
}

function newTab() {
    $('a.ext').click(function() {
        $(this).attr('target', '_blank');
    });
}

function googleMap() {
    if (GBrowserIsCompatible()) {
        var map = document.getElementById('map');
        if (map) {
            var info = new Array();
			info[0] = '<div style="width:240px; color: #000;"><strong>Studio Kuchnie24</strong><br />Al. Roździeńskiego 91 <br />41-203 Katowice</div>';

			var m = new GMap2(map);
            m.setCenter(new GLatLng(50.2687311, 19.0548768), 14);
            m.addControl(new GLargeMapControl());
       		m.addControl(new GMapTypeControl());
       		m.enableDoubleClickZoom();

       		function createMarker(point, number) {
				var marker = new GMarker(point);
				GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml(number);
				});
				return marker;
			}

			var point = new GLatLng(50.2687311, 19.0548768);
			m.addOverlay(createMarker(point, info[0]));
        }
    }
}
