// JavaScript Document
// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs)
{
var imageSeparator = imageFiles.indexOf(";");
var nextImage = imageFiles.substring(0,imageSeparator);
 //nextImage="images/TransiPIM/"+nextImage;
if (document.all)
{
document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
document.getElementById(pictureName).filters.blendTrans.Apply();
}
document.getElementById(pictureName).src = nextImage;
if (document.all)
{
document.getElementById(pictureName).filters.blendTrans.Play();
}
var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
+ ';' + nextImage;
setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
displaySecs*1000);
// Cache the next image to improve performance.
imageSeparator = futureImages.indexOf(";");
nextImage = futureImages.substring(0,imageSeparator);
if (slideCache[nextImage] == null) {
slideCache[nextImage] = new Image;
slideCache[nextImage].src = +nextImage;
}
}
function RunSlideShow2(pictureName,imageFiles,displaySecs)
{
var imageSeparator = imageFiles.indexOf(";");
var nextImage = imageFiles.substring(0,imageSeparator);
 //nextImage="images/TransiPIM/"+nextImage;
if (document.all)
{
document.getElementById(pictureName).style.filter="blendTrans(duration=0.5)";
document.getElementById(pictureName).filters.blendTrans.Apply();
}
document.getElementById(pictureName).src = nextImage;
if (document.all)
{
document.getElementById(pictureName).filters.blendTrans.Play();
}
var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
+ ';' + nextImage;
setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
displaySecs*1000);
// Cache the next image to improve performance.
imageSeparator = futureImages.indexOf(";");
nextImage = futureImages.substring(0,imageSeparator);
if (slideCache[nextImage] == null) {
slideCache[nextImage] = new Image;
slideCache[nextImage].src = +nextImage;
}
}

if (document.all) {

var counter
yourLogo = "  Esperamos que pases un buen dia  ";
logoFont = "Arial";
logoColor = "#FFFFFF";
yourLogo = yourLogo.split('');
L = yourLogo.length; 
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 150;
logoHeight = -20;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('<div id="outer" style=" z-index:1;display:none;position:absolute;top:0px;left:0px"><div style="z-index:1;position:absolute;top:0px;left:0px;">');
for (i = 0; i < L; i++) {
document.write('<div id="ie" style="z-index:10;position:absolute;top:200px;left:200px;'
+'width:10px;height:10px;font-family:'+logoFont+';font-size:20px;'
+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>');
}
document.write('</div></div>');

function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}

function animateLogo() {
//document.onmousemove=Mouse;
ypos=675;
xpos=150;
outer.style.pixelTop = document.body.scrollTop; 
for (i = 0; i < L; i++) {
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);
Sz[i] = ie[i].style.pixelTop - ypos;
if (Sz[i] < 5) Sz[i] = 8;
ie[i].style.fontSize = Sz[i] / 1.0;
}
outer.style.display="block";
currStep -= step;
counter=setTimeout('animateLogo()', 40);
}

function parar(){
window.clearTimeout(counter);
outer.style.display="none";
}
}

