function confirmSubmit()
{
  var agree=confirm("Are you sure you wish to delete the information from database ?");
  if (agree)
    return true ;
  else
    return false ;
}

function confirm2Submit()
{
	var agree1=confirm("Are you sure you wish to delete the information from database ?");
	if (agree1) {
		var agree2=confirm("Please click OK if you really want to remove the information from database");
		if (agree2)
			return true ;
		else
			return false;
	} else {
		return false ;
	}
}

function confirmDeleteFileNoFN()
{
	var agree1=confirm("Are you sure you wish to delete the file from folder?");
	if (agree1) {
		var agree2=confirm("Please click OK if you really want to remove the files from folder");
		if (agree2)
			return true ;
		else
			return false;
	} else {
		return false ;
	}
}

function confirmDeleteFile(filename)
{
  var agree=confirm("Are you sure you wish to delete the file from folder?\nFilename : " + filename);
  if (agree)
    return true ;
  else
    return false ;
}

function confirmNotInList(item)
{
  var agree=confirm("\' " + item + " \' is not in list. Would you like to add it in the list?");
  if (agree)
    return true ;
  else
    return false ;
}

function confirmNotInList(item, newlist)
{
	if (newlist == 1)	{	// if the item is not in list
		var agree=confirm("\' " + item + " \' is not in list. Would you like to add it in the list?");
		if (agree) {
			alert("new list - New data inserted");
			return true ;
		} else {
			alert("new list - New data has NOT been added. Please enter data again");
			return false ;
		}
	}
	return true;
}

function confirmNotInListTwo(item1, item2, newlist1, newlist2)
{
	var agree;
	if (newlist1 == 1)	{	// if the item1 is not in list
		if (newlist2 == 1)	{	// if the item2 is not in list
			agree=confirm("\"" + item1 + "\" and \"" +  item2 + "\" is not in list.\nWould you like to add it in the list?");
			if (agree) {
				alert("new list - New data \"" + item1 + "\" and \"" + item2 + "\" have been inserted");
				return true ;
			} else {
				alert("new list - New data has NOT been added. Please enter data again");
				return false ;
			}
		} else {
			agree=confirm("\"" + item1 + "\" is not in list.\nWould you like to add it in the list?");
			if (agree) {
				alert("new list - New data \"" + item1 + "\" has been inserted");
				return true ;
			} else {
				alert("new list - New data has NOT been added. Please enter data again");
				return false ;
			}
		}
	} else {
		if (newlist2 == 1)	{	// if the item is not in list
			agree=confirm("\"" + item2 + " \" is not in list. Would you like to add it in the list?");
			if (agree) {
				alert("new list - New data \"" + item2 + "\" has been inserted");
				return true ;
			} else {
				alert("new list - New data has NOT been added. Please enter data again");
				return false ;
			}
		} else {
			//alert("Already in list - Skip over");
			return true;
		}
	}
}

