		var next=0;
		var setInt;
		function changeTabPanel(next) { $("#startInterval").css('background','url(images/playerActive.gif)');$("#startInterval").css('background-position','0pt -1pt');$("#stopInterval").css('background','url(images/player.gif)');$("#stopInterval").css('background-position','31pt -1pt');$("#tab"+next).click();	 }
					
		
		function startInterval() {
			window.clearInterval(setInt);setInt="";
			setIntervalTabPanel(next);
			$("#startInterval").css('background','url(images/playerActive.gif)');
			$("#startInterval").css('background-position','0pt -1pt');
			$("#stopInterval").css('background','url(images/player.gif)');	
			$("#stopInterval").css('background-position','31pt -1pt');
		}
		function stopInterval() {
			window.clearInterval(setInt);setInt="";
			$("#startInterval").css('background','url(images/player.gif)');
			$("#startInterval").css('background-position','0pt -1pt');
			$("#stopInterval").css('background','url(images/playerActive.gif)');
			$("#stopInterval").css('background-position','31pt -1pt');
		}		
		function setIntervalTabPanel(next) { setInt=window.setInterval("changeTabPanel("+next+");if (next==5){next=0;}else {next++;}",8000); }

$(document).ready(function () {
	$('.period').click(function (e) {

		$(this).parent().parent().find("img.day").attr("src","images/today2.gif");
		$(this).parent().parent().find("img.week").attr("src","images/thisweek2.gif");
		$(this).parent().parent().find("img.month").attr("src","images/thismonth2.gif");

		if ($(this).children("img").attr("src")=='images/today2.gif') {
			$(this).children("img").attr("src","images/today1.gif");
		} else if ($(this).children("img").attr("src")=='images/thisweek2.gif') {
			$(this).children("img").attr("src","images/thisweek1.gif");
		} else if ($(this).children("img").attr("src")=='images/thismonth2.gif') {
			$(this).children("img").attr("src","images/thismonth1.gif");
		}

		//$("#DEventTab").slideUp("slow");
		//$("#DEventTab").animate({ height: "600px" }, "fast");
	});	

//	$('.addImg').mouseover(function (e) {
//		//alert($(this).attr("src"));
//		var query=$(this).attr("src");
//		query=query.split(".png"); 
//		$(this).attr("src",query[0]+"2.png");
//	});	
//	$('.addImg').mouseout(function (e) {
//		//alert($(this).attr("src"));
//		var query=$(this).attr("src");
//		query=query.split("2.png"); 
//		$(this).attr("src",query[0]+".png");
//	});		
	$('.categoryEvent').click(function (e) {
		$(this).parent().parent().children("li").removeClass("eventPromotedCatSub3");
		$(this).parent().addClass("eventPromotedCatSub3");
	});		

});
		
		
		this.tooltip = function(){	
			/* CONFIG */		
				xOffset = 10;
				yOffset = 170;		
				// these 2 variable determine popup's distance from the cursor
				// you might want to adjust to get the right result		
			/* END CONFIG */		
			$(".showcalendar").click(function(e){											  
				  
				$("#tooltip")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX - yOffset) + "px")
					.fadeIn("fast");	
		    });	

		};