
function pagina(){
	var pagina=Window.location.href;
	return pagina;
}


getMyHref = function()
{	var hrefa = location.href;
	var posi=hrefa.lastIndexOf("/");
	var href=hrefa.substring(posi+1)
	document.menu.SetVariable("/:href",href);
	//document.banner.SetVariable("/:delay",3000);
}

var texts = new Array
(
"<font size='3' color='{COLOR}' face='Microsoft Sans Serif'><b>NDP® </b></font>",
"<font size='3' color='{COLOR}' face='Microsoft Sans Serif'><b>NDP® </b></font>",
"<font size='3' color='{COLOR}' face='Microsoft Sans Serif'><b>NDP® </b></font>",
"<font size='3' color='{COLOR}' face='Microsoft Sans Serif'><b>NDP® </b></font>",
"<font size='3' color='{COLOR}' face='Microsoft Sans Serif'><b>NDP® </b></font>"
)
 
var bgcolor = "#FFFFFF"; // background color, must be valid browser hex color (not color names)
var fcolor = "#6A9989";  // foreground or font color
var steps = 100; // number of steps to fade
var show = 6000; // milliseconds to display message
var sleep = 1000; // milliseconds to pause inbetween messages
var loop = true; // true = continue to display messages, false = stop at last message

// Do Not Edit Below This Line
var colors = new Array(steps);
getFadeColors(bgcolor,fcolor,colors);
var color = 0;
var text = 0;
var step = 1;
var opaci=700;
function dameimagen()
{
	return '<table border=1><tr><td> </td></tr></table>';
}

function fade() 
{
	pasa=texts[text].lastIndexOf("{COLOR}");
	if(pasa > 0)
	{
		var text_out = texts[text].replace("{COLOR}", colors[color]); 
	}
	else
	{
		var text_out = texts[text].replace("filter:alpha(opacity=100); -moz-opacity:0.5", "filter:alpha(opacity="+opaci+"); -moz-opacity:0.5"); 	}


if (document.all) fader.innerHTML = text_out; // document.all = IE only
if (document.layers) { document.fader.document.write(text_out); document.fader.document.close(); } 


color += step; 
opaci=opaci-10;

if (color >= colors.length-1) {
step = -1; 


if (!loop && text >= texts.length-1) return;
}


if (color == 0) {
step = 1; // traverse colors array forward to fade in again


text += 1;

if (text == texts.length) text = 0; // loop back to first message
}


setTimeout("fade()", (color == colors.length-2 && step == -1) ? show : ((color == 1 && step == 1) ? sleep : 50)); 
}

function getFadeColors(ColorA, ColorB, Colors) {
len = Colors.length; 

if (ColorA.charAt(0)=='#') ColorA = ColorA.substring(1);
if (ColorB.charAt(0)=='#') ColorB = ColorB.substring(1);

// substract rgb compents from hex string 
var r = HexToInt(ColorA.substring(0,2));
var g = HexToInt(ColorA.substring(2,4));
var b = HexToInt(ColorA.substring(4,6));
var r2 = HexToInt(ColorB.substring(0,2));
var g2 = HexToInt(ColorB.substring(2,4));
var b2 = HexToInt(ColorB.substring(4,6));

// calculate size of step for each color component
var rStep = Math.round((r2 - r) / len);
var gStep = Math.round((g2 - g) / len);
var bStep = Math.round((b2 - b) / len);

// fill Colors array with fader colors
for (i = 0; i < len-1; i++) {
Colors[i] = "#" + IntToHex(r) + IntToHex(g) + IntToHex(b);
r += rStep;
g += gStep;
b += bStep;
}
Colors[len-1] = ColorB; // make sure we finish exactly at ColorB
}

// IntToHex: converts integers between 0-255 into a two digit hex string.
function IntToHex(n) {
var result = n.toString(16);
if (result.length==1) result = "0"+result;
return result;
}

// HexToInt: converts two digit hex strings into integer.
function HexToInt(hex) {
return parseInt(hex, 16);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}

function checkBrowser()
{
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
