
//Jeff
// www.huntingground.freeserve.co.uk

vs5Arr=[

["images/rp-left-gallery-pic1.jpg","http://www.rocketpropertygroup.com","rocketpropertygroup"],
["images/rp-left-gallery-pic2.jpg","http://www.briansher.com.au","briansher"],
["images/rp-left-gallery-pic3.jpg","http://craftmatic.co.nz","craftmatic"],
["images/rp-left-gallery-pic4.jpg","http://partyballoonsdelivered.com","partyballoonsdelivered"],
["images/rp-left-gallery-pic5.jpg","http://www.aussiecarbrokers.com.au","aussiecarbrokers"],
["images/rp-left-gallery-pic6.jpg","http://howtogetaferrari.com","howtogetaferrari"],
["images/rp-left-gallery-pic7.jpg","http://chinesepropertyguide.com.au","chinesepropertyguide"],
["images/rp-left-gallery-pic8.jpg","http://www.damobilemechanics.com.au","damobilemechanics"],
["images/rp-left-gallery-pic9.jpg","http://ideliverroses.com","ideliverroses"],
["images/rp-left-gallery-pic10.jpg","http://installingsecurity.com","installingsecurity"],
["images/rp-left-gallery-pic11.jpg","http://spanishlessonsreviewed.com","spanishlessonsreviewed"],
["images/rp-left-gallery-pic12.jpg","http://www.pda-handheld.com","pda-handheld"],
["images/rp-left-gallery-pic13.jpg","http://sanitizingbusinessforsale.com","sanitizingbusinessforsale"],
["images/rp-left-gallery-pic14.jpg","http://www.reductasesolution.com","reductasesolution"],
["images/rp-left-gallery-pic17.jpg","http://personal.optus.com.au/web/ocaportal.portal?_nfpb=true&_pageLabel=Template_woRHS&FP=/personal/customerhelp/securitysuite&site=personal","optus"],
["images/rp-left-gallery-pic18.jpg","http://twitter.com/lunaparksydney","Lunapark"],
["images/rp-left-gallery-pic19.jpg","http://convertingyourwebsiteintosales.com/gateway/index.html","Gateway To Wealth "],

]

dir=1 // 0 = up 1 = down
speed=2
imageSize=100  // %
fixedWidth=180 // set a fixed width
fixedHeight=100 // set a fixed height
dualFade=0 // 0 = fades in, 1 = fades out then in

biggest=0
ieBorder=0
sv3Timer=null

lastN=0
count=0
fading=0
fadeStep = 2
fadeSpeed=10
minFadeValue=0

preload=new Array()
for(var i=0;i<vs5Arr.length;i++){
preload[i]=new Image()
preload[i].src=vs5Arr[i][0]
}

function initVS5(){
scrollBox=document.getElementById("scroll_box")
scroll1=document.getElementById("scroller1")

for(var j=0;j<vs5Arr.length;j++){

scroll1.innerHTML+='<a href="'+vs5Arr[j][1]+'" target="_blank"><img id="pic'+j+'" src="'+preload[j].src+'" alt="'+vs5Arr[j][2]+'" title="'+vs5Arr[j][2]+'" onclick="initFade('+j+')"></a><br>'

if(imageSize!=0){ // use percentage size
newWidth=preload[j].width/100*imageSize
newHeight=preload[j].height/100*imageSize
}
else{ // use fixed size
newWidth=fixedWidth
newHeight=fixedHeight
}

document.getElementById("pic"+j).style.width=newWidth+"px"
document.getElementById("pic"+j).style.height=newHeight+"px"

if(document.getElementById("pic"+j).offsetWidth>biggest){
biggest=document.getElementById("pic"+j).offsetWidth
}

}

if(scrollBox.currentStyle&&!window.opera&&document.compatMode!="CSS1Compat"){
ieBorder=parseInt(scrollBox.currentStyle.borderWidth)*2
}


scrollBox.style.width=biggest+ieBorder+"px"

scroll2=document.getElementById("scroller2")
scroll2.innerHTML=scroll1.innerHTML
scroll2.style.top=scroll1.offsetHeight+"px"

if(dir==0){
speed= -speed
}

scrollVS5()
}

function scrollVS5(){
clearTimeout(sv3Timer)

scroll1Pos=parseInt(scroll1.style.top)
scroll2Pos=parseInt(scroll2.style.top)

scroll1Pos+=speed
scroll2Pos+=speed

scroll1.style.top=scroll1Pos+"px"
scroll2.style.top=scroll2Pos+"px"

sv3Timer=setTimeout("scrollVS5()",60)

if(dir==0){
if(scroll1Pos< -scroll1.offsetHeight){
scroll1.style.top=scroll1.offsetHeight+"px"
}

if(scroll2Pos< -scroll1.offsetHeight){
scroll2.style.top=scroll1.offsetHeight+"px"
}
}

if(dir==1){
if(scroll1Pos>parseInt(scrollBox.style.height)){
scroll1.style.top=(scroll2Pos-scroll1.offsetHeight)+"px"
}

if(scroll2Pos>parseInt(scrollBox.style.height)){
scroll2.style.top=(scroll1Pos - scroll2.offsetHeight)+"px"
}
}

}

st=null
function pause(){
clearTimeout(sv3Timer)
clearTimeout(st)
}

function reStartHV5(){
clearTimeout(st)
st=setTimeout("scrollVS5()",100)
}

function initFade(n){
count=n
if(lastN==n||fading==1){return}

if(dualFade==0){fadeValue=0}
else{fadeValue=100}

picNum=n
lastN=n
fadePic()
}

function fadePic(){
displayEl=document.images["bigpic"]
fading=1
fadeValue -= fadeStep
fadeTimer=setTimeout("fadePic()",fadeSpeed)

if(displayEl.filters){displayEl.filters.alpha.opacity=fadeValue}
else{displayEl.style.opacity=(fadeValue/100)-0.1}

if(fadeValue<minFadeValue){ // for fade out first
fadeValue=minFadeValue
fadeStep= -fadeStep
displayEl.src=vs5Arr[picNum][1]
}

if(fadeValue>=100){ // fade in
fadeValue=100
fadeStep= -fadeStep
fading=0
clearTimeout(fadeTimer)
}
}

// add onload="initVS5()" to the opening body tag




