﻿// JavaScript Document

var message= new Array()

message[0]="<center><b>Folder 2010, </b>|klik hier|../folder2010.html| 'mainFrame' "
message[1]="<center><b>SVR donateur vanaf 1 september 13 euro p/d</b>|klik hier|http://www.camping-neumuhle.lu/svr.html| 'mainFrame' "
message[2]="<center><b>Foto's 2009, </b>|klik hier|../diashow-2009/index.html| '_blank' "

//http://www.youtube.com/watch?v=bzvA6XUEgnY
// The height of the scrollerbox (pixels)
var scrollerheight=30
// The width of the scrollerbox (pixels)
var scrollerwidth=300
// The distance to the top border of the window (pixels)
var scrollertop= 3
// The distance to the left border of the window (pixels)
var scrollerleft= 2
// The padding between the scrollerbox and the text (pixels)
var scrollerpadding=0
// The width of the scrollerbox-border (pixels)
var backgroundborder=0
// The background-colour of the scrollerbox
var scrollerbgcolor="#cccccc"
// Font attributes of the title
var font_titleface="Verdana"
var font_titlecolor="#336699"
var font_titlesize=1
// Font attributes of the copytext
var font_copyface="Verdana"
var font_copycolor="blue"
var font_copysize=1
// standstill between the messages (milliseconds)
var standstillfix=3000
var cliptop=0
var clipbottom=scrollerheight-2*scrollerpadding
var clipleft=0
var clipright=scrollerwidth
var i_message=0
var mes_joined
var mes_split
var contenttext
var contentbg
var totalheight=scrollerheight*(message.length)
var i_height=0
var step=2
var pause=50
var standstillflex=0
function initiate(){
            contenttext="<table cellpadding=0 cellspacing=0 border=0 width="+(scrollerwidth-2*scrollerpadding)+">"
            contenttext+="<tr valign='top'''><td height='"+scrollerheight+"'><br></td></tr>"
            for (i=0;i<=message.length-1;i++) {
                        mes_joined=message[i]
                        mes_split=mes_joined.split("|")
                        contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"+mes_split[0]+"</font><br><a href='"+mes_split[2]+"' target ="+mes_split[3]+" ><font face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"+mes_split[1]+"</font></a></td></tr>"
            }
                       
            contenttext+="</table>"
       
            contentbg="<table cellpadding=0 cellspacing=0  border="+backgroundborder+" width='"+scrollerwidth+"'><tr><td height='"+scrollerheight+"' bgcolor="+scrollerbgcolor+"> </td></tr></table>"
          
			if(document.getElementById){ 
                        document.getElementById('scrollertext').innerHTML=contenttext
                        document.getElementById('scrollerbg').innerHTML=contentbg
                        document.getElementById('scrollertext').style.top=scrollertop+"px";
                        document.getElementById('scrollertext').style.left=scrollerleft+"px";
                        document.getElementById('scrollerbg').style.top=scrollertop-scrollerpadding+"px";
                        document.getElementById('scrollerbg').style.left=scrollerleft-scrollerpadding+"px";
                        document.getElementById('scrollertext').style.clip="rect("+cliptop+"px,"+clipright+"px,"+clipbottom+"px,"+clipleft+"px)"
			}
			else if (document.all) {
                        scrollertext.innerHTML=contenttext
                        scrollerbg.innerHTML=contentbg
                        document.all.scrollertext.style.posTop=scrollertop
                        document.all.scrollertext.style.posLeft=scrollerleft
                        document.all.scrollerbg.style.posTop=scrollertop-scrollerpadding
                        document.all.scrollerbg.style.posLeft=scrollerleft-scrollerpadding
                        document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
            }

            else if (document.layers) {
                        document.scrollertext.document.write(contenttext)
                        document.scrollertext.document.close()
                        document.scrollerbg.document.write(contentbg)
                        document.scrollerbg.document.close()
                        document.scrollertext.top=scrollertop
                        document.scrollertext.left=scrollerleft
                        document.scrollerbg.top=scrollertop-scrollerpadding
                        document.scrollerbg.left=scrollerleft-scrollerpadding    
                        document.scrollertext.clip.left=clipleft
				        document.scrollertext.clip.right=clipright
				        document.scrollertext.clip.top=cliptop
				        document.scrollertext.clip.bottom=clipbottom
            }

            scroll()

}

 

function scroll(){

            standstillflex=standstillfix

            if (document.getElementById) {
                        if (i_height<scrollerheight) {
                                   i_height+=step
                                   cliptop+=step
                                   clipbottom+=step
                                   document.getElementById('scrollertext').style.clip="rect("+cliptop+"px,"+clipright+"px,"+clipbottom+"px,"+clipleft+"px)"
								   h = document.getElementById('scrollertext').style.top
								   strip=/[px]/gi; h = h.replace(strip,''); h = parseInt(h)-step; 
                                   document.getElementById('scrollertext').style.top=h+"px"
                                   var timer=setTimeout("scroll()",pause)
                        }
                        else {
								   h = document.getElementById('scrollertext').style.top
								   strip=/[px]/gi; h = h.replace(strip,''); h = parseInt(h); 
                                   
								   if (h<=-(totalheight)) {
                                               document.getElementById('scrollertext').style.top=scrollertop+"px";
                                               cliptop= 0
                                               clipbottom=scrollerheight-2*scrollerpadding
                                               document.getElementById('scrollertext').style.clip="rect("+cliptop+"px,"+clipright+"px,"+clipbottom+"px,"+clipleft+"px)"
                                               standstillflex=0
                                   }
                                   i_height= 0
                                   clearTimeout(timer)
                                   var timer=setTimeout("scroll()",standstillflex)
                        }			
			}
			else if (document.all){
                        if (i_height<scrollerheight) {
                                   i_height+=step
                                   cliptop+=step
                                   clipbottom+=step
                                   document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                                   document.all.scrollertext.style.posTop-=step
                                   var timer=setTimeout("scroll()",pause)
                        }
                        else {
                                   if (document.all.scrollertext.style.posTop<=-(totalheight)) {
                                               document.all.scrollertext.style.posTop=scrollertop
                                               cliptop= 0
                                               clipbottom=scrollerheight-2*scrollerpadding
                                               document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                                               standstillflex=0
                                   }
                                   i_height= 0
                                   clearTimeout(timer)
                                   var timer=setTimeout("scroll()",standstillflex)
                        }
            }
            else if (document.layers){
				if (i_height<scrollerheight) {
					i_height+=step
					cliptop+=step
					clipbottom+=step
					document.scrollertext.clip.left=clipleft
					document.scrollertext.clip.right=clipright
					document.scrollertext.clip.top=cliptop
					document.scrollertext.clip.bottom=clipbottom
					document.scrollertext.top-=step
					var timer=setTimeout("scroll()",pause)
				}
				else {
						   if (document.scrollertext.top<=-(totalheight)) {
									   document.scrollertext.top=scrollertop
									   cliptop=0
									   clipbottom=scrollerheight-2*scrollerpadding
									   document.scrollertext.clip.left=clipleft
										document.scrollertext.clip.right=clipright
										document.scrollertext.clip.top=cliptop
										document.scrollertext.clip.bottom=clipbottom
									   standstillflex=0
						   }

						   i_height=0
						   clearTimeout(timer)
						   var timer=setTimeout("scroll()",standstillflex)

				}

            }

}