﻿$(document).ready(function(){



$(function() {


    $('input[class*=datepicker]').live('click', function () {
            $(this).datepicker('destroy').datepicker().focus();

		$(this).datepicker({ dateFormat: 'yy-mm-dd' });
//getter
var dateFormat = $(this).datepicker( "option", "dateFormat" );
//setter
$(this).datepicker( "option", "dateFormat", 'yy-mm-dd' );
$(this).datepicker({ monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'] });
	//getter
var monthNames = $(this).datepicker( "option", "monthNames" );
//setter
$(this).datepicker( "option", "monthNames", ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'] );
	
	$(this).datepicker({ dayNamesMin: ['Nd', 'Pn', 'Wt', 'Sr', 'Cz', 'Pt', 'Sb'] });
	var dayNamesMin = $(this).datepicker( "option", "dayNamesMin" );
//setter
$(this).datepicker( "option", "dayNamesMin", ['Nd', 'Pn', 'Wt', 'Sr', 'Cz', 'Pt', 'Sb'] );

	});	});


	$('.mscContent').live("click",function(){
  $('#overlay').animate({'opacity':'0'},500,function() { $(this).remove(); }),
  $('#msgbox').remove(),
  id=$(this).attr('id'),
  $.ajax({
  'url':'/profil/addMiejsca.php',
  'data': {"text": id, "profile": profile},
  'type':'POST',
  'success': function(msg) {
  $('#miejsca').html(msg);
  }

	});
	});

  var display=false;
  
  $('[class*=userBox]').mouseover(function(){
    $div=$(this).children(':last');

  setTimeout(function(){
  $('.boxU').hide(),
  $div.show()},500)
  });
  
  
  $('.boxU').mouseleave(function(){
   setTimeout(function(){$('.boxU').hide(),
  display=false;
  },1000)
  });
  
  $('body').mouseup(function(){
  $('.boxU').hide()
  });
  
});

