
function selectAllNone(blnArg, objCheckboxCollection){
	/*
		 This function through a named collection of checkboxes
		 checking or clearing all.
		 
		 Arguments:
		 boolean argument - true or false
		 named checkbox collection
		 
		 Example:
		<a href="#" onclick="selectAllNone(true, document.frmDelete.delete_ssid)" class="list1">check all</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onclick="selectAllNone(false, document.frmDelete.delete_ssid)" class="list1">check none</a>
	*/
	var intCheckboxes = objCheckboxCollection.length;
	if (intCheckboxes == undefined){
		objCheckboxCollection.checked = blnArg
	}else{
		for (i = 0; i <= intCheckboxes -1; i++) {
			objCheckboxCollection[i].checked = blnArg;
		}
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////

function doDelete(objCheckboxCollection, objForm){
	/*
		This function verifies and confirms a set of data to be deleted
		indicated by checked checkboxes on the form.
		
		Arguements:
		a checkbox collection
		
		Example:
		<a href="#" onclick="doDelete(document.frmDelete.delete_ssid, document.frmDelete)" class="list1">delete checked schedules</a>
	*/
	var blnItemsAreSelected = false;
	var intCheckboxes = objCheckboxCollection.length;
	if (intCheckboxes == undefined && objCheckboxCollection.checked == true){
		blnItemsAreSelected = true;
	}else{
		for (i = 0; i < intCheckboxes; i++) {
			if(objCheckboxCollection[i].checked == true){
				blnItemsAreSelected = true;
			}
		}
	}
	
	if(blnItemsAreSelected){
		if (confirm("Are you sure you want do delete these items?")){
			objForm.submit();
		}
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////

function spawnWindow(url, name, options){
	if (name == null){
		name = "spawned_window"
	}
	if (options == null){
		options = "width=513,height=300,top=50,left=100,resizable=yes,scrollbars=yes,menubar=no,status=no,toolbar=no"
	}
	// myWindow = window.open(url, name, "width=513,height=300,top=50,left=100,resizable=yes,scrollbars=yes,menubar=no,status=no,toolbar=no");
	myWindow = window.open(url, name, options);
}/////////////////////////////////////////////////////////////////////////////////////////////////

function mover(strMove){
	if(strMove == 'remove'){
		for(x = 0;x<(document.frmMyForm.lstAssigned.length);x++){
			if(document.frmMyForm.lstAssigned.options[x].selected){
				with(document.frmMyForm.lstAvailable){
					options[options.length] = new Option(document.frmMyForm.lstAssigned.options[x].text,document.frmMyForm.lstAssigned.options[x].value);
				}
				document.frmMyForm.lstAssigned.options[x] = null;
				x = -1;
			}
		}
	}

	if(strMove == 'add'){
		for(x = 0;x<(document.frmMyForm.lstAvailable.length);x++){
			if(document.frmMyForm.lstAvailable.options[x].selected){
				with(document.frmMyForm.lstAssigned){
					options[options.length] = new Option(document.frmMyForm.lstAvailable.options[x].text,document.frmMyForm.lstAvailable.options[x].value);
				}
				document.frmMyForm.lstAvailable.options[x] = null;
				x = -1;
			}
		}
	}
	return true;
}/////////////////////////////////////////////////////////////////////////////////////////////////

function selectAllOptions(objListBox){
	for(x = 0;x<(objListBox.length);x++){
		objListBox.options[x].selected = true;
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////

function limitLength(objInput, intMaxLength){
	/*
		This function sets the character limit
		on a textarea.  Pass the input object
		and the max length desired.
		
		Example:
		onkeyup="limitLength(this, 120);"
	*/
	var intTextLength = objInput.value.length;
	var strText = objInput.value;
	
	if(intTextLength > intMaxLength){
		objInput.value = strText.substr(0, intMaxLength);
		alert("Maximum length is "+ intMaxLength +" characters.");
		objInput.focus();
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////

function hiLight(fieldInput){
	if (fieldInput.type != "button"){
		fieldInput.style.background = "#ffff00"
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////

function unHiLight(fieldInput){
	if (fieldInput.type != "button"){
		fieldInput.style.background = "#ffffff"
	}
}/////////////////////////////////////////////////////////////////////////////////////////////////
