hs2bArr=[
["images/plastivision/1.gif","images/plastivision/1.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/2.gif","images/plastivision/2.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/3.gif","images/plastivision/3.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/4.gif","images/plastivision/4.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/5.gif","images/plastivision/5.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/6.gif","images/plastivision/6.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/7.gif","images/plastivision/7.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/8.gif","images/plastivision/8.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/9.gif","images/plastivision/9.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/10.gif","images/plastivision/10.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/11.gif","images/plastivision/11.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/12.gif","images/plastivision/12.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/13.gif","images/plastivision/13.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/14.gif","images/plastivision/14.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/15.gif","images/plastivision/15.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/16.gif","images/plastivision/16.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/17.gif","images/plastivision/17.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/18.gif","images/plastivision/18.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/19.gif","images/plastivision/19.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/20.gif","images/plastivision/20.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/21.gif","images/plastivision/21.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/22.gif","images/plastivision/22.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/23.gif","images/plastivision/23.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/24.gif","images/plastivision/24.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/25.gif","images/plastivision/25.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/26.gif","images/plastivision/26.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/27.gif","images/plastivision/27.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/28.gif","images/plastivision/28.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/29.gif","images/plastivision/29.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/30.gif","images/plastivision/30.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/31.gif","images/plastivision/31.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/32.gif","images/plastivision/32.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/33.gif","images/plastivision/33.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/34.gif","images/plastivision/34.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/35.gif","images/plastivision/35.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/36.gif","images/plastivision/36.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/37.gif","images/plastivision/37.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/38.gif","images/plastivision/38.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/39.gif","images/plastivision/39.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/40.gif","images/plastivision/40.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/41.gif","images/plastivision/41.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/42.gif","images/plastivision/42.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/43.gif","images/plastivision/43.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/44.gif","images/plastivision/44.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"],
["images/plastivision/45.gif","images/plastivision/45.gif","PLASTIVISION &nbsp;&nbsp; INDIA &nbsp;&nbsp; 2007"]
]

thumbWidth=120
thumbHeight=80
thumbSpace=5 // space between thumbs

doFade=1 // 0 = no fade 1 = apply fade effect
dualFade=0 // 0 = fades in, 1 = fades out then in

var preloadhs2bPics=[]
for(var i=0;i<hs2bArr.length;i++) {
preloadhs2bPics[i]=new Image()
preloadhs2bPics[i].src=hs2bArr[i][1]
}

function initHS2bFade(){
thumbPos=[]
defaultSpeed=20
step=defaultSpeed
thumbScrollerWidth=0

mainCont=document.getElementById("container")
bigPic=document.getElementById("hs2b_big_pic")
thumbContainer=document.getElementById("thumb_container")
thumbScroller=document.getElementById("thumb_scroller")

for(var i=0;i<hs2bArr.length;i++){
newImg=document.createElement("IMG")
newImg.setAttribute("id","pic"+i)
newImg.setAttribute("src",hs2bArr[i][0])
newImg.style.width=thumbWidth+"px"
newImg.style.height=thumbHeight+"px"
newImg.style.marginRight=thumbSpace+"px"
newImg.i=i
newImg.onclick=function(){swapHS2bPic(this.i)}
thumbScroller.appendChild(newImg)

if(i==0){newImg.style.borderColor="white"}

thumbScrollerWidth+=(newImg.offsetWidth+thumbSpace)
thumbPos[i]=(thumbScrollerWidth-newImg.offsetWidth)-thumbSpace // get image positions
}

//bigPic.style.width=parseInt(mainCont.style.width)

var el = document.getElementById("pic0")
isBorder=0
if(document.uniqueID && el.currentStyle){
isBorder=el.currentStyle.borderWidth
}

if(document.defaultView && document.defaultView.getComputedStyle){
isBorder=document.defaultView.getComputedStyle(el, '').getPropertyValue("border-top-width")
}

thumbContainer.style.width=(thumbWidth*3)+(thumbSpace*2)+((parseInt(isBorder)*2)*3)+"px"
thumbContainer.style.height=thumbHeight+(parseInt(isBorder)*2)+"px"
//thumbContainer.style.marginLeft=(mainCont.offsetWidth-thumbContainer.offsetWidth)/2+"px"
thumbContainer.style.clip="rect(0,"+(thumbContainer.offsetWidth+"px")+","+(thumbHeight+"px")+",0)"

thumbScroller.style.width=thumbScrollerWidth+"px"

halfWay=thumbContainer.offsetWidth/2

bigPic.src=hs2bArr[0][1]
document.getElementById("hs2b_text").innerHTML=hs2bArr[0][2]
}

