function $()
{
	var elements = new Array();

	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];

		if (typeof element == 'string')
			element = document.getElementById(element)
				   || document.getElementsByName(element)[0]
//                 || document.getElementsByTagName(element)[0]
				   || undefined
			;

		if (arguments.length == 1) return element;
		elements.push(element);
	}
	return elements;
}

function $onLoad(func, w) {
	if (!w) w = window;
	if (w.addEventListener) w.addEventListener("load", func, false);
	else if (w.attachEvent) w.attachEvent("onload", func);
}

function $tags(tag, parent) {
	tag = tag.toUpperCase();
	var chs = parent.childNodes;
	var res = [];
	for(var i = 0; i < chs.length; i++) {
		var ch = chs[i];
		if (ch.tagName == tag) res.push(ch);
	}
	return res;
}

var $act_doc = document;
function $create(parent, tag, cl) {
	var el = $act_doc.createElement(tag);
	parent.appendChild(el);
	if(cl) el.className = cl;
	return el;
}

function $DIV(parent, text, cl) {
	var el = $create(parent, "DIV", cl);
	if (text) el.innerHTML = text;
	return el;
}



function sgxGetCacheKiller() {
    return new Date().getTime();
}

var augmentations = []
var is_aug_registered;

function sgxRegisterAugmentation(classname, func)
{
	augmentations[classname] = func
}

function sgxGetElementsByClass(w, classname, on_each)
{
	var children = w.document.getElementsByTagName('*') || w.document.all;

	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var classNames = child.className.split(' ');
		for (var j = 0; j < classNames.length; j++) {
			if (classNames[j] == classname) {
				on_each(child);
				break;
			}
		}
	}
};


var Ajax = new Object();

Ajax.getXMLReq = function() {
    var res = null;
    if (window.XMLHttpRequest) res = new XMLHttpRequest();
    else if (window.ActiveXObject) res = new ActiveXObject("Microsoft.XMLHTTP");
    return res;
}

Ajax.reqSync = function(cmd, post, give_xml) {
    var req = this.getXMLReq();
    if (post) {
    	req.open('POST', cmd, false);
    	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	    req.send(post);
    }
    else {
	    req.open('GET', cmd, false);
	    req.send(null);
	}
    if (req.status != 200) {
        alert("Fehler beim Abrufen von Daten: " + req.statusText + " (" + req.status + ")");
        return "";
    }
    return give_xml ? req.responseXML : req.responseText;
}

Ajax.reqAsync = function(cmd, post, func) {
    var req = this.getXMLReq();
    if (post) {
    	req.open('POST', cmd, true);
    	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
    }
    else {
	    req.open('GET', cmd, true);
	}
    req.onreadystatechange = function() {
    	if (req.readyState == 4) {
			if (req.status == 200) func(req.responseText, req.responseXML)
			else alert("Fehler beim Abrufen von Daten: " + req.statusText);
		}
    }
    req.send(post)
}

Ajax.request = function(cmd, post, on_finish) {
	cmd += "?no_cache=" + sgxGetCacheKiller();

	if (on_finish) return this.reqAsync(cmd, post, on_finish);
	else return this.reqSync(cmd, post);
}

Ajax.reqPeriodic = function(interval, cmd, post, on_query) {
	var update = function() {
		Ajax.reqAsync(cmd, null, function(res, xml) {
			var finished = on_query(res, xml);
			if (!finished) window.setTimeout(update, interval);
		})
	}
	window.setTimeout(update, interval);
}

Ajax.getFormData = function(form, additional_parms) {
	var els = form.elements
	var data = ""
    if (els) {
        for(var i = 0; i < els.length; i++) {
            var el = els[i]
            // alert("el: " + el + ", " + el.type + ", " + el.name + " = " + el.value)
            if (el.type == "checkbox") {
                if (el.checked) {
                    if (data) data += "&";
                    data += el.name + "=" + encodeURIComponent(el.value);
                }
            }
            else {
                if (el.name && el.value) {
                    if (data) data += "&";
                    data += el.name + "=" + encodeURIComponent(el.value);
                }
            }
        }
    }
    if (additional_parms) {
		if (data) data += "&";
		data += additional_parms;
	}
    return data;
}

Ajax.postForm = function(url, additional_parms, form, on_finish) {
	var data = Ajax.getFormData(form, additional_parms);
    if (on_finish) return Ajax.reqAsync(url + "?no_cache=" + sgxGetCacheKiller(), data, on_finish);
	else return Ajax.reqSync(url + "?no_cache=" + sgxGetCacheKiller(), data);
}

