// jQUERY //
jQuery.noConflict();

jQuery(document).ready(
		function()
		{
			jQuery("#addPhoto").click( 
				function(evt)
				{
					jQuery("#photoBrowser").fadeIn('normal');
					id = 1;
					jQuery("#items").text("");
					getAllItemsJson(id);
					evt.preventDefault();	
				}
			);
			
			jQuery("#addPhotoToNew").click(
				function(evt)
				{
					//var content = $(".mceContentBody p").val();
					//var contentNew = content+$("#photoValue").attr('value');
					jQuery(".mceContentBody").text("aaaa");
					evt.preventDefault();					
				}
			);
			
			jQuery('.gallery_photo a').lightBox();

		}
);

  
var mapa; // obiekt globalny
		function mapaStart()  
		{  
		    if(GBrowserIsCompatible())
		    {  
				mapa = new GMap2(document.getElementById('mapka'),{mapTypes: [G_NORMAL_MAP]});
				mapa.setCenter(new GLatLng(54.35209828045117, 18.22854995727539),13);

				var punkt  = new GLatLng(54.35259929045127, 18.22774995727539);
				var marker = new GMarker(punkt,{title: 'Usługi Projektowe Marcin Brylowski'});

				mapa.addOverlay(marker);
				
				GEvent.addListener(marker, "click", function() {
	           marker.openInfoWindowHtml('<p><strong>"Usługi Projektowe" Marcin Brylowski</strong></p><p>83-300 Kartuzy, Grzybno ul. Świerkowa 3</p>');
	          });

		    }   
		} 

// TINY MCE //
tinyMCE.init({
        theme : "advanced",
        mode : "exact",
		elements : "content",
        plugins : 'inlinepopups,contextmenu,spellchecker,paste',
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        theme_advanced_buttons3_add : "pastetext,pasteword,selectall",
        paste_auto_cleanup_on_paste : false,
        paste_convert_headers_to_strong : true,
        paste_remove_spans : true,
        paste_remove_styles : true,

        // force past as word text
        setup: function(ed) {
        ed.onPaste.add( function(ed, e, o) {
            ed.execCommand('mcePasteWord', true);
            return tinymce.dom.Event.cancel(e);
        });

    }
});


