var idioma = 'SP';

function setOrder()
{
//  alert(window.frames[0].id)
  window.frames[0].style.zIndex = 0;
}

function execAbyShop()
{
  alert('Opcion no disponible. / Option not available.');
/*  var aheight = 600;
  var awidth  = 800;
  var params = "height=" + aheight +
               ",width=" + awidth +
               "toolbar=no, menubar=no, location=no, scrollbars=no"+
               "resizable=yes, status=yes";
  window.open('http://abysal.com/abyshop/', null, params);
  window.history.back(1);*/
}

function execSoporte(idioma)
{
//  alert('Opcion no disponible. / Option not available.');
/*  var aheight = 320;
  var awidth  = 520;

  var oXSL = "inicioSop.htm";
  if ( idioma == 1 )
     oXSL = "loginSop.htm";

  var params = "height=" + aheight +
               ",width=" + awidth +
               "toolbar=no, menubar=no, location=no, scrollbars=no"+
               "resizable=yes, status=yes";

  window.open( oXSL, null, params );*/
  var aheight = 600;
  var awidth  = 800;

  oXSL = "soporte.xml"

  var params = "height=" + aheight +
               ",width=" + awidth +
               "toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=yes, status=yes";

  window.open( oXSL, null, params );

}

function Botones()
{
     var lista = new Array('abysal_user',document.getElementById('usuarioaux').value,
                           'abysal_password',document.getElementById('passwdaux').value,
                           'abysal_debug','1',
                           'usuario',document.getElementById('usuarioaux').value,
                           'passwd',document.getElementById('passwdaux').value)

     DoCallSec('abinip01.wdtp',lista,null,true);
}

function CambioPasswd()
{
    if (isBlankOrNull(document.getElementById('usuarioaux')))
    {
       alert('Debe rellenar usuario');
       putFocus('usuarioaux');
       return;
    }
    else
    {
       var lista = new Array('abysal_debug','0',
                             'ver','S',
                             'usuario',document.getElementById('usuarioaux').value);
       DoTpcallSec('abinip06.wdtp',lista,null,true);
    }
}

function TeclaPulsada( eventoPulsaTecla )
{
   bc = new browser_check;
   if (bc.ns6)
     tecla = eventoPulsaTecla.keyCode;
   else
     if (bc.ie)
        tecla = window.event.keyCode;
   if (tecla == 13)
   {
     Botones();
   }
}

function xzoom( sender  )
{
   if (sender.id == 'selCallejero')
   {
     var name = sender.value;
   }
   else
   {
     var idx = 1;
     var name = sender.id;
     if (name == 'map001') { name = 'map002'; idx = 2; }
     else
     if (name == 'map002') { name = 'map003'; idx = 3; }
     else
     if (name == 'map003') { name = 'map004'; idx = 4; }
     else
     if (name == 'map004') { name = 'map005'; idx = 5; }
     else
     if (name == 'map005') { name = 'map006'; idx = 6; }
     else
     if (name == 'map006') { name = 'map001'; idx = 1; }
     document.getElementById('selCallejero').selectedIndex = idx - 1;
   }
     
   var sName='';
   var tdImages = document.getElementById('tdImages');
   var images = tdImages.getElementsByTagName('IMG');
   for ( var i=0; i < images.length; i++ )
   {
        if ( images[i].id == name )
          images[i].style.display = '';
        else
          images[i].style.display = 'none';
   }

   
/*   if (name == 'ozoom' || name == 'ozoom2')
   {
      document.getElementById('izoom').style.display = ''
      document.getElementById('izoom2').style.display = ''
      document.getElementById('ozoom').style.display = 'none'
      document.getElementById('ozoom2').style.display = 'none'
   }
   if (name == 'izoom' || name == 'izoom2')
   {
      document.getElementById('izoom').style.display = 'none'
      document.getElementById('izoom2').style.display = 'none'
      document.getElementById('ozoom').style.display = ''
      document.getElementById('ozoom2').style.display = ''
   }*/

}

