<!--

/**
 * associationWindow.js
 * by Kurt Freytag
 * js component for opening filesystemWindow
 */

function newFolderWindow() {

  filesystemWin = window.open("", "filesystemWindow", "scrollbars=no,status=no,width=250,height=150");

  if (!filesystemWin.opener) {
    filesystemWin.opener=self;
  }
}

function newBookmarkWindow() {

  bookmarkWin = window.open("", "bookmarkWindow", "scrollbars=no,status=no,width=250,height=350");

  if (!bookmarkWin.opener) {
    bookmarkWin.opener=self;
  }
}

function newMoveWindow(myUrl) {

  bookmarkWin = window.open(myUrl, "bookmarkWindow", "scrollbars=no,status=no,width=250,height=350");

  if (!bookmarkWin.opener) {
    bookmarkWin.opener=self;
  }

}

function validateMove() {
	if (document.idsForm.actionIds == null) {
		alert('Please select the item(s) you wish to move.');
		return false;
	} else if (document.idsForm.actionIds.length == null) {
		if (document.idsForm.actionIds.checked != true) {
			alert('Please select the item(s) you wish to move.');
			return false;
		} else {
			return true;
		}
	} else {
		numSelected = 0;
		for (var i = 0; i < document.idsForm.actionIds.length; i++) {
			if (document.idsForm.actionIds[i].checked == true) {
				numSelected++;
			}
		}
		if (numSelected == 0) {
			alert ('Please select the item(s) you wish to move.');
			return false;
		} else {
			return true;
		}
	}

	alert (document.idsForm.action);
	return false;
}

function confirmBookmarkDelete() {
	if (document.idsForm.actionIds == null) {
		alert('Please select the item(s) you wish to delete.');
		return false;
	} else if (document.idsForm.actionIds.length == null) {
		if (document.idsForm.actionIds.checked != true) {
			alert('Please select the item(s) you wish to delete.');
			return false;
		} else {
				return (confirm('Are you sure you want to delete this item?'));
		}
	} else {
		numSelected = 0;
		for (var i = 0; i < document.idsForm.actionIds.length; i++) {
			if (document.idsForm.actionIds[i].checked == true) {
				numSelected++;
			}
		}
		if (numSelected == 0) {
			alert ('Please select the item(s) you wish to delete.');
			return false;
		} else if (numSelected == 1) {
			return (confirm ('Are you sure you want to delete this item?'));
		} else {
			return (confirm ('Are you sure you want to delete these items?'));
		}
	}
}

// -->
