function refreshParent() {
    var parentManager;
    var parentLocation;

    parentManager = window.opener;
    parentLocation = parentManager.location;
    parentLocation.reload();

    window.close();
}

function IsNumeric(InString, ValidString)
      {
        var IsNumericFlag = true
        RefString     = ValidString;
        DecimalPoints = 0;
        
        if (InString == "") {
			IsNumericFlag = false
		}
		else {
		    for (i=0; i<InString.length; i++)
			{
				TempChar = InString.substring ( i, i+1 );
				if ( TempChar == "." ) { DecimalPoints++; } /* Can only have zero or one decimal point in a number */
				if (( TempChar == "-" ) && ( i != 0 )) IsNumericFlag = false /* If the hyphen is not in the first pos. */
				/* Check if current character is valid */
				if ( RefString.indexOf (TempChar,0) == -1)
				{ 
					/* character not found in RefString */
					IsNumericFlag = false;
				} 
			}
			if ( DecimalPoints > 1 ) IsNumericFlag = false
        }
        return IsNumericFlag;
      } 

function confirmInsert() {
	if (confirm("Are you sure you want to add this record into the database?\n\nIf you are sure Click OK to Continue."  )) {
		return true; 
	}
	else 
		return false;
}

function confirmCancel() {
	if (confirm("Are you sure you want to Cancel?\n\nIf you are sure Click OK to Continue."  )) {
		return true; 
	}
	else 
		return false;
}

function confirmDelete() {
	if (confirm("Are you sure you want to delete this record from the database?\n\nIf you are sure Click OK to Continue."  )) {
		return true;
	}
	else 
		return false;
}

function confirmUpdate() {
	if (confirm("Are you sure you want to update this record?\n\nIf you are sure Click OK to Continue."  )) {
		return true;
	}
	else 
		return false;
}

function confirmReset() {
	if (confirm("Are you sure you want to Reset?\n\nIf you are sure Click OK to Continue."  )) {
		return true; 
	}
	else 
		return false;
}

function openMoreInfoWin(id, w, h) {
	window.open(id,'','status=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+'');
}

function confirmAccept() {
	if (confirm("Are you sure you want to accept?\n\nIf you are sure Click OK to Continue."  )) {
		return true;
	}
	else 
		return false;
}

function confirmDecline() {
	if (confirm("Are you sure you want to decline?\n\nIf you are sure Click OK to Continue."  )) {
		return true;
	}
	else 
		return false;
}

function confirmCopy() {
	if (confirm("Are you sure you want to copy this record?\n\nIf you are sure Click OK to Continue."  )) {
		return true;
	}
	else 
		return false;
}

function changeTo(strColor){
	highlightcolor = strColor
	source=event.srcElement
	if (source.tagName=="TR"||source.tagName=="TABLE"){
		return
	}
	while(source.tagName!="TD"){
		source=source.parentElement
	}
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore"){
		source.parentElement.style.backgroundColor=highlightcolor
	}
}

function changeBack(strColor){
	originalcolor = strColor
	if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore"){
		return
	}
	if (event.toElement!=source){
		source.parentElement.style.backgroundColor=originalcolor
	}
}
		
function linkTo(url){
	source=event.srcElement
	if (source.id!="ignore"){
		window.location = url
	}
}
