<!--
function htmToggleDisplay(eId,aId) {
// November 1, 2007. Edgar R. Ogando 
	if (eId != '') {
		aSet[aId] = (typeof(aSet[aId]) == 'undefined') ? 'undefined': aSet[aId];
		if (eId != aSet[aId]) {
			document.getElementById(eId).style.display = 'block';
		}
		if (aSet[aId] != 'undefined' && eId != aSet[aId]) {
			document.getElementById(aSet[aId]).style.display = 'none';
		}
		aSet[aId] = eId;
	}
}
aSet = new Array();
//

function winNewOnload(newOnload) {
// June 21, 2008. Edgar R. Ogando 
// *Based on Simon Willison’s addLoadEvent()
// *http://simonwillison.net/2004/May/26/addLoadEvent/
var oldOnload = window.onload;
	if (typeof window.onload != 'function') {
	window.onload = newOnload;
	} else {
		window.onload = function() {
		if (oldOnload) {
		oldOnload();
		}
		newOnload();
		}
	}
}
//

function cssButtonsHover() {
// June 20, 2008. Edgar R. Ogando 
	var buttonsHovers = document.getElementsByTagName('input');
	for (var i = 0; i < buttonsHovers.length; i++) {
		if (buttonsHovers[i].className == "button") {
		buttonsHovers[i].onmouseover=new Function("this.className = 'buttonhover';");
		buttonsHovers[i].onmouseout=new Function("this.className = 'button';");
		}
	}
}
winNewOnload(cssButtonsHover);
//

function frmActionChange(formObj,action) {
// March 13, 2008. Edgar R. Ogando 
formObj.action = action;
}
//

function frmDialogReturn(messageTxt) {
// February 18, 2008. Edgar R. Ogando 
	if (confirm(messageTxt)) { 
		return true;
	} else {
		return false;
	}
}
//

function frmInputFilter(inputObj,eventObj,filterRef) {
// February 07, 2008. Edgar R. Ogando 
if (!eventObj) var eventObj = window.event;
var charCode = (eventObj.which) ? eventObj.which : eventObj.keyCode;
var inputKey = String.fromCharCode(charCode);
var keyCodes = new Array(8,37,38,39,40);
	switch(filterRef) {
		case "numeric":
		filterRef = /^[0-9.,\-]$/
		break;
		case "natural":
		filterRef = /^[1-9]$/
		break;
		case "cardinal":
		filterRef = /^[0-9]$/
		break;
		case "integer":
		filterRef = /^[0-9\-]$/
		break;
		case "float":
		filterRef = /^[0-9.\-]$/
		break;
		case "point":
		filterRef = /^[0-9.]$/
		break;
		case "string":
		filterRef = /^[\w\-]$/
		break;
		default:
	}
	for(c=0;c<keyCodes.length;c++) {
		if (keyCodes[c] == charCode) {
			return true;
			break;
		}
	}
	if (filterRef.test(inputKey)) {
		return true;
	}
return false;
}
//

function frmInputClear(inputObj,repeat) {
// February 07, 2008. Edgar R. Ogando
var repeat = repeat;
	if (typeof frmInputClearNot == "undefined") {
		frmInputClearNot = new Array();
	}
	if (repeat == false) {
	var repeat = true;
		for (i=0; i<frmInputClearNot.length; i++) {
			if (frmInputClearNot[i] == inputObj.id) {
			var repeat = false;
			break;
			} 
		}
		if (repeat == true) {
		frmInputClearNot.push(inputObj.id);
		}
	}
	if (repeat == true) {
		inputObj.value = '';
	}
}
//

function frmSelectChange(selectId,groupId) {
// February 06, 2008. Edgar R. Ogando 
var selectObj = document.getElementById(selectId);
selectObj.options.length=0
	if (frmSelectChangeGroups[groupId] != undefined) {
		for (i=0;i<frmSelectChangeGroups[groupId].length;i++) {
			optionObj = frmSelectChangeGroups[groupId][i];
			selectObj.options[i]=new Option(optionObj.txt,optionObj.val,optionObj.def,optionObj.sel)
		}
	} else {
		optionObj = frmSelectChangeGroups['DEFAULT'][0];
		selectObj.options[0]=new Option(optionObj.txt,optionObj.val,optionObj.def,optionObj.sel)
	}
}
function frmSelectChangeOption(txt,val,def,sel) {
	this.txt = txt;
	this.val = val;
	this.def = def; // BOOLEAN defaultSelected
	this.sel = sel; // BOOLEAN selected
}
var frmSelectChangeGroups = new Array();
frmSelectChangeGroups['DEFAULT'] = new Array();
frmSelectChangeGroups['DEFAULT'].push(new frmSelectChangeOption('-','',true,true));
//

function newWindow(winURL,winNAME,winFEAT,winREF) {
// August 08, 2006. October 15, 2007, Edgar R. Ogando
// winObjRef = window.open( URL, name [ , features [, replace ] ] )
// Features: toolbar=0|1, location=0|1, directories=0|1, status=0|1, menubar=0|1, scrollbars=0|1, resizable=0|1, width=pixels, height=pixels, top=pixels, left=pixels ; 0|1 or yes|no
winObjRef = window.open(winURL,winNAME,winFEAT);
	if (winREF != "") {
	eval(winREF+" = winObjRef;");
		if (winObjRef && winObjRef.open && !winObjRef.closed) {
			return true;
		} else {
			return false;
		}
	}
}
//

function newImageWindow(imgSRC,imgWIDTH,imgHEIGHT,winTITLE,winNAME,winFEAT,winREF) {
// October 16, 2007. Edgar R. Ogando
winNAME = (winNAME == "") ? "imageWin" : winNAME;
winFEAT = (winFEAT == "") ? "width="+imgWIDTH+",height="+imgHEIGHT+"" : winFEAT;
winObjRef = window.open("",winNAME,winFEAT);
	if (winObjRef && winObjRef.open && !winObjRef.closed) {
		winObjRef.document.open('text/html');
		winObjRef.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');
		winObjRef.document.write('<html>');
		winObjRef.document.write('<head>');
		winObjRef.document.write('<title>'+winTITLE+'</title>');
		winObjRef.document.write('<style>');
		winObjRef.document.write('html,body{width:100%;height:100%;margin:0px;padding:0px;border:0px;}');
		winObjRef.document.write('div{position:relative;top:0px;left:auto;width:'+imgWIDTH+'px;height:'+imgHEIGHT+'px;margin-left:auto;margin-right:auto;padding:0px;border:0px;}');
		winObjRef.document.write('</style>');
		winObjRef.document.write('</head>');
		winObjRef.document.write('<body>');
		winObjRef.document.write('<div><a href="javascript:window.close();" title="[X]">');
		winObjRef.document.write('<img src="'+imgSRC+'" width="'+imgWIDTH+'" height="'+imgHEIGHT+'" border="0" alt="'+winTITLE+'">');
		winObjRef.document.write('</a></div>');
		winObjRef.document.write('</body>');
		winObjRef.document.write('</html>');
		winObjRef.document.close();
		if (winREF != "") {
			eval(winREF+" = winObjRef;");
			return true;
		}
	} else {
		if (winREF != "") {
			return false;
		}
	}
}
//

//-->

