function jsCheckForm(aForm) {
	aForm.jsenabled.value = "true";
	return true;
}
function jsCheck() {
	document.seel.jsenabled.value = "true";
	return true;
}
function AddRep(coyRef, someCheckBox) {
	testRef = ":" + coyRef + ":";
	coyRef = coyRef + "::";
	var refIdx = document.seel.newcoys.value.indexOf(testRef);
	if ((someCheckBox.checked)&&(refIdx == -1)) {
		document.seel.newcoys.value = document.seel.newcoys.value + coyRef;
	} else if ((!someCheckBox.checked)&&(refIdx > -1)) {
		var newList = document.seel.newcoys.value.substring(0, refIdx);
		if ((refIdx + coyRef.length) < document.seel.newcoys.value.length) {
			newList = newList + document.seel.newcoys.value.substring(refIdx + testRef.length, document.seel.newcoys.value.length);
		}
		document.seel.newcoys.value = newList;
	}
	return true;
}
function Aktivieren(coyRef, someCheckBox) {
	testRef = ":" + coyRef + ":";
	coyRef = coyRef + "::";
	var refIdx = document.seel.newpdfs.value.indexOf(testRef);
	if ((someCheckBox.checked)&&(refIdx == -1)) {
		document.seel.newpdfs.value = document.seel.newpdfs.value + coyRef;
	} else if ((!someCheckBox.checked)&&(refIdx > -1)) {
		var newList = document.seel.newpdfs.value.substring(0, refIdx);
		if ((refIdx + coyRef.length) < document.seel.newpdfs.value.length) {
			newList = newList + document.seel.newpdfs.value.substring(refIdx + testRef.length, document.seel.newpdfs.value.length);
		}
		document.seel.newpdfs.value = newList;
	}
	return true;
}
function spawnSmallWindow(name, title, location, _height, _width) {
	window.open(location, name, "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=" + _width + ",height=" + _height)
	return false;
}
function spawnWindow(name, title, location, _height, _width) {
	if ((_height > 0) && (_width > 0 )) {
		window.open(location, name, "toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=no,resizable=yes,width=" + _width + ",height=" + _height)
	} else {
		window.open(location, name, "toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=no,resizable=yes")
	}
	if (location == '') {
		return true
	} else {
		return false;
	}
}
function closeWindow(){
	self.window.close();
}
function submitForm(avalue){
	document.seel.submit();
}


function check_for_nulls(message, input_1, input_2){

	var valid

	if ((input_1.value != "null" )||(input_2.value != "")){
		valid="true"
	}
	if (valid != "true"){
		alert(message)
		return false
	}else{
		return true
	}
}

function check_for_nulls_2(message, array){

	var valid

	for (i=0;i<=array.length;i++){

		if ((array[i].value != "null" )||(array[i].value != "")){
			valid="true"
		}
	}
	if (valid != "true"){
		alert(message)
		return false
	}else{
		return true
	}
}


function add_to_array(array,element){
	pushed = push(array, element)
}

function submitQuery(destination) {
	startpt = destination.indexOf('userID=')
	stoppt = destination.indexOf('&', startpt) + 1
	sortval = destination.substring(startpt, stoppt)
	destination = destination.replace(sortval, '')
	startpt = destination.indexOf('sort=')
	stoppt = destination.indexOf('&', startpt) + 1
	sortval = destination.substring(startpt, stoppt)
	destination = destination.replace(sortval, '')
	sortval = sortval.replace('sort=', '')
	sortval = sortval.replace('&', '')
	document.seel.sort.value = sortval
	document.seel.jsenabled.value = 'true'
	document.seel.action = destination
	document.seel.submit()
	return false
}

function asp_submitQuery(destination) {
	startpt = destination.indexOf('session_ID=')
	stoppt = destination.indexOf('&', startpt) + 1
	sortval = destination.substring(startpt, stoppt)
	destination = destination.replace(sortval, '')
	document.seel.jsenabled.value = 'true'
	document.seel.action = destination
	document.seel.submit()
	return false
}


// activate or deactivate all buttons for hard copies
function allhcActive(box, arrChecked) {

		var temp = new String();
		var temp2;

		if (box.name == "allhc") {
			if (box.checked == false)
				document.seel["allhc2"].checked = false;
			else
				document.seel["allhc2"].checked = true;
		}
		else {
			if (box.checked == false)
				document.seel["allhc"].checked = false;
			else
				document.seel["allhc"].checked = true;
		}

    	if (box.checked == false) {
    		for (x = 0; x < document.seel.length; x++) {
				temp2 = document.seel[x];
				temp = temp2.name;
    			if (temp.substring(0,3) == "tic") {
    				if (!(arrChecked[temp] == 1))
    					document.seel[temp].checked = false;
				}
    		}
    	}
    	else {
    		for (x = 0; x < document.seel.length; x++) {
				temp2 = document.seel[x];
				temp = temp2.name;
				arrChecked[temp] = 0;
    			if (temp.substring(0,3) == "tic") {
					if (document.seel[temp].checked == true)
						arrChecked[temp] = 1;
					else
    					document.seel[temp].checked = true;
				}
			}
    	}
}

// activate or deactivate all buttons for electronic copies
function allecActive(box, arrChecked) {

		var temp = new String();
		var temp2;

		if (box.name == "allec") {
			if (box.checked == false)
				document.seel["allec2"].checked = false;
			else
				document.seel["allec2"].checked = true;
		}
		else {
			if (box.checked == false)
				document.seel["allec"].checked = false;
			else
				document.seel["allec"].checked = true;
		}

    	if (box.checked == false) {
    		for (x = 0; x < document.seel.length; x++) {
				temp2 = document.seel[x];
				temp = temp2.name;
    			if (temp.substring(0,3) == "ele") {
    				if (!(arrChecked[temp] == 1))
    					document.seel[temp].checked = false;
				}
    		}
    	}
    	else {
    		for (x = 0; x < document.seel.length; x++) {
				temp2 = document.seel[x];
				temp = temp2.name;
				arrChecked[temp] = 0;
    			if (temp.substring(0,3) == "ele") {
					if (document.seel[temp].checked == true)
						arrChecked[temp] = 1;
					else
    					document.seel[temp].checked = true;
				}
			}
    	}
}

function selectActivate(objSelect, key) {

// PARAMETERS:
//		objSelect	 -> Object Reference to the list box
//		key			 -> The value in the list box that should be selected
	for (x = 0; x < objSelect.length; x++) {
		if (objSelect[x].type == "radio") {
			if (objSelect[x].value == key) {
				objSelect[x].checked = true;
			}
		}
		else {
			if (objSelect.options[x].value == key) {
				objSelect.selectedIndex = x;
			}
		}
	}

} // selectActivate
