$(document).ready(function(){
   simple_tooltip('div.image a', 'tooltip')

   // banner
   $('#ad').innerfade({
       animationtype: 'fade',
       speed: 2500,
       timeout: 14000,
       type: 'sequence',
       containerheight: '276px'
    })

   // remove of default values
   $('input').focus(
       function() {
           if($(this).val() == 'Telefonní \u010díslo' ||
              $(this).val() == 'Jméno' ||
              $(this).val() == 'P\u0159íjmení' ||
              $(this).val() == 'E-mail' ||
              $(this).val() == 'Heslo' ||
              $(this).val() == 'P\u0159edmět') {
              $(this).val('')
           }
       }
   )

  $('textarea').focus(
        function() {
           if($(this).val() == 'Zpráva') {
              $(this).val('');
           }
        }
  );

   // hover effect in main menu
   $('#header ul li a').each(function() {
       if(window.location.pathname == $(this).attr('href')) {
           $(this).parent().addClass('active');
       }
   });

   $('#askUsTab').click(function() {
		$('#askUsForm').animate({width: 'toggle'});
	});

   // subtraction of vms counter
   /*$("span.vmsClose").live("click", function () {
        var vmsCounter = $('.vmsCounter').text();
        vmsCounter = parseInt(vmsCounter) - 1;
        $('.vmsCounter').text(vmsCounter);
    });*/
});

$(function() {
	$('input[type=text][title], input[type=password][title], textarea[title]')
		.each(function() {
			if($(this).val() === '') {
				$(this).val($(this).attr('title'));
			}

			$(this).focus(function() {
				if($(this).val() === $(this).attr('title')) {
					$(this).val('').addClass('focused');
				}
			});

			$(this).blur(function() {
				if($(this).val() === '') {
					$(this).val($(this).attr('title')).removeClass('focused');
				}
			});
		});
});

