// Scripts for Eduardo Moran Website
<!--

//NAVIGATION IMAGE CHANGER
	if (document.images)
		{
			nav0on= new Image(50,24);
			nav0on.src="gfx/HomeOn.jpg";
			nav1on= new Image(100,24);
			nav1on.src="gfx/LessonsOn.jpg";
			nav2on= new Image(140,24);
			nav2on.src="gfx/PerformanceOn.jpg";
			nav3on= new Image(165,24);
			nav3on.src="gfx/AccompanimentOn.jpg";
			nav4on= new Image(90,24);
			nav4on.src="gfx/MediaOn.jpg";
			nav5on= new Image(100,24);
			nav5on.src="gfx/ContactOn.jpg";
			nav6on= new Image(193,24);
			nav6on.src="gfx/LessonsSub1On.jpg";
			nav7on= new Image(214,24);
			nav7on.src="gfx/LessonsSub2On.jpg";
			nav8on= new Image(193,24);
			nav8on.src="gfx/LessonsSub3On.jpg";
			nav9on= new Image(90,24);
			nav9on.src="gfx/LinksOn.jpg";
			
			nav0off= new Image(50,24);
			nav0off.src="gfx/HomeOff.jpg";
			nav1off= new Image(100,24);
			nav1off.src="gfx/LessonsOff.jpg";
			nav2off= new Image(140,24);
			nav2off.src="gfx/PerformanceOff.jpg";
			nav3off= new Image(165,24);
			nav3off.src="gfx/AccompanimentOff.jpg";
			nav4off= new Image(90,24);
			nav4off.src="gfx/MediaOff.jpg";
			nav5off= new Image(100,24);
			nav5off.src="gfx/ContactOff.jpg";
			nav6off= new Image(193,24);
			nav6off.src="gfx/LessonsSub1Off.jpg";
			nav7off= new Image(214,24);
			nav7off.src="gfx/LessonsSub2Off.jpg";
			nav8off= new Image(193,24);
			nav8off.src="gfx/LessonsSub3Off.jpg";
			nav9off= new Image(90,24);
			nav9off.src="gfx/LinksOff.jpg";
		}

	function HoverOn(imgName)
		{
			if (document.images)
			{
				imgOn=eval (imgName + "on.src");
				document[imgName].src= imgOn;
			}
		}
	
	function HoverOff(imgName)
		{
			if (document.images)
			{
				imgOff=eval (imgName + "off.src");
				document[imgName].src= imgOff;
			}
		}

//END OF NAVIGATION IMAGE CHANGER

// Flooble.com's Animated Text script. 
	// Summary of use: 
	//     call animate(tagID, color); where "tagID" is the ID 
	//     of the tag that contains text to be animated,
	//     and "color" is the color to use to highlight the text with.
	//
	// For more information, and detailed instructions, see 
	//     http://www.flooble.com/scripts/animate.php
	//
	// Copyright (c) 2002 by Animus Pactum Consulting Inc.
	// This script comes with no warranties whatsoever. 
	// Animus Pactum Consulting will not be responsible
	// for any damages resulting from its use.

        var ie4 = false;
        if(document.all) {
                ie4 = true; 
        }       
        function setContent(name, value) {
                var d;  
                if (ie4) { 
                        d = document.all[name];
                } else {
                        d = document.getElementById(name);
                }       
                d.innerHTML = value;    
        }       

	function getContent(name) {
		var d;
                if (ie4) {
                        d = document.all[name];
                } else {
                        d = document.getElementById(name);
                }
                return d.innerHTML;
	}

        function setColor(name, value) {
                var d;  
                if (ie4) { 
                        d = document.all[name];
                } else {
                        d = document.getElementById(name);
                }
                d.style.color = value;  
        }

	function getColor(name) {
                var d;
                if (ie4) {
                        d = document.all[name];
                } else {
                        d = document.getElementById(name);
                }
                return d.style.color;
        }

        function animate(name, col) {
		var value = getContent(name);
		if (value.indexOf('<span') >= 0) { return; }
		var length = 0;
                var str = '';
		var ch;
		var token = '';
		var htmltag = false;	
                for (i = 0; i < value.length; i++) {
			ch = value.substring(i, i+1);
			if (i < value.length - 1) { nextch = value.substring(i+1, i+2); } else { nextch = ' '; }
			token += ch;
			if (ch == '<' && '/aAbBpPhHiIoOuUlLtT'.indexOf(nextch) >= 0) { htmltag = true; }
			if (ch == '>' && htmltag) { htmltag = false; }
			if (!htmltag && ch.charCodeAt(0) > 30 && ch != ' ' && ch != '\n') {		
                        	str += '<span id="' + name + '_' + length + '">' + token + '</span>';
				token = '';
				length++;
			}
                }
                setContent(name, str);
                command = 'animateloop(\'' + name + '\', ' + length + ', 0, 1, \'' + col + '\')';
                setTimeout(command , 100);
        }

        function animateloop(name, length, ind, delta, col) {
		var next = ind + delta;
		if (next >= length) { delta = delta * -1; next = ind + delta; }
		if (next < 0) { delta = delta * -1; next = ind + delta; }
                setColor(name + '_' + ind, getColor(name + '_' + next));
                setColor(name + '_' + next, col);
                command = 'animateloop(\'' + name + '\', ' + length + ', ' + next + ', ' + delta + ', \'' + col + '\')';
                setTimeout(command , 100);
        }
//-->

//INLINE IMAGE POPUP

function Lpop(link) {
  var bookWindow;
  bookWindow = window.open(link, "photo", "width=800,height=600,scrollbars=0,resizable=0,location=0,menubar=0,status=0");
  if (bookWindow.open) {
    bookWindow.close;
  }
  bookWindow.focus();
}
function Ppop(link) {
  var bookWindow;
  bookWindow = window.open(link, "photo", "width=600,height=800,scrollbars=0,resizable=0,location=0,menubar=0,status=0");
  if (bookWindow.open) {
    bookWindow.close;
  }
  bookWindow.focus();
}
-->