$(function() {
if(top.location.hash.substr(1) == "")
{veriCek($('#cal1 .has-event:first a').attr("href"));}
else
{veriCek(top.location.hash.substr(1));}

function veriCek(url)
{
$.ajax({
	type:"GET",
	dataType:"xml",
	url:"/apps/events.xml",
	success:function(xml){
	$(xml).find("event").each(function(){
	var xmlUrl = $(this).attr("href");
	if (xmlUrl == url)
	{location.hash = '#' + $(this).attr("href"); top.location.hash = '#'+$(this).attr("href");}
		});
	}
 });
}

		   $('#etkinlikboxi a').click(function(){
				//var adresClick = $(this).attr("href");
				$('#takvimKapsul').toggleClass("acik");
				$('#etkinlikboxi a').toggleClass("on");
		   });
		   
            $('#cal1 .has-event a').click(function() {$('#etkinlikboxi a').click(); veriCek($(this).attr("href")); return false; });
            var hash = location.hash;
            function onHashChanged() { if (!location.hash) return; $('#content').empty().text('yukleniyor').load('../' + top.location.hash.substr(1));}
            setInterval(function() { if (location.hash != hash) { hash = location.hash; onHashChanged(); } }, 100);
            onHashChanged();
			$('td.prev:first').attr("align","right");
			
			$('#cal1 .has-event').hover(function() { 
			   $(this).children('div').children('a').css("display", "block")},
			   function(){$(this).children('div').children('a').css("display", "none");}
			   );
			
			$('#cal1 td.prev a').eq(0).attr("title","Onceki Aya Git");				
			$('#cal1 td.prev a').eq(1).attr("title","Sonraki Aya Git");	
			if (isPostBack == true)
			{$('#etkinlikboxi a').click();}			
			});