function botonMouse(obj)
{
  if (obj != null)
  {
    s = obj.className;

    if (s == 'botonOut')
    {
      obj.setAttribute('class', 'botonOver');
      obj.setAttribute('className', 'botonOver');
    }
    if (s == 'botonOver')
    {
      obj.setAttribute('class', 'botonOut');
      obj.setAttribute('className', 'botonOut');
    }
  }
}

function whichLabel(sender)
{
/*
Could load any of the following images:
    lbl-soluciones.jpg;lbl-agenda.jpg";lbl-contactar.jpg";lbl-estrategia.jpg";lbl-fd.jpg";
    lbl-sd.jpg";lbl-pd.jpg";lbl-padmin.jpg";lbl-fd.jpg";lbl-migrax.jpg";lbl-perfil.jpg";
    lbl-sort.jpg";lbl-spool.jpg";lbl-ubicacion.jpg";lbl-webdtp.jpg";lbl-webdtpstudio.jpg";
    lbl-webfinanciero.jpg";lbl-wms.jpg";lbl-faq.jpg";lbl-mapa.jpg";lbl-servicios.jpg";
*/
/*
   if ( document.getElementById('lbl') != null )
    {
       alert('PUFO');
      var oBodyId = parent.window.frames[0].window.document.body.id;
      var iObj = document.getElementById('ifrmContent');
      iObj.onload = '';
      
    }
    if ( oBodyId != null && oBodyId != '' )
    {
      var vsrc = 'resources/lbl-'+oBodyId+'.jpg';
      if (document.getElementById('lbl'))
        document.getElementById('lbl').setAttribute('src', vsrc);
    }
*/
   var oBody = parent.window.document;
   if ( oBody && oBody.getElementById('lblpath') != null && oBody.getElementById('lbltopic') != null )
    {
      var sBody = parent.window.frames[0].window.document.body;
      var label = sBody.getAttribute('abyLabel');
      var topic = sBody.getAttribute('abyTopic');
      oBody.getElementById('lblpath').childNodes[0].nodeValue = label;
      oBody.getElementById('lbltopic').childNodes[0].nodeValue = topic;
    }


}

function winDownload(sUrl, sName, bReplace)
{

  var sFeatures = 'resizable=no,scrollbars=no,location=no,status=no,menubar=no,toolbar=no,height=460,width=600';

  if (uhost == null)
    var uhost = document.location.host;

  sUrl="https://" + uhost + sUrl;

  var win = window.open(sUrl, sName, sFeatures, bReplace);
//  win.focus();

}

function winMap(sUrl, sName, bReplace)
{

  var sFeatures = 'unadorned=yes;center=yes;resizable=no,scrollbars=no,location=no,status=no,menubar=no,toolbar=no,height=490,width=805';

//  if (uhost == null)
//    var uhost = document.location.host;

//  sUrl="https://" + uhost + sUrl;

  var win = window.open(sUrl, sName, sFeatures, bReplace);
  win.focus();

}

function winSolicitud(sUrl, sName, bReplace)
{

  var sFeatures = 'center=yes;scrollbars=no,location=no,status=no,menubar=no,height=410,width=600';

  if (uhost == null)
    var uhost = document.location.host;

  sUrl="https://" + uhost + sUrl;
  
  var win = window.open(sUrl, sName, sFeatures, bReplace);
  win.focus();

}

function changeLang(sender)
{
   var lang = sender.value;
   var colEn = document.getElementsByName('en');
   var colSp = document.getElementsByName('sp');
   if ( lang == 'en')// english
   {
     for ( i=0; i < colSp.length; i++ )
       colSp[i].style.display = 'none';
     for ( i=0; i < colEn.length; i++ )
       colEn[i].style.display = '';
   }
   if ( lang == 'sp')// spanish
   {
     for ( i=0; i < colSp.length; i++ )
       colSp[i].style.display = '';
     for ( i=0; i < colEn.length; i++ )
       colEn[i].style.display = 'none';
   }
}

