/* 
	JavaScript program for 
 	moving banner display
   	Copyright (c) Roman VIII 2001
  	Version 1
	Nov 2001
  	www.romanviii.co.uk
	info@romanviii.co.uk
*/
bannerTxt = new Array();
bannerURL = new Array();

//***********New Products ********************************************
bannerTxt[0]="<p class=\"jsbnr\">See our demonstration structure . . . </p>"
bannerURL[0]="visit.htm"

bannerTxt[1]="<p class=\"jsbnri\">Arrange site viewing today! . . . </p>"
bannerURL[1]="visit.htm"
bannerTxt[2]="<p class=\"jsbnri\">click here! . . . . .</p>"
bannerURL[2]="visit.htm"
//***************************************************************


topOffset=65;
leftOffset=575;
Width=257;
Align="left";
fontSize="2";
fontFace="Arial";
fontColor="#6E5F97";
typingSpeed=0;
pause=2000;
var whinx=800;
var whiny=600;
var str_idx=-1;
var msg_idx=0;
var html_idx=0;

var divTxt=new Array();



// Do NOT edit below this line.
if (document.all) {
	html_idx=0;
	document.write('<DIV ID="animText" STYLE="position:absolute;width:'+Width+'px;top:'+topOffset+';left:'+leftOffset+';z-index:2; visibility: visible;" ALIGN="'+Align+'"></DIV>');
}
else{
	document.write('<LAYER NAME="animText" WIDTH="'+Width+'" TOP="'+topOffset+'" LEFT="'+leftOffset+'" HEIGHT=\"18\"></LAYER>');
	document.layers["animText"].visibility="visible";
	document.animText.zIndex=3;	
	}
//<A HREF="javascript:newLocation()"><img src="idx_img2/spacer.gif" width="590" height="30" border="0"></a>	

function newLocation() 
{
		//document.location.href = /*"http://www." + */bannerURL[msg_idx];
		window.open(bannerURL[msg_idx], '_top');
}
function autobnr(number, state) 
{
	text=bannerTxt[number]; //get first display line
	thenum=number;

	if (state=="begin") 
	{
		if (str_idx<text.length) 
		{
			str_idx++; //next letter
			//Catch html whole!!
			if (text.charAt(str_idx)=="<") 
			{
				//locate end char
				idx=text.indexOf(">",str_idx+1);
				if(idx!=-1)str_idx=idx; //both point to beyond the next >
			}
			else if	(text.charAt(str_idx)=="&")
			{
				//locate end char
				idx=text.indexOf(";",str_idx+1);
				if(idx!=-1)str_idx=idx; //both point to beyond the end of the beaking space				
			}	
			text2=text.substring(0, str_idx+1); //letter by letter
			divTxt='<a href="'+bannerURL[msg_idx]+'" target=\"_top\">';
			if (document.all) 
			{
				document.all("animText").innerHTML=divTxt+text2+'</a>'
			}
			if (document.layers) 
			{
				/*if(whinx!=window.innerWidth || whiny!=window.innerHeight)
				{
					window.location.reload();
				}
				else
				{*/	
					document.animText.document.write('<DIV>'+divTxt+text2+'</a></DIV>');
					document.animText.document.close();
				//}	
			}
			//Recurs to line end with time out loop
			fnId = setTimeout('autobnr(thenum, "begin")', typingSpeed);
		}
		//end of text string pause
		else {clearInterval(fnId);setTimeout('autobnr(thenum, "end")', pause);str_idx+=1;}
	}
	else if (state=="end") 
	{
		if (str_idx>0) 
		{
			str_idx=-1;
			if (document.all) 
			{
				document.all("animText").innerHTML=divTxt+" "+'</a>'
			}
			if (document.layers) 
			{
				/*if(whinx!=window.innerWidth || whiny!=window.innerHeight)
				{
					window.location.reload();
				}
				else
				{*/
					document.animText.document.write('<div>'+divTxt+"     "+'</a></div>');
					document.animText.document.close();
				//}	
			}
			fnId = setTimeout('autobnr(thenum, "end")', (typingSpeed/4));
		}
		else {
			msg_idx++;
			msg_idx=(msg_idx)%bannerTxt.length;
			clearInterval(fnId);setTimeout('autobnr(msg_idx, "begin")', 50);
		}
	}
}