function sgxHideObjects(doc, hide)
{
    var els = doc.getElementsByTagName("object");
    if (hide) hide = "hidden";
    else hide = "visible";
    for(var i = 0; i < els.length; i++) {
        if (els[i].style) els[i].style.visibility = hide;
    }
}

function sgxCalcWindowSize()
{
	var obj=new Object();
	if (typeof (window.innerWidth) == 'number') {
		//Non-IE
		obj.w = window.innerWidth;
		obj.h = window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight )) {
		//IE 6+ in 'standards compliant mode'
		obj.w = document.documentElement.clientWidth;
		obj.h = document.documentElement.clientHeight;
	}
	else if (document.body && ( document.body.clientWidth || document.body.clientHeight)) {
		//IE 4 compatible
		obj.w = document.body.clientWidth;
		obj.h = document.body.clientHeight;
	}
	return obj;
}

// tag: e.g 'div'
function sgxWrapNode(node, tag, classname)
{
    var wrapper = document.createElement(tag);
    wrapper.className = classname;
    var inner = node.parentNode.replaceChild(wrapper, node);
    wrapper.appendChild(inner);
}

// type: 1:elements, 2:attribute, 3:text etc.
function sgxIterateChildren(node, type, func)
{
    if (!node) return;

    if (node.hasChildNodes) {
		for (var i = 0; i < node.childNodes.length;i++) {
            sgxIterateChilds(node.childNodes[i], type, func);
		}
        if (node.nodeType == type) func(node);
    }
}

function sgxIterateChildrenByClass(node, classname, func)
{
    if (!node) return false;

    if (node.hasChildNodes) {
		for (var i = 0; i < node.childNodes.length;i++) {
            sgxIterateChildrenByClass(node.childNodes[i], classname, func);
		}
        if (node.nodeType == 1 && node.className.match(classname)) {
       		func(node);
        }
    }
    return true;
}


function sgxHiliteSearches(content) {
    var query = window.location.search;

    if (typeof decodeURI != 'undefined'){
        query = decodeURI(unescape(query))
    }
    else {
        return false
    }

    if (query) {
        var qfinder = new RegExp()
        qfinder.compile("search=([^&]*)", "gi")
        qq = qfinder.exec(query)

        if (qq && qq[1]){
            query = qq[1]

            if (!query) return false;
//            var queries = query.replace(/\+/g,' ').split(/\s+/);
            var queries = query.replace(/\+/g,' ').split(/&/);

            var word;
            var func = function(node) {
                var i = node.nodeValue.toLowerCase().indexOf(word.toLowerCase())
                if (i != -1) {
                    if (node.parentNode.className != "searchhl") {
                        par = node.parentNode;
                        contents = node.nodeValue;

                        hiword = document.createElement("span");
                        hiword.className = "searchhl";
                        hiword.appendChild(document.createTextNode(contents.substr(i, word.length)));

                        par.insertBefore(document.createTextNode(contents.substr(0, i)), node);
                        par.insertBefore(hiword, node);
                        par.insertBefore(document.createTextNode(contents.substr(i + word.length)), node);

                        par.removeChild(node);
                    }
                }
            }

            for (var q = 0; q < queries.length;q++) {
                word = queries[q];
                sgxIterateChildren(content, 3, func);
            }
        }
    }
    return false;
}

// Browser.onLoad(sgxHiliteSearches)


//--- Browser-Object for browser detection and specific functions

