var menub = new SKMenuBar();



function SKMenuBar () {

   this.menus = [];

   this.addMenu = function (skmMenu) {

      this.menus[this.menus.length++] = skmMenu;

   };

   return this;

} //SKMenuBar



function SKMenu (iId, sColor) {

   this.id           = iId;

   this.items        = [];

   this.color        = (sColor)?sColor:"#536C7B";

   this.addMenuItem  = function (skmiItem) {

      this.items[this.items.length++] = skmiItem;

   };

   return this;

} //SKMenu



function SKMenuItem (iId, sTexto, sLink, skmMenu) {

   this.id     = iId;

   this.text   = sTexto;

   this.link   = sLink;

   this.men    = skmMenu;

   return this;

} //MenuItem



function menu_in (obj, iId) {

   var oOld = obj

   var curLeft = 0;

   var curTop  = 0;

   if (obj.offsetParent) {

      while (obj.offsetParent) {

         curLeft  += obj.offsetLeft;

         curTop   += obj.offsetTop;

         obj = obj.offsetParent;

      } 

   } else if (obj.x) {

      curleft  += obj.x;

      curTop   += obj.y;

   }

   

   oOld.src = 'img/' + oOld.name + '_roll.gif';

   

   var o = null;

   

   var menu = document.getElementById("menu_init");

   hideSubMenu();

   if ((menu)&&(menu.name != iId)) {

      hideMenu();

      menu = null;

   }

   

   if (!menu) {

      o = window.document.createElement ("DIV");

      o.id = 'menu_init';

      o.name = iId;

      o.style.position = 'absolute';

      o.style.left=curLeft;

      o.style.top=curTop+19;

      o.style.zIndex = 1000;

      sInner = "<div id=menu OnMouseOut='menu_out(event)'><table  border='0' cellspacing='0' cellspadding='0'>"; 

      if (iId<menub.menus.length) {

         m = menub.menus[iId];

         o.style.background = m.color;

         for (var i=0; i<m.items.length; i++) {
			 
			 sInner += "<tr><td width=100%><div OnMouseOver='submenu_in(this,"+iId+","+i+")'><table><tr><td width=100%>";

            if (m.items[i].link)
				
               sInner += "<a class='skMenuItem' href='"+m.items[i].link+"' >";
				
            else

               sInner += "<a class='skMenuItem'>";
			//alert(sInner);
            sInner += m.items[i].text;

            sInner += "</a></td>";

            if (m.items[i].men)

               sInner += "<td><img style='float:right' src='img/flecha.gif' width='5' height='8' border='0'></td>";

            else

               sInner += "<td><img style='float:right' src='img/t.gif' width='5' height='8' border='0'></td>";

            sInner += "</tr></table></div></td></tr>";

         }

      }

      sInner += "</table>";

      o.innerHTML = sInner;

      o.este = oOld;

      o.nombreeste = 'img/' + oOld.name + '.gif';

      window.document.body.appendChild(o);   

   } 

} //menu_in







function viewSubMenu (iId) {

   var divCat = document.getElementById ('mnop'+iId);
   if (divCat.style.display=='block') {
      divCat.style.display = 'none';

   } else {
      divCat.style.display='block';

   }

   return false;

} //viewSubMenu



function menu_out (ev) {  

   var ev = ev? ev: window.event;

   var to = null;

   if (ev.toElement)

      to = ev.toElement;

   else if (ev.relatedTarget)

      to = ev.relatedTarget

   

   if (to!=null)

      if (!p(to)) {

         hideSubMenu ();

         hideMenu ();

      }

} //menu_out         



function p (obj) {

	if (obj) {

	   if ((obj.id) && ((obj.id=='submenu_init')||(obj.id=="menu_init")||(obj.id.indexOf("sk_menu_op_")==0)))

	      return true;	



      if (obj.parentElement)

         return p(obj.parentElement);

      if (obj.parentNode)

         return p(obj.parentNode);

   }

   return false;

} //p



function hideMenu () {

   var menu = document.getElementById("menu_init");          

   if (menu) {

      menu.este.src = menu.nombreeste;

      document.body.removeChild(menu);    

   }

} //hideMenu



function hideSubMenu () {

   var submenu = document.getElementById("submenu_init");          

   if (submenu) {

      submenu.este.style.background = "transparent";

      document.body.removeChild(submenu);    

   }

} //hideSubMenu



function submenu_in (obj, iIdM, iIdSbM) {

   var oOld = obj

   var curLeft = 0;

   var curTop  = 0;

   if (obj.offsetParent) {

      while (obj.offsetParent) {

         curLeft  += obj.offsetLeft;

         curTop   += obj.offsetTop;

         obj = obj.offsetParent;

      } 

   } else if (obj.x) {

      curleft  += obj.x;

      curTop   += obj.y;

   }

   

   var menu = document.getElementById("menu_init");

   curLeft += menu.offsetWidth;

   curTop  -= 1;

   

   var o = null;

   

   var submenu = document.getElementById("submenu_init");

   if ((submenu)&&(submenu.name!=iIdSbM)) {

      hideSubMenu();

      submenu = null;

   }

   

   if (!submenu) {

      o = window.document.createElement ("DIV");

      o.id = 'submenu_init';

      o.name = iIdSbM;

      o.style.position = 'absolute';

      o.style.left=curLeft-1;

      o.style.top=curTop;

      o.style.zIndex = 1000;

      sInner = "<div id=menu OnMouseOut='menu_out(event)'><table  border='0' cellspacing='0' cellspadding='0'>"; 

      if (iIdM<menub.menus.length) {

         m = menub.menus[iIdM].items[iIdSbM].men;

         if (m) {

            o.style.background = m.color;

            for (var i=0; i<m.items.length; i++) {

               sInner += "<tr><td width=100%><div OnMouseOver=\"this.style.background='#BEC7CE'\" OnMouseOut=\"this.style.background='transparent'\"><table><tr><td  width=100%><a class='skMenuItem' href='"+m.items[i].link+"' >" + m.items[i].text +"</a></td>";

               sInner += "<td><img style='float:right' src='img/t.gif' width='5' height='8' border='0'></td>";

               sInner += "</tr></table></div></td></tr>";

            }   

         }

      }

      sInner += "</table>";

      o.innerHTML = sInner;

      o.este = oOld;

      o.esteval = oOld.style.background;

      

      oOld.style.background = "#BEC7CE";

      window.document.body.appendChild(o);   

   }

   

} //submenu_in



// -------------------------------------------------------------------------

//    Funciones importadas por la herramienta de diseņo

// -------------------------------------------------------------------------

//

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

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();

}

function MM_openBrWindow(theURL,winName,features) { //v2.0

   window.open(theURL,winName,features);

}