function gHistorial(direccion)
{
   if (direccion == 'next')
   {
     window.history.go(1);
   }
   if (direccion == 'prev')
   {
     window.history.back(1);
   }
}

var space= '&nbsp;';
var cpyr = "&#169;"
function setAbyMenu(language)
{
// Menu principal
  document.write("<td id='tdMenu' valign='top' align='center' style='padding-top:2px;background-image: url(resources/abysal-left3.gif);background-repeat: no-repeat;background-position: left '>");
  document.write("<div align='center' class='menuBar' nowrap='true' id='mnuabysal'>");
  document.write("<table cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td style='padding-top:5px;'>");
  if( language == 34)
  {
    document.write("<a class='menuElemento' style=padding-top:2px;width:98px;height:22px;' href='home.xml' valign='middle'>");
    document.write("Inicio");
  }
  if( language == 1)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='home_e.xml'>");
    document.write("Home");
  }
  document.write("</a>");
  document.write("</td>");
  document.write("<td style='padding-top:5px;'>");
  if( language == 34)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='servicios.htm'>");
    document.write("Servicios");
  }
  if( language == 1)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='services.htm'>");
    document.write("Services");
  }
  document.write("</a>");
  document.write("</td>");
  document.write("<td style='padding-top:5px;'>");
  if( language == 34)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;white-space:nowrap' href='' onclick='return elementoClick(this, &#39;mnuEmpresa&#39;);' onmouseover='elementoMouseover(this, &#39;mnuEmpresa&#39;);'>");
    document.write("Empresa"+space+space+space+space);
  }
  if( language == 1)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;white-space:nowrap' href='' onclick='return elementoClick(this, &#39;mnuEmpresa&#39;);' onmouseover='elementoMouseover(this, &#39;mnuEmpresa&#39;);'>");
    document.write("Company"+space+space+space+space);
  }
  document.write("<img src='resources/arroworange-down.gif' style='border:0px'>");
  document.write("</img>");
  document.write("</a>");
  document.write("</td>");
  document.write("<td style='padding-top:5px;'>");
  if( language == 34)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='' onclick='return elementoClick(this, &#39;mnuProductos&#39;);' onmouseover='elementoMouseover(this, &#39;mnuProductos&#39;);'>");
    document.write("Productos"+space+space);
  }
  if( language == 1)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='' onclick='return elementoClick(this, &#39;mnuProductos&#39;);' onmouseover='elementoMouseover(this, &#39;mnuProductos&#39;);'>");
    document.write("Products"+space+space+space+space);
  }
  document.write("<img src='resources/arroworange-down.gif' style='border:0px'>");
  document.write("</img>");
  document.write("</a>");
  document.write("</td>");
  document.write("<td style='padding-top:5px;'>");
  if( language == 34)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='' onclick='return elementoClick(this, &#39;mnuAcceso&#39;);' onmouseover='elementoMouseover(this, &#39;mnuAcceso&#39;);'>");
    document.write("Soporte"+space+space+space+space+space+space);
  }
  if( language == 1)
  {
    document.write("<a class='menuElemento' style='padding-top:2px;width:98px;height:22px;' href='' onclick='return elementoClick(this, &#39;mnuAcceso&#39;);' onmouseover='elementoMouseover(this, &#39;mnuAcceso&#39;);'>");
    document.write("Support"+space+space+space+space+space+space);
  }
  document.write("<img src='resources/arroworange-down.gif' style='border:0px'>");
  document.write("</img>");
  document.write("</a>");
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</div>");
// Submenus
// Submenu de Servicios
  document.write("<div id='mnuEmpresa' class='menu' onmouseover='menuMouseover(this)'>");
  document.write("<table cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
    document.write("<a class='menuItem' href='perfil.htm'>");
    document.write("Perfil");
  }
  if( language == 1)
  {
    document.write("<a class='menuItem' href='profile.htm'>");
    document.write("Profile");
  }
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='estrategia.htm'>");
     document.write("Estrategia");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='strategics.htm'>");
     document.write("Strategy");
  }
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td style='border-bottom:1px solid #F4C74D'>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='inicio.htm'>");
     document.write("Acerca de");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='login.htm'>");
     document.write("About Abysal");
  }
  document.write("</a>");			
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='contactar.htm'>");
     document.write("Contacto");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='contact.htm'>");
     document.write("Contact Information");
  }
  document.write("</a>");			
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='javascript:winMap(&#39;ubicacion.htm&#39;, &#39;UBICACION&#39;, true)'>");
     document.write("D&#243;nde Estamos");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='javascript:winMap(&#39;location.htm&#39;, &#39;LOCATION&#39;, true)'>");
     document.write("Our location");
  }
  document.write("</a>");			
  document.write("</td>");
  document.write("</tr>");

  document.write("</table>");
  document.write("</div>");
