var ns = (navigator.appName == "Netscape") ? true : false;

function changeCustomer(form, obj) {
	if (obj.value > 0) {
		window.location.href = '/hosting/index.php?customer='+obj.value;
	}
	else if (obj.value < 0) {
		window.location.href = '/customer/index.php?edit=0';
	}
}

/*
 * bestätigen ob eintrag gelöscht werden soll
 */
function confDelete(url, qString) {
	if (confirm("Wollen Sie diesen Eintrag wirklich löschen?")) {
		document.location = url + "?" + qString;
	}
}

/**
 * Open a new popup window
 */





function openView(url) {
var pwin = open(url,'pwin','menubar=no,resizable=no,scrollbars=no,width=730,height=415');
pwin.focus();
}

/**
 * Open a new popup window
 */

function opennew( url, nrOfPicture, name)
	{
	var height = 600;
		
	name = window.open( url , name ,'resizable=yes,width=800 ,height=' + height +',toolbar=no,location=no,menubar=no,status=yes,scrollbars = '+ scroll);
	//Öffnen eines neuen Fensters ohne Toolbar, Statusleiste,....
	}

/**
 * Add an entry to an option list (SELECT-Tag)
 */
function addOptionEntry(form, opt, val, field) {
    var entryFound = false;
    
    if (val == '') {
        alert("A value must be specified.");
        return;
    }
    
    for (var i = 0; i < form[opt].length; i++) {
        if (val == form[opt].options[i].value) {
            entryFound = true;
            break;
        }
    }
    if (!entryFound) {
        if (ns) {
            newOpt = new Option(val, val, false, false);
            form[opt].options[form[opt].length] = newOpt;

            // remove dummy entry
            if (form[opt].options[0].value.charAt(0) == '') {
                form[opt].options[0] = null;
            }
            form[opt].options[form[opt].length-1].selected = false;
        }
        else {
            newOpt = document.createElement("OPTION");
            newOpt.value = val;
            newOpt.text = val;
			field.value = '';
            form[opt].options.add(newOpt);
            
            // remove dummy entry
            if (form[opt].options[0].value.charAt(0) == '') {
                form[opt].options.remove(0);
            }
        }
        form[opt].options[form[opt].length-1].selected = true;
    }
}