function swapImage(id, image) { 
	document.images[id].src = image; 
} 

function showkontent (obj, obj2) {
	if (document.getElementById(obj)) {
		document.getElementById(obj).style.display = "block";
		if ( document.getElementById(obj2) )
			document.getElementById(obj2).style.display = "none";
	}
}
function hidekontent (obj, obj2) {
	if (document.getElementById(obj)) {
		document.getElementById(obj).style.display = "none";
		if ( document.getElementById(obj2) )
			document.getElementById(obj2).style.display = "block";
	}
}

/* selects the option of the select box "sel" with the value "val" */
function selectOption( sel, val ) {
	i = 0;
	found = false;
	while( !found && i < sel.options.length ) {
		if ( sel.options[i].value == val ) {
			found = true;
			sel.options.selectedIndex = i;
		}	
		i++;
	}
}

function openPopUp(width, height, target) {
    options ="left=0,top=0,screenX=0,screenY=0,width="+width+",height="+height+",toolbar=no,locationbar=no,directories=no,scrollbars=no,status=yes,menubar=no,resizable=yes";
	popupWin = open(target,'PopUp',options);
}


// general cookie funktions

 function getCookie( name ) {
   name += "=";
   var len = name.length;
   var cookie_len = document.cookie.length;
   var i = 0;
   while ( i < cookie_len ) {
     var j = i + len;
	 if ( document.cookie.substring(i,j) == name ) return getCookieValue(j);
	 i = document.cookie.indexOf( " ", i ) + 1;
	 if ( i == 0 ) break;
   }
   return null;
 }

 function getCookieValue( position ) {
   var end = document.cookie.indexOf(";", position );
   if ( end == -1 ) end = document.cookie.length;
   return unescape( document.cookie.substring( position, end ) );
 }

 function setCookie(name, value, expires, path) {
   var exp = new Date();
   exp.setTime(exp.getTime() + expires);
   document.cookie = name + "=" + value + "; expires=" + exp.toGMTString() +
     ((path == null ) ? "" : ("; path=" + path ));
 }

 function setTempCookie(name, value, path) {
   document.cookie = name + "=" + value + ((path == null ) ? "" : ("; path=" + path ));
 }

