/* DHTML NewsTicker */

/* Copyright Notice for the Original Source. It has been substantially modified */
/* Pausing updown message scroller- (C) Dynamic Drive (www.dynamicdrive.com) */

/* Configure the variables below to change the color, dimensions of the scroller */
scrollerwidth=150
scrollerheight=90
scrollerbgcolor='white'
toppause=4000 
minipause=10  // Original Value = var  minipause=100
dtop=5        // Original Value
decrement=2   // Original Value = var decrement=5

//set below to '' if you don't wish to use a background image
// MUST use transparent background image to prevent Netscape draw bug
scrollerbackground='transparent.gif'
PSSWEB_heads=new Array()
PSSWEB_urls=new Array()
//////////////////////////////////////////////////////////////////////////////
// The following line is a unique string to identify this array to another script 
//<!--HeadAPUrl-->
PSSWEB_heads[0]="Av. Petit Thouars 2378 <BR>Lince, Lima 14 - Per&uacute"
PSSWEB_heads[1]="Tel&eacute;fono: 421-0958 <br> Cel: 721-9337&nbsp;&nbsp;852-8286"
PSSWEB_heads[2]="www.pssweb.com"
PSSWEB_heads[3]="e-mail: correo@pssweb.com"
PSSWEB_urls[0]="mailto:correo@pssweb.com"
PSSWEB_urls[1]="mailto:correo@pssweb.com"
PSSWEB_urls[2]="mailto:correo@pssweb.com"
PSSWEB_urls[3]="mailto:correo@pssweb.com"
//<!--/HeadAPUrl-->
//<!--HeadUrl-->
//<!--/HeadUrl-->
// The previous line is a unique string to identify this array to another script 
//////////////////////////////////////////////////////////////////////////////
source_font="<font face='Verdana' SIZE=1>"
num_mess=1  // Número de titulares por página (no puede ser menos de 1)

///////Do not edit past this line///////////////////////

messages=new Array()
function write_message( mindex, urlarray, textarray, index ) {
	messages[ mindex ] = "<Table width='100%' height='"+ scrollerheight +"'>";
	for (i=0; i< num_mess; i++)
	{
		messages[ mindex ] += "<tr valign='middle'><td align='center'>" + source_font + "<a href='" + urlarray[index + i] + "'>" + textarray[index + i] + "</a>";
		messages[ mindex ] += "</font></td></tr>";
	    if (! textarray[ index + i + 1 ] ) i=num_mess;
	}
		messages[ mindex ] += "</table>";
}

   mess_len = Math.round((PSSWEB_heads.length + (PSSWEB_heads.length % num_mess)) / num_mess);

   for (d=0, m=0, e=0; m<=(mess_len-1); m++) {
	if ( PSSWEB_heads[e] ) {
	  write_message( m, PSSWEB_urls, PSSWEB_heads, e );
	  e += num_mess;
    } 
   }

if (messages.length>1) {
  ticker_index=2
  if ( ticker_index >= messages.length )
    ticker_index = 0;
}
else
  ticker_index=0

function move1(whichlayer){
  tlayer=eval(whichlayer)
  if (tlayer.top>0&&tlayer.top<=dtop){
    tlayer.top=0
    setTimeout("move1(tlayer)",toppause)
    setTimeout("move2(document.main.document.second)",toppause)
    return
  }
  if (tlayer.top>=tlayer.document.height*-1){
    tlayer.top-=decrement
    setTimeout("move1(tlayer)",minipause)
  } else {
    tlayer.top=scrollerheight
    tlayer.document.write(messages[ticker_index])
    tlayer.document.close()
    if (ticker_index==messages.length-1)
      ticker_index=0
    else
      ticker_index++
  }
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=dtop){
tlayer2.top=0
setTimeout("move2(tlayer2)",toppause)
setTimeout("move1(document.main.document.first)",toppause)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=decrement
setTimeout("move2(tlayer2)",minipause)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[ticker_index])
tlayer2.document.close()
if (ticker_index==messages.length-1)
ticker_index=0
else
ticker_index++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=dtop){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",toppause)
setTimeout("move4(second2)",toppause)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=decrement
setTimeout("move3(tdiv)",minipause)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[ticker_index]
if (ticker_index==messages.length-1)
ticker_index=0
else
ticker_index++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=dtop){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",toppause)
setTimeout("move3(first2)",toppause)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=decrement
setTimeout("move4(second2)",minipause)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[ticker_index]
if (ticker_index==messages.length-1)
ticker_index=0
else
ticker_index++
}}
function startscroll(){
	if (document.all){
		move3(first2);
		second2.style.top=scrollerheight;
		second2.style.visibility='visible';
	}
	else if (document.layers){
		move1(document.main.document.first);
		document.main.visibility='show';
		document.main.document.second.top=scrollerheight+decrement;
		document.main.document.second.visibility='show';
	}
}

if (document.all){
	document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">');
	document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">');
	document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">');
	document.write(messages[0]);
	document.writeln('</div>');
	document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0;visibility:hidden">');
	document.write(messages[1]);
	document.writeln('</div>');
	document.writeln('</div>');
	document.writeln('</span>');
}
else if (document.layers){
	document.write("<ILAYER id=main visibility='show' background=' "+ scrollerbackground +"' bgColor='" + scrollerbgcolor + "' height='" + scrollerheight + "' width='" + scrollerwidth + "'> <LAYER id=first visibility='show' width='" + scrollerwidth + "' top='1' left='0' bgColor='" + scrollerbgcolor + "'>");
	document.write(messages[0]);
	document.write("</LAYER><LAYER id=second visibility='show' width='" + scrollerwidth + "' top='0' left='0' bgColor='" + scrollerbgcolor + "'>");
	document.write(messages[1]); 
	document.write("</LAYER></ILAYER>");
}
startscroll();