function confirmNotInListThree(item2, item3, item4, newlist2, newlist3, newlist4)
{
	var agree;
	if (newlist2 == 1)	{	// if the item2 is not in list
		if (newlist3 == 1)	{	// if the item3 is not in list
			if (newlist4 == 1)	{	// if the item1, item2, item3, item4 are not in list
				agree=confirm("\""+item2+"\", \""+item3+"\", and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item2+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			} else {	// if the item2, item3 are not in list
				agree=confirm("\""+item2+"\", and \""+item3+"\" are not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item2+"\", and \""+item3+"\" have been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			}
		} else {
			if (newlist4 == 1)	{	//if the item2, item4 are not in list
				agree=confirm("\""+item2+"\", and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item2+"\", and \""+item4+"\" have been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			} else {	//if the item2 are not in list
				agree=confirm("\""+item2+"\" is not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item2+"\" has been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			}
		}
	} else {	// if item2 is in list
		if (newlist3 == 1)	{
			if (newlist4 == 1)	{	// if the item3, item4 are not in list
				agree=confirm("\""+item3+"\", and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item3+"\", and \""+item4+"\" have been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			} else {	// if the item3 are not in list
				agree=confirm("\""+item3+"\" is not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item3+"\" has been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			}
		} else {
			if (newlist4 == 1)	{	//if the item4 are not in list
				agree=confirm("\""+item4+"\" is not in list.\nWould you like to add them in the list?");
				if (agree) {
					alert("new list - New data \""+item4+"\" has been inserted");
					return true ;
				} else {
					alert("new list - New data has NOT been added. Please enter data again");
					return false ;
				}
			} else {	//All in the list
				return true;
			}
		}
	}			
}

function confirmNotInListFour(item1, item2, item3, item4, newlist1, newlist2, newlist3, newlist4)
{
	var agree;
	if (newlist1 == 1)	{	// if the item1 is not in list
		if (newlist2 == 1)	{	// if the item2 is not in list
			if (newlist3 == 1)	{	// if the item3 is not in list
				if (newlist4 == 1)	{	// if the item1, item2, item3, item4 are not in list
					agree=confirm("\""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	// if the item1, item2, item3 are not in list
					agree=confirm("\""+item1+"\", \""+item2+"\", and \""+item3+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", \""+item2+"\", and \""+item3+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			} else {
				if (newlist4 == 1)	{	//if the item1, item2, item4 are not in list
					agree=confirm("\""+item1+"\", \""+item2+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", \""+item2+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	//if the item1, item2 are not in list
					agree=confirm("\""+item1+"\", and \""+item2+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", and \""+item2+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			}
		} else {	// if item2 is in list
			if (newlist3 == 1)	{
				if (newlist4 == 1)	{	// if the item1, item3, item4 are not in list
					agree=confirm("\""+item1+"\", \""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	// if the item1,item3 are not in list
					agree=confirm("\""+item1+"\", and \""+item3+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", and \""+item3+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			} else {
				if (newlist4 == 1)	{	//if the item1, item4 are not in list
					agree=confirm("\""+item1+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	//if the item1 is not in list
					agree=confirm("\""+item1+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item1+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			}
		}			
	} else {
		if (newlist2 == 1)	{
			if (newlist3 == 1)	{
				if (newlist4 == 1)	{	// if item2, item3, item4 are not in list
					agree=confirm("\""+item2+"\", \""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item2+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	// if item2, item3 are not in list
					agree=confirm("\""+item2+"\", and \""+item3+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item2+"\", and \""+item3+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			} else {
				if (newlist4 == 1)	{	//if item2, item4 are not in list
					agree=confirm("\""+item2+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item2+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	//if item2 are not in list
					agree=confirm("\""+item2+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item2+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			}
		} else {	// if item2 is in list
			if (newlist3 == 1)	{
				if (newlist4 == 1)	{	// if item3, item4 are not in list
					agree=confirm("\""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item3+"\", and \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {	// if item3 is not in list
					agree=confirm("\""+item3+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item3+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				}
			} else {
				if (newlist4 == 1)	{	//if item4 is not in list
					agree=confirm("\""+item4+"\" is not in list.\nWould you like to add them in the list?");
					if (agree) {
						alert("new list - New data \""+item4+"\" have been inserted");
						return true ;
					} else {
						alert("new list - New data has NOT been added. Please enter data again");
						return false ;
					}
				} else {
					return true;
				}
			}
		}	
	}
}

function confirmNotInListFive(item1, item2, item3, item4, item5, newlist1, newlist2, newlist3, newlist4, newlist5)
{
	var agree;
	if (newlist1 == 1)	{	// if the item1 is not in list
		if (newlist2 == 1)	{	// if the item2 is not in list
			if (newlist3 == 1)	{	// if the item3 is not in list
				if (newlist4 == 1)	{	// if the item1, item2, item3, item4 are not in list
					if (newlist5 == 1)	{	// if the item1, item2, item3, item4, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if the item1, item2, item3, item4 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else { 
					if (newlist5 == 1)	{	//if the item1, item2, item3, and item 5 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item5+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", \""+item3+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	//if the item1, item2, item3 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", and \""+item3+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", and \""+item3+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			} else {	// if item3 is in list
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if the item1, item2, item4, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", \""+item4+"\", and \""+item5+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if the item1,item2, itemn4 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
						alert("new list - New data \""+item1+"\", \""+item2+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else { 		// item3, item4 are in the list
					if (newlist5 == 1)	{	//if the item1, item2, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item2+"\", and \""+item5+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item2+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// item3, item4, item5 are in the list
						agree=confirm("\""+item1+"\" and \""+item2+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\" and \""+item2+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			}			
		} else {		// item2 is in the list
			if (newlist3 == 1)	{
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if item1, item3, item4, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item1, item3, item4are not in list
						agree=confirm("\""+item1+"\", \""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else {	// item4 is in the list
					if (newlist5 == 1)	{	// if item1, item3, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item3+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item3+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// item2, item4, item5 are in the list
						agree=confirm("\""+item1+"\" and \""+item3+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\" and \""+item3+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			} else {	// item2, item3 is in list
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if item1, item4, item5 are not in list
						agree=confirm("\""+item1+"\", \""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item1, item4 are not in list
						agree=confirm("\""+item1+"\" and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\" and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else {	// item2, item3, item4 are in the list
					if (newlist5 == 1)	{	//if item1, item5 are not in the list
						agree=confirm("\""+item1+"\" and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\" and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item1 is not in the list
						agree=confirm("\""+item1+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item1+"\" has been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			}	
		}
	} else {	// item1 is in the list
		if (newlist2 == 1)	{	// if the item2 is not in list
			if (newlist3 == 1)	{	// if the item3 is not in list
				if (newlist4 == 1)	{	// if item2, item3, item4 are not in list
					if (newlist5 == 1)	{	// if item2, item3, item4, item5 are not in list
						agree=confirm("\""+item2+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", \""+item3+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item2, item3, item4 are not in list
						agree=confirm("\""+item2+"\", \""+item3+"\", and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", \""+item3+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else { 
					if (newlist5 == 1)	{	//if item2, item3, and item 5 are not in list
						agree=confirm("\""+item2+"\", \""+item3+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", \""+item3+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	//if item2, item3 are not in list
						agree=confirm("\""+item2+"\", and \""+item3+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", and \""+item3+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			} else {	// if item3 is in list
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if item2, item4, item5 are not in list
						agree=confirm("\""+item2+"\", \""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item2, item4 are not in list
						agree=confirm("\""+item2+"\", and \""+item4+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
						alert("new list - New data \""+item2+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else { 		// item3, item4 are in the list
					if (newlist5 == 1)	{	//if the item1, item2, item5 are not in list
						agree=confirm("\""+item2+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// item3, item4, item5 are in the list
						agree=confirm("\""+item2+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item2+"\" has been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			}			
		} else {		// item2 is in the list
			if (newlist3 == 1)	{
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if item1, item3, item4, item5 are not in list
						agree=confirm("\""+item3+"\", \""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item3+"\", \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item1, item3, item4are not in list
						agree=confirm("\""+item3+"\", and \""+item4+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item3+"\", and \""+item4+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else {	// item4 is in the list
					if (newlist5 == 1)	{	// if item1, item3, item5 are not in list
						agree=confirm("\""+item3+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item3+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// item2, item4, item5 are in the list
						agree=confirm("\""+item3+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item3+"\" has been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				}
			} else {	// item2, item3 is in list
				if (newlist4 == 1)	{
					if (newlist5 == 1)	{	// if item1, item4, item5 are not in list
						agree=confirm("\""+item4+"\", and \""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item4+"\", and \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {	// if item1, item4 are not in list
						agree=confirm("\""+item4+"\" is not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item4+"\" has been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					}
				} else {	// item2, item3, item4 are in the list
					if (newlist5 == 1)	{	//if item1, item5 are not in list
						agree=confirm("\""+item5+"\" are not in list.\nWould you like to add them in the list?");
						if (agree) {
							alert("new list - New data \""+item5+"\" have been inserted");
							return true ;
						} else {
							alert("new list - New data has NOT been added. Please enter data again");
							return false ;
						}
					} else {
						return true;
					}
				}
			}	
		}
	}
}	


function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	}
	return true;
}

function notEmptyTwoInput(elem1, elem2, msg1, msg2){
	if(elem1.value.length == 0){
		if(elem2.value.length == 0){
			alert("Please Enter " + msg1 + " and " + msg2);
			elem1.focus();
			return false;
		} else {
			alert("Please Enter " + msg1);
			elem1.focus();
			return false;
		}
	} else {
		if(elem2.value.length == 0){
			alert("Please Enter " + msg2);
			elem2.focus();
			return false;
		} else {
			return true;
		}
	}
}


function notEmptyTwo(elem1, elem2, helperMsg){
	if(elem1.value.length == 0){
		if(elem2.value.length == 0){
			alert(helperMsg);
			elem1.focus();
			return false;
		} else {
			alert(helperMsg);
			elem1.focus();
			return false;
		}
	} else {
		if(elem2.value.length == 0){
			alert(helperMsg);
			elem2.focus();
			return false;
		} else {
			return true;
		}
	}
}

function notEmptyThree(elem1, elem2, elem3, helperMsg){
	if(elem1.value.length == 0){
		if(elem2.value.length == 0){
			if(elem3.value.length == 0){
				alert(helperMsg);
				elem1.focus();
				return false;
			} else {
				alert(helperMsg);
				elem1.focus();
				return false;
			}
		} else {
			if(elem3.value.length == 0){
			alert(helperMsg);
				elem1.focus();
				return false;
			} else {
				return false;
			}
		}
	} else {
		if(elem2.value.length == 0){
			if(elem3.value.length == 0){
				alert(helperMsg);
				elem2.focus();
				return false;
			} else {
				alert(helperMsg);
				elem2.focus();
				return false;
			}
		} else {
			if(elem3.value.length == 0){
			alert(helperMsg);
				elem3.focus();
				return false;
			} else {
				return true;
			}
		}
	}
}

function notEmptyThreeAndVerifyPWD(elem1, elem2, elem3, helperMsg, pwdmismatch){
	if(elem1.value.length == 0){
		if(elem2.value.length == 0){
			if(elem3.value.length == 0){
				alert(helperMsg);
				elem1.focus();
				return false;
			} else {
				alert(helperMsg);
				elem1.focus();
				return false;
			}
		} else {
			if(elem3.value.length == 0){
			alert(helperMsg);
				elem1.focus();
				return false;
			} else {
				return false;
			}
		}
	} else {
		if(elem2.value.length == 0){
			if(elem3.value.length == 0){
				alert(helperMsg);
				elem2.focus();
				return false;
			} else {
				alert(helperMsg);
				elem2.focus();
				return false;
			}
		} else {
			if(elem3.value.length == 0){
				alert(helperMsg);
				elem3.focus();
				return false;
			} else {
				if(elem2.value == elem3.value) {
					return true;
				} else {
					alert(pwdmismatch);
					elem2.focus();
					return false;
				}
			}
		}
	}
}

function notEmptyFour(elem1, elem2, elem3, elem4, helperMsg){
	
	if(elem1.value.length == 0){
		if(elem2.value.length == 0){
			if(elem3.value.length == 0){
				if(elem4.value.length == 0){
					alert(helperMsg);
					elem1.focus();
					return false;
				} else {
					alert(helperMsg);
					elem1.focus();
					return false;
				}
			} else {
				if(elem4.value.length == 0){
					alert(helperMsg);
					elem1.focus();
					return false;
				} else {
					alert(helperMsg);
					elem1.focus();
					return false;
				}
			}			
		}
		else {
			if(elem3.value.length == 0){

				if(elem4.value.length == 0){
					alert(helperMsg);
					elem1.focus();
					return false;
				} else {
					alert(helperMsg);
					elem1.focus();
					return false;
				}
			} else {
				if(elem4.value.length == 0){
					alert(helperMsg);
					elem1.focus();
					return false;
				} else {
					alert(helperMsg);
					elem1.focus();
					return false;
				}
			}
		}
	} else {
		if(elem2.value.length == 0){

			if(elem3.value.length == 0){

				if(elem4.value.length == 0){
					alert(helperMsg);
					elem2.focus();
					return false;
				} else {
					alert(helperMsg);
					elem2.focus();
					return false;
				}
			} else {
				if(elem4.value.length == 0){
					alert(helperMsg);
					elem2.focus();
					return false;
				} else {
					alert(helperMsg);
					elem2.focus();
					return false;
				}
			}			
		}
		else {
			if(elem3.value.length == 0){

				if(elem4.value.length == 0){
					alert(helperMsg);
					elem3.focus();
					return false;
				} else {
					alert(helperMsg);
					elem3.focus();
					return false;
				}
			} else {
				if(elem4.value.length == 0){
					alert(helperMsg);
					elem4.focus();
					return false;
				} else {
					return true;
				}
			}
		}
	}
}