/* ------------------- New functions ----------------------------- */

function js_popup(str_url, str_name, str_window, int_width, int_height, int_x, int_y, str_features) {
 str_features = str_features + ',width=' + int_width + ',height=' + int_height;
 if (int_x=='false')
  str_features = str_features + ',left=' + (screen.width/2 - int_width/2) + ',top=' + (screen.height/2 - int_height/2);
 else
  str_features = str_features + ',left=' + int_x + ',top=' + int_y;
 eval(str_name+"=window.open('"+str_url+"','"+str_window+"','"+str_features+"')");
 eval(str_window+".focus()");
}

var blnToolTipCanceled = false;
function SetToolTip(strHTML) {
	blnToolTipCanceled = false;
	SetToolTip2(strHTML, 8, 10)
}

function SetToolTip2(strHTML, xoffset, yoffset) {
	blnToolTipCanceled = false;
	setTimeout("ShowToolTip('" + strHTML + "', " + (window.event.clientX + document.body.scrollLeft + xoffset) + ", " + (window.event.clientY + document.body.scrollTop + yoffset) + ")", 150);
}

function ShowToolTip(strHTML, lngX, lngY) {
	document.all.ToolTipText.innerHTML=strHTML;
	if (!blnToolTipCanceled) {
		if (lngX + ToolTip.offsetWidth > document.body.clientWidth) lngX = document.body.clientWidth - ToolTip.offsetWidth - 15;
		ToolTip.style.pixelLeft = lngX;
		ToolTip.style.pixelTop = lngY;
		ToolTip.style.visibility="visible";
	}
}
function ResetToolTip() {
	blnToolTipCanceled = true;
	ToolTip.style.visibility="hidden";
}

function MenuSubportal(strID, strColor)
{
	var elem, i;
	for(i=0;i<=4;i++)
	{
		elem = document.getElementById("spe_" + strID + "_" + i + "_1")
		if(elem!=null) elem.style.backgroundColor = strColor;
		elem = document.getElementById("spe_" + strID + "_" + i + "_2")
		if(elem!=null) elem.style.backgroundColor = strColor;
	}
	elem = document.getElementById("spe_" + strID + "_5")
	if(elem!=null) elem.style.backgroundColor = strColor;
}

function StandardLink(strID, strColor)
{
	var elem;
	elem = document.getElementById("sl_" + strID + "_top")
	if(elem!=null) elem.style.backgroundColor = strColor;
	elem = document.getElementById("sl_" + strID + "_left")
	if(elem!=null) elem.style.backgroundColor = strColor;
	elem = document.getElementById("sl_" + strID + "_right")
	if(elem!=null) elem.style.backgroundColor = strColor;
	elem = document.getElementById("sl_" + strID + "_bottom")
	if(elem!=null) elem.style.backgroundColor = strColor;
}

/* ------------------ Old functions (still needed) ----------------------------------- */

//zentriertes popup-window
function PopUp(url,width,height){
   var xMax = 800, yMax=600; // default
   if (document.all) var xMax = screen.width, yMax = screen.height;
   else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
   var xOffset = (xMax-width)/2;
   var yOffset = (yMax-height)/2;
   Fenster = window.open(url,'PopUp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
   Fenster.focus();
}


//Funktion zum Einblenden des vergrößerten Bildes
function View(showpage){
   url="imagepopup.asp?bild="+showpage;
   var xMax = 800, yMax=600; // default
   if (document.all) var xMax = screen.width, yMax = screen.height;
   else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
   var xOffset = (xMax-512)/2; // 420
   var yOffset = (yMax-740)/2; //  120

   Fenster = window.open(url,'Bild','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=1,height=1,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');

   Fenster.focus();
}


//funktion zum aufrufen eines links aus einer selectbox
function SelectChange(selectBox) {
    if(selectBox) {
	var url = selectBox.options[selectBox.selectedIndex].value;
        if(url) self.document.location.href=url;
    }
}

function ImpressumWindow(url, title)
{
   var width = 520;
   var height = 480;

   var xMax = 800, yMax=600; // default
   if (document.all) var xMax = screen.width, yMax = screen.height;
   else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
   
   var xOffset = (xMax-width)/2;
   var yOffset = (yMax-height)/2;
   
   Fenster = window.open(url,title,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
   Fenster.focus();
}

function DruckWindow(url, title)
{
   var width = 660;
   var height = 480;

   var xMax = 800, yMax=600; // default
   if (document.all) var xMax = screen.width, yMax = screen.height;
   else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
   
   var xOffset = (xMax-width)/2;
   var yOffset = (yMax-height)/2;
   
   Fenster = window.open(url,title,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
   Fenster.focus();
}

/* ------------------ Old functions (not clear if needed after redesign) ----------------------------------- */


function LmOver(elem)
{
	elem.style.backgroundColor = "#FF6600";
	elem.style.cursor = 'hand';
}

function LmOut(elem)
{
	if (elem.id=='r' + markedID) { elem.style.backgroundColor = "#FF9900"; }
	else { elem.style.backgroundColor = ''; }
}

function LmDown(elem)
{
	elem.style.backgroundColor = "#FF9900";
}

function LmClick(elem) 
{
	var link, href;
	link = eval(document.all[elem.id+'_link']);
	if(link) href = link.href;
	if(href) self.document.location.href = href;
}

function setActiveRow(rowID) {
	var row;
	
	if(rowID!='')
	{
		if (IE4 || DOM)
		{
		  row = eval (document.all['r'+rowID]);
		  if (row) LmDown(row);
	        }
		//LmDown('r'+rowID);
	}

}

function LmUp(path)
{
	location.href = path;
}

function getLeft(l)
{
  if (l.offsetParent) return (l.offsetLeft + getLeft(l.offsetParent));
  else return (l.offsetLeft);
}

function getTop(l)
{
  if (l.offsetParent) return (l.offsetTop + getTop(l.offsetParent));
  else return (l.offsetTop);
}

/* ------------------ Old functions (not needed anymore) ----------------------------------- */

/*
function showContactLayer()
{
	strURL = document.URL;
	pos  = strURL.indexOf("?");
	cpos = strURL.indexOf("show=contact"); 

	if(pos==-1) {
		window.location.href = document.URL + "?show=contact";
	} else {
		if(cpos==-1) {
			window.location.href = document.URL + "&show=contact";
		} else {
			window.location.href = document.URL;
		}
	}
}
*/

