/*
 * JS pro webovou cast
 *
 *
 */
$(document).ready(function(){
	$('a[href$="jpg"], a[href$="jpeg"], a[href$="gif"], a[href$="png"], a[href$="JPG"], a[href$="JPEG"], a[href$="GIF"], a[href$="PNG"]').fancybox();
	
	$("#infinite").scrollable({
		vertical:true,
		keyboard: false
	}).circular();	
	
	$("#menu li").hover(
		function(){	
			//timecheck = now.getTime();
			$(this).addClass('selected');				 
			if (!$(this).hasClass("selected2") && $(this).parent().hasClass("submenu"))
			{
				$("a:first", this).addClass("mhsel");
				
				if (jQuery.browser['msie'] && $("ul",this).size() > 0)
				{
					$(this).css('margin-bottom', '-2px');					
				}
			}
			$("ul:first", this).show(); 
		},
		function(){			
			$(this).removeClass('selected');
			$("a:first", this).removeClass("mhsel");			
			$(".submenu",this).hide()
			if (jQuery.browser['msie'] && $("ul",this).size() > 0)
				$(this).css('margin-bottom', '0px');
		}
	);
	
	$("#search").focus(function(){
		$(this).val('');
	});


});

var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);

function createMarker(point, text, label) 
{	      
	var letter = label;
	var letteredIcon = new GIcon(baseIcon);
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(text);
	});
	return marker;
}