/* ------------------- 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) ----------------------------------- */

// funktion zum Oeffnen des vergroesserten Bildes 

function openwindow (url) {
 var fenster=window.open(url,'fenster1','width=400,height=300,status=yes,scrollbars=yes,resizable=yes');
}



//Funktion zum Einblenden des vergrößerten Bildes
function View(showpage){
   url="/scriptfiles/image.htm?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;
    }
}
