function WriteYearOptions()
{
  Now = new Date();
  NowYear = Now.getYear(); //Aktualis ev
  if (NowYear < 2000) NowYear += 1900; //netscape miatt kell
  
  CurrentDate = document.getElementById("currentDate").value;
  CurrentYear = NowYear;
  CurrentMonth = Now.getMonth();
  CurrentDay = Now.getUTCDate();
  
 // 2012. november
  if (CurrentDate != null) {
    pos = CurrentDate.indexOf(".");
	CurrentYear = CurrentDate.substring(0,pos);
	monthString = CurrentDate.substring(pos+2);
	
	if (monthString == 'január') CurrentMonth = 0;
	if (monthString == 'február') CurrentMonth = 1;
	if (monthString == 'március') CurrentMonth = 2;
	if (monthString == 'április') CurrentMonth = 3;
	if (monthString == 'május') CurrentMonth = 4;
	if (monthString == 'június') CurrentMonth = 5;
	if (monthString == 'július') CurrentMonth = 6;
	if (monthString == 'augusztus') CurrentMonth = 7;
	if (monthString == 'szeptember') CurrentMonth = 8;
	if (monthString == 'október') CurrentMonth = 9;
	if (monthString == 'november') CurrentMonth = 10;
	if (monthString == 'december') CurrentMonth = 11;

  }
 
  FromYear = NowYear - 6;
  ToYear = NowYear + 5;
  line = "";

  for (i=ToYear; i!=FromYear; i--)
  {
    if (i == CurrentYear )line += "<OPTION value='"+i+"' selected = 'selected'>";
	else line += "<OPTION value='"+i+"'>";
    line += i;
  }
  return line;
}

function WriteMonthOptions()
{
  line = "";

  for (i=0; i<=11; i++)
  {
	if (i == CurrentMonth ) line += "<OPTION value='"+i+"' selected = 'selected'>";
    else line += "<OPTION value='"+i+"'>";
	if (i==0) line += "Január";
	if (i==1) line += "Február";
	if (i==2) line += "Március";
	if (i==3) line += "Április";
	if (i==4) line += "Május";
	if (i==5) line += "Június";
	if (i==6) line += "Július";
	if (i==7) line += "Augusztus";
	if (i==8) line += "Szeptember";
	if (i==9) line += "Október";
	if (i==10) line += "November";
	if (i==11) line += "December";
  } 
  return line;
}

/*
function CalendarSelectCurrentDay(){
  Now = new Date();
  CurrentDay = Now.getUTCDate();
  
  nowParameter = "day"+CurrentDay;
  CurrentDayNode = document.getElementById(nowParameter);
  CurrentDayContent = CurrentDayNode.getElementsByTagName('a')[0];
  CurrentDayNode.style.background = 'green';
}*/


function LoadCalendarPage(Year,Month)
{
  BaseUrl = document.getElementById("nextUrl").value;
  pos = BaseUrl.lastIndexOf("&");
  if (pos == -1) pos = BaseUrl.indexOf("?");
  TargetUrl = BaseUrl.substring(0,pos);
  if (TargetUrl.indexOf("?") == -1) TargetUrl += '/?';
  else TargetUrl += '&';
  TargetUrl += "honap=";
  TargetUrl += document.getElementById("yearselector").value;
  TargetUrl += '_';
  TargetUrl += document.getElementById("month").value;
  //alert(TargetUrl);
  location.href=TargetUrl;
}

