<!--
//Jeff
// www.huntingground.freeserve.co.uk

hs6Arr=[
//["thumb1.jpg","bigpic1.jpg","Alt Text 1","text box text","Bild-Unterschrift für bigpic"],

["Showroom/showroom_scrollbar_start-stop-marker_thumb.jpg","Showroom/showroom_scrollbar_start-stop-marker.gif","","",""],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_001_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_001.jpg","","","n.n.<br><br>Öl auf Leinwand / -- &times; -- cm"],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_002_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_002.jpg","","","n.n.<br><br>Öl auf Leinwand / -- &times; -- cm"],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_003_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_003.jpg","","","n.n.<br><br>Öl auf Leinwand / -- &times; -- cm"],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_004_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_004.jpg","","","Mujer sobre fondo verde (Clair)<br><br>Öl und Alkyd auf Leinwand<br>2008<br>50 &times; 89 cm"],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_478_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_478.jpg","","","n.n.<br><br>Öl auf Leinwand / -- &times; -- cm"],
["Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_485_thumb.jpg","Showroom/Alejandro_Decinti/alejandro_decinti_-_showroom_Galerie_485.jpg","","","n.n.<br><br>Öl auf Leinwand / -- &times; -- cm"]


/*
["pic01.jpg","pic01.jpg","Alt Text 1","Display text over these images. This text box is always positioned at the bottom"],
["pic02.jpg","pic02.jpg","","The height of the text box adjusts to the amount of text shown. If there is no text this box does not appear"],
["pic03.jpg","pic03.jpg","","All appears to be working fine in IE and Firefox"],
["pic04.jpg","pic04.jpg","","Have taken into account if a border is used on these images and if a border and/or padding is used on the text div"],
["pic05.jpg","pic05.jpg","","Have fun "]
["pic06.jpg","pic06.jpg","Alt Text 6",""],
["pic07.jpg","pic07.jpg","Alt Text 7",""],
["pic08.jpg","pic08.jpg","Alt Text 8",""],
["pic09.jpg","pic09.jpg","Alt Text 9",""],
["pic10.jpg","pic10.jpg","Alt Text 10",""] // no comma at end of last index
*/
]

dir=0 		// 0 = left 1 = right
speed=1

imageSize=80  	// % set to zero to use fixedWidth and fixedHeight values

fixedWidth=200 	// set a fixed width
fixedHeight=200	// set a fixed height
spacerWidth=15 	// space between images
dualFade=0 	// 0 = fades in, 1 = fades out then in

biggest=0
scrollBoxBorder=0
totalWidth=0
hs6Timer=null

lastN=0
count=0
fading=0
fadeStep = 2
fadeSpeed=10
minFadeValue=0

preload=new Array()
for(var i=0;i<hs6Arr.length;i++){
   preload[i]=[]

   for(var j=0;j<2;j++){
      preload[i][j]=new Image()
      preload[i][j].src=hs6Arr[i][j]
   }

}

function initHS6(){
   scrollBox=document.getElementById("scroll_box")
   scroll1=document.getElementById("scroller1")
   //alert(preload[0][0].src)
   for(var k=0;k<hs6Arr.length;k++){

      scroll1.innerHTML+='<img id="pic'+k+'" src="'+preload[k][0].src+'" alt="'+hs6Arr[k][2]+'" title="'+hs6Arr[k][2]+'" onclick="initFade('+k+')" onmouseover="showTxt(this,this.offsetParent.id,'+k+')" onmouseout="hideTxt(event)">'

      if(imageSize!=0){ // use percentage size
         newWidth=preload[k][0].width/100*imageSize
         newHeight=preload[k][0].height/100*imageSize
      }
      else{ // use fixed size
         newWidth=fixedWidth
         newHeight=fixedHeight
      }

      document.getElementById("pic"+k).style.width=newWidth+"px"
      document.getElementById("pic"+k).style.height=newHeight+"px"

      if(document.getElementById("pic"+k).offsetHeight>biggest){
         biggest=document.getElementById("pic"+k).offsetHeight
      }

      document.getElementById("pic"+k).style.marginLeft=spacerWidth+"px"
      totalWidth+=document.getElementById("pic"+k).offsetWidth+spacerWidth
   }

   totalWidth+=1

   for(var l=0;l<hs6Arr.length;l++){ // vertically center images
      document.getElementById("pic"+l).style.marginBottom = (biggest-document.getElementById("pic"+l).offsetHeight)/2+"px"
   }

   if(scrollBox.currentStyle&&!window.opera&&document.compatMode!="CSS1Compat"){
      scrollBoxBorder=parseInt(scrollBox.currentStyle.borderWidth)*2;
   }

   // ggf. "scrollBoxBorder+80", damit der OnMouseOver-Text weiter runter geschoben werden kann
   // Bei schmalen Bildern überdeckt der sonst das ganze Bild und man kann
   // nicht drauf klicken!
   scrollBox.style.height=biggest+scrollBoxBorder+"px";		

   scroll1.style.width=totalWidth+"px";
   scroll2=document.getElementById("scroller2");
   scroll2.innerHTML=scroll1.innerHTML;
   scroll2.style.left= scroll1.offsetWidth+"px";
   scroll2.style.top= 0+"px"; //-scroll1.offsetHeight+"px"
   scroll2.style.width=totalWidth+"px";

   if(dir==1){
      speed= -speed
   }

   scrollHS6()
}

