


function OpenWindow(url,titel,scroll,breite,hoehe)
{
window.open(url,titel,'toolbar=no,alwaysRaised=yes,alwaysRaised=yes,directories=no,status=no,statusbar=no,menubar=no,scrollbars='+scroll+',resizable=no,width='+breite+',height='+hoehe+'').focus();
}
function _back() {
	window.history.back();
}

function _submit(lnr) {
	document.forms[lnr].submit();
}

function _reset(lnr) {
	document.forms[lnr].reset();
}

// catch possible bugs with WebTV and other older browsers
var is_regexp = (window.RegExp) ? true : false;
var vBobjects = new Array();
var vbDOMtype = "ie4";

function fetch_object(idname, forcefetch)
{
	if (forcefetch || typeof(vBobjects[idname]) == "undefined")
	{
		switch (vbDOMtype)
		{
			case "std":
			{
				vBobjects[idname] = document.getElementById(idname);
			}
			break;
			case "ie4":
			{
				vBobjects[idname] = document.all[idname];
			}
			break;
			case "ns4":
			{
				vBobjects[idname] = document.layers[idname];
			}
			break;
		}
	}
	return vBobjects[idname];
}



// +++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Cookies Funktionen                       2002
//
// ++++++ Gueltigkeit+++++++++++++++++++++++++++++++++++
var expDays = 100;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
//++++++++++++++++++++++++++++++++++++++++++++++++++++++

// ++++++ gueltigkeit des Cookies Lese Funktion
function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
}

// ++++++ Lese Wert Von Cookie Funktion +++++++
function GetCookie (name) {  

	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}

// ++++++ Schreib von Cookie Funktion +++++++
function SetCookie (name, value) { 

	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
	document.cookie = "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr";	
}


// ++++++ Aufzeichnung von Formularen  Funktion +++++++

function cookieForms() {  
	var mode = cookieForms.arguments[0];
	
	for(f=1; f<cookieForms.arguments.length; f++) {
		formName = cookieForms.arguments[f];
		
		if(mode == 'open') {	
			cookieValue = GetCookie('saved_'+formName);
			if(cookieValue != null) {
				var cookieArray = cookieValue.split('#cf#');
				
				if(cookieArray.length == document[formName].elements.length) {
					for(i=0; i<document[formName].elements.length; i++) {
					
						if(cookieArray[i].substring(0,6) == 'select') { document[formName].elements[i].options.selectedIndex = cookieArray[i].substring(7, cookieArray[i].length-1); }
						else if((cookieArray[i] == 'cbtrue') || (cookieArray[i] == 'rbtrue')) { document[formName].elements[i].checked = true; }
						else if((cookieArray[i] == 'cbfalse') || (cookieArray[i] == 'rbfalse')) { document[formName].elements[i].checked = false; }
						else { document[formName].elements[i].value = (cookieArray[i]) ? cookieArray[i] : ''; }
					}
				}
			}
		}
				
		if(mode == 'save') {	
			cookieValue = '';
			for(i=0; i<document[formName].elements.length; i++) {
				fieldType = document[formName].elements[i].type;
				
				if(fieldType == 'password') { passValue = ''; }
				else if(fieldType == 'checkbox') { passValue = 'cb'+document[formName].elements[i].checked; }
				else if(fieldType == 'radio') { passValue = 'rb'+document[formName].elements[i].checked; }
				else if(fieldType == 'select-one') { passValue = 'select'+document[formName].elements[i].options.selectedIndex; }
				else { passValue = document[formName].elements[i].value; }
			
				cookieValue = cookieValue + passValue + '#cf#';
			}
			cookieValue = cookieValue.substring(0, cookieValue.length-4); // Remove last delimiter
			
			SetCookie('saved_'+formName, cookieValue, exp);		
		}	
	}
}

// ++++++ Loescht Cookie Funktion +++++++
function DeleteCookie (name) {    
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

// *********************************
// Öffnet und Schliesst MenueTabellen
function toggle_collapse(objid)
{

	if (!is_regexp)
	{
		return false;
	}
	
	var opjTabell = fetch_object("body_" + objid);	
	var opjTabellNeg = fetch_object("body_" + objid + "_neg");	
	var img = fetch_object("image_" + objid);

	
	if (!opjTabell)
	{
		// nothing to collapse!
		if (img)
		{
			// hide the clicky image if there is one
			img.style.display = "";
		}
		return false;
	}
	if (opjTabell.style.display == "none")
	{
		opjTabell.style.display = "";
		opjTabellNeg.style.display = "none";
		SetCookie (objid, false,exp);
		if (img)
		{
			img_re = new RegExp("_collapsed\\.gif$");
			img.src = '../images/Button/Pfeilauf.bmp'
		}


	}
	else
	{
		opjTabell.style.display = "none";
		opjTabellNeg.style.display = "";
		SetCookie (objid, true,exp);
		if (img)
		{
			img_re = new RegExp("\\.gif$");
			img.src = '../images/Button/Pfeilab.bmp'

		}
	}
	return false;
}
function Menue_Stellen(objid)
{
	
	if (!is_regexp)
	{
		return false;
	}
	
	var opjTabell = fetch_object("body_" + objid);	
	var opjTabellNeg = fetch_object("body_" + objid + "_neg");
	var img = fetch_object("image_" + objid);

	
	if (!opjTabell)
	{
		// nothing to collapse!
		if (img)
		{
			// hide the clicky image if there is one
			img.style.display = "";
		}
		return false;
	}
	if (GetCookie(objid) == "false")
	{
		opjTabell.style.display = "";
		opjTabellNeg.style.display = "none";	
//		SetCookie (objid, false,exp);
		if (img)
		{
			img_re = new RegExp("_collapsed\\.gif$");
			img.src = '../images/Button/Pfeilauf.bmp'
		}


	}
	else
	{
		opjTabell.style.display = "none";
		opjTabellNeg.style.display = "";
//		SetCookie (objid, true,exp);
		if (img)
		{
			img_re = new RegExp("\\.gif$");
			img.src = '../images/Button/Pfeilab.bmp'

		}
	}
	return false;
}

function jsWechselTaze1(objid)
{
    var TempTest = objid;
	var img = fetch_object(objid);

	img.src = '../images/menue/Taze20k.gif'
setTimeout("jsWechselTaze2('" + TempTest + "')",500);
}
function jsWechselTaze2(objid2)
{
	var img = fetch_object(objid2);

	img.src = '../images/menue/Taze20.gif'
}
function jsWechselBild(objid,mysec)
{
	var img = fetch_object(objid);

	img.src = mysec

}
function OnMouseRechtsSound()
{
if (document.all)
{
document.all.sound.src = "../sound/Kreischen.wav";
}
}

  
