
	function jBchange (id, newClass) {
		identity = document.getElementById(id);
		if (identity){
			identity.className = newClass;
		}
	}

	document.oncontextmenu = disableSelect;
	document.ondragstart = disableSelect;
	document.onselectstart = disableSelect;
	
	if (window.sidebar || window.opera) {
		document.onmousedown = disableSelect;
		document.onclick = reEnable;
		document.onmouseup = reEnable;
	}
	
	if (window.opera) {
		document.oncontextmenu = click;
	}


	function _isformelement ( target ) {
		return target && (target.tagName == "INPUT" || target.tagName == "TEXTAREA");
	}
	

	function disableSelect (evt) {
		if (!evt) {
			evt = window.event;
		}
		var target = evt.srcElement ? evt.srcElement : evt.target;
		if (!_isformelement(target)) {
			return false;
		}
	}
	
	function reEnable(){
		return true;
	}
	
	function click (e) {
	  if (!e)
	    e = window.event;
	  if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
	    if (window.opera)
	      window.alert("Ihre rechte Maustaste ist defekt");
	    return false;
	  }
	}

	var connection;
	var olddestination = null;

	(function () {
		connection = (window.XMLHttpRequest) ? new XMLHttpRequest() : ((window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : false);
	})();

	function getcookie ( search ) {
		var value = "";
		var cookies = document.cookie.split(";");
		for (var index in cookies) {
			if (trim(cookies[index].split("=")[0]) == search) {
				value = unescape(trim(cookies[index].split("=")[1]));
			}
		}
		return value;
	}

	function emailPopup ( caption, url, /* optional */ height, width, callback_fn ) {
		var options = {
			caption : caption,
			height : height || 520,
			width : width || 460,
			fullscreen : false,
			show_loading : true,
			callback_fn: callback_fn
		}
		var win = new GB_Window(options);
		return win.show(url);
	}
	

	function jBdetails ( information, reset ) {
		var destination = document.getElementById(information);
		if (destination != null && destination == olddestination) {
			return;
		}
		if (connection) {
			if (connection && connection.readyState < 4) {
				connection.abort();
			}
			connection.open("GET", "/cms/localstyles/bourse/system/ajax.jsp?cache=" + new Date().getTime() + "&info=" + information);
			connection.setRequestHeader("Cookie", document.cookie);
			connection.setRequestHeader("Connection", "close");
			connection.onreadystatechange = function ()
			{
				if (connection.readyState == 4 && connection.status == 200) {
					var responseResult = trim(connection.responseText);
					if (olddestination != null && reset) {
						if (olddestination.id == "jBInformations") {
							olddestination.className = "jBhide";
						} else {
							olddestination.innerHTML = "&nbsp;";
						}
					}
					if (information == "exh_homepage") {
						if (responseResult != "Illegal request.") {
							if (responseResult.substr(0, 4) != "http") {
								responseResult = "http://" + responseResult;
							}
							if (responseResult.substr(0, 4) == "http") {
								window.open(responseResult);
							} else {
								alert("Invalid URI.");
							}
						} else {
							alert(responseResult);
						}
					} else if (information == "jBInformations") {
						destination.className = "jBshow";
						try {
							eval(responseResult); // json string
						} catch (e) {
							alert("Invalid data.");
						}
						if (typeof(jBinfos) == "object") {
							var element;
							for (var key in jBinfos) {
								element = document.getElementById(key);
								if (element) {
									if (key == "an_dauer" && jBinfos[key].indexOf(".00") > -1) {
										jBinfos[key] = parseInt(jBinfos[key]);
									}
									element.innerHTML = jBinfos[key];
								}
							}
						} else {
							alert("Invalid data.");
						}
					} else {
						destination.innerHTML = responseResult;
					}
					if (destination != null) {
						olddestination = destination;
					}
				}
			}
			connection.send(null);
		}
	}