var Browser = {

	init: function() {
		var s, i;
		this.agent 	 = navigator.userAgent;
		this.isIE    = false;
		this.isNS    = false;
		this.version = null;
		this.frames  = null;
		this.pngTransp = true;

		var ua = this.agent;
		this.isSafari = (ua.toLowerCase().indexOf('safari')>0 || ua.toLowerCase().indexOf('applewebkit')>0);

		s = "MSIE";
		if ((i = ua.indexOf(s)) >= 0) {
			this.isIE = true;
			this.version = parseFloat(ua.substr(i + s.length));
			if (this.version < 7) this.pngTransp = false;
			return;
		}

		s = "Netscape6/";
		if ((i = ua.indexOf(s)) >= 0) {
			this.isNS = true;
			this.version = parseFloat(ua.substr(i + s.length));
			return;
		}

		// Treat any other "Gecko" browser as NS 6.1.
		s = "Gecko";
		if ((i = ua.indexOf(s)) >= 0) {
			this.isNS = true;
			this.version = 6.1;
			return;
		}

	},

	getCursorPos: function(event) {
		var res = new Position()
		if (this.isIE) {
			this.forWindows(function(w) {
				if (w.event) {
					res.x = w.event.screenX;// + w.document.documentElement.scrollLeft + w.document.body.scrollLeft;		// clientX/Y
					res.y = w.event.screenY;// + w.document.documentElement.scrollTop  + w.document.body.scrollTop;
				}
			})
		}
		else {
			res.x = event.screenX + window.scrollX;		// event.clientX
			res.y = event.screenY + window.scrollY;		// event.clientY
		}
		return res;
	},

	forWindows: function(func) {
		func(window)
		var frames = document.getElementsByTagName("iframe")
		if (frames != null) {
			for(var i = 0; i < frames.length; i++) {
				func(frames[i].contentWindow);
			}
		}
	},

	cancelEvent: function(event) {
		if (this.isIE) {
			this.forWindows(function(w) {
				if (w.event) w.event.cancelBubble = true;
				if (w.event) w.event.returnValue = false;
			})
		}
		else {
			event.preventDefault();
		}
	},

	addEvent: function(event, func) {
		if (this.isIE) {
			this.forWindows(function(w) {
				w.document.attachEvent("on" + event, func);
			})
		}
		else {
			this.forWindows(function(w) {
				w.document.addEventListener(event, func, true);
			})
		}
	},

	onLoad: function(func, w) {
		if (!w) w = window;
		if (w.addEventListener) w.addEventListener("load", func, false);
		else if (w.attachEvent) w.attachEvent("onload", func);
	},

	removeEvent: function(event, func) {
		if (this.isIE) {
			this.forWindows(function(w) {
				w.document.detachEvent("on" + event, func);
			})
		}
		else {
			this.forWindows(function(w) {
				w.document.removeEventListener(event, func, true);
			})
		}
	},

	startDrag: function(event, on_drag, on_end, absolute_mode) {
		var init_pos = Browser.getCursorPos(event);
		var last_pos;

		var on_move = function(ev) {
			var t;
			if (!ev) ev = window.event;
			t = ev.target;
			if (!t) t = ev.srcElement;

			last_pos = Browser.getCursorPos(ev);
			if (!absolute_mode) last_pos.substract(init_pos);
			on_drag(last_pos, ev, t)
			Browser.cancelEvent(ev);
		}
		var on_release = function(event) {
			Browser.removeEvent("mousemove", on_move);
			Browser.removeEvent("mouseup", on_release);
			if (on_end) on_end(last_pos);
			Browser.cancelEvent(event);
		}
		Browser.addEvent("mousemove", on_move);
		Browser.addEvent("mouseup", on_release);
		Browser.cancelEvent(event);
	},

	startDragAbsolute: function(event, on_drag, on_end) {
		this.startDrag(event, on_drag, on_end, true);
	},

	getPos: function(obj) {
	    if (!obj) return 0;

	    var res = new Position();
		res.w = obj.offsetWidth;
		res.h = obj.offsetHeight;

	    if (this.isIE) {
	        var x = document.body.scrollLeft, y = document.body.scrollTop;
	        while(obj.offsetParent) {
	            x += obj.offsetLeft;
	            y += obj.offsetTop;
	            obj = obj.offsetParent;
	        }
	        res.x = x;
	        res.y = y;
	    }
	    else {
	    	/*if (this.version < 5) {
	            res.x = obj.x;
	            res.y = obj.y;
	            res.w = 600;
	            res.h = 60;
	            return res;
	        }
	        else*/ {
	            var x = 0, y = 0;
	            while(obj.offsetParent) {
	                x += obj.offsetLeft;
	                y += obj.offsetTop;
	                obj = obj.offsetParent;
	            }
	            res.x = x;
	            res.y = y;
	        }
	    }
	    return res;
	}
}

Browser.init()


var Utils = new Object();

Utils.addChild = function(el, tag, cl, win) {
	if (!tag) tag = "div";
	if (!win) win = window;
    if (!el) el = document.getElementsByTagName("body")[0];
    var b = win.document.createElement(tag);
	if (cl) b.className = cl;
	el.appendChild(b);
	return b;
}


