/* var SWFUpload;

if (SWFUpload == undefined) {
	SWFUpload = function (settings) {
		this.initSWFUpload(settings);
	};
}

SWFUpload.prototype.initSWFUpload = function (settings) { */

var flashLightBoxInjector;
var flashLightBoxInjector = function (settings) {}

//var flashLightBoxInjector = Class.create();
	
	flashLightBoxInjector.prototype = {
		
		initialize : function() {
			//alert("inicjuje");
			$("body").append('<div id="flashLightBoxInjectionBox" style="display:none;"></div>');	
		},
		
		reset : function() {
			//alert("resetuje");
			$('#flashLightBoxInjectionBox').html("");
		},
		
		appendElement : function(link, title, id, setId) {
			//alert("appenduje");
			$("#flashLightBoxInjectionBox").append('<a class="lightbox" href="' + link + '" title="' + title + '" id="' + id + '" rel="lightbox[' + setId + ']">' + link + '</a>\n');
			//new Insertion.Bottom('flashLightBoxInjectionBox', '<a href="' + link + '" title="' + title + '" id="' + id + '" rel="lightbox[' + setId + ']">' + link + '</a>');
		},
		
		prependElement : function(link, title, id, setId) {
			//alert("preppenduje");
			$("#flashLightBoxInjectionBox").append('<a class="lightbox" href="' + link + '" title="' + title + '" id="' + id + '" rel="lightbox[' + setId + ']">' + link + '</a>\n');
			//new Insertion.Top('flashLightBoxInjectionBox', '<a href="' + link + '" title="' + title + '" id="' + id + '" rel="lightbox[' + setId + ']">' + link + '</a>');
		},
		
		updateImageList : function() {
			//myLightbox.updateImageList();
			//alert("update: ");			
			$(".lightbox").lightbox();
		},
		
		start	: function(id) {
			//myLightbox.start($(id));
			//alert("start: "+id);
			$("#"+id).trigger("click");
		}
		
	}
	
function initFlashLightBoxInjector() 
{ 
	//alert("odpalam initFlashLightBoxInjector");
	myFlashLightBoxInjector = new flashLightBoxInjector();
	myFlashLightBoxInjector.initialize();
	//myFlashLightBoxInjector.appendElement("images/bigwizual1.jpg", "title", "1", "1");
	//myFlashLightBoxInjector.start(1);
}



