/** 
  * @version $Id: global.js,v 1.1 2004/06/15 08:09:24 christof.hoeke Exp $
  */
var isCamino = navigator.userAgent.indexOf('Camino') > -1;
var dhtml = (document.all || document.getElementById && !isCamino) ? 1 : 0;
  
if (dhtml) {
	//styles if js enabled
	document.write('<link rel="STYLESHEET" type="text/css" href="include/css/dhtml.css">');
	}
if (document.layers) {
	//additional styles for older browsers
	document.write('<link rel="STYLESHEET" type="text/css" href="include/css/basic.css">');
	}
	
function setfocus() {
	if (document.forms[0]) {
		document.forms[0].elements[0].focus();
		}
		alert(document.forms[0])
	}
/* window.onload = setfocus; */

	
/* utility functions */	
function getE(id) {
	if (document.all) {
		return document.all[id];
		}
	else if (document.getElementById) {
		return document.getElementById(id);
		}
	}

/* DHTML functions 
	target is normally "_info"
	src is normally "_info" + IDofFormElement + selectedIndex
*/
function swapContent(srcE, targetid) {
	sindex = srcE.selectedIndex + 1;
	if (sindex < 1) 
		sindex = 1;
	srcid = '_info_' + sindex;
	se = getE(srcid);
	te = getE(targetid);
	te.innerHTML = se.innerHTML;
	}
	
/* gets computed value of display Property 
if not possible set a default style value */
function getCurrentDisplay(e) {
	// ie
	if (e.currentStyle) 
		return e.currentStyle.display;
	// moz
	if (window.getComputedStyle) 
		return window.getComputedStyle(e, null).display;
	// other not available, set default
	if (!e.style.display) 
		e.style.display = "none";
	return;
	}
	
/* opens or closes a block */
function toggleBlock(id) {
	var e = getE(id);
	cd = getCurrentDisplay(e)
	if (e.style.display == "none" || cd == "none") 
		e.style.display = "block";
	else 
		e.style.display = "none";
	return false;
	}

/* for IE
 * expects class(or classpart)-name "Submit" (nextSubmit or backSubmit)
 * replaces Submit with SubmitFOCUS or the other way round!
 */
function submitFOCUS(item) {
	if (document.all) {
		var currentClass = item.className;
		if (currentClass.indexOf('SubmitFOCUS') == -1) {
			item.className = currentClass.replace('Submit', 'SubmitFOCUS');
			}
		else {
			item.className = currentClass.replace('SubmitFOCUS', 'Submit');
			}
		}
	}
	
function logout() {
	// add call to logout
	self.close();
	}
	
//no errors for older browser, so disable all functions that would not work
function dummyFunction() {}
if (!dhtml) {
	swapContent = dummyFunction;
	toggleBlock = dummyFunction;
	}
	


