var rc="";
function chkIE() {if (document.all) {(rc);return false;}}
function chkNS(e) {if (document.layers ||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(rc);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=chkNS;}
else{document.onmouseup=chkNS;document.oncontextmenu=chkIE;}
document.oncontextmenu=new Function("return false")

var win= null;
function PopWindow(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'
	if ((!win)||(win.closed)){
		var win=window.open(mypage,myname,settings)
		if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
	}
}
function PopBrowser(mypage,myname,w,h){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,dependent=no'
	if ((!win)||(win.closed)){
		var win=window.open(mypage,myname,settings)
		if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
	}
}

function setOpenerPage(pageName) {
	window.opener.location.href = pageName;
	window.close();
}


function SetFocus(ctl) {
	ctl.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 IsChild() {
	var winParent = new Object;
	winParent = window.opener;
	if (winParent == null) {
		return false;
	} else {
		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 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;
	}
}