function hs2bCurPos(e,id){
if(running==1){return}
e = e || window.event

if(e.clientX){
cursorX=e.clientX
cursorY=e.clientY
}
else{
cursorX=e.pageX - document.body.scrollLeft
cursorY=e.pageY - document.body.scrollTop
}

targetID=document.getElementById("thumb_container")

elPosX = targetID.offsetLeft
elPosY = targetID.offsetTop
parent_el = targetID.offsetParent

while (parent_el != null){
elPosX += parent_el.offsetLeft
elPosY += parent_el.offsetTop
parent_el = parent_el.offsetParent
}

divCurX=(cursorX-elPosX)+document.body.scrollLeft
divCurY=(cursorY-elPosY)+document.body.scrollTop
}

lastC=0

function swapHS2bPic(n){
if(running==1 || fading==1||lastC==n){return}
if(divCurX<thumbWidth){scrollHS2bFade(0)}
if(divCurX>thumbContainer.offsetWidth-thumbWidth){scrollHS2bFade(1)}

if(lastC!=null){document.getElementById("pic"+lastC).style.borderColor=""}
document.getElementById("pic"+n).style.borderColor="white"
lastC=n

if(doFade==1){
if(dualFade==0){fadeValue=0}
else{fadeValue=100}
picNum=n
fadeHS2bPic()
}
else{
bigPic.src=hs2bArr[n][1]
}

document.getElementById("hs2b_text").innerHTML=hs2bArr[n][2]

}

timer=""
count= 0
running=0
counted=0

function scrollHS2bFade(dir){
clearTimeout(timer)

thumbScrollerPos=parseInt(thumbScroller.style.left)
if(running==0){

if(dir==1){

if(thumbScrollerPos==0 && thumbPos[count]<halfWay){
count++
counted=1
scrollHS2bFade(dir)
return
}

if(counted==0){count++}
/*
if(count==hs2bArr.length-1){alert("1");return}
else if(thumbScrollerPos== -(thumbScrollerWidth-thumbContainer.offsetWidth)){alert("2");return}
else{if(counted==0){count++;alert("3")}}
*/
}

counted=0

if(dir==0){

if(count==0){return}
else{count--}

}

}

running=1

if(dir==1){thumbScrollerPos-=step}
else{thumbScrollerPos+=step}

thumbScroller.style.left=thumbScrollerPos+"px"
timer=setTimeout("scrollHS2bFade("+dir+")",50)

imgStartPos= -thumbPos[count]+(halfWay-(document.getElementById("pic"+count).offsetWidth/2))

if(dir==1&&thumbScrollerPos<imgStartPos+step){
thumbScroller.style.left=imgStartPos+"px"
clearTimeout(timer)
running=0
}

if(thumbScrollerPos< -(thumbScrollerWidth-thumbContainer.offsetWidth)){ // if at right end
thumbScroller.style.left= -(thumbScrollerWidth-thumbContainer.offsetWidth)+thumbSpace+"px"
clearTimeout(timer)
running=0
count=hs2bArr.length-2
}

if(dir==0){
if(thumbScrollerPos>imgStartPos-step){ // if at next left position
thumbScroller.style.left=imgStartPos+"px"
clearTimeout(timer)
running=0
}

if(thumbScrollerPos>=0){ // when scrolling left, if next image is < half display width and image box = zero
thumbScroller.style.left=0+"px"
clearTimeout(timer)
running=0
}

}

}

fading=0
fadeStep = 4
minFadeValue=0

function fadeHS2bPic(){
fading=1
fadeValue -= fadeStep
fadeTimer=setTimeout("fadeHS2bPic()",10)

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

if(fadeValue<minFadeValue){
fadeValue=minFadeValue
fadeStep= -fadeStep
bigPic.src=hs2bArr[picNum][1]
}

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

// add onload="initHS2bFade()" to the opening BODY tag

// -->