var backcolor = "#dddddd";
var fcolor = "#001234";
var capcolor = "#ffffcc";

// Main background color (the large area)
// Usually a bright color (white, yellow etc)
   if (typeof fcolor == 'undefined') { var fcolor = "#FFFFcc";}
   
// Border color and color of caption
// Usually a dark color (black, brown etc)
   if (typeof backcolor == 'undefined') { var backcolor = "#dddddd";}
      
// Text color
// Usually a dark color
   if (typeof textcolor == 'undefined') { var textcolor = "#ffccff";}
   
// Color of the caption text
// Usually a bright color
   if (typeof capcolor == 'undefined') { var capcolor = "#FFFFcc";}
   
// Color of "Close" when using Sticky
// Usually a semi-bright color
   if (typeof closecolor == 'undefined') { var closecolor = "#dddddd";}
   
   
// Width of the popups in pixels
// 100-300 pixels is typical
   if (typeof width == 'undefined') { var width = "200";}
   
// How thick the border should be in pixels
// 1-3 pixels is typical
   if (typeof border == 'undefined') { var border = "1";}
   
   
// How many pixels to the right/left of the cursor to show the popup
// Values between 3 and 12 are best
   if (typeof offsetx == 'undefined') { var offsetx = 15;}
   
// How many pixels to the below the cursor to show the popup
// Values between 3 and 12 are best
   if (typeof offsety == 'undefined') { var offsety = -260;}
   

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

//control tipo navegador
if (ie4) {
   if (navigator.userAgent.indexOf('MSIE 5')>0) {
      ie5 = true;
   } else {
      ie5 = false; }
} else {
   ie5 = false;
}

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0; 
var dirh = 1; //en horizontal
var dirv = 0; //en vertical
var valh = 1; //en horizontal
var valv = 1; //en vertical
if ( (ns4) || (ie4) ) {
   if (ns4) over = document.overDiv
   if (ie4) over = overDiv.style
   document.onmousemove = mouseMove
   if (ns4) document.captureEvents(Event.MOUSEMOVE)
}

// elimina la capa
function nd() {
   if ( cnt >= 1 ) { sw = 0 };
   if ( (ns4) || (ie4) ) {
      if ( sw == 0 ) {
         snow = 0;
         hideObject(over);
      } else {
         cnt++;
      }
   }
}

// sólo texto
function dts(h,v,ancho,alto,alinea,text) {
   txt = "<TABLE WIDTH="+ancho+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=7 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><P ALIGN="+alinea+"><FONT FACE=\"Verdana\" COLOR=\""+textcolor+"\" SIZE=\"1\">"+text+"</FONT></P></TD></TR></TABLE></TD></TR></TABLE>"
   layerWrite(txt);
   dirh = h;
   dirv = v;
   valh =ancho;
   valv = alto;
   disp();
}

// sólo imagen
function dtsimg(h,v,img,ancho,alto) {
   txt = "<P><IMG BORDER=1 WIDTH="+ancho+" HEIGHT="+alto+" SRC=\""+img+"\"></P>"
   layerWrite(txt);
   dirh = h;
   dirv = v;
   valh =ancho; 
   valv = alto;
   disp();
}

// título y texto
function dtc(h,v,ancho,alto,alinea,text, title) {
   txt = "<TABLE WIDTH="+ancho+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\" ><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><P ALIGN="+alinea+"><FONT FACE=Verdana SIZE=2 COLOR=\""+capcolor+"\"><B>"+title+"</B></FONT></P></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><P ALIGN="+alinea+"><FONT FACE=Verdana SIZE=1 COLOR=\""+textcolor+"\">"+text+"</FONT></P></TD></TR></TABLE></TD></TR></TABLE>"
   layerWrite(txt);
   dirh = h;
   dirv = v;
   valh =ancho; 
   valv = alto;
   disp();
}

// título e imagen
function dtcimg(h,v,img,title,ancho,alto) {
   txt = "<TABLE  BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\" ><TR><TD><TABLE  BORDER=0 BGCOLOR=\""+fcolor+"\" WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=Center><SPAN ID=\"PTT\"><B><FONT FACE=Verdana SIZE=1 COLOR=\""+textcolor+"\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD ALIGN=Center><P><IMG BORDER=0 WIDTH="+ancho+" HEIGHT="+alto+" SRC=\""+img+"\"></P></TD></TR></TABLE></TD></TR></TABLE>"
   layerWrite(txt);
   dirh = h;
   dirv = v;
   valh =ancho; 
   valv = alto;
   disp();
}

// título y texto con enlace
function stc(h,v,text, title) {
   sw = 1;
   cnt = 0;
   txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
   layerWrite(txt);
   dirh = h;
   dirv = v;
   valh =width; 
   valv = width;
   disp();
   snow = 0;
}

// Privadas
function disp() {
   if ( (ns4) || (ie4) ) {
      if (snow == 0)    {
         if (dirh == 2) {
            if (dirv == 0) { // centrada, abajo
	moveTo(over,x+offsetx-(valh/2),y+2*offsety);}
            if (dirv == 1) { // centrada, arriba
	moveTo(over,x+offsetx-(valh/2),y-valv);}
         }
         if (dirh == 1) {
            if (dirv == 0) { // derecha, abajo
	moveTo(over,x+offsetx,y+offsety);}
            if (dirv == 1) { // derecha, arriba
	moveTo(over,x+offsetx,y-valv);}
         }
         if (dirh == 0) {
            if (dirv == 0) { // izquierda, abajo
	moveTo(over,x-offsetx-valh,y+offsety);}
            if (dirv == 1) { // izquierda, arriba
	moveTo(over,x-offsetx-valh,y-valv);}
         }
         showObject(over);
         snow = 1;
      }
   }
// Here you can make the text goto the statusbar.
}

// Moves the layer
function mouseMove(e) {
   if (ns4) {x=e.pageX; y=e.pageY;}
   if (ie4) {x=event.x; y=event.y;}
   if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
   if (snow) {
      if (dirh == 2) { 
            if (dirv == 0) { // centrada, abajo
	moveTo(over,x+offsetx-(valh/2),y+2*offsety);}
            if (dirv == 1) { // centrada, arriba
	moveTo(over,x+offsetx-(valh/2),y-valv);}
      }
      if (dirh == 1) { 
            if (dirv == 0) { // derecha, abajo
	moveTo(over,x+offsetx,y+offsety);}
            if (dirv == 1) { // derecha, arriba
	moveTo(over,x+offsetx,y-valv);}
      }
      if (dirh == 0) { // Left
            if (dirv == 0) { // izquierda, abajo
	moveTo(over,x-offsetx-valh,y+offsety);}
            if (dirv == 1) { // izquierda, arriba
	moveTo(over,x-offsetx-valh,y-valv);}
      }
   }
}

// The Close onMouseOver function for Sticky
function cClick() {
   hideObject(over);
   sw=0;
}

// Writes to a layer
function layerWrite(txt) {
        if (ns4) {
                var lyr = document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) document.all["overDiv"].innerHTML = txt

}

// Make an object visible
function showObject(obj) {
        if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}

// Hides an object
function hideObject(obj) {
        if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
}

// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}


