
function setLegend(url)
{
	var img = dom.gI('legendeimg');
	
	
	
	if(img != null)
		img.src = url;
		
		
}
function showReservierung(vid)
{
	
	var url = "reservierung.aspx";
	if(vid != null)
		url += "?vid=" + vid;
		
	var fenster2 = window.open(url, "Kartenreservierung", "left=0,top=0,menubar=0,fullscreen=1,resizable=1,status=1");	
	fenster2.focus();

}


var currentrow = null;

function highlightRow(vid,currselectedid)
{

	var row = document.getElementById('terminrow' + vid);
	
	if(vid == currselectedid)
	{
		currentrow = null;
		return;
	}
	
	if(row != null){
		row.className += "_sel";
		currentrow = row;
		
		var elm = row;
		if (document.addEventListener) {
		
			elm.addEventListener('mouseout',unhighlightRow,true);
		} else {
			elm.attachEvent('onmouseout',unhighlightRow);
		}
	}

}

function unhighlightRow()
{
	if(currentrow != null)
		currentrow.className = currentrow.className.replace('_sel','');
}





/* 
calculates the height of a different divs.
should be added to window.resize event and also called after every postback.
*/
function neuAufbau()
{
	var Hoehe = Fensterhoehe();
	
	var hheader = dom.gI("hiddenHeaderState");
	
	// if header is existing you have to make divs higher
	if(hheader != null)
		if(hheader.value == "none")
			Hoehe += 73;
			

		
	/*if(dom.gI("resterminediv") != null && Hoehe > 100)
		dom.gI("resterminediv").style.height = (Hoehe - 460) + "px";
	if(dom.gI("subleft") != null && Hoehe > 100)
		dom.gI("subleft").style.height = (Hoehe - 143) + "px"; */
	if(dom.gI("resbigtable") != null && Hoehe > 100)
		dom.gI("resbigtable").style.height = (Hoehe - 15) + "px"; 
	if(dom.gI("maintable") != null && Hoehe > 100)
		dom.gI("maintable").style.height = (Hoehe - 15) + "px"; 
	if(dom.gI("scrolldiv") != null && Hoehe > 100)
		dom.gI("scrolldiv").style.height = (Hoehe + 10) + "px"; 

}




/* returns the width of the window */
function Fensterhoehe() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
    ie = false;
  } else if( document.documentElement &&
      ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  
  } else if( document.body &&  document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  
  return myHeight;
}

/* returns the height of the window */
function Fensterbreite() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body &&  document.body.clientWidth ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  
  return myWidth;
}
