function popUp(pstrURL,pstrName,pintWidth,pintHeight,pstrAttr) {
	window.open(pstrURL,pstrName,MakeWindowAttrib(pintWidth,pintHeight,pstrAttr));
}
function RemoveSelectedItemFromSelect(pobj) {
	for(lintO=0;lintO<pobj.options.length;lintO++)
		if(pobj.options[lintO].value==pobj.value) {
			pobj.options[lintO]=null;
			break;
		}
}
function AddStringKey(pstrKeys, pstrKey, pstrSep) {
	if(pstrSep===undefined) pstrSep="|";
	pstrKeys=RemoveStringKey(pstrKeys,pstrKey,pstrSep);
	if(pstrKeys!="")
		pstrKeys+=pstrSep;
	pstrKeys+=pstrKey;
	return pstrKeys;
}
function RemoveStringKey(pstrKeys, pstrKey, pstrSep) {
	if(pstrSep===undefined) pstrSep="|";
	aKeys=pstrKeys.split(pstrSep);
	aRes=new Array();
	for(var intK=0;intK<aKeys.length;intK++)
		if(aKeys[intK]!=pstrKey)
			aRes[aRes.length]=aKeys[intK];
	pstrKeys=aRes.join(pstrSep);
	return pstrKeys;
}
function padL(pstr,pintLength,pstrChar) {
	while(pstr.length<pintLength)
		pstr=pstrChar+pstr;
	return pstr;
}
function padR(pstr,pintLength,pstrChar) {
	while(pstr.length<pintLength)
		pstr=pstr+pstrChar;
	return pstr;
}
function formatDate(pintY,pintM,pintD) {
	return padL(pintD,2,"0")+"/"+getMonthName(pintM)+"/"+padL(pintY,4,"0");
}
function getMonthName(pintM) {
	return "Ene|Feb|Mar|Abr|May|Jun|Jul|Ago|Set|Oct|Nov|Dic".split("|")[pintM-1];
}
function globalX(pobj) {
	var llngLeft=pobj.offsetLeft;
	if(pobj.offsetParent)
		llngLeft+=globalX(pobj.offsetParent);
	return llngLeft;
}
function globalY(pobj) {
	var llngTop=pobj.offsetTop;
	if(pobj.offsetParent)
		llngTop+=globalY(pobj.offsetParent);
	return llngTop;
}
function objectPosX(pobj) {
	return pobj.offsetLeft;
}
function objectPosY(pobj) {
	return pobj.offsetTop;
}
function objectHeight(pobj) {
	return pobj.offsetHeight;
}
function objectWidth(pobj) {

	return pobj.offsetWidth;
}
function windowScrollTop() {
	var intScrollTop;
	if(window.pageYOffset)
		intScrollTop=window.pageYOffset;
	else if(document.documentElement && document.documentElement.scrollTop)
		intScrollTop=document.documentElement.scrollTop;
	else if(document.body)
		intScrollTop=document.body.scrollTop;
	return intScrollTop;
}
function windowWidth() {
	var intWidth;
	if(window.innerWidth)
		intWidth=window.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		intWidth=document.documentElement.clientWidth;
	else if(document.body)
		intWidth=document.body.clientWidth;
	return intWidth;
}
function windowHeight() {
	var intHeight;
	if(window.innerHeight)
		intHeight=window.innerHeight;
	else if(document.documentElement && document.documentElement.clientHeight)
		intHeight=document.documentElement.clientHeight;
	else if(document.body)
		intHeight=document.body.clientHeight;
	return intHeight;
}
function moveObjectTo(pobj, pintX, pintY, pintXS, pintYS) {
	pobj.style.left	=	pintX+'px';
	pobj.style.top	=	pintY+'px';
	if(pintXS!==undefined)
		setObjectWidth(pobj, pintXS);
	if(pintYS!==undefined)
		setObjectHeight(pobj, pintYS);
}
function setObjectWidth(pobj, pintWidth) {
	if(pintWidth<0)
		pintWidth=0;
	pstrWidth=''+pintWidth+(pintWidth!='auto' ? 'px' : '');
	pobj.style.width	=	pstrWidth;
}
function setObjectHeight(pobj, pintHeight) {
	if(pintHeight<0)
		pintHeight=0;
	pstrHeight=''+pintHeight+(pintHeight!='auto' ? 'px' : '');
	pobj.style.height	=	pstrHeight;
}
function moveObjectInsideWindow(pobj, pintX, pintY) {
	intWST=windowScrollTop();
	intWSY=windowHeight();
	intSY=objectHeight(pobj);
	if(pintY-intWST+intSY>intWSY)
		pintY=intWST+intWSY-intSY;
	if(pintY<intWST)
		pintY=intWST;
	moveObjectTo(pobj, pintX, pintY);
}
function centerObject(pobj) {
	intSX=objectWidth(pobj);
	intSY=objectHeight(pobj);
	intWSX=windowWidth();
	intWSY=windowHeight();
	intX=Math.floor((intWSX-intSX)/2);
	intY=Math.floor((intWSY-intSY)/2);
	moveObjectTo(pobj, intX, intY);
}