function scrollHS6(){
   clearTimeout(hs6Timer)
   scroll1Pos=parseInt(scroll1.style.left)
   scroll2Pos=parseInt(scroll2.style.left)
   scroll1Pos-=speed
   scroll2Pos-=speed
   scroll1.style.left=scroll1Pos+"px"
   scroll2.style.left=scroll2Pos+"px"
   hs6Timer=setTimeout("scrollHS6()",50)

   if(dir==0){
      if(scroll1Pos< -scroll1.offsetWidth){
         scroll1.style.left=scroll1.offsetWidth+"px"
      }

      if(scroll2Pos< -scroll1.offsetWidth){
         scroll2.style.left=scroll1.offsetWidth+"px"
      }
   }

   if(dir==1){
      if(scroll1Pos>parseInt(scrollBox.style.width)){
         scroll1.style.left=scroll2Pos+ (-scroll1.offsetWidth)+"px"
      }

      if(scroll2Pos>parseInt(scrollBox.style.width)){
         scroll2.style.left=scroll1Pos+ (-scroll2.offsetWidth)+"px"
      }
   }

}

st=null

function pause(){
   clearTimeout(hs6Timer)
   clearTimeout(st)
}

function reStartHS6(){
   clearTimeout(st)
   st=setTimeout("scrollHS6()",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=hs6Arr[picNum][1]
   }

   if(fadeValue>=100){ // fade in
      fadeValue=100
      fadeStep= -fadeStep
      fading=0
      clearTimeout(fadeTimer)
   }
   
   // Bild-Unterschrift setzen
   document.getElementById("BildUnterschrift").innerHTML=hs6Arr[picNum][4];
}

function showTxt(obj,objParentID,num){
   if(hs6Arr[num][3]==""){return}

   imgTxt=document.getElementById("imgtxt")
   imgParent=document.getElementById(objParentID)

   imgTxt.innerHTML=hs6Arr[num][3]

   scrollBoxBorder=0
   imageBorder=0

   txtBorder=0
   txtPadding=0

   if(document.uniqueID && document.getElementById("pic"+num).currentStyle){ // ie
      imageBorder=parseInt(document.getElementById("pic"+num).currentStyle.borderWidth)
      //txtPadding=parseInt(imgTxt.currentStyle.paddingLeft) // uncomment for doctype
   }

   if(window.getComputedStyle){
      scrollBoxBorder=parseInt(document.defaultView.getComputedStyle(scrollBox, '').getPropertyValue("border-top-width"))

      scrollBoxBorder=(/firefox/i.test(navigator.userAgent)?scrollBoxBorder:(window.opera?-scrollBoxBorder:0))

      imageBorder=parseInt(document.defaultView.getComputedStyle(document.getElementById("pic"+num), '').getPropertyValue("border-top-width"))
      txtPadding=parseInt(document.defaultView.getComputedStyle(imgTxt, '').getPropertyValue("padding-top"))
      txtBorder=parseInt(document.defaultView.getComputedStyle(imgTxt, '').getPropertyValue("border-top-width"))

   }

   imgTxt.style.display="block"
   imgTxt.style.width=obj.offsetWidth-(imageBorder*2)-(txtPadding*2)-(txtBorder*2)+"px"

   imgTxt.style.left=obj.offsetLeft+imgParent.offsetLeft+scrollBoxBorder+imageBorder+"px"
   imgTxt.style.top=(obj.offsetTop+imgParent.offsetTop)+obj.offsetHeight-imgTxt.offsetHeight+scrollBoxBorder-imageBorder+"px"		// ggf. "offsetTop+80", damit der OnMouseOver-Text weiter unten steht
   																	// Bei schmalen Bildern überdeckt der sonst das ganze Bild und man kann
																	// nicht drauf klicken!

}

function hideTxt(e){
   if(e.toElement&&event.toElement.id!="imgtxt"){
      imgTxt.style.display="none"
   }

   if(e.relatedTarget&&e.relatedTarget.id!="imgtxt"){
      imgTxt.style.display="none"
   }
}


// -->

