jQuery().ready(function() {
	jQuery('span.wpcf7-list-item').append('<div style="clear:both"></div>');

	jQuery('a').each(function() {
		if(!this.innerHTML) return;
		if(this.innerHTML.indexOf('»') > 0) return;
		if(this.innerHTML.indexOf('«') > -1) return;
		if(this.innerHTML.indexOf('raquo') > 0) return;
		if(this.innerHTML.indexOf('laquo') > 0) return;
		if(this.innerHTML.indexOf('>') > 0) return;
		if(this.innerHTML.indexOf('.hu') > 0) return;
		if(this.parentNode.nodeName.toUpperCase()=='LI') return;
		this.innerHTML += ' &raquo;';
//		alert(this.innerHTML);
	});
	
	equal_height();
	setInterval('equal_height()',1000);
	
	
//	$.datepicker.setDefaults($.extend({showMonthAfterYear: true}, $.datepicker.regional['hu']));
	jQuery('input[name=arrive],input[name=depart],input[name=when]').datepicker({showOn: 'button'
		, buttonImage: '/wp-content/themes/knab_layout/images/calendar_icon.gif'
		, buttonImageOnly: true
		, dateFormat: 'yy-mm-dd'
		, minDate: 0
		, maxDate: '+10y'
	});
	
	
	show_map();
});


function equal_height() {
	var h1 = jQuery('#content').height()+20;
	var h2 = jQuery('#sidebar').height()-20;
	if(h1 > h2) jQuery('#sidebar').height(h1);
	if(h1 < h2) jQuery('#content').height(h2);
}

function show_map() {
	if(document.getElementById('map')===null) return;
	
	// Creating an object literal containing the properties
	// we want to pass to the map
	var options = {
		zoom: 15,
		center: new google.maps.LatLng(46.342558, 19.048555),
		mapTypeId: google.maps.MapTypeId.ROADMAP,
		mapTypeControl: false
	};

	// Creating the map
	var map = new google.maps.Map(document.getElementById('map'), options);

	// Adding a marker to the map
	var jelolo = new google.maps.Marker({
		position: new google.maps.LatLng(46.342558, 19.048555),
		map: map,
		title: 'panzió'
	});

	var infowindow = new google.maps.InfoWindow({
		content: '<span style=color:black;><h1>Knab panzió</h1></span>'
	});

	infowindow.open(map, jelolo);

	// Adding a click event to the marker
/*	google.maps.event.addListener(jelolo, 'click', function() {
		// Calling the open method of the infoWindow
		infowindow.open(map, jelolo);
	});*/
};

