function hilfe(i) {
    querywindow = window.open("hilfe.php?i=" + i, '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=460,height=561');
    return false;
}


function zeigeagb() {
    querywindow = window.open("agb.php", '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=460,height=561');
    return false;
}


function zeigetermin(id, kategorie) {
    if (typeof(kategorie) == 'undefined')
        kategorie = '';
    querywindow = window.open("termin.php?id=" + id + "&kategorie=" + escape(kategorie), '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=460,height=561');
    return false;
}


function getObj(objName) {
    if (document.getElementById && document.getElementById(objName) != null)
        return document.getElementById(objName);
    else if (document.all)
        return document.all[objName];
	else
		return null;
}


function selectOption(dd, value) {
    for (var n = 0; n < dd.options.length; n++) {
        if (dd.options[n].value == value) {
            dd.options.selectedIndex = n;
            return true;
        }
    }

    return false;
}


function validId(str) {
    return str.replace(/[^0-9A-Za-z_]/g, '');
}


function priceformat(v) {
	if (v == '')
		v = 0;
	var str = "" + Math.round(100 * v);
	while (str.length <= 2)
		str = "0" + str;
	var euro = str.slice(0, -2);
	var pf = str.substring(str.length - 2, str.length);
	while (pf.length < 2)
		pf = pf + "0";

	if (pf == '00')
		pf = '-';

	return euro + ',' + pf + ' Euro';
}