var win= null;
function NewWindow(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'
	win=window.open(mypage,myname,settings)
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function ChkDelete(theForm,Element,Text){
	ElementStr = "document." + theForm + "." + Element + ".selectedIndex"
	IDNum = eval(ElementStr)
	if (IDNum >= 0){
		var ConfirmDelete = window.confirm("Are you Sure you want to Delete this " + Text + "? \nNOTE: THIS CANNOT BE UNDONE! \n\nClick 'OK' to Confirm... \nClick 'Cancel' to Change your Mind...")
		if (ConfirmDelete) {return true}
		else {return false}
	}
	return true
}

function ChkDeleteLink(Text){
	var ConfirmDelete = window.confirm("Are you Sure you want to Delete this " + Text + "? \nNOTE: THIS CANNOT BE UNDONE! \n\nClick 'OK' to Confirm... \nClick 'Cancel' to Change your Mind...")
	if (ConfirmDelete) {return true}
	else {return false}
	return true
}
		
function Validate(theForm,Element,Action,Text){
	ElementStr = "document." + theForm + "." + Element + ".selectedIndex"
	IDNum = eval(ElementStr)
	if (IDNum < 0){
		alert("No " + Text + " was Selected!")
		return false
	}
	if (Action == 'Delete') {
		return ChkDelete(theForm,Element,Text)
	}
}		

function SetFocus(ctl) {
	ctl.focus();
}

function validateRemarksLength(frm,ctl,len){
	if (eval('document.' + frm + '.' + ctl + '.innerText.length') > len) {
		alert("Remarks cannot exceed " + len + " characters!");
		eval('document.' + frm + '.' + ctl + '.focus()')
		return false;
	}
}

function Post(frmName){
	eval('document.' + frmName + '.submit();')
}
