function cLayer (sParNombre) { this.sName = sParNombre; this.sLayer = this.bEsNS4 ? "document." + this.sName : (oNavegador.bEsDOM ? "document.getElementById ('" + this.sName + "')" : "document.all." + this.sName); this.oLayer = eval (this.sLayer); this.sCSS = this.bEsNS4 ? this.sLayer : this.sLayer + ".style"; this.oCSS = this.oLayer ? eval (this.sCSS) : null; this.Show = cLayer_Show; this.Hide = cLayer_Hide; this.nGetLeft = cLayer_nGetLeft; this.SetLeft = cLayer_SetLeft; this.nGetTop = cLayer_nGetTop; this.SetTop = cLayer_SetTop; this.nGetWidth = cLayer_nGetWidth; this.SetWidth = cLayer_SetWidth; this.nGetHeight = cLayer_nGetHeight; this.SetHeight = cLayer_SetHeight; this.SetDimensions = cLayer_SetDimensions; this.Write = cLayer_Write; this.MoveBy = cLayer_MoveBy; this.MoveTo = cLayer_MoveTo; this.MoveUp = cLayer_MoveUp; this.MoveDown = cLayer_MoveDown; this.MoveLeft = cLayer_MoveLeft; this.MoveRight = cLayer_MoveRight; this.SetColor = cLayer_SetColor; this.SetBGColor = cLayer_SetBGColor; this.anGetClip = cLayer_anGetClip; this.nGetClipTop = cLayer_nGetClipTop; this.nGetClipRight = cLayer_nGetClipRight; this.nGetClipBottom = cLayer_nGetClipBottom; this.nGetClipLeft = cLayer_nGetClipLeft; this.nGetClipHeight = cLayer_nGetClipHeight; this.nGetClipWidth = cLayer_nGetClipWidth; this.SetClipTop = cLayer_SetClipTop; this.SetClipRight = cLayer_SetClipRight; this.SetClipBottom = cLayer_SetClipBottom; this.SetClipLeft = cLayer_SetClipLeft; this.SetClip = cLayer_SetClip; this.ScrollUp = cLayer_ScrollUp; this.ScrollDown = cLayer_ScrollDown; this.ScrollLeft = cLayer_ScrollLeft; this.ScrollRight = cLayer_ScrollRight; this.bVisible = this.oCSS ? (this.oCSS.visibility != "hidden" && this.oCSS.display != "none") : false; this.nLeft = this.oCSS ? ( (this.oCSS.left == "") ? this.oLayer.offsetLeft : this.oCSS.left ) : 0; this.nTop = this.oCSS ? ( (this.oCSS.top == "") ? this.oLayer.offsetTop : this.oCSS.top ) : 0; this.nWidth = this.oCSS ? ( (this.oCSS.width == "") ? this.oLayer.offsetWidth : this.oCSS.width ) : 0; this.nHeight = this.oCSS ? ( (this.oCSS.height == "") ? this.oLayer.offsetHeight : this.oCSS.height ) : 0; this.nClipLeft = 0; this.nClipTop = 0; this.nClipRight = this.nWidth; this.nClipBottom = this.nHeight; this.nClipWidth = this.nWidth; this.nClipHeight = this.nHeight; this.sColor = "#000000"; this.sBGColor = "#FFFFFF"; } function cLayer_Show () { this.oCSS = eval (this.sCSS); if (this.oCSS) { if (oNavegador.bEsNS4) this.oCSS.visibility = "visible"; else { this.oCSS.display = ""; this.oCSS.visibility = "visible"; } this.bVisible = true; } } function cLayer_Hide () { this.oCSS = eval (this.sCSS); if (this.oCSS) { if (oNavegador.bEsNS4) this.oCSS.visibility = "hidden"; else { this.oCSS.display = "none"; this.oCSS.visibility = "hidden"; } this.bVisible = false; } } function cLayer_nGetLeft () { /* var sLeft = oNavegador.bEsNS4 ? '.pageX' : (oNavegador.bEsDOM ? '.left' : '.pixelLeft'); if (this.oCSS) { var nLeft = eval (this.sCSS + sLeft); if (nLeft == "") nLeft = 0; return parseInt ( nLeft ); } else return (this.nLeft);*/ return (this.nLeft); } function cLayer_SetLeft (nParLeft) { this.oCSS = eval (this.sCSS); this.nLeft = nParLeft; var sLeft = oNavegador.bEsNS4 ? '.pageX' : (oNavegador.bEsDOM ? '.left' : '.pixelLeft'); if (nParLeft != null && this.oCSS) { eval ( this.sCSS + sLeft + ' = ' + nParLeft + ';'); } } function cLayer_nGetTop () { /* var sTop = oNavegador.bEsNS4 ? '.pageY' : (oNavegador.bEsDOM ? '.top' : '.pixelTop'); if (this.oCSS) { var n = eval (this.sCSS + sTop); if (n == "") n = 0; return parseInt ( n ); } else return (this.nTop); */ return (this.nTop); } function cLayer_SetTop (nParTop) { this.oCSS = eval (this.sCSS); var sTop = oNavegador.bEsNS4 ? '.pageY' : (oNavegador.bEsDOM ? '.top' : '.pixelTop'); if (nParTop != null && this.oCSS) eval (this.sCSS + sTop + ' = ' + nParTop); this.nTop = nParTop; } function cLayer_nGetWidth () { /* var sWidth = oNavegador.bEsNS4 ? '.width' : (oNavegador.bEsDOM ? '.width' : '.pixelWidth'); if (this.oCSS) { var n = eval (this.sCSS + sWidth); if (n == "") n = 0; return parseInt ( n ); } else return (this.nWidth);*/ return (this.nWidth); } function cLayer_SetWidth (nParWidth) { this.oCSS = eval (this.sCSS); var sWidth = oNavegador.bEsNS4 ? '.width' : (oNavegador.bEsDOM ? '.width' : '.pixelWidth'); if (nParWidth != null && this.oCSS) eval (this.sCSS + sWidth + ' = ' + nParWidth); this.nWidth = nParWidth; } function cLayer_nGetHeight () { /* var sHeight = oNavegador.bEsNS4 ? '.height' : (oNavegador.bEsDOM ? '.height' : '.pixelHeight'); if (this.oCSS) { var n = eval (this.sCSS + sHeight); if (n == "") n = 0; return parseInt ( n ); } else return (this.nHeight);*/ return (this.nHeight); } function cLayer_SetHeight (nParHeight) { this.oCSS = eval (this.sCSS); var sHeight = oNavegador.bEsNS4 ? '.height' : (oNavegador.bEsDOM ? '.height' : '.pixelHeight'); if (nParHeight != null && this.oCSS) eval (this.sCSS + sHeight + ' = ' + nParHeight); this.nHeight = nParHeight; } function cLayer_SetDimensions (nParWidth, nParHeight) { this.SetWidth (nParWidth); this.SetHeight (nParHeight); } function cLayer_MoveBy (nParDx, nParDy) { if (! nParDx) nParDx = 0; if (! nParDy) nParDy = 0; this.SetLeft (this.nGetLeft() + nParDx); this.SetTop (this.nGetTop() + nParDy); } function cLayer_MoveTo (nParX, nParY) { this.SetLeft (nParX); this.SetTop (nParY); } function cLayer_MoveUp (nParPixels) { this.MoveBy ( null, -nParPixels ); } function cLayer_MoveDown (nParPixels) { this.MoveBy ( null, nParPixels ); } function cLayer_MoveLeft (nParPixels) { this.MoveBy ( -nParPixels, null ); } function cLayer_MoveRight (nParPixels) { this.MoveBy ( nParPixels, null ); } function cLayer_SetColor (sParColor) { this.oCSS = eval (this.sCSS); if (this.oCSS) eval (this.sCSS + '.color = "' + sParColor + '"'); this.sColor = sParColor; } function cLayer_SetBGColor (sParBGColor) { this.oCSS = eval (this.sCSS); sBGColor = oNavegador.bEsNS4 ? ".bgColor" : ".backgroundColor"; if (this.oCSS) eval (this.sCSS + sBGColor + ' = "' + sParBGColor + '"'); this.sBGColor = sParBGColor; } function cLayer_Write (sParTexto) { this.oLayer = eval (this.sLayer); if (oNavegador.bEsNS4) { this.oLayer.document.open(); this.oLayer.document.write(sParTexto); this.oLayer.document.close(); } else { this.oLayer.innerHTML = sParTexto; //eval (this.sLayer + ".innerHTML = \"" + sParTexto + "\";"); } } function cLayer_anGetClip () { var anClip = new Array(); var asClip = new Array(); /* vClipRect = eval (this.sCSS + '.clip'); if (oNavegador.bEsNS4) { anClip[0] = vClipRect.top; anClip[1] = vClipRect.right; anClip[2] = vClipRect.bottom; anClip[3] = vClipRect.left; } else { if (vClipRect == "") vClipRect = "0 0 0 0"; else vClipRect = vClipRect.substring ( vClipRect.indexOf ( '(' ) + 1, vClipRect.indexOf ( ')' ) ); asClip = vClipRect.split ( ' ' ); anClip[0] = (asClip[0] == "") ? 0 : parseInt (asClip[0]); anClip[1] = (asClip[1] == "") ? 0 : parseInt (asClip[1]); anClip[2] = (asClip[2] == "") ? 0 : parseInt (asClip[2]); anClip[3] = (asClip[3] == "") ? 0 : parseInt (asClip[3]); }*/ anClip[0] = this.nClipTop; anClip[1] = this.nClipRight; anClip[2] = this.nClipBottom; anClip[3] = this.nClipLeft; return (anClip); } function cLayer_nGetClipTop () { // return parseInt (oNavegador.bEsNS4 ? eval (this.sCSS + '.clip.top' ) : this.anGetClip()[0]); return this.nClipTop; } function cLayer_nGetClipRight () { // return parseInt (oNavegador.bEsNS4 ? eval (this.sCSS + '.clip.right' ) : this.anGetClip()[1]); return this.nClipRight; } function cLayer_nGetClipBottom () { // return parseInt (oNavegador.bEsNS4 ? eval (this.sCSS + '.clip.bottom' ) : this.anGetClip()[2]); return this.nClipBottom; } function cLayer_nGetClipLeft () { // return parseInt (oNavegador.bEsNS4 ? eval (this.sCSS + '.clip.left' ) : this.anGetClip()[3]); return this.nClipLeft; } function cLayer_nGetClipHeight () { return this.nClipBottom + this.nClipTop; } function cLayer_nGetClipWidth () { return this.nClipRight - this.nClipLeft; } function cLayer_SetClip (nParTop, nParRight, nParBottom, nParLeft) { this.oCSS = eval (this.sCSS); if (oNavegador.bEsNS4) { this.SetClipTop (nParTop); this.SetClipRight (nParRight); this.SetClipBottom (nParBottom); this.SetClipLeft (nParLeft); } else { sRect = 'rect(' + nParTop + 'px ' + nParRight + 'px ' + nParBottom + 'px ' + nParLeft + 'px)'; this.oCSS.clip = sRect; } this.nClipTop = nParTop; this.nClipRight = nParRight; this.nClipBottom = nParBottom; this.nClipLeft = nParLeft; this.nClipWidth = this.nClipRight - this.nClipLeft; this.nClipHeight = this.nClipBottom - this.nClipTop; } function cLayer_SetClipTop (nParPixels) { this.oCSS = eval (this.sCSS); this.nClipTop = nParPixels; if (oNavegador.bEsNS4) { eval (this.sCSS + '.clip.top=' + nParPixels); } else { this.SetClip (nParPixels, this.nGetClipRight(), this.nGetClipBottom(), this.nGetClipLeft()); } } function cLayer_SetClipRight (nParPixels) { this.oCSS = eval (this.sCSS); this.nClipRight = nParPixels; if (oNavegador.bEsNS4) { eval (this.sCSS + '.clip.right=' + nParPixels); } else { this.SetClip (this.nGetClipTop(), nParPixels, this.nGetClipBottom(), this.nGetClipLeft()); } } function cLayer_SetClipBottom (nParPixels) { this.oCSS = eval (this.sCSS); this.nClipBottom = nParPixels; if (oNavegador.bEsNS4) { eval (this.sCSS + '.clip.bottom=' + nParPixels); } else { this.SetClip (this.nGetClipTop(), this.nGetClipRight(), nParPixels, this.nGetClipLeft()); } } function cLayer_SetClipLeft (nParPixels) { this.oCSS = eval (this.sCSS); this.nClipLeft = nParPixels; if (oNavegador.bEsNS4) { eval (this.sCSS + '.clip.left=' + nParPixels); } else { this.SetClip (this.nGetClipTop(), this.nGetClipRight(), this.nGetClipBottom(), nParPixels); } } function cLayer_ScrollUp (nParPixels) { this.SetClipTop (this.nGetClipTop() - nParPixels); this.SetClipBottom (this.nGetClipBottom() - nParPixels); this.MoveDown (nParPixels); this.SetDimensions ( this.nGetWidth(), this.nGetHeight() - nParPixels); } function cLayer_ScrollDown (nParPixels) { this.SetClipTop (this.nGetClipTop() + nParPixels); this.SetClipBottom (this.nGetClipBottom() + nParPixels); this.MoveUp (nParPixels); this.SetDimensions ( this.nGetWidth(), this.nGetHeight() + nParPixels); } function cLayer_ScrollLeft (nParPixels) { this.SetClipLeft (this.nGetClipLeft() - nParPixels); this.SetClipRight (this.nGetClipRight() - nParPixels); this.MoveRight (nParPixels); this.SetDimensions ( this.nGetWidth() - nParPixels, this.nGetHeight()); } function cLayer_ScrollRight (nParPixels) { this.SetClipLeft (this.nGetClipLeft() + nParPixels); this.SetClipRight (this.nGetClipRight() + nParPixels); this.MoveLeft (nParPixels); this.SetDimensions ( this.nGetWidth() + nParPixels, this.nGetHeight()); }