Utils.getHeight = function(el) {
	return el.offsetHeight;
}

Utils.hide = function(el) {
	el.old_display = el.style.display;
	el.style.display = "none";
}

Utils.show = function(el) {
	var mode = el.old_display;
	if (!mode || mode == "none") mode = "block";
	el.style.display = mode;
}

Utils.isVisible = function(el) {
	return el.style.display != "none";
}

Utils.toggle = function(el) {
	if (this.isVisible(el)) {
		this.hide(el);
		return false;
	}
	else {
		this.show(el);
		return true;
	}
}

Utils.activate = function(last, el) {
	if (last) last.className = last.className.replace(/(^| )active/, "");
	if (el) {
        el.className += ' active';
        // Utils.toggleClass(el, 'active')
    }
	return el;
}

Utils.isActive = function(el) {
    return el.className.indexOf("active") >= 0;
}

Utils.removeClass = function(el, className) {
    var cls = el.className.split(" ");
    for(var i = 0; i < cls.length; i++) {
        if (cls[i] == className) {
            cls[i] = "";
            el.className = cls.join(" ");
            return true;
        }
    }
    return false;
}

Utils.toggleClass = function(el, className) {
    if (this.removeClass(el, className)) return false;
    else {
        el.className += ' ' + className;
        return true;
    }
}

Utils.setActive = function(active, el) {
	el = $(el);
	el.className = el.className.replace(/(^| )active/, "");
	if (active) el.className += ' active';
}

Utils.setFormFocus = function(el) {
	if (el.nodeName != "FORM") {
		el = el.getElementsByTagName("FORM")
		if (el) el = el[0];
	}
    for(var i = 0; i < el.length; i++) {
		var e = el.elements[i];
		if (e && (e.nodeName == "INPUT" || e.nodeName=="TEXTAREA")) {
			e.focus();
			break;
		}
	}
}

Utils.forElementsByClass = function(el, classname, on_each) {
	on_each(el);

	var classNames = el.className;
	if (0 && classnames) {
		classnames = classnames.split(' ');
	    for(var j = 0; j < classnames.length; j++) {
			if (classNames[j] == classname) {
				on_each(el);
				break;
			}
		}
	}

	var children = el.childNodes;
	if (!children) return;

	for (var i = 0; i < children.length; i++) {
		var ch = children[i];
		this.forElementsByClass(ch, classname, on_each);
	}
}

Utils.mix = function() {
	var str = arguments[0];
	str = str.replace(/%1/, arguments[1]);
	str = str.replace(/%2/, arguments[2]);
	str = str.replace(/%3/, arguments[3]);
	return str;
}

Utils.addOption = function(el, value, text) {
	var opt = document.createElement("option");
	opt.value = value;
	opt.text = text;
	if (Browser.isIE) el.add(opt, el.length);
	else el.add(opt, null);
}

Utils.selectOption = function(el_select, value) {
    if (el_select) {
        var opts = el_select.getElementsByTagName("OPTION");
        for(var i = 0; i < opts.length; i++) {
            if (opts[i].value == value) opts[i].selected = true;
        }
    }
}

//--- element, liste mit Tag-names -> Array mit Elementen des letzten Typs
Utils.getChildren = function(e) {
    for(var i = 1; i < arguments.length; i++) {
        var a = arguments[i];
        if (i > 1) e = e[0];
        if (!e) return new Array();
        e = e.getElementsByTagName(a);
    }
    return e;
}


var OptionGroup = function() {
	this.last = null;

	this.activate = function(el) {
		this.last = Utils.activate(this.last, el);
	}
}


var Position = function(x, y, w, h) {
	if (x instanceof Position) {
		this.x = x.x;
		this.y = x.y;
		this.w = x.w;
		this.h = x.h;
	}
	else {
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
	}

	this.setXY = function(x, y) {
		this.x = x;
		this.y = y;
	}

	this.setWH = function(w, h) {
		this.w = w;
		this.h = h;
	}

	this.set = function(pos, y, w, h) {
		if (arguments.length == 1) {
			this.x = pos.x;
			this.y = pos.y;
			this.w = pos.w;
			this.h = pos.h;
		}
		else {
			this.x = pos;
			this.y = y;
			if (this.w != null) this.w = w;
			if (this.h != null) this.h = h;
		}
	}

	this.substract = function(pos, y) {
		if (y == null) {
			this.x -= pos.x;
			this.y -= pos.y;
		}
		else {
			this.x -= pos;
			this.y -= y;
		}
	}

	this.add = function(pos, y) {
		if (y == null) {
			this.x += pos.x;
			this.y += pos.y;
		}
		else {
			this.x += pos;
			this.y += y;
		}
	}
}


