// SCROLL ÚLTIMAS NOTICIAS //

// Variables //
var pausecontent=new Array()
pausecontent[0]='<a href="http://www.industriagraficaonline.com/industria_grafica/quienes_somos.htm">Industria Gráfica es la revista online líder del sector gráfico con más de 28.000 visitas mensuales.</a>'
pausecontent[1]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/05n/2010-03-12-InfoPrint.php">Noticia: Servex elige la solución InfoPrint Mailroom Integrity</a>'
pausecontent[2]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/05n/2010-03-12-DuPont.php">Noticia: DuPont Packaging Graphics Anuncia los Premios New Horizon de 2009</a>'
pausecontent[3]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/10p/2010-03-12-Enfocus.php">Producto: Enfocus presenta Switch 09</a>'
pausecontent[4]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/05n/2010-03-10-Toshiba.php">Noticia: Toshiba anuncia crecimiento en 2010 del mercado de impresión digital en España</a>'
pausecontent[5]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/05n/2010-03-10-Kodak.php">Noticia: Photomec Elgg potencia la eficiencia y exactitud de su producción con las soluciones KODAK</a>'
pausecontent[6]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/10p/2010-03-10-Xerox.php">Producto: Xerox mejora la solución de gran formato Xerox 6279 con soporte de impresión para archivos de hasta 200 metros de longitud</a>'
pausecontent[7]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/15a/2010-03-08-FESPA.php">Art&iacute;culo: La nueva exposición FESPA Fabric será un escaparate para la innovación en decoración de prendas de vestir</a>'
pausecontent[8]='<a href="http://www.industriagraficaonline.com/tex/90_2010/75_03/05n/2010-03-08-Graphispag.php">Noticia: Graphispag 2011 marcará el punto de inflexión de la recuperación del sector gráfico español</a>'
pausecontent[9]='<a href="http://www.industriagraficaonline.com/editorial/editorial.php">Editorial: Anuncios de mejora</a>'
pausecontent[10]='<a href="http://www.industriagraficaonline.com/industria/buscador/formulario.php">Añada su empresa gratuitamente al Directorio de Empresas de Industria Gráfica Online.</a>'

// pausecontent[1]='<a href="">Noticia: </a>'

// Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
// This notice MUST stay intact for legal use
// Visit http://www.dynamicdrive.com/ for this script and 100s more.

function pausescroller(content, divId, divClass, delay){
this.content=content
this.tickerid=divId
this.delay=delay
this.mouseoverBol=0
this.hiddendivpointer=1
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener)
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent)
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById)
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent)
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle)
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

// FECHA ACTUAL //

function Fecha() { 
	var now = new Date();
	var monthNames = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	document.write(now.getDate() + " de " + monthNames[now.getMonth()] + " de " + now.getFullYear());
}

// MENU PRINCIPAL //

// Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Distribute this code, any part or any modified version of it.
//     Instead, you can link to the homepage of this code:
//     http://www.php-development.ru/javascripts/menu.php.
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as a part of another product provided that
//     its main use is not creating javascript menus.
// NO WARRANTY
// This code is provided "as is" without warranty of any kind, either
// expressed or implied, including, but not limited to, the implied warranties
// of merchantability and fitness for a particular purpose. You expressly
// acknowledge and agree that use of this code is at your own risk.

function at_display(x)
{
  var win = window.open();
  for (var i in x) win.document.write(i+' = '+x[i]+'<br>');
}

var at_timeout = 50;

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);
  p.className        = "active";
  if (c.offsetWidth <= 0)
  {
    c.style.position   = "absolute";
    c.style.visibility = "visible";
    c.style.display    = "block";
  }
  var direction = undefined;
  if (p.parentNode && p.parentNode["at_position"] == "x")
    direction = p.parentNode["at_direction"];
  var top   = (c["at_position"] == "y") ?  p.offsetHeight+2 : 0;
  var left1 = (c["at_position"] == "x") ?  p.offsetWidth +2 : 0;
  var left2 = (c["at_position"] == "x") ? -c.offsetWidth -2 : 0;
  var left3 = (c["at_position"] == "x") ?  p.offsetWidth +2 : 0;
  for (; p; p = p.offsetParent)
  {
    if (p.style.position != 'absolute')
    {
      left1 += p.offsetLeft;
      left2 += p.offsetLeft;
      top   += p.offsetTop;
    }
    left3 += p.offsetLeft;
  }
  if (direction)
  {
    left = (direction == 'right') ? left1 : left2;
    c['at_direction'] = direction;
  }
  else
  {
    left = (left3+c.offsetWidth < document.body.offsetWidth) ? left1 : left2;
    c['at_direction'] = (left3+c.offsetWidth < document.body.offsetWidth) ? 'right' : 'left';
  }
  c.style.position   = "absolute";
  c.style.visibility = "visible";
  c.style.display    = "block";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
}

function at_hide_aux(parent, child)
{
  document.getElementById(parent).className        = "parent";
  document.getElementById(child ).style.visibility = "hidden";
  document.getElementById(child ).style.display    = "block";
}

function at_show(e)
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);
  at_show_aux(p.id, c.id);
  clearTimeout(c["at_timeout"]);
}

function at_hide()
{
  var c = document.getElementById(this["at_child"]);
  c["at_timeout"] = setTimeout("at_hide_aux('"+this["at_parent"]+"', '"+this["at_child" ]+"')", at_timeout);
}

function at_attach(parent, child, position)
{
  p = document.getElementById(parent);
  c = document.getElementById(child );
  p["at_child"]    = c.id;
  c["at_child"]    = c.id;
  p["at_parent"]   = p.id;
  c["at_parent"]   = p.id;
  c["at_position"] = position;
  p.onmouseover = at_show;
  p.onmouseout  = at_hide;
  c.onmouseover = at_show;
  c.onmouseout  = at_hide;
}

function dhtmlmenu_build_aux(parent, child, position)
{
  document.getElementById(parent).className = "parent";
  document.write('<div class="vertical" id="'+parent+'_child">');
  var n = 0;
  for (var i in child)
  {
    if (i == '-')
    {
      document.getElementById(parent).href = child[i];
      continue;
    }
    if (typeof child[i] == "object")
    {
      document.write('<a class="parent" id="'+parent+'_'+n+'">'+i+'</a>');
      dhtmlmenu_build_aux(parent+'_'+n, child[i], "x");
    }
    else document.write('<a id="'+parent+'_'+n+'" href="'+child[i]+'">'+i+'</a>');
    n++;
  }
  document.write('</div>');
  at_attach(parent, parent+"_child", position);
}

function dhtmlmenu_build(menu)
{
  for (var i in menu) dhtmlmenu_build_aux(i, menu[i], "y");
}