// Submenu de productos
  document.write("<div id='mnuProductos' class='menu' onmouseover='menuMouseover(this)' width='200px'>");
  document.write("<table cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
     document.write("<a class='menuItem' href='resources/abysal_webdtp_c_061116.pdf' target='_blank'>");
  if( language == 1)
     document.write("<a class='menuItem' href='resources/abysal_webdtp_e_061116.pdf' target='_blank'>");
  document.write("webDTP");

  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
     document.write("<a class='menuItem' href='webdtp_studio.htm'>");
  if( language == 1)
     document.write("<a class='menuItem' href='webdtp_studio_en.htm'>");
  document.write("webDTP Studio");

  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td style='border-bottom:1px solid #F4C74D'>");
  document.write("<a class='menuItem' href='' onclick='return false;' onmouseover='menuItemMouseover(this, event, &#39;internet1&#39;);' width='100%'>");
  document.write("<span class='menuItemText'>");
     document.write("Internet / Intranet"+space+space);

  document.write("</span>");
  document.write("<img src='resources/arroworange-mnu.gif' style='border:0px'>");
  document.write("</img>");
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
     document.write("<a class='menuItem' href='wms.htm'>");
  if( language == 1)
     document.write("<a class='menuItem' href='wms_en.htm'>");
  document.write("WMS");

  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
     document.write("<a class='menuItem' href='spool.htm'>");
  if( language == 1)
     document.write("<a class='menuItem' href='spool_en.htm'>");
  document.write("SPOOL");
  
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
     document.write("<a class='menuItem' href='sort.htm'>");
  if( language == 1)
     document.write("<a class='menuItem' href='sort_en.htm'>");
  document.write("SORT");

  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td style='border-bottom:1px solid #F4C74D'>");
  if( language == 34)
     document.write("<a class='menuItem' href='resources/edintas2 wdtp.pdf' target='_blank'>");
  if( language == 1)
     document.write("<a class='menuItem' href='resources/edintas2 wdtp en.pdf' target='_blank'>");
  document.write("EDIINT AS2");
  
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</div>");
// submenu de soporte
  document.write("<div id='mnuAcceso' class='menu' onmouseover='menuMouseover(this)' width='200px'>");
  document.write("<table cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td>");
     document.write("<a class='menuItem' href='javascript:execSoporte(language);'>");
  if( language == 34)
     document.write("Clientes - Soporte T&#233;cnico");
  if( language == 1)
     document.write("Client - Technical Support");
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='https://www.abysal.com/intranet/' target='_blank'>");
     document.write("Empleados - Intranet");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='https://www.abysal.com/intranet/' target='_blank'>");
     document.write("Employee - Intranet");
  }
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
/*  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='/abydoc/' target='new'>");
     document.write("Documentaci&#243;n T&#233;cnica");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='/abydoc/' target='new'>");
     document.write("Technical Documentation");
  }
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");*/
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
     document.write("<a class='menuItem' href='faq.htm'>");
     document.write("Preguntas m&#225;s frecuentes");
  }
  if( language == 1)
  {
     document.write("<a class='menuItem' href='faq_en.htm'>");
     document.write("WebDTP FAQ");
  }
  document.write("</a>");				
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</div>");
  // Submenus de submenus