var Popup = function(titlebar) {
	this.content = "[empty]"
	this.root = null
	this.titlebar = titlebar;
	this.pos = new Position(0, 0, 0, 0);
	this.has_shadow = true;
	this.bg = "#f4f4f4";
	this.is_dragable = true;
	this.is_resizeable = false;
	this.has_closer = false;
	this.popup_class = "sgx-popup";
	this.content_class = "sgx-content";
}

var shadow_img_path = "img/";

Popup.prototype.create = function(do_show) {
	if (this.root) return;

	var b = document.getElementsByTagName("body")[0];
	var resizer;
	var t = this;

	if (this.has_shadow && Browser.pngTransp) {
		this.root = Utils.addChild(b);
		var sh1 = Utils.addChild(this.root, "div", "sgx-sh-r");
		sh1.style.height = "100%";
		this.body = Utils.addChild(sh1, "div", "sgx-popup");
		var sh_b1 = Utils.addChild(this.root, "div", "sgx-sh-bl");
		var sh_b2 = Utils.addChild(this.root, "div", "sgx-sh-br");
		var sh_b3 = Utils.addChild(this.root, "div", "sgx-sh-b");
		if (this.is_resizeable) resizer = sh_b2;
	}
	else {
		this.root = Utils.addChild(b, "div", this.popup_class);
		this.body = this.root;
		if (this.has_shadow) this.body.className += " sgx-popup-no-shadow";
	}

	if (this.titlebar) {
		this.title_bar = Utils.addChild(this.body, "div", "sgx-titlebar")
		var closer = "";
		if (this.has_closer) {
			closer = "<a href='#' title='Schlie&szlig;en' class='sgx-title-closer'></a>";
		}
		this.title_bar.innerHTML = closer + this.titlebar;
		if (this.has_closer) {
			this.title_bar.childNodes[0].onmousedown = function() {
				t.hide();
			}
		}
		this.content_bar = Utils.addChild(this.body, "div", this.content_class)
	}
	else {
		this.content_bar = this.body;
	}
	with(this.root.style) {
		position = 'absolute';
		visibility = 'visible';
		if (!do_show) display = "none";
		left = this.pos.x + "px";
		top = this.pos.y + "px";
		if (this.pos.w) width = this.pos.w + "px";
		if (this.pos.h) height = this.pos.h + "px";
		zIndex = 5;
	}

	b.appendChild(this.root)
	this.setContent(this.content)
	if (this.bg) this.content_bar.style.background = this.bg;
	if (this.opacity) this.setOpacity(this.opacity);

	if (this.is_dragable) {
		var el = this.title_bar || this.content_bar;
		el.style.cursor = "move";
		el.onmousedown = function(event) {
			t.startDrag(event);
		}
		if (resizer) {
			resizer.style.cursor = "se-resize";
			resizer.onmousedown = function(event) {
				t.startResize(event);
			}
		}
	}
}

Popup.prototype.show = function() {
	if (!this.root) this.create(true);
	else Utils.show(this.root)
}

Popup.prototype.toggle = function() {
	if (!this.root) show();
	else Utils.toggle(this.root);
}


Popup.prototype.showAtCursor = function() {
	show()
}

Popup.prototype.focus = function() {
	Utils.setFormFocus(this.content_bar);
}

Popup.prototype.hide = function() {
    if (this.on_close) this.on_close(this);
	Utils.hide(this.root)
}

Popup.prototype.dispose = function() {
	if (this.root) {
        if (this.on_close) this.on_close(this);
		this.root.parentNode.removeChild(this.root)
		this.root = null;
	}
}

Popup.prototype.moveTo = function(p) {
	var pos = this.pos;
	pos.setXY(p.x, p.y)
	if (this.root) {
		this.root.style.left = pos.x + "px";
		this.root.style.top = pos.y + "px";
	}
}

Popup.prototype.setSize = function(w, h) {
	var pos = this.pos;
	if (w) pos.w = w;
	if (h) pos.h = h;
	if (this.root) {
		if (pos.w) this.root.style.width = pos.w + "px";
		if (pos.h) this.root.style.height = pos.h + "px";
	}
}