$(document).ready(function(){
  
$("table.tabelka tr:odd").css("background-color", "#C3AD7E");
$("table.tabelka tr:even").css("background-color", "#E8D6AE");

  $(".lightbox").lightbox();
  //$("html").css({"overflow-y":"scroll"});
  $("#ramka").jScrollPane({
	showArrows: false
	,scrollbarWidth: 13
	,reinitialiseOnImageLoad: true
	//,maintainPosition: false
	//,animateTo : true
	//,scrollbarMargin: 25
  });

		$(".nyro").nyroModal({
			type: 'iframe',
			//width: 800,
			//height: 624,
			minWidth: 720, // Minimum width
			minHeight: 576, // Minimum height
			width: null,
			height: null,
			resizeable: false, 
			autoSizable: true,
			css: { // Default CSS option for the nyroModal Div. Some will be overwritten or updated when using IE6
			    bg: {
			      zIndex: 100,
			      position: 'fixed',
			      top: 0,
			      left: 0,
			      height: '100%',
			      width: '100%'
			    },
			    wrapper: {
			      zIndex: 101,
			      position: 'fixed',
			      top: '50%',
			      left: '50%'
			    },
			    wrapper2: {
			    },
			    content: {
			      overflow: 'hidden'
			    },
			    loading: {
			      zIndex: 102,
			      position: 'fixed',
			      top: '50%',
			      left: '50%',
			      marginTop: '-50px',
			      marginLeft: '-50px'
			    }
			  }
		});	
		
		
		$(".nyro2").nyroModal({
			type: 'iframe',
			width: 800,
			height: 624,
			//minWidth: 720, // Minimum width
			//minHeight: 576, // Minimum height
			resizeable: true, 
			autoSizable: true,
			css: { // Default CSS option for the nyroModal Div. Some will be overwritten or updated when using IE6
			    bg: {
			      zIndex: 100,
			      position: 'fixed',
			      top: 0,
			      left: 0,
			      height: '100%',
			      width: '100%'
			    },
			    wrapper: {
			      zIndex: 101,
			      position: 'fixed',
			      top: '50%',
			      left: '50%'
			    },
			    wrapper2: {
			    },
			    content: {
			      overflow: 'hidden'
			    },
			    loading: {
			      zIndex: 102,
			      position: 'fixed',
			      top: '50%',
			      left: '50%',
			      marginTop: '-50px',
			      marginLeft: '-50px'
			    }
			  }
		});		
  

   var options_wyslij = {
          //target:        '#myList',   // target element(s) to be updated with server response
          //beforeSubmit:  showRequest,  // pre-submit callback
          url: 'ajax.php',
		  resetForm: true,
          success:       showResponse_tekst
      };
  function showResponse_tekst(responseText, statusText)  {
   //alert('zmiany zapisane\n'+responseText);
	//$("#form_kontaktowy textarea").text(responseText);
	//editable_kat(".kategorie p");
    alert(responseText);
	//$('td.but_radio').jForms();
	//$('td.but_radio .chosen').removeClass('chosen');	
	//$('td.but_radio .radioAreaChecked').removeClass('radioAreaChecked');
  }

    var options_wyslij = {
          //target:        '#myList',   // target element(s) to be updated with server response
          //beforeSubmit:  showRequest,  // pre-submit callback
          url: 'ajax.php',
		  resetForm: true,
          success:       showResponse_tekst
      };
  function showResponse_tekst(responseText, statusText)  {
   //alert('zmiany zapisane\n'+responseText);
	//$("#form_kontaktowy textarea").text(responseText);
	//editable_kat(".kategorie p");
    alert(responseText);
	//$('td.but_radio').jForms();
	//$('td.but_radio .chosen').removeClass('chosen');	
	//$('td.but_radio .radioAreaChecked').removeClass('radioAreaChecked');
  }

$(".ajax").submit(function(){
	$(this).ajaxSubmit(options_wyslij);
   return false;
  });  


	$("#inwMenu a,#galMenu a,#inwestorMenu a,#aktMenu a,#kontaktMenu a").hover(
      function () {
        //$(this).append($("<span> ***</span>"));
		//nazwa=$(this).attr('class');
		//$("div#result1").append($("p:first").hasClass("selected").toString());
		//$(this).toggleClass("highlight");
		//alert(nazwa);
		
		if($("#strzalka_lewa").hasClass("pos1")){wybrany=1;}
		if($("#strzalka_lewa").hasClass("pos2")){wybrany=2;}
		if($("#strzalka_lewa").hasClass("pos3")){wybrany=3;}
		
		if($(this).hasClass("pos1")){
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "16px"}, 500 );
		}
		if($(this).hasClass("pos2"))
		{
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "46px"}, 500 );
		}
		if($(this).hasClass("pos3"))
		{
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "77px"}, 500 );
		}
		
		//16,46,77	
      }, 
      function () {
		if($("#strzalka_lewa").hasClass("pos1")){
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "16px"}, 500 );
		}
		if($("#strzalka_lewa").hasClass("pos2"))
		{
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "46px"}, 500 );
		}
		if($("#strzalka_lewa").hasClass("pos3"))
		{
			$("#strzalka_lewa").stop();
			$("#strzalka_lewa").animate({top: "77px"}, 500 );
		}
      }
    );
  
  
})


$(window).load(function () {
  initFlashLightBoxInjector();
});
  