");
}
j.document.writeln('');
///////////////////////////////////
// Try this table for normal forms, if does not exist then try the loop
var vLay = document.getElementById("LayoutTable");
if (vLay == null)
{
for (i=1;;i++)
{
var vLay = document.getElementById("LayoutTable_"+i);
if (vLay == null) break;
j.document.writeln(vLay.rows[0].cells[0].innerHTML);
}
}
else
{
j.document.writeln(vLay.rows[0].cells[0].innerHTML);
}
j.document.writeln('');
j.document.writeln('');
j.document.writeln('');
j.document.close();
}
function activar(nombreImagen,img)
{
if (document.images) {
document[nombreImagen].src=img; }
}
function desactivar(nombreImagen,img)
{
if (document.images) {
document[nombreImagen].src=img; }
}
function openCard(u,sub)
{
var filter ="p1="+u;
var sDialog = ""
if (sub=="1")
{
sDialog = "../../employee/eComunicacionFicha.jsp?"+filter;
}
else
{
sDialog = "../employee/eComunicacionFicha.jsp?"+filter;
}
open(sDialog,"","resizable=no,menubar=no,status=no,toolbar=no,titlebar=no,width=500px,height=200px,left=200px,top=170px");
}
var sDirVirtual = "";
var sApp = "";
var sMensajeDesconexion = "";
var idTimer = null;
function seteaMensaje(){
sMensajeDesconexion = arguments[0];
}
function activaTimer(){
sDirVirtual = arguments[0];
sApp = arguments[1];
var iNumMinutes = eval(arguments[2]);
idTimer = setTimeout("desconectar()",iNumMinutes * 60 * 1000);
}
function desconectar(){
var sDesconexion = sDirVirtual + "/core/logout.jsp?logged=yes&Application="+sApp;
alert(sMensajeDesconexion);
window.location.href = sDesconexion;
}
function desactivaTemporizador(){
clearTimeout(idTimer);
}
/*************************************************************************************
* Bubble functions
*/
var descrX = -1;
var descrY = -1;
/**
*
*/
function setDescriptionPosition(xpos,ypos)
{
descrX = xpos;
descrY = ypos;
}
/**
* Hides the bubble
*/
function hideDescription()
{
document.getElementById("Description").style.display = "none";
}
/**
* Shows the bubble rectangle with an informative message. It assumes that there is a div
* element called Description in it. Inside the Description div, it must exist a text
* called textContents id. This function should be called on onMouseOver event
* handler, and hideDescription can be called on onMouseOut event.
*/
function showDescription()
{
var elementToShow = document.getElementById("Description");
var text = document.getElementById("textContents");
// each argument will represent a row in the same cell (no new rows)
var iNum = arguments.length;
text.innerHTML = arguments[0];
for ( i=1;i";
text.innerHTML += arguments[i];
}
if ( descrX == -1 )
{
elementToShow.style.left = event.x + 20;
elementToShow.style.top = event.y + 5;
}
else {
elementToShow.style.position = "absolute";
elementToShow.style.left = descrX;
elementToShow.style.top = descrY;
}
elementToShow.style.display = "inline";
}
/**
* Writes an alert message to an object in the page.
* The class of this object should be warning, in order to
* present this message in red.
* Also, this message will be erased after 5 secs.
*/
function writeAlertMessage(objectId,message,clearTimeInSecs){
var whereToWrite = document.getElementById(objectId);
try{
whereToWrite.innerHTML = message;
document.objectID = objectId;
whereToWrite.style.display = "inline";
setTimeout( "clearAlertMessage()",clearTimeInSecs * 1000 );
}catch(someError){
alert(someError);
}
}
/**
* Clears the alert message
*/
function clearAlertMessage(){
var whereToWrite = document.getElementById(document.objectID);
try{
whereToWrite.innerHTML = "";
}catch(someError){
alert(someError);
}
}
function columnMarkRemoveAll ()
{
var theId = arguments[0];
if (theId == "") return;
var check =document.getElementById(theId);
if (check.checked)
columnMarkAll(theId);
else
columnRemoveAllMarks(theId);
}
function columnMarkAll ()
{
var theId = arguments[0];
if (theId == "") return;
var aRow ="";
var string ="";
for (i=1;; i++)
{
aRow = document.getElementById(theId+""+i);
if (aRow == null)
{
break;
}
else
{
string = aRow.innerHTML;
if (string.indexOf("IMG") < 0)
{
aRow.checked=true;
if ( theId == 'DeleteCB' )
aRow.parentNode.parentNode.style.textDecorationLineThrough=true;
if ( theId == 'ReadCB' )
aRow.parentNode.parentNode.style.fontStyle='oblique';
}
}
}
}
function columnRemoveAllMarks ()
{
var theId = arguments[0];
if (theId == "") return;
var aRow ="";
var string ="";
for (i=1;; i++)
{
aRow = document.getElementById(theId+""+i);
if (aRow == null)
{
break;
}
else
{
aRow.checked=false;
if ( theId == 'DeleteCB' )
aRow.parentNode.parentNode.style.textDecorationLineThrough=false;
if ( theId == 'ReadCB' )
aRow.parentNode.parentNode.style.fontStyle='normal';
}
}
}
function openHelpPage(pageNo,lang,extPath)
{
if (pageNo == '')
{
alert('No help page specified');
return;
}
if (lang == '') lang ="ES";
var dialog = extPath + "help/" + pageNo + "_" + lang + ".html";
var sName ="";
showModalDialog(dialog,Array(window,sName),"help:no;status:no;dialogWidth:500px;dialogHeight:400px");
}
function validateDate(idDate) {
oFecha = document.getElementById(idDate);
var dia, mes, any, num, num1, i=1;
var sFecha = oFecha.value;
if( sFecha.length == 0) return true;
if (sFecha.length >= 6) {
num = sFecha.indexOf("/");
dia = sFecha.substr(0,num);
num1 = sFecha.lastIndexOf("/");
var barra=(num1-(num+1));
mes = sFecha.substr((num+1),barra);
if (mes.length == 1)
mes = '0' + mes;
var l=sFecha.length;
any = sFecha.substr((num1+1),l);
if (any.length == 2)
any = ((any > '30') ? '19' : '20') + any;
}
var date = new Date(any, mes-1, dia);
var mesValidado = date.getMonth() + 1;
if ( mes != mesValidado) {
try {
sError = document.getElementById("errorDate").value;
} catch( SomeError) {
sError = 'Incorrect Date';
}
displayJavaScriptError(sError,0);
oFecha.blur();
oFecha.focus();
oFecha.select();
return false;
} else {
oFecha.value = dia + '/' + mes + '/' + any;
return true;
}
}
///////////////////////////////////
// fixed decimal places function
function fdp(n,d)
{
var xx = n.indexOf('.');
var l = n.length;
var zstr = '0000000000000000000000';
var theInt = '';
var theFrac = '';
var theNo = '';
rfac = '';
rfacx = 0;
nx = 0;
var xt = parseInt(d) + 1;
var rstr = '' + zstr.substring(1,xt);
var rfac = '.' + rstr + '5';
var rfacx = parseFloat(rfac);
if (xx == -1 )
{
// No fraction
theFrac = zstr;
theInt = "" + n;
}
else if (xx == 0)
{
theInt = '0';
nx = 0 + parseFloat(n) + parseFloat(rfacx);
n = nx + zstr;
theFrac = '' + n.substring(1, n.length);
}
else
{
theInt = n.substring(0,xx);
nx = parseFloat(n) + rfacx;
n = '' + nx + zstr;
theFrac = '' + n.substring(xx+1,xx + 1 + parseInt(d));
var astr = 'd = ' + d;
}
theFrac = theFrac.substring(0,parseInt(d));
var ii = 0;
theNo = theInt + '.' + theFrac;
return theNo;
}
//////////////////////////////////////////
// Assign today date to specific field
function getTodayDate(fieldName)
{
var Avui = new Date();
var Any = Avui.getYear();
var Mes = Avui.getMonth()+1;
if (Mes < 10) Mes = "0"+Mes
var Dia = Avui.getDate();
var fechaIn = document.getElementById(fieldName);
fechaIn.value = Dia + "/" + Mes + "/" + Any;
}
///////////////////////////////////
// function to control number of input charactes in textarea fields
function textCounter(txtField,txtCount,maxlimit)
{
field = document.getElementById(txtField);
cntfield = document.getElementById(txtCount);
if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
else cntfield.value = maxlimit - field.value.length;
}
//////////////////////////////////////////////////////
// Pair of functions for timer reset
//
// requirements:
// - must exist an iframe named 'resetTimerFrame'
// - on main form add the event onmousemove="resetTimer(p1,p2,p3)"
// where parameters are the same than activaTimer() function
function sendDummyTransaction()
{
var sent = document.getElementById("timerTrans");
sent.value ="yes";
var sDialog = arguments[0]+"/core/doNothing.jsp";
frames["resetTimerFrame"].location.href = sDialog;
}
function resetTimer()
{
var sent = document.getElementById("timerTrans").value;
//alert(sent);
if (sent == null || sent == "no")
{
clearTimeout(idTimer);
activaTimer(arguments[0],arguments[1],arguments[2]);
sendDummyTransaction(arguments[0]);
}
}
function scrollDown(divname)
{
document.getElementById(divname).doScroll("scrollbarDown");
}
function scrollUp(divname)
{
document.getElementById(divname).doScroll("scrollbarUp");
}
function markDeleted(_object){
var _object = _object.parentNode.parentNode;
_object.style.textDecorationLineThrough= ! _object.style.textDecorationLineThrough;
}
function markRead(_object){
var _object = _object.parentNode.parentNode;
if ( _object.style.fontStyle != 'oblique')
_object.style.fontStyle = 'oblique';
else
_object.style.fontStyle = 'normal';
}