function load() {
	var zoom=16; 
	var point = new GLatLng(49.560476,22.199206);
  	var marker = new GMarker(point);
	
	if (GBrowserIsCompatible()) {
		var mapa = new GMap2(document.getElementById("mapka"));
		GEvent.addListener(marker, "click", function() {alert("Kwiaciarnia Melflor");});
		mapa.addControl(new GSmallZoomControl());
		mapa.setCenter(new GLatLng(49.560476,22.199206), zoom); 
    	mapa.addOverlay(marker);
   }
}

$(document).ready(function() {
	/*
	$('.apoint').bind('mouseenter', function(e){
		$('.kbox').hide();
		idp=$(this).attr('id').split("_");
		$('#kbox'+idp[1]).fadeIn("fast");
	});
	$('.kbox').bind('mouseleave', function(e){
		$('.kbox').hide();
	});
	
	$('.kbox').bind('click', function(e){
		//alert('#a'+$(this).attr('id'));
		$(document).load('/kontakt#a'+$(this).attr('id'));
	});
	*/
	
	$('#inewsletter').focus(function() {
		$(this).val('')
	});
	
		$('.LB').lightBox();
		$('.LB2').lightBox();	
		
		$('.atab').bind('click', function(){
			$('.on').removeClass('on');
			$(this).addClass('on');
			tabid=$(this).attr("id").replace("ab", "");
			$('.tab').hide();
			$('#'+tabid).slideDown("fast");
		});
		
		$('.mitem').bind('mouseenter', function(){
			$('.mitem').each(function(){
				src=$(this).attr("src");
				newsrc=src.replace(/_on/g, "");
				$(this).attr("src", newsrc);
				$(this).parent().css('background-color', 'transparent');
			});
			
			src=$(this).attr("src");
			newsrc=src.replace(/.png/g, "");
			$(this).attr("src", newsrc+"_on.png");
			
			$(this).parent().css('background-color', '#f9842e');
			
		});
		$('.menuitem').bind('mouseenter', function(){
			$('#menu ul li ul').hide();
			$('#menu').css('height', '41px');
			p=$(this).position();
			
			if($(this).attr('id') != "") {
				aa=$(this).attr('id');
				atr=aa.split("_");
				$('#menu').css('height', '70px');
				$('#ul_'+atr[1]).css('left', (p.left-40*atr[1])+'px');
				$('#ul_'+atr[1]).show();
			}
			
		});
		$('#top').bind('mouseenter', function(){
			$('#menu ul li ul').hide();
		});
		
		$('.mitem').bind('mouseout', function(){
			
		});
		
		$('#imgarrow').bind('mouseenter', function(){
			$(this).attr('src', '/css/images/arrowon.gif');
		});
		$('#imgarrow').bind('mouseleave', function(){
			$(this).attr('src', '/css/images/arrow.gif');
		});
		/*
		sIFR.replace(futura, {
      selector: '.orange',
		wmode: 'transparent'
      ,css: {
        '.sIFR-root': { 'color': '#ffa200' }
      }
    });
		
		sIFR.replace(futura, {
      selector: 'h2',
		wmode: 'transparent'
      ,css: {
        '.sIFR-root': { 'color': '#373b3f' }
      }
    });
	 
	 
	 
	 sIFR.replace(futura, {
      selector: 'h1#haslo',
		wmode: 'transparent'
      ,css: {
        '.sIFR-root': { 'color': '#373b3f' }
      }
    });
	 
	 sIFR.replace(futura, {
      selector: 'strong#haslo2',
		wmode: 'transparent',
      css:
        '.sIFR-root { color: #f96400; line-height: 10px; }',
		  filters: {	
   		 DropShadow: {
		      knockout: false,
		      distance: 1,
		      color: '#fff',
		      strength: 3,
		      angle: 20 
		    }
		  }
    });
	 
	 sIFR.replace(futura, { selector: '#haslo3', wmode: 'transparent', css: {
    	'.sIFR-root': { 'color': '#373b3f' }
    }});
	 */
});

function kontakt_form(id) {
	if(!$('#imie').val()) { alert("Proszę uzupełnić imię i nazwisko"); return false; }
	if(!$('#email').val()) { alert("Proszę podać e-mail"); return false; }
	if(!$('#tresc').val()) { alert("Proszę uzupełnić treść wiadomości"); return false; }
	
	imie=$('#imie').val();
	firma=$('#firma').val();
	email=$('#email').val();
	tresc=$('#tresc').val();

	$.ajax({
   	type: "GET",
	   url: "mail.php",
	   data: "imie="+imie+"&email="+email+"&firma="+firma+"&tresc="+tresc+"",
	   success: function(msg){
	     $('#msg').html(msg);
		  $('#imie').val("");	
		  $('#firma').val("");
		  $('#email').val("");
		  $('#tresc').val("");
	   }
 	});
	
	return false;
}


function content() {
	$('#pf').css('display', 'none');
	$('#container').animate({
    width: '891px'
   }, 500, function() {
	$('#cright').fadeIn("fast");
	/*
	sIFR.replace(futura, {
      selector: 'h2',
		wmode: 'transparent'
      ,css: {
        '.sIFR-root': { 'color': '#ffffff' }
      }
    });
	*/
		cc=$('#container').height();
		$('#mapka').css('height', cc);
  });
}

function content_out() {
	$('#cright').hide();
	$('#container').animate({
    width: '220px'
   }, 500, function() {
	$('#pf').css('display', 'block');
  });
}

var ii=1;
var jj=1;

function rotate_bg() {
	if(jj == 1) {
		
	 jj++;
	}
	$('html').removeClass();
	$('html').addClass('bg'+ii);
	if(ii > 3) ii = 1;
	else ii++;
}

