/*************************************************************************************
This script made by and copyrighted to Peter Svendsen.
This script may be used freely as long as this message is intact
*************************************************************************************/
var mess=new Array();
var time=new Array();
var fade=new Array();
var link=new Array();
/*************************************************************************************
Don't edit the above varibles.
Below here are the variables wich you can adjust. 
Remember ..... if you want to change anything concerning looks of the text, do so in
the "style"-section. Comments are made for the different adjustment options!
Note that a new version is underway, giving more options, possibly based on feedback.
*************************************************************************************/

				/*** Enter the text to be faded. ***/
mess[0]="In februari is ons nieuwste verkoopconcept gestart, kijk snel op www.centraalwoonstation.nl.";

/*** Write the site you want the text to point to. If you dont want it to link, enter "0".      ***/
/*** The text stops functioning as a link when fadeout starts(after duration of below variable. ***/
link[0]="0";

/*** Enter the duration in which the text will be displyed in last color, after fadein.    ***/
/*** If a link is attached to the text, the text will function as a link during this time. ***/
time[0]=4000;  //milliseconds

/*** Enter the time you want blank screen(startcolor) before displaying the next text.     ***/
/*** If text 5 is a continuation of text 4, enter a short time for text 4.   E.g. 200      ***/
fade[0]=500; //milliseconds

mess[1]="Scherpe hypotheekrentes, 10 jaar vast met NHG al vanaf 4,7%!!!.";
link[1]="0";
time[1]=4000;
fade[1]=500;

mess[2]="Kent u de 7 redenen om nu een huis te kopen? Koopprijzen staan onder druk, de hypotheekrente is laag, de NHG-norm is verruimd, koopsubsidie is nog steeds mogelijk, meer keus dus meer kans op uw droomhuis, als koper heeft u een beter onderhandelingspositie, met de NVM No-Riskclausule voorkomt u dubbele lasten!!.";
link[2]="0";
time[2]=4000;
fade[2]=500;
/***
mess[3]="Sinds mei is onze dienstverlening uitgebreid. Met een team van specialisten assisteren wij bij bedrijfsovernames.";
link[3]="0";
time[3]=4000;
fade[3]=500;

mess[4]="Wilt u uw bedrijf te koop aanbieden? Wij komen graag langs voor een Quick-scan en een vrijblijvend gesprek.";
link[4]="0";
time[4]=4000;
fade[4]=500;

mess[5]="Nieuw in de verkoop: Zeijen, Oude Norgerweg 5a, nette vrijstaande woning met prachtige tuin net buiten het dorp.";
link[5]="0";
time[5]=4000;
fade[5]=500;

mess[6]="Binnen 1 week verkocht: Smilde, Lijsterstraat 21, halvrijstaande woning met garage.";
link[6]="0";
time[6]=4000;
fade[6]=500;

mess[7]="Nieuw in de verkoop: Oosterwolde, Kringgreppelstraat 15, bijzondere gemoderniseerde tussenwoning aan rustige hof.";
link[7]="0";
time[7]=4000;
fade[7]=500;

mess[8]="Ons kantoor is geopend op werkdagen van 8.45 uur t/m 17.15 uur. Telefonisch bereikbaar via (0592) 414 454 op werkdagen van 8.30 uur tot en met 20.00 uur, op zaterdag van 10.00 uur t/m 13.00 uur.";
link[8]="0";
time[8]=4000;
fade[8]=500;

mess[9]="Tijdens schoolvakanties is ons kantoor ’s middags vanaf 15.30 uur gesloten. Telefonisch blijven wij uiteraard bereikbaar.";
link[9]="0";
time[9]=4000;
fade[9]=500;***/

/*** Here you put the colors to be used in the fade. You can ofcourse add as many as liked by entering: ***/
/*** " colors[incrementing number]='hexcode' " incrementing the number from 6.                          ***/
/*** Color 6 will be the last on fadein and vice versa on fadeout ;-) Make first color match background ***/
colors=new Array()
colors[0]='#EEEEEE'
colors[1]='#CCCCCC'
colors[2]='#C0C0C0'
colors[3]='#999999'
colors[4]='#666666'
colors[5]='#333333'
colors[6]='#000000'

/*** Enter here the speed between changes in color. The shorter time yieds the smoother fade. ***/
/*** Better if more than the original 6 colors in colorarray.                                 ***/
/*** E.g. 12 fadecolors and fadespeed of approx. 100                                          ***/
var fadespeed=150;

/*** Do you want fadeout as well? Or just a fadein of a new text? Or maybe just fadeout!      ***/
/*** 0 = just fadein's, no fadeout. 1 = fade in and out. 2 = only fadeouts                    ***/
var fadeout=1;

/*** Do you wish the link to be presented with a picture? Note the path for the pic if yes.   ***/
/*** If you don't want a picture along with the presentation of the link, just enter "" .     ***/
var path="lillehand.gif"

/*************************************************************************************
Here comes the 'privat part'......................    Don't change ANYTHING below this.
**************************************************************************************/
var count=0;var newsno=0;var pause=0;var progress=0;var first=0;var pic;
(path!="")?pic= "<br><IMG border='0' src='"+path+"'>": pic="";

function fade_in()
{first=1;	if(link[newsno]==0)document.all("txtNews").innerHTML="<FONT color='"+colors[count]+"'>"+mess[newsno].substring(0,mess[newsno].length)+"</FONT>";
	else document.all("txtNews").innerHTML="<A href='"+link[newsno]+"' target='idokument' style='text-decoration: none'><FONT color='"+colors[count]+"'>"+mess[newsno].substring(0,mess[newsno].length)+"</FONT></A>"+pic;  //width='20' height='26'
	count++;if(count!=colors.length){progress=0;pause=fadespeed;} else{if(fadeout==0){	pause=time[newsno];progress=0;count=0;newsno++;}
	else{progress=1;pause=time[newsno];}if(newsno>=mess.length){newsno=0;}}watchit();
}

function fade_out()
{document.all("txtNews").innerHTML="<FONT color='"+colors[count]+"'>"+mess[newsno].substring(0,mess[newsno].length)+"</FONT>";
	count--;if(count!=-1){progress=1;pause=fadespeed;}
	else{pause=fade[newsno];progress=0;count=0;first=0;newsno++;
	if(newsno>=mess.length){newsno=0;}}watchit();
}

function watchit()
{if(progress==0){if((fadeout==2)&&(first==0))count=mess.length-1;if(count<=colors.length)aktiv=setTimeout("fade_in()",pause);}
if((progress==1)&&(fadeout>=1)){clearTimeout(aktiv);if(count>=colors.length)count=colors.length-1;if(count!=-1)aktiv=setTimeout("fade_out()",pause);}
}

/***************************
The script fades out .......
***************************/
/*** Please give feedback and/or a url to where you're using the script so i can see it function ***/
/*** Do so on nesdnevs@hotmail.com ***/