// submenu de productos, submenu de internet intranet
  document.write("<div id='internet1' class='menu'>");				
  document.write("<table cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
    document.write("<a class='menuItem' href='wfinanza.htm'>");
    document.write("Web Financiero");
  }
  if( language == 1)
  {
    document.write("<a class='menuItem' href='financialweb.htm'>");
    document.write("Financial Web");
  }
  document.write("</a>");
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
    document.write("<a class='menuItem' href='agenda.htm'>");
    document.write("Abynet");
  }
  if( language == 1)
  {
    document.write("<a class='menuItem' href='agenda_en.htm'>");
    document.write("Abynet");
  }
  document.write("</a>");
  document.write("</td>");
  document.write("</tr>");
  document.write("<tr>");
  document.write("<td>");
  if( language == 34)
  {
    document.write("<a class='menuItem' href='javascript:execAbyShop()'>");
    document.write("Tienda Virtual");
  }
  if( language == 1)
  {
    document.write("<a class='menuItem' href='javascript:execAbyShop()'>");
    document.write("Virtual Shop");
  }
  document.write("</a>");
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</div>");
  document.write("</td>");
}

function setFooter(language)
{
  document.write("<td width='750px' height='50px' align='center' style='padding-top: 2px;'>");
  document.write("<table cellpadding='0' cellspacing='0' width='100%' style='padding-top:1px;padding-bottom:1px;background-image: url(resources/puntazo_horz.gif);background-repeat: repeat-x;background-positiony: bottom;'>");
  document.write("<tr>");
  document.write("<td width='25%' valign='middle' align='left' class='txtabyadm' style='white-space:nowrap;padding-left:2px'><b>");
        document.write(cpyr+space+"Abysal Systems, S.A. 1984-2008");
  document.write("</b>");
  document.write("</td>");

/*  document.write("<td valign='middle' align='right' class='txtabyadm' style='padding-right:2px'>");
  if( language == 1)
  {
    document.write("<a class='txtabyadm' href='javascript:winMap(&#39;location.htm&#39;, &#39;LOCATION&#39;, true)'>");
    document.write("(Las Rozas Business Park)");
    document.write("</a>");
  }
  if( language == 34)
  {
    document.write("<a class='txtabyadm' href='javascript:winMap(&#39;ubicacion.htm&#39;, &#39;UBICACION&#39;, true)'>");
    document.write("(Parque Empresarial Las Rozas)");
    document.write("</a>");
  }
  document.write("</td>");*/

  document.write("<td width='45%' valign='middle' align='center' class='txtabyadm2' style='white-space:nowrap;padding-right:2px'><b>");
        document.write("Tel.:"+space+"( +34 ) 91 651 53 03"+space+space+space+space+
                       "Fax:"+space+"( +34 ) 91 652 25 90");
  document.write("</b>");
  document.write("</td>");

  document.write("<td valign='top' align='right' class='txtabyadm' style=''>");
  document.write("<table valign='top' cellpadding='0' cellspacing='0'>");
  document.write("<tr>");
  document.write("<td style='padding-right:3px'>");
  document.write("<a class='txtabyadm' href='javascript:gHistorial(&#39;prev&#39;)'>");
  if( language == 34)
        document.write("anterior");
  if( language == 1)
        document.write("back");
  document.write("</a>");
  document.write("</td>");
  document.write("<td class='txtabyadm' >");
        document.write("|");
  document.write("</td>");
  document.write("<td style='padding-left:3px'>");
  document.write("<a class='txtabyadm' href='javascript:gHistorial(&#39;next&#39;)'>");
  if( language == 34)
        document.write("siguiente");
  if( language == 1)
        document.write("next");
  document.write("</a>");
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</td>");
}
// Fin
