//general javascripts for all the views
function initDatepicker() {
	$("#available-from").datepicker($.datepicker.regional.fi);
}

//captcha tooltip
/*function initCaptcha() {
	$('.captcha .tooltip').bind('click', function() {

		//initialize modal container
		$('#defaultModal').jqm({
			modal : false
		});

		JSTemplate.get('captcha-tooltip',function(template) {
			var markup = JSTemplate.populate(template, {});
			$('#defaultModal .content').html(markup);
			$('#defaultModal').jqmShow();
			$('html, body').animate({
				scrollTop: $("body").offset().top
			}, 0);
		});
	});
}*/

$(document).ready(function() {
	//date picker field
	initDatepicker();

	//captcha tooltip
	//initCaptcha();

	// Init captcha tooltips on this page
	$(".captcha .tooltip").tooltip();

	// initialize request loader
	Loader.init();

	//initialize search field
	$('.search input[type="text"]').defaultValueInputField({
		defaultValue : 'Kirjoita kohdenumero tai alue'
	});

	//initialize search field EN
	$('.search.en input[type="text"]').defaultValueInputField({
		defaultValue : 'Target number or location'
	});
});
