imageSize=100 // % size the image is shown at, if set to zero the fixed width and heights are used
fixedWidth=100 // set a fixed width
fixedHeight=130 // set a fixed height
spacerWidth=5 // space between images

autoWidth=0 // 0 = no, 1 = yes, sets the width to the widest image size

defaultSpeed=426
maxSpeed=50

popupLeft= 100 // pixels
popupTop= 100 // pixels

totalWidth=0
displayWidth=0
displayHeight=0
speed=defaultSpeed

preload=[]

for(var i=0;i<is1hArr.length;i++){
preload[i]=[]

for(var j=0;j<is1hArr[i].length;j++){
preload[i][j]=new Image()
preload[i][j].src=is1hArr[i][j]
}

}

function initHS1(){
imgBox=document.getElementById("image_box")
imgNum=is1hArr.length

if(document.getElementById&&document.all&&document.compatMode!="CSS1Compat"){
ieBorder=parseInt(document.getElementById("inner_box").style.borderWidth)*2
}
else{
ieBorder=0
}

for(var i=0;i<imgNum;i++){ // set image size

newImg=document.createElement("IMG")
newImg.setAttribute("src",is1hArr[i][0])
newImg.setAttribute("id","pic"+i)
newImg.i=i

//newImg.onclick=function(){getBigPic(this.i)}

newImg.onmouseover=function(){toggleOpac(this)}
newImg.onmouseout=function(){toggleOpac(this)}

if(imageSize!=0){ // use percentage size

//newImg.style.width=preload[i][0].width/100*imageSize+"px"
//newImg.style.height=preload[i][0].height/100*imageSize+"px"

newImg.style.width="100px"
newImg.style.height="104px"

}
else{ // use fixed size
newImg.style.width=fixedWidth+"px"
newImg.style.height=fixedHeight+"px"
}

imgBox.appendChild(newImg)

}

for(var i=0;i<imgNum;i++){
totalWidth+=(document.getElementById("pic"+i).offsetWidth)
document.getElementById("pic"+i).style.marginRight=spacerWidth+"px"

if(autoWidth==1){
if(document.getElementById("pic"+i).offsetWidth>displayWidth){
displayWidth=document.getElementById("pic"+i).offsetWidth
}

}
else{
displayWidth=parseInt(document.getElementById("inner_box").style.width)
}

if(document.getElementById("pic"+i).offsetHeight>displayHeight){
displayHeight=document.getElementById("pic"+i).offsetHeight
}

}

for(var i=0;i<imgNum;i++){ // vertically center images
document.getElementById("pic"+i).style.marginBottom=(displayHeight-document.getElementById("pic"+i).height)/2+"px"
}

totalWidth=totalWidth+(imgNum*spacerWidth)

imgHolderWidth=displayWidth+ieBorder
document.getElementById("outer_box").style.width=imgHolderWidth+"px"
document.getElementById("inner_box").style.width=imgHolderWidth+"px"
imgBox.style.width=totalWidth+"px"

imgHolderHeight=displayHeight+ieBorder
document.getElementById("inner_box").style.height=imgHolderHeight+"px" 
document.getElementById("inner_box").style.clip="rect(0,"+(imgHolderWidth+"px")+","+(imgHolderHeight+"px")+",0)"

}

leftTimer=""
function scrollHS1(n){

//clearTimeout(leftTimer)

imgBoxPos=parseInt(imgBox.style.left)

if(n==1){
imgBoxPos-=speed
//alert(imgBoxPos);
}
else{
imgBoxPos+=speed
}

imgBox.style.left=imgBoxPos+"px"
leftTimer=setTimeout("scrollHS1("+n+")",50)

if(n==1&&imgBoxPos< -(totalWidth-imgHolderWidth)+(spacerWidth-ieBorder)){
imgBox.style.left=-(totalWidth-imgHolderWidth)+spacerWidth-ieBorder+"px"
clearTimeout(leftTimer)
}
//imgBox.style.left=-imgBoxPos+"px"
clearTimeout(leftTimer)

if(n==0&&imgBoxPos> 0-speed){
imgBox.style.left=0
clearTimeout(leftTimer)
}

}

function fast(){
speed=maxSpeed
}

function slow(){
speed=defaultSpeed
}

function pause(){
clearTimeout(leftTimer)
}

picWin=null

function getBigPic(p){
if(is1hArr[p]&&is1hArr[p]!=""){

bigImg=new Image()
bigImg.src=is1hArr[p][1]

data="\n<center>\n<img src='"+bigImg.src+"'>\n</center>\n"

if(picWin){picWin.close()} // if window exists close it

winProps = "left= "+popupLeft+", top = "+popupTop+", width="+(bigImg.width+20)+", height="+(bigImg.height+20)+", scrollbars=no, resizable=yes, status=no" 
picWin=window.open("","win1",winProps)
picWin.document.write("<HTML>\n<HEAD>\n<TITLE><\/TITLE>\n")
picWin.document.write("<\/HEAD>\n")
picWin.document.write("<BODY style='background-color:black;margin-top:10px;margin-left:10px'>\n")
picWin.document.write("<div id=\"display\">"+data+"<\/div>")
picWin.document.write("\n<\/BODY>\n<\/HTML>")
picWin.document.close()
}
}

maxOpac=100
minOpac=70

maxOpac1=70
minOpac1=100

function toggleOpac(obj){

if(obj.filters){
//if(obj.filters.alpha.Opacity==minOpac)
if(obj.style.filter=="alpha(opacity:"+minOpac+")")
{
	//obj.filters.alpha.Opacity=maxOpac
	obj.style.filter = "alpha(opacity:"+maxOpac+")"
}
else
{
	//obj.filters.alpha.Opacity=minOpac
	obj.style.filter = "alpha(opacity:"+minOpac+")"
}

}
else{

if(obj.style.opacity == maxOpac1/100){
obj.style.opacity = minOpac1/100}
else{obj.style.opacity = maxOpac1/100}

}

}

// IE/Win
//  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
//  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
//  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
//  obj.style.opacity = opacity/100;


