function mOver(cell)
{
  if (!cell.contains(event.fromElement))
   {
      cell.style.cursor = 'hand';
      cell.bgColor = '#FFE439';
   }
}

function mOut(cell)
{
   if (!cell.contains(event.toElement))
   {
      cell.style.cursor = 'default';
      cell.bgColor = '#A2B82F';
   }
}

function mClick(cell)
{
   if(event.srcElement.tagName=='TD')
   {
      cell.children.tags('A')[0].click();
   }
}


/* Menüs für Schnelllinks */

var menus = new Array ();
menus["maina"] = true;
menus["mainb"] = true;

var menu_close = true;
var menu_close_force = false;

function close_menus ()
{
	if (menu_close == true
	|| menu_close_force == true)
	{
	  for (var pref in menus)
	  {
  		document.getElementById (pref).style.display = 'none';
  	}
  }
}

function open_menu (menu_id)
{
  menu_close_force = true;
  close_menus ();
  menu_close_force = false;

  if (menus[menu_id] == true
  && menu_close == false)
  {
	  document.getElementById (menu_id).style.display = 'inline';
	}
}

function objektdetail(id) {
	var objektdetails=window.open("details.php?objektID="+id,"objektdetails","width=460,height=300,locationbar=no,resizable=no,scrollbars=yes,dependent=no,statusbar=no");
	objektdetails.focus();
}

xmlHttp = false;
if(typeof(XMLHttpRequest) != 'undefined')
{
  xmlHttp = new XMLHttpRequest();
}
if(!xmlHttp)
{
  try
  {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e)
  {
    try
    {
      xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e)
    {
      xmlHttp  = false;
    }
  }
}


function getAJAX(action)
{
  if(xmlHttp)
  {
		if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3)
		{

		}
		else
	  {
      xmlHttp.open('get', action);
      xmlHttp.send(null);
    }
  }
}

function objektFoto(objekt,id,width,height) {
 var foto=window.open("objekt-foto.php?objekt="+objekt+"&id="+id+"&width="+width+"&height="+height,"foto","width="+(width+50)+",height="+(height+50)+",locationbar=no,resizable=no,scrollbars=yes,dependent=no,statusbar=no");
}

function kalender(f,d) {
 var datum=d.split('.');
 var date=datum[2]+datum[1];
 var kalenderf=window.open("../content/kalender.php?f="+f+"&d="+date,"kalender","width=245,height=215,locationbar=no,resizable=no,scrollbars=yes,dependent=yes,statusbar=no");
 kalenderf.focus();
}

function sendDay(d,f) {
 eval("document.buchung."+f+".value='"+d+"'");
}

function checkLeistungen(id,status) {
 if(id>=1 && id<=3) {
  for(i=1;i<=3;i++) {
   if(document.getElementById('leistung'+i)!=null) {
    document.getElementById('leistung'+i).checked=false;
   }
  }
  document.getElementById('leistung'+id).checked=status;
 }
}