Popup.prototype.setContent = function(content) {
	this.content = content;
	if (this.content_bar) {
		this.content_bar.innerHTML = content;
		this.updateSize();
	}
}

Popup.prototype.updateSize = function(content) {
	this.pos.w = this.root.offsetWidth;
	this.pos.h = this.root.offsetHeight;
}

Popup.prototype.setBg = function(v) {
	this.bg = v;
	if (this.root) {
		this.content_bar.style.background = this.bg;
	}
}

Popup.prototype.setOpacity = function(op) {
	this.opacity = op;
	if (!this.root) return;

	with(this.root.style) {
		if (Browser.isIE) {
			filter = 'alpha(opacity:' + op + ')';
		}
		else if(Browser.isSafari) {
			opacity = op/100;
			KhtmlOpacity = op/100;
		}
		else if(Browser.isNS) {
			MozOpacity = op/100;
		}
   	}
}

Popup.prototype.startDrag = function(event) {
	var popup = this;
	var start_pos = new Position(this.pos);

	Browser.startDrag(event, function(pos) {
		pos.add(start_pos);
		popup.moveTo(pos)
	})
}

Popup.prototype.startResize = function(event) {
	var popup = this;
	var start_pos = new Position(this.pos.w, this.pos.h);

	Browser.startDrag(event, function(pos) {
		pos.add(start_pos);
		if (pos.x < 32) pos.x = 32;
		if (pos.y < 18) pos.y = 18;
		popup.setSize(pos.x, pos.y)
	})
}


var Debug = new Object();
Debug.on = false;

Debug.show = function() {
	this.win = window.open("", "Debug", "left=0,top=0,width=400,height=800,scrollbars=yes,status=yes,resizable=yes");
	if (this.win) {
		this.win.opener = self;
		this.win.document.open();
		this.win.document.write("<HTML><HEAD><TITLE>Debug Window</TITLE></HEAD><BODY><PRE>\n");
		this.on = true;
	}
}

Debug.clear = function() {
	this.win.document.close();
	this.win.document.open();
	this.win.document.write("<HTML><HEAD><TITLE>Debug Window</TITLE></HEAD><BODY><PRE>\n");
}

Debug.hide = function() {
	this.on = false;
	if (this.win && !this.win.closed) {
		this.win.close();
		this.win = null;
	}
}

Debug.wr = function(text) {
	if (this.win && !this.win.closed) {
		this.win.document.write(text + "\n");
	}
	else this.on = false;
}


Browser.onLoad(function() {
	var children = document.getElementsByTagName('*') || document.all;
	var elements = new Array();

	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var classNames = child.className.split(' ');
		for (var j = 0; j < classNames.length; j++) {
			var aug = augmentations[classNames[j]]
			if (aug) aug(child)
		}
	}
})


// element-id, diff to screen-size
function sgxAutoResize(element, dist)
{
	var min_height;
	var el;

	function setHeight()
	{
		// if (document.attachEvent) dist--;
		var h = sgxCalcWindowSize().h - dist;
		if (h < min_height) h = min_height;
		el.style.height = h + "px";
		return false
	}

	Browser.onLoad(function() {
		el = $(element);
		min_height = el.offsetHeight
		window.onresize = setHeight
		setHeight()
	})
}

var sgx_on_resize

function sgxOnResize(func)
{
	$onLoad(function() {
		sgx_on_resize = function() {
			func(true, sgxCalcWindowSize())
		}
		window.onresize = sgx_on_resize
		func(false, sgxCalcWindowSize())
	})
}


function regInlineInfo(name, info_text) {
	var el = $(name)
	el.onfocus = function() {
		if (el.value == info_text) {
			// if (el.was_pw) el.type = "password"
			el.style.color = "black"
			el.value = ""
		}
	}
	el.onblur = function() {
		if (el.value == "") {
			/*if (!is_ie && el.type == "password") {
				el.type = "text"
				el.was_pw = true
			}*/
			el.value = info_text
			el.style.color = "#aaa"
		}
	}
	el.value = ""
	el.onblur()
}




function Img(src1, src2) {
	this.src1 = src1;
	this.src2 = src2;
}

var js_imgs = {};

function lowlite(id) {
	$("img_" + id).src = js_imgs[id].src1;
}

function hilite(id) {
	$("img_" + id).src = js_imgs[id].src2;
}


