
// CREDITS:
// Fullpage Background-Ticker 2.1 by Peter Gehrig 
// Copyright (c) 2004 Peter Gehrig. 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.com & http://www.designerwiz.com.
// info@24fun.com
// 1/8/2004

// IMPORTANT: 
// If you add this script to a script-library or a script-archive 
// you have to insert a link to http://www.24fun.com right into the webpage where the script
// will be displayed.

// Set your messages. You may add as many messages as you like.
var message=new Array()
message[0]="We are open 8:00 to 5:00 daily except on Christmas Day, New Years day and Good Friday."
message[1]="We have introduced three new levels of Pet Care: GOLD, SILVER & BRONZE. Details are on 'Prices' page."
message[2]="Please sign our Guest Book. We welcome your comments."
message[3]="You can also use our online booking form. We will respond within 24 hours or the next business day to confirm."
message[4]="Join our new Discussion Forum. Start a discussion or enter an existing thread." 

//message[3]='<nobr><font face="Arial">Thank you for visiting <a href="http://www.homesteadkennels.com.au">Homestead Kennels.</a> //To make online booking <a href="index.cfm?/booking/">click here.</a></font></nobr>'

// Set font-family of the text
var fnt="Arial"

// Set font-size of the text (CSS-values)
var fntsize="small"

// Set font-color of the text
var fntcolor="Yellow"

// Set font-color of the last letter of the ticker
var fntcolorlastletter="Yellow"

// Set font-weight. Set a value between 1 to 9 to adjust the boldness
var fntweight=8

// Set standstill between the messages (seconds)
var standstill=2

// Set speed (higher=slower)
var speed=120

// the top-position of the ticker (distance to the border on top, pixels)
var topposition=121

// the left-position of the ticker (distance to the border on the left, pixels)
var leftposition=185

// Do not edit the variables below
var tickerwidth
var tickerheight
var i_substring=0
var i_presubstring=0
var i_message=0
var messagecontent=""
var messagebackground=""
var messagepresubstring=""
var messageaftersubstring=""
fntweight=fntweight*100
standstill*=1000

var browserinfos=navigator.userAgent 
var me4=document.all&&!document.getElementById&&!browserinfos.match(/Opera/)
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns4=document.layers
var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)
var opera=browserinfos.match(/Opera/)  
var browserok=me4||ie5||ns4||ns6||opera

for (i=0;i<=message.length-1;i++) {
	message[i]=message[i]+" "
}

function initiateticker() {
	if (me4) {	
		tickerwidth="650"
		tickerheight="22"
//		tickerheight=document.body.clientHeight-5
//    	tickerwidth=document.body.clientWidth-5
		document.all.ticker.style.posLeft=leftposition
		document.all.ticker.style.posTop=topposition
		showticker()
	}
	if (ie5 || opera) {	
		tickerwidth="650"
		tickerheight="22"
//		tickerheight=window.innerHeight-10
//    	tickerwidth=window.nnerWidth-10
		document.getElementById('ticker').style.left=leftposition
		document.getElementById('ticker').style.top=topposition
		showticker()
	}
	if (ns4) {
		tickerwidth="650"
		tickerheight="22"
//		tickerheight=window.innerHeight-10
//    	tickerwidth=window.innerWidth-10
		document.ticker.left=leftposition
		document.ticker.top=topposition
		showticker()
	}
	if (ns6) {
		tickerwidth="650"
		tickerheight="22"
//		tickerheight=window.innerHeight-10
//    	tickerwidth=window.innerWidth-10
		document.getElementById('ticker').style.left=leftposition
		document.getElementById('ticker').style.top=topposition
		getmessagecontentNS6()
	}
}

function getmessagecontent() {
	messagepresubstring=message[i_message].substring(0,i_presubstring)
	messageaftersubstring=message[i_message].substring(i_presubstring,i_substring)
	messagecontent="<table border=0 width="+tickerwidth+" height="+tickerheight+"><tr><td valign=top>"
	messagecontent+="<span style='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsize+"pt;font-weight:"+fntweight+"'>"	
	messagecontent+="<font color='"+fntcolor+"'>"
	messagecontent+=messagepresubstring
	messagecontent+="</font>"
	messagecontent+="</span>"
	messagecontent+="<span style='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsize+"pt;font-weight:900'>"	
	messagecontent+="<font color='"+fntcolorlastletter+"'>"
	messagecontent+=messageaftersubstring
	messagecontent+="</font>"
	messagecontent+="</span>"
	messagecontent+="</td></tr></table>"
}

function getmessagecontentNS6() {
	messagecontent="<table border=0 width="+tickerwidth+" height="+tickerheight+"><tr><td valign=top>"
	messagecontent+="<span style='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsize+"pt;font-weight:"+fntweight+"'>"	
	messagecontent+="<font color='"+fntcolor+"'>"
	messagecontent+=message[i_message]
	messagecontent+="</font>"
	messagecontent+="</span>"
	messagecontent+="</td></tr></table>"
	showtickerNS6()
}

