
// realised by apachejeff
// www.huntingground.freeserve.co.uk

display_width=228 // set to the largest image width
display_height=258 // user choice

margin_top=0 // image top space
margin_left=0 // image left space
margin_right=0 // image right space
margin_bottom=4 // image bottom space

css_pos=1 // use CSS to position the display 0 = no 1 = yes
css_left=0 // used if css_positioning is selected
css_top=0 // used if css_positioning is selected

speed=1
rdm_img=0 // 0 = no 1 = yes show images at random
new_window=0 // 0 = no 1 = yes Open a new window for links
offset_time=5 // 
scrolling=0

data=new Array()
data[0]=new Array("../assets/uk_map_5.png","Free Steak Offer","../steak_offer.htm")
data[1]=new Array("","<center><div class=\"bodytext scrollspan\"><img src=../assets/scroll-button-arrow-o.gif border=0> Too far to travel? Its worth going the extra mile.</div></center>","http://www.clean-image.co.uk/extramile.htm")
data[2]=new Array("","<center><div class=\"bodytext scrollspan\"><img src=../assets/scroll-button-arrow-g.gif border=0> Are you wondering what you are going to do in Chelmsford while we work on your car? <u>There\'s loads to do!</u></div></center>","http://www.clean-image.co.uk/chelmsford/index.htm")
data[3]=new Array("","<center><div class=\"bodytext scrollspan\"><img src=../assets/scroll-button-arrow-o.gif border=0> We can help you get your car here - click here to see our transport options.</div></center>","http://www.clean-image.co.uk/transporter.htm")

preloadimages=new Array()
for (i=0;i<data.length;i++) {
preloadimages[i]=new Image()
preloadimages[i].src=data[i][0]
}

if(rdm_img==1){

temp_array=new Array()
for(i=0;i<data.length;i++){
temp_array[i]=data[i]
}

rdm_array=new Array()
for(p=0;p<data.length;p++){
rndnum=Math.floor(Math.random()*(temp_array.length))
rdm_array[p]=temp_array[rndnum]
temp_array.splice(rndnum,1)
}

}

function init_scroller(){
if(css_pos==0){
document.write('<div style="position:absolute;width:'+(display_width+margin_left+margin_right)+'px; height:'+display_height+'px;clip:rect(0,'+(display_width+margin_left+margin_right)+','+display_height+',0); overflow:hidden;border:0px solid blue;text-align:left">')
}
else{
document.write('<div style="position:absolute;left:6px;top:0px;width:'+(display_width+margin_left+margin_right)+'px; height:'+display_height+'px;clip:rect(0,'+(display_width+margin_left+margin_right)+','+display_height+',0); overflow:hidden;border:0px solid blue;text-align:left">')
}

document.write('<div id="holder1" style="position:absolute;text-align:center;border:0px solid red">')
for(i=0;i<data.length;i++){

if(rdm_img==1){
document.write('<a id="loc_'+[i]+'" href="" onclick="newwin(\''+rdm_array[i][2]+'\');return false" onmouseover="stopme()" onmouseout="scrollme()">')

if(rdm_array[i][0]==""){
document.write('<div style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px">'+rdm_array[i][1]+'</div>') // show text only
}
else{document.write('<img src="'+rdm_array[i][0]+'" border=0 style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px" alt="'+rdm_array[i][1]+'">') // show image
}

document.write('</a><br>')
}
else{
document.write('<a id="loc_'+[i]+'" href="" onclick="newwin(\''+data[i][2]+'\');return false" onmouseover="stopme()" onmouseout="scrollme()">')

if(data[i][0]==""){
document.write('<div style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px">'+data[i][1]+'</div>') // show text only
}
else{document.write('<img src="'+data[i][0]+'" border=0 style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px" alt="'+data[i][1]+'">') //show image
}

document.write('</a><br>')
}

}
document.write('</div>')

document.write('<div id="holder2" style="position:absolute;text-align:center;border:0px solid blue">')
for(i=0;i<data.length;i++){

if(rdm_img==1){
document.write('<a id="loc_'+[i]+'" href="" onclick="newwin(\''+rdm_array[i][2]+'\');return false" onmouseover="stopme()" onmouseout="scrollme()">')

if(rdm_array[i][0]==""){
document.write('<div style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px">'+rdm_array[i][1]+'</div>') // show text only
}
else{document.write('<img src="'+rdm_array[i][0]+'" border=0 style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px" alt="'+rdm_array[i][1]+'">') // show image
}

document.write('</a><br>')
}
else{
document.write('<a id="loc_'+[i]+'" href="" onclick="newwin(\''+data[i][2]+'\');return false" onmouseover="stopme()" onmouseout="scrollme()">')

if(data[i][0]==""){
document.write('<div style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px">'+data[i][1]+'</div>') // show text only
}
else{
document.write('<img src="'+data[i][0]+'" border=0 style="margin-top:'+margin_top+'px;margin-right:'+margin_right+'px; margin-bottom:'+margin_bottom+'px;margin-left:'+margin_left+'px" alt="'+data[i][1]+'">') // show image
}

document.write('</a><br>')
}

}
document.write('</div>')

document.write('</div>')

obj1=document.getElementById("holder1")
obj2=document.getElementById("holder2")

setTimeout("start_scroller()",offset_time*1000)

}

function start_scroller(){
obj1.style.top=obj2.offsetTop+obj2.offsetHeight
scrolling=1
scrollme()
}

tt=""
pos= -speed
function scrollme(){
if(scrolling==0){return}

obj1pos=obj1.offsetTop
obj2pos=obj2.offsetTop

obj1pos+=pos
obj2pos+=pos

obj1.style.top=obj1pos
obj2.style.top=obj2pos

tt=setTimeout("scrollme()",50)

if(parseInt(obj1.style.top)< -obj1.offsetHeight){
obj1.style.top=obj2.offsetTop+obj2.offsetHeight
}

if(parseInt(obj2.style.top)< -obj2.offsetHeight){
obj2.style.top=obj1.offsetTop+obj1.offsetHeight
}

}

function stopme(){
clearTimeout(tt)
}

function newwin(loc){
if(loc==""){return}
if(new_window==0){
location=loc
}
else{
window.open(loc)
//window.open(loc,'','left=130,top=270,width=400,height=200,location=yes') // use for specific size and positioned window
}
}


