$(function() {

	// columns
	$("table.calendar tr.weekdays th a").mouseover( function() {
		var iIndex = $(this).parent().parent().children('th').index($(this).parent()[0]);
		$("table.calendar tr td:nth-child(" + (iIndex+1) + ") a").addClass('active');
	 });
	$("table.calendar tr.weekdays th a").mouseout( function() {
		var iIndex = $(this).parent().parent().children('th').index($(this).parent()[0]);
		$("table.calendar tr td:nth-child(" + (iIndex+1) + ") a").removeClass('active');
	 });
	 
	// rows
	$("table.calendar th.weeknr a").mouseover( function() {
		$(this).parent().parent().children().children('a').addClass('active') });
	$("table.calendar th.weeknr a").mouseout( function() {
		$(this).parent().parent().children().children('a').removeClass('active') });
	
	
	
});

function changeInputValue(strFormId)
{
	var chosen_value = $("#"+strFormId+" :input").filter(function(index){return $(this).attr("name")=="my";}).attr("value");
	var chosen_option = $("#"+strFormId+"select[@name=my]").children().filter(function(index){return $(this).attr("value")==chosen_value;}).text();
	var pos = chosen_option.indexOf(" ");
	var year = chosen_option.substring(pos+1, pos+5);
	var month = chosen_value.split("-");
	$("#"+strFormId+" :input").filter(function(index){return $(this).attr("name")=="y";}).attr("value", year);
	$("#"+strFormId+"select[@name=my]").children().filter(function(index){return $(this).attr("value")==chosen_value;}).val(month[0]);
}

