﻿function showImageBox() {
    document.getElementById('ImageBox').style.visibility = 'visible'
}

function hideImageBox() {
    document.getElementById('ImageBox').style.visibility = 'hidden'
}
   
function DelValue(id) {
    if (document.getElementById(id).value == "Name Betrieb") {
        document.getElementById(id).value = "";
    }
}
      
hs.graphicsDir = '/highslide/graphics/';
hs.align = 'center';
hs.showCredits = false;
hs.transitions = ['expand', 'crossfade'];
hs.wrapperClassName = 'wide-border';
hs.fadeInOut = true;
hs.dimmingOpacity = 0.5;

// Add the controlbar
hs.addSlideshow({
	slideshowGroup: 'gallery',
	interval: 5000,
	repeat: true,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .75,
		position: 'bottom center',
		hideOnMouseOut: true
	}

});
// Add the controlbar
hs.addSlideshow({
	slideshowGroup: 'CompanyGallery',
	interval: 5000,
	repeat: true,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .75,
		position: 'bottom center',
		hideOnMouseOut: true
	}

});

var defaultImage = "/images/bilder/ortschaften/sueden-suedtirols-small.jpg";

function SetImage( id, _Image )
{
    var Image = _Image;
    var NewSrc = "/images/bilder/ortschaften/" + Image + "-small.jpg";
    var NewTxt = id.title;

    if (Image == null)
    {
        NewSrc = defaultImage;
        NewTxt = document.getElementById('BigImage').title;
    }                
    
    document.getElementById('BigImage').src = NewSrc;
    document.getElementById('BigText').innerHTML = NewTxt;
}

function SetThema( id, _Image )
{
    var Image = _Image;
    var NewSrc = "/images/bilder/" + Image + ".jpg";
    var NewTxt = id.title;

    if (Image == null)
    {
        NewSrc = defaultImage;
        NewTxt = document.getElementById('BigThema').title;
    }                
    
    document.getElementById('BigThema').src = NewSrc;
}

var $j=jQuery.noConflict();

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();

$j(document).ready(function() {
              
        if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod') {
            $j(document).scroll(function() {

              //$j(".downfix").css("position", "static");
              $j(".downfix").css("top",$j(document).scrollTop() + $j(window).height() - 40);
                  });

        }

    $j('#slideshow').after('<div id="pager">').cycle({
        fx:     'scrollHorz',
        speed:   1000,
        timeout: 4500,
        pager:  '#pager',
        pauseOnPagerHover: true,
        before: function() { if (window.console) console.log(this.src); }
    });



    $j('#gallery').after('<p id="pagerGallery">').cycle({
        fx:     'fade',
        speed:   2000,
        timeout: 8000,
        pager:  '#pagerGallery',
        pauseOnPagerHover: true,
        //before: function() { if (window.console) console.log(this.src);
        
        
          // callback fn that creates a thumbnail to use as pager anchor 
        pagerAnchorBuilder: function(idx, slide) { 
            if ((idx+1) % 4) {
                return '<a href="#"><img alt="" src="' + jQuery(slide).find('img').attr('src') + '" style="width: 50px; height:auto;" /></a>'; 
            } else {
                return '<a href="#" style="margin-right: 0px;"><img alt="" src="' + jQuery(slide).find('img').attr('src') + '" style="width: 50px; height:auto;" /></a>'; 
            }
        }
    });
    
    $j('#CityList').selectbox();
    $j('#CategoryList').selectbox();
    $j('#Stars').selectbox();

     $j("#ImageBox").click(function (event) {
        event.preventDefault();
        //var target = $j("#ImageBox a").attr("href");
        $j('html,body').animate({scrollTop: 500}, 800);
    });

});
          