function showticker() {
	if (i_substring<=message[i_message].length-1) {
			i_substring++
			i_presubstring=i_substring-1
			if (i_presubstring<0) {i_presubstring00}
			getmessagecontent()
		if (me4) {
			ticker.innerHTML=messagecontent
			var timer=setTimeout("showticker()", speed)
		}
		if (ie5 || opera) {
			document.getElementById('ticker').innerHTML=messagecontent
			var timer=setTimeout("showticker()", speed)
		}

		if (ns4) {
			document.ticker.document.write(messagecontent)
			document.ticker.document.close()
			var timer=setTimeout("showticker()", speed)
		}
	}
	else {
		clearTimeout(timer)
		var timer=setTimeout("changemessage()", standstill)
	}
}

function showtickerNS6() {
	document.getElementById('ticker').innerHTML=messagecontent
	i_message++
	if (i_message>message.length-1) {i_message=0}
	var timer=setTimeout("getmessagecontentNS6()", 2*standstill)
}

function changemessage() {
	i_substring=0
	i_presubstring=0
	i_message++
	if (i_message>message.length-1) {
		i_message=0
	}
	showticker()
}




//Drop-in slideshow II (hyperlinked)- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var slideshow_width=250 //SET SLIDESHOW WIDTH (set to largest image's width if multiple dimensions exist)
var slideshow_height=90 //SET SLIDESHOW HEIGHT (set to largest image's height if multiple dimensions exist)
var pause=5000 //SET PAUSE BETWEEN SLIDE (2000=2 seconds)


var dropimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
dropimages[0]="images/hk_lenni_250x90.jpg"
dropimages[1]="images/hk_dogcare_250x90.jpg"
dropimages[2]="images/hk_dogtraining_250x90.jpg"
dropimages[3]="images/hk_playtime_250x90.jpg"
dropimages[4]="images/hk_pettaxi_250x90.jpg"
dropimages[5]="images/hk_catcare_250x90.jpg"
dropimages[6]="images/hk_grooming_250x90.jpg"
dropimages[7]="images/hk_blackies2_250x90.jpg"
dropimages[8]="images/hk_cooldogs_250x90.jpg"
dropimages[9]="images/hk_awardwinning_250x90.jpg"


var droplinks=new Array()
//SET IMAGE URLs. Extend or contract array as needed
droplinks[0]="index.cfm?/ourdogs/"
droplinks[1]="index.cfm?/dogcare/"
droplinks[2]="index.cfm?/training/"
droplinks[3]="index.cfm?/exercise/"
droplinks[4]="index.cfm?/transport/"
droplinks[5]="index.cfm?/catcare/"
droplinks[6]="index.cfm?/grooming/"
droplinks[7]="index.cfm?/blackrussianterriers/"
droplinks[8]="index.cfm?/ourdogs/"
droplinks[9]="index.cfm?/austawards/"



////NO need to edit beyond here/////////////

var preloadedimages=new Array()
for (p=0;p<dropimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=dropimages[p]
}

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||dom)
document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:-'+slideshow_height+'"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:-'+slideshow_height+'"></div></div>')
else
document.write('<a href="javascript:rotatelink()"><img name="defaultslide" src="'+dropimages[0]+'" border=0></a>')

var curpos=slideshow_height*(-1)
var degree=10
var curcanvas="canvas0"
var curimageindex=0
var nextimageindex=1


function movepic(){
if (curpos<0){
curpos=Math.min(curpos+degree,0)
tempobj.style.top=curpos
}
else{
clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML='<a href="'+droplinks[curimageindex]+'"><img src="'+dropimages[curimageindex]+'" border=0></a>'
nextimageindex=(nextimageindex<dropimages.length-1)? nextimageindex+1 : 0
setTimeout("rotateimage()",pause)
}
}

function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
var temp='setInterval("movepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=dropimages[curimageindex]
linkindex=curimageindex
curimageindex=(curimageindex<dropimages.length-1)? curimageindex+1 : 0
}

function rotatelink(){
window.location=droplinks[linkindex]
}

function resetit(what){
curpos=slideshow_height*(-1)
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
crossobj.style.top=curpos}

function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML='<a href="'+droplinks[curimageindex]+'"><img src="'+dropimages[curimageindex]+'" border=0></a>'
rotateimage()
}

function startitall(){
	initiateticker()
	startit()
	
}

if (ie4||dom)
window.onload=startitall
else
setInterval("rotateimage()",pause)


//if (ie4||dom)
//window.onload=startit
//else
//setInterval("rotateimage()",pause)

//if (browserok) {window.onload=initiateticker}

