

// CREDITS:
// Simple UpNews Scroller by Urs Dudli and Peter Gehrig
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.ch.
// info@24fun.ch
// 3/15/2000

// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a hyperlink to http://www.24fun.ch on the webpage
// where this script will be running.

// INSTALLATION:
// 1.	Delete the DIV-container with the id 'deletethisdiv'.
//		This is the only part of this file that is not required for the script.
//		Save the file.
// 2.	Configure the messages. Let's take a look at the first message to understand
//		its principle:
//		- '	Madonna Storms UK Charts' is the title. Then follows a '|'.
//		-	Then follows the copytext 'Girl band All Saints were knocked off
//			the top spot in the British charts on Sunday by the queen of girl
//			power herself.'
//		-	Then again follows a '|'.
//		-	Then follows the link for the message: http://www.24fun.ch.
//		As you see the '|' acts as delimiter between title, copytext and link!
// 3.	Configure the variables below:

var message= new Array()

// Please read section 2 above on how the messages have to be configured.
// You may add as many messages as you like!
 message[0]="|The Suarez's <BR> Your villa was beautiful and extremely comfortable providing us with a perfect"
 message[0]=message[0]+"sanctuary for a much needed break. <BR>Lurlene is worth her weight in gold! She took the best care of us."
message[0]=message[0]+"Clarke couldn't have done more for us. We ended up hiring him as a driver during our stay."
message[0]=message[0]+"He took us over the country and filled us in on life in Jamaica. Between the two of them we couldn't lose...."
message[0]=message[0]+"<BR> We hope to return to Jamaica many times in the years to come. Of course, we\'ll stay at the Burlingame Villa!|"  ;



message[1]="|The Grant's <BR> Thank you so much for the use of your villa and staff. Everyone enjoyed themselves."
message[1]= message[1]+"Lurlene and Clinton were great!! The food was excellent!!! I am so happy with everything. "
message[1]= message[1]+"<BR> Again, thank you.|"

message[2]="|The DaCosta's <BR> Got back yesterday. Just want to let you know you have a wonderful staff and"
message[2]=message[2]+" a wonderful place. Lurlene and Clinton were great. The Villa is exactly what's advertized. "
message[2]=message[2]+"My brothers and I were very happy. It was six years since we've been back to JA... We are now"
message[2]=message[2]+" looking forward in taking a trip annually. <BR> Thanks again...|"



// The height of the scrollerbox (pixels)
var scrollerheight=175

// The width of the scrollerbox (pixels)
var scrollerwidth=570

// The distance to the left border of the window (pixels)
var scrollertop=450

// The distance to the top border of the window (pixels)
var scrollerleft=250

// The padding between the scrollerbox and the text (pixels)
var scrollerpadding=10

// The width of the scrollerbox-border (pixels)
var backgroundborder=  "5"

// The background-colour of the scrollerbox
var scrollerbgcolor= 0

// Font attributes of the title
var font_titleface="Verdana"
var font_titlecolor="F8F609"
var font_titlesize=3

// Font attributes of the copytext
var font_copyface="Verdana"
var font_copycolor="F8F609"
var font_copysize=2

// standstill between the messages (milliseconds)
var standstillfix=3000

// Do not edit below this line
var cliptop=0
var clipbottom=scrollerheight-(2*scrollerpadding)
var clipleft=0
var clipright=scrollerwidth-(2*scrollerpadding)

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=1
var pause=20

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+"'><a class='textscroll' href='"+mes_split[2]+"'><font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"+mes_split[0]+"</font></a><br><font face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"+mes_split[1]+"</font></td></tr>"
	}
	contenttext+="</table>"

	contentbg="<table cellpadding=0 cellspacing=0 border="+backgroundborder+" width='"+scrollerwidth+"'><tr><td height='"+scrollerheight+"' bgcolor="+scrollerbgcolor+">&nbsp;</td></tr></table>"

	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+")"
	}
	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.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)
		}
	}

		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)
		}
	